Skip to content

Migrate common UI components to packages/ui #3049

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Jun 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions apps/upskii/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3524,7 +3524,9 @@
"edit_description": "Edit an existing course",
"delete_confirm_title": "Deleting \"{name}\"",
"card_view": "Card View",
"table_view": "Table View"
"table_view": "Table View",
"no_courses_found": "No courses found",
"no_description_provided": "No description provided"
},
"ws-crawlers": {
"plural": "Crawlers",
Expand Down Expand Up @@ -4136,7 +4138,5 @@
"ai_teach_studio": "AI Teaching Studio",
"users": "Users",
"teams": "Teams"
},
"no-courses-found": "No courses found",
"no-description-provided": "No description provided"
}
}
10 changes: 5 additions & 5 deletions apps/upskii/messages/vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -3522,10 +3522,12 @@
"edit": "Chỉnh sửa khóa học",
"name": "Tên khóa học",
"edit_description": "Chỉnh sửa khóa học hiện có",
"delete_confirm_title": "Xác nhận xoá \"{name}\"",
"course_description": "Mô tả khóa học",
"card_view": "Dạng thẻ",
"table_view": "Dạng bảng"
"table_view": "Dạng bảng",
"no_courses_found": "Chưa có khóa học nào",
"no_description_provided": "Không có mô tả",
"delete_confirm_title": "Xác nhận xoá \"{name}\""
},
"ws-crawlers": {
"plural": "Công cụ cào dữ liệu",
Expand Down Expand Up @@ -4131,7 +4133,5 @@
"empty_state_description": "Hoàn thành các khóa học để giành chứng chỉ và thể hiện thành tích của bạn.",
"browse_courses": "Xem các khóa học",
"certified": "Được chứng nhận"
},
"no-courses-found": "Chưa có khóa học nào",
"no-description-provided": "Không có mô tả"
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use client';

import { WorkspaceCourseModuleRowActions } from './row-actions';
import { ColumnDef } from '@tanstack/react-table';
import { WorkspaceCourseModule } from '@tuturuuu/types/db';
import { WorkspaceCourseModuleRowActions } from '@tuturuuu/ui/custom/education/modules/course-module-row-actions';

Check warning on line 5 in apps/upskii/src/app/[locale]/(dashboard)/[wsId]/courses/[courseId]/columns.tsx

View check run for this annotation

Codecov / codecov/patch

apps/upskii/src/app/[locale]/(dashboard)/[wsId]/courses/[courseId]/columns.tsx#L5

Added line #L5 was not covered by tests
import { DataTableColumnHeader } from '@tuturuuu/ui/custom/tables/data-table-column-header';
import { Check, X } from '@tuturuuu/ui/icons';
import moment from 'moment';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import { createClient } from '@tuturuuu/supabase/next/server';
import { UserGroup } from '@tuturuuu/types/primitives/UserGroup';
import FeatureSummary from '@tuturuuu/ui/custom/feature-summary';
import { GraduationCap } from '@tuturuuu/ui/icons';
import { CourseHeader } from '@tuturuuu/ui/custom/education/courses/course-header';

Check warning on line 3 in apps/upskii/src/app/[locale]/(dashboard)/[wsId]/courses/[courseId]/layout.tsx

View check run for this annotation

Codecov / codecov/patch

apps/upskii/src/app/[locale]/(dashboard)/[wsId]/courses/[courseId]/layout.tsx#L3

Added line #L3 was not covered by tests
import { Separator } from '@tuturuuu/ui/separator';
import { getTranslations } from 'next-intl/server';
import Link from 'next/link';
import { notFound } from 'next/navigation';
import { ReactNode } from 'react';

Expand All @@ -18,29 +15,12 @@
}

