@nualang/nualang-ui-components 0.1.1255 → 0.1.1257

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.
Files changed (174) hide show
  1. package/README.md +64 -64
  2. package/dist/Assignments/AssignmentBotSelection/package.json +6 -6
  3. package/dist/Assignments/AssignmentCard/package.json +6 -6
  4. package/dist/Assignments/AssignmentCardsList/package.json +6 -6
  5. package/dist/Assignments/AssignmentCourseSelection/package.json +6 -6
  6. package/dist/Assignments/AssignmentExerciseSelection/package.json +6 -6
  7. package/dist/Assignments/AssignmentExerciseSelector/package.json +6 -6
  8. package/dist/Assignments/AssignmentRoleplaySelection/package.json +6 -6
  9. package/dist/Assignments/CreateAssignmentDialog/CreateAssignmentDialog.js +111 -39
  10. package/dist/Assignments/CreateAssignmentDialog/package.json +6 -6
  11. package/dist/Assignments/SelectAssignmentTypeDialog/package.json +6 -6
  12. package/dist/Cards/CardElements/CardVisibility/CardVisibility.js +27 -6
  13. package/dist/Cards/Course/Course.js +35 -5
  14. package/dist/Cards/SubscriptionPlan/SubscriptionPlan.js +13 -16
  15. package/dist/Cards/SubscriptionPlan/nuala.svg +28 -28
  16. package/dist/Cards/SubscriptionPlan/plus.svg +4 -4
  17. package/dist/Dialogs/AvatarDialog/AvatarDialog.js +5 -5
  18. package/dist/Dialogs/CreatePhrase/CreatePhrase.js +22 -6
  19. package/dist/Dialogs/GenerateBot/GenerateBot.js +60 -37
  20. package/dist/Dialogs/GeneratePhrases/GeneratePhrases.js +4 -28
  21. package/dist/Dialogs/GenerateQuestion/GenerateQuestion.js +1 -3
  22. package/dist/Dialogs/GenerateRoleplay/GenerateRoleplay.js +23 -11
  23. package/dist/Dialogs/UploadPhrases/UploadPhrases.js +6 -6
  24. package/dist/Dialogs/UploadRoleplayScript/UploadRoleplayScript.js +11 -11
  25. package/dist/Editors/Bot/Editor/BotFlow/BotFlow.js +3 -3
  26. package/dist/Editors/Bot/Editor/Editor.js +1 -2
  27. package/dist/Editors/Phrases/Phrases.js +2 -2
  28. package/dist/Exercises/Bot/Bot.js +3 -3
  29. package/dist/Lists/Categories/package.json +6 -6
  30. package/dist/Misc/AnswerResult/AnswerResult.js +4 -1
  31. package/dist/Misc/AxiosRestExample/AxiosRestExample.js +3 -3
  32. package/dist/Misc/AxiosRestExample/AxiosRestPostExample.js +6 -6
  33. package/dist/Misc/ColorLinearProgress/package.json +6 -6
  34. package/dist/Screens/Classrooms/ViewClassroom/ViewClassroom.js +18 -5
  35. package/dist/Screens/Courses/ViewCourse/ViewCourse.js +1 -1
  36. package/dist/Screens/Search/package.json +6 -6
  37. package/dist/Tables/Progress/ProgressList.js +3 -3
  38. package/dist/Tables/RecordingListCards/RecordingListCards.js +1 -1
  39. package/dist/hooks/useRecognition.js +6 -6
  40. package/dist/hooks/useSpreadsheetState.js +7 -7
  41. package/dist/img/0-nuala-001.svg +34 -34
  42. package/dist/img/1-teacher-001.svg +38 -38
  43. package/dist/img/AudioNuala.svg +165 -165
  44. package/dist/img/Bronze Medal.svg +545 -545
  45. package/dist/img/Bronze.svg +349 -349
  46. package/dist/img/BronzeBadge.svg +493 -493
  47. package/dist/img/BronzeBadgeWithoutRibbon.svg +317 -317
  48. package/dist/img/Frame 51.svg +98 -98
  49. package/dist/img/Frame 52.svg +131 -131
  50. package/dist/img/Frame 53.svg +139 -139
  51. package/dist/img/Gold Badge.svg +362 -362
  52. package/dist/img/Gold Medal.svg +481 -481
  53. package/dist/img/GoldBadge.svg +470 -470
  54. package/dist/img/GoldBadgeWithoutRibbon.svg +324 -324
  55. package/dist/img/NewText.svg +5 -5
  56. package/dist/img/NualaCreateImage.svg +129 -129
  57. package/dist/img/NualangLiveAnswerQuickly.svg +103 -103
  58. package/dist/img/NualangLiveAnwerQuicklyListening.svg +3607 -3607
  59. package/dist/img/NualangLiveListen.svg +42 -42
  60. package/dist/img/NualangLiveListenToPhrase.svg +4285 -4285
  61. package/dist/img/NualangLivePickAnswer.svg +134 -134
  62. package/dist/img/NualangLiveResult.svg +1235 -1235
  63. package/dist/img/NualangLiveRoleplayAnswer.svg +334 -334
  64. package/dist/img/NualangLiveRoleplayConvo.svg +282 -282
  65. package/dist/img/NualangLiveSeePlace.svg +134 -134
  66. package/dist/img/NualangLiveTranslate.svg +54 -54
  67. package/dist/img/NualangLiveTranslateQuickly.svg +197 -197
  68. package/dist/img/NualangLiveViewConversations.svg +135 -135
  69. package/dist/img/Polly.svg +17 -17
  70. package/dist/img/Silver Badge.svg +523 -523
  71. package/dist/img/Silver Medal.svg +549 -549
  72. package/dist/img/SilverBadge.svg +655 -655
  73. package/dist/img/SilverBadgeWithoutRibbon.svg +491 -491
  74. package/dist/img/avatars/0-nuala-001.svg +34 -34
  75. package/dist/img/avatars/0-nuala-002.svg +25 -25
  76. package/dist/img/avatars/0-nuala-003.svg +27 -27
  77. package/dist/img/avatars/0-nuala-004.svg +41 -41
  78. package/dist/img/avatars/0-nuala-005.svg +33 -33
  79. package/dist/img/avatars/0-nuala-006.svg +32 -32
  80. package/dist/img/avatars/0-nuala-007.svg +37 -37
  81. package/dist/img/avatars/0-nuala-008.svg +21 -21
  82. package/dist/img/avatars/0-nuala-009.svg +21 -21
  83. package/dist/img/avatars/0-nuala-010.svg +39 -39
  84. package/dist/img/avatars/0-nuala-011.svg +33 -33
  85. package/dist/img/avatars/0-nuala-012.svg +43 -43
  86. package/dist/img/avatars/0-nuala-013.svg +36 -36
  87. package/dist/img/avatars/0-nuala-014.svg +30 -30
  88. package/dist/img/avatars/0-nuala-015.svg +28 -28
  89. package/dist/img/avatars/0-nuala-016.svg +24 -24
  90. package/dist/img/avatars/0-nuala-017.svg +31 -31
  91. package/dist/img/avatars/0-nuala-018.svg +29 -29
  92. package/dist/img/avatars/0-nuala-019.svg +57 -57
  93. package/dist/img/avatars/0-nuala-020.svg +30 -30
  94. package/dist/img/avatars/0-nuala-021.svg +28 -28
  95. package/dist/img/avatars/1-teacher-001.svg +38 -38
  96. package/dist/img/avatars/1-teacher-002.svg +52 -52
  97. package/dist/img/avatars/1-teacher-003.svg +86 -86
  98. package/dist/img/avatars/nuala_10_celebrating.svg +44 -44
  99. package/dist/img/avatars/nuala_10_speaking.svg +45 -45
  100. package/dist/img/avatars/nuala_11_celebrating.svg +38 -38
  101. package/dist/img/avatars/nuala_11_speaking.svg +41 -41
  102. package/dist/img/avatars/nuala_12_celebrating.svg +48 -48
  103. package/dist/img/avatars/nuala_12_speaking.svg +49 -49
  104. package/dist/img/avatars/nuala_13_celebrating.svg +41 -41
  105. package/dist/img/avatars/nuala_13_speaking.svg +44 -44
  106. package/dist/img/avatars/nuala_14_celebrating.svg +35 -35
  107. package/dist/img/avatars/nuala_14_speaking.svg +36 -36
  108. package/dist/img/avatars/nuala_15_celebrating.svg +33 -33
  109. package/dist/img/avatars/nuala_15_speaking.svg +36 -36
  110. package/dist/img/avatars/nuala_16_celebrating.svg +29 -29
  111. package/dist/img/avatars/nuala_16_speaking.svg +32 -32
  112. package/dist/img/avatars/nuala_17_celebrating.svg +36 -36
  113. package/dist/img/avatars/nuala_17_speaking.svg +39 -39
  114. package/dist/img/avatars/nuala_18_celebrating.svg +34 -34
  115. package/dist/img/avatars/nuala_18_speaking.svg +37 -37
  116. package/dist/img/avatars/nuala_19_celebrating.svg +62 -62
  117. package/dist/img/avatars/nuala_19_speaking.svg +65 -65
  118. package/dist/img/avatars/nuala_1_celebrating.svg +30 -30
  119. package/dist/img/avatars/nuala_1_speaking.svg +37 -37
  120. package/dist/img/avatars/nuala_20_celebrating.svg +35 -35
  121. package/dist/img/avatars/nuala_20_speaking.svg +38 -38
  122. package/dist/img/avatars/nuala_21_celebrating.svg +33 -33
  123. package/dist/img/avatars/nuala_21_speaking.svg +36 -36
  124. package/dist/img/avatars/nuala_2_celebrating.svg +21 -21
  125. package/dist/img/avatars/nuala_2_speaking.svg +29 -29
  126. package/dist/img/avatars/nuala_3_celebrating.svg +20 -20
  127. package/dist/img/avatars/nuala_3_speaking.svg +28 -28
  128. package/dist/img/avatars/nuala_4_celebrating.svg +33 -33
  129. package/dist/img/avatars/nuala_4_speaking.svg +41 -41
  130. package/dist/img/avatars/nuala_5_celebrating.svg +30 -30
  131. package/dist/img/avatars/nuala_5_speaking.svg +36 -36
  132. package/dist/img/avatars/nuala_6_celebrating.svg +37 -37
  133. package/dist/img/avatars/nuala_6_speaking.svg +36 -36
  134. package/dist/img/avatars/nuala_7_celebrating.svg +42 -42
  135. package/dist/img/avatars/nuala_7_speaking.svg +43 -43
  136. package/dist/img/avatars/nuala_8_celebrating.svg +26 -26
  137. package/dist/img/avatars/nuala_8_speaking.svg +29 -29
  138. package/dist/img/avatars/nuala_9_celebrating.svg +26 -26
  139. package/dist/img/avatars/nuala_9_speaking.svg +27 -27
  140. package/dist/img/aws.svg +5 -5
  141. package/dist/img/azure.svg +9 -9
  142. package/dist/img/bot-error.svg +28 -28
  143. package/dist/img/bot_nuala.svg +45 -45
  144. package/dist/img/classroom.svg +178 -178
  145. package/dist/img/course.svg +113 -113
  146. package/dist/img/dashboard.svg +103 -103
  147. package/dist/img/nuala_1_celebrating.svg +33 -33
  148. package/dist/img/nuala_2_celebrating.svg +20 -20
  149. package/dist/img/nuala_3_celebrating.svg +21 -21
  150. package/dist/img/nuala_4_celebrating.svg +30 -30
  151. package/dist/img/nuala_5_celebrating.svg +30 -30
  152. package/dist/img/nuala_celebrating.svg +39 -39
  153. package/dist/img/nuala_sign_in.svg +62 -62
  154. package/dist/img/nuala_speaking.svg +41 -41
  155. package/dist/img/nuala_speaking_2.svg +41 -41
  156. package/dist/img/nuala_speaking_3.svg +41 -41
  157. package/dist/img/nuala_speaking_4.svg +41 -41
  158. package/dist/img/nualang-logo-primary.svg +17 -17
  159. package/dist/img/nualangSquareIcon.svg +18 -18
  160. package/dist/img/nualas.svg +185 -185
  161. package/dist/img/sentiment_dissatisfied_24px.svg +3 -3
  162. package/dist/img/sentiment_satisfied_24px.svg +3 -3
  163. package/dist/img/sentiment_very_satisfied_24px.svg +3 -3
  164. package/dist/img/stars1.svg +44 -44
  165. package/dist/img/stars2.svg +30 -30
  166. package/dist/img/structuring.svg +76 -76
  167. package/dist/img/teacher-create-2.svg +81 -81
  168. package/dist/img/teacher-create.svg +49 -49
  169. package/dist/img/teacher-world.svg +271 -271
  170. package/dist/img/teacher.svg +89 -89
  171. package/dist/img/world.svg +41 -41
  172. package/dist/utils/canvasUtils.js +5 -5
  173. package/dist/utils/index.js +8 -8
  174. package/package.json +190 -190
