@hed-hog/lms 0.0.306 → 0.0.309
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/course/course-structure.controller.d.ts +60 -0
- package/dist/course/course-structure.controller.d.ts.map +1 -1
- package/dist/course/course-structure.controller.js +79 -0
- package/dist/course/course-structure.controller.js.map +1 -1
- package/dist/course/course-structure.service.d.ts +61 -1
- package/dist/course/course-structure.service.d.ts.map +1 -1
- package/dist/course/course-structure.service.js +326 -1
- package/dist/course/course-structure.service.js.map +1 -1
- package/dist/course/course.controller.d.ts +52 -4
- package/dist/course/course.controller.d.ts.map +1 -1
- package/dist/course/course.service.d.ts +52 -5
- package/dist/course/course.service.d.ts.map +1 -1
- package/dist/course/course.service.js +78 -57
- package/dist/course/course.service.js.map +1 -1
- package/dist/course/dto/create-course-structure-lesson.dto.d.ts.map +1 -1
- package/dist/course/dto/create-course-structure-lesson.dto.js +5 -1
- package/dist/course/dto/create-course-structure-lesson.dto.js.map +1 -1
- package/dist/course/dto/create-course.dto.d.ts +1 -1
- package/dist/course/dto/create-course.dto.d.ts.map +1 -1
- package/dist/course/dto/create-course.dto.js +4 -1
- package/dist/course/dto/create-course.dto.js.map +1 -1
- package/dist/course/dto/move-lesson.dto.d.ts +10 -0
- package/dist/course/dto/move-lesson.dto.d.ts.map +1 -0
- package/dist/course/dto/move-lesson.dto.js +28 -0
- package/dist/course/dto/move-lesson.dto.js.map +1 -0
- package/dist/course/dto/paste-lessons.dto.d.ts +4 -0
- package/dist/course/dto/paste-lessons.dto.d.ts.map +1 -0
- package/dist/course/dto/paste-lessons.dto.js +24 -0
- package/dist/course/dto/paste-lessons.dto.js.map +1 -0
- package/dist/course/dto/reorder-lessons.dto.d.ts +5 -0
- package/dist/course/dto/reorder-lessons.dto.d.ts.map +1 -0
- package/dist/course/dto/reorder-lessons.dto.js +24 -0
- package/dist/course/dto/reorder-lessons.dto.js.map +1 -0
- package/dist/course/dto/reorder-sessions.dto.d.ts +5 -0
- package/dist/course/dto/reorder-sessions.dto.d.ts.map +1 -0
- package/dist/course/dto/reorder-sessions.dto.js +24 -0
- package/dist/course/dto/reorder-sessions.dto.js.map +1 -0
- package/dist/training/training.controller.js +1 -1
- package/dist/training/training.controller.js.map +1 -1
- package/hedhog/data/image_type.yaml +20 -0
- package/hedhog/data/menu.yaml +2 -2
- package/hedhog/data/route.yaml +60 -6
- package/hedhog/frontend/app/_components/class-form-sheet.tsx.ejs +146 -165
- package/hedhog/frontend/app/_components/course-avatar.tsx.ejs +70 -0
- package/hedhog/frontend/app/_components/course-form-sheet.tsx.ejs +372 -22
- package/hedhog/frontend/app/classes/[id]/page.tsx.ejs +437 -77
- package/hedhog/frontend/app/classes/page.tsx.ejs +311 -289
- package/hedhog/frontend/app/courses/[id]/_components/CourseCertificateCard.tsx.ejs +10 -7
- package/hedhog/frontend/app/courses/[id]/_components/CourseClassificationCard.tsx.ejs +23 -32
- package/hedhog/frontend/app/courses/[id]/_components/CourseContentCard.tsx.ejs +3 -9
- package/hedhog/frontend/app/courses/[id]/_components/CourseDangerZoneCard.tsx.ejs +26 -16
- package/hedhog/frontend/app/courses/[id]/_components/CourseFlagsCard.tsx.ejs +19 -5
- package/hedhog/frontend/app/courses/[id]/_components/CourseMainInfoCard.tsx.ejs +10 -14
- package/hedhog/frontend/app/courses/[id]/_components/CourseMediaCard.tsx.ejs +131 -107
- package/hedhog/frontend/app/courses/[id]/_components/CourseRelationsCard.tsx.ejs +10 -7
- package/hedhog/frontend/app/courses/[id]/_components/CourseSectionCard.tsx.ejs +38 -19
- package/hedhog/frontend/app/courses/[id]/_components/CourseSummaryCard.tsx.ejs +1 -1
- package/hedhog/frontend/app/courses/[id]/_components/course-edit-types.ts.ejs +1 -1
- package/hedhog/frontend/app/courses/[id]/page.tsx.ejs +336 -1057
- package/hedhog/frontend/app/courses/[id]/structure/_components/confirm-dialog.tsx.ejs +45 -0
- package/hedhog/frontend/app/courses/[id]/structure/_components/course-tree-dnd.tsx.ejs +362 -0
- package/hedhog/frontend/app/courses/[id]/structure/_components/course-tree-panel.tsx.ejs +111 -0
- package/hedhog/frontend/app/courses/[id]/structure/_components/course-tree-skeleton.tsx.ejs +64 -0
- package/hedhog/frontend/app/courses/[id]/structure/_components/course-tree.tsx.ejs +134 -0
- package/hedhog/frontend/app/courses/[id]/structure/_components/detail-course.tsx.ejs +113 -0
- package/hedhog/frontend/app/courses/[id]/structure/_components/detail-lesson.tsx.ejs +314 -0
- package/hedhog/frontend/app/courses/[id]/structure/_components/detail-panel.tsx.ejs +62 -0
- package/hedhog/frontend/app/courses/[id]/structure/_components/detail-session.tsx.ejs +174 -0
- package/hedhog/frontend/app/courses/[id]/structure/_components/drag-handle.tsx.ejs +58 -0
- package/hedhog/frontend/app/courses/[id]/structure/_components/drag-overlay.tsx.ejs +52 -0
- package/hedhog/frontend/app/courses/[id]/structure/_components/editor-bulk.tsx.ejs +276 -0
- package/hedhog/frontend/app/courses/[id]/structure/_components/editor-course.tsx.ejs +1216 -0
- package/hedhog/frontend/app/courses/[id]/structure/_components/editor-lesson.tsx.ejs +1827 -0
- package/hedhog/frontend/app/courses/[id]/structure/_components/editor-session.tsx.ejs +443 -0
- package/hedhog/frontend/app/courses/[id]/structure/_components/highlighted-text.tsx.ejs +41 -0
- package/hedhog/frontend/app/courses/[id]/structure/_components/mock-data.ts.ejs +184 -0
- package/hedhog/frontend/app/courses/[id]/structure/_components/multi-select-bar.tsx.ejs +264 -0
- package/hedhog/frontend/app/courses/[id]/structure/_components/search-filter.tsx.ejs +96 -0
- package/hedhog/frontend/app/courses/[id]/structure/_components/session-picker-dialog.tsx.ejs +74 -0
- package/hedhog/frontend/app/courses/[id]/structure/_components/shortcuts-help.tsx.ejs +136 -0
- package/hedhog/frontend/app/courses/[id]/structure/_components/sortable-tree-row.tsx.ejs +80 -0
- package/hedhog/frontend/app/courses/[id]/structure/_components/store.ts.ejs +948 -0
- package/hedhog/frontend/app/courses/[id]/structure/_components/tree-context-menu.tsx.ejs +525 -0
- package/hedhog/frontend/app/courses/[id]/structure/_components/tree-display-settings-popover.tsx.ejs +150 -0
- package/hedhog/frontend/app/courses/[id]/structure/_components/tree-helpers.ts.ejs +182 -0
- package/hedhog/frontend/app/courses/[id]/structure/_components/tree-row-course.tsx.ejs +52 -0
- package/hedhog/frontend/app/courses/[id]/structure/_components/tree-row-lesson.tsx.ejs +271 -0
- package/hedhog/frontend/app/courses/[id]/structure/_components/tree-row-session.tsx.ejs +167 -0
- package/hedhog/frontend/app/courses/[id]/structure/_components/tree-row.tsx.ejs +108 -0
- package/hedhog/frontend/app/courses/[id]/structure/_components/types.ts.ejs +122 -0
- package/hedhog/frontend/app/courses/[id]/structure/_components/use-course-structure-shortcuts.ts.ejs +318 -0
- package/hedhog/frontend/app/courses/[id]/structure/_components/use-tree-display-settings.ts.ejs +97 -0
- package/hedhog/frontend/app/courses/[id]/structure/_data/adapters/course-structure.adapter.ts.ejs +347 -0
- package/hedhog/frontend/app/courses/[id]/structure/_data/course-structure-contract.ts.ejs +195 -0
- package/hedhog/frontend/app/courses/[id]/structure/_data/services/course-structure.service.ts.ejs +420 -0
- package/hedhog/frontend/app/courses/[id]/structure/_data/types/api-course.types.ts.ejs +254 -0
- package/hedhog/frontend/app/courses/[id]/structure/_data/use-course-structure-mutations.ts.ejs +987 -0
- package/hedhog/frontend/app/courses/[id]/structure/_data/use-course-structure-query.ts.ejs +86 -0
- package/hedhog/frontend/app/courses/[id]/structure/_data/use-course-structure.ts.ejs +160 -0
- package/hedhog/frontend/app/courses/[id]/structure/page.tsx.ejs +10 -3212
- package/hedhog/frontend/app/courses/page.tsx.ejs +45 -26
- package/hedhog/frontend/app/{training → paths}/page.tsx.ejs +29 -7
- package/hedhog/frontend/messages/en.json +88 -10
- package/hedhog/frontend/messages/pt.json +88 -10
- package/hedhog/table/course.yaml +1 -1
- package/hedhog/table/image_type.yaml +14 -0
- package/package.json +7 -7
- package/src/course/course-structure.controller.ts +63 -0
- package/src/course/course-structure.service.ts +390 -3
- package/src/course/course.service.ts +59 -27
- package/src/course/dto/create-course-structure-lesson.dto.ts +3 -2
- package/src/course/dto/create-course.dto.ts +4 -1
- package/src/course/dto/move-lesson.dto.ts +17 -0
- package/src/course/dto/paste-lessons.dto.ts +9 -0
- package/src/course/dto/reorder-lessons.dto.ts +10 -0
- package/src/course/dto/reorder-sessions.dto.ts +10 -0
- package/src/training/training.controller.ts +1 -1
|
@@ -1,21 +1,27 @@
|
|
|
1
|
+
import { EntityPicker } from '@/components/ui/entity-picker';
|
|
1
2
|
import {
|
|
2
3
|
FormField,
|
|
3
4
|
FormItem,
|
|
4
5
|
FormLabel,
|
|
5
6
|
FormMessage,
|
|
6
7
|
} from '@/components/ui/form';
|
|
7
|
-
import { EntityPicker } from '@/components/ui/entity-picker';
|
|
8
|
-
import type { UseFormReturn } from 'react-hook-form';
|
|
9
8
|
import { Award } from 'lucide-react';
|
|
9
|
+
import type { UseFormReturn } from 'react-hook-form';
|
|
10
10
|
|
|
11
11
|
import { CourseSectionCard } from './CourseSectionCard';
|
|
12
|
-
import type {
|
|
12
|
+
import type {
|
|
13
|
+
CourseEditFormValues,
|
|
14
|
+
PickerOption,
|
|
15
|
+
TranslationFn,
|
|
16
|
+
} from './course-edit-types';
|
|
13
17
|
|
|
14
18
|
type CourseCertificateCardProps = {
|
|
15
19
|
form: UseFormReturn<CourseEditFormValues>;
|
|
16
20
|
t: TranslationFn;
|
|
17
21
|
options: PickerOption[];
|
|
18
|
-
onCreateTemplate: (
|
|
22
|
+
onCreateTemplate: (
|
|
23
|
+
values: Record<string, string>
|
|
24
|
+
) => Promise<PickerOption | null>;
|
|
19
25
|
};
|
|
20
26
|
|
|
21
27
|
export function CourseCertificateCard({
|
|
@@ -68,9 +74,6 @@ export function CourseCertificateCard({
|
|
|
68
74
|
option.description || option.meta || undefined
|
|
69
75
|
}
|
|
70
76
|
/>
|
|
71
|
-
<p className="text-sm text-muted-foreground">
|
|
72
|
-
{t('form.fields.certificateModel.description')}
|
|
73
|
-
</p>
|
|
74
77
|
<FormMessage />
|
|
75
78
|
</FormItem>
|
|
76
79
|
)}
|
|
@@ -17,10 +17,7 @@ import { Palette, Settings2 } from 'lucide-react';
|
|
|
17
17
|
import type { UseFormReturn } from 'react-hook-form';
|
|
18
18
|
|
|
19
19
|
import { CourseSectionCard } from './CourseSectionCard';
|
|
20
|
-
import type {
|
|
21
|
-
CourseEditFormValues,
|
|
22
|
-
TranslationFn,
|
|
23
|
-
} from './course-edit-types';
|
|
20
|
+
import type { CourseEditFormValues, TranslationFn } from './course-edit-types';
|
|
24
21
|
|
|
25
22
|
type SelectOption = {
|
|
26
23
|
value: string;
|
|
@@ -36,24 +33,18 @@ type CourseClassificationCardProps = {
|
|
|
36
33
|
offeringTypes: readonly SelectOption[];
|
|
37
34
|
};
|
|
38
35
|
|
|
39
|
-
function ColorPreview({
|
|
40
|
-
color,
|
|
41
|
-
label,
|
|
42
|
-
}: {
|
|
43
|
-
color: string;
|
|
44
|
-
label: string;
|
|
45
|
-
}) {
|
|
36
|
+
function ColorPreview({ color, label }: { color: string; label: string }) {
|
|
46
37
|
return (
|
|
47
|
-
<div className="flex items-center gap-2 rounded-
|
|
38
|
+
<div className="flex items-center gap-2 rounded-lg border border-border/60 bg-muted/20 px-2.5 py-1.5">
|
|
48
39
|
<span
|
|
49
|
-
className="h-
|
|
40
|
+
className="h-4 w-4 shrink-0 rounded-full border border-black/10"
|
|
50
41
|
style={{ backgroundColor: color }}
|
|
51
42
|
/>
|
|
52
43
|
<div className="min-w-0">
|
|
53
|
-
<p className="text-[
|
|
44
|
+
<p className="text-[10px] font-medium uppercase tracking-[0.14em] text-muted-foreground">
|
|
54
45
|
{label}
|
|
55
46
|
</p>
|
|
56
|
-
<p className="truncate text-
|
|
47
|
+
<p className="truncate text-xs font-medium text-foreground">{color}</p>
|
|
57
48
|
</div>
|
|
58
49
|
</div>
|
|
59
50
|
);
|
|
@@ -76,7 +67,7 @@ export function CourseClassificationCard({
|
|
|
76
67
|
description="Defina estágio, formato e identidade visual do curso."
|
|
77
68
|
icon={Settings2}
|
|
78
69
|
>
|
|
79
|
-
<div className="grid gap-
|
|
70
|
+
<div className="grid gap-3 md:grid-cols-2 xl:grid-cols-3">
|
|
80
71
|
<FormField
|
|
81
72
|
control={form.control}
|
|
82
73
|
name="nivel"
|
|
@@ -86,7 +77,9 @@ export function CourseClassificationCard({
|
|
|
86
77
|
<Select value={field.value} onValueChange={field.onChange}>
|
|
87
78
|
<FormControl>
|
|
88
79
|
<SelectTrigger className="w-full">
|
|
89
|
-
<SelectValue
|
|
80
|
+
<SelectValue
|
|
81
|
+
placeholder={t('form.fields.level.placeholder')}
|
|
82
|
+
/>
|
|
90
83
|
</SelectTrigger>
|
|
91
84
|
</FormControl>
|
|
92
85
|
<SelectContent>
|
|
@@ -111,7 +104,9 @@ export function CourseClassificationCard({
|
|
|
111
104
|
<Select value={field.value} onValueChange={field.onChange}>
|
|
112
105
|
<FormControl>
|
|
113
106
|
<SelectTrigger className="w-full">
|
|
114
|
-
<SelectValue
|
|
107
|
+
<SelectValue
|
|
108
|
+
placeholder={t('form.fields.status.placeholder')}
|
|
109
|
+
/>
|
|
115
110
|
</SelectTrigger>
|
|
116
111
|
</FormControl>
|
|
117
112
|
<SelectContent>
|
|
@@ -149,10 +144,6 @@ export function CourseClassificationCard({
|
|
|
149
144
|
))}
|
|
150
145
|
</SelectContent>
|
|
151
146
|
</Select>
|
|
152
|
-
<p className="text-sm text-muted-foreground">
|
|
153
|
-
{offeringTypes.find((option) => option.value === watchedOfferingType)
|
|
154
|
-
?.description ?? t('form.fields.offeringType.description')}
|
|
155
|
-
</p>
|
|
156
147
|
<FormMessage />
|
|
157
148
|
</FormItem>
|
|
158
149
|
)}
|
|
@@ -165,18 +156,18 @@ export function CourseClassificationCard({
|
|
|
165
156
|
<FormItem>
|
|
166
157
|
<FormLabel>{t('form.fields.primaryColor.label')}</FormLabel>
|
|
167
158
|
<FormControl>
|
|
168
|
-
<div className="flex items-center gap-
|
|
159
|
+
<div className="flex items-center gap-2 rounded-lg border border-border/60 bg-muted/20 px-2 py-1.5">
|
|
169
160
|
<Input
|
|
170
161
|
type="color"
|
|
171
162
|
value={field.value}
|
|
172
163
|
onChange={field.onChange}
|
|
173
|
-
className="h-
|
|
164
|
+
className="h-8 w-10 cursor-pointer rounded-md border border-border/60 bg-transparent p-0.5"
|
|
174
165
|
/>
|
|
175
166
|
<Input
|
|
176
167
|
value={field.value}
|
|
177
168
|
onChange={field.onChange}
|
|
178
169
|
placeholder={t('form.fields.primaryColor.placeholder')}
|
|
179
|
-
className="font-mono"
|
|
170
|
+
className="h-8 font-mono"
|
|
180
171
|
/>
|
|
181
172
|
</div>
|
|
182
173
|
</FormControl>
|
|
@@ -192,18 +183,18 @@ export function CourseClassificationCard({
|
|
|
192
183
|
<FormItem>
|
|
193
184
|
<FormLabel>{t('form.fields.secondaryColor.label')}</FormLabel>
|
|
194
185
|
<FormControl>
|
|
195
|
-
<div className="flex items-center gap-
|
|
186
|
+
<div className="flex items-center gap-2 rounded-lg border border-border/60 bg-muted/20 px-2 py-1.5">
|
|
196
187
|
<Input
|
|
197
188
|
type="color"
|
|
198
189
|
value={field.value}
|
|
199
190
|
onChange={field.onChange}
|
|
200
|
-
className="h-
|
|
191
|
+
className="h-8 w-10 cursor-pointer rounded-md border border-border/60 bg-transparent p-0.5"
|
|
201
192
|
/>
|
|
202
193
|
<Input
|
|
203
194
|
value={field.value}
|
|
204
195
|
onChange={field.onChange}
|
|
205
196
|
placeholder={t('form.fields.secondaryColor.placeholder')}
|
|
206
|
-
className="font-mono"
|
|
197
|
+
className="h-8 font-mono"
|
|
207
198
|
/>
|
|
208
199
|
</div>
|
|
209
200
|
</FormControl>
|
|
@@ -212,10 +203,10 @@ export function CourseClassificationCard({
|
|
|
212
203
|
)}
|
|
213
204
|
/>
|
|
214
205
|
|
|
215
|
-
<div className="space-y-
|
|
216
|
-
<div className="flex items-center gap-
|
|
217
|
-
<Palette className="h-
|
|
218
|
-
Preview
|
|
206
|
+
<div className="space-y-2 rounded-lg border border-border/60 bg-linear-to-br from-muted/30 to-background p-3">
|
|
207
|
+
<div className="flex items-center gap-1.5 text-xs font-medium text-muted-foreground">
|
|
208
|
+
<Palette className="h-3.5 w-3.5" />
|
|
209
|
+
Preview
|
|
219
210
|
</div>
|
|
220
211
|
<ColorPreview color={watchedPrimary} label="Primária" />
|
|
221
212
|
<ColorPreview color={watchedSecondary} label="Secundária" />
|
|
@@ -23,7 +23,7 @@ export function CourseContentCard({ form }: CourseContentCardProps) {
|
|
|
23
23
|
description="Concentre os textos longos que apoiam venda, orientação pedagógica e publicação."
|
|
24
24
|
icon={FileText}
|
|
25
25
|
>
|
|
26
|
-
<div className="grid gap-
|
|
26
|
+
<div className="grid gap-3">
|
|
27
27
|
<FormField
|
|
28
28
|
control={form.control}
|
|
29
29
|
name="objetivos"
|
|
@@ -33,13 +33,10 @@ export function CourseContentCard({ form }: CourseContentCardProps) {
|
|
|
33
33
|
<FormControl>
|
|
34
34
|
<Textarea
|
|
35
35
|
{...field}
|
|
36
|
-
rows={
|
|
36
|
+
rows={3}
|
|
37
37
|
placeholder="Explique o que o aluno será capaz de fazer ao concluir o curso."
|
|
38
38
|
/>
|
|
39
39
|
</FormControl>
|
|
40
|
-
<p className="text-sm text-muted-foreground">
|
|
41
|
-
Use frases diretas para orientar catálogo, marketing e equipe acadêmica.
|
|
42
|
-
</p>
|
|
43
40
|
<FormMessage />
|
|
44
41
|
</FormItem>
|
|
45
42
|
)}
|
|
@@ -54,13 +51,10 @@ export function CourseContentCard({ form }: CourseContentCardProps) {
|
|
|
54
51
|
<FormControl>
|
|
55
52
|
<Textarea
|
|
56
53
|
{...field}
|
|
57
|
-
rows={
|
|
54
|
+
rows={3}
|
|
58
55
|
placeholder="Descreva para quem este curso foi pensado."
|
|
59
56
|
/>
|
|
60
57
|
</FormControl>
|
|
61
|
-
<p className="text-sm text-muted-foreground">
|
|
62
|
-
Ajuda a alinhar expectativa comercial e segmentação da oferta.
|
|
63
|
-
</p>
|
|
64
58
|
<FormMessage />
|
|
65
59
|
</FormItem>
|
|
66
60
|
)}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { Button } from '@/components/ui/button';
|
|
2
|
+
import {
|
|
3
|
+
Tooltip,
|
|
4
|
+
TooltipContent,
|
|
5
|
+
TooltipProvider,
|
|
6
|
+
TooltipTrigger,
|
|
7
|
+
} from '@/components/ui/tooltip';
|
|
2
8
|
import { AlertTriangle, Trash2 } from 'lucide-react';
|
|
3
9
|
|
|
4
10
|
import { CourseSectionCard } from './CourseSectionCard';
|
|
@@ -21,22 +27,26 @@ export function CourseDangerZoneCard({
|
|
|
21
27
|
className="border-destructive/20"
|
|
22
28
|
contentClassName="pt-0"
|
|
23
29
|
>
|
|
24
|
-
<
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
30
|
+
<TooltipProvider>
|
|
31
|
+
<Tooltip>
|
|
32
|
+
<TooltipTrigger asChild>
|
|
33
|
+
<Button
|
|
34
|
+
type="button"
|
|
35
|
+
variant="destructive"
|
|
36
|
+
size="sm"
|
|
37
|
+
className="gap-2"
|
|
38
|
+
onClick={onDelete}
|
|
39
|
+
>
|
|
40
|
+
<Trash2 className="h-3.5 w-3.5" />
|
|
41
|
+
{t('form.actions.deleteCourse')}
|
|
42
|
+
</Button>
|
|
43
|
+
</TooltipTrigger>
|
|
44
|
+
<TooltipContent side="top" className="max-w-[240px] text-xs">
|
|
45
|
+
Remove o curso, turmas, matrículas e certificados vinculados
|
|
46
|
+
permanentemente.
|
|
47
|
+
</TooltipContent>
|
|
48
|
+
</Tooltip>
|
|
49
|
+
</TooltipProvider>
|
|
40
50
|
</CourseSectionCard>
|
|
41
51
|
);
|
|
42
52
|
}
|
|
@@ -5,6 +5,12 @@ import {
|
|
|
5
5
|
FormLabel,
|
|
6
6
|
} from '@/components/ui/form';
|
|
7
7
|
import { Switch } from '@/components/ui/switch';
|
|
8
|
+
import {
|
|
9
|
+
Tooltip,
|
|
10
|
+
TooltipContent,
|
|
11
|
+
TooltipProvider,
|
|
12
|
+
TooltipTrigger,
|
|
13
|
+
} from '@/components/ui/tooltip';
|
|
8
14
|
import { BadgeCheck } from 'lucide-react';
|
|
9
15
|
import type { UseFormReturn } from 'react-hook-form';
|
|
10
16
|
|
|
@@ -28,11 +34,19 @@ function FlagRow({
|
|
|
28
34
|
onCheckedChange: (value: boolean) => void;
|
|
29
35
|
}) {
|
|
30
36
|
return (
|
|
31
|
-
<div className="flex items-
|
|
32
|
-
<
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
37
|
+
<div className="flex items-center justify-between gap-3 rounded-lg border border-border/60 bg-muted/20 px-3 py-2">
|
|
38
|
+
<TooltipProvider>
|
|
39
|
+
<Tooltip>
|
|
40
|
+
<TooltipTrigger asChild>
|
|
41
|
+
<p className="cursor-default text-sm font-medium text-foreground">
|
|
42
|
+
{title}
|
|
43
|
+
</p>
|
|
44
|
+
</TooltipTrigger>
|
|
45
|
+
<TooltipContent side="right" className="max-w-55 text-xs">
|
|
46
|
+
{description}
|
|
47
|
+
</TooltipContent>
|
|
48
|
+
</Tooltip>
|
|
49
|
+
</TooltipProvider>
|
|
36
50
|
<Switch checked={checked} onCheckedChange={onCheckedChange} />
|
|
37
51
|
</div>
|
|
38
52
|
);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RichTextEditor } from '@/components/rich-text-editor';
|
|
1
2
|
import {
|
|
2
3
|
FormControl,
|
|
3
4
|
FormField,
|
|
@@ -6,7 +7,6 @@ import {
|
|
|
6
7
|
FormMessage,
|
|
7
8
|
} from '@/components/ui/form';
|
|
8
9
|
import { Input } from '@/components/ui/input';
|
|
9
|
-
import { RichTextEditor } from '@/components/rich-text-editor';
|
|
10
10
|
import { Hash, NotebookPen } from 'lucide-react';
|
|
11
11
|
import type { UseFormReturn } from 'react-hook-form';
|
|
12
12
|
|
|
@@ -18,32 +18,31 @@ type CourseMainInfoCardProps = {
|
|
|
18
18
|
t: TranslationFn;
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
export function CourseMainInfoCard({
|
|
22
|
-
form,
|
|
23
|
-
t,
|
|
24
|
-
}: CourseMainInfoCardProps) {
|
|
21
|
+
export function CourseMainInfoCard({ form, t }: CourseMainInfoCardProps) {
|
|
25
22
|
return (
|
|
26
23
|
<CourseSectionCard
|
|
27
24
|
title={t('form.sections.basicInfo')}
|
|
28
25
|
description="Os identificadores e a comunicação principal do curso ficam aqui."
|
|
29
26
|
icon={NotebookPen}
|
|
30
27
|
>
|
|
31
|
-
<div className="grid gap-
|
|
28
|
+
<div className="grid gap-3 md:grid-cols-2">
|
|
32
29
|
<FormField
|
|
33
30
|
control={form.control}
|
|
34
|
-
name="
|
|
31
|
+
name="slug"
|
|
35
32
|
render={({ field }) => (
|
|
36
33
|
<FormItem>
|
|
37
|
-
<FormLabel>{t('form.fields.
|
|
34
|
+
<FormLabel>{t('form.fields.slug.label')}</FormLabel>
|
|
38
35
|
<FormControl>
|
|
39
36
|
<div className="relative">
|
|
40
37
|
<Hash className="pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" />
|
|
41
38
|
<Input
|
|
42
39
|
{...field}
|
|
43
|
-
className="pl-9
|
|
44
|
-
placeholder={t('form.fields.
|
|
40
|
+
className="pl-9 font-mono"
|
|
41
|
+
placeholder={t('form.fields.slug.placeholder')}
|
|
45
42
|
onChange={(event) =>
|
|
46
|
-
field.onChange(
|
|
43
|
+
field.onChange(
|
|
44
|
+
String(event.target.value || '').toLowerCase()
|
|
45
|
+
)
|
|
47
46
|
}
|
|
48
47
|
/>
|
|
49
48
|
</div>
|
|
@@ -100,9 +99,6 @@ export function CourseMainInfoCard({
|
|
|
100
99
|
className="w-full max-w-full"
|
|
101
100
|
/>
|
|
102
101
|
</FormControl>
|
|
103
|
-
<p className="text-sm text-muted-foreground">
|
|
104
|
-
{t('form.fields.description.description')}
|
|
105
|
-
</p>
|
|
106
102
|
<FormMessage />
|
|
107
103
|
</FormItem>
|
|
108
104
|
)}
|