eionet2-dashboard 1.4.0

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 (111) hide show
  1. package/.fx/configs/azure.parameters.Prod_EEA.json +15 -0
  2. package/.fx/configs/azure.parameters.dev.json +15 -0
  3. package/.fx/configs/config.Prod_EEA.json +10 -0
  4. package/.fx/configs/config.dev.json +10 -0
  5. package/.fx/configs/projectSettings.json +83 -0
  6. package/.fx/states/state.Prod_EEA.json +47 -0
  7. package/.fx/states/state.dev.json +47 -0
  8. package/.vscode/launch.json +91 -0
  9. package/.vscode/settings.json +6 -0
  10. package/.vscode/tasks.json +63 -0
  11. package/CHANGELOG.md +140 -0
  12. package/Jenkinsfile +166 -0
  13. package/LICENSE.md +9 -0
  14. package/README.md +55 -0
  15. package/api/.funcignore +11 -0
  16. package/api/extensions.csproj +11 -0
  17. package/api/getGraphData/function.json +27 -0
  18. package/api/getGraphData/index.js +147 -0
  19. package/api/host.json +11 -0
  20. package/api/package-lock.json +1546 -0
  21. package/api/package.json +17 -0
  22. package/api/proxies.json +4 -0
  23. package/package.json +25 -0
  24. package/tabs/.env.teamsfx.Prod_EEA +11 -0
  25. package/tabs/.env.teamsfx.dev +11 -0
  26. package/tabs/.eslintrc.json +48 -0
  27. package/tabs/.prettierrc +7 -0
  28. package/tabs/.stylelintrc.json +6 -0
  29. package/tabs/babel.config.js +3 -0
  30. package/tabs/package-lock.json +15564 -0
  31. package/tabs/package.json +88 -0
  32. package/tabs/public/auth-end.html +76 -0
  33. package/tabs/public/auth-start.html +178 -0
  34. package/tabs/public/deploy.png +0 -0
  35. package/tabs/public/favicon.ico +0 -0
  36. package/tabs/public/hello.png +0 -0
  37. package/tabs/public/index.html +20 -0
  38. package/tabs/public/publish.png +0 -0
  39. package/tabs/src/components/App.jsx +36 -0
  40. package/tabs/src/components/CustomColumnResizeIcon.jsx +68 -0
  41. package/tabs/src/components/CustomDrawer.jsx +51 -0
  42. package/tabs/src/components/EventDialogTitle.jsx +29 -0
  43. package/tabs/src/components/HtmlBox.jsx +18 -0
  44. package/tabs/src/components/Privacy.jsx +17 -0
  45. package/tabs/src/components/ResizableGrid.jsx +44 -0
  46. package/tabs/src/components/Tab.jsx +477 -0
  47. package/tabs/src/components/Tab.scss +138 -0
  48. package/tabs/src/components/TabConfig.jsx +51 -0
  49. package/tabs/src/components/TabPanel.jsx +29 -0
  50. package/tabs/src/components/TermsOfUse.jsx +17 -0
  51. package/tabs/src/components/UnderConstruction.jsx +24 -0
  52. package/tabs/src/components/UserMenu.jsx +109 -0
  53. package/tabs/src/components/_variables.scss +10 -0
  54. package/tabs/src/components/activity/Activity.jsx +301 -0
  55. package/tabs/src/components/activity/ConsultationList.jsx +297 -0
  56. package/tabs/src/components/activity/EventList.jsx +463 -0
  57. package/tabs/src/components/activity/GroupsTags.jsx +26 -0
  58. package/tabs/src/components/activity/Reporting.jsx +13 -0
  59. package/tabs/src/components/activity/activity.scss +153 -0
  60. package/tabs/src/components/event_rating/EventRating.jsx +92 -0
  61. package/tabs/src/components/event_rating/EventRatingDialog.jsx +46 -0
  62. package/tabs/src/components/event_registration/Approval.jsx +80 -0
  63. package/tabs/src/components/event_registration/ApprovalDialog.jsx +30 -0
  64. package/tabs/src/components/event_registration/ApprovalList.jsx +62 -0
  65. package/tabs/src/components/event_registration/EventRegistration.jsx +214 -0
  66. package/tabs/src/components/lib/useData.js +33 -0
  67. package/tabs/src/components/lib/useGraph.js +39 -0
  68. package/tabs/src/components/lib/useTeamsFx.js +55 -0
  69. package/tabs/src/components/my_country/AtAGlance.jsx +151 -0
  70. package/tabs/src/components/my_country/CountryProgress.jsx +92 -0
  71. package/tabs/src/components/my_country/DataReporters.jsx +13 -0
  72. package/tabs/src/components/my_country/GroupView.jsx +54 -0
  73. package/tabs/src/components/my_country/GroupsBoard.jsx +52 -0
  74. package/tabs/src/components/my_country/IndicatorCard.jsx +60 -0
  75. package/tabs/src/components/my_country/ManagementBoard.jsx +109 -0
  76. package/tabs/src/components/my_country/MyCountry.jsx +186 -0
  77. package/tabs/src/components/my_country/ProgressGauge.jsx +125 -0
  78. package/tabs/src/components/my_country/ScientificCommittee.jsx +13 -0
  79. package/tabs/src/components/my_country/YearlyProgress.jsx +41 -0
  80. package/tabs/src/components/my_country/my_country.scss +81 -0
  81. package/tabs/src/components/publications/Publications.jsx +13 -0
  82. package/tabs/src/components/self_service/UserEdit.jsx +334 -0
  83. package/tabs/src/components/self_service/UserEdit.scss +107 -0
  84. package/tabs/src/data/apiProvider.js +153 -0
  85. package/tabs/src/data/constants.json +7 -0
  86. package/tabs/src/data/hooks/useConfiguration.js +18 -0
  87. package/tabs/src/data/icsHelper.js +38 -0
  88. package/tabs/src/data/messages.json +39 -0
  89. package/tabs/src/data/provider.js +199 -0
  90. package/tabs/src/data/selfServiceProvider.js +59 -0
  91. package/tabs/src/data/selfServiceSharepointProvider.js +68 -0
  92. package/tabs/src/data/sharepointProvider.js +729 -0
  93. package/tabs/src/data/validator.js +25 -0
  94. package/tabs/src/data/validator.test.js +9 -0
  95. package/tabs/src/index.css +16 -0
  96. package/tabs/src/index.jsx +6 -0
  97. package/tabs/src/static/images/teams-icon.svg +1 -0
  98. package/tabs/src/utils/uiHelper.js +6 -0
  99. package/templates/appPackage/aad.template.json +133 -0
  100. package/templates/appPackage/manifest.template.json +58 -0
  101. package/templates/appPackage/resources/color.png +0 -0
  102. package/templates/appPackage/resources/outline.png +0 -0
  103. package/templates/azure/config.bicep +27 -0
  104. package/templates/azure/main.bicep +20 -0
  105. package/templates/azure/provision/frontendHosting.bicep +23 -0
  106. package/templates/azure/provision/function.bicep +82 -0
  107. package/templates/azure/provision/identity.bicep +14 -0
  108. package/templates/azure/provision/simpleAuth.bicep +44 -0
  109. package/templates/azure/provision.bicep +58 -0
  110. package/templates/azure/teamsFx/function.bicep +76 -0
  111. package/templates/azure/teamsFx/simpleAuth.bicep +43 -0