package/README.md CHANGED
@@ -1,65 +1,65 @@
1
- # Nualang ui-components
2
- This is the ui-components repository for the Nualang product. The components
3
- are developed, reviewed and tested with storybook and a library is then published
4
- to `npm` and consumed from there by nualang web apps.
5
-
6
- ## Getting Started
7
- Clone this repository and then execute `npm install`. `npm start` will start
8
- [stoybook](https://storybook.js.org) and allow you to brrowse the available components.
9
-
10
- ## Develop
11
- ```
12
- npm start
13
- ```
14
-
15
- ## Create Local Package
16
- Compile and pack (This will create a '.tgz' file):
17
- ```
18
- npm run localpack
19
- ```
20
-
21
- Install package (Inside webapp):
22
- ```
23
- npm i ../ui-components/fathomtech-nualang-ui-components-0.1.XXX.tgz
24
- ```
25
-
26
- If webapp is caching previous versions (Add a character to the end of the .tgz, e.g 'a') and install again:
27
- ```
28
- yarn add ../ui-components/fathomtech-nualang-ui-components-0.1.XXXa.tgz
29
- ```
30
-
31
- ## Publish to npm
32
- Make sure that the version number has been updayed in package.json.
33
- Ensure that you have committed the latest version to git.
34
- Execute:-
35
- ```bash
36
- npm run postversion
37
- ```
38
- npm will complain if you try to re-publish a previously used version number.
39
-
40
-
41
- ## Additional Scripts
42
- In the project directory, you can run:
43
-
44
- ### `npm run storybook`
45
- Runs the app in the development mode.<br />
46
- Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
47
-
48
- The page will reload if you make edits.<br />
49
- You should also see any lint errors in the console.
50
-
51
- ### `npm run test`
52
- Launches the test runner in interactive watch mode.<br />
53
- See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
54
-
55
- ### `npm run lint`
56
- Check for any lint errors or warnings.
57
-
58
- ### `npm run compile`
59
- Run the babel compiler to compile es6 to js.
60
-
61
- ### `npm run postversion`
62
- Publish a new version of the pacakage to npm. npm will complain
63
-
64
- ### `npm run chromatic`
1
+ # Nualang ui-components
2
+ This is the ui-components repository for the Nualang product. The components
3
+ are developed, reviewed and tested with storybook and a library is then published
4
+ to `npm` and consumed from there by nualang web apps.
5
+
6
+ ## Getting Started
7
+ Clone this repository and then execute `npm install`. `npm start` will start
8
+ [stoybook](https://storybook.js.org) and allow you to brrowse the available components.
9
+
10
+ ## Develop
11
+ ```
12
+ npm start
13
+ ```
14
+
15
+ ## Create Local Package
16
+ Compile and pack (This will create a '.tgz' file):
17
+ ```
18
+ npm run localpack
19
+ ```
20
+
21
+ Install package (Inside webapp):
22
+ ```
23
+ npm i ../ui-components/fathomtech-nualang-ui-components-0.1.XXX.tgz
24
+ ```
25
+
26
+ If webapp is caching previous versions (Add a character to the end of the .tgz, e.g 'a') and install again:
27
+ ```
28
+ yarn add ../ui-components/fathomtech-nualang-ui-components-0.1.XXXa.tgz
29
+ ```
30
+
31
+ ## Publish to npm
32
+ Make sure that the version number has been updayed in package.json.
33
+ Ensure that you have committed the latest version to git.
34
+ Execute:-
35
+ ```bash
36
+ npm run postversion
37
+ ```
38
+ npm will complain if you try to re-publish a previously used version number.
39
+
40
+
41
+ ## Additional Scripts
42
+ In the project directory, you can run:
43
+
44
+ ### `npm run storybook`
45
+ Runs the app in the development mode.<br />
46
+ Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
47
+
48
+ The page will reload if you make edits.<br />
49
+ You should also see any lint errors in the console.
50
+
51
+ ### `npm run test`
52
+ Launches the test runner in interactive watch mode.<br />
53
+ See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
54
+
55
+ ### `npm run lint`
56
+ Check for any lint errors or warnings.
57
+
58
+ ### `npm run compile`
59
+ Run the babel compiler to compile es6 to js.
60
+
61
+ ### `npm run postversion`
62
+ Publish a new version of the pacakage to npm. npm will complain
63
+
64
+ ### `npm run chromatic`
65
65
  Publish a new version of the pacakage to https://www.chromatic.com/
@@ -1,7 +1,7 @@
1
- {
2
- "name": "AssignmentBotSelection",
3
- "version": "0.0.0",
4
- "private": true,
5
- "main": "./AssignmentBotSelection.js"
6
- }
1
+ {
2
+ "name": "AssignmentBotSelection",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "main": "./AssignmentBotSelection.js"
6
+ }
7
7
 
@@ -1,7 +1,7 @@
1
- {
2
- "name": "AssignmentCard",
3
- "version": "0.0.0",
4
- "private": true,
5
- "main": "./AssignmentCard.js"
6
- }
1
+ {
2
+ "name": "AssignmentCard",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "main": "./AssignmentCard.js"
6
+ }
7
7
 
@@ -1,7 +1,7 @@
1
- {
2
- "name": "AssignmentCardsList",
3
- "version": "0.0.0",
4
- "private": true,
5
- "main": "./AssignmentCardsList.js"
6
- }
1
+ {
2
+ "name": "AssignmentCardsList",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "main": "./AssignmentCardsList.js"
6
+ }
7
7
 
@@ -1,7 +1,7 @@
1
- {
2
- "name": "AssignmentCourseSelection",
3
- "version": "0.0.0",
4
- "private": true,
5
- "main": "./AssignmentCourseSelection.js"
6
- }
1
+ {
2
+ "name": "AssignmentCourseSelection",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "main": "./AssignmentCourseSelection.js"
6
+ }
7
7
 
@@ -1,7 +1,7 @@
1
- {
2
- "name": "AssignmentExerciseSelection",
3
- "version": "0.0.0",
4
- "private": true,
5
- "main": "./AssignmentExerciseSelection.js"
6
- }
1
+ {
2
+ "name": "AssignmentExerciseSelection",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "main": "./AssignmentExerciseSelection.js"
6
+ }
7
7
 
@@ -1,7 +1,7 @@
1
- {
2
- "name": "AssignmentExerciseSelector",
3
- "version": "0.0.0",
4
- "private": true,
5
- "main": "./AssignmentExerciseSelector.js"
6
- }
1
+ {
2
+ "name": "AssignmentExerciseSelector",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "main": "./AssignmentExerciseSelector.js"
6
+ }
7
7
 
@@ -1,7 +1,7 @@
1
- {
2
- "name": "AssignmentRoleplaySelection",
3
- "version": "0.0.0",
4
- "private": true,
5
- "main": "./AssignmentRoleplaySelection.js"
6
- }
1
+ {
2
+ "name": "AssignmentRoleplaySelection",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "main": "./AssignmentRoleplaySelection.js"
6
+ }
7
7
 
@@ -79,33 +79,51 @@ function CreateAssignmentDialog({
79
79
  exercises: submittedExercises,
80
80
  ...initialData
81
81
  });
82
- const classroomQuery = _Queries.classrooms.useClassroom(async classroomId => {
83
- const allClassroomsCourses = [];
84
- await Promise.all(classroomId.map(async cId => {
85
- if (!cId) return;
86
- const response = await getClassroom(cId);
87
- allClassroomsCourses.push(response?.Item?.courses || []);
88
- }));
89
- const flatClassrooms = allClassroomsCourses.flat();
90
- const seen = new Set();
91
- const uniqueClassroomsCourses = flatClassrooms.filter(classR => {
92
- if (seen.has(classR)) return false;
93
- seen.add(classR);
94
- return true;
95
- });
96
- return uniqueClassroomsCourses;
97
- }, {
98
- classroomId: assignment?.classroomId
99
- }, {
100
- enabled: !!(assignment.classroomId.length > 0)
82
+ const classroomQuery = useQueries({
83
+ queries: (Array.isArray(assignment.classroomId) ? assignment.classroomId : [assignment.classroomId]).map(cId => ({
84
+ queryKey: _Queries.classrooms.classroomKeys.item(cId, username),
85
+ queryFn: () => getClassroom(cId, filters),
86
+ queryOptions: {
87
+ enabled: !!(Array.isArray(assignment.classroomId) ? assignment.classroomId.length > 0 : assignment.classroomId)
88
+ }
89
+ })),
90
+ combine: results => {
91
+ const normalizedData = results.map(result => {
92
+ const data = result.data;
93
+ if (data?.classroomId) {
94
+ return data;
95
+ }
96
+ if (data?.Item?.classroomId) {
97
+ return data.Item;
98
+ }
99
+ return null;
100
+ }).filter(Boolean);
101
+ return {
102
+ data: normalizedData,
103
+ pending: results.some(result => result.isPending)
104
+ };
105
+ }
101
106
  });
102
- const selectedClassroom = (0, _react.useMemo)(() => classroomQuery.isSuccess && classroomQuery.data ? classroomQuery.data : {}, [classroomQuery.data, classroomQuery.isSuccess]);
107
+ const selectedClassroomCourses = (0, _react.useMemo)(() => {
108
+ if (!classroomQuery.pending && classroomQuery.data.length > 0) {
109
+ const allCourses = classroomQuery.data.flatMap(classroom => classroom.courses || []);
110
+ const seen = new Set();
111
+ const uniqueCourses = allCourses.filter(courseId => {
112
+ if (seen.has(courseId)) return false;
113
+ seen.add(courseId);
114
+ return true;
115
+ });
116
+ return uniqueCourses;
117
+ } else {
118
+ return [];
119
+ }
120
+ }, [classroomQuery.data, classroomQuery.pending]);
103
121
  const coursesQuery = _Queries.courses.useCourses(async filters => {
104
122
  const response = await getCourses(filters);
105
123
  return response;
106
124
  }, {
107
125
  filters: {
108
- courseIds: selectedClassroom?.toString()
126
+ courseIds: selectedClassroomCourses?.toString()
109
127
  }
110
128
  }, {
111
129
  enabled: !!assignment.classroomId
@@ -122,17 +140,22 @@ function CreateAssignmentDialog({
122
140
  }
123
141
  })),
124
142
  combine: results => {
143
+ const allMembers = results.flatMap(result => {
144
+ if (Array.isArray(result?.data?.Items)) {
145
+ return result.data.Items;
146
+ }
147
+ return [];
148
+ });
125
149
  return {
126
- data: results.map(result => result.data),
150
+ data: allMembers,
127
151
  pending: results.some(result => result.isPending)
128
152
  };
129
153
  }
130
154
  });
131
- const selectedMembers = (0, _react.useMemo)(() => {
132
- if (!classroomMembersQueries.pending && Array.isArray(classroomMembersQueries.data[0].Items) && classroomMembersQueries.data[0].Items.length) {
133
- const flatMembers = classroomMembersQueries.data[0].Items.flat();
155
+ const uniqueClassroomMembers = (0, _react.useMemo)(() => {
156
+ if (!classroomMembersQueries.pending && classroomMembersQueries.data.length > 0) {
134
157
  const seen = new Set();
135
- const uniqueMembers = flatMembers.filter(member => {
158
+ const uniqueMembers = classroomMembersQueries.data.filter(member => {
136
159
  if (seen.has(member.memberId)) return false;
137
160
  seen.add(member.memberId);
138
161
  return true;
@@ -160,13 +183,13 @@ function CreateAssignmentDialog({
160
183
  courses: filteredCourses
161
184
  });
162
185
  }, [selectedCourses, submittedExercises]);
163
- const classroomMembers = async selectedMembers => {
164
- const formattedMembers = await getMemberDetails(selectedMembers);
186
+ const classroomMembers = async uniqueClassroomMembers => {
187
+ const formattedMembers = await getMemberDetails(uniqueClassroomMembers);
165
188
  setMembers(formattedMembers);
166
189
  };
167
190
  (0, _react.useEffect)(() => {
168
- classroomMembers(selectedMembers);
169
- }, [selectedMembers]);
191
+ classroomMembers(uniqueClassroomMembers);
192
+ }, [uniqueClassroomMembers]);
170
193
  (0, _react.useEffect)(() => {
171
194
  setAssignment(prev => ({
172
195
  ...prev,
@@ -227,7 +250,7 @@ function CreateAssignmentDialog({
227
250
  const handleCreateAssignment = async () => {
228
251
  try {
229
252
  await Promise.all(assignment.classroomId.map(async cId => {
230
- const selectedClassroomMembers = selectedMembers.filter(member => member.classroomId === cId).map(student => student.memberId).filter(studentId => assignment?.assignedStudents.includes(studentId));
253
+ const selectedClassroomMembers = uniqueClassroomMembers.filter(member => member.classroomId === cId).map(student => student.memberId).filter(studentId => assignment?.assignedStudents.includes(studentId));
231
254
  const formattedAssignment = {
232
255
  ...assignment,
233
256
  classroomId: cId,
@@ -295,7 +318,33 @@ function CreateAssignmentDialog({
295
318
  label: t("select_classroom"),
296
319
  onChange: handleChange("classroomId"),
297
320
  required: true,
298
- renderValue: selected => selected?.map(classroomId => classrooms?.find(c => c.classroomId === classroomId))?.map(c => c?.classroomName)?.filter(n => n).join(", "),
321
+ renderValue: selected => /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
322
+ sx: {
323
+ display: "inline-block",
324
+ maxWidth: "100%",
325
+ whiteSpace: "nowrap",
326
+ overflow: "hidden",
327
+ textOverflow: "ellipsis"
328
+ },
329
+ children: selected?.map(classroomId => classrooms?.find(c => c.classroomId === classroomId))?.map(c => c?.classroomName)?.filter(n => n).join(", ")
330
+ }),
331
+ MenuProps: {
332
+ PaperProps: {
333
+ sx: {
334
+ width: 'auto',
335
+ maxWidth: 400
336
+ }
337
+ },
338
+ getContentAnchorEl: null,
339
+ anchorOrigin: {
340
+ vertical: "bottom",
341
+ horizontal: "left"
342
+ },
343
+ transformOrigin: {
344
+ vertical: "top",
345
+ horizontal: "left"
346
+ }
347
+ },
299
348
  children: classrooms.filter(c => c.createdBy === username || c.collaborators.includes(userEmail)).map(c => /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.MenuItem, {
300
349
  value: c.classroomId,
301
350
  disabled: c.classroomId === classroom,
@@ -303,14 +352,37 @@ function CreateAssignmentDialog({
303
352
  sx: {
304
353
  display: "flex",
305
354
  alignItems: "center",
306
- gap: 0.5
355
+ justifyContent: "space-between",
356
+ width: "100%"
307
357
  },
308
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.ListItemAvatar, {
309
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Avatar, {
310
- src: c.picture
311
- })
312
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.ListItemText, {
313
- primary: c.classroomName
358
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
359
+ sx: {
360
+ display: "flex",
361
+ alignItems: "center",
362
+ flex: 1,
363
+ minWidth: 0,
364
+ gap: 1
365
+ },
366
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Avatar, {
367
+ src: c.picture,
368
+ sx: {
369
+ width: 32,
370
+ height: 32
371
+ }
372
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.ListItemText, {
373
+ primary: c.classroomName,
374
+ primaryTypographyProps: {
375
+ noWrap: true,
376
+ sx: {
377
+ overflow: "hidden",
378
+ textOverflow: "ellipsis"
379
+ }
380
+ },
381
+ sx: {
382
+ minWidth: 0,
383
+ flex: 1
384
+ }
385
+ })]
314
386
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Checkbox, {
315
387
  disabled: c.classroomId === classroom,
316
388
  checked: assignment.classroomId?.includes(c.classroomId) || c.classroomId === classroom
@@ -1,7 +1,7 @@
1
- {
2
- "name": "CreateAssignmentDialog",
3
- "version": "0.0.0",
4
- "private": true,
5
- "main": "./CreateAssignmentDialog.js"
6
- }
1
+ {
2
+ "name": "CreateAssignmentDialog",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "main": "./CreateAssignmentDialog.js"
6
+ }
7
7
 
@@ -1,7 +1,7 @@
1
- {
2
- "name": "SelectAssignmentTypeDialog",
3
- "version": "0.0.0",
4
- "private": true,
5
- "main": "./SelectAssignmentTypeDialog.js"
6
- }
1
+ {
2
+ "name": "SelectAssignmentTypeDialog",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "main": "./SelectAssignmentTypeDialog.js"
6
+ }
7
7
 
@@ -11,11 +11,13 @@ var _Public = _interopRequireDefault(require("@mui/icons-material/Public"));
11
11
  var _VpnLock = _interopRequireDefault(require("@mui/icons-material/VpnLock"));
12
12
  var _colors = require("@mui/material/colors");
13
13
  var _Archive = _interopRequireDefault(require("@mui/icons-material/Archive"));
14
+ var _VisibilityOff = _interopRequireDefault(require("@mui/icons-material/VisibilityOff"));
14
15
  var _jsxRuntime = require("react/jsx-runtime");
15
16
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
17
  function CardVisibility({
17
18
  t = text => text,
18
- visibility = ""
19
+ visibility = "",
20
+ isCourseHidden = false
19
21
  }) {
20
22
  const isPublic = visibility === "public";
21
23
  let icon;
@@ -36,18 +38,18 @@ function CardVisibility({
36
38
  });
37
39
  color = "secondary";
38
40
  }
39
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
41
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
40
42
  sx: {
41
43
  position: "relative"
42
44
  },
43
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Chip.default, {
45
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Chip.default, {
44
46
  color: color,
45
47
  icon: icon,
46
48
  label: t(visibility),
47
49
  sx: theme => ({
48
50
  position: "absolute",
49
- bottom: "16px",
50
- right: "16px",
51
+ bottom: "8px",
52
+ right: "8px",
51
53
  fontWeight: "bold",
52
54
  textTransform: "capitalize",
53
55
  pointerEvents: "none",
@@ -57,7 +59,26 @@ function CardVisibility({
57
59
  color: "white"
58
60
  })
59
61
  })
60
- })
62
+ }), isCourseHidden && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Chip.default, {
63
+ color: "success",
64
+ icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_VisibilityOff.default, {
65
+ fontSize: "small"
66
+ }),
67
+ label: t("hidden"),
68
+ sx: theme => ({
69
+ position: "absolute",
70
+ bottom: "8px",
71
+ right: "108px",
72
+ fontWeight: "bold",
73
+ textTransform: "capitalize",
74
+ pointerEvents: "none",
75
+ boxShadow: theme.shadows[1],
76
+ backgroundColor: theme.palette.mode === "light" ? _colors.blue[700] : _colors.blue[500],
77
+ ...(theme.palette.mode === "light" && {
78
+ color: "white"
79
+ })
80
+ })
81
+ })]
61
82
  });
62
83
  }
63
84
  CardVisibility.propTypes = {
@@ -19,6 +19,8 @@ var _FileCopy = _interopRequireDefault(require("@mui/icons-material/FileCopy"));
19
19
  var _OndemandVideo = _interopRequireDefault(require("@mui/icons-material/OndemandVideo"));
20
20
  var _PictureAsPdf = _interopRequireDefault(require("@mui/icons-material/PictureAsPdf"));
21
21
  var _School = _interopRequireDefault(require("@mui/icons-material/School"));
22
+ var _Visibility = _interopRequireDefault(require("@mui/icons-material/Visibility"));
23
+ var _VisibilityOff = _interopRequireDefault(require("@mui/icons-material/VisibilityOff"));
22
24
  var _Members = _interopRequireDefault(require("../../Dialogs/Members"));
23
25
  var _CourseOutline = _interopRequireDefault(require("../../Dialogs/CourseOutline"));
24
26
  var _Members2 = _interopRequireDefault(require("../../Lists/Members"));
@@ -43,16 +45,18 @@ function OverflowMenu({
43
45
  handleClickOpenMembers,
44
46
  isCreator,
45
47
  isMember,
46
- viewCourse,
47
48
  startCourse,
48
49
  leaveCourse,
49
50
  handleRemoveCourse,
51
+ handleHideCourse,
52
+ handleUnhideCourse,
50
53
  isAdmin,
51
54
  handleDuplicateCourse,
52
55
  course,
53
56
  classroomId,
54
57
  isClassroomArchived = false,
55
- canDuplicateCourse
58
+ canDuplicateCourse,
59
+ hiddenCourses = []
56
60
  }) {
57
61
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Menu, {
58
62
  id: `card-menu-${courseId}`,
@@ -129,6 +133,24 @@ function OverflowMenu({
129
133
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
130
134
  children: t("remove_course")
131
135
  })]
136
+ }), handleHideCourse && !hiddenCourses.includes(courseId) && !isClassroomArchived && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.MenuItem, {
137
+ onClick: () => handleHideCourse(courseId),
138
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_CardElements.CardMenuIcon, {
139
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_VisibilityOff.default, {
140
+ fontSize: "small"
141
+ })
142
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
143
+ children: t("hide_course")
144
+ })]
145
+ }), handleUnhideCourse && hiddenCourses.includes(courseId) && !isClassroomArchived && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.MenuItem, {
146
+ onClick: () => handleUnhideCourse(courseId),
147
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_CardElements.CardMenuIcon, {
148
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Visibility.default, {
149
+ fontSize: "small"
150
+ })
151
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
152
+ children: t("show_course")
153
+ })]
132
154
  })]
133
155
  });
134
156
  }
@@ -199,6 +221,8 @@ function CourseCard({
199
221
  handleLeaveCourse,
200
222
  handleClickCourse,
201
223
  handleRemoveCourse,
224
+ handleHideCourse,
225
+ handleUnhideCourse,
202
226
  membersProps,
203
227
  selectable,
204
228
  selected,
@@ -218,13 +242,15 @@ function CourseCard({
218
242
  classroomId,
219
243
  cardTitleComponent = "h2",
220
244
  isClassroomArchived = false,
221
- email
245
+ email,
246
+ hiddenCourses = []
222
247
  }) {
223
248
  const [placeholderRef, visible] = (0, _reactIntersectionObserver.useInView)({
224
249
  rootMargin: "320px",
225
250
  triggerOnce: true
226
251
  });
227
252
  const [isOutlineOpen, setIsOutlineOpen] = (0, _react.useState)(false);
253
+ const isCourseHidden = hiddenCourses.includes(course.courseId);
228
254
  const sectionsQuery = _Queries.courses.useCourseSections(async (courseId, filters) => {
229
255
  const response = await getCourseSections(courseId, filters);
230
256
  return response;
@@ -346,7 +372,8 @@ function CourseCard({
346
372
  placeholderRef: placeholderRef
347
373
  }), isCreator && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CardElements.CardVisibility, {
348
374
  t: t,
349
- visibility: visibility
375
+ visibility: visibility,
376
+ isCourseHidden: isCourseHidden
350
377
  })]
351
378
  }), userImage ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_CardElements.CardAvatar, {
352
379
  "aria-label": `${t("go_to")} ${createdByName || `${courseName} ${t("creator")}`} ${t("profile")}`,
@@ -535,10 +562,13 @@ function CourseCard({
535
562
  startCourse: startCourse,
536
563
  leaveCourse: leaveCourse,
537
564
  handleRemoveCourse: handleRemoveCourse,
565
+ handleHideCourse: handleHideCourse,
566
+ handleUnhideCourse: handleUnhideCourse,
538
567
  handleDuplicateCourse: handleDuplicateCourse,
539
568
  course: course,
540
569
  isClassroomArchived: isClassroomArchived,
541
- canDuplicateCourse: canDuplicateCourse
570
+ canDuplicateCourse: canDuplicateCourse,
571
+ hiddenCourses: hiddenCourses
542
572
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Members.default, {
543
573
  getMemberDetails: getMemberDetails,
544
574
  t: t,