@nualang/nualang-ui-components 0.1.1323 → 0.1.1327

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.
@@ -73,6 +73,7 @@ export default function CreateAssignmentDialog({
73
73
  exercises: submittedExercises
74
74
  });
75
75
  const [isTitleEdited, setIsTitleEdited] = useState(Boolean(initialData.title));
76
+ const [isCreating, setIsCreating] = useState(false);
76
77
  const classroomQuery = useQueries({
77
78
  queries: (Array.isArray(assignment.classroomId) ? assignment.classroomId : [assignment.classroomId]).map(cId => ({
78
79
  queryKey: classroomQuerys.classroomKeys.item(cId, username),
@@ -262,6 +263,7 @@ export default function CreateAssignmentDialog({
262
263
  }));
263
264
  };
264
265
  const handleCreateAssignment = async () => {
266
+ setIsCreating(true);
265
267
  try {
266
268
  await Promise.all(assignment.classroomId.map(async cId => {
267
269
  const selectedClassroomMembers = uniqueClassroomMembers.filter(member => member.classroomId === cId).map(student => student.memberId).filter(studentId => assignment?.assignedStudents.includes(studentId));
@@ -275,6 +277,8 @@ export default function CreateAssignmentDialog({
275
277
  handleClose();
276
278
  } catch (error) {
277
279
  console.error("Error creating assignments:", error);
280
+ } finally {
281
+ setIsCreating(false);
278
282
  }
279
283
  };
280
284
  const handleRemoveExercise = toRemove => {
@@ -647,7 +651,7 @@ export default function CreateAssignmentDialog({
647
651
  },
648
652
  children: /*#__PURE__*/_jsx(Button, {
649
653
  "data-cy": "assignment-assign-button",
650
- disabled: !assignment.assignedStudents?.length || !assignment.scheduleDate || !assignment.dueDate || !assignment.title || !assignment.classroomId || !assignment.exercises?.length,
654
+ disabled: isCreating || !assignment.assignedStudents?.length || !assignment.scheduleDate || !assignment.dueDate || !assignment.title || !assignment.classroomId || !assignment.exercises?.length,
651
655
  onClick: async () => await handleCreateAssignment(),
652
656
  children: t("assign")
653
657
  })
@@ -6,7 +6,7 @@ const StyledCardTitle = styled(Typography)(({
6
6
  theme
7
7
  }) => ({
8
8
  fontSize: "1.125rem",
9
- fontWeight: "bold",
9
+ fontWeight: "600",
10
10
  marginTop: theme.spacing(2)
11
11
  }));
12
12
  function CardTitle({
@@ -9,7 +9,6 @@ const CardContainer = styled(Card)(({
9
9
  theme
10
10
  }) => ({
11
11
  textAlign: "left",
12
- color: theme.palette.text.secondary,
13
12
  maxWidth: 600,
14
13
  minWidth: 320,
15
14
  display: "flex",
@@ -109,7 +108,8 @@ const CardInfoSection = styled(Box)(({
109
108
  [theme.breakpoints.down("sm")]: {
110
109
  marginBottom: 0
111
110
  },
112
- marginBottom: theme.spacing(2)
111
+ marginBottom: theme.spacing(2),
112
+ color: theme.palette.text.secondary
113
113
  }));
114
114
  const CardInfoSectionItem = styled(Typography)(() => ({
115
115
  display: "flex",
@@ -13,7 +13,6 @@ import level2Rubric from "../../Dialogs/PDFViewer/rubrics/level2Rubric.pdf";
13
13
  import level3Rubric from "../../Dialogs/PDFViewer/rubrics/level3Rubric.pdf";
14
14
  import level4Rubric from "../../Dialogs/PDFViewer/rubrics/level4Rubric.pdf";
15
15
  import HelpOutlineIcon from "@mui/icons-material/HelpOutline";
16
- import NualaCreating from "../../Misc/NualaCreating/NualaCreating";
17
16
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
18
17
  export default function FeedbackCard({
19
18
  t = x => x,
@@ -39,7 +38,8 @@ export default function FeedbackCard({
39
38
  goToTimestamp = () => {},
40
39
  startTimes = {},
41
40
  canSubmitAll = {},
42
- setCanSubmit = () => {}
41
+ setCanSubmit = () => {},
42
+ setIsGeneratingIndividual = () => {}
43
43
  }) {
44
44
  const [isRecordingDialogOpen, setIsRecordingDialogOpen] = useState(false);
45
45
  const [hasBeenEdited, setHasBeenEdited] = useState(false);
@@ -50,6 +50,7 @@ export default function FeedbackCard({
50
50
  const [openPDF, setOpenPDF] = useState(false);
51
51
  const [pageNumber, setPageNumber] = useState(1);
52
52
  const [scale, setScale] = useState(1);
53
+ const [isGeneratingFeedback, setIsGeneratingFeedback] = useState(false);
53
54
  const handleChangeCheckbox = event => {
54
55
  setCheckedSubmissions({
55
56
  ...checkedSubmissions,
@@ -159,7 +160,14 @@ export default function FeedbackCard({
159
160
  }, [submitTrigger]);
160
161
  const handleGenerateAI = async () => {
161
162
  setAiJustGenerated(true);
162
- await onGenerateFeedback(discussionData);
163
+ setIsGeneratingFeedback(true);
164
+ setIsGeneratingIndividual(true);
165
+ try {
166
+ await onGenerateFeedback(discussionData);
167
+ } finally {
168
+ setIsGeneratingFeedback(false);
169
+ setIsGeneratingIndividual(false);
170
+ }
163
171
  };
164
172
  const handleOpenPDF = () => {
165
173
  setOpenPDF(true);
@@ -241,23 +249,7 @@ export default function FeedbackCard({
241
249
  overflow: "hidden",
242
250
  backgroundColor: "background.paper"
243
251
  },
244
- children: [aiJustGenerated ? /*#__PURE__*/_jsxs(Grid, {
245
- sx: {
246
- ...(!aiJustGenerated && {
247
- display: "none"
248
- })
249
- },
250
- mx: 2,
251
- size: 12,
252
- children: [/*#__PURE__*/_jsx(Typography, {
253
- variant: "h6",
254
- sx: {
255
- mt: 2,
256
- mb: 2
257
- },
258
- children: t("generating_feedback")
259
- }), /*#__PURE__*/_jsx(NualaCreating, {})]
260
- }) : /*#__PURE__*/_jsxs(_Fragment, {
252
+ children: [/*#__PURE__*/_jsxs(_Fragment, {
261
253
  children: [/*#__PURE__*/_jsxs(Box, {
262
254
  sx: {
263
255
  px: 3,
@@ -420,16 +412,16 @@ export default function FeedbackCard({
420
412
  },
421
413
  children: [/*#__PURE__*/_jsx(Button, {
422
414
  variant: "outlined",
423
- disabled: !hasSubmission || aiJustGenerated,
415
+ disabled: !hasSubmission || isGeneratingFeedback,
424
416
  onClick: handleOpenRecordingDialog,
425
417
  children: t("view_recording")
426
418
  }), /*#__PURE__*/_jsx(Button, {
427
419
  variant: "contained",
428
420
  color: "secondary",
429
- disabled: !hasSubmission || aiJustGenerated,
421
+ disabled: !hasSubmission || isGeneratingFeedback,
430
422
  onClick: handleGenerateAI,
431
423
  endIcon: /*#__PURE__*/_jsx(AutoFixHighIcon, {}),
432
- children: t("generate_feedback")
424
+ children: isGeneratingFeedback ? t("generating") : t("generate_feedback")
433
425
  }), /*#__PURE__*/_jsx(Button, {
434
426
  type: "submit",
435
427
  variant: "contained",
@@ -154,7 +154,8 @@ export default function BottomBar({
154
154
  },
155
155
  disableUnderline: true,
156
156
  multiline: true,
157
- rows: isChallengeBot ? 3 : 1,
157
+ minRows: isChallengeBot ? 3 : 1,
158
+ maxRows: 3,
158
159
  autoComplete: autoComplete,
159
160
  inputRef: activeRef,
160
161
  onClick: handleSelectCurrentInput,
@@ -1,5 +1,5 @@
1
1
  import { useMemo, useEffect, useState, useRef, useCallback } from "react";
2
- import { Dialog, DialogContent, IconButton, Box, Typography, AppBar, Toolbar, CircularProgress, Button, Checkbox, Paper, Divider, Tooltip, Skeleton } from "@mui/material";
2
+ import { Dialog, DialogContent, IconButton, Box, Typography, AppBar, Toolbar, CircularProgress, Button, Checkbox, Paper, Divider, Tooltip, Skeleton, Grid } from "@mui/material";
3
3
  import CloseIcon from "@mui/icons-material/Close";
4
4
  import { red, orange, green, grey } from "@mui/material/colors";
5
5
  import FeedbackCard from "../../Cards/FeedbackCard/FeedbackCard";
@@ -7,7 +7,8 @@ import AutoFixHighIcon from "@mui/icons-material/AutoFixHigh";
7
7
  import NualaHeadphonesBackground from "../../img/NualaHeadphonesBackground.svg";
8
8
  import CheckCircleIcon from "@mui/icons-material/CheckCircle";
9
9
  import useConfirm from "../../hooks/useConfirm";
10
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
+ import NualaCreating from "../../Misc/NualaCreating/NualaCreating";
11
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
11
12
  export default function GroupFeedbackDialog({
12
13
  open = false,
13
14
  onClose = () => {},
@@ -41,6 +42,9 @@ export default function GroupFeedbackDialog({
41
42
  const [pendingSubmissions, setPendingSubmissions] = useState(0);
42
43
  const [canSubmit, setCanSubmit] = useState({});
43
44
  const [hasReachedBottom, setHasReachedBottom] = useState(false);
45
+ const [isGeneratingAll, setIsGeneratingAll] = useState(false);
46
+ const [isGeneratingIndividual, setIsGeneratingIndividual] = useState(false);
47
+ const isAnyGenerating = isGeneratingAll || isGeneratingIndividual;
44
48
  const [confirm] = useConfirm(t);
45
49
  const bottomRefCallback = useCallback(node => {
46
50
  if (node) {
@@ -56,7 +60,7 @@ export default function GroupFeedbackDialog({
56
60
  }
57
61
  }, []);
58
62
  useEffect(() => {
59
- // dialog is shared between discussions, so reset when teacher seletcts another discussion
63
+ // dialog is shared between discussions, so reset when teacher selects another discussion
60
64
  setGenerateAllUsed(false);
61
65
  setCheckedSubmissions({});
62
66
  setCheckedAll(false);
@@ -64,6 +68,7 @@ export default function GroupFeedbackDialog({
64
68
  setPendingSubmissions(0);
65
69
  setCanSubmit({});
66
70
  setHasReachedBottom(false);
71
+ setIsGeneratingAll(false);
67
72
  }, [groupedId]);
68
73
  useEffect(() => {
69
74
  if (pendingSubmissions === 0 && submitTrigger !== null) {
@@ -149,8 +154,13 @@ export default function GroupFeedbackDialog({
149
154
  };
150
155
  });
151
156
  if (conversationsToGrade.length > 0 && handleBatchGradeConversations) {
157
+ setIsGeneratingAll(true);
152
158
  setGenerateAllUsed(true);
153
- await handleBatchGradeConversations(conversationsToGrade);
159
+ try {
160
+ await handleBatchGradeConversations(conversationsToGrade);
161
+ } finally {
162
+ setIsGeneratingAll(false);
163
+ }
154
164
  }
155
165
  };
156
166
  const handleSubmitFeedback = async ({
@@ -218,291 +228,341 @@ export default function GroupFeedbackDialog({
218
228
  setPendingSubmissions(prev => Math.max(prev - 1, 0));
219
229
  };
220
230
  const isSubmitAllEnabled = hasReachedBottom && Object.values(canSubmit).some(v => v === true);
221
- return /*#__PURE__*/_jsxs(Dialog, {
222
- fullScreen: true,
223
- open: open,
224
- onClose: onClose,
225
- "aria-label": "group-feedback-dialog",
226
- children: [/*#__PURE__*/_jsx(AppBar, {
227
- sx: {
228
- position: "relative"
229
- },
230
- children: /*#__PURE__*/_jsx(Toolbar, {
231
- children: /*#__PURE__*/_jsx(IconButton, {
232
- edge: "start",
233
- color: "inherit",
234
- onClick: onClose,
235
- "aria-label": "close",
236
- children: /*#__PURE__*/_jsx(CloseIcon, {})
237
- })
238
- })
239
- }), /*#__PURE__*/_jsx(DialogContent, {
240
- sx: {
241
- p: 3,
242
- backgroundColor: "background.default"
243
- },
244
- children: discussionsInGroup.length === 0 ? /*#__PURE__*/_jsx(Box, {
231
+ return /*#__PURE__*/_jsxs(_Fragment, {
232
+ children: [/*#__PURE__*/_jsxs(Dialog, {
233
+ fullScreen: true,
234
+ open: open,
235
+ onClose: onClose,
236
+ "aria-label": "group-feedback-dialog",
237
+ children: [/*#__PURE__*/_jsx(AppBar, {
245
238
  sx: {
246
- textAlign: "center",
247
- py: 8
239
+ position: "relative"
248
240
  },
249
- children: /*#__PURE__*/_jsx(Typography, {
250
- variant: "h6",
251
- color: "text.secondary",
252
- children: t("no_discussions_found")
241
+ children: /*#__PURE__*/_jsx(Toolbar, {
242
+ children: /*#__PURE__*/_jsx(IconButton, {
243
+ edge: "start",
244
+ color: "inherit",
245
+ onClick: onClose,
246
+ "aria-label": "close",
247
+ children: /*#__PURE__*/_jsx(CloseIcon, {})
248
+ })
253
249
  })
254
- }) : /*#__PURE__*/_jsxs(Box, {
250
+ }), /*#__PURE__*/_jsx(DialogContent, {
255
251
  sx: {
256
- maxWidth: 1400,
257
- mx: "auto"
252
+ p: 3,
253
+ backgroundColor: "background.default"
258
254
  },
259
- children: [/*#__PURE__*/_jsxs(Box, {
255
+ children: discussionsInGroup.length === 0 ? /*#__PURE__*/_jsx(Box, {
260
256
  sx: {
261
- display: "flex",
262
- alignItems: "flex-start",
263
- justifyContent: "space-between",
264
- mb: 3,
265
- gap: 4
257
+ textAlign: "center",
258
+ py: 8
266
259
  },
267
- children: [/*#__PURE__*/_jsx(Box, {
260
+ children: /*#__PURE__*/_jsx(Typography, {
261
+ variant: "h6",
262
+ color: "text.secondary",
263
+ children: t("no_discussions_found")
264
+ })
265
+ }) : /*#__PURE__*/_jsxs(Box, {
266
+ sx: {
267
+ maxWidth: 1400,
268
+ mx: "auto"
269
+ },
270
+ children: [/*#__PURE__*/_jsxs(Box, {
268
271
  sx: {
269
- position: "relative",
270
- width: "100%",
271
- maxWidth: "300px"
272
+ display: "flex",
273
+ alignItems: "flex-start",
274
+ justifyContent: "space-between",
275
+ mb: 3,
276
+ gap: 4
272
277
  },
273
- children: /*#__PURE__*/_jsxs(Box, {
278
+ children: [/*#__PURE__*/_jsx(Box, {
274
279
  sx: {
275
280
  position: "relative",
276
281
  width: "100%",
277
- paddingTop: "56.25%",
278
- borderRadius: "8px",
279
- overflow: "hidden"
282
+ maxWidth: "300px"
280
283
  },
281
- children: [/*#__PURE__*/_jsx(Skeleton, {
282
- variant: "rectangular",
284
+ children: /*#__PURE__*/_jsxs(Box, {
283
285
  sx: {
284
- position: "absolute",
285
- top: 0,
286
- left: 0,
286
+ position: "relative",
287
287
  width: "100%",
288
- height: "100%",
288
+ paddingTop: "56.25%",
289
289
  borderRadius: "8px",
290
- zIndex: 0
291
- }
292
- }), /*#__PURE__*/_jsx("img", {
293
- src: editMeetingImages || editBackgroundImages || NualaHeadphonesBackground,
294
- alt: "Meeting Image",
295
- onLoad: e => {
296
- setTimeout(() => {
297
- e.target.style.opacity = 1;
298
- }, 500);
290
+ overflow: "hidden"
299
291
  },
300
- style: {
301
- position: "absolute",
302
- top: 0,
303
- left: 0,
304
- width: "100%",
305
- height: "100%",
306
- objectFit: "cover",
307
- borderRadius: "8px",
308
- opacity: 0,
309
- transition: "opacity 0.5s ease",
310
- zIndex: 1
311
- }
312
- })]
313
- })
314
- }), /*#__PURE__*/_jsxs(Box, {
315
- sx: {
316
- flexBasis: "70%",
317
- maxWidth: "70%"
318
- },
319
- children: [/*#__PURE__*/_jsx(Typography, {
320
- variant: "h5",
321
- component: "h2",
322
- sx: {
323
- fontWeight: 600,
324
- mb: 2,
325
- color: "text.primary"
326
- },
327
- children: selectedGroup?.meetingTopic || t("discussion")
328
- }), selectedGroup?.meetingPrompt && /*#__PURE__*/_jsx(Typography, {
329
- variant: "body2",
330
- color: "text.secondary",
292
+ children: [/*#__PURE__*/_jsx(Skeleton, {
293
+ variant: "rectangular",
294
+ sx: {
295
+ position: "absolute",
296
+ top: 0,
297
+ left: 0,
298
+ width: "100%",
299
+ height: "100%",
300
+ borderRadius: "8px",
301
+ zIndex: 0
302
+ }
303
+ }), /*#__PURE__*/_jsx("img", {
304
+ src: editMeetingImages || editBackgroundImages || NualaHeadphonesBackground,
305
+ alt: "Meeting Image",
306
+ onLoad: e => {
307
+ setTimeout(() => {
308
+ e.target.style.opacity = 1;
309
+ }, 500);
310
+ },
311
+ style: {
312
+ position: "absolute",
313
+ top: 0,
314
+ left: 0,
315
+ width: "100%",
316
+ height: "100%",
317
+ objectFit: "cover",
318
+ borderRadius: "8px",
319
+ opacity: 0,
320
+ transition: "opacity 0.5s ease",
321
+ zIndex: 1
322
+ }
323
+ })]
324
+ })
325
+ }), /*#__PURE__*/_jsxs(Box, {
331
326
  sx: {
332
- lineHeight: 1.6,
333
- whiteSpace: "pre-line"
327
+ flexBasis: "70%",
328
+ maxWidth: "70%"
334
329
  },
335
- children: selectedGroup.meetingPrompt
336
- })]
337
- }), /*#__PURE__*/_jsxs(Box, {
338
- sx: {
339
- display: "flex",
340
- flexDirection: "column",
341
- alignItems: "center",
342
- justifyContent: "flex-start",
343
- minWidth: 100
344
- },
345
- children: [/*#__PURE__*/_jsxs(Box, {
330
+ children: [/*#__PURE__*/_jsx(Typography, {
331
+ variant: "h5",
332
+ component: "h2",
333
+ sx: {
334
+ fontWeight: 600,
335
+ mb: 2,
336
+ color: "text.primary"
337
+ },
338
+ children: selectedGroup?.meetingTopic || t("discussion")
339
+ }), selectedGroup?.meetingPrompt && /*#__PURE__*/_jsx(Typography, {
340
+ variant: "body2",
341
+ color: "text.secondary",
342
+ sx: {
343
+ lineHeight: 1.6,
344
+ whiteSpace: "pre-line"
345
+ },
346
+ children: selectedGroup.meetingPrompt
347
+ })]
348
+ }), /*#__PURE__*/_jsxs(Box, {
346
349
  sx: {
347
- position: "relative",
348
- display: "inline-flex",
349
- width: 100,
350
- height: 100
350
+ display: "flex",
351
+ flexDirection: "column",
352
+ alignItems: "center",
353
+ justifyContent: "flex-start",
354
+ minWidth: 100
351
355
  },
352
- children: [/*#__PURE__*/_jsx(CircularProgress, {
353
- variant: "determinate",
354
- value: progress,
355
- size: 100,
356
- thickness: 4.5,
356
+ children: [/*#__PURE__*/_jsxs(Box, {
357
357
  sx: {
358
- color: ringColor
359
- }
360
- }), /*#__PURE__*/_jsx(Box, {
361
- sx: {
362
- top: 0,
363
- left: 0,
364
- bottom: 0,
365
- right: 0,
366
- position: "absolute",
367
- display: "flex",
368
- alignItems: "center",
369
- justifyContent: "center"
358
+ position: "relative",
359
+ display: "inline-flex",
360
+ width: 100,
361
+ height: 100
370
362
  },
371
- children: /*#__PURE__*/_jsxs(Typography, {
372
- variant: "h6",
373
- fontWeight: 700,
363
+ children: [/*#__PURE__*/_jsx(CircularProgress, {
364
+ variant: "determinate",
365
+ value: progress,
366
+ size: 100,
367
+ thickness: 4.5,
374
368
  sx: {
375
369
  color: ringColor
370
+ }
371
+ }), /*#__PURE__*/_jsx(Box, {
372
+ sx: {
373
+ top: 0,
374
+ left: 0,
375
+ bottom: 0,
376
+ right: 0,
377
+ position: "absolute",
378
+ display: "flex",
379
+ alignItems: "center",
380
+ justifyContent: "center"
376
381
  },
377
- children: [submittedCount, " / ", totalDiscussions]
378
- })
382
+ children: /*#__PURE__*/_jsxs(Typography, {
383
+ variant: "h6",
384
+ fontWeight: 700,
385
+ sx: {
386
+ color: ringColor
387
+ },
388
+ children: [submittedCount, " / ", totalDiscussions]
389
+ })
390
+ })]
391
+ }), /*#__PURE__*/_jsx(Typography, {
392
+ variant: "caption",
393
+ sx: {
394
+ mt: 1,
395
+ fontWeight: "bold",
396
+ color: ringColor,
397
+ textAlign: "center",
398
+ textTransform: "uppercase",
399
+ letterSpacing: 0.2
400
+ },
401
+ children: t("submissions")
379
402
  })]
403
+ })]
404
+ }), /*#__PURE__*/_jsxs(Paper, {
405
+ elevation: 3,
406
+ sx: {
407
+ position: "sticky",
408
+ top: 8,
409
+ zIndex: 10,
410
+ p: 2,
411
+ mb: 3,
412
+ display: "flex",
413
+ alignItems: "center",
414
+ gap: 2,
415
+ borderRadius: 2,
416
+ border: "none",
417
+ borderColor: "divider",
418
+ transition: "all 0.3s ease"
419
+ },
420
+ children: [/*#__PURE__*/_jsx(Checkbox, {
421
+ checked: checkedAll,
422
+ onChange: handleCheckAll,
423
+ disabled: submittedCount === 0
380
424
  }), /*#__PURE__*/_jsx(Typography, {
381
- variant: "caption",
425
+ variant: "body2",
426
+ fontWeight: 600,
427
+ children: selectedCount > 0 ? `${selectedCount} ${t("selected")}` : `${t("select_all")} (0 / ${submittedCount})`
428
+ }), /*#__PURE__*/_jsx(Divider, {
429
+ orientation: "vertical",
430
+ flexItem: true,
431
+ sx: {
432
+ bgcolor: "rgba(255, 255, 255, 0.3)"
433
+ }
434
+ }), /*#__PURE__*/_jsx(Box, {
382
435
  sx: {
383
- mt: 1,
384
- fontWeight: "bold",
385
- color: ringColor,
386
- textAlign: "center",
387
- textTransform: "uppercase",
388
- letterSpacing: 0.2
436
+ flex: 1
437
+ }
438
+ }), /*#__PURE__*/_jsx(Button, {
439
+ variant: "contained",
440
+ color: "secondary",
441
+ endIcon: /*#__PURE__*/_jsx(AutoFixHighIcon, {}),
442
+ disabled: selectedCount === 0 || isGeneratingAll,
443
+ onClick: handleGenerateFeedbackForAll,
444
+ sx: {
445
+ fontWeight: 600
389
446
  },
390
- children: t("submissions")
447
+ children: isGeneratingAll ? t("generating") : t("generate_feedback")
448
+ }), hasReachedBottom ? /*#__PURE__*/_jsx(Button, {
449
+ variant: "contained",
450
+ disabled: !isSubmitAllEnabled || selectedCount === 0,
451
+ endIcon: /*#__PURE__*/_jsx(CheckCircleIcon, {}),
452
+ onClick: handleSubmitMultipleFeedback,
453
+ children: t("submit_feedback")
454
+ }) : /*#__PURE__*/_jsx(Tooltip, {
455
+ title: t("submit_feedback_scroll"),
456
+ children: /*#__PURE__*/_jsx("span", {
457
+ children: /*#__PURE__*/_jsx(Button, {
458
+ variant: "contained",
459
+ disabled: !isSubmitAllEnabled || selectedCount === 0,
460
+ endIcon: /*#__PURE__*/_jsx(CheckCircleIcon, {}),
461
+ onClick: handleSubmitMultipleFeedback,
462
+ children: t("submit_feedback")
463
+ })
464
+ })
391
465
  })]
466
+ }), discussionsInGroup.sort((a, b) => {
467
+ const aHasSubmission = Boolean(submissionsByMeetingId[a.meetingID || a.meetingId]);
468
+ const bHasSubmission = Boolean(submissionsByMeetingId[b.meetingID || b.meetingId]);
469
+ return bHasSubmission - aHasSubmission;
470
+ }).map((discussion, index) => {
471
+ const discMeetingId = discussion.meetingID || discussion.meetingId;
472
+ const submissionForThisDiscussion = submissionsByMeetingId[discMeetingId];
473
+ const hasSubmission = Boolean(submissionForThisDiscussion);
474
+ const discussionData = {
475
+ ...discussion,
476
+ ...(submissionForThisDiscussion || {}),
477
+ conversation: submissionForThisDiscussion?.conversation || [],
478
+ s3Url: submissionForThisDiscussion?.s3Url || "",
479
+ joinedMembers: submissionForThisDiscussion?.joinedMembers || [],
480
+ hasBadLanguage: submissionForThisDiscussion?.hasBadLanguage || false,
481
+ meetingId: submissionForThisDiscussion?.meetingId || submissionForThisDiscussion?.meetingID,
482
+ extMeetingId: submissionForThisDiscussion?.extMeetingId,
483
+ creator: submissionForThisDiscussion?.creator
484
+ };
485
+ const feedbackMeetingId = submissionForThisDiscussion?.meetingId || submissionForThisDiscussion?.meetingID;
486
+ return /*#__PURE__*/_jsx(FeedbackCard, {
487
+ t: t,
488
+ discussionData: discussionData,
489
+ userData: userData,
490
+ hasSubmission: hasSubmission,
491
+ aiGrade: aiGrade[discussionData.meetingId || discussionData.meetingID] || {},
492
+ existingFeedback: feedbackByMeetingId[feedbackMeetingId] || {},
493
+ onGenerateFeedback: () => handleGenerateFeedback(discussionData),
494
+ onSubmitFeedback: handleSubmitFeedback,
495
+ setSelectedRecording: setSelectedRecording,
496
+ selectedRecording: selectedRecording,
497
+ s3Url: s3Url,
498
+ playerRef: playerRef,
499
+ conversation: conversation,
500
+ generateAllUsed: generateAllUsed,
501
+ setGenerateAllUsed: setGenerateAllUsed,
502
+ checkedSubmissions: checkedSubmissions,
503
+ setCheckedSubmissions: setCheckedSubmissions,
504
+ submitTrigger: checkedSubmissions[discussionData.meetingId || discussionData.meetingID] ? submitTrigger : null,
505
+ onSubmissionComplete: handleSubmissionComplete,
506
+ goToTimestamp: goToTimestamp,
507
+ startTimes: startTimes,
508
+ canSubmitAll: canSubmit,
509
+ setCanSubmit: setCanSubmit,
510
+ setIsGeneratingIndividual: setIsGeneratingIndividual
511
+ }, discussion.meetingId || discussion.meetingID || index);
512
+ }), /*#__PURE__*/_jsx("div", {
513
+ ref: bottomRefCallback,
514
+ style: {
515
+ height: 1
516
+ }
392
517
  })]
393
- }), /*#__PURE__*/_jsxs(Paper, {
394
- elevation: 3,
518
+ })
519
+ })]
520
+ }), /*#__PURE__*/_jsx(Dialog, {
521
+ open: isAnyGenerating,
522
+ maxWidth: "sm",
523
+ fullWidth: true,
524
+ PaperProps: {
525
+ sx: {
526
+ borderRadius: 3,
527
+ overflow: "visible"
528
+ }
529
+ },
530
+ children: /*#__PURE__*/_jsx(DialogContent, {
531
+ sx: {
532
+ p: 4
533
+ },
534
+ children: /*#__PURE__*/_jsx(Grid, {
535
+ container: true,
395
536
  sx: {
396
- position: "sticky",
397
- top: 8,
398
- zIndex: 10,
399
- p: 2,
400
- mb: 3,
401
- display: "flex",
402
- alignItems: "center",
403
- gap: 2,
404
- borderRadius: 2,
405
- border: "none",
406
- borderColor: "divider",
407
- transition: "all 0.3s ease"
537
+ width: "100%"
408
538
  },
409
- children: [/*#__PURE__*/_jsx(Checkbox, {
410
- checked: checkedAll,
411
- onChange: handleCheckAll,
412
- disabled: submittedCount === 0
413
- }), /*#__PURE__*/_jsx(Typography, {
414
- variant: "body2",
415
- fontWeight: 600,
416
- children: selectedCount > 0 ? `${selectedCount} ${t("selected")}` : `${t("select_all")} (0 / ${submittedCount})`
417
- }), /*#__PURE__*/_jsx(Divider, {
418
- orientation: "vertical",
419
- flexItem: true,
420
- sx: {
421
- bgcolor: "rgba(255, 255, 255, 0.3)"
422
- }
423
- }), /*#__PURE__*/_jsx(Box, {
424
- sx: {
425
- flex: 1
426
- }
427
- }), /*#__PURE__*/_jsx(Button, {
428
- variant: "contained",
429
- color: "secondary",
430
- endIcon: /*#__PURE__*/_jsx(AutoFixHighIcon, {}),
431
- disabled: selectedCount === 0,
432
- onClick: handleGenerateFeedbackForAll,
539
+ children: /*#__PURE__*/_jsxs(Grid, {
540
+ size: 12,
433
541
  sx: {
434
- fontWeight: 600
542
+ display: "flex",
543
+ flexDirection: "column",
544
+ alignItems: "center",
545
+ justifyContent: "center",
546
+ textAlign: "center",
547
+ gap: 3,
548
+ py: 2
435
549
  },
436
- children: t("generate_feedback")
437
- }), hasReachedBottom ? /*#__PURE__*/_jsx(Button, {
438
- variant: "contained",
439
- disabled: !isSubmitAllEnabled || selectedCount === 0,
440
- endIcon: /*#__PURE__*/_jsx(CheckCircleIcon, {}),
441
- onClick: handleSubmitMultipleFeedback,
442
- children: t("submit_feedback")
443
- }) : /*#__PURE__*/_jsx(Tooltip, {
444
- title: t("submit_feedback_scroll"),
445
- children: /*#__PURE__*/_jsx("span", {
446
- children: /*#__PURE__*/_jsx(Button, {
447
- variant: "contained",
448
- disabled: !isSubmitAllEnabled || selectedCount === 0,
449
- endIcon: /*#__PURE__*/_jsx(CheckCircleIcon, {}),
450
- onClick: handleSubmitMultipleFeedback,
451
- children: t("submit_feedback")
452
- })
453
- })
454
- })]
455
- }), discussionsInGroup.sort((a, b) => {
456
- const aHasSubmission = Boolean(submissionsByMeetingId[a.meetingID || a.meetingId]);
457
- const bHasSubmission = Boolean(submissionsByMeetingId[b.meetingID || b.meetingId]);
458
- return bHasSubmission - aHasSubmission;
459
- }).map((discussion, index) => {
460
- const discMeetingId = discussion.meetingID || discussion.meetingId;
461
- const submissionForThisDiscussion = submissionsByMeetingId[discMeetingId];
462
- const hasSubmission = Boolean(submissionForThisDiscussion);
463
- const discussionData = {
464
- ...discussion,
465
- ...(submissionForThisDiscussion || {}),
466
- conversation: submissionForThisDiscussion?.conversation || [],
467
- s3Url: submissionForThisDiscussion?.s3Url || "",
468
- joinedMembers: submissionForThisDiscussion?.joinedMembers || [],
469
- hasBadLanguage: submissionForThisDiscussion?.hasBadLanguage || false,
470
- meetingId: submissionForThisDiscussion?.meetingId || submissionForThisDiscussion?.meetingID,
471
- extMeetingId: submissionForThisDiscussion?.extMeetingId,
472
- creator: submissionForThisDiscussion?.creator
473
- };
474
- const feedbackMeetingId = submissionForThisDiscussion?.meetingId || submissionForThisDiscussion?.meetingID;
475
- return /*#__PURE__*/_jsx(FeedbackCard, {
476
- t: t,
477
- discussionData: discussionData,
478
- userData: userData,
479
- hasSubmission: hasSubmission,
480
- aiGrade: aiGrade[discussionData.meetingId || discussionData.meetingID] || {},
481
- existingFeedback: feedbackByMeetingId[feedbackMeetingId] || {},
482
- onGenerateFeedback: () => handleGenerateFeedback(discussionData),
483
- onSubmitFeedback: handleSubmitFeedback,
484
- setSelectedRecording: setSelectedRecording,
485
- selectedRecording: selectedRecording,
486
- s3Url: s3Url,
487
- playerRef: playerRef,
488
- conversation: conversation,
489
- generateAllUsed: generateAllUsed,
490
- setGenerateAllUsed: setGenerateAllUsed,
491
- checkedSubmissions: checkedSubmissions,
492
- setCheckedSubmissions: setCheckedSubmissions,
493
- submitTrigger: checkedSubmissions[discussionData.meetingId || discussionData.meetingID] ? submitTrigger : null,
494
- onSubmissionComplete: handleSubmissionComplete,
495
- goToTimestamp: goToTimestamp,
496
- startTimes: startTimes,
497
- canSubmitAll: canSubmit,
498
- setCanSubmit: setCanSubmit
499
- }, discussion.meetingId || discussion.meetingID || index);
500
- }), /*#__PURE__*/_jsx("div", {
501
- ref: bottomRefCallback,
502
- style: {
503
- height: 1
504
- }
505
- })]
550
+ children: [/*#__PURE__*/_jsx(Typography, {
551
+ variant: "h5",
552
+ sx: {
553
+ fontWeight: 600,
554
+ color: "text.primary"
555
+ },
556
+ children: t("generating_feedback")
557
+ }), /*#__PURE__*/_jsx(Box, {
558
+ sx: {
559
+ maxWidth: 500,
560
+ width: "100%"
561
+ },
562
+ children: /*#__PURE__*/_jsx(NualaCreating, {})
563
+ })]
564
+ })
565
+ })
506
566
  })
507
567
  })]
508
568
  });
@@ -34,6 +34,7 @@ function Contact({
34
34
  freeTrial: false,
35
35
  requestDemo: false,
36
36
  newsAndUpdates: false,
37
+ jobTitle: "",
37
38
  ...initialValues
38
39
  });
39
40
  const handleChange = event => {
@@ -65,7 +66,8 @@ function Contact({
65
66
  message,
66
67
  freeTrial,
67
68
  requestDemo,
68
- newsAndUpdates
69
+ newsAndUpdates,
70
+ jobTitle
69
71
  } = values;
70
72
  const roles = [{
71
73
  value: "",
@@ -277,6 +279,23 @@ function Contact({
277
279
  rows: 3,
278
280
  maxRows: 3
279
281
  })
282
+ }), /*#__PURE__*/_jsx(Grid, {
283
+ size: 12,
284
+ children: /*#__PURE__*/_jsx(TextField, {
285
+ name: "jobTitle",
286
+ value: jobTitle || "",
287
+ onChange: handleChange,
288
+ autoComplete: "off",
289
+ tabIndex: -1,
290
+ sx: {
291
+ position: "absolute",
292
+ left: "-10000px",
293
+ top: "auto",
294
+ width: "1px",
295
+ height: "1px",
296
+ overflow: "hidden"
297
+ }
298
+ })
280
299
  }), !disableCheckboxes && /*#__PURE__*/_jsx(Grid, {
281
300
  size: 12,
282
301
  children: /*#__PURE__*/_jsxs(FormControl, {
@@ -7,7 +7,7 @@ const SingleLineGridList = styled(ImageList)(() => ({
7
7
  }));
8
8
  const minWidth = {
9
9
  xs: 330,
10
- sm: 380
10
+ sm: 360
11
11
  };
12
12
  const SingleLineGridListItem = styled(ImageListItem)(({
13
13
  theme
@@ -1,3 +1,4 @@
1
+ import { useState } from "react";
1
2
  import { Box } from "@mui/material";
2
3
  import Nuala from "./Nuala1";
3
4
  import Nuala2 from "./Nuala2";
@@ -8,8 +9,10 @@ export default function NualaCreating() {
8
9
  // Create an array with the three components
9
10
  const images = [/*#__PURE__*/_jsx(Nuala, {}), /*#__PURE__*/_jsx(Nuala2, {}), /*#__PURE__*/_jsx(Nuala3, {})];
10
11
 
11
- // Randomly select one of the images
12
- const randomImage = images[Math.floor(Math.random() * images.length)];
12
+ // Use useState to pick a random image only once on mount
13
+ const [randomImage] = useState(() => {
14
+ return images[Math.floor(Math.random() * images.length)];
15
+ });
13
16
  return /*#__PURE__*/_jsx(Box, {
14
17
  sx: {
15
18
  maxWidth: 500,
@@ -108,7 +108,7 @@ export default function AppBreadcrumbs(props) {
108
108
  } = props;
109
109
  routes = appRoutes;
110
110
  return /*#__PURE__*/_jsx(Paper, {
111
- elevation: 0,
111
+ elevation: 1,
112
112
  square: true,
113
113
  className: classes.paper,
114
114
  children: /*#__PURE__*/_jsx(Breadcrumbs, {})
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nualang/nualang-ui-components",
3
- "version": "0.1.1323",
3
+ "version": "0.1.1327",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "files": [