@@ -0,0 +1,297 @@
1
+ import { React, useCallback, useState } from 'react';
2
+ import { format } from 'date-fns';
3
+ import { Button, Box, Typography, Link, Dialog, IconButton, Tooltip } from '@mui/material';
4
+ import TaskAltIcon from '@mui/icons-material/TaskAlt';
5
+ import AssignmentIcon from '@mui/icons-material/Assignment';
6
+ import GradingIcon from '@mui/icons-material/Grading';
7
+
8
+ import { GroupsTags } from './GroupsTags';
9
+ import ResizableGrid from '../ResizableGrid';
10
+
11
+ export function ConsultationList({
12
+ userInfo,
13
+ configuration,
14
+ openConsultations,
15
+ reviewConsultations,
16
+ finalisedConsultations,
17
+ type,
18
+ tabsValue,
19
+ }) {
20
+ const [tagsCellOpen, setTagCellOpen] = useState(false),
21
+ [selectedGroups, setSelectedGroups] = useState([]);
22
+
23
+ const renderConsultationTitle = (params) => {
24
+ return (
25
+ <Box>
26
+ {params.row.Linktofolder && (
27
+ <Tooltip title={params.row.Title}>
28
+ <Link
29
+ className="grid-text"
30
+ style={{ overflow: 'hidden', textOverflow: 'ellipsis' }}
31
+ component="button"
32
+ variant="body1"
33
+ onClick={() => {
34
+ params.row.Linktofolder && window.open(params.row.Linktofolder, '_blank');
35
+ }}
36
+ >
37
+ {params.row.Title}
38
+ </Link>
39
+ </Tooltip>
40
+ )}
41
+
42
+ {!params.row.Linktofolder && (
43
+ <Tooltip title={params.row.Title}>
44
+ <Typography
45
+ className="grid-text"
46
+ style={{ overflow: 'hidden', textOverflow: 'ellipsis' }}
47
+ variant="body1"
48
+ component={'span'}
49
+ >
50
+ {params.row.Title}
51
+ </Typography>
52
+ </Tooltip>
53
+ )}
54
+ </Box>
55
+ );
56
+ },
57
+ renderDocument = (params) => {
58
+ return (
59
+ <Tooltip title="See details">
60
+ <IconButton
61
+ variant="contained"
62
+ color="primary"
63
+ onClick={() => {
64
+ params.row.ItemLink && window.open(params.row.ItemLink, '_blank');
65
+ }}
66
+ >
67
+ <AssignmentIcon></AssignmentIcon>
68
+ </IconButton>
69
+ </Tooltip>
70
+ );
71
+ },
72
+ renderGroupsTags = (params) => {
73
+ return <GroupsTags handleClick={handleCellClick} groups={params.row.EionetGroups || []} />;
74
+ },
75
+ renderStartDate = (params) => {
76
+ let dateFormat = configuration.DateFormatDashboard || 'dd-MMM-yyyy';
77
+ return (
78
+ <Typography className="grid-text" variant="body1" component={'span'}>
79
+ {format(params.row.Startdate, dateFormat)}
80
+ </Typography>
81
+ );
82
+ },
83
+ renderDeadline = (params) => {
84
+ let dateFormat = configuration.DateFormatDashboard || 'dd-MMM-yyyy';
85
+ return (
86
+ <Typography className="grid-text" variant="body1" component={'span'}>
87
+ {format(params.row.Deadline, dateFormat)}
88
+ </Typography>
89
+ );
90
+ },
91
+ renderResults = (params) => {
92
+ if (params.row.LinkToResults) {
93
+ return (
94
+ <Tooltip title={configuration.ConsultationResultsTooltip}>
95
+ <IconButton
96
+ variant="contained"
97
+ color="success"
98
+ onClick={() => {
99
+ params.row.LinkToResults && window.open(params.row.LinkToResults, '_blank');
100
+ }}
101
+ >
102
+ <GradingIcon />
103
+ </IconButton>
104
+ </Tooltip>
105
+ );
106
+ }
107
+ },
108
+ renderCountryResponded = (params) => {
109
+ return (
110
+ <div className="grid-cell-centered">
111
+ {params.row.HasUserCountryResponded && (
112
+ <Tooltip title={configuration.CountryRespondedTooltip}>
113
+ <TaskAltIcon color="success"></TaskAltIcon>
114
+ </Tooltip>
115
+ )}
116
+ </div>
117
+ );
118
+ },
119
+ handleCellClick = useCallback(
120
+ (groups) => {
121
+ setTagCellOpen(true);
122
+ setSelectedGroups(groups);
123
+ },
124
+ [tagsCellOpen, selectedGroups],
125
+ ),
126
+ handleTagDialogClose = useCallback(() => {
127
+ setTagCellOpen(false);
128
+ }, [tagsCellOpen]);
129
+
130
+ const startDateColumn = {
131
+ field: 'Startdate',
132
+ headerName: 'Launch date',
133
+ width: '100',
134
+ renderCell: renderStartDate,
135
+ },
136
+ titleColumn = {
137
+ field: 'Closed',
138
+ headerName: type,
139
+ flex: 0.75,
140
+ renderCell: renderConsultationTitle,
141
+ },
142
+ documentColumn = {
143
+ field: 'Title',
144
+ headerName: 'Document',
145
+ width: '100',
146
+ align: 'center',
147
+ renderCell: renderDocument,
148
+ },
149
+ groupsColumn = {
150
+ field: 'EionetGroups',
151
+ headerName: 'Eionet groups',
152
+ renderCell: renderGroupsTags,
153
+ flex: 0.5,
154
+ },
155
+ countryRespondedColumn = {
156
+ field: 'HasUserCountryResponded',
157
+ headerName: 'Responded',
158
+ renderCell: renderCountryResponded,
159
+ align: 'center',
160
+ width: '100',
161
+ };
162
+
163
+ const getCellColor = (params) => {
164
+ if (params.value < 3) {
165
+ return 'red-cell-text';
166
+ }
167
+ };
168
+
169
+ let openColumns = [];
170
+ openColumns.push(titleColumn);
171
+ openColumns.push(documentColumn);
172
+ openColumns.push(groupsColumn);
173
+ openColumns.push(startDateColumn);
174
+ openColumns.push({
175
+ field: 'DaysLeft',
176
+ headerName: 'Days left',
177
+ width: '100',
178
+ align: 'center',
179
+ cellClassName: (params) => {
180
+ return getCellColor(params);
181
+ },
182
+ });
183
+ userInfo.country && openColumns.push(countryRespondedColumn);
184
+
185
+ let reviewColumns = [];
186
+ reviewColumns.push(titleColumn);
187
+ reviewColumns.push(documentColumn);
188
+ reviewColumns.push(groupsColumn);
189
+ reviewColumns.push(startDateColumn);
190
+ reviewColumns.push({
191
+ field: 'DaysFinalised',
192
+ headerName: 'Finalised in (days)',
193
+ width: '170',
194
+ align: 'center',
195
+ cellClassName: (params) => {
196
+ return getCellColor(params);
197
+ },
198
+ });
199
+ userInfo.country && reviewColumns.push(countryRespondedColumn);
200
+
201
+ let finalisedColumns = [];
202
+ finalisedColumns.push(titleColumn);
203
+ finalisedColumns.push(documentColumn);
204
+ finalisedColumns.push(groupsColumn);
205
+ finalisedColumns.push({
206
+ field: 'Deadline',
207
+ headerName: 'Deadline',
208
+ width: '100',
209
+ renderCell: renderDeadline,
210
+ });
211
+ userInfo.country && finalisedColumns.push(countryRespondedColumn);
212
+ finalisedColumns.push({
213
+ field: 'Results',
214
+ headerName: 'Results',
215
+ width: '75',
216
+ align: 'center',
217
+ renderCell: renderResults,
218
+ });
219
+ return (
220
+ <div className="">
221
+ {false && <span>{configuration.toString()}</span>}
222
+ <Box
223
+ sx={{
224
+ boxShadow: 2,
225
+ }}
226
+ >
227
+ <Dialog open={tagsCellOpen} onClose={handleTagDialogClose} maxWidth="xl">
228
+ <GroupsTags groups={selectedGroups} isDialog={true} />
229
+ <Button
230
+ onClick={handleTagDialogClose}
231
+ sx={{ alignSelf: 'end', marginRight: '0.5rem', marginBottom: '0.5rem' }}
232
+ >
233
+ Close
234
+ </Button>
235
+ </Dialog>
236
+ <Box sx={{ display: 'flex', height: '97%', width: '100%' }}>
237
+ {tabsValue == 0 && (
238
+ <ResizableGrid
239
+ rows={openConsultations}
240
+ columns={openColumns}
241
+ hideFooterSelectedRowCount={true}
242
+ pageSizeOptions={[25, 50, 100]}
243
+ initialState={{
244
+ pagination: { paginationModel: { pageSize: 25 } },
245
+ sorting: {
246
+ sortModel: [
247
+ {
248
+ field: 'DaysLeft',
249
+ sort: 'asc',
250
+ },
251
+ ],
252
+ },
253
+ }}
254
+ />
255
+ )}
256
+ {tabsValue == 1 && (
257
+ <ResizableGrid
258
+ rows={reviewConsultations}
259
+ columns={reviewColumns}
260
+ pageSizeOptions={[25, 50, 100]}
261
+ hideFooterSelectedRowCount={true}
262
+ initialState={{
263
+ sorting: {
264
+ sortModel: [
265
+ {
266
+ field: 'DaysFinalised',
267
+ sort: 'asc',
268
+ },
269
+ ],
270
+ },
271
+ }}
272
+ />
273
+ )}
274
+ {tabsValue == 2 && (
275
+ <ResizableGrid
276
+ rows={finalisedConsultations}
277
+ columns={finalisedColumns}
278
+ pageSizeOptions={[25, 50, 100]}
279
+ hideFooterSelectedRowCount={true}
280
+ initialState={{
281
+ pagination: { paginationModel: { pageSize: 25 } },
282
+ sorting: {
283
+ sortModel: [
284
+ {
285
+ field: 'Deadline',
286
+ sort: 'desc',
287
+ },
288
+ ],
289
+ },
290
+ }}
291
+ />
292
+ )}
293
+ </Box>
294
+ </Box>
295
+ </div>
296
+ );
297
+ }