Skip to content

Commit

Permalink
Merge pull request #4 from virtualidentityag/feat/CARITAS-243-rm-team…
Browse files Browse the repository at this point in the history
…-consultation

feat(CARITAS-243): teamsessions-removal
  • Loading branch information
koepferd authored Sep 11, 2024
2 parents 09b86f3 + 95eb102 commit 8c2a811
Show file tree
Hide file tree
Showing 43 changed files with 46 additions and 639 deletions.
1 change: 0 additions & 1 deletion cypress/fixtures/registration/agency.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"postcode": "postcode",
"city": "city",
"description": "description",
"teamAgency": true,
"offline": false,
"consultingType": 1,
"topicIds": null
Expand Down
7 changes: 0 additions & 7 deletions cypress/fixtures/registration/consultingType.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,6 @@
"peer": ["consultant"]
}
},
"notifications": {
"teamSessions": {
"newMessage": {
"allTeamConsultants": false
}
}
},
"showAskerProfile": true,
"welcomeScreen": {
"anonymous": {
Expand Down
1 change: 0 additions & 1 deletion cypress/fixtures/service.agencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"postcode": "postcode",
"city": "city",
"description": "description",
"teamAgency": true,
"offline": false,
"consultingType": 1,
"url": "url",
Expand Down
7 changes: 0 additions & 7 deletions cypress/fixtures/service.consultingtypes.addiction.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,6 @@
"peer": ["consultant"]
}
},
"notifications": {
"teamSessions": {
"newMessage": {
"allTeamConsultants": false
}
}
},
"showAskerProfile": true,
"welcomeScreen": {
"anonymous": {
Expand Down
7 changes: 0 additions & 7 deletions cypress/fixtures/service.consultingtypes.emigration.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,6 @@
"peer": ["consultant"]
}
},
"notifications": {
"teamSessions": {
"newMessage": {
"allTeamConsultants": false
}
}
},
"showAskerProfile": false,
"welcomeScreen": {
"anonymous": {
Expand Down
7 changes: 0 additions & 7 deletions cypress/fixtures/service.consultingtypes.pregnancy.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,6 @@
"peer": ["consultant"]
}
},
"notifications": {
"teamSessions": {
"newMessage": {
"allTeamConsultants": false
}
}
},
"showAskerProfile": true,
"welcomeScreen": {
"anonymous": {
Expand Down
7 changes: 0 additions & 7 deletions cypress/fixtures/service.consultingtypes.u25.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@
"peer": ["consultant", "u25-consultant"]
}
},
"notifications": {
"teamSessions": {
"newMessage": {
"allTeamConsultants": false
}
}
},
"showAskerProfile": true,
"requiredComponents": {
"age": {
Expand Down
10 changes: 2 additions & 8 deletions cypress/fixtures/service.users.data.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"postcode": "12345",
"city": "city",
"description": "description",
"teamAgency": true,
"offline": false,
"consultingType": 0
}
Expand All @@ -26,7 +25,6 @@
"consultingTypes": null,
"formalLanguage": true,
"absent": false,
"inTeamAgency": true,
"languages": [],
"emailToggles": [
{
Expand All @@ -53,16 +51,14 @@
"postcode": "12345",
"city": "city",
"description": "description",
"teamAgency": true,
"offline": false,
"consultingType": 2
}
],
"grantedAuthorities": ["AUTHORIZATION_CONSULTANT_DEFAULT"],
"consultingTypes": null,
"formalLanguage": true,
"absent": false,
"inTeamAgency": true
"absent": false
},
{
"userId": "asker",
Expand All @@ -84,15 +80,13 @@
"postcode": "12345",
"city": "city",
"description": null,
"teamAgency": true,
"offline": false,
"consultingType": 1
}
},
"17": { "sessionData": null, "isRegistered": false, "agency": null }
},
"formalLanguage": true,
"absent": false,
"inTeamAgency": false
"absent": false
}
]
1 change: 0 additions & 1 deletion cypress/fixtures/service.users.sessions.room.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"lastMessage": null,
"messageDate": 0,
"messagesRead": false,
"isTeamSession": false,
"registrationType": "REGISTERED",
"createDate": "2022-06-15T08:09:18Z",
"attachment": null,
Expand Down
8 changes: 1 addition & 7 deletions cypress/support/sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { v4 as uuid } from 'uuid';
import { SESSION_LIST_TYPES } from '../../src/components/session/sessionHelpers';
import {
ListItemInterface,
SessionItemInterface,
SessionUserDataInterface
} from '../../src/globalState/interfaces';

