@local-civics/mgmt-ui 0.1.61 → 0.1.63

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/index.d.ts CHANGED
@@ -1,6 +1,68 @@
1
1
  export { showNotification, updateNotification } from '@mantine/notifications';
2
2
  import * as React from 'react';
3
3
 
4
+ /**
5
+ * NavbarProps
6
+ */
7
+ interface NavbarProps {
8
+ active: string;
9
+ navigate: (to: string) => void;
10
+ onLogout: () => void;
11
+ onSwitchAccounts?: () => void;
12
+ }
13
+ /**
14
+ * Navbar
15
+ * @param props
16
+ * @constructor
17
+ */
18
+ declare const Navbar: (props: NavbarProps) => JSX.Element;
19
+
20
+ /**
21
+ * NavbarProps
22
+ */
23
+ interface NestedNavbarProps {
24
+ active: string;
25
+ version: string;
26
+ image: string;
27
+ name: string;
28
+ email: string;
29
+ links: Record<string, {
30
+ notifications: number;
31
+ href: string;
32
+ hidden?: boolean;
33
+ }>;
34
+ onLogout: () => void;
35
+ onSwitchAccounts?: () => void;
36
+ }
37
+ declare function NestedNavbar(props: NestedNavbarProps): JSX.Element;
38
+
39
+ /**
40
+ * AccountItem
41
+ */
42
+ type AccountItem = {
43
+ accountId: string;
44
+ name: string;
45
+ isAdmin?: boolean;
46
+ isGroupAdmin?: boolean;
47
+ };
48
+ /**
49
+ * SwitchAccountProps
50
+ */
51
+ type SwitchAccountProps = {
52
+ opened: boolean;
53
+ account: string;
54
+ loading: boolean;
55
+ accounts: AccountItem[];
56
+ onClick: (account: string) => void;
57
+ onClose: () => void;
58
+ };
59
+ /**
60
+ * SwitchAccount
61
+ * @param props
62
+ * @constructor
63
+ */
64
+ declare const SwitchAccount: (props: SwitchAccountProps) => JSX.Element;
65
+
4
66
  /**
5
67
  * Item
6
68
  */
@@ -8,6 +70,7 @@ interface Item$i {
8
70
  lessonName: string;
9
71
  completion: number;
10
72
  isStarted?: boolean;
73
+ href: string;
11
74
  }
12
75
 
13
76
  /**
@@ -29,6 +92,7 @@ interface Item$g {
29
92
  lessonId: string;
30
93
  lessonName: string;
31
94
  percentageCompletion: number;
95
+ href: string;
32
96
  }
33
97
 
34
98
  /**
@@ -54,11 +118,9 @@ type BadgeProps = {
54
118
  lessons: Item$g[];
55
119
  classId: string;
56
120
  students: BadgeUserItem[];
121
+ href: string;
57
122
  onBackClick: () => void;
58
123
  onClassChange: (classId: string) => void;
59
- onPreviewClick: () => void;
60
- onUserClick: (user: BadgeUserItem) => void;
61
- onLessonClick: (lesson: Item$g) => void;
62
124
  onCopyLinkClick: () => void;
63
125
  onExportDataClick: () => void;
64
126
  };
@@ -76,6 +138,7 @@ interface Item$f {
76
138
  badgeId: string;
77
139
  name: string;
78
140
  description: string;
141
+ href: string;
79
142
  }
80
143
 
81
144
  /**
@@ -89,7 +152,6 @@ type BadgesProps = {
89
152
  loading: boolean;
90
153
  badges: BadgeItem[];
91
154
  onAutocompleteChange: (value: string) => void;
92
- onBadgeClick: (badge: BadgeItem) => void;
93
155
  };
94
156
  /**
95
157
  * Badges
@@ -184,7 +246,7 @@ declare const Dashboard: (props: DashboardProps) => JSX.Element;
184
246
  */
