diff --git a/.github/workflows/dockerImage.yml b/.github/workflows/dockerImage.yml
index 9c9923f37..04c8a38ec 100644
--- a/.github/workflows/dockerImage.yml
+++ b/.github/workflows/dockerImage.yml
@@ -10,7 +10,6 @@ on:
- 'dockerImage.v.*'
- 'v*'
-
jobs:
build:
name: Build
diff --git a/cypress/fixtures/registration/agency.json b/cypress/fixtures/registration/agency.json
index 83a44d3bc..ed708e557 100644
--- a/cypress/fixtures/registration/agency.json
+++ b/cypress/fixtures/registration/agency.json
@@ -4,7 +4,6 @@
"postcode": "postcode",
"city": "city",
"description": "description",
- "teamAgency": true,
"offline": false,
"consultingType": 1,
"topicIds": null
diff --git a/cypress/fixtures/registration/consultingType.json b/cypress/fixtures/registration/consultingType.json
index 7235f05f6..45cb8d244 100644
--- a/cypress/fixtures/registration/consultingType.json
+++ b/cypress/fixtures/registration/consultingType.json
@@ -19,12 +19,10 @@
}
},
"isSubsequentRegistrationAllowed": true,
- "isAnonymousConversationAllowed": true,
"isSetEmailAllowed": true,
"slug": "suchtberatung",
"languageFormal": true,
"lockedAgencies": false,
- "excludeNonMainConsultantsFromTeamSessions": false,
"whiteSpot": {
"whiteSpotAgencyAssigned": true,
"whiteSpotAgencyId": 100
@@ -46,20 +44,12 @@
"relation": true,
"state": false
},
- "initializeFeedbackChat": false,
"roles": {
"consultant": {
"main": ["consultant"],
"peer": ["consultant"]
}
},
- "notifications": {
- "teamSessions": {
- "newMessage": {
- "allTeamConsultants": false
- }
- }
- },
"showAskerProfile": true,
"welcomeScreen": {
"anonymous": {
diff --git a/cypress/fixtures/service.agencies.json b/cypress/fixtures/service.agencies.json
index fa14f1ff9..99e496cff 100644
--- a/cypress/fixtures/service.agencies.json
+++ b/cypress/fixtures/service.agencies.json
@@ -5,7 +5,6 @@
"postcode": "postcode",
"city": "city",
"description": "description",
- "teamAgency": true,
"offline": false,
"consultingType": 1,
"url": "url",
diff --git a/cypress/fixtures/service.consultingtypes.addiction.json b/cypress/fixtures/service.consultingtypes.addiction.json
index 7235f05f6..45cb8d244 100644
--- a/cypress/fixtures/service.consultingtypes.addiction.json
+++ b/cypress/fixtures/service.consultingtypes.addiction.json
@@ -19,12 +19,10 @@
}
},
"isSubsequentRegistrationAllowed": true,
- "isAnonymousConversationAllowed": true,
"isSetEmailAllowed": true,
"slug": "suchtberatung",
"languageFormal": true,
"lockedAgencies": false,
- "excludeNonMainConsultantsFromTeamSessions": false,
"whiteSpot": {
"whiteSpotAgencyAssigned": true,
"whiteSpotAgencyId": 100
@@ -46,20 +44,12 @@
"relation": true,
"state": false
},
- "initializeFeedbackChat": false,
"roles": {
"consultant": {
"main": ["consultant"],
"peer": ["consultant"]
}
},
- "notifications": {
- "teamSessions": {
- "newMessage": {
- "allTeamConsultants": false
- }
- }
- },
"showAskerProfile": true,
"welcomeScreen": {
"anonymous": {
diff --git a/cypress/fixtures/service.consultingtypes.emigration.json b/cypress/fixtures/service.consultingtypes.emigration.json
index 8dc7efb54..ce6c14c61 100644
--- a/cypress/fixtures/service.consultingtypes.emigration.json
+++ b/cypress/fixtures/service.consultingtypes.emigration.json
@@ -21,12 +21,10 @@
}
},
"isSubsequentRegistrationAllowed": true,
- "isAnonymousConversationAllowed": true,
"isSetEmailAllowed": true,
"slug": "rw-auswanderung",
"languageFormal": true,
"lockedAgencies": false,
- "excludeNonMainConsultantsFromTeamSessions": false,
"whiteSpot": {
"whiteSpotAgencyAssigned": true,
"whiteSpotAgencyId": 1731
@@ -43,20 +41,12 @@
"sendFurtherStepsMessage": true,
"sendSaveSessionDataMessage": true,
"sessionDataInitializing": {},
- "initializeFeedbackChat": false,
"roles": {
"consultant": {
"main": ["consultant"],
"peer": ["consultant"]
}
},
- "notifications": {
- "teamSessions": {
- "newMessage": {
- "allTeamConsultants": false
- }
- }
- },
"showAskerProfile": false,
"welcomeScreen": {
"anonymous": {
diff --git a/cypress/fixtures/service.consultingtypes.pregnancy.json b/cypress/fixtures/service.consultingtypes.pregnancy.json
index 1eabaa92a..f6d82bca2 100644
--- a/cypress/fixtures/service.consultingtypes.pregnancy.json
+++ b/cypress/fixtures/service.consultingtypes.pregnancy.json
@@ -19,13 +19,11 @@
}
},
"isSubsequentRegistrationAllowed": true,
- "isAnonymousConversationAllowed": true,
"isVideoCallAllowed": true,
"isSetEmailAllowed": true,
"slug": "suchtberatung",
"languageFormal": true,
"lockedAgencies": false,
- "excludeNonMainConsultantsFromTeamSessions": false,
"whiteSpot": {
"whiteSpotAgencyAssigned": true,
"whiteSpotAgencyId": 100
@@ -47,20 +45,12 @@
"relation": true,
"state": false
},
- "initializeFeedbackChat": false,
"roles": {
"consultant": {
"main": ["consultant"],
"peer": ["consultant"]
}
},
- "notifications": {
- "teamSessions": {
- "newMessage": {
- "allTeamConsultants": false
- }
- }
- },
"showAskerProfile": true,
"welcomeScreen": {
"anonymous": {
diff --git a/cypress/fixtures/service.consultingtypes.u25.json b/cypress/fixtures/service.consultingtypes.u25.json
index 4649c0e3b..fdb9e9fdf 100644
--- a/cypress/fixtures/service.consultingtypes.u25.json
+++ b/cypress/fixtures/service.consultingtypes.u25.json
@@ -23,12 +23,10 @@
}
},
"isSubsequentRegistrationAllowed": false,
- "isAnonymousConversationAllowed": false,
"isSetEmailAllowed": false,
"slug": "u25",
"languageFormal": false,
"lockedAgencies": false,
- "excludeNonMainConsultantsFromTeamSessions": false,
"whiteSpot": {
"whiteSpotAgencyAssigned": false
},
@@ -50,20 +48,12 @@
"relation": false,
"state": true
},
- "initializeFeedbackChat": true,
"roles": {
"consultant": {
"main": ["consultant", "u25-consultant", "u25-main-consultant"],
"peer": ["consultant", "u25-consultant"]
}
},
- "notifications": {
- "teamSessions": {
- "newMessage": {
- "allTeamConsultants": false
- }
- }
- },
"showAskerProfile": true,
"requiredComponents": {
"age": {
diff --git a/cypress/fixtures/service.users.data.json b/cypress/fixtures/service.users.data.json
index eec6202ed..21a27b674 100644
--- a/cypress/fixtures/service.users.data.json
+++ b/cypress/fixtures/service.users.data.json
@@ -13,7 +13,6 @@
"postcode": "12345",
"city": "city",
"description": "description",
- "teamAgency": true,
"offline": false,
"consultingType": 0
}
@@ -23,11 +22,9 @@
"AUTHORIZATION_VIEW_AGENCY_CONSULTANTS",
"AUTHORIZATION_ASSIGN_CONSULTANT_TO_SESSION"
],
- "hasAnonymousConversations": false,
"consultingTypes": null,
"formalLanguage": true,
"absent": false,
- "inTeamAgency": true,
"languages": [],
"emailToggles": [
{
@@ -37,10 +34,6 @@
{
"name": "NEW_CHAT_MESSAGE_FROM_ADVICE_SEEKER",
"state": true
- },
- {
- "name": "NEW_FEEDBACK_MESSAGE_FROM_ADVICE_SEEKER",
- "state": true
}
]
},
@@ -58,17 +51,14 @@
"postcode": "12345",
"city": "city",
"description": "description",
- "teamAgency": true,
"offline": false,
"consultingType": 2
}
],
"grantedAuthorities": ["AUTHORIZATION_CONSULTANT_DEFAULT"],
- "hasAnonymousConversations": false,
"consultingTypes": null,
"formalLanguage": true,
- "absent": false,
- "inTeamAgency": true
+ "absent": false
},
{
"userId": "asker",
@@ -90,16 +80,13 @@
"postcode": "12345",
"city": "city",
"description": null,
- "teamAgency": true,
"offline": false,
"consultingType": 1
}
},
"17": { "sessionData": null, "isRegistered": false, "agency": null }
},
- "hasAnonymousConversations": false,
"formalLanguage": true,
- "absent": false,
- "inTeamAgency": false
+ "absent": false
}
]
diff --git a/cypress/fixtures/service.users.sessions.room.json b/cypress/fixtures/service.users.sessions.room.json
index 7f29441d3..388a3e81a 100644
--- a/cypress/fixtures/service.users.sessions.room.json
+++ b/cypress/fixtures/service.users.sessions.room.json
@@ -7,15 +7,11 @@
"postcode": "12345",
"language": "de",
"groupId": "someGroupId",
- "feedbackGroupId": null,
- "isPeerChat": false,
"askerRcId": "askerRcId",
"e2eLastMessage": null,
"lastMessage": null,
"messageDate": 0,
"messagesRead": false,
- "feedbackRead": true,
- "isTeamSession": false,
"registrationType": "REGISTERED",
"createDate": "2022-06-15T08:09:18Z",
"attachment": null,
diff --git a/cypress/support/commands/mockApi.ts b/cypress/support/commands/mockApi.ts
index 30d2d8b40..845ad802d 100644
--- a/cypress/support/commands/mockApi.ts
+++ b/cypress/support/commands/mockApi.ts
@@ -38,10 +38,6 @@ const defaultReturns = {
{
name: 'NEW_CHAT_MESSAGE_FROM_ADVICE_SEEKER',
state: false
- },
- {
- name: 'NEW_FEEDBACK_MESSAGE_FROM_ADVICE_SEEKER',
- state: false
}
]
},
diff --git a/cypress/support/sessions.ts b/cypress/support/sessions.ts
index 39b512220..455b85829 100644
--- a/cypress/support/sessions.ts
+++ b/cypress/support/sessions.ts
@@ -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';
@@ -43,15 +42,10 @@ export const generateConsultantSession = ({
status,
postcode: 12345,
groupId: rcGroupId,
- feedbackGroupId: null,
askerRcId: 'askerRcId',
lastMessage: 'lastMessage',
messageDate: 1606900238,
messagesRead: messagesRead === undefined ? true : messagesRead,
- feedbackRead: true,
- isTeamSession: true,
- isFeedbackSession: false,
- isPeerChat: false,
attachment: null,
registrationType: 'REGISTERED',
e2eLastMessage: {
@@ -90,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();
@@ -112,15 +104,10 @@ export const generateAskerSession = ({
status: 2,
postcode: 12345,
groupId: rcGroupId,
- feedbackGroupId: 'feedbackGroupId1',
askerRcId: 'askerRcId1',
lastMessage: null,
messageDate: null,
messagesRead: messagesRead === undefined ? true : messagesRead,
- feedbackRead: null,
- isTeamSession: isTeamSession === undefined ? true : isTeamSession,
- isFeedbackSession: false,
- isPeerChat: false,
attachment: null,
registrationType: 'REGISTERED',
e2eLastMessage: {
@@ -141,7 +128,6 @@ export const generateAskerSession = ({
postcode: '12345',
city: 'city',
description: null,
- teamAgency: true,
offline: false,
consultingType: 1
},
diff --git a/src/api/apiAnonymousConversationAvailability.ts b/src/api/apiAnonymousConversationAvailability.ts
deleted file mode 100644
index c411dc1ba..000000000
--- a/src/api/apiAnonymousConversationAvailability.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { endpoints } from '../resources/scripts/endpoints';
-import { fetchData, FETCH_METHODS, FETCH_ERRORS } from './fetchData';
-
-export interface AnonymousConversationAvailabilityInterface {
- numAvailableConsultants: number;
- status: string;
-}
-
-export const apiAnonymousConversationAvailability = async (
- sessionId: number
-): Promise => {
- const url = `${endpoints.anonymousBase}${sessionId}`;
-
- return fetchData({
- url: url,
- method: FETCH_METHODS.GET,
- responseHandling: [FETCH_ERRORS.CONFLICT, FETCH_ERRORS.ABORTED]
- });
-};
diff --git a/src/api/apiEnquiryAcceptance.ts b/src/api/apiEnquiryAcceptance.ts
index 2eda4c840..b4b488b12 100644
--- a/src/api/apiEnquiryAcceptance.ts
+++ b/src/api/apiEnquiryAcceptance.ts
@@ -1,13 +1,8 @@
import { endpoints } from '../resources/scripts/endpoints';
import { fetchData, FETCH_ERRORS, FETCH_METHODS } from './fetchData';
-export const apiEnquiryAcceptance = async (
- sessionId: number,
- isAnonymousEnquiry: boolean = false
-): Promise => {
- const url = isAnonymousEnquiry
- ? `${endpoints.anonymousAskerBase}${sessionId}/accept`
- : `${endpoints.sessionBase}/new/${sessionId}`;
+export const apiEnquiryAcceptance = async (sessionId: number): Promise => {
+ const url = `${endpoints.sessionBase}/new/${sessionId}`;
return fetchData({
url: url,
diff --git a/src/api/apiFinishAnonymousConversation.ts b/src/api/apiFinishAnonymousConversation.ts
deleted file mode 100644
index b7184f538..000000000
--- a/src/api/apiFinishAnonymousConversation.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { endpoints } from '../resources/scripts/endpoints';
-import { fetchData, FETCH_METHODS, FETCH_ERRORS } from './fetchData';
-
-export const apiFinishAnonymousConversation = async (
- sessionId: number
-): Promise => {
- const url = `${endpoints.anonymousBase}${sessionId}/finish`;
-
- return fetchData({
- url: url,
- method: FETCH_METHODS.PUT,
- responseHandling: [FETCH_ERRORS.CONFLICT, FETCH_ERRORS.ABORTED]
- });
-};
diff --git a/src/api/apiForwardMessage.ts b/src/api/apiForwardMessage.ts
deleted file mode 100644
index 7ada6c679..000000000
--- a/src/api/apiForwardMessage.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import { endpoints } from '../resources/scripts/endpoints';
-import { fetchData, FETCH_METHODS } from './fetchData';
-
-export const apiForwardMessage = async (
- messageData: string,
- messageDate: string,
- displayName: string,
- userId: string,
- rcGroupId: string,
- isEncrypted: boolean
-): Promise => {
- const url = endpoints.forwardMessage;
- const headersData = { rcGroupId: rcGroupId };
- const data = JSON.stringify({
- message: messageData,
- timestamp: messageDate,
- username: displayName, // TODO change to displayName if message service is adjusted
- rcUserId: userId,
- t: isEncrypted ? 'e2e' : ''
- });
-
- return fetchData({
- url: url,
- method: FETCH_METHODS.POST,
- headersData: headersData,
- rcValidation: true,
- bodyData: data
- });
-};
diff --git a/src/api/apiGetConsultantSessionList.ts b/src/api/apiGetConsultantSessionList.ts
index a21f2f6fe..14718f22e 100644
--- a/src/api/apiGetConsultantSessionList.ts
+++ b/src/api/apiGetConsultantSessionList.ts
@@ -1,21 +1,17 @@
import { endpoints } from '../resources/scripts/endpoints';
import {
- SESSION_LIST_TAB_ANONYMOUS,
SESSION_LIST_TAB_ARCHIVE,
SESSION_LIST_TYPES
} from '../components/session/sessionHelpers';
import { ListItemsResponseInterface } from '../globalState/interfaces';
import { FETCH_ERRORS, FETCH_METHODS, fetchData } from './fetchData';
-export const INITIAL_FILTER: string = 'all';
-export const FILTER_FEEDBACK: string = 'feedback';
export const INITIAL_OFFSET: number = 0;
export const SESSION_COUNT: number = 15;
export const TIMEOUT: number = 10000;
export interface ApiGetConsultantSessionListInterface {
type: SESSION_LIST_TYPES;
- filter?: typeof INITIAL_FILTER | typeof FILTER_FEEDBACK;
offset?: number;
sessionListTab?: string;
count?: number;
@@ -24,34 +20,22 @@ export interface ApiGetConsultantSessionListInterface {
export const apiGetConsultantSessionList = async ({
type,
- filter = INITIAL_FILTER,
offset = INITIAL_OFFSET,
sessionListTab,
count = SESSION_COUNT,
signal
}: ApiGetConsultantSessionListInterface): Promise => {
- 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}?`
: `${endpoints.consultantSessions}`
}`;
} else {
- url = `${endpoints.consultantEnquiriesBase}${
- sessionListTab && sessionListTab === SESSION_LIST_TAB_ANONYMOUS
- ? `${SESSION_LIST_TAB_ANONYMOUS}`
- : 'registered'
- }?`;
+ url = `${endpoints.consultantEnquiriesBase}registered?`;
}
- url = url + `count=${count}&filter=${filter}&offset=${offset}`;
+ url = url + `count=${count}&filter=all&offset=${offset}`;
return fetchData({
url: url,
diff --git a/src/api/apiPostAnonymousRegistration.ts b/src/api/apiPostAnonymousRegistration.ts
deleted file mode 100644
index c533b4899..000000000
--- a/src/api/apiPostAnonymousRegistration.ts
+++ /dev/null
@@ -1,39 +0,0 @@
-import { removeAllCookies } from '../components/sessionCookie/accessSessionCookie';
-import { endpoints } from '../resources/scripts/endpoints';
-import {
- fetchData,
- FETCH_METHODS,
- FETCH_SUCCESS,
- FETCH_ERRORS
-} from './fetchData';
-
-export interface AnonymousRegistrationResponse {
- userName: string;
- sessionId: number;
- accessToken: string;
- expiresIn: number;
- refreshToken: string;
- rcUserId: string;
- rcToken: string;
- rcGroupId: string;
- refreshExpiresIn: number;
-}
-
-export const apiPostAnonymousRegistration = async (
- consultingType: number
-): Promise => {
- const url = endpoints.registerAnonymousAsker;
- const data = JSON.stringify({
- consultingType: consultingType
- });
-
- removeAllCookies();
-
- return fetchData({
- url: url,
- method: FETCH_METHODS.POST,
- bodyData: data,
- skipAuth: true,
- responseHandling: [FETCH_SUCCESS.CONTENT, FETCH_ERRORS.CONFLICT]
- });
-};
diff --git a/src/api/apiSendAliasMessage.ts b/src/api/apiSendAliasMessage.ts
index 9e1037c0f..81c177d03 100644
--- a/src/api/apiSendAliasMessage.ts
+++ b/src/api/apiSendAliasMessage.ts
@@ -3,8 +3,6 @@ import { fetchData, FETCH_METHODS } from './fetchData';
export enum ALIAS_MESSAGE_TYPES {
E2EE_ACTIVATED = 'E2EE_ACTIVATED',
- FINISHED_CONVERSATION = 'FINISHED_CONVERSATION',
- FORWARD = 'FORWARD',
FURTHER_STEPS = 'FURTHER_STEPS',
UPDATE_SESSION_DATA = 'UPDATE_SESSION_DATA',
VIDEOCALL = 'VIDEOCALL',
diff --git a/src/api/apiSendMessage.ts b/src/api/apiSendMessage.ts
index 74cd68058..fe628591f 100644
--- a/src/api/apiSendMessage.ts
+++ b/src/api/apiSendMessage.ts
@@ -4,16 +4,11 @@ import { fetchData, FETCH_METHODS } from './fetchData';
export const apiSendMessage = (
messageData: string,
rcGroupIdOrSessionId: string | number,
- isFeedback: boolean,
sendMailNotification: boolean,
isEncrypted: boolean
): Promise => {
- const url = isFeedback
- ? endpoints.sendMessageToFeedback
- : endpoints.sendMessage;
- const activeGroupId = isFeedback
- ? { rcFeedbackGroupId: rcGroupIdOrSessionId }
- : { rcGroupId: rcGroupIdOrSessionId };
+ const url = endpoints.sendMessage;
+ const activeGroupId = { rcGroupId: rcGroupIdOrSessionId };
const message = JSON.stringify({
message: messageData,
t: isEncrypted ? 'e2e' : '',
diff --git a/src/api/apiUploadAttachment.ts b/src/api/apiUploadAttachment.ts
index 2ccb8e3f3..341b76751 100644
--- a/src/api/apiUploadAttachment.ts
+++ b/src/api/apiUploadAttachment.ts
@@ -11,7 +11,6 @@ const isLocalDevelopment = nodeEnv === 'development';
export const apiUploadAttachment = (
attachment: File,
rcGroupIdOrSessionId: string | number,
- isFeedback: boolean,
sendMailNotification: boolean,
uploadProgress: Function,
handleXhr: (xhr) => void,
@@ -24,9 +23,7 @@ export const apiUploadAttachment = (
const rcUid = getValueFromCookie('rc_uid');
const csrfToken = generateCsrfToken();
- const url = isFeedback
- ? endpoints.attachmentUploadFeedbackRoom + rcGroupIdOrSessionId
- : endpoints.attachmentUpload + rcGroupIdOrSessionId;
+ const url = endpoints.attachmentUpload + rcGroupIdOrSessionId;
let data = new FormData();
data.append('file', attachment);
diff --git a/src/api/index.ts b/src/api/index.ts
index 0bbb47cae..6f44622a9 100644
--- a/src/api/index.ts
+++ b/src/api/index.ts
@@ -2,9 +2,6 @@ export * from './apiAgencySelection';
export * from './apiDeleteAskerAccount';
export * from './apiDraftMessages';
export * from './apiEnquiryAcceptance';
-export * from './apiFinishAnonymousConversation';
-export * from './apiAnonymousConversationAvailability';
-export * from './apiForwardMessage';
export * from './apiGetAgencyConsultantList';
export * from './apiGetAgencyId';
export * from './apiGetAskerSessionList';
@@ -21,7 +18,6 @@ export * from './apiGetUserData';
export * from './apiGroupChatSettings';
export * from './apiLogoutKeycloak';
export * from './apiLogoutRocketchat';
-export * from './apiPostAnonymousRegistration';
export * from './apiPostRegistration';
export * from './apiPutArchive';
export * from './apiPutDearchive';
diff --git a/src/components/agencyRadioSelect/AgencyRadioSelect.tsx b/src/components/agencyRadioSelect/AgencyRadioSelect.tsx
index 3673207d0..75736ac94 100644
--- a/src/components/agencyRadioSelect/AgencyRadioSelect.tsx
+++ b/src/components/agencyRadioSelect/AgencyRadioSelect.tsx
@@ -56,7 +56,6 @@ export const AgencyRadioSelect = ({
prefix: 'agency'
}}
info={agency}
- showTeamAgencyInfo={agency.teamAgency}
isProfileView={showTooltipAbove}
/>
diff --git a/src/components/app/FinishedAnonymousConversationHandler.tsx b/src/components/app/FinishedAnonymousConversationHandler.tsx
deleted file mode 100644
index 51180d90e..000000000
--- a/src/components/app/FinishedAnonymousConversationHandler.tsx
+++ /dev/null
@@ -1,61 +0,0 @@
-import { OVERLAY_FUNCTIONS, Overlay } from '../overlay/Overlay';
-import * as React from 'react';
-import { useContext, useEffect, useState } from 'react';
-import {
- AnonymousConversationFinishedContext,
- RocketChatContext
-} from '../../globalState';
-import { removeAllCookies } from '../sessionCookie/accessSessionCookie';
-import { useAppConfig } from '../../hooks/useAppConfig';
-import {
- finishAnonymousChatSuccessOverlayItem,
- selfFinishedAnonymousChatSuccessOverlayItem
-} from '../sessionMenu/sessionMenuHelpers';
-
-export const FinishedAnonymousConversationHandler = () => {
- const settings = useAppConfig();
-
- const [overlayActive, setOverlayActive] = useState(false);
- const { anonymousConversationFinished, setAnonymousConversationFinished } =
- useContext(AnonymousConversationFinishedContext);
- const { close: closeWebsocket } = useContext(RocketChatContext);
-
- /*
- ToDo: Refactor the anonymous logic because dropping cookies is not a clear logout.
- Other requests should be blocked too because refresh requests will end in 401
- */
- useEffect(() => {
- if (anonymousConversationFinished) {
- closeWebsocket(false);
- setOverlayActive(true);
- setTimeout(() => {
- removeAllCookies();
- }, 1500);
- } else {
- setOverlayActive(false);
- }
- }, [
- anonymousConversationFinished,
- closeWebsocket,
- setAnonymousConversationFinished
- ]);
-
- const handleOverlayAction = (buttonFunction: string) => {
- if (buttonFunction === OVERLAY_FUNCTIONS.REDIRECT_TO_URL) {
- window.location.href = settings.urls.finishedAnonymousChatRedirect;
- }
- };
-
- if (!overlayActive) return null;
-
- return (
-
- );
-};
diff --git a/src/components/app/NavigationBar.tsx b/src/components/app/NavigationBar.tsx
index 8659c231c..5d791c6dd 100644
--- a/src/components/app/NavigationBar.tsx
+++ b/src/components/app/NavigationBar.tsx
@@ -23,10 +23,7 @@ import { ReactComponent as LogoutIconOutline } from '../../resources/img/icons/l
import { ReactComponent as LogoutIconFilled } from '../../resources/img/icons/logout_filled.svg';
import clsx from 'clsx';
import { RocketChatUnreadContext } from '../../globalState/provider/RocketChatUnreadProvider';
-import {
- apiFinishAnonymousConversation,
- apiGetAskerSessionList
-} from '../../api';
+import { apiGetAskerSessionList } from '../../api';
import { useTranslation } from 'react-i18next';
import { LocaleSwitch } from '../localeSwitch/LocaleSwitch';
import { userHasBudibaseTools } from '../../api/apiGetTools';
@@ -51,18 +48,15 @@ export const NavigationBar = ({
const { consultingTypes } = useContext(ConsultingTypesContext);
const { sessions, dispatch } = useContext(SessionsDataContext);
const { selectableLocales } = useContext(LocaleContext);
- const [sessionId, setSessionId] = useState(null);
const [hasTools, setHasTools] = useState(false);
const isConsultant = hasUserAuthority(
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([]);
@@ -71,13 +65,8 @@ export const NavigationBar = ({
const ref_select = useRef();
const handleLogout = useCallback(() => {
- if (hasUserAuthority(AUTHORITIES.ANONYMOUS_DEFAULT, userData)) {
- apiFinishAnonymousConversation(sessionId).catch((error) => {
- console.error(error);
- });
- }
onLogout();
- }, [onLogout, sessionId, userData]);
+ }, [onLogout]);
const location = useLocation();
const [animateNavIcon, setAnimateNavIcon] = useState(false);
@@ -94,7 +83,6 @@ export const NavigationBar = ({
ready: true,
sessions: sessionsData.sessions
});
- setSessionId(sessionsData?.sessions?.[0]?.session?.id);
});
}
}, [dispatch, isConsultant]);
@@ -113,12 +101,7 @@ export const NavigationBar = ({
return;
}
- if (
- unreadSessions.length +
- unreadGroup.length +
- unreadTeamSessions.length >
- 0
- ) {
+ if (unreadSessions.length + unreadGroup.length > 0) {
setAnimateNavIcon(true);
}
@@ -126,16 +109,12 @@ export const NavigationBar = ({
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
};
diff --git a/src/components/app/RouterConfig.tsx b/src/components/app/RouterConfig.tsx
index 0a9f82a78..a464357cc 100644
--- a/src/components/app/RouterConfig.tsx
+++ b/src/components/app/RouterConfig.tsx
@@ -5,13 +5,9 @@ import {
SESSION_LIST_TYPES,
SESSION_TYPE_ARCHIVED,
SESSION_TYPE_ENQUIRY,
- SESSION_TYPE_FEEDBACK,
SESSION_TYPE_GROUP,
- SESSION_TYPE_LIVECHAT,
- SESSION_TYPE_SESSION,
- SESSION_TYPE_TEAMSESSION
+ SESSION_TYPE_SESSION
} from '../session/sessionHelpers';
-
import { AskerInfo } from '../askerInfo/AskerInfo';
import { Profile } from '../profile/Profile';
import { SessionViewEmpty } from '../session/SessionViewEmpty';
@@ -21,15 +17,12 @@ import { Appointments } from '../appointment/Appointments';
import VideoConference from '../videoConference/VideoConference';
import { AUTHORITIES, hasUserAuthority } from '../../globalState';
import { AppConfigInterface } from '../../globalState/interfaces';
-
import { ReactComponent as OverviewIconOutline } from '../../resources/img/icons/overview_outline.svg';
import { ReactComponent as OverviewIconFilled } from '../../resources/img/icons/overview_filled.svg';
import { ReactComponent as InboxIconOutline } from '../../resources/img/icons/inbox_outline.svg';
import { ReactComponent as InboxIconFilled } from '../../resources/img/icons/inbox_filled.svg';
import { ReactComponent as MessagesIconOutline } from '../../resources/img/icons/messages_outline.svg';
import { ReactComponent as MessagesIconFilled } from '../../resources/img/icons/messages_filled.svg';
-import { ReactComponent as TeamsIconOutline } from '../../resources/img/icons/teams_outline.svg';
-import { ReactComponent as TeamsIconFilled } from '../../resources/img/icons/teams_filled.svg';
import { ReactComponent as ProfilIconOutline } from '../../resources/img/icons/profil_outline.svg';
import { ReactComponent as ProfilIconFilled } from '../../resources/img/icons/profil_filled.svg';
import { ReactComponent as ToolsIconOutline } from '../../resources/img/icons/tools_outline.svg';
@@ -159,9 +152,7 @@ export const RouterConfigUser = (
SESSION_TYPE_SESSION,
SESSION_TYPE_ARCHIVED,
SESSION_TYPE_GROUP,
- SESSION_TYPE_LIVECHAT,
- SESSION_TYPE_ENQUIRY,
- SESSION_TYPE_TEAMSESSION
+ SESSION_TYPE_ENQUIRY
]
},
{
@@ -172,9 +163,7 @@ export const RouterConfigUser = (
SESSION_TYPE_SESSION,
SESSION_TYPE_ARCHIVED,
SESSION_TYPE_GROUP,
- SESSION_TYPE_LIVECHAT,
- SESSION_TYPE_ENQUIRY,
- SESSION_TYPE_TEAMSESSION
+ SESSION_TYPE_ENQUIRY
]
}
],
@@ -272,7 +261,7 @@ export const RouterConfigConsultant = (settings: AppConfigInterface): any => {
{
path: '/sessions/consultant/sessionPreview/:rcGroupId?/:sessionId?',
component: SessionsListWrapper,
- sessionTypes: [SESSION_TYPE_ENQUIRY, SESSION_TYPE_LIVECHAT],
+ sessionTypes: [SESSION_TYPE_ENQUIRY],
type: SESSION_LIST_TYPES.ENQUIRY,
exact: false
},
@@ -282,9 +271,7 @@ export const RouterConfigConsultant = (settings: AppConfigInterface): any => {
sessionTypes: [
SESSION_TYPE_SESSION,
SESSION_TYPE_ARCHIVED,
- SESSION_TYPE_GROUP,
- SESSION_TYPE_FEEDBACK,
- SESSION_TYPE_TEAMSESSION
+ SESSION_TYPE_GROUP
],
type: SESSION_LIST_TYPES.MY_SESSION,
exact: false
@@ -365,281 +352,3 @@ export const RouterConfigConsultant = (settings: AppConfigInterface): any => {
toolsRoutes
};
};
-
-export const RouterConfigTeamConsultant = (
- settings: AppConfigInterface
-): any => {
- return {
- plainRoutes: [
- {
- condition: hasVideoCallFeature,
- path: settings.urls.consultantVideoConference,
- exact: true,
- component: VideoConference
- }
- ],
- navigation: [
- overviewRoute(settings),
- {
- to: '/sessions/consultant/sessionPreview',
- icon: InboxIconOutline,
- iconFilled: InboxIconFilled,
- titleKeys: {
- large: 'navigation.consultant.enquiries'
- }
- },
- {
- to: '/sessions/consultant/sessionView',
- icon: MessagesIconOutline,
- iconFilled: MessagesIconFilled,
- titleKeys: {
- large: 'navigation.consultant.sessions.large',
- small: 'navigation.consultant.sessions.small'
- }
- },
- {
- to: '/sessions/consultant/teamSessionView',
- icon: TeamsIconOutline,
- iconFilled: TeamsIconFilled,
- titleKeys: {
- large: 'navigation.consultant.teamsessions.large',
- small: 'navigation.consultant.teamsessions.small'
- }
- },
- {
- condition: (userData, consultingTypes) =>
- isVideoAppointmentsEnabled(
- userData,
- consultingTypes,
- settings.disableVideoAppointments
- ),
- to: '/termine',
- icon: CalendarIconOutline,
- iconFilled: CalendarIconFilled,
- titleKeys: {
- large: 'navigation.appointments'
- }
- },
- {
- condition: showAppointmentsMenuItem,
- to: '/booking/events',
- icon: CalendarIconOutline,
- iconFilled: CalendarIconFilled,
- titleKeys: {
- large: 'navigation.booking.events'
- }
- },
- {
- to: '/profile',
- icon: ProfilIconOutline,
- iconFilled: ProfilIconFilled,
- titleKeys: {
- large: 'navigation.profile'
- }
- }
- ],
- listRoutes: [
- {
- path: '/sessions/consultant/sessionPreview/:rcGroupId?/:sessionId?',
- component: SessionsListWrapper,
- sessionTypes: [SESSION_TYPE_LIVECHAT, SESSION_TYPE_ENQUIRY],
- type: SESSION_LIST_TYPES.ENQUIRY,
- exact: false
- },
- {
- path: '/sessions/consultant/sessionView/:rcGroupId?/:sessionId?',
- component: SessionsListWrapper,
- sessionTypes: [
- SESSION_TYPE_SESSION,
- SESSION_TYPE_ARCHIVED,
- SESSION_TYPE_GROUP,
- SESSION_TYPE_FEEDBACK,
- SESSION_TYPE_TEAMSESSION
- ],
- type: SESSION_LIST_TYPES.MY_SESSION,
- exact: false
- },
- {
- path: '/sessions/consultant/teamSessionView/:rcGroupId?/:sessionId?',
- component: SessionsListWrapper,
- sessionTypes: [
- SESSION_TYPE_SESSION,
- SESSION_TYPE_ARCHIVED,
- SESSION_TYPE_GROUP,
- SESSION_TYPE_FEEDBACK,
- SESSION_TYPE_TEAMSESSION
- ],
- type: SESSION_LIST_TYPES.TEAMSESSION,
- exact: false
- }
- ],
- detailRoutes: [
- {
- path: '/sessions/consultant/sessionPreview/',
- component: SessionViewEmpty,
- type: SESSION_LIST_TYPES.ENQUIRY
- },
- {
- path: '/sessions/consultant/sessionPreview/:rcGroupId/:sessionId',
- component: SessionView,
- type: SESSION_LIST_TYPES.ENQUIRY
- },
- {
- path: '/sessions/consultant/sessionView/',
- component: SessionViewEmpty,
- type: SESSION_LIST_TYPES.MY_SESSION
- },
- {
- path: '/sessions/consultant/sessionView/:rcGroupId/:sessionId/',
- component: SessionView,
- type: SESSION_LIST_TYPES.MY_SESSION
- },
- {
- path: '/sessions/consultant/sessionView/:rcGroupId/:sessionId/editGroupChat',
- component: CreateGroupChatView,
- type: SESSION_LIST_TYPES.MY_SESSION
- },
- {
- path: '/sessions/consultant/teamSessionView/',
- component: SessionViewEmpty,
- type: SESSION_LIST_TYPES.TEAMSESSION
- },
- {
- path: '/sessions/consultant/teamSessionView/:rcGroupId/:sessionId/',
- component: SessionView,
- type: SESSION_LIST_TYPES.TEAMSESSION
- },
- {
- path: '/sessions/consultant/teamSessionView/:rcGroupId/:sessionId/editGroupChat',
- component: CreateGroupChatView,
- type: SESSION_LIST_TYPES.TEAMSESSION
- }
- ],
- userProfileRoutes: [
- {
- path: '/sessions/consultant/sessionPreview/:rcGroupId/:sessionId/userProfile',
- component: AskerInfo,
- type: SESSION_LIST_TYPES.ENQUIRY
- },
- {
- path: '/sessions/consultant/sessionView/:rcGroupId/:sessionId/userProfile',
- component: AskerInfo,
- type: SESSION_LIST_TYPES.MY_SESSION
- },
- {
- path: '/sessions/consultant/sessionView/:rcGroupId/:sessionId/groupChatInfo',
- component: GroupChatInfo,
- type: SESSION_LIST_TYPES.MY_SESSION
- },
- {
- path: '/sessions/consultant/teamSessionView/:rcGroupId/:sessionId/userProfile',
- component: AskerInfo,
- type: SESSION_LIST_TYPES.TEAMSESSION
- },
- {
- path: '/sessions/consultant/teamSessionView/:rcGroupId/:sessionId/groupChatInfo',
- component: GroupChatInfo,
- type: SESSION_LIST_TYPES.TEAMSESSION
- },
- {
- path: '/sessions/consultant/sessionView/createGroupChat/',
- component: CreateGroupChatView,
- type: SESSION_LIST_TYPES.MY_SESSION
- }
- ],
- profileRoutes: [
- {
- path: '/overview',
- component: OverviewPage
- },
- {
- path: '/profile',
- exact: false,
- component: Profile
- },
- {
- condition: (userData, consultingTypes) =>
- isVideoAppointmentsEnabled(
- userData,
- consultingTypes,
- settings.disableVideoAppointments
- ),
- path: '/termine',
- exact: false,
- component: Appointments
- }
- ],
- appointmentRoutes,
- toolsRoutes
- };
-};
-
-export const RouterConfigPeerConsultant = (
- settings: AppConfigInterface
-): any => {
- return RouterConfigConsultant(settings);
-};
-
-export const RouterConfigMainConsultant = (
- settings: AppConfigInterface
-): any => {
- const config = RouterConfigTeamConsultant(settings);
-
- config.navigation[3].titleKeys = {
- large: 'navigation.consultant.peersessions.large',
- small: 'navigation.consultant.peersessions.small'
- };
- return config;
-};
-
-export const RouterConfigAnonymousAsker = (): any => {
- return {
- navigation: [
- {
- to: '/sessions/user/view',
- icon: MessagesIconOutline,
- iconFilled: MessagesIconFilled,
- titleKeys: {
- large: 'navigation.asker.sessions.large',
- small: 'navigation.asker.sessions.small'
- }
- }
- ],
- listRoutes: [
- {
- path: '/sessions/user/view/:rcGroupId?/:sessionId?',
- component: SessionsListWrapper,
- exact: false,
- sessionTypes: [
- SESSION_TYPE_SESSION,
- SESSION_TYPE_ARCHIVED,
- SESSION_TYPE_GROUP,
- SESSION_TYPE_LIVECHAT,
- SESSION_TYPE_ENQUIRY,
- SESSION_TYPE_TEAMSESSION
- ]
- }
- ],
- detailRoutes: [
- {
- path: '/sessions/user/view/:rcGroupId/:sessionId',
- component: SessionView,
- type: SESSION_LIST_TYPES.MY_SESSION
- },
- {
- path: '/sessions/user/view/',
- component: SessionViewEmpty,
- type: SESSION_LIST_TYPES.MY_SESSION
- },
- {
- path: '/booking/reschedule',
- component: BookingReschedule
- },
- {
- path: '/booking/events',
- exact: false,
- component: BookingEvents
- }
- ]
- };
-};
diff --git a/src/components/app/Routing.tsx b/src/components/app/Routing.tsx
index 77e9bc3ed..36b8bad04 100644
--- a/src/components/app/Routing.tsx
+++ b/src/components/app/Routing.tsx
@@ -1,14 +1,7 @@
import * as React from 'react';
import { useContext, useMemo, Suspense } from 'react';
import { Route, Switch, Redirect } from 'react-router-dom';
-import {
- RouterConfigUser,
- RouterConfigConsultant,
- RouterConfigTeamConsultant,
- RouterConfigMainConsultant,
- RouterConfigPeerConsultant,
- RouterConfigAnonymousAsker
-} from './RouterConfig';
+import { RouterConfigUser, RouterConfigConsultant } from './RouterConfig';
import { AbsenceHandler } from './AbsenceHandler';
import {
UserDataContext,
@@ -20,7 +13,6 @@ import {
} from '../../globalState';
import { NavigationBar } from './NavigationBar';
import { Header } from '../header/Header';
-import { FinishedAnonymousConversationHandler } from './FinishedAnonymousConversationHandler';
import { ReleaseNote } from '../releaseNote/ReleaseNote';
import { NonPlainRoutesWrapper } from './NonPlainRoutesWrapper';
import { Walkthrough } from '../walkthrough/Walkthrough';
@@ -41,24 +33,9 @@ export const Routing = (props: RoutingProps) => {
const hasAssignedConsultant = useAskerHasAssignedConsultant();
const routerConfig = useMemo(() => {
- if (hasUserAuthority(AUTHORITIES.VIEW_ALL_PEER_SESSIONS, userData)) {
- return RouterConfigMainConsultant(settings);
- }
- if (hasUserAuthority(AUTHORITIES.USE_FEEDBACK, userData)) {
- return RouterConfigPeerConsultant(settings);
- }
- if (
- hasUserAuthority(AUTHORITIES.CONSULTANT_DEFAULT, userData) &&
- userData.inTeamAgency
- ) {
- return RouterConfigTeamConsultant(settings);
- }
if (hasUserAuthority(AUTHORITIES.CONSULTANT_DEFAULT, userData)) {
return RouterConfigConsultant(settings);
}
- if (hasUserAuthority(AUTHORITIES.ANONYMOUS_DEFAULT, userData)) {
- return RouterConfigAnonymousAsker();
- }
return RouterConfigUser(settings, hasAssignedConsultant);
}, [userData, settings, hasAssignedConsultant]);
@@ -365,10 +342,6 @@ export const Routing = (props: RoutingProps) => {
AUTHORITIES.CONSULTANT_DEFAULT,
userData
) && }
- {hasUserAuthority(
- AUTHORITIES.ANONYMOUS_DEFAULT,
- userData
- ) && }
{hasUserAuthority(
AUTHORITIES.CONSULTANT_DEFAULT,
userData
diff --git a/src/components/app/WebsocketHandler.tsx b/src/components/app/WebsocketHandler.tsx
index 25fe929e8..34a57f9c2 100644
--- a/src/components/app/WebsocketHandler.tsx
+++ b/src/components/app/WebsocketHandler.tsx
@@ -1,5 +1,5 @@
import * as React from 'react';
-import { useContext, useEffect, useMemo, useState } from 'react';
+import { useContext, useEffect, useState } from 'react';
import { useHistory } from 'react-router-dom';
import { Stomp } from '@stomp/stompjs';
import * as SockJS from 'sockjs-client';
@@ -10,24 +10,14 @@ import {
VideoCallRequestProps
} from '../incomingVideoCall/IncomingVideoCall';
import {
- AnonymousConversationFinishedContext,
- AnonymousConversationStartedContext,
- AnonymousEnquiryAcceptedContext,
- AUTHORITIES,
- ConsultingTypesContext,
- hasUserAuthority,
NotificationsContext,
- UserDataContext,
WebsocketConnectionDeactivatedContext
} from '../../globalState';
-import { SESSION_LIST_TAB_ANONYMOUS } from '../session/sessionHelpers';
import {
isBrowserNotificationTypeEnabled,
sendNotification
} from '../../utils/notificationHelpers';
import { useTranslation } from 'react-i18next';
-import { RocketChatUserStatusContext } from '../../globalState/provider/RocketChatUserStatusProvider';
-import { STATUS_ONLINE } from './RocketChat';
import { useAppConfig } from '../../hooks/useAppConfig';
interface WebsocketHandlerProps {
@@ -38,45 +28,14 @@ export const WebsocketHandler = ({ disconnect }: WebsocketHandlerProps) => {
const { t: translate } = useTranslation();
const history = useHistory();
const { releaseToggles } = useAppConfig();
- const { userData } = useContext(UserDataContext);
- const { consultingTypes } = useContext(ConsultingTypesContext);
- const { status } = useContext(RocketChatUserStatusContext);
-
const [newStompDirectMessage, setNewStompDirectMessage] =
useState(false);
- const [newStompAnonymousEnquiry, setNewStompAnonymousEnquiry] =
- useState(false);
const [newStompVideoCallRequest, setNewStompVideoCallRequest] =
useState();
const { addNotification } = useContext(NotificationsContext);
- const { setAnonymousEnquiryAccepted } = useContext(
- AnonymousEnquiryAcceptedContext
- );
- const { setAnonymousConversationFinished } = useContext(
- AnonymousConversationFinishedContext
- );
const { setWebsocketConnectionDeactivated } = useContext(
WebsocketConnectionDeactivatedContext
);
- const { setAnonymousConversationStarted } = useContext(
- AnonymousConversationStartedContext
- );
-
- const hasLiveChatAndEnabled = useMemo(
- () =>
- consultingTypes &&
- hasUserAuthority(AUTHORITIES.CONSULTANT_DEFAULT, userData) &&
- userData.hasAnonymousConversations &&
- userData.agencies.some(
- (agency) =>
- (consultingTypes ?? []).find(
- (consultingType) =>
- consultingType.id === agency.consultingType
- )?.isAnonymousConversationAllowed
- ) &&
- status === STATUS_ONLINE,
- [consultingTypes, userData, status]
- );
const stompClient = Stomp.over(function () {
return new SockJS(endpoints.liveservice);
@@ -138,31 +97,6 @@ export const WebsocketHandler = ({ disconnect }: WebsocketHandlerProps) => {
}
}, [newStompDirectMessage]); // eslint-disable-line react-hooks/exhaustive-deps
- useEffect(() => {
- if (newStompAnonymousEnquiry) {
- setNewStompAnonymousEnquiry(false);
-
- if (!hasLiveChatAndEnabled) {
- return;
- }
-
- setAnonymousConversationStarted(true);
- if (
- !releaseToggles.enableNewNotifications ||
- isBrowserNotificationTypeEnabled('initialEnquiry')
- ) {
- sendNotification(translate('notifications.enquiry.new'), {
- showAlways: true,
- onclick: () => {
- history.push(
- `/sessions/consultant/sessionPreview?sessionListTab=${SESSION_LIST_TAB_ANONYMOUS}`
- );
- }
- });
- }
- }
- }, [newStompAnonymousEnquiry, hasLiveChatAndEnabled]); // eslint-disable-line react-hooks/exhaustive-deps
-
useEffect(() => {
if (newStompVideoCallRequest) {
addNotification({
@@ -187,14 +121,6 @@ export const WebsocketHandler = ({ disconnect }: WebsocketHandlerProps) => {
const stompEventContent: VideoCallRequestProps =
stompMessageBody['eventContent'];
setNewStompVideoCallRequest(stompEventContent);
- } else if (stompEventType === 'newAnonymousEnquiry') {
- setNewStompAnonymousEnquiry(true);
- } else if (stompEventType === 'anonymousEnquiryAccepted') {
- setAnonymousEnquiryAccepted(true);
- } else if (stompEventType === 'anonymousConversationFinished') {
- const finishConversationPhase =
- stompMessageBody.eventContent?.finishConversationPhase;
- setAnonymousConversationFinished(finishConversationPhase);
}
message.ack({ 'message-id': message.headers.id });
});
diff --git a/src/components/app/app.tsx b/src/components/app/app.tsx
index 014c49253..e5ea578cb 100644
--- a/src/components/app/app.tsx
+++ b/src/components/app/app.tsx
@@ -46,11 +46,7 @@ const Registration = lazy(() =>
default: m.Registration
}))
);
-const WaitingRoomLoader = lazy(() =>
- import('../waitingRoom/WaitingRoomLoader').then((m) => ({
- default: m.WaitingRoomLoader
- }))
-);
+
const VideoConference = lazy(
() => import('../videoConference/VideoConference')
);
@@ -171,14 +167,6 @@ const RouterWrapper = ({ extraRoutes }: RouterWrapperProps) => {
-
-
- setStartWebsocket(true)
- }
- />
-
-
diff --git a/src/components/askerInfo/AskerInfoAssign.tsx b/src/components/askerInfo/AskerInfoAssign.tsx
index e16191738..aa1d74d01 100644
--- a/src/components/askerInfo/AskerInfoAssign.tsx
+++ b/src/components/askerInfo/AskerInfoAssign.tsx
@@ -20,7 +20,6 @@ export const AskerInfoAssign = ({
const { userData } = useContext(UserDataContext);
return (
- !activeSession.isLive &&
hasUserAuthority(AUTHORITIES.CONSULTANT_DEFAULT, userData) && (
<>
diff --git a/src/components/askerInfo/AskerInfoContent.tsx b/src/components/askerInfo/AskerInfoContent.tsx
index 3902fa223..e327e6faa 100644
--- a/src/components/askerInfo/AskerInfoContent.tsx
+++ b/src/components/askerInfo/AskerInfoContent.tsx
@@ -24,30 +24,23 @@ export const AskerInfoContent = () => {
const { type } = useContext(SessionTypeContext);
const isSessionAssignAvailable = useMemo(() => {
- const isPeerChat = activeSession.item.isPeerChat;
- const isLiveChat = activeSession.isLive;
const isGroupChat = activeSession.isGroup;
const isEnquiryListView = type === SESSION_LIST_TYPES.ENQUIRY;
const isAsker = hasUserAuthority(AUTHORITIES.ASKER_DEFAULT, userData);
- if (isAsker || isLiveChat || isGroupChat) {
+ if (isAsker || isGroupChat) {
return false;
}
if (isEnquiryListView) {
- return (
- isPeerChat &&
- hasUserAuthority(
- AUTHORITIES.ASSIGN_CONSULTANT_TO_ENQUIRY,
- userData
- )
+ return hasUserAuthority(
+ AUTHORITIES.ASSIGN_CONSULTANT_TO_ENQUIRY,
+ userData
);
}
return hasUserAuthority(
- isPeerChat
- ? AUTHORITIES.ASSIGN_CONSULTANT_TO_PEER_SESSION
- : AUTHORITIES.ASSIGN_CONSULTANT_TO_SESSION,
+ AUTHORITIES.ASSIGN_CONSULTANT_TO_SESSION,
userData
);
}, [activeSession, type, userData]);
diff --git a/src/components/askerInfo/AskerInfoData.tsx b/src/components/askerInfo/AskerInfoData.tsx
index 03e1e21b3..7a7fb5a78 100644
--- a/src/components/askerInfo/AskerInfoData.tsx
+++ b/src/components/askerInfo/AskerInfoData.tsx
@@ -31,17 +31,16 @@ export const AskerInfoData = () => {
{topic?.name || ''}
- {activeSession.item.consultingType === 0 &&
- !activeSession.isLive && (
-
-
- {translate('userProfile.data.postcode')}
-
-
- {activeSession.item.postcode}
-
-
- )}
+ {activeSession.item.consultingType === 0 && (
+
+
+ {translate('userProfile.data.postcode')}
+
+
+ {activeSession.item.postcode}
+
+
+ )}
{preparedUserSessionData.map((item, index) =>
item.type === 'age' && item.value === 'null' ? null : (
diff --git a/src/components/form/textarea.styles.scss b/src/components/form/textarea.styles.scss
index f13eaefc5..fc1ba3add 100644
--- a/src/components/form/textarea.styles.scss
+++ b/src/components/form/textarea.styles.scss
@@ -66,7 +66,7 @@
}
/* stylelint-disable */
- label:not(.requestFeedbackLabel) {
+ label {
width: calc(100% - #{$grid-base-three * 2});
position: absolute;
left: $grid-base-three;
@@ -77,5 +77,6 @@
text-align: left;
background-color: white;
}
+
/* stylelint-enable */
}
diff --git a/src/components/infoTooltip/InfoTooltip.tsx b/src/components/infoTooltip/InfoTooltip.tsx
index 6537644ca..cf8c7d82b 100644
--- a/src/components/infoTooltip/InfoTooltip.tsx
+++ b/src/components/infoTooltip/InfoTooltip.tsx
@@ -19,13 +19,11 @@ export interface DisplayInfoProps {
ns: string;
};
isProfileView?: boolean;
- showTeamAgencyInfo?: boolean;
}
export const InfoTooltip = ({
translation,
isProfileView,
- showTeamAgencyInfo,
info
}: DisplayInfoProps) => {
const { t: translate } = useTranslation(['common', translation.ns]);
@@ -88,17 +86,6 @@ export const InfoTooltip = ({
}`}
ref={agencyInfoRef}
>
- {showTeamAgencyInfo && (
-
-
-
-
- )}
{displayInfo.name && (
{
- const { t: translate } = useTranslation();
- const [messageCopied, setMessageCopied] = useState(false);
- let timeoutId: number = null;
-
- useEffect(() => {
- return () => {
- // Unset timeout on unmounting to prevent state change on unmounted components
- if (timeoutId) window.clearTimeout(timeoutId);
- };
- });
-
- const copyText = async (content) => {
- await copyTextToClipboard(content, () => {
- setMessageCopied(true);
- timeoutId = window.setTimeout(() => setMessageCopied(false), 3000);
- });
- };
-
- return (
- copyText(props.message)}
- >
-
-
-
- );
-};
diff --git a/src/components/message/ForwardMessage.tsx b/src/components/message/ForwardMessage.tsx
deleted file mode 100644
index 545a626ed..000000000
--- a/src/components/message/ForwardMessage.tsx
+++ /dev/null
@@ -1,137 +0,0 @@
-import * as React from 'react';
-import { useCallback, useContext, useState } from 'react';
-
-import { apiForwardMessage } from '../../api';
-import { ReactComponent as ArrowForwardIcon } from '../../resources/img/icons/arrow-forward.svg';
-import { ReactComponent as CheckmarkIcon } from '../../resources/img/icons/checkmark.svg';
-import { encryptText } from '../../utils/encryptionHelpers';
-import { useE2EE } from '../../hooks/useE2EE';
-import { E2EEContext } from '../../globalState';
-import { useTranslation } from 'react-i18next';
-import { apiPostError, ERROR_LEVEL_WARN } from '../../api/apiPostError';
-import { useE2EEViewElements } from '../../hooks/useE2EEViewElements';
-import { Overlay } from '../overlay/Overlay';
-import { useTimeoutOverlay } from '../../hooks/useTimeoutOverlay';
-import {
- OVERLAY_E2EE,
- OVERLAY_REQUEST
-} from '../../globalState/interfaces/AppConfig/OverlaysConfigInterface';
-
-interface ForwardMessageProps {
- right: boolean;
- message: string;
- messageTime: string;
- displayName: string;
- askerRcId: string;
- groupId: string;
-}
-
-export const ForwardMessage = (props: ForwardMessageProps) => {
- const { t: translate } = useTranslation();
- const [messageForwarded, setMessageForwarded] = useState(false);
- const [isRequestInProgress, setIsRequestInProgress] = useState(false);
-
- const { visible: requestOverlayVisible, overlay: requestOverlay } =
- useTimeoutOverlay(isRequestInProgress);
-
- /* E2EE */
- const { key, keyID, encrypted, encryptRoom } = useE2EE(props.groupId);
- const {
- visible: e2eeOverlayVisible,
- setState: setE2EEState,
- overlay: e2eeOverlay
- } = useE2EEViewElements();
-
- const { isE2eeEnabled } = useContext(E2EEContext);
-
- const forwardMessage = useCallback(async () => {
- if (isRequestInProgress) {
- return null;
- }
-
- setIsRequestInProgress(true);
-
- if (encrypted && !keyID) {
- console.error("Can't send message without key");
- setIsRequestInProgress(false);
- return null;
- }
-
- let message = props.message;
- let isEncrypted = isE2eeEnabled;
- try {
- message = await encryptText(message, keyID, key);
- } catch (e: any) {
- apiPostError({
- name: e.name,
- message: e.message,
- stack: e.stack,
- level: ERROR_LEVEL_WARN
- }).then();
-
- isEncrypted = false;
- }
-
- apiForwardMessage(
- message,
- props.messageTime,
- props.displayName,
- props.askerRcId,
- props.groupId,
- isEncrypted
- ).then(() => {
- encryptRoom(setE2EEState).then(() => {
- setMessageForwarded(true);
- setTimeout(() => {
- setMessageForwarded(false);
- setIsRequestInProgress(false);
- }, 3000);
- });
- });
- }, [
- isRequestInProgress,
- encrypted,
- props.message,
- props.messageTime,
- props.displayName,
- props.askerRcId,
- props.groupId,
- isE2eeEnabled,
- key,
- keyID,
- encryptRoom,
- setE2EEState
- ]);
-
- return (
-
-
-
-
- {requestOverlayVisible && (
-
- )}
- {e2eeOverlayVisible && (
-
- )}
-
- );
-};
diff --git a/src/components/message/MessageDisplayName.tsx b/src/components/message/MessageDisplayName.tsx
index 37074e37a..5403789ff 100644
--- a/src/components/message/MessageDisplayName.tsx
+++ b/src/components/message/MessageDisplayName.tsx
@@ -1,27 +1,19 @@
import { isUserModerator } from '../session/sessionHelpers';
import * as React from 'react';
import { useCallback, useContext } from 'react';
-import {
- formatToHHMM,
- getPrettyDateFromMessageDate
-} from '../../utils/dateHelpers';
-import { ReactComponent as ArrowForwardIcon } from '../../resources/img/icons/arrow-forward.svg';
-import { ForwardMessageDTO } from './MessageItemComponent';
import { ActiveSessionContext } from '../../globalState';
import { useTranslation } from 'react-i18next';
interface MessageDisplayNameProps {
- alias?: ForwardMessageDTO;
isUser: Boolean;
isMyMessage: Boolean;
- type: 'forwarded' | 'user' | 'consultant' | 'self' | 'system';
+ type: 'user' | 'consultant' | 'self' | 'system';
userId: string;
username: string;
displayName: string;
}
export const MessageDisplayName = ({
- alias,
isUser,
isMyMessage,
type,
@@ -32,20 +24,6 @@ export const MessageDisplayName = ({
const { t: translate } = useTranslation();
const { activeSession } = useContext(ActiveSessionContext);
- const forwardedLabel = useCallback(() => {
- const prettyDate = getPrettyDateFromMessageDate(
- Math.round(alias.timestamp / 1000)
- );
-
- return translate('message.forward.label', {
- username: alias.displayName || alias.username,
- date: prettyDate.str
- ? translate(prettyDate.str)
- : translate(prettyDate.date),
- time: alias.timestamp && formatToHHMM(alias.timestamp)
- });
- }, [alias, translate]);
-
const subscriberIsModerator = isUserModerator({
chatItem: activeSession.item,
rcUserId: userId
@@ -77,20 +55,11 @@ export const MessageDisplayName = ({
return (
<>
- {!alias && displayName && (
-
- {getUsernameWithPrefix()}
-
- )}
-
- {alias && (
-
- )}
+
+ {getUsernameWithPrefix()}
+
>
);
};
diff --git a/src/components/message/MessageItemComponent.tsx b/src/components/message/MessageItemComponent.tsx
index ddd10a3c8..4e5dab1b6 100644
--- a/src/components/message/MessageItemComponent.tsx
+++ b/src/components/message/MessageItemComponent.tsx
@@ -7,18 +7,12 @@ import {
hasUserAuthority,
AUTHORITIES,
E2EEContext,
- SessionTypeContext,
RocketChatGlobalSettingsContext,
ActiveSessionContext
} from '../../globalState';
-import {
- ConsultingTypeInterface,
- STATUS_ARCHIVED
-} from '../../globalState/interfaces';
-import { isUserModerator, SESSION_LIST_TYPES } from '../session/sessionHelpers';
-import { ForwardMessage } from './ForwardMessage';
+import { STATUS_ARCHIVED } from '../../globalState/interfaces';
+import { isUserModerator } from '../session/sessionHelpers';
import { MessageMetaData } from './MessageMetaData';
-import { CopyMessage } from './CopyMessage';
import { MessageDisplayName } from './MessageDisplayName';
import { markdownToDraft } from 'markdown-draft-js';
import { stateToHTML } from 'draft-js-export-html';
@@ -70,14 +64,6 @@ import { BanUser, BanUserOverlay } from '../banUser/BanUser';
import { getValueFromCookie } from '../sessionCookie/accessSessionCookie';
import { VideoChatDetails, VideoChatDetailsAlias } from './VideoChatDetails';
-export interface ForwardMessageDTO {
- message: string;
- rcUserId: string;
- timestamp: any;
- username: string;
- displayName: string;
-}
-
export interface VideoCallMessageDTO {
eventType: 'IGNORED_CALL';
initiatorRcUserId: string;
@@ -99,7 +85,6 @@ export interface MessageItem {
groupId?: string;
isNotRead: boolean;
alias?: {
- forwardMessageDTO?: ForwardMessageDTO;
videoCallMessageDTO?: VideoCallMessageDTO;
content?: string;
messageType: ALIAS_MESSAGE_TYPES;
@@ -115,7 +100,6 @@ interface MessageItemComponentProps extends MessageItem {
isOnlyEnquiry?: boolean;
isMyMessage: boolean;
clientName: string;
- resortData: ConsultingTypeInterface;
isUserBanned: boolean;
handleDecryptionErrors: (
id: string,
@@ -133,7 +117,6 @@ export const MessageItemComponent = ({
message,
messageDate,
messageTime,
- resortData,
isMyMessage,
displayName,
username,
@@ -153,7 +136,6 @@ export const MessageItemComponent = ({
const { activeSession, reloadActiveSession } =
useContext(ActiveSessionContext);
const { userData } = useContext(UserDataContext);
- const { type } = useContext(SessionTypeContext);
const [renderedMessage, setRenderedMessage] = useState(null);
const [decryptedMessage, setDecryptedMessage] = useState<
@@ -242,9 +224,6 @@ export const MessageItemComponent = ({
if (isMyMessage) {
return 'self';
}
- if (alias?.forwardMessageDTO) {
- return 'forwarded';
- }
if (displayName === 'system') {
return 'system';
}
@@ -293,8 +272,6 @@ export const MessageItemComponent = ({
alias?.messageType === ALIAS_MESSAGE_TYPES.UPDATE_SESSION_DATA;
const isVideoCallMessage =
alias?.messageType === ALIAS_MESSAGE_TYPES.VIDEOCALL;
- const isFinishedConversationMessage =
- alias?.messageType === ALIAS_MESSAGE_TYPES.FINISHED_CONVERSATION;
const isUserMutedMessage =
alias?.messageType === ALIAS_MESSAGE_TYPES.USER_MUTED;
const isE2EEActivatedMessage =
@@ -317,7 +294,6 @@ export const MessageItemComponent = ({
return null;
}
- const isTeamSession = activeSession?.item?.isTeamSession;
const isMySession = activeSession?.consultant?.id === userData?.userId;
const isAppointmentSet =
alias?.messageType === ALIAS_MESSAGE_TYPES.APPOINTMENT_SET ||
@@ -355,7 +331,6 @@ export const MessageItemComponent = ({
return isAsker ? (
clickReassignRequestMessage(
accepted,
@@ -366,7 +341,6 @@ export const MessageItemComponent = ({
) : (
);
@@ -400,14 +374,6 @@ export const MessageItemComponent = ({
messageType={alias.messageType}
/>
);
- case isFinishedConversationMessage:
- return (
-
- {translate(
- 'anonymous.session.systemMessage.chatFinished'
- )}
-
- );
case isVideoCallMessage && !videoCallMessage?.eventType:
const parsedMessage = JSON.parse(
alias.content
@@ -456,7 +422,6 @@ export const MessageItemComponent = ({
<>
))}
- {activeSession.isFeedback && (
-
- )}
- {hasRenderedMessage &&
- hasUserAuthority(
- AUTHORITIES.USE_FEEDBACK,
- userData
- ) &&
- type !== SESSION_LIST_TYPES.ENQUIRY &&
- activeSession.isSession &&
- activeSession.item.feedbackGroupId &&
- !activeSession.isFeedback &&
- activeSession.item.status !==
- STATUS_ARCHIVED && (
-
- )}
>
);
@@ -578,9 +513,7 @@ export const MessageItemComponent = ({
messageTime={messageTime}
t={t}
type={getUsernameType()}
- isReadStatusDisabled={
- isVideoCallMessage || isFinishedConversationMessage
- }
+ isReadStatusDisabled={isVideoCallMessage}
/>
diff --git a/src/components/message/MessageMetaData.tsx b/src/components/message/MessageMetaData.tsx
index 8f82c8e45..ab7a658c7 100644
--- a/src/components/message/MessageMetaData.tsx
+++ b/src/components/message/MessageMetaData.tsx
@@ -27,8 +27,6 @@ export const MessageMetaData = (props: MessageMetaDataProps) => {
const isReadStatus = () => {
if (
hasUserAuthority(AUTHORITIES.ASKER_DEFAULT, userData) ||
- hasUserAuthority(AUTHORITIES.ANONYMOUS_DEFAULT, userData) ||
- (!activeSession.isGroup && activeSession.isFeedback) ||
props.isReadStatusDisabled
) {
return null;
diff --git a/src/components/message/ReassignMessage.tsx b/src/components/message/ReassignMessage.tsx
index d0a3f744c..4a6a421f8 100644
--- a/src/components/message/ReassignMessage.tsx
+++ b/src/components/message/ReassignMessage.tsx
@@ -7,7 +7,6 @@ import { ConsultantListContext } from '../../globalState';
export const ReassignRequestMessage: React.FC<{
fromConsultantName: string;
toConsultantName: string;
- isTeamSession: boolean;
onClick: (accepted: boolean) => void;
}> = (props) => {
const { t: translate } = useTranslation();
@@ -27,9 +26,7 @@ export const ReassignRequestMessage: React.FC<{
{translate(
- `session.reassign.system.message.reassign.description.${
- props.isTeamSession ? 'team' : 'noTeam'
- }`,
+ 'session.reassign.system.message.reassign.description.noTeam',
{
oldConsultant: props.fromConsultantName,
newConsultant: props.toConsultantName
@@ -70,7 +67,6 @@ export const ReassignRequestSentMessage: React.FC<{
toAskerName: string;
fromConsultantId: string;
toConsultantId: string;
- isTeamSession: boolean;
isMySession: boolean;
}> = (props) => {
const { t: translate } = useTranslation();
@@ -91,12 +87,6 @@ export const ReassignRequestSentMessage: React.FC<{
let descriptionToTranslate =
'session.reassign.system.message.reassign.sent.description.noTeam';
- if (props.isTeamSession && props.isMySession)
- descriptionToTranslate =
- 'session.reassign.system.message.reassign.sent.description.team.self';
- if (props.isTeamSession && !props.isMySession)
- descriptionToTranslate =
- 'session.reassign.system.message.reassign.sent.description.team.other';
return (
diff --git a/src/components/message/VideoCallMessage.tsx b/src/components/message/VideoCallMessage.tsx
index 26fbcebc0..60b4b3dce 100644
--- a/src/components/message/VideoCallMessage.tsx
+++ b/src/components/message/VideoCallMessage.tsx
@@ -1,10 +1,7 @@
import * as React from 'react';
import { ICON_CALL_OFF, SystemMessage } from './SystemMessage';
import { VideoCallMessageDTO } from './MessageItemComponent';
-import {
- currentUserIsTeamConsultant,
- currentUserWasVideoCallInitiator
-} from '../../utils/videoCallHelpers';
+import { currentUserWasVideoCallInitiator } from '../../utils/videoCallHelpers';
import { useTranslation } from 'react-i18next';
interface VideoCallMessageProps {
videoCallMessage: VideoCallMessageDTO;
@@ -30,22 +27,7 @@ export const VideoCallMessage = (props: VideoCallMessageProps) => {
) : (
<>
{props.videoCallMessage.initiatorUserName}{' '}
- {currentUserIsTeamConsultant(
- props.videoCallMessage.initiatorRcUserId,
- props.activeSessionAskerRcId
- ) ? (
- <>
- {translate(
- 'videoCall.incomingCall.rejected.teamconsultant.prefix'
- )}{' '}
-
{props.activeSessionUsername}{' '}
- {translate(
- 'videoCall.incomingCall.rejected.suffix'
- )}
- >
- ) : (
- translate('videoCall.incomingCall.ignored')
- )}
+ {translate('videoCall.incomingCall.ignored')}
>
)
}
diff --git a/src/components/message/message.styles.scss b/src/components/message/message.styles.scss
index 57265bb98..ca70b459d 100644
--- a/src/components/message/message.styles.scss
+++ b/src/components/message/message.styles.scss
@@ -19,6 +19,7 @@ $message-attachment-color: $secondary !default;
opacity: 0;
transform: translate(0, 0) scale(0.98);
}
+
100% {
opacity: 1;
transform: translate(0, 0) scale(1);
@@ -50,6 +51,7 @@ $message-attachment-color: $secondary !default;
line-height: 13px;
text-align: center;
}
+
&__username {
text-align: left;
display: flex;
@@ -71,21 +73,6 @@ $message-attachment-color: $secondary !default;
color: $message-name-consultant;
}
- &--forwarded {
- font-size: $font-size-secondary;
- line-height: $line-height-secondary;
- color: $message-name-forwarded;
-
- svg {
- display: inline-block;
- margin-right: 8px;
- padding-bottom: 4px;
- path {
- fill: $text-low-emphasis;
- }
- }
- }
-
.flyoutMenu {
margin-left: $grid-base;
}
@@ -316,10 +303,6 @@ $message-attachment-color: $secondary !default;
color: var(--text-color-contrast-switch, $white);
}
}
-
- &--forwarded {
- background-color: $yellow-4;
- }
}
&__action {
@@ -336,12 +319,6 @@ $message-attachment-color: $secondary !default;
fill: var(--skin-color-secondary, $secondary);
}
- &.forward {
- &--active {
- animation: successReverse 2.5s ease forwards;
- }
- }
-
&.copy {
&--active {
animation: successCopyReverse 2.5s ease forwards;
@@ -525,6 +502,7 @@ $message-attachment-color: $secondary !default;
transform: translate(-50%, 0) scale(0);
opacity: 0;
}
+
33%,
66% {
transform: translate(-50%, 0) scale(1);
@@ -532,25 +510,13 @@ $message-attachment-color: $secondary !default;
}
}
-@keyframes successReverse {
- 100%,
- 0% {
- transform: scale(1);
- opacity: 1;
- }
- 15%,
- 80% {
- transform: scale(0) rotate(45deg);
- opacity: 0;
- }
-}
-
@keyframes successCopyReverse {
100%,
0% {
transform: scale(1);
opacity: 1;
}
+
15%,
80% {
transform: scale(0);
diff --git a/src/components/messageSubmitInterface/messageSubmitInterface.yellowTheme.styles.scss b/src/components/messageSubmitInterface/messageSubmitInterface.yellowTheme.styles.scss
deleted file mode 100644
index 392c51695..000000000
--- a/src/components/messageSubmitInterface/messageSubmitInterface.yellowTheme.styles.scss
+++ /dev/null
@@ -1,23 +0,0 @@
-.session--yellowTheme {
- .textarea {
- background-color: $message-submit-interface-textarea-background-color-yellow;
- }
-}
-
-.session {
- .textarea--yellowTheme {
- animation: yellowThemeHighlight 1.5s forwards;
- }
-
- @keyframes yellowThemeHighlight {
- 0% {
- background: $dark-grey;
- }
- 20% {
- background: $yellow-4;
- }
- 100% {
- background: var(--skin-color-secondary-light, $yellow-3);
- }
- }
-}
diff --git a/src/components/messageSubmitInterface/messageSubmitInterfaceComponent.tsx b/src/components/messageSubmitInterface/messageSubmitInterfaceComponent.tsx
index 3cde178c6..88c5d8564 100644
--- a/src/components/messageSubmitInterface/messageSubmitInterfaceComponent.tsx
+++ b/src/components/messageSubmitInterface/messageSubmitInterfaceComponent.tsx
@@ -11,19 +11,17 @@ import { useHistory } from 'react-router-dom';
import { SendMessageButton } from './SendMessageButton';
import { SESSION_LIST_TYPES } from '../session/sessionHelpers';
-import { Checkbox } from '../checkbox/Checkbox';
import {
AUTHORITIES,
getContact,
hasUserAuthority,
- AnonymousConversationFinishedContext,
E2EEContext,
SessionTypeContext,
useTenant,
UserDataContext,
ActiveSessionContext
} from '../../globalState';
-import { STATUS_ARCHIVED, STATUS_FINISHED } from '../../globalState/interfaces';
+import { STATUS_ARCHIVED } from '../../globalState/interfaces';
import {
apiPutDearchive,
apiSendEnquiry,
@@ -69,7 +67,6 @@ import { ReactComponent as RemoveIcon } from '../../resources/img/icons/x.svg';
import { ReactComponent as CalendarMonthIcon } from '../../resources/img/icons/calendar-month-navigation.svg';
import './emojiPicker.styles';
import './messageSubmitInterface.styles';
-import './messageSubmitInterface.yellowTheme.styles';
import clsx from 'clsx';
import { mobileListView } from '../app/navigationHandler';
import { Button, ButtonItem, BUTTON_TYPES } from '../button/Button';
@@ -97,7 +94,6 @@ import {
OVERLAY_REQUEST
} from '../../globalState/interfaces/AppConfig/OverlaysConfigInterface';
import { getIconForAttachmentType } from '../message/messageHelpers';
-import classNames from 'classnames';
//Linkify Plugin
const omitKey = (key, { [key]: _, ...obj }) => obj;
@@ -127,8 +123,7 @@ const INFO_TYPES = {
ATTACHMENT_SIZE_ERROR: 'ATTACHMENT_SIZE_ERROR',
ATTACHMENT_FORMAT_ERROR: 'ATTACHMENT_FORMAT_ERROR',
ATTACHMENT_QUOTA_REACHED_ERROR: 'ATTACHMENT_QUOTA_REACHED_ERROR',
- ATTACHMENT_OTHER_ERROR: 'ATTACHMENT_OTHER_ERROR',
- FINISHED_CONVERSATION: 'FINISHED_CONVERSATION'
+ ATTACHMENT_OTHER_ERROR: 'ATTACHMENT_OTHER_ERROR'
};
export interface MessageSubmitInterfaceComponentProps {
@@ -165,9 +160,6 @@ export const MessageSubmitInterfaceComponent = ({
const { activeSession, reloadActiveSession } =
useContext(ActiveSessionContext);
const { type, path: listPath } = useContext(SessionTypeContext);
- const { anonymousConversationFinished } = useContext(
- AnonymousConversationFinishedContext
- );
const { isE2eeEnabled } = useContext(E2EEContext);
const [activeInfo, setActiveInfo] = useState(null);
@@ -187,14 +179,7 @@ export const MessageSubmitInterfaceComponent = ({
const [isSessionArchived, setIsSessionArchived] = useState(
activeSession.item.status === STATUS_ARCHIVED
);
- const [isTypingActive, setIsTypingActive] = useState(
- activeSession.isGroup || activeSession.isLive
- );
- const [isLiveChatFinished, setIsLiveChatFinished] = useState(
- activeSession.isLive && activeSession.item.status === STATUS_FINISHED
- );
- const [requestFeedbackCheckboxChecked, setRequestFeedbackCheckboxChecked] =
- useState(false);
+ const [isTypingActive, setIsTypingActive] = useState(activeSession.isGroup);
const [showAppointmentButton, setShowAppointmentButton] = useState(false);
//Emoji Picker Plugin
@@ -218,7 +203,6 @@ export const MessageSubmitInterfaceComponent = ({
// This loads the keys for current activeSession.rid which is already set:
// to groupChat.groupId on group chats
// to session.groupId on session chats
- // to session.feebackGroupId on feedback chats
const {
keyID,
key,
@@ -229,15 +213,6 @@ export const MessageSubmitInterfaceComponent = ({
ready: e2EEReady
} = useE2EE(activeSession.rid || null);
- // This loads keys for feedback chat to have the ability to encrypt
- // the feedback chat when checkbox "Request feedback" is checked
- const {
- keyID: feedbackChatKeyId,
- key: feedbackChatKey,
- encryptRoom: feedbackEncryptRoom,
- ready: feedbackE2EEReady
- } = useE2EE(activeSession.item.feedbackGroupId);
-
const {
visible: e2eeOverlayVisible,
setState: setE2EEState,
@@ -261,18 +236,11 @@ export const MessageSubmitInterfaceComponent = ({
activeSession.consultant?.absent
);
setIsSessionArchived(activeSession.item.status === STATUS_ARCHIVED);
- setIsTypingActive(activeSession.isGroup || activeSession.isLive);
- setIsLiveChatFinished(
- activeSession.isLive &&
- activeSession.item.status === STATUS_FINISHED
- );
+ setIsTypingActive(activeSession.isGroup);
}, [activeSession, activeSession.item.status, userData]);
const { onChange: onDraftMessageChange, loaded: draftLoaded } =
- useDraftMessage(
- !anonymousConversationFinished && !isRequestInProgress,
- setEditorState
- );
+ useDraftMessage(!isRequestInProgress, setEditorState);
useEffect(() => {
if (
@@ -282,18 +250,10 @@ export const MessageSubmitInterfaceComponent = ({
setActiveInfo(INFO_TYPES.ARCHIVED);
} else if (isConsultantAbsent) {
setActiveInfo(INFO_TYPES.ABSENT);
- } else if (isLiveChatFinished) {
- setActiveInfo(INFO_TYPES.FINISHED_CONVERSATION);
} else {
setActiveInfo(null);
}
- }, [isConsultantAbsent, isLiveChatFinished, isSessionArchived, userData]);
-
- useEffect(() => {
- if (isLiveChatFinished) {
- setActiveInfo(INFO_TYPES.FINISHED_CONVERSATION);
- }
- }, [isLiveChatFinished]);
+ }, [isConsultantAbsent, isSessionArchived, userData]);
const getTypedMarkdownMessage = useCallback(
(currentEditorState?: EditorState) => {
@@ -511,37 +471,16 @@ export const MessageSubmitInterfaceComponent = ({
const handleMessageSendSuccess = useCallback(() => {
onMessageSendSuccess?.();
- if (requestFeedbackCheckboxChecked) {
- const feedbackButton = document.querySelector(
- '.sessionInfo__feedbackButton'
- );
- feedbackButton?.classList.add(
- 'sessionInfo__feedbackButton--active'
- );
- setTimeout(() => {
- feedbackButton?.classList.remove(
- 'sessionInfo__feedbackButton--active'
- );
- }, 700);
- }
setEditorState(EditorState.createEmpty());
setActiveInfo('');
resizeTextarea();
setTimeout(() => setIsRequestInProgress(false), 1200);
- }, [onMessageSendSuccess, requestFeedbackCheckboxChecked, resizeTextarea]);
+ }, [onMessageSendSuccess, resizeTextarea]);
const sendMessage = useCallback(
- async (
- sendToFeedbackEndpoint,
- message,
- attachment: File,
- isEncrypted
- ) => {
- const sendToRoomWithId = sendToFeedbackEndpoint
- ? activeSession.item.feedbackGroupId
- : activeSession.rid || activeSession.item.id;
- const getSendMailNotificationStatus = () =>
- !activeSession.isGroup && !activeSession.isLive;
+ async (message, attachment: File, isEncrypted) => {
+ const sendToRoomWithId = activeSession.rid || activeSession.item.id;
+ const getSendMailNotificationStatus = () => !activeSession.isGroup;
if (attachment) {
let res: any;
@@ -577,7 +516,6 @@ export const MessageSubmitInterfaceComponent = ({
res = await apiUploadAttachment(
attachmentFile,
sendToRoomWithId,
- sendToFeedbackEndpoint,
getSendMailNotificationStatus(),
setUploadProgress,
setAttachmentUpload,
@@ -617,7 +555,6 @@ export const MessageSubmitInterfaceComponent = ({
await apiSendMessage(
message,
sendToRoomWithId,
- sendToFeedbackEndpoint,
getSendMailNotificationStatus() && !attachment,
isEncrypted
)
@@ -640,8 +577,6 @@ export const MessageSubmitInterfaceComponent = ({
},
[
activeSession.isGroup,
- activeSession.isLive,
- activeSession.item.feedbackGroupId,
activeSession.item.id,
activeSession.rid,
cleanupAttachment,
@@ -673,21 +608,11 @@ export const MessageSubmitInterfaceComponent = ({
return null;
}
- const sendToFeedbackEndpoint =
- requestFeedbackCheckboxChecked || activeSession.isFeedback;
-
- const messageKeyId = requestFeedbackCheckboxChecked
- ? feedbackChatKeyId
- : keyID;
- const messageKey = requestFeedbackCheckboxChecked
- ? feedbackChatKey
- : key;
-
let message = getTypedMarkdownMessage().trim();
let isEncrypted = isE2eeEnabled;
if (message.length > 0 && isE2eeEnabled) {
try {
- message = await encryptText(message, messageKeyId, messageKey);
+ message = await encryptText(message, keyID, key);
} catch (e: any) {
apiPostError({
name: e.name,
@@ -708,31 +633,16 @@ export const MessageSubmitInterfaceComponent = ({
return;
}
- await sendMessage(
- sendToFeedbackEndpoint,
- message,
- attachment,
- isEncrypted
- );
-
- if (requestFeedbackCheckboxChecked) {
- await feedbackEncryptRoom(setE2EEState);
- }
+ await sendMessage(message, attachment, isEncrypted);
}, [
- activeSession.isFeedback,
encrypted,
- feedbackChatKey,
- feedbackChatKeyId,
- feedbackEncryptRoom,
getTypedMarkdownMessage,
isE2eeEnabled,
key,
keyID,
preselectedFile,
- requestFeedbackCheckboxChecked,
sendEnquiry,
sendMessage,
- setE2EEState,
type,
userData
]);
@@ -782,12 +692,6 @@ export const MessageSubmitInterfaceComponent = ({
userData
]);
- const handleRequestFeedbackCheckbox = useCallback(() => {
- setRequestFeedbackCheckboxChecked(
- (requestFeedbackCheckboxChecked) => !requestFeedbackCheckboxChecked
- );
- }, []);
-
const handleAttachmentSelect = useCallback(() => {
const attachmentInput: any = attachmentInputRef.current;
attachmentInput.click();
@@ -873,13 +777,6 @@ export const MessageSubmitInterfaceComponent = ({
infoHeadline: translate('attachments.error.other.headline'),
infoMessage: translate('attachments.error.other.message')
};
- } else if (activeInfo === INFO_TYPES.FINISHED_CONVERSATION) {
- infoData = {
- isInfo: true,
- infoHeadline: translate(
- 'anonymous.session.infoMessage.chatFinished'
- )
- };
} else if (activeInfo === INFO_TYPES.ARCHIVED) {
infoData = {
isInfo: true,
@@ -901,12 +798,6 @@ export const MessageSubmitInterfaceComponent = ({
!hasUserAuthority(AUTHORITIES.ASKER_DEFAULT, userData))) &&
!tenant?.settings?.featureAttachmentUploadDisabled;
- const hasRequestFeedbackCheckbox =
- hasUserAuthority(AUTHORITIES.USE_FEEDBACK, userData) &&
- !hasUserAuthority(AUTHORITIES.VIEW_ALL_PEER_SESSIONS, userData) &&
- activeSession.item.feedbackGroupId &&
- (activeSession.isGroup || !activeSession.isFeedback);
-
const bookingButton: ButtonItem = useMemo(
() => ({
label: translate('message.submit.booking.buttonLabel'),
@@ -923,7 +814,7 @@ export const MessageSubmitInterfaceComponent = ({
return null;
}, []);
- if (!e2EEReady || !feedbackE2EEReady) {
+ if (!e2EEReady) {
return null;
}
@@ -951,202 +842,166 @@ export const MessageSubmitInterfaceComponent = ({
/>
)}
{activeInfo &&
}
- {!isLiveChatFinished && (
-