@nualang/nualang-ui-components 0.1.1317 → 0.1.1318
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useState, useEffect, Fragment } from "react";
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
3
|
import { withStyles } from "tss-react/mui";
|
|
4
|
+
import { useNavigate, useLocation } from "react-router-dom";
|
|
4
5
|
import { Typography, Box, List, Dialog, DialogContent, Card, CardActionArea, Button, Select, FormControl, InputLabel, IconButton, Tooltip, CircularProgress, Divider, MenuItem } from "@mui/material";
|
|
5
6
|
import { red, orange, green, grey } from "@mui/material/colors";
|
|
6
7
|
import Styles from "../../utils/Styles";
|
|
@@ -11,6 +12,7 @@ import EditIcon from "@mui/icons-material/Edit";
|
|
|
11
12
|
import ArchiveIcon from "@mui/icons-material/Archive";
|
|
12
13
|
import dayjs from "dayjs";
|
|
13
14
|
import GroupFeedbackDialog from "../../Dialogs/GroupedFeedbackDialog/GroupedFeedbackDialog";
|
|
15
|
+
import { useUrlQueryParam } from "../../hooks/useUrlQueryParam";
|
|
14
16
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
15
17
|
const MeetingPromptsList = withStyles(({
|
|
16
18
|
scheduleListData,
|
|
@@ -39,6 +41,8 @@ const MeetingPromptsList = withStyles(({
|
|
|
39
41
|
getRecordings,
|
|
40
42
|
startTimes = {}
|
|
41
43
|
}) => {
|
|
44
|
+
const navigate = useNavigate();
|
|
45
|
+
const location = useLocation();
|
|
42
46
|
const [selectedGroup, setSelectedGroup] = useState({});
|
|
43
47
|
const [isDialogOpen, setDialogOpen] = useState(false);
|
|
44
48
|
const [meetingCounts, setMeetingCounts] = useState({});
|
|
@@ -51,6 +55,20 @@ const MeetingPromptsList = withStyles(({
|
|
|
51
55
|
const [isRecordingDialogOpen, setIsRecordingDialogOpen] = useState(false);
|
|
52
56
|
const [attendeesData, setAttendeesData] = useState([]);
|
|
53
57
|
const [loading, setLoading] = useState(false);
|
|
58
|
+
const [groupedIdFromUrl, setGroupedIdFromUrl, clearGroupedId] = useUrlQueryParam("groupedId", {
|
|
59
|
+
hash: "Discuss"
|
|
60
|
+
});
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
if (groupedIdFromUrl && scheduleListData.length > 0) {
|
|
63
|
+
const discussion = scheduleListData.find(item => item.groupedId === groupedIdFromUrl);
|
|
64
|
+
if (discussion) {
|
|
65
|
+
setSelectedGroup(discussion);
|
|
66
|
+
setSelectedDiscussion(discussion);
|
|
67
|
+
setGroupedId(discussion.groupedId);
|
|
68
|
+
setDialogOpen(true);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}, [groupedIdFromUrl, scheduleListData, setSelectedDiscussion]);
|
|
54
72
|
const calculateMeetingCounts = () => {
|
|
55
73
|
const counts = {};
|
|
56
74
|
scheduleListData?.forEach(item => {
|
|
@@ -113,6 +131,8 @@ const MeetingPromptsList = withStyles(({
|
|
|
113
131
|
};
|
|
114
132
|
const closeDialog = () => {
|
|
115
133
|
setDialogOpen(false);
|
|
134
|
+
setSelectedGroup({});
|
|
135
|
+
clearGroupedId();
|
|
116
136
|
};
|
|
117
137
|
useEffect(() => {
|
|
118
138
|
const selectedDiscussionGroup = scheduleListData.filter(item => item.groupedId === groupedId);
|
|
@@ -201,6 +221,7 @@ const MeetingPromptsList = withStyles(({
|
|
|
201
221
|
setSelectedDiscussion(discussion);
|
|
202
222
|
setGroupedId(discussion?.groupedId);
|
|
203
223
|
openDialog();
|
|
224
|
+
setGroupedIdFromUrl(discussion.groupedId);
|
|
204
225
|
},
|
|
205
226
|
children: /*#__PURE__*/_jsxs(Box, {
|
|
206
227
|
sx: {
|
|
@@ -361,8 +382,7 @@ const MeetingPromptsList = withStyles(({
|
|
|
361
382
|
}), sortedScheduleListData?.length > cardsToShow && /*#__PURE__*/_jsx(Button, {
|
|
362
383
|
variant: "outlined",
|
|
363
384
|
"aria-label": t("view_more"),
|
|
364
|
-
onClick: () => setCardsToShow(cardsToShow + 2)
|
|
365
|
-
,
|
|
385
|
+
onClick: () => setCardsToShow(cardsToShow + 2),
|
|
366
386
|
children: t("view_more")
|
|
367
387
|
})]
|
|
368
388
|
}), /*#__PURE__*/_jsx(ConfirmDeleteDiscussion, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useState, Fragment } from "react";
|
|
1
|
+
import { useState, useEffect, Fragment } from "react";
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
3
|
import { withStyles } from "tss-react/mui";
|
|
4
4
|
import { Typography, Box, Button } from "@mui/material";
|
|
@@ -7,6 +7,7 @@ import RecordingDialog from "../../Dialogs/RecordingDialog/RecordingDialog";
|
|
|
7
7
|
import FeedbackDialog from "../../Dialogs/FeedbackInfoDialog/FeedbackInfoDialog";
|
|
8
8
|
import RecordingCard from "../../Cards/RecordingCard/RecordingCard";
|
|
9
9
|
import LoadingCard from "../../Cards/LoadingCard/LoadingCard";
|
|
10
|
+
import { useUrlQueryParam } from "../../hooks/useUrlQueryParam";
|
|
10
11
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
12
|
const RecordingListCards = withStyles(({
|
|
12
13
|
classes,
|
|
@@ -31,6 +32,18 @@ const RecordingListCards = withStyles(({
|
|
|
31
32
|
const [open, setOpen] = useState(false);
|
|
32
33
|
const [feedbackOpen, setFeedbackOpen] = useState(false);
|
|
33
34
|
const [cardsToShow, setCardsToShow] = useState(3);
|
|
35
|
+
const [recordingIdFromUrl, setRecordingIdFromUrl, clearRecordingIdFromUrl] = useUrlQueryParam("meetingId", {
|
|
36
|
+
hash: 'Discuss'
|
|
37
|
+
});
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (recordingIdFromUrl && recordingsTableData.length > 0) {
|
|
40
|
+
const recording = recordingsTableData.find(rec => (rec.meetingId || rec.meetingID)?.toString() === recordingIdFromUrl.toString());
|
|
41
|
+
if (recording) {
|
|
42
|
+
setSelectedRecording(recording);
|
|
43
|
+
setOpen(true);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}, [recordingIdFromUrl, recordingsTableData, setSelectedRecording]);
|
|
34
47
|
const attendeeUsernames = [];
|
|
35
48
|
userData.forEach(user => {
|
|
36
49
|
[selectedRecording?.attendees].flat().forEach(attendee => {
|
|
@@ -50,6 +63,7 @@ const RecordingListCards = withStyles(({
|
|
|
50
63
|
const handleJoin = recording => {
|
|
51
64
|
setSelectedRecording(recording);
|
|
52
65
|
setOpen(true);
|
|
66
|
+
setRecordingIdFromUrl(recording.meetingId);
|
|
53
67
|
};
|
|
54
68
|
const handleFeedbackJoin = recording => {
|
|
55
69
|
setSelectedRecording(recording);
|
|
@@ -58,6 +72,7 @@ const RecordingListCards = withStyles(({
|
|
|
58
72
|
const handleClose = () => {
|
|
59
73
|
resetVideoState();
|
|
60
74
|
setOpen(false);
|
|
75
|
+
clearRecordingIdFromUrl();
|
|
61
76
|
};
|
|
62
77
|
return /*#__PURE__*/_jsxs(Fragment, {
|
|
63
78
|
children: [/*#__PURE__*/_jsx(Box, {
|
|
@@ -122,25 +137,21 @@ const RecordingListCards = withStyles(({
|
|
|
122
137
|
})), recordingsTableData?.length > cardsToShow && /*#__PURE__*/_jsx(Button, {
|
|
123
138
|
variant: "outlined",
|
|
124
139
|
"aria-label": t("view_more"),
|
|
125
|
-
onClick: () => setCardsToShow(cardsToShow + 2)
|
|
126
|
-
,
|
|
140
|
+
onClick: () => setCardsToShow(cardsToShow + 2),
|
|
127
141
|
children: t("view_more")
|
|
128
142
|
})]
|
|
129
|
-
}) : /*#__PURE__*/_jsx(
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
variant: "h5",
|
|
142
|
-
children: t("no_recordings_found")
|
|
143
|
-
})
|
|
143
|
+
}) : /*#__PURE__*/_jsx(Box, {
|
|
144
|
+
sx: {
|
|
145
|
+
display: "flex",
|
|
146
|
+
alignItems: "center",
|
|
147
|
+
justifyContent: "center",
|
|
148
|
+
height: "15vh",
|
|
149
|
+
textAlign: "center"
|
|
150
|
+
},
|
|
151
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
|
152
|
+
component: "h5",
|
|
153
|
+
variant: "h5",
|
|
154
|
+
children: t("no_recordings_found")
|
|
144
155
|
})
|
|
145
156
|
})]
|
|
146
157
|
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useCallback } from "react";
|
|
2
|
+
import { useLocation, useNavigate } from "react-router-dom";
|
|
3
|
+
export function useUrlQueryParam(name, {
|
|
4
|
+
hash
|
|
5
|
+
}) {
|
|
6
|
+
const location = useLocation();
|
|
7
|
+
const navigate = useNavigate();
|
|
8
|
+
const params = new URLSearchParams(location.search);
|
|
9
|
+
const value = params.get(name);
|
|
10
|
+
const setValue = useCallback(newValue => {
|
|
11
|
+
const newParams = new URLSearchParams(location.search);
|
|
12
|
+
if (newValue === null || newValue === undefined) {
|
|
13
|
+
newParams.delete(name);
|
|
14
|
+
} else {
|
|
15
|
+
newParams.set(name, newValue);
|
|
16
|
+
}
|
|
17
|
+
const queryString = newParams.toString();
|
|
18
|
+
const hashSuffix = hash ? `#${hash}` : location.hash;
|
|
19
|
+
navigate(`${location.pathname}${queryString ? `?${queryString}` : ""}${hashSuffix || ""}`, {
|
|
20
|
+
replace: true
|
|
21
|
+
});
|
|
22
|
+
}, [hash, location.pathname, location.search, location.hash, name, navigate]);
|
|
23
|
+
const clear = useCallback(() => {
|
|
24
|
+
setValue(null);
|
|
25
|
+
}, [setValue]);
|
|
26
|
+
return [value, setValue, clear];
|
|
27
|
+
}
|