185
247
  type Item$9 = {
186
248
  classId: string;
187
- studentId: string;
249
+ userId: string;
188
250
  avatar: string;
189
251
  email: string;
190
252
  givenName: string;
@@ -194,12 +256,14 @@ type Item$9 = {
194
256
  hasAccount: boolean;
195
257
  badgesEarned: number;
196
258
  lessonsCompleted: number;
259
+ isAdmin: boolean;
260
+ href: string;
197
261
  };
198
262
 
199
263
  /**
200
- * StudentItem
264
+ * MemberItem
201
265
  */
202
- type StudentItem = Item$9;
266
+ type MemberItem = Item$9;
203
267
  /**
204
268
  * ClassProps
205
269
  */
@@ -207,15 +271,15 @@ type ClassProps = {
207
271
  loading: boolean;
208
272
  displayName: string;
209
273
  description: string;
210
- students: StudentItem[];
274
+ members: MemberItem[];
211
275
  percentageOfAccountsCreated: number;
212
276
  numberOfBadgesEarned: number;
213
277
  numberOfLessonsCompleted: number;
214
278
  withClassLink?: boolean;
215
279
  onBackClick: () => void;
216
- onCreateStudents: (students: StudentItem[]) => void;
217
- onDeleteStudent: (student: StudentItem) => void;
218
- onStudentClick: (student: StudentItem) => void;
280
+ onCreateMembers: (members: MemberItem[]) => void;
281
+ onDeleteMember: (student: MemberItem) => void;
282
+ onChangeUserRole: (user: MemberItem, role: string | null) => void;
219
283
  onCopyLinkClick: () => void;
220
284
  };
221
285
  /**
@@ -229,9 +293,11 @@ declare const Class: (props: ClassProps) => JSX.Element;
229
293
  * Item
230
294
  */
231
295
  type Item$8 = {
296
+ href: string;
232
297
  classId: string;
233
298
  name: string;
234
299
  description: string;
300
+ numberOfStudents: number;
235
301
  };
236
302
 
237
303
  /**
@@ -246,7 +312,7 @@ type ClassesProps = {
246
312
  classes: ClassItem[];
247
313
  onCreateClass: (group: ClassItem) => void;
248
314
  onDeleteClass: (group: ClassItem) => void;
249
- onClassClick: (group: ClassItem) => void;
315
+ onAutocompleteChange: (next: string) => void;
250
316
  };
251
317
  /**
252
318
  * Classes
@@ -262,6 +328,7 @@ interface Item$7 {
262
328
  badgeId: string;
263
329
  badgeName: string;
264
330
  isComplete?: boolean;
331
+ lessons: Item$i[];
265
332
  }
266
333
 
267
334
  /**
@@ -272,6 +339,7 @@ interface Item$6 {
272
339
  lessonName: string;
273
340
  questionName: string;
274
341
  answer: string[];
342
+ href: string;
275
343
  }
276
344
 
277
345
  /**
@@ -282,6 +350,7 @@ interface Item$5 {
282
350
  lessonName: string;
283
351
  reflection: string;
284
352
  rating: number;
353
+ href: string;
285
354
  }
286
355
 
287
356
  /**
@@ -297,9 +366,6 @@ type StudentProps = {
297
366
  answers: Item$6[];
298
367
  reflections: Item$5[];
299
368
  onBackClick: () => void;
300
- onBadgeClick: (item: Item$7) => void;
301
- onAnswerClick: (item: Item$6) => void;
302
- onReflectionClick: (item: Item$5) => void;
303
369
  };
304
370
  declare const Student: (props: StudentProps) => JSX.Element;
305
371
 
@@ -357,6 +423,7 @@ interface Item$2 {
357
423
  answers: Item$3[];
358
424
  isStarted?: boolean;
359
425
  isComplete?: boolean;
426
+ href: string;
360
427
  }
361
428
 
362
429
  /**
@@ -388,6 +455,7 @@ type LessonProps = {
388
455
  loading: boolean;
389
456
  displayName: string;
390
457
  description: string;
458
+ href: string;
391
459
  classId: string;
392
460
  classes: LessonClass[];
393
461
  students: LessonUserItem[];
@@ -395,8 +463,6 @@ type LessonProps = {
395
463
  questions: Item$1[];
396
464
  onBackClick: () => void;
397
465
  onClassChange: (classId: string) => void;
398
- onPreviewClick: () => void;
399
- onUserClick: (user: LessonUserItem) => void;
400
466
  onCopyLinkClick: () => void;
401
467
  onExportDataClick: () => void;
402
468
  };
@@ -414,6 +480,7 @@ interface Item {
414
480
  lessonId: string;
415
481
  name: string;
416
482
  description: string;
483
+ href: string;
417
484
  }
418
485
 
419
486
  /**
@@ -427,7 +494,6 @@ type LessonsProps = {
427
494
  loading: boolean;
428
495
  lessons: LessonItem[];
429
496
  onAutocompleteChange: (next: string) => void;
430
- onLessonClick: (item: LessonItem) => void;
431
497
  };
432
498
  /**
433
499
  * Lessons
@@ -450,46 +516,6 @@ interface AdminProviderProps {
450
516
  */
451
517
  declare const AdminProvider: (props: AdminProviderProps) => JSX.Element;
452
518
 
453
- /**
454
- * AccountItem
455
- */
456
- type AccountItem = {
457
- accountId: string;
458
- name: string;
459
- };
460
- /**
461
- * SwitchAccountProps
462
- */
463
- type SwitchAccountProps = {
464
- opened: boolean;
465
- account: string;
466
- accounts: AccountItem[];
467
- onChange: (account: string) => void;
468
- onClose: () => void;
469
- };
470
- /**
471
- * SwitchAccount
472
- * @param props
473
- * @constructor
474
- */
475
- declare const SwitchAccount: (props: SwitchAccountProps) => JSX.Element;
476
-
477
- /**
478
- * NavbarProps
479
- */
480
- interface NavbarProps {
481
- active: string;
482
- navigate: (to: string) => void;
483
- onLogout: () => void;
484
- onSwitchAccounts?: () => void;
485
- }
486
- /**
487
- * Navbar
488
- * @param props
489
- * @constructor
490
- */
491
- declare const Navbar: (props: NavbarProps) => JSX.Element;
492
-
493
519
  /**
494
520
  * AppProps
495
521
  */
@@ -497,9 +523,9 @@ type AppProps = {
497
523
  loading: boolean;
498
524
  account: string;
499
525
  accounts: AccountItem[];
500
- navbar: React.ReactElement<NavbarProps>;
526
+ navbar: React.ReactElement<NestedNavbarProps>;
501
527
  page: React.ReactNode;
502
- onAccountChange: (account: string) => void;
528
+ onAccountChange: (account: string) => Promise<void>;
503
529
  };
504
530
  /**
505
531
  * App
@@ -508,4 +534,4 @@ type AppProps = {
508
534
  */
509
535
  declare const App: (props: AppProps) => JSX.Element;
510
536
 
511
- export { AccountItem, AdminProvider, AdminProviderProps, App, AppProps, Badge, BadgeClass, BadgeItem, BadgeProps, BadgeUserItem, Badges, BadgesProps, Class, ClassItem, ClassProps, Classes, ClassesProps, Dashboard, DashboardClass, DashboardProps, Home, HomeProps, Lesson, LessonClass, LessonItem, LessonProps, LessonUserItem, Lessons, LessonsProps, Navbar, Student, StudentItem, StudentProps, SwitchAccount };
537
+ export { AccountItem, AdminProvider, AdminProviderProps, App, AppProps, Badge, BadgeClass, BadgeItem, BadgeProps, BadgeUserItem, Badges, BadgesProps, Class, ClassItem, ClassProps, Classes, ClassesProps, Dashboard, DashboardClass, DashboardProps, Home, HomeProps, Lesson, LessonClass, LessonItem, LessonProps, LessonUserItem, Lessons, LessonsProps, MemberItem, Navbar, NavbarProps, NestedNavbar, NestedNavbarProps, Student, StudentProps, SwitchAccount, SwitchAccountProps };