Expand Down Expand Up @@ -47,7 +46,6 @@ export const generateConsultantSession = ({
lastMessage: 'lastMessage',
messageDate: 1606900238,
messagesRead: messagesRead === undefined ? true : messagesRead,
isTeamSession: true,
attachment: null,
registrationType: 'REGISTERED',
e2eLastMessage: {
Expand Down Expand Up @@ -86,11 +84,9 @@ export const generateMultipleConsultantSessions = (amount: number): void => {
};

export const generateAskerSession = ({
messagesRead,
isTeamSession
messagesRead
}: {
messagesRead?: boolean;
isTeamSession?: boolean;
} = {}): ListItemInterface => {
const sessionId = Math.random();
const rcGroupId = uuid();
Expand All @@ -112,7 +108,6 @@ export const generateAskerSession = ({
lastMessage: null,
messageDate: null,
messagesRead: messagesRead === undefined ? true : messagesRead,
isTeamSession: isTeamSession === undefined ? true : isTeamSession,
attachment: null,
registrationType: 'REGISTERED',
e2eLastMessage: {
Expand All @@ -133,7 +128,6 @@ export const generateAskerSession = ({
postcode: '12345',
city: 'city',
description: null,
teamAgency: true,
offline: false,
consultingType: 1
},
Expand Down
9 changes: 1 addition & 8 deletions src/api/apiGetConsultantSessionList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,8 @@ export const apiGetConsultantSessionList = async ({
count = SESSION_COUNT,
signal
}: ApiGetConsultantSessionListInterface): Promise<ListItemsResponseInterface> => {
const isTeamSession: boolean = type === SESSION_LIST_TYPES.TEAMSESSION;
let url: string;
if (isTeamSession) {
url = `${
sessionListTab === SESSION_LIST_TAB_ARCHIVE
? `${endpoints.teamSessionsBase}${SESSION_LIST_TAB_ARCHIVE}?`
: `${endpoints.consultantTeamSessions}`
}`;
} else if (type === SESSION_LIST_TYPES.MY_SESSION) {
if (type === SESSION_LIST_TYPES.MY_SESSION) {
url = `${
sessionListTab === SESSION_LIST_TAB_ARCHIVE
? `${endpoints.myMessagesBase}${SESSION_LIST_TAB_ARCHIVE}?`
Expand Down
1 change: 0 additions & 1 deletion src/components/agencyRadioSelect/AgencyRadioSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export const AgencyRadioSelect = ({
prefix: 'agency'
}}
info={agency}
showTeamAgencyInfo={agency.teamAgency}
isProfileView={showTooltipAbove}
/>
</div>
Expand Down
23 changes: 6 additions & 17 deletions src/components/app/NavigationBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,9 @@ export const NavigationBar = ({
AUTHORITIES.CONSULTANT_DEFAULT,
userData
);
const {
sessions: unreadSessions,
group: unreadGroup,
teamsessions: unreadTeamSessions
} = useContext(RocketChatUnreadContext);
const { sessions: unreadSessions, group: unreadGroup } = useContext(
RocketChatUnreadContext
);
const { tenant } = useContext(TenantContext);

const ref_menu = useRef<any>([]);
Expand Down Expand Up @@ -103,29 +101,20 @@ export const NavigationBar = ({
return;
}

if (
unreadSessions.length +
unreadGroup.length +
unreadTeamSessions.length >
0
) {
if (unreadSessions.length + unreadGroup.length > 0) {
setAnimateNavIcon(true);
}

animateNavIconTimeoutRef.current = setTimeout(() => {
setAnimateNavIcon(false);
animateNavIconTimeoutRef.current = null;
}, 1000);
}, [unreadSessions, unreadGroup, unreadTeamSessions]);

const notificationConsultant = isConsultant ? 0 : unreadTeamSessions.length;
}, [unreadSessions, unreadGroup]);

const pathsToShowUnreadMessageNotification = {
'/sessions/consultant/sessionView':
unreadSessions.length + unreadGroup.length,
'/sessions/user/view':
unreadSessions.length + unreadGroup.length + notificationConsultant,
'/sessions/consultant/teamSessionView': unreadTeamSessions.length,
'/sessions/user/view': unreadSessions.length + unreadGroup.length,
'/profile': isFirstVisit && !browserNotificationsSettings().visited
};

Expand Down
Loading

0 comments on commit 8c2a811

Please sign in to comment.