Skip to content

Commit

Permalink
feat: groups filtering(#271860)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihai Nicolae committed Aug 5, 2024
1 parent 1833532 commit 6da2e21
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion tabs/src/components/my_country/MyCountry.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import GroupsIcon from '@mui/icons-material/Groups';
import GroupWorkIcon from '@mui/icons-material/GroupWork';
import CustomDrawer from '../CustomDrawer';
import { CountryMembers } from './CountryMembers';
import Constants from '../../data/constants.json';

import { useAppInsightsContext } from '@microsoft/applicationinsights-react-js';

Expand Down Expand Up @@ -60,7 +61,11 @@ export function MyCountry({ userInfo, selectedCountry, configuration, drawerOpen
loadedOrganisations && setOrganisations(loadedOrganisations);
});
getAvailableGroups().then((loadedGroups) => {
setAvailableGroups(loadedGroups);
setAvailableGroups(
loadedGroups.filter(
(gr) => gr && !gr.toLowerCase().startsWith(Constants.WorkingGroupPrefix),
),
);
});
getCountryCodeMappingsList().then((loadedCountries) => {
selectedCountry &&
Expand Down
6 changes: 5 additions & 1 deletion tabs/src/data/sharepointProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
import { format, differenceInDays, addDays } from 'date-fns';
import { sendEmail } from './provider';
import { createIcs } from './icsHelper';
import Constants from './constants.json';

function wrapError(err, message) {
return {
Expand Down Expand Up @@ -279,6 +280,7 @@ export async function getMeetings(fromDate, country, userInfo) {
MeetingStart: new Date(fields.Meetingstart),
MeetingEnd: new Date(fields.Meetingend),
MeetingType: fields.MeetingType,
EventCategory: fields.EventCategory,

Year: parseInt(fields.Year.replace(',', '')),
Linktofolder: fields.Linktofolder,
Expand Down Expand Up @@ -471,7 +473,9 @@ export function getGroups(users, removeWorkingGroups = false) {
}

if (removeWorkingGroups) {
groups = groups.filter((gr) => gr && gr.toLowerCase().startsWith('wg-'));
groups = groups.filter(
(gr) => gr && !gr.toLowerCase().startsWith(Constants.WorkingGroupPrefix),
);
}
return [...new Set(groups)];
}
Expand Down

0 comments on commit 6da2e21

Please sign in to comment.