eionet2-dashboard 1.6.0 → 1.7.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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,26 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ ### [1.7.0](https://github.com/eea/eionet2-dashboard/compare/1.6.1...1.7.0) - 24 November 2023
8
+
9
+ #### :rocket: New Features
10
+
11
+ - feat: reporting obligations(#260290) [Mihai Nicolae - [`44880c4`](https://github.com/eea/eionet2-dashboard/commit/44880c4c40e6fd9a7c3060a92249193ec9a88f95)]
12
+
13
+ #### :bug: Bug Fixes
14
+
15
+ - fix: filter obligations [Mihai Nicolae - [`929d89e`](https://github.com/eea/eionet2-dashboard/commit/929d89e42a1946b35959ae3c58fbff3ed3d341f2)]
16
+
17
+ ### [1.6.1](https://github.com/eea/eionet2-dashboard/compare/1.6.0...1.6.1) - 3 November 2023
18
+
19
+ #### :bug: Bug Fixes
20
+
21
+ - fix: publication item type [Mihai Nicolae - [`34b440d`](https://github.com/eea/eionet2-dashboard/commit/34b440d72791b2cdd721d3ca40e5eea1ba1add67)]
22
+
23
+ #### :house: Internal changes
24
+
25
+ - chore: new version [Mihai Nicolae - [`9764098`](https://github.com/eea/eionet2-dashboard/commit/97640985d67fc98114d2b68cac803f555f6bdaa0)]
26
+
7
27
  ### [1.6.0](https://github.com/eea/eionet2-dashboard/compare/1.5.0...1.6.0) - 3 November 2023
8
28
 
9
29
  #### :rocket: New Features
package/CONFIGURATION.md CHANGED
@@ -1,3 +1,12 @@
1
1
  ### [1.6.0]
2
2
  Configuration keys
3
- - PublicationsText - contains values used the filter the displayed publications. Use semicolon to separate values. Check is not case sensitive.
3
+ - PublicationsType - contains values used the filter the displayed publications. Use semicolon to separate values. Check is not case sensitive.
4
+
5
+ ### [1.7.0]
6
+ Configuration keys
7
+ - PublicationsIntroText - Intro text that can be displayed above the publications list. HTML can be used.
8
+ - ReportingObligationsIntroText - Intro text that can be displayed above the obligations list. HTML can be used.
9
+ - ObligationsListId - Id of the sharepoint list that stores the obligations
10
+ - ReportingClientsUrl - URL to the reporting obligations database site for client list
11
+ - ReportingInstrumentsUrl - URL to the reporting obligations database site for instrument list
12
+ - ReportingObligationsUrl - URL to the reporting obligations database site for obligation list. Used in dashboard and azure-jobs.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eionet2-dashboard",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "scripts": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/eionet2-dashboard",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "lockfileVersion": 1,
5
5
  "requires": true,
6
6
  "dependencies": {
package/tabs/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/eionet2-dashboard",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "license": "MIT",
5
5
  "description": "Teams app for managing Eionet users.",
6
6
  "dependencies": {
@@ -17,9 +17,15 @@ import FastForwardOutlinedIcon from '@mui/icons-material/FastForwardOutlined';
17
17
  import HistoryOutlinedIcon from '@mui/icons-material/HistoryOutlined';
18
18
  import { ConsultationList } from './ConsultationList';
19
19
  import { EventList } from './EventList';
20
- import { getConsultations, getMeetings, getPublications } from '../../data/sharepointProvider';
20
+ import {
21
+ getConsultations,
22
+ getMeetings,
23
+ getPublications,
24
+ getObligations,
25
+ } from '../../data/sharepointProvider';
21
26
  import CustomDrawer from '../CustomDrawer';
22
27
  import { PublicatonList } from './PublicationList';
28
+ import { ObligationList } from './ObligationList';
23
29
 
24
30
  export function Activity({
25
31
  userInfo,
@@ -42,6 +48,8 @@ export function Activity({
42
48
  [finalisedSurveys, setFinalisedSurveys] = useState([]),
43
49
  [futurePublications, setFuturePublications] = useState([]),
44
50
  [pastPublications, setPastPublications] = useState([]),
51
+ [upcomingObligations, setUpcomingObligations] = useState([]),
52
+ [continuousObligations, setContinuousObligations] = useState([]),
45
53
  [loading, setloading] = useState(false);
46
54
 
47
55
  const drawerOptions = (
@@ -195,6 +203,35 @@ export function Activity({
195
203
  <ListItemText primary={'Past(' + pastPublications.length + ')'} />
196
204
  </ListItemButton>
197
205
  </ListItem>
206
+ <ListItem disablePadding className="list-item" key={15}>
207
+ <ListItemText
208
+ className="list-item-text"
209
+ primary={'REPORTING OBLIGATIONS'}
210
+ sx={{ color: 'primary.main' }}
211
+ />
212
+ </ListItem>
213
+ <ListItem disablePadding className="list-item" key={16}>
214
+ <ListItemButton
215
+ className={'list-item-button ' + (tabsValue == 11 ? ' drawer-item-selected' : '')}
216
+ onClick={() => setTabsValue(11)}
217
+ >
218
+ <ListItemIcon className="list-item-icon">
219
+ <LoopIcon />
220
+ </ListItemIcon>
221
+ <ListItemText primary={'Upcoming(' + upcomingObligations.length + ')'} />
222
+ </ListItemButton>
223
+ </ListItem>
224
+ <ListItem disablePadding className="list-item" key={17}>
225
+ <ListItemButton
226
+ className={'list-item-button ' + (tabsValue == 12 ? ' drawer-item-selected' : '')}
227
+ onClick={() => setTabsValue(12)}
228
+ >
229
+ <ListItemIcon className="list-item-icon">
230
+ <HistoryOutlinedIcon />
231
+ </ListItemIcon>
232
+ <ListItemText primary={'Continuous(' + continuousObligations.length + ')'} />
233
+ </ListItemButton>
234
+ </ListItem>
198
235
  </div>
199
236
  );
200
237
 
@@ -207,97 +244,105 @@ export function Activity({
207
244
  let fromDate = new Date();
208
245
  fromDate.setMonth(fromDate.getMonth() - monthsBehind);
209
246
 
210
- const loadedMeetings = await getMeetings(fromDate, country, userInfo),
211
- loadedConsultations = await getConsultations(undefined, fromDate, country);
212
- let loadedPublications = await getPublications();
213
-
214
- if (loadedMeetings) {
215
- setCurrentMeetings(
216
- loadedMeetings.filter((c) => {
217
- return c.IsCurrent;
218
- }),
219
- );
220
- setUpcomingMeetings(
221
- loadedMeetings.filter((c) => {
222
- return c.IsUpcoming;
223
- }),
224
- );
225
- setPastMeetings(
226
- loadedMeetings.filter((c) => {
227
- return c.IsPast;
228
- }),
229
- );
230
- }
247
+ getMeetings(fromDate, country, userInfo).then((loadedMeetings) => {
248
+ if (loadedMeetings) {
249
+ setCurrentMeetings(
250
+ loadedMeetings.filter((c) => {
251
+ return c.IsCurrent;
252
+ }),
253
+ );
254
+ setUpcomingMeetings(
255
+ loadedMeetings.filter((c) => {
256
+ return c.IsUpcoming;
257
+ }),
258
+ );
259
+ setPastMeetings(
260
+ loadedMeetings.filter((c) => {
261
+ return c.IsPast;
262
+ }),
263
+ );
264
+ }
231
265
 
232
- setData4Menu(loadedMeetings);
266
+ setData4Menu(loadedMeetings);
267
+ setloading(false);
268
+ });
233
269
 
234
- if (loadedConsultations) {
235
- setOpenConsultations(
236
- loadedConsultations.filter((c) => {
237
- return (
238
- c.ConsultationType == Constants.ConsultationType.Consultation &&
239
- c.Closed >= new Date()
240
- );
241
- }),
242
- );
243
- setReviewConsultations(
244
- loadedConsultations.filter((c) => {
245
- return (
246
- c.ConsultationType == Constants.ConsultationType.Consultation &&
247
- c.Closed < new Date() &&
248
- c.Deadline >= new Date()
249
- );
250
- }),
251
- );
252
- setFinalisedConsultations(
253
- loadedConsultations.filter((c) => {
254
- return (
255
- c.ConsultationType == Constants.ConsultationType.Consultation &&
256
- c.Closed <= new Date() &&
257
- c.Deadline < new Date()
258
- );
259
- }),
260
- );
270
+ getConsultations(undefined, fromDate, country).then((loadedConsultations) => {
271
+ if (loadedConsultations) {
272
+ setOpenConsultations(
273
+ loadedConsultations.filter((c) => {
274
+ return (
275
+ c.ConsultationType == Constants.ConsultationType.Consultation &&
276
+ c.Closed >= new Date()
277
+ );
278
+ }),
279
+ );
280
+ setReviewConsultations(
281
+ loadedConsultations.filter((c) => {
282
+ return (
283
+ c.ConsultationType == Constants.ConsultationType.Consultation &&
284
+ c.Closed < new Date() &&
285
+ c.Deadline >= new Date()
286
+ );
287
+ }),
288
+ );
289
+ setFinalisedConsultations(
290
+ loadedConsultations.filter((c) => {
291
+ return (
292
+ c.ConsultationType == Constants.ConsultationType.Consultation &&
293
+ c.Closed <= new Date() &&
294
+ c.Deadline < new Date()
295
+ );
296
+ }),
297
+ );
261
298
 
262
- setOpenSurveys(
263
- loadedConsultations.filter((c) => {
264
- return (
265
- c.ConsultationType == Constants.ConsultationType.Survey && c.Closed >= new Date()
266
- );
267
- }),
268
- );
269
- setReviewSurveys(
270
- loadedConsultations.filter((c) => {
271
- return (
272
- c.ConsultationType == Constants.ConsultationType.Survey &&
273
- c.Closed < new Date() &&
274
- c.Deadline >= new Date()
275
- );
276
- }),
277
- );
278
- setFinalisedSurveys(
279
- loadedConsultations.filter((c) => {
280
- return (
281
- c.ConsultationType == Constants.ConsultationType.Survey &&
282
- c.Closed <= new Date() &&
283
- c.Deadline < new Date()
284
- );
285
- }),
286
- );
287
- }
299
+ setOpenSurveys(
300
+ loadedConsultations.filter((c) => {
301
+ return (
302
+ c.ConsultationType == Constants.ConsultationType.Survey && c.Closed >= new Date()
303
+ );
304
+ }),
305
+ );
306
+ setReviewSurveys(
307
+ loadedConsultations.filter((c) => {
308
+ return (
309
+ c.ConsultationType == Constants.ConsultationType.Survey &&
310
+ c.Closed < new Date() &&
311
+ c.Deadline >= new Date()
312
+ );
313
+ }),
314
+ );
315
+ setFinalisedSurveys(
316
+ loadedConsultations.filter((c) => {
317
+ return (
318
+ c.ConsultationType == Constants.ConsultationType.Survey &&
319
+ c.Closed <= new Date() &&
320
+ c.Deadline < new Date()
321
+ );
322
+ }),
323
+ );
324
+ }
325
+ });
288
326
 
289
- if (loadedPublications) {
290
- const typeFilter = configuration.PublicationsType
291
- ? configuration.PublicationsType.split(';').map((p) => p.toLowerCase())
292
- : [];
293
- loadedPublications = loadedPublications.filter(
294
- (p) => !p.ItemType || p.ItemType.some((it) => typeFilter.includes(it.toLowerCase())),
295
- );
296
- setFuturePublications(loadedPublications.filter((p) => !p.IsPast));
297
- setPastPublications(loadedPublications.filter((p) => p.IsPast));
298
- }
327
+ getPublications().then((result) => {
328
+ if (result) {
329
+ const typeFilter = configuration.PublicationsType
330
+ ? configuration.PublicationsType.split(';').map((p) => p.toLowerCase())
331
+ : [];
332
+ const loadedPublications = result.filter(
333
+ (p) => !p.ItemType || typeFilter.includes(p.ItemType.toLowerCase()),
334
+ );
335
+ setFuturePublications(loadedPublications.filter((p) => !p.IsPast));
336
+ setPastPublications(loadedPublications.filter((p) => p.IsPast));
337
+ }
338
+ });
299
339
 
300
- setloading(false);
340
+ getObligations().then((result) => {
341
+ if (result) {
342
+ setUpcomingObligations(result.filter((p) => p.IsUpcoming && !p.IsContinuous));
343
+ setContinuousObligations(result.filter((p) => p.IsContinuous));
344
+ }
345
+ });
301
346
  })();
302
347
  }, [monthsBehind, userInfo, country]);
303
348
 
@@ -327,18 +372,17 @@ export function Activity({
327
372
  )}
328
373
  {tabsValue >= 3 && tabsValue <= 5 && (
329
374
  <ConsultationList
330
- userInfo={userInfo}
331
375
  configuration={configuration}
332
376
  openConsultations={openConsultations}
333
377
  reviewConsultations={reviewConsultations}
334
378
  finalisedConsultations={finalisedConsultations}
335
379
  type={Constants.ConsultationType.Consultation}
380
+ country={country}
336
381
  tabsValue={tabsValue - 3}
337
382
  ></ConsultationList>
338
383
  )}
339
384
  {tabsValue >= 6 && tabsValue <= 8 && (
340
385
  <ConsultationList
341
- userInfo={userInfo}
342
386
  configuration={configuration}
343
387
  openConsultations={openSurveys}
344
388
  reviewConsultations={reviewSurveys}
@@ -356,6 +400,15 @@ export function Activity({
356
400
  tabsValue={tabsValue - 9}
357
401
  ></PublicatonList>
358
402
  )}
403
+ {tabsValue >= 11 && tabsValue <= 12 && (
404
+ <ObligationList
405
+ userInfo={userInfo}
406
+ configuration={configuration}
407
+ upcomingObligations={upcomingObligations}
408
+ continuousObligations={continuousObligations}
409
+ tabsValue={tabsValue - 11}
410
+ ></ObligationList>
411
+ )}
359
412
  </Box>
360
413
  {false && <span>{userInfo.toString()}</span>}
361
414
  </Box>
@@ -9,12 +9,12 @@ import { GroupsTags } from './GroupsTags';
9
9
  import ResizableGrid from '../ResizableGrid';
10
10
 
11
11
  export function ConsultationList({
12
- userInfo,
13
12
  configuration,
14
13
  openConsultations,
15
14
  reviewConsultations,
16
15
  finalisedConsultations,
17
16
  type,
17
+ country,
18
18
  tabsValue,
19
19
  }) {
20
20
  const [tagsCellOpen, setTagCellOpen] = useState(false),
@@ -106,15 +106,25 @@ export function ConsultationList({
106
106
  }
107
107
  },
108
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
- );
109
+ if (country) {
110
+ return (
111
+ <div>
112
+ {params.row.HasUserCountryResponded && (
113
+ <Tooltip title={configuration.CountryRespondedTooltip}>
114
+ <TaskAltIcon color="success"></TaskAltIcon>
115
+ </Tooltip>
116
+ )}
117
+ </div>
118
+ );
119
+ } else {
120
+ return (
121
+ <div>
122
+ <Typography className="grid-text" variant="body1" component={'span'}>
123
+ {params.row.Respondants.length}
124
+ </Typography>
125
+ </div>
126
+ );
127
+ }
118
128
  },
119
129
  handleCellClick = useCallback(
120
130
  (groups) => {
@@ -180,7 +190,7 @@ export function ConsultationList({
180
190
  return getCellColor(params);
181
191
  },
182
192
  });
183
- userInfo.country && openColumns.push(countryRespondedColumn);
193
+ openColumns.push(countryRespondedColumn);
184
194
 
185
195
  let reviewColumns = [];
186
196
  reviewColumns.push(titleColumn);
@@ -196,7 +206,7 @@ export function ConsultationList({
196
206
  return getCellColor(params);
197
207
  },
198
208
  });
199
- userInfo.country && reviewColumns.push(countryRespondedColumn);
209
+ reviewColumns.push(countryRespondedColumn);
200
210
 
201
211
  let finalisedColumns = [];
202
212
  finalisedColumns.push(titleColumn);
@@ -208,7 +218,7 @@ export function ConsultationList({
208
218
  width: '100',
209
219
  renderCell: renderDeadline,
210
220
  });
211
- userInfo.country && finalisedColumns.push(countryRespondedColumn);
221
+ finalisedColumns.push(countryRespondedColumn);
212
222
  finalisedColumns.push({
213
223
  field: 'Results',
214
224
  headerName: 'Results',
@@ -0,0 +1,163 @@
1
+ import { React } from 'react';
2
+
3
+ import { Box, Typography, Link } from '@mui/material';
4
+ import TaskAltIcon from '@mui/icons-material/TaskAlt';
5
+
6
+ import { format } from 'date-fns';
7
+
8
+ import ResizableGrid from '../ResizableGrid';
9
+ import { HtmlBox } from '../HtmlBox';
10
+
11
+ export function ObligationList({
12
+ userInfo,
13
+ configuration,
14
+ upcomingObligations,
15
+ continuousObligations,
16
+ tabsValue,
17
+ }) {
18
+ const renderDate = (params) => {
19
+ let dateFormat = configuration.DateFormatDashboard;
20
+ return (
21
+ <Typography
22
+ sx={{ whiteSpace: 'pre-line' }}
23
+ className="grid-text"
24
+ variant="body1"
25
+ component={'span'}
26
+ >
27
+ {params.row.Deadline && format(params.row.Deadline, dateFormat)}
28
+ </Typography>
29
+ );
30
+ },
31
+ renderCoreEEAFlow = (params) => {
32
+ return <div>{params.row.IsEEACore && <TaskAltIcon color="success"></TaskAltIcon>}</div>;
33
+ },
34
+ renderTitle = (params) => {
35
+ return renderUrl(params.row.Url, params.row.Title);
36
+ },
37
+ renderInstrument = (params) => {
38
+ return renderUrl(params.row.InstrumentUrl, params.row.Instrument);
39
+ },
40
+ renderReportTo = (params) => {
41
+ return renderUrl(params.row.ReportToUrl, params.row.ReportTo);
42
+ },
43
+ renderUrl = (url, title) => {
44
+ return (
45
+ <Box>
46
+ <Link
47
+ className="grid-text"
48
+ style={{ overflow: 'hidden', textOverflow: 'ellipsis' }}
49
+ component="button"
50
+ variant="body1"
51
+ onClick={() => {
52
+ url && window.open(url, '_blank');
53
+ }}
54
+ >
55
+ {title}
56
+ </Link>
57
+ </Box>
58
+ );
59
+ };
60
+
61
+ const gridColumns = [
62
+ {
63
+ field: 'Title',
64
+ headerName: 'Obligation',
65
+ renderCell: renderTitle,
66
+ flex: 1,
67
+ },
68
+ {
69
+ field: 'Instrument',
70
+ headerName: 'Instrument',
71
+ renderCell: renderInstrument,
72
+ flex: 1,
73
+ },
74
+ {
75
+ field: 'Deadline',
76
+ headerName: 'Deadline',
77
+ width: '110',
78
+ renderCell: renderDate,
79
+ },
80
+ {
81
+ field: 'ReportTo',
82
+ headerName: 'Report to',
83
+ renderCell: renderReportTo,
84
+ flex: 0.5,
85
+ },
86
+ {
87
+ field: 'IsEEACore',
88
+ headerName: 'Core data flow',
89
+ renderCell: renderCoreEEAFlow,
90
+ align: 'center',
91
+ width: '120',
92
+ },
93
+ ];
94
+
95
+ return (
96
+ <div className="">
97
+ <Box
98
+ sx={{
99
+ boxShadow: 2,
100
+ display: 'flex',
101
+ flexDirection: 'column',
102
+ height: '100%',
103
+ }}
104
+ >
105
+ {configuration?.ReportingObligationsIntroText && (
106
+ <Box
107
+ sx={{
108
+ borderBottom: 1,
109
+ borderColor: 'divider',
110
+ }}
111
+ >
112
+ <HtmlBox html={configuration?.ReportingObligationsIntroText}></HtmlBox>
113
+ </Box>
114
+ )}
115
+ <Box className="grid-container">
116
+ {tabsValue == 0 && (
117
+ <ResizableGrid
118
+ rows={upcomingObligations}
119
+ columns={gridColumns}
120
+ pageSizeOptions={[25, 50, 100]}
121
+ initialState={{
122
+ pagination: { paginationModel: { pageSize: 25 } },
123
+ sorting: {
124
+ sortModel: [
125
+ {
126
+ field: 'Deadline',
127
+ sort: 'asc',
128
+ },
129
+ ],
130
+ },
131
+ }}
132
+ hideFooterSelectedRowCount
133
+ />
134
+ )}
135
+ {tabsValue == 1 && (
136
+ <ResizableGrid
137
+ rows={continuousObligations}
138
+ columns={gridColumns}
139
+ hideFooterSelectedRowCount
140
+ pageSizeOptions={[25, 50, 100]}
141
+ initialState={{
142
+ pagination: { paginationModel: { pageSize: 25 } },
143
+ sorting: {
144
+ sortModel: [
145
+ {
146
+ field: 'Instrument',
147
+ sort: 'asc',
148
+ },
149
+ {
150
+ field: 'Title',
151
+ sort: 'asc',
152
+ },
153
+ ],
154
+ },
155
+ }}
156
+ />
157
+ )}
158
+ </Box>
159
+ {false && <span>{userInfo.toString()}</span>}
160
+ </Box>
161
+ </div>
162
+ );
163
+ }
@@ -5,6 +5,7 @@ import { Box, Typography, Chip, Tooltip } from '@mui/material';
5
5
  import { format } from 'date-fns';
6
6
 
7
7
  import ResizableGrid from '../ResizableGrid';
8
+ import { HtmlBox } from '../HtmlBox';
8
9
 
9
10
  export function PublicatonList({
10
11
  userInfo,
@@ -26,9 +27,6 @@ export function PublicatonList({
26
27
  </Typography>
27
28
  );
28
29
  },
29
- renderTypes = (params) => {
30
- return renderChips(params.row.ItemType);
31
- },
32
30
  renderProducts = (params) => {
33
31
  return renderChips(params.row.ExtraCommsProducts);
34
32
  },
@@ -56,7 +54,6 @@ export function PublicatonList({
56
54
  {
57
55
  field: 'ItemType',
58
56
  headerName: 'Type',
59
- renderCell: renderTypes,
60
57
  flex: 0.5,
61
58
  },
62
59
  {
@@ -83,8 +80,21 @@ export function PublicatonList({
83
80
  <Box
84
81
  sx={{
85
82
  boxShadow: 2,
83
+ display: 'flex',
84
+ flexDirection: 'column',
85
+ height: '100%',
86
86
  }}
87
87
  >
88
+ {configuration?.PublicationsIntroText && (
89
+ <Box
90
+ sx={{
91
+ borderBottom: 1,
92
+ borderColor: 'divider',
93
+ }}
94
+ >
95
+ <HtmlBox html={configuration?.PublicationsIntroText}></HtmlBox>
96
+ </Box>
97
+ )}
88
98
  <Box className="grid-container">
89
99
  {tabsValue == 0 && (
90
100
  <ResizableGrid
@@ -26,11 +26,6 @@
26
26
  display: flex;
27
27
  }
28
28
 
29
- .grid-cell-centered {
30
- display: flex;
31
- justify-content: center;
32
- }
33
-
34
29
  .grid-text {
35
30
  font-size: 14px !important;
36
31
  }
@@ -22,7 +22,7 @@ export async function getOrganisationList(country) {
22
22
  config.SharepointSiteId +
23
23
  '/lists/' +
24
24
  config.OrganisationListId +
25
- '/items?$expand=fields&$top=999';
25
+ '/items?$expand=fields&$top=999&$select=id,fields';
26
26
  if (country) {
27
27
  path += "&$filter=fields/Country eq '" + country + "'";
28
28
  }
@@ -140,7 +140,7 @@ export async function getConsultations(consultationType, fromDate, userCountry)
140
140
  config.SharepointSiteId +
141
141
  '/lists/' +
142
142
  config.ConsultationListId +
143
- '/items?$expand=fields&$top=999';
143
+ '/items?$expand=fields&$top=999&$select=id,fields';
144
144
 
145
145
  if (consultationType) {
146
146
  path += "&$filter=fields/ConsultationType eq '";
@@ -203,7 +203,7 @@ export async function getMeetings(fromDate, country, userInfo) {
203
203
  config.SharepointSiteId +
204
204
  '/lists/' +
205
205
  config.MeetingListId +
206
- '/items?$expand=fields&$top=999';
206
+ '/items?$expand=fields&$top=999&$select=id,fields';
207
207
 
208
208
  if (fromDate) {
209
209
  path += "&$filter=fields/Meetingstart ge '";
@@ -310,7 +310,7 @@ export async function getParticipants(meetingId, country) {
310
310
  config.SharepointSiteId +
311
311
  '/lists/' +
312
312
  config.MeetingParticipantsListId +
313
- '/items?$expand=fields&$top=999';
313
+ '/items?$expand=fields&$top=999&$select=id,fields';
314
314
 
315
315
  if (meetingId) {
316
316
  path += '&$filter=fields/MeetingtitleLookupId eq ';
@@ -388,7 +388,7 @@ export async function getInvitedUsers(country) {
388
388
  config.SharepointSiteId +
389
389
  '/lists/' +
390
390
  config.UserListId +
391
- '/items?$expand=fields&$top=999';
391
+ '/items?$expand=fields&$top=999&$select=id,fields';
392
392
  if (country) {
393
393
  path += "&$filter=fields/Country eq '" + country + "'";
394
394
  }
@@ -455,7 +455,7 @@ export async function getPublications() {
455
455
  config.CommunicationSiteId +
456
456
  '/lists/' +
457
457
  config.PublicationListId +
458
- '/items?$expand=fields&$top=999';
458
+ '/items?$expand=fields&$top=999&$select=id,fields';
459
459
 
460
460
  let result = [];
461
461
  const currentDate = new Date(new Date().toDateString());
@@ -488,6 +488,54 @@ export async function getPublications() {
488
488
  }
489
489
  }
490
490
 
491
+ export async function getObligations() {
492
+ const config = await getConfiguration();
493
+ try {
494
+ let path =
495
+ '/sites/' +
496
+ config.SharepointSiteId +
497
+ '/lists/' +
498
+ config.ObligationsListId +
499
+ '/items?$expand=fields&$top=999&$select=id,fields&$filter=fields/IsTerminated eq 0 and fields/IsFlagged eq 1';
500
+
501
+ let result = [];
502
+
503
+ while (path) {
504
+ const response = await apiGet(path),
505
+ obligations = response.graphClientMessage;
506
+
507
+ if (obligations && obligations.value) {
508
+ obligations.value.forEach((o) => {
509
+ const currentDate = new Date(new Date().toDateString()),
510
+ deadline = o.fields.Deadline && new Date(o.fields.Deadline),
511
+ isContinuous = !o.fields.ReportingFrequencyMonths && !deadline,
512
+ isUpcoming = deadline && deadline >= currentDate;
513
+
514
+ result.push({
515
+ id: o.fields.id,
516
+ Title: o.fields.Title,
517
+ Url: o.fields.Url,
518
+ Instrument: o.fields.Instrument,
519
+ InstrumentUrl: o.fields.InstrumentUrl,
520
+ ReportTo: o.fields.ReportTo,
521
+ ReportToUrl: o.fields.ReportToUrl,
522
+ ...(deadline && { Deadline: deadline }),
523
+ IsEEACore: o.fields.IsEEACore,
524
+ IsContinuous: isContinuous,
525
+ IsUpcoming: isUpcoming,
526
+ });
527
+ });
528
+ }
529
+
530
+ path = obligations['@odata.nextLink'];
531
+ }
532
+
533
+ return result;
534
+ } catch (err) {
535
+ console.log(err);
536
+ }
537
+ }
538
+
491
539
  export async function postParticipant(participant, event) {
492
540
  const config = await getConfiguration(),
493
541
  graphURL =