export default async function CourseDetailsLayout({ children, params }: Props) {
const t = await getTranslations();
const { wsId, courseId } = await params;
const data = await getData(wsId, courseId);

return (
<>
<FeatureSummary
title={
<h1 className="flex w-full items-center gap-2 text-2xl font-bold">
<div className="flex items-center gap-2 rounded-lg border border-dynamic-blue/20 bg-dynamic-blue/10 px-2 text-lg text-dynamic-blue max-md:hidden">
<GraduationCap className="h-6 w-6" />
{t('ws-courses.singular')}
</div>
<Link
href={`/${wsId}/courses/${courseId}`}
className="line-clamp-1 text-lg font-bold hover:underline md:text-2xl"
>
{data.name || t('common.unknown')}
</Link>
</h1>
}
description={<div>{data.description || t('common.unknown')}</div>}
/>
<CourseHeader data={data} href={`/${wsId}/courses/${courseId}`} />

Check warning on line 23 in apps/upskii/src/app/[locale]/(dashboard)/[wsId]/courses/[courseId]/layout.tsx

View check run for this annotation

Codecov / codecov/patch

apps/upskii/src/app/[locale]/(dashboard)/[wsId]/courses/[courseId]/layout.tsx#L23

Added line #L23 was not covered by tests
<Separator className="my-4" />
{children}
</>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import ModuleContentEditor from './content-editor';
import { createClient } from '@tuturuuu/supabase/next/server';
import { Button } from '@tuturuuu/ui/button';
import FeatureSummary from '@tuturuuu/ui/custom/feature-summary';
import { Goal, Sparkles } from '@tuturuuu/ui/icons';
import { ModuleContentEditor } from '@tuturuuu/ui/text-editor/content-editor';
import { JSONContent } from '@tuturuuu/ui/tiptap';
import { getTranslations } from 'next-intl/server';

Check warning on line 7 in apps/upskii/src/app/[locale]/(dashboard)/[wsId]/courses/[courseId]/modules/[moduleId]/content/page.tsx

View check run for this annotation

Codecov / codecov/patch

apps/upskii/src/app/[locale]/(dashboard)/[wsId]/courses/[courseId]/modules/[moduleId]/content/page.tsx#L5-L7

Added lines #L5 - L7 were not covered by tests

interface Props {
params: Promise<{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import LinkButton from '../../link-button';
import ModuleToggles from './toggles';
import {
createClient,
createDynamicClient,
} from '@tuturuuu/supabase/next/server';
import { WorkspaceCourseModule } from '@tuturuuu/types/db';
import LinkButton from '@tuturuuu/ui/custom/education/modules/link-button';
import { ModuleToggles } from '@tuturuuu/ui/custom/education/modules/module-toggle';
import FeatureSummary from '@tuturuuu/ui/custom/feature-summary';
import {
BookText,
Expand Down Expand Up @@ -41,7 +41,7 @@

const data = await getData(courseId, moduleId);
const resources = await getResources({
path: `${wsId}/courses/${courseId}/modules/${moduleId}/resources/`,
path: `${commonHref}/resources/`,

Check warning on line 44 in apps/upskii/src/app/[locale]/(dashboard)/[wsId]/courses/[courseId]/modules/[moduleId]/layout.tsx

View check run for this annotation

Codecov / codecov/patch

apps/upskii/src/app/[locale]/(dashboard)/[wsId]/courses/[courseId]/modules/[moduleId]/layout.tsx#L44

Added line #L44 was not covered by tests
});
const completionStatus = await getCompletionStatus(moduleId);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { CourseSection } from '../../section';
import ClientFlashcards from './flashcards/client-flashcards';
import ClientQuizzes from './quizzes/client-quizzes';
import FileDisplay from './resources/file-display';
import { YoutubeEmbed } from './youtube-links/embed';
import { extractYoutubeId } from '@/utils/url-helper';
import {
createClient,
createDynamicClient,
} from '@tuturuuu/supabase/next/server';
import { WorkspaceCourseModule } from '@tuturuuu/types/db';
import { Accordion } from '@tuturuuu/ui/accordion';
import { CourseSection } from '@tuturuuu/ui/custom/education/modules/content-section';
import { FileDisplay } from '@tuturuuu/ui/custom/education/modules/resources/file-display';
import { YoutubeEmbed } from '@tuturuuu/ui/custom/education/modules/youtube/embed';

Check warning on line 12 in apps/upskii/src/app/[locale]/(dashboard)/[wsId]/courses/[courseId]/modules/[moduleId]/page.tsx

View check run for this annotation

Codecov / codecov/patch

apps/upskii/src/app/[locale]/(dashboard)/[wsId]/courses/[courseId]/modules/[moduleId]/page.tsx#L10-L12

Added lines #L10 - L12 were not covered by tests
import {
BookText,
Goal,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import DeleteResourceButton from './delete-resource';
import FileDisplay from './file-display';
import { StorageObjectForm } from '@/app/[locale]/(dashboard)/[wsId]/drive/form';
import { createDynamicClient } from '@tuturuuu/supabase/next/server';
import { DeleteResourceButton } from '@tuturuuu/ui/custom/education/modules/resources/delete-resource';
import { FileDisplay } from '@tuturuuu/ui/custom/education/modules/resources/file-display';
import { StorageObjectForm } from '@tuturuuu/ui/custom/education/modules/resources/file-upload-form';

Check warning on line 4 in apps/upskii/src/app/[locale]/(dashboard)/[wsId]/courses/[courseId]/modules/[moduleId]/resources/page.tsx

View check run for this annotation

Codecov / codecov/patch

apps/upskii/src/app/[locale]/(dashboard)/[wsId]/courses/[courseId]/modules/[moduleId]/resources/page.tsx#L2-L4

Added lines #L2 - L4 were not covered by tests
import FeatureSummary from '@tuturuuu/ui/custom/feature-summary';
import { Paperclip } from '@tuturuuu/ui/icons';
import { Separator } from '@tuturuuu/ui/separator';
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import DeleteLinkButton from './delete-link';
import { YoutubeEmbed } from './embed';
import YouTubeLinkForm from './form';
import { extractYoutubeId } from '@/utils/url-helper';
import { createClient } from '@tuturuuu/supabase/next/server';
import DeleteLinkButton from '@tuturuuu/ui/custom/education/modules/youtube/delete-link-button';
import { YoutubeEmbed } from '@tuturuuu/ui/custom/education/modules/youtube/embed';
import YouTubeLinkForm from '@tuturuuu/ui/custom/education/modules/youtube/form';

Check warning on line 5 in apps/upskii/src/app/[locale]/(dashboard)/[wsId]/courses/[courseId]/modules/[moduleId]/youtube-links/page.tsx

View check run for this annotation

Codecov / codecov/patch

apps/upskii/src/app/[locale]/(dashboard)/[wsId]/courses/[courseId]/modules/[moduleId]/youtube-links/page.tsx#L3-L5

Added lines #L3 - L5 were not covered by tests
import FeatureSummary from '@tuturuuu/ui/custom/feature-summary';
import { Youtube } from '@tuturuuu/ui/icons';
import { Separator } from '@tuturuuu/ui/separator';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { getWorkspaceCourseModuleColumns } from './columns';
import CourseModuleForm from './form';
import { CustomDataTable } from '@/components/custom-data-table';
import { createClient } from '@tuturuuu/supabase/next/server';
import { WorkspaceCourseModule } from '@tuturuuu/types/db';
import { Database } from '@tuturuuu/types/supabase';
import { Button } from '@tuturuuu/ui/button';
import { CourseModuleForm } from '@tuturuuu/ui/custom/education/modules/course-module-form';

Check warning on line 7 in apps/upskii/src/app/[locale]/(dashboard)/[wsId]/courses/[courseId]/page.tsx

View check run for this annotation

Codecov / codecov/patch

apps/upskii/src/app/[locale]/(dashboard)/[wsId]/courses/[courseId]/page.tsx#L7

Added line #L7 was not covered by tests
import FeatureSummary from '@tuturuuu/ui/custom/feature-summary';
import { Separator } from '@tuturuuu/ui/separator';
import { getTranslations } from 'next-intl/server';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use client';

import { WorkspaceCourseRowActions } from './row-actions';
import { ColumnDef } from '@tanstack/react-table';
import { WorkspaceCourse } from '@tuturuuu/types/db';
import { WorkspaceCourseRowActions } from '@tuturuuu/ui/custom/education/courses/course-row-actions';
import { DataTableColumnHeader } from '@tuturuuu/ui/custom/tables/data-table-column-header';
import moment from 'moment';
import Link from 'next/link';

Check warning on line 8 in apps/upskii/src/app/[locale]/(dashboard)/[wsId]/courses/columns.tsx

View check run for this annotation

Codecov / codecov/patch

apps/upskii/src/app/[locale]/(dashboard)/[wsId]/courses/columns.tsx#L5-L8

Added lines #L5 - L8 were not covered by tests

export const getWorkspaceCourseColumns = (
t: any,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { CourseCardView } from './card-view';
import { getWorkspaceCourseColumns } from './columns';
import { CoursePagination } from './course-pagination';
import CourseForm from './form';
import { ViewToggle } from './view-toggle';
//import { mockData } from './mock/mock-courses';
import { CustomDataTable } from '@/components/custom-data-table';
import { createClient } from '@tuturuuu/supabase/next/server';
import { WorkspaceCourse } from '@tuturuuu/types/db';
import { CourseCardView } from '@tuturuuu/ui/custom/education/courses/course-card-view';
import { CourseForm } from '@tuturuuu/ui/custom/education/courses/course-form';
import { CoursePagination } from '@tuturuuu/ui/custom/education/courses/course-pagination';
import FeatureSummary from '@tuturuuu/ui/custom/feature-summary';
import { ViewToggle } from '@tuturuuu/ui/custom/view-toggle';

Check warning on line 10 in apps/upskii/src/app/[locale]/(dashboard)/[wsId]/courses/page.tsx

View check run for this annotation

Codecov / codecov/patch

apps/upskii/src/app/[locale]/(dashboard)/[wsId]/courses/page.tsx#L10

Added line #L10 was not covered by tests
import { Separator } from '@tuturuuu/ui/separator';
import { getTranslations } from 'next-intl/server';

Expand Down
Loading