Skip to content

Commit

Permalink
improvement (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihai Nicolae committed Sep 20, 2024
1 parent 20feb85 commit 8d8eb76
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 25 deletions.
4 changes: 2 additions & 2 deletions tabs/src/components/activity/Activity.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export function Activity({
<ListItemIcon className="list-item-icon">
<FastForwardOutlinedIcon />
</ListItemIcon>
<ListItemText primary={'Review(' + reviewConsultations.length + ')'} />
<ListItemText primary={'EEA Review(' + reviewConsultations.length + ')'} />
</ListItemButton>
</ListItem>
<ListItem disablePadding className="list-item" key={8}>
Expand Down Expand Up @@ -204,7 +204,7 @@ export function Activity({
<ListItemIcon className="list-item-icon">
<FastForwardOutlinedIcon />
</ListItemIcon>
<ListItemText primary={'Review(' + reviewSurveys.length + ')'} />
<ListItemText primary={'EEA Review(' + reviewSurveys.length + ')'} />
</ListItemButton>
</ListItem>
<ListItem disablePadding className="list-item" key={13}>
Expand Down
14 changes: 4 additions & 10 deletions tabs/src/components/my_country/AtAGlance.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export function AtAGlance({
availableGroups,
}) {
const signedInUsers = users.filter((u) => {
return u.SignedIn;
}),
return u.SignedIn;
}),
signedInGroups = getGroups(signedInUsers),
pendingSignInUsers = users.filter((u) => {
return !u.SignedIn;
Expand Down Expand Up @@ -63,17 +63,11 @@ export function AtAGlance({
year: i,
meetingsCount: allMeetings.length,
meetingsUrl: `${configuration.MeetingListUrl}?FilterField1=Countries&FilterValue1=${country}${yearFilter}`,
attendedMeetingsCount: allMeetings.filter((meeting) => {
return meeting.Participants.some(
(participant) => participant.Country == country && participant.Participated,
);
}).length,
attendedMeetingsCount: allMeetings.filter((meeting) => meeting.Countries?.includes(country)).length,
consultationsCount: allConsultations.length,
//!!! ConsultationListUrl already contains a filter in configuration
consultationsUrl: `${configuration.ConsultationListUrl}${yearFilter}&FilterField3=Respondants&FilterValue3=${country}`,
responseConsultationsCount: allConsultations.filter((c) => {
return c.Respondants.includes(country);
}).length,
responseConsultationsCount: allConsultations.filter((c) => c.Respondants?.includes(country)).length,
surveysCount: allSurveys.length,
//!!! InquiryListUrl already contains a filter in configuration
surveysUrl: `${configuration.InquiryListUrl}${yearFilter}&FilterField3=Respondants&FilterValue3=${country}`,
Expand Down
27 changes: 14 additions & 13 deletions tabs/src/data/sharepointProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ export async function getMappingsList() {
if (!mappingsList) {
const response = await apiGet(
'/sites/' +
config.SharepointSiteId +
'/lists/' +
config.MappingListId +
'/items?$expand=fields',
config.SharepointSiteId +
'/lists/' +
config.MappingListId +
'/items?$expand=fields',
);
mappingsList = response.graphClientMessage.value.map(function (mapping) {
return {
Expand Down Expand Up @@ -122,13 +122,13 @@ export async function getSPUserByMail(email) {
const config = await getConfiguration();
try {
const path =
'/sites/' +
config.SharepointSiteId +
'/lists/' +
config.UserListId +
"/items?$filter=fields/Email eq '" +
email +
"'&$expand=fields",
'/sites/' +
config.SharepointSiteId +
'/lists/' +
config.UserListId +
"/items?$filter=fields/Email eq '" +
email +
"'&$expand=fields",
response = await apiGet(path),
profile = response.graphClientMessage;
if (profile.value && profile.value.length) {
Expand Down Expand Up @@ -305,6 +305,7 @@ export async function getMeetings(fromDate, country, userInfo) {
IsOffline: fields.MeetingType && fields.MeetingType != 'Online',

CustomMeetingRequest: fields.CustomMeetingRequests,
Countries: fields.Countries,

HasRegistered: !!currentParticipant?.Registered,
HasVoted: !!currentParticipant?.Voted,
Expand Down Expand Up @@ -709,8 +710,8 @@ async function sentNFPNotification(participant, event) {
} else {
await logError(
'The NFP couldn’t be notified for the user with email ' +
participant.Email +
' because the user does not have a country specified.',
participant.Email +
' because the user does not have a country specified.',
'',
participant,
);
Expand Down

0 comments on commit 8d8eb76

Please sign in to comment.