From 5b992d1b131fc776bfbb5571d081ddfa611cb403 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deborah=20K=C3=B6pfer?= Date: Tue, 23 Jul 2024 11:20:32 +0200 Subject: [PATCH 01/37] feat(initializeFeedbackChat): rm initializeFeedbackChat functionality --- cypress/fixtures/registration/consultingType.json | 1 - cypress/fixtures/service.consultingtypes.emigration.json | 1 - cypress/fixtures/service.consultingtypes.pregnancy.json | 1 - cypress/fixtures/service.consultingtypes.u25.json | 1 - 4 files changed, 4 deletions(-) diff --git a/cypress/fixtures/registration/consultingType.json b/cypress/fixtures/registration/consultingType.json index 7235f05f6..eaa00a1c2 100644 --- a/cypress/fixtures/registration/consultingType.json +++ b/cypress/fixtures/registration/consultingType.json @@ -46,7 +46,6 @@ "relation": true, "state": false }, - "initializeFeedbackChat": false, "roles": { "consultant": { "main": ["consultant"], diff --git a/cypress/fixtures/service.consultingtypes.emigration.json b/cypress/fixtures/service.consultingtypes.emigration.json index 8dc7efb54..83f9f2398 100644 --- a/cypress/fixtures/service.consultingtypes.emigration.json +++ b/cypress/fixtures/service.consultingtypes.emigration.json @@ -43,7 +43,6 @@ "sendFurtherStepsMessage": true, "sendSaveSessionDataMessage": true, "sessionDataInitializing": {}, - "initializeFeedbackChat": false, "roles": { "consultant": { "main": ["consultant"], diff --git a/cypress/fixtures/service.consultingtypes.pregnancy.json b/cypress/fixtures/service.consultingtypes.pregnancy.json index 1eabaa92a..47d68f190 100644 --- a/cypress/fixtures/service.consultingtypes.pregnancy.json +++ b/cypress/fixtures/service.consultingtypes.pregnancy.json @@ -47,7 +47,6 @@ "relation": true, "state": false }, - "initializeFeedbackChat": false, "roles": { "consultant": { "main": ["consultant"], diff --git a/cypress/fixtures/service.consultingtypes.u25.json b/cypress/fixtures/service.consultingtypes.u25.json index 4649c0e3b..cb671867b 100644 --- a/cypress/fixtures/service.consultingtypes.u25.json +++ b/cypress/fixtures/service.consultingtypes.u25.json @@ -50,7 +50,6 @@ "relation": false, "state": true }, - "initializeFeedbackChat": true, "roles": { "consultant": { "main": ["consultant", "u25-consultant", "u25-main-consultant"], From cc3fb8cf69ee1bf525ddb5afbb94c2fcac527ff4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deborah=20K=C3=B6pfer?= Date: Tue, 23 Jul 2024 11:24:12 +0200 Subject: [PATCH 02/37] feat(NEW_FEEDBACK_MESSAGE_FROM_ADVICE_SEEKER): rm NEW_FEEDBACK_MESSAGE_FROM_ADVICE_SEEKER functionality --- cypress/fixtures/service.users.data.json | 4 ---- cypress/support/commands/mockApi.ts | 4 ---- src/resources/scripts/config.ts | 3 +-- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/cypress/fixtures/service.users.data.json b/cypress/fixtures/service.users.data.json index eec6202ed..dc2b75f0b 100644 --- a/cypress/fixtures/service.users.data.json +++ b/cypress/fixtures/service.users.data.json @@ -37,10 +37,6 @@ { "name": "NEW_CHAT_MESSAGE_FROM_ADVICE_SEEKER", "state": true - }, - { - "name": "NEW_FEEDBACK_MESSAGE_FROM_ADVICE_SEEKER", - "state": true } ] }, 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/src/resources/scripts/config.ts b/src/resources/scripts/config.ts index 71e1ac3c9..915ddba18 100644 --- a/src/resources/scripts/config.ts +++ b/src/resources/scripts/config.ts @@ -100,8 +100,7 @@ export const config: AppConfigInterface = { { label: 'profile.notifications.follow.up.email.label', types: [ - 'NEW_CHAT_MESSAGE_FROM_ADVICE_SEEKER', - 'NEW_FEEDBACK_MESSAGE_FROM_ADVICE_SEEKER' + 'NEW_CHAT_MESSAGE_FROM_ADVICE_SEEKER' ] } ] From 9da1eee2b7ccc70503f7596c47ef0a896d800b8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deborah=20K=C3=B6pfer?= Date: Tue, 23 Jul 2024 12:03:15 +0200 Subject: [PATCH 03/37] feat(ForwardMessage): rm all related ForwardMessage functionality --- src/api/apiForwardMessage.ts | 29 -- src/api/apiSendAliasMessage.ts | 1 - src/api/index.ts | 1 - src/components/message/ForwardMessage.tsx | 137 ------- src/components/message/MessageDisplayName.tsx | 47 +-- .../message/MessageItemComponent.tsx | 63 +-- src/components/message/message.styles.scss | 55 +-- src/generated/messageservice.d.ts | 129 ++---- src/generated/userservice.d.ts | 388 ++++++++---------- src/resources/i18n/de/common.json | 4 - src/resources/i18n/en/common.json | 4 - src/resources/scripts/endpoints.ts | 1 - src/resources/styles/settings.scss | 11 +- 13 files changed, 258 insertions(+), 612 deletions(-) delete mode 100644 src/api/apiForwardMessage.ts delete mode 100644 src/components/message/ForwardMessage.tsx 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/apiSendAliasMessage.ts b/src/api/apiSendAliasMessage.ts index 9e1037c0f..e46e95893 100644 --- a/src/api/apiSendAliasMessage.ts +++ b/src/api/apiSendAliasMessage.ts @@ -4,7 +4,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/index.ts b/src/api/index.ts index 0bbb47cae..97799fc16 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -4,7 +4,6 @@ export * from './apiDraftMessages'; export * from './apiEnquiryAcceptance'; export * from './apiFinishAnonymousConversation'; export * from './apiAnonymousConversationAvailability'; -export * from './apiForwardMessage'; export * from './apiGetAgencyConsultantList'; export * from './apiGetAgencyId'; export * from './apiGetAskerSessionList'; 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..da60cc6e8 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 @@ -62,9 +40,9 @@ export const MessageDisplayName = ({ } else { return subscriberIsModerator ? translate('session.groupChat.consultant.prefix') + - (displayName || username) + (displayName || username) : translate('session.consultant.prefix') + - (displayName || username); + (displayName || username); } }, [ displayName, @@ -77,20 +55,11 @@ export const MessageDisplayName = ({ return ( <> - {!alias && displayName && ( -
- {getUsernameWithPrefix()} -
- )} - - {alias && ( -
- - {forwardedLabel()} -
- )} +
+ {getUsernameWithPrefix()} +
); }; diff --git a/src/components/message/MessageItemComponent.tsx b/src/components/message/MessageItemComponent.tsx index ddd10a3c8..d4dab421e 100644 --- a/src/components/message/MessageItemComponent.tsx +++ b/src/components/message/MessageItemComponent.tsx @@ -16,7 +16,6 @@ import { STATUS_ARCHIVED } from '../../globalState/interfaces'; import { isUserModerator, SESSION_LIST_TYPES } from '../session/sessionHelpers'; -import { ForwardMessage } from './ForwardMessage'; import { MessageMetaData } from './MessageMetaData'; import { CopyMessage } from './CopyMessage'; import { MessageDisplayName } from './MessageDisplayName'; @@ -70,14 +69,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 +90,6 @@ export interface MessageItem { groupId?: string; isNotRead: boolean; alias?: { - forwardMessageDTO?: ForwardMessageDTO; videoCallMessageDTO?: VideoCallMessageDTO; content?: string; messageType: ALIAS_MESSAGE_TYPES; @@ -213,9 +203,9 @@ export const MessageItemComponent = ({ setRenderedMessage( contentStateMessage.hasText() ? sanitizeHtml( - urlifyLinksInText(stateToHTML(contentStateMessage)), - sanitizeHtmlDefaultOptions - ) + urlifyLinksInText(stateToHTML(contentStateMessage)), + sanitizeHtmlDefaultOptions + ) : '' ); }, [decryptedMessage]); @@ -242,9 +232,6 @@ export const MessageItemComponent = ({ if (isMyMessage) { return 'self'; } - if (alias?.forwardMessageDTO) { - return 'forwarded'; - } if (displayName === 'system') { return 'system'; } @@ -456,7 +443,6 @@ export const MessageItemComponent = ({ <>
)} - {hasRenderedMessage && - hasUserAuthority( - AUTHORITIES.USE_FEEDBACK, - userData - ) && - type !== SESSION_LIST_TYPES.ENQUIRY && - activeSession.isSession && - activeSession.item.feedbackGroupId && - !activeSession.isFeedback && - activeSession.item.status !== - STATUS_ARCHIVED && ( - - )}
); @@ -550,12 +510,10 @@ export const MessageItemComponent = ({ return (
{getMessageDate()}
diff --git a/src/components/message/message.styles.scss b/src/components/message/message.styles.scss index 57265bb98..901a14f0c 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; } @@ -131,8 +118,7 @@ $message-attachment-color: $secondary !default; &::after { content: ''; display: inline-block; - border-top: 1px solid - var(--skin-color-secondary-contrast-safe, $text-divider-color); + border-top: 1px solid var(--skin-color-secondary-contrast-safe, $text-divider-color); width: $grid-base-three; vertical-align: middle; margin: 0 $grid-base; @@ -148,7 +134,7 @@ $message-attachment-color: $secondary !default; } } - & + .messageItem__divider { + &+.messageItem__divider { margin-top: 12px; } } @@ -203,11 +189,11 @@ $message-attachment-color: $secondary !default; display: flex; flex-direction: column; - & > * { + &>* { margin-top: $grid-base; } - & > *:first-child { + &>*:first-child { margin-top: 0; } } @@ -316,10 +302,6 @@ $message-attachment-color: $secondary !default; color: var(--text-color-contrast-switch, $white); } } - - &--forwarded { - background-color: $yellow-4; - } } &__action { @@ -336,12 +318,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; @@ -520,11 +496,13 @@ $message-attachment-color: $secondary !default; } @keyframes success { + 100%, 0% { transform: translate(-50%, 0) scale(0); opacity: 0; } + 33%, 66% { transform: translate(-50%, 0) scale(1); @@ -532,28 +510,17 @@ $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); opacity: 0; } -} +} \ No newline at end of file diff --git a/src/generated/messageservice.d.ts b/src/generated/messageservice.d.ts index 262a916ae..b3e83d1d4 100644 --- a/src/generated/messageservice.d.ts +++ b/src/generated/messageservice.d.ts @@ -1,7 +1,6 @@ declare namespace MessageService { namespace Schemas { export interface AliasMessageDTO { - forwardMessageDTO?: ForwardMessageDTO; videoCallMessageDTO?: VideoCallMessageDTO; messageType?: MessageType; } @@ -72,29 +71,7 @@ declare namespace MessageService { */ type: string; } - export interface ForwardMessageDTO { - /** - * example: - * Lorem ipsum dolor sit amet, consetetur... - */ - message: string; - /** - * Full qualified timestamp - * example: - * 2018-11-15T09:33:00.057Z - */ - timestamp: string; - /** - * example: - * asker23 - */ - username: string; - /** - * example: - * ag89h3tjkerg94t - */ - rcUserId: string; - } + export interface MasterKeyDTO { /** * example: @@ -124,7 +101,6 @@ declare namespace MessageService { } export type MessageType = | 'FINISHED_CONVERSATION' - | 'FORWARD' | 'FURTHER_STEPS' | 'UPDATE_SESSION_DATA' | 'VIDEOCALL'; @@ -210,11 +186,11 @@ declare namespace Paths { } export type RequestBody = MessageService.Schemas.MessageDTO; namespace Responses { - export interface $201 {} - export interface $400 {} - export interface $401 {} - export interface $403 {} - export interface $500 {} + export interface $201 { } + export interface $400 { } + export interface $401 { } + export interface $403 { } + export interface $500 { } } } namespace CreateMessage { @@ -230,11 +206,11 @@ declare namespace Paths { } export type RequestBody = MessageService.Schemas.MessageDTO; namespace Responses { - export interface $201 {} - export interface $400 {} - export interface $401 {} - export interface $403 {} - export interface $500 {} + export interface $201 { } + export interface $400 { } + export interface $401 { } + export interface $403 { } + export interface $500 { } } } namespace CreateVideoHintMessage { @@ -246,11 +222,11 @@ declare namespace Paths { } export type RequestBody = MessageService.Schemas.VideoCallMessageDTO; namespace Responses { - export interface $201 {} - export interface $400 {} - export interface $401 {} - export interface $403 {} - export interface $500 {} + export interface $201 { } + export interface $400 { } + export interface $401 { } + export interface $403 { } + export interface $500 { } } } namespace FindDraftMessage { @@ -262,33 +238,14 @@ declare namespace Paths { } namespace Responses { export type $200 = string; - export interface $204 {} - export interface $400 {} - export interface $401 {} - export interface $403 {} - export interface $500 {} - } - } - namespace ForwardMessage { - export interface HeaderParameters { - rcToken: Parameters.RcToken; - rcUserId: Parameters.RcUserId; - rcGroupId: Parameters.RcGroupId; - } - namespace Parameters { - export type RcGroupId = string; - export type RcToken = string; - export type RcUserId = string; - } - export type RequestBody = MessageService.Schemas.ForwardMessageDTO; - namespace Responses { - export interface $201 {} - export interface $400 {} - export interface $401 {} - export interface $403 {} - export interface $500 {} + export interface $204 { } + export interface $400 { } + export interface $401 { } + export interface $403 { } + export interface $500 { } } } + namespace GetMessageStream { export interface HeaderParameters { rcToken: Parameters.RcToken; @@ -304,11 +261,11 @@ declare namespace Paths { } namespace Responses { export type $200 = MessageService.Schemas.MessageStreamDTO; - export interface $204 {} - export interface $400 {} - export interface $401 {} - export interface $403 {} - export interface $500 {} + export interface $204 { } + export interface $400 { } + export interface $401 { } + export interface $403 { } + export interface $500 { } } } namespace SaveAliasOnlyMessage { @@ -320,11 +277,11 @@ declare namespace Paths { } export type RequestBody = MessageService.Schemas.AliasOnlyMessageDTO; namespace Responses { - export interface $201 {} - export interface $400 {} - export interface $401 {} - export interface $403 {} - export interface $500 {} + export interface $201 { } + export interface $400 { } + export interface $401 { } + export interface $403 { } + export interface $500 { } } } namespace SaveDraftMessage { @@ -336,22 +293,22 @@ declare namespace Paths { } export type RequestBody = string; namespace Responses { - export interface $200 {} - export interface $201 {} - export interface $400 {} - export interface $401 {} - export interface $403 {} - export interface $500 {} + export interface $200 { } + export interface $201 { } + export interface $400 { } + export interface $401 { } + export interface $403 { } + export interface $500 { } } } namespace UpdateKey { export type RequestBody = MessageService.Schemas.MasterKeyDTO; namespace Responses { - export interface $202 {} - export interface $401 {} - export interface $403 {} - export interface $409 {} - export interface $500 {} + export interface $202 { } + export interface $401 { } + export interface $403 { } + export interface $409 { } + export interface $500 { } } } } diff --git a/src/generated/userservice.d.ts b/src/generated/userservice.d.ts index 4249ac0a6..a7bf624e3 100644 --- a/src/generated/userservice.d.ts +++ b/src/generated/userservice.d.ts @@ -55,7 +55,6 @@ declare namespace UserService { consultingType?: number; } export interface AliasMessageDTO { - forwardMessageDTO?: ForwardMessageDTO; videoCallMessageDTO?: VideoCallMessageDTO; messageType?: MessageType; } @@ -241,7 +240,7 @@ declare namespace UserService { */ groupId: string; } - export interface Date {} + export interface Date { } export interface DeleteUserAccountDTO { /** * example: @@ -256,30 +255,8 @@ declare namespace UserService { */ message: string; } - export interface ForwardMessageDTO { - /** - * example: - * Lorem ipsum dolor sit amet, consetetur... - */ - message: string; - /** - * Full qualified timestamp - * example: - * 2018-11-15T09:33:00.057Z - */ - timestamp: string; - /** - * example: - * asker23 - */ - username: string; - /** - * example: - * ag89h3tjkerg94t - */ - rcUserId: string; - } - export interface HttpStatus {} + + export interface HttpStatus { } export interface MandatorySessionDataDTO { /** * mandatory depending on the consulting type @@ -304,7 +281,6 @@ declare namespace UserService { export type MessageType = | 'FURTHER_STEPS' | 'UPDATE_SESSION_DATA' - | 'FORWARD' | 'VIDEOCALL'; export interface MobileTokenDTO { /** @@ -795,12 +771,12 @@ declare namespace Paths { sessionId: Parameters.SessionId /* int64 */; } namespace Responses { - export interface $200 {} - export interface $400 {} - export interface $401 {} - export interface $403 {} - export interface $409 {} - export interface $500 {} + export interface $200 { } + export interface $400 { } + export interface $401 { } + export interface $403 { } + export interface $409 { } + export interface $500 { } } } namespace AssignSession { @@ -813,22 +789,22 @@ declare namespace Paths { consultantId: Parameters.ConsultantId; } namespace Responses { - export interface $200 {} - export interface $400 {} - export interface $401 {} - export interface $403 {} - export interface $409 {} - export interface $500 {} + export interface $200 { } + export interface $400 { } + export interface $401 { } + export interface $403 { } + export interface $409 { } + export interface $500 { } } } namespace CreateChat { export type RequestBody = UserService.Schemas.ChatDTO; namespace Responses { export type $201 = UserService.Schemas.CreateChatResponseDTO; - export interface $400 {} - export interface $403 {} - export interface $409 {} - export interface $500 {} + export interface $400 { } + export interface $403 { } + export interface $409 { } + export interface $500 { } } } namespace CreateEnquiryMessage { @@ -846,22 +822,22 @@ declare namespace Paths { } export type RequestBody = UserService.Schemas.EnquiryMessageDTO; namespace Responses { - export interface $201 {} - export interface $400 {} - export interface $401 {} - export interface $403 {} - export interface $409 {} - export interface $500 {} + export interface $201 { } + export interface $400 { } + export interface $401 { } + export interface $403 { } + export interface $409 { } + export interface $500 { } } } namespace DeactivateAndFlagUserAccountForDeletion { export type RequestBody = UserService.Schemas.DeleteUserAccountDTO; namespace Responses { - export interface $200 {} - export interface $400 {} - export interface $401 {} - export interface $403 {} - export interface $500 {} + export interface $200 { } + export interface $400 { } + export interface $401 { } + export interface $403 { } + export interface $500 { } } } namespace FetchSessionForConsultant { @@ -873,11 +849,11 @@ declare namespace Paths { } namespace Responses { export type $200 = UserService.Schemas.ConsultantSessionDTO; - export interface $400 {} - export interface $401 {} - export interface $403 {} - export interface $404 {} - export interface $500 {} + export interface $400 { } + export interface $401 { } + export interface $403 { } + export interface $404 { } + export interface $500 { } } } namespace GetChat { @@ -889,11 +865,11 @@ declare namespace Paths { } namespace Responses { export type $200 = UserService.Schemas.ChatInfoResponseDTO; - export interface $400 {} - export interface $401 {} - export interface $403 {} - export interface $404 {} - export interface $500 {} + export interface $400 { } + export interface $401 { } + export interface $403 { } + export interface $404 { } + export interface $500 { } } } namespace GetChatMembers { @@ -905,12 +881,12 @@ declare namespace Paths { } namespace Responses { export type $200 = UserService.Schemas.ChatMembersResponseDTO; - export interface $400 {} - export interface $401 {} - export interface $403 {} - export interface $404 {} - export interface $409 {} - export interface $500 {} + export interface $400 { } + export interface $401 { } + export interface $403 { } + export interface $404 { } + export interface $409 { } + export interface $500 { } } } namespace GetConsultants { @@ -922,11 +898,11 @@ declare namespace Paths { } namespace Responses { export type $200 = UserService.Schemas.ConsultantResponseDTO[]; - export interface $204 {} - export interface $400 {} - export interface $401 {} - export interface $403 {} - export interface $500 {} + export interface $204 { } + export interface $400 { } + export interface $401 { } + export interface $403 { } + export interface $500 { } } } namespace GetMonitoring { @@ -938,11 +914,11 @@ declare namespace Paths { } namespace Responses { export type $200 = UserService.Schemas.MonitoringDTO; - export interface $204 {} - export interface $400 {} - export interface $401 {} - export interface $403 {} - export interface $500 {} + export interface $204 { } + export interface $400 { } + export interface $401 { } + export interface $403 { } + export interface $500 { } } } namespace GetSessionsForAuthenticatedConsultant { @@ -965,10 +941,10 @@ declare namespace Paths { namespace Responses { export type $200 = UserService.Schemas.ConsultantSessionListResponseDTO; - export interface $204 {} - export interface $401 {} - export interface $403 {} - export interface $500 {} + export interface $204 { } + export interface $401 { } + export interface $403 { } + export interface $500 { } } } namespace GetSessionsForAuthenticatedUser { @@ -980,11 +956,11 @@ declare namespace Paths { } namespace Responses { export type $200 = UserService.Schemas.UserSessionListResponseDTO; - export interface $204 {} - export interface $400 {} - export interface $401 {} - export interface $403 {} - export interface $500 {} + export interface $204 { } + export interface $400 { } + export interface $401 { } + export interface $403 { } + export interface $500 { } } } namespace GetTeamSessionsForAuthenticatedConsultant { @@ -1005,43 +981,43 @@ declare namespace Paths { namespace Responses { export type $200 = UserService.Schemas.ConsultantSessionListResponseDTO; - export interface $204 {} - export interface $401 {} - export interface $403 {} - export interface $500 {} + export interface $204 { } + export interface $401 { } + export interface $403 { } + export interface $500 { } } } namespace GetUserData { namespace Responses { export type $200 = UserService.Schemas.UserDataResponseDTO; - export interface $400 {} - export interface $401 {} - export interface $403 {} - export interface $500 {} + export interface $400 { } + export interface $401 { } + export interface $403 { } + export interface $500 { } } } namespace ImportAskers { namespace Responses { - export interface $200 {} - export interface $400 {} - export interface $401 {} - export interface $500 {} + export interface $200 { } + export interface $400 { } + export interface $401 { } + export interface $500 { } } } namespace ImportAskersWithoutSession { namespace Responses { - export interface $200 {} - export interface $400 {} - export interface $401 {} - export interface $500 {} + export interface $200 { } + export interface $400 { } + export interface $401 { } + export interface $500 { } } } namespace ImportConsultants { namespace Responses { - export interface $200 {} - export interface $400 {} - export interface $401 {} - export interface $500 {} + export interface $200 { } + export interface $400 { } + export interface $401 { } + export interface $500 { } } } namespace JoinChat { @@ -1052,13 +1028,13 @@ declare namespace Paths { chatId: Parameters.ChatId /* int64 */; } namespace Responses { - export interface $200 {} - export interface $400 {} - export interface $401 {} - export interface $403 {} - export interface $404 {} - export interface $409 {} - export interface $500 {} + export interface $200 { } + export interface $400 { } + export interface $401 { } + export interface $403 { } + export interface $404 { } + export interface $409 { } + export interface $500 { } } } namespace LeaveChat { @@ -1069,13 +1045,13 @@ declare namespace Paths { chatId: Parameters.ChatId /* int64 */; } namespace Responses { - export interface $200 {} - export interface $400 {} - export interface $401 {} - export interface $403 {} - export interface $404 {} - export interface $409 {} - export interface $500 {} + export interface $200 { } + export interface $400 { } + export interface $401 { } + export interface $403 { } + export interface $404 { } + export interface $409 { } + export interface $500 { } } } namespace RegisterNewConsultingType { @@ -1090,20 +1066,20 @@ declare namespace Paths { export type RequestBody = UserService.Schemas.NewRegistrationDto; namespace Responses { export type $201 = UserService.Schemas.NewRegistrationResponseDto; - export interface $400 {} - export interface $403 {} - export interface $409 {} - export interface $500 {} + export interface $400 { } + export interface $403 { } + export interface $409 { } + export interface $500 { } } } namespace RegisterUser { export type RequestBody = UserService.Schemas.UserDTO; namespace Responses { - export interface $201 {} - export interface $400 {} - export interface $403 {} - export interface $409 {} - export interface $500 {} + export interface $201 { } + export interface $400 { } + export interface $403 { } + export interface $409 { } + export interface $500 { } } } namespace SendLiveEvent { @@ -1114,31 +1090,31 @@ declare namespace Paths { rcGroupId: Parameters.RcGroupId; } namespace Responses { - export interface $200 {} - export interface $400 {} - export interface $403 {} - export interface $409 {} - export interface $500 {} + export interface $200 { } + export interface $400 { } + export interface $403 { } + export interface $409 { } + export interface $500 { } } } namespace SendNewFeedbackMessageNotification { export type RequestBody = UserService.Schemas.NewMessageNotificationDTO; namespace Responses { - export interface $200 {} - export interface $400 {} - export interface $401 {} - export interface $409 {} - export interface $500 {} + export interface $200 { } + export interface $400 { } + export interface $401 { } + export interface $409 { } + export interface $500 { } } } namespace SendNewMessageNotification { export type RequestBody = UserService.Schemas.NewMessageNotificationDTO; namespace Responses { - export interface $200 {} - export interface $400 {} - export interface $401 {} - export interface $409 {} - export interface $500 {} + export interface $200 { } + export interface $400 { } + export interface $401 { } + export interface $409 { } + export interface $500 { } } } namespace StartChat { @@ -1149,12 +1125,12 @@ declare namespace Paths { chatId: Parameters.ChatId /* int64 */; } namespace Responses { - export interface $200 {} - export interface $400 {} - export interface $401 {} - export interface $403 {} - export interface $409 {} - export interface $500 {} + export interface $200 { } + export interface $400 { } + export interface $401 { } + export interface $403 { } + export interface $409 { } + export interface $500 { } } } namespace StopChat { @@ -1165,22 +1141,22 @@ declare namespace Paths { chatId: Parameters.ChatId /* int64 */; } namespace Responses { - export interface $200 {} - export interface $400 {} - export interface $401 {} - export interface $403 {} - export interface $409 {} - export interface $500 {} + export interface $200 { } + export interface $400 { } + export interface $401 { } + export interface $403 { } + export interface $409 { } + export interface $500 { } } } namespace UpdateAbsence { export type RequestBody = UserService.Schemas.AbsenceDTO; namespace Responses { - export interface $200 {} - export interface $400 {} - export interface $401 {} - export interface $403 {} - export interface $500 {} + export interface $200 { } + export interface $400 { } + export interface $401 { } + export interface $403 { } + export interface $500 { } } } namespace UpdateChat { @@ -1193,52 +1169,52 @@ declare namespace Paths { export type RequestBody = UserService.Schemas.ChatDTO; namespace Responses { export type $200 = UserService.Schemas.UpdateChatResponseDTO; - export interface $400 {} - export interface $403 {} - export interface $409 {} - export interface $500 {} + export interface $400 { } + export interface $403 { } + export interface $409 { } + export interface $500 { } } } namespace UpdateConsultantData { export type RequestBody = UserService.Schemas.UpdateConsultantDTO; namespace Responses { - export interface $200 {} - export interface $400 {} - export interface $401 {} - export interface $403 {} - export interface $409 {} - export interface $500 {} + export interface $200 { } + export interface $400 { } + export interface $401 { } + export interface $403 { } + export interface $409 { } + export interface $500 { } } } namespace UpdateEmailAddress { export type RequestBody = string; namespace Responses { - export interface $200 {} - export interface $400 {} - export interface $401 {} - export interface $403 {} - export interface $409 {} - export interface $500 {} + export interface $200 { } + export interface $400 { } + export interface $401 { } + export interface $403 { } + export interface $409 { } + export interface $500 { } } } namespace UpdateKey { export type RequestBody = UserService.Schemas.MasterKeyDTO; namespace Responses { - export interface $202 {} - export interface $401 {} - export interface $403 {} - export interface $409 {} - export interface $500 {} + export interface $202 { } + export interface $401 { } + export interface $403 { } + export interface $409 { } + export interface $500 { } } } namespace UpdateMobileToken { export type RequestBody = UserService.Schemas.MobileTokenDTO; namespace Responses { - export interface $200 {} - export interface $400 {} - export interface $401 {} - export interface $403 {} - export interface $500 {} + export interface $200 { } + export interface $400 { } + export interface $401 { } + export interface $403 { } + export interface $500 { } } } namespace UpdateMonitoring { @@ -1250,21 +1226,21 @@ declare namespace Paths { } export type RequestBody = UserService.Schemas.MonitoringDTO; namespace Responses { - export interface $200 {} - export interface $400 {} - export interface $401 {} - export interface $403 {} - export interface $500 {} + export interface $200 { } + export interface $400 { } + export interface $401 { } + export interface $403 { } + export interface $500 { } } } namespace UpdatePassword { export type RequestBody = UserService.Schemas.PasswordDTO; namespace Responses { - export interface $200 {} - export interface $400 {} - export interface $401 {} - export interface $403 {} - export interface $500 {} + export interface $200 { } + export interface $400 { } + export interface $401 { } + export interface $403 { } + export interface $500 { } } } namespace UpdateSessionData { @@ -1276,12 +1252,12 @@ declare namespace Paths { } export type RequestBody = UserService.Schemas.SessionDataDTO; namespace Responses { - export interface $200 {} - export interface $400 {} - export interface $401 {} - export interface $403 {} - export interface $404 {} - export interface $500 {} + export interface $200 { } + export interface $400 { } + export interface $401 { } + export interface $403 { } + export interface $404 { } + export interface $500 { } } } } diff --git a/src/resources/i18n/de/common.json b/src/resources/i18n/de/common.json index be687102c..89ba4390e 100644 --- a/src/resources/i18n/de/common.json +++ b/src/resources/i18n/de/common.json @@ -1264,10 +1264,6 @@ "headline": "Nachricht löschen" } }, - "forward": { - "label": "Weitergeleitete Nachricht von {{username}}, {{date}} um {{time}}", - "title": "Textnachricht an\nFeedback weiterleiten" - }, "groupChat": "Gruppenchat", "isMyMessage": { "name": "Ich" diff --git a/src/resources/i18n/en/common.json b/src/resources/i18n/en/common.json index 0dbf02480..753cf5256 100644 --- a/src/resources/i18n/en/common.json +++ b/src/resources/i18n/en/common.json @@ -1249,10 +1249,6 @@ "headline": "Delete message" } }, - "forward": { - "label": "Forwarded message from {{username}}, {{date}} at {{time}}", - "title": "Forward text message to\nFeedback" - }, "groupChat": "Group chat", "isMyMessage": { "name": "Me" diff --git a/src/resources/scripts/endpoints.ts b/src/resources/scripts/endpoints.ts index fb0cba15a..dc9ad3255 100644 --- a/src/resources/scripts/endpoints.ts +++ b/src/resources/scripts/endpoints.ts @@ -54,7 +54,6 @@ export const endpoints = { draftMessages: apiUrl + '/service/messages/draft', email: apiUrl + '/service/users/email', error: apiUrl + '/service/logstash', - forwardMessage: apiUrl + '/service/messages/forward', groupChatBase: apiUrl + '/service/users/chat/', keycloakAccessToken: apiUrl + '/auth/realms/online-beratung/protocol/openid-connect/token', diff --git a/src/resources/styles/settings.scss b/src/resources/styles/settings.scss index c4e73daac..52ddf478d 100644 --- a/src/resources/styles/settings.scss +++ b/src/resources/styles/settings.scss @@ -80,7 +80,6 @@ $message-name-self: $text-low-emphasis; $message-name-system: var(--skin-color-default, $primary); $message-name-consultant: var(--skin-color-default, $primary); $message-name-user: #167a6f; -$message-name-forwarded: $text-low-emphasis; $message-system: #8c878c; // FONT SIZES @@ -233,11 +232,9 @@ $max-input-width: 320px; $message-background-primary: $primary; $message-background-secondary: black; $message-background-rate: 0%; -$message-background: mix( - $message-background-secondary, - $primary, - $message-background-rate -); +$message-background: mix($message-background-secondary, + $primary, + $message-background-rate); $message-submit-interface-textarea-background-color: $dark-grey; $message-submit-interface-textarea-background-color-yellow: $yellow-3; $message-submit-interface-textarea-placeholder-color: $light-grey; @@ -290,4 +287,4 @@ $text-divider-font-weight: $font-weight-regular; $text-divider-text-transform: none; $upload-progress: #80dd92; $waiting-room-illustration-display-after: block; -$welcome-screen-icon-background: $primary; +$welcome-screen-icon-background: $primary; \ No newline at end of file From 92bd00c1d5a98680247afb1d96f09b6744a2d625 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deborah=20K=C3=B6pfer?= Date: Tue, 23 Jul 2024 12:04:42 +0200 Subject: [PATCH 04/37] feat(initializeFeedbackChat): rm initializeFeedbackChat functionality --- cypress/fixtures/service.consultingtypes.addiction.json | 1 - 1 file changed, 1 deletion(-) diff --git a/cypress/fixtures/service.consultingtypes.addiction.json b/cypress/fixtures/service.consultingtypes.addiction.json index 7235f05f6..eaa00a1c2 100644 --- a/cypress/fixtures/service.consultingtypes.addiction.json +++ b/cypress/fixtures/service.consultingtypes.addiction.json @@ -46,7 +46,6 @@ "relation": true, "state": false }, - "initializeFeedbackChat": false, "roles": { "consultant": { "main": ["consultant"], From 8ede5c9ef566e42280f494c749f16e0df8fd24f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deborah=20K=C3=B6pfer?= Date: Tue, 23 Jul 2024 12:13:48 +0200 Subject: [PATCH 05/37] feat(feedbackRead): rm feedbackRead functionality --- .../fixtures/service.users.sessions.room.json | 1 - cypress/support/sessions.ts | 2 -- .../SessionListItemComponent.tsx | 29 +++++++++---------- src/generated/userservice.d.ts | 5 ---- .../interfaces/SessionsDataInterface.ts | 11 ++++--- src/hooks/useSession.tsx | 6 +--- 6 files changed, 19 insertions(+), 35 deletions(-) diff --git a/cypress/fixtures/service.users.sessions.room.json b/cypress/fixtures/service.users.sessions.room.json index 7f29441d3..83e8dc8ad 100644 --- a/cypress/fixtures/service.users.sessions.room.json +++ b/cypress/fixtures/service.users.sessions.room.json @@ -14,7 +14,6 @@ "lastMessage": null, "messageDate": 0, "messagesRead": false, - "feedbackRead": true, "isTeamSession": false, "registrationType": "REGISTERED", "createDate": "2022-06-15T08:09:18Z", diff --git a/cypress/support/sessions.ts b/cypress/support/sessions.ts index 39b512220..a8bbf0202 100644 --- a/cypress/support/sessions.ts +++ b/cypress/support/sessions.ts @@ -48,7 +48,6 @@ export const generateConsultantSession = ({ lastMessage: 'lastMessage', messageDate: 1606900238, messagesRead: messagesRead === undefined ? true : messagesRead, - feedbackRead: true, isTeamSession: true, isFeedbackSession: false, isPeerChat: false, @@ -117,7 +116,6 @@ export const generateAskerSession = ({ lastMessage: null, messageDate: null, messagesRead: messagesRead === undefined ? true : messagesRead, - feedbackRead: null, isTeamSession: isTeamSession === undefined ? true : isTeamSession, isFeedbackSession: false, isPeerChat: false, diff --git a/src/components/sessionsListItem/SessionListItemComponent.tsx b/src/components/sessionsListItem/SessionListItemComponent.tsx index ca288065b..b59bb498a 100644 --- a/src/components/sessionsListItem/SessionListItemComponent.tsx +++ b/src/components/sessionsListItem/SessionListItemComponent.tsx @@ -92,7 +92,7 @@ export const SessionListItemComponent = ({ const { key, keyID, encrypted, ready } = useE2EE( activeSession.item.groupId, activeSession.item.lastMessageType === - ALIAS_MESSAGE_TYPES.MASTER_KEY_LOST + ALIAS_MESSAGE_TYPES.MASTER_KEY_LOST ); const [plainTextLastMessage, setPlainTextLastMessage] = useState(null); @@ -169,8 +169,7 @@ export const SessionListItemComponent = ({ const handleOnClick = () => { if (activeSession.item.groupId && activeSession.item.id !== undefined) { history.push( - `${listPath}/${activeSession.item.groupId}/${ - activeSession.item.id + `${listPath}/${activeSession.item.groupId}/${activeSession.item.id }${getSessionListTab()}` ); } else if ( @@ -293,7 +292,7 @@ export const SessionListItemComponent = ({ className={clsx( 'sessionsListItem__username', activeSession.item.messagesRead && - 'sessionsListItem__username--readLabel' + 'sessionsListItem__username--readLabel' )} > {activeSession.item.topic} @@ -326,9 +325,8 @@ export const SessionListItemComponent = ({ ); } - const feedbackPath = `${listPath}/${activeSession.item.feedbackGroupId}/${ - activeSession.item.id - }${getSessionListTab()}`; + const feedbackPath = `${listPath}/${activeSession.item.feedbackGroupId}/${activeSession.item.id + }${getSessionListTab()}`; const hasConsultantData = !!activeSession.consultant; let sessionTopic = ''; @@ -367,11 +365,11 @@ export const SessionListItemComponent = ({ >
{type === SESSION_LIST_TYPES.TEAMSESSION && - hasUserAuthority( - AUTHORITIES.VIEW_ALL_PEER_SESSIONS, - userData - ) && - activeSession.consultant ? ( + hasUserAuthority( + AUTHORITIES.VIEW_ALL_PEER_SESSIONS, + userData + ) && + activeSession.consultant ? (
{translate('sessionList.user.peer')}:{' '} {activeSession.consultant.firstName}{' '} @@ -380,8 +378,8 @@ export const SessionListItemComponent = ({ ) : (
{!isAsker && - !activeSession.isLive && - !autoSelectPostcode + !activeSession.isLive && + !autoSelectPostcode ? activeSession.item.postcode : null}
@@ -413,7 +411,7 @@ export const SessionListItemComponent = ({ className={clsx( 'sessionsListItem__username', activeSession.item.messagesRead && - 'sessionsListItem__username--readLabel' + 'sessionsListItem__username--readLabel' )} > {sessionTopic} @@ -453,7 +451,6 @@ export const SessionListItemComponent = ({ {!isAsker && type !== SESSION_LIST_TYPES.ENQUIRY && !activeSession.isLive && - !activeSession.item.feedbackRead && !activeSession.isFeedback && ( Date: Tue, 23 Jul 2024 14:58:04 +0200 Subject: [PATCH 06/37] feat(sendFeedback): rm sendFeedback functionality and yellowTheme --- src/api/apiSendMessage.ts | 9 +- src/api/apiUploadAttachment.ts | 5 +- src/components/form/textarea.styles.scss | 11 +- ...ageSubmitInterface.yellowTheme.styles.scss | 23 ---- .../messageSubmitInterfaceComponent.tsx | 116 +++--------------- .../session/SessionItemComponent.tsx | 24 ++-- .../session/session.yellowTheme.styles.scss | 15 --- src/resources/i18n/de/common.json | 15 --- src/resources/i18n/en/common.json | 15 --- 9 files changed, 33 insertions(+), 200 deletions(-) delete mode 100644 src/components/messageSubmitInterface/messageSubmitInterface.yellowTheme.styles.scss delete mode 100644 src/components/session/session.yellowTheme.styles.scss 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/components/form/textarea.styles.scss b/src/components/form/textarea.styles.scss index f13eaefc5..8834d1ef9 100644 --- a/src/components/form/textarea.styles.scss +++ b/src/components/form/textarea.styles.scss @@ -49,8 +49,8 @@ color: transparent; } - &:focus + label, - &:not(:placeholder-shown) + label { + &:focus+label, + &:not(:placeholder-shown)+label { font-size: 12px; top: 2px; transition: @@ -60,13 +60,13 @@ padding-top: $grid-base; } - &:placeholder-shown + label { + &:placeholder-shown+label { top: 4px; } } /* 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 */ -} +} \ No newline at end of file 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..f99d30f8d 100644 --- a/src/components/messageSubmitInterface/messageSubmitInterfaceComponent.tsx +++ b/src/components/messageSubmitInterface/messageSubmitInterfaceComponent.tsx @@ -69,7 +69,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 +96,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; @@ -182,7 +180,7 @@ export const MessageSubmitInterfaceComponent = ({ const [isRichtextActive, setIsRichtextActive] = useState(false); const [isConsultantAbsent, setIsConsultantAbsent] = useState( hasUserAuthority(AUTHORITIES.ASKER_DEFAULT, userData) && - activeSession.consultant?.absent + activeSession.consultant?.absent ); const [isSessionArchived, setIsSessionArchived] = useState( activeSession.item.status === STATUS_ARCHIVED @@ -193,8 +191,6 @@ export const MessageSubmitInterfaceComponent = ({ const [isLiveChatFinished, setIsLiveChatFinished] = useState( activeSession.isLive && activeSession.item.status === STATUS_FINISHED ); - const [requestFeedbackCheckboxChecked, setRequestFeedbackCheckboxChecked] = - useState(false); const [showAppointmentButton, setShowAppointmentButton] = useState(false); //Emoji Picker Plugin @@ -229,15 +225,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, @@ -248,7 +235,7 @@ export const MessageSubmitInterfaceComponent = ({ useTimeoutOverlay( // Disable the request overlay if upload is in progess because upload progress is shown in the ui already isRequestInProgress && - !(uploadProgress > 0 && uploadProgress < 100), + !(uploadProgress > 0 && uploadProgress < 100), null, null, null, @@ -258,13 +245,13 @@ export const MessageSubmitInterfaceComponent = ({ useEffect(() => { setIsConsultantAbsent( hasUserAuthority(AUTHORITIES.ASKER_DEFAULT, userData) && - activeSession.consultant?.absent + activeSession.consultant?.absent ); setIsSessionArchived(activeSession.item.status === STATUS_ARCHIVED); setIsTypingActive(activeSession.isGroup || activeSession.isLive); setIsLiveChatFinished( activeSession.isLive && - activeSession.item.status === STATUS_FINISHED + activeSession.item.status === STATUS_FINISHED ); }, [activeSession, activeSession.item.status, userData]); @@ -387,7 +374,7 @@ export const MessageSubmitInterfaceComponent = ({ if ( draftLoaded && currentEditorState.getCurrentContent() !== - editorState.getCurrentContent() && + editorState.getCurrentContent() && isTyping ) { isTyping(!currentEditorState.getCurrentContent().hasText()); @@ -455,11 +442,11 @@ export const MessageSubmitInterfaceComponent = ({ let textInputStyles = `min-height: ${currentInputHeight}px; ${currentOverflow} ${textInputMarginTop} ${textInputMarginBottom}`; textInputStyles = isRichtextActive ? textInputStyles + - `border-top: none; border-top-right-radius: 0; box-shadow: none;` + `border-top: none; border-top-right-radius: 0; box-shadow: none;` : textInputStyles; textInputStyles = attachmentSelected ? textInputStyles + - `border-bottom: none; border-bottom-right-radius: 0;` + `border-bottom: none; border-bottom-right-radius: 0;` : textInputStyles; textInput?.setAttribute('style', textInputStyles); @@ -511,35 +498,19 @@ 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 sendToRoomWithId = activeSession.rid || activeSession.item.id; const getSendMailNotificationStatus = () => !activeSession.isGroup && !activeSession.isLive; @@ -577,7 +548,6 @@ export const MessageSubmitInterfaceComponent = ({ res = await apiUploadAttachment( attachmentFile, sendToRoomWithId, - sendToFeedbackEndpoint, getSendMailNotificationStatus(), setUploadProgress, setAttachmentUpload, @@ -617,7 +587,6 @@ export const MessageSubmitInterfaceComponent = ({ await apiSendMessage( message, sendToRoomWithId, - sendToFeedbackEndpoint, getSendMailNotificationStatus() && !attachment, isEncrypted ) @@ -673,21 +642,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, @@ -709,27 +668,18 @@ export const MessageSubmitInterfaceComponent = ({ } await sendMessage( - sendToFeedbackEndpoint, message, attachment, isEncrypted ); - - if (requestFeedbackCheckboxChecked) { - await feedbackEncryptRoom(setE2EEState); - } }, [ activeSession.isFeedback, encrypted, - feedbackChatKey, - feedbackChatKeyId, - feedbackEncryptRoom, getTypedMarkdownMessage, isE2eeEnabled, key, keyID, preselectedFile, - requestFeedbackCheckboxChecked, sendEnquiry, sendMessage, setE2EEState, @@ -782,12 +732,6 @@ export const MessageSubmitInterfaceComponent = ({ userData ]); - const handleRequestFeedbackCheckbox = useCallback(() => { - setRequestFeedbackCheckboxChecked( - (requestFeedbackCheckboxChecked) => !requestFeedbackCheckboxChecked - ); - }, []); - const handleAttachmentSelect = useCallback(() => { const attachmentInput: any = attachmentInputRef.current; attachmentInput.click(); @@ -840,11 +784,10 @@ export const MessageSubmitInterfaceComponent = ({ const contact = getContact(activeSession); infoData = { isInfo: true, - infoHeadline: `${ - contact?.displayName || + infoHeadline: `${contact?.displayName || contact?.username || translate('sessionList.user.consultantUnknown') - } ${translate('consultant.absent.message')} `, + } ${translate('consultant.absent.message')} `, infoMessage: activeSession.consultant.absenceMessage }; } else if (activeInfo === INFO_TYPES.ATTACHMENT_SIZE_ERROR) { @@ -901,12 +844,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 +860,7 @@ export const MessageSubmitInterfaceComponent = ({ return null; }, []); - if (!e2EEReady || !feedbackE2EEReady) { + if (!e2EEReady) { return null; } @@ -953,24 +890,8 @@ export const MessageSubmitInterfaceComponent = ({ {activeInfo && } {!isLiveChatFinished && (
- {hasRequestFeedbackCheckbox && ( - - )}
@@ -1026,14 +947,7 @@ export const MessageSubmitInterfaceComponent = ({ handleKeyCommand={ handleEditorKeyCommand } - placeholder={ - hasRequestFeedbackCheckbox && - requestFeedbackCheckboxChecked - ? translate( - 'enquiry.write.input.placeholder.feedback.peer' - ) - : placeholder - } + placeholder={placeholder} stripPastedStyles={true} spellCheck={true} handleBeforeInput={() => diff --git a/src/components/session/SessionItemComponent.tsx b/src/components/session/SessionItemComponent.tsx index b835cf15e..ca2d96ffe 100644 --- a/src/components/session/SessionItemComponent.tsx +++ b/src/components/session/SessionItemComponent.tsx @@ -30,7 +30,6 @@ import { } from '../../globalState'; import { ConsultingTypeInterface } from '../../globalState/interfaces'; import './session.styles'; -import './session.yellowTheme.styles'; import { useDebouncedCallback } from 'use-debounce'; import { ReactComponent as ArrowDoubleDownIcon } from '../../resources/img/icons/arrow-double-down.svg'; import smoothScroll from './smoothScrollHelper'; @@ -85,7 +84,7 @@ export const SessionItemComponent = (props: SessionItemProps) => { useEffect(() => { setCanWriteMessage( type !== SESSION_LIST_TYPES.ENQUIRY || - hasUserAuthority(AUTHORITIES.VIEW_ALL_PEER_SESSIONS, userData) + hasUserAuthority(AUTHORITIES.VIEW_ALL_PEER_SESSIONS, userData) ); }, [type, userData]); @@ -322,7 +321,7 @@ export const SessionItemComponent = (props: SessionItemProps) => { if ( trackedErrorIndex >= 0 && acc[trackedErrorIndex][1].message === - collectedError.message + collectedError.message ) { if (timestamp > acc[trackedErrorIndex][0]) { acc.splice( @@ -356,17 +355,13 @@ export const SessionItemComponent = (props: SessionItemProps) => { return (
{ ))}
{newMessages > 0 && ( @@ -476,7 +470,7 @@ export const SessionItemComponent = (props: SessionItemProps) => { className={clsx( 'session__submit-interface', !isScrolledToBottom && - 'session__submit-interface--scrolled-up' + 'session__submit-interface--scrolled-up' )} placeholder={getPlaceholder()} typingUsers={props.typingUsers} diff --git a/src/components/session/session.yellowTheme.styles.scss b/src/components/session/session.yellowTheme.styles.scss deleted file mode 100644 index f41209a2c..000000000 --- a/src/components/session/session.yellowTheme.styles.scss +++ /dev/null @@ -1,15 +0,0 @@ -.session--yellowTheme { - background-color: var(--skin-color-secondary-light, $yellow-2); - .session__content { - background-color: var(--skin-color-secondary-light, $yellow-2); - } -} - -.sessionsListItem--yellowTheme { - .sessionsListItem__content { - background-color: var(--skin-color-secondary-light, $yellow-2); - } - &:after { - background-color: var(--skin-color-secondary-light, $yellow-2); - } -} diff --git a/src/resources/i18n/de/common.json b/src/resources/i18n/de/common.json index 89ba4390e..841bd29e3 100644 --- a/src/resources/i18n/de/common.json +++ b/src/resources/i18n/de/common.json @@ -374,7 +374,6 @@ "dataProtection": "Datenschutz", "dearchive": "Dearchivieren", "editGroupChat": "Chat-Einstellungen", - "feedback": "Feedback", "groupChatInfo": "Chat-Info", "imprint": "Impressum", "leaveGroupChat": "Chat verlassen", @@ -595,10 +594,6 @@ "placeholder": { "asker": "Schreiben Sie uns, was Sie bewegt.", "consultant": "Nachricht an Klient:in schreiben", - "feedback": { - "main": "Nachricht an Peer schreiben", - "peer": "Nachricht an Teamleiter:in schreiben" - }, "groupChat": "Nachricht schreiben" } }, @@ -1291,13 +1286,6 @@ "moderatorEndedTitle": "Videokonferenz wurde beendet: {{time}}", "moderatorStartedTitle": "Moderator:in {{name}} hat eine Videokonferenz gestartet" }, - "write": { - "peer": { - "checkbox": { - "label": "Feedback anfordern" - } - } - }, "yesterday": "Gestern" }, "navigation": { @@ -2120,9 +2108,6 @@ "restrictions": ".jpg, .png, .pdf, .docx, .xlsx bis maximal {{attachment_filesize}} MB" }, "empty": "Bitte wählen Sie eine Nachricht aus", - "feedback": { - "label": "Feedback" - }, "groupChat": { "consultant": { "prefix": "Moderatorin oder Moderator - " diff --git a/src/resources/i18n/en/common.json b/src/resources/i18n/en/common.json index 753cf5256..01000d99a 100644 --- a/src/resources/i18n/en/common.json +++ b/src/resources/i18n/en/common.json @@ -362,7 +362,6 @@ "dataProtection": "Data protection", "dearchive": "Dearchive", "editGroupChat": "Chat settings", - "feedback": "Feedback", "groupChatInfo": "Chat info", "imprint": "Imprint", "leaveGroupChat": "Leave chat", @@ -583,10 +582,6 @@ "placeholder": { "asker": "Write us what moves you.", "consultant": "Write a message to client", - "feedback": { - "main": "Send a message to Peer", - "peer": "Send a message to Teamleader" - }, "groupChat": "Write message" } }, @@ -1269,13 +1264,6 @@ "today": "Today", "tomorrow": "Tomorrow", "unread": "unread", - "write": { - "peer": { - "checkbox": { - "label": "Request feedback" - } - } - }, "yesterday": "Yesterday" }, "navigation": { @@ -2001,9 +1989,6 @@ "restrictions": ".jpg, .png, .pdf, .docx, .xlsx up to a maximum of {{attachment_filesize}}MB" }, "empty": "Please select a message", - "feedback": { - "label": "Feedback" - }, "groupChat": { "consultant": { "prefix": "Moderator - " From 4c8aba1fd20f3de39b1a58d9391c4e7dd06982d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deborah=20K=C3=B6pfer?= Date: Tue, 23 Jul 2024 15:25:13 +0200 Subject: [PATCH 07/37] feat(session-header,-menu-and-copy-message): rm feedback functionality from session header, menu and copy message --- .../fixtures/service.users.sessions.room.json | 1 - cypress/support/sessions.ts | 4 - src/components/message/CopyMessage.tsx | 54 --------- .../message/MessageItemComponent.tsx | 7 -- src/components/message/MessageMetaData.tsx | 1 - .../messageSubmitInterfaceComponent.tsx | 3 - .../sessionHeader/SessionHeaderComponent.tsx | 113 +++++++----------- .../sessionHeader/sessionHeader.styles.scss | 51 +------- .../sessionHeader.yellowTheme.styles.scss | 9 -- src/components/sessionMenu/SessionMenu.tsx | 44 +------ .../SessionListItemComponent.tsx | 16 +-- src/generated/userservice.d.ts | 12 -- src/globalState/helpers/stateHelpers.ts | 9 +- .../interfaces/SessionsDataInterface.ts | 1 - 14 files changed, 52 insertions(+), 273 deletions(-) delete mode 100644 src/components/message/CopyMessage.tsx delete mode 100644 src/components/sessionHeader/sessionHeader.yellowTheme.styles.scss diff --git a/cypress/fixtures/service.users.sessions.room.json b/cypress/fixtures/service.users.sessions.room.json index 83e8dc8ad..09d009609 100644 --- a/cypress/fixtures/service.users.sessions.room.json +++ b/cypress/fixtures/service.users.sessions.room.json @@ -7,7 +7,6 @@ "postcode": "12345", "language": "de", "groupId": "someGroupId", - "feedbackGroupId": null, "isPeerChat": false, "askerRcId": "askerRcId", "e2eLastMessage": null, diff --git a/cypress/support/sessions.ts b/cypress/support/sessions.ts index a8bbf0202..692afa88b 100644 --- a/cypress/support/sessions.ts +++ b/cypress/support/sessions.ts @@ -43,13 +43,11 @@ export const generateConsultantSession = ({ status, postcode: 12345, groupId: rcGroupId, - feedbackGroupId: null, askerRcId: 'askerRcId', lastMessage: 'lastMessage', messageDate: 1606900238, messagesRead: messagesRead === undefined ? true : messagesRead, isTeamSession: true, - isFeedbackSession: false, isPeerChat: false, attachment: null, registrationType: 'REGISTERED', @@ -111,13 +109,11 @@ export const generateAskerSession = ({ status: 2, postcode: 12345, groupId: rcGroupId, - feedbackGroupId: 'feedbackGroupId1', askerRcId: 'askerRcId1', lastMessage: null, messageDate: null, messagesRead: messagesRead === undefined ? true : messagesRead, isTeamSession: isTeamSession === undefined ? true : isTeamSession, - isFeedbackSession: false, isPeerChat: false, attachment: null, registrationType: 'REGISTERED', diff --git a/src/components/message/CopyMessage.tsx b/src/components/message/CopyMessage.tsx deleted file mode 100644 index 08046986d..000000000 --- a/src/components/message/CopyMessage.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import * as React from 'react'; -import { useEffect, useState } from 'react'; -import { ReactComponent as CopyIcon } from '../../resources/img/icons/documents.svg'; -import { ReactComponent as CheckmarkIcon } from '../../resources/img/icons/checkmark.svg'; -import { copyTextToClipboard } from '../../utils/clipboardHelpers'; -import { useTranslation } from 'react-i18next'; - -interface CopyMessageProps { - right: Boolean; - message: string; -} - -export const CopyMessage = (props: CopyMessageProps) => { - 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/MessageItemComponent.tsx b/src/components/message/MessageItemComponent.tsx index d4dab421e..486d9f2a2 100644 --- a/src/components/message/MessageItemComponent.tsx +++ b/src/components/message/MessageItemComponent.tsx @@ -17,7 +17,6 @@ import { } from '../../globalState/interfaces'; import { isUserModerator, SESSION_LIST_TYPES } 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'; @@ -484,12 +483,6 @@ export const MessageItemComponent = ({ hasRenderedMessage={hasRenderedMessage} /> ))} - {activeSession.isFeedback && ( - - )}
); diff --git a/src/components/message/MessageMetaData.tsx b/src/components/message/MessageMetaData.tsx index 8f82c8e45..03b3a5b2e 100644 --- a/src/components/message/MessageMetaData.tsx +++ b/src/components/message/MessageMetaData.tsx @@ -28,7 +28,6 @@ export const MessageMetaData = (props: MessageMetaDataProps) => { if ( hasUserAuthority(AUTHORITIES.ASKER_DEFAULT, userData) || hasUserAuthority(AUTHORITIES.ANONYMOUS_DEFAULT, userData) || - (!activeSession.isGroup && activeSession.isFeedback) || props.isReadStatusDisabled ) { return null; diff --git a/src/components/messageSubmitInterface/messageSubmitInterfaceComponent.tsx b/src/components/messageSubmitInterface/messageSubmitInterfaceComponent.tsx index f99d30f8d..abf8bf813 100644 --- a/src/components/messageSubmitInterface/messageSubmitInterfaceComponent.tsx +++ b/src/components/messageSubmitInterface/messageSubmitInterfaceComponent.tsx @@ -214,7 +214,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, @@ -610,7 +609,6 @@ export const MessageSubmitInterfaceComponent = ({ [ activeSession.isGroup, activeSession.isLive, - activeSession.item.feedbackGroupId, activeSession.item.id, activeSession.rid, cleanupAttachment, @@ -673,7 +671,6 @@ export const MessageSubmitInterfaceComponent = ({ isEncrypted ); }, [ - activeSession.isFeedback, encrypted, getTypedMarkdownMessage, isE2eeEnabled, diff --git a/src/components/sessionHeader/SessionHeaderComponent.tsx b/src/components/sessionHeader/SessionHeaderComponent.tsx index 9b360487d..882e9b891 100644 --- a/src/components/sessionHeader/SessionHeaderComponent.tsx +++ b/src/components/sessionHeader/SessionHeaderComponent.tsx @@ -29,7 +29,6 @@ import { } from '../profile/profileHelpers'; import { ReactComponent as BackIcon } from '../../resources/img/icons/arrow-left.svg'; import './sessionHeader.styles'; -import './sessionHeader.yellowTheme.styles'; import { useSearchParam } from '../../hooks/useSearchParams'; import { useTranslation } from 'react-i18next'; import { GroupChatHeader } from './GroupChatHeader'; @@ -62,8 +61,8 @@ export const SessionHeaderComponent = (props: SessionHeaderProps) => { const preparedUserSessionData = hasUserAuthority(AUTHORITIES.CONSULTANT_DEFAULT, userData) && - userSessionData && - !activeSession.isLive + userSessionData && + !activeSession.isLive ? convertUserDataObjectToArray(userSessionData) : null; const translateBase = getUserDataTranslateBase( @@ -85,9 +84,8 @@ export const SessionHeaderComponent = (props: SessionHeaderProps) => { }, [isSubscriberFlyoutOpen]); const sessionView = getViewPathForType(type); - const userProfileLink = `/sessions/consultant/${sessionView}/${ - activeSession.item.groupId - }/${activeSession.item.id}/userProfile${getSessionListTab()}`; + const userProfileLink = `/sessions/consultant/${sessionView}/${activeSession.item.groupId + }/${activeSession.item.id}/userProfile${getSessionListTab()}`; const handleBackButton = () => { mobileListView(); @@ -131,35 +129,6 @@ export const SessionHeaderComponent = (props: SessionHeaderProps) => { ); } - if (activeSession.isFeedback) { - return ( -
-
- - - -
-

{translate('session.feedback.label')}

-
-
-
- {activeSession.user.username ? ( -
- {activeSession.user.username} -
- ) : null} -
-
- ); - } - return (
@@ -181,12 +150,12 @@ export const SessionHeaderComponent = (props: SessionHeaderProps) => { AUTHORITIES.ANONYMOUS_DEFAULT, userData )) && ( -

- {contact?.displayName || - contact?.username || - translate('sessionList.user.consultantUnknown')} -

- )} +

+ {contact?.displayName || + contact?.username || + translate('sessionList.user.consultantUnknown')} +

+ )} {hasUserAuthority( AUTHORITIES.CONSULTANT_DEFAULT, userData @@ -221,18 +190,18 @@ export const SessionHeaderComponent = (props: SessionHeaderProps) => { {(hasUserAuthority(AUTHORITIES.ASKER_DEFAULT, userData) || hasUserAuthority(AUTHORITIES.CONSULTANT_DEFAULT, userData)) && ( -
- {!activeSession.agency ? ( -
- {topic?.name || ''} -
- ) : null} - {preparedUserSessionData - ? preparedUserSessionData.map((item, index) => +
+ {!activeSession.agency ? ( +
+ {topic?.name || ''} +
+ ) : null} + {preparedUserSessionData + ? preparedUserSessionData.map((item, index) => item.value && - !( - item.type === 'age' && item.value === 'null' - ) ? ( + !( + item.type === 'age' && item.value === 'null' + ) ? (
{
) : null ) - : null} - {activeSession.agency?.name && ( -
- {' '} - {translate( - [ - `agency.${activeSession.agency.id}.name`, - activeSession.agency.name - ], - { ns: 'agencies' } - )}{' '} -
- )} - {activeSession.agency && ( -
- {translate('consultant.jobTitle')} -
- )} -
- )} + : null} + {activeSession.agency?.name && ( +
+ {' '} + {translate( + [ + `agency.${activeSession.agency.id}.name`, + activeSession.agency.name + ], + { ns: 'agencies' } + )}{' '} +
+ )} + {activeSession.agency && ( +
+ {translate('consultant.jobTitle')} +
+ )} +
+ )}
); }; diff --git a/src/components/sessionHeader/sessionHeader.styles.scss b/src/components/sessionHeader/sessionHeader.styles.scss index da3791554..491f14422 100644 --- a/src/components/sessionHeader/sessionHeader.styles.scss +++ b/src/components/sessionHeader/sessionHeader.styles.scss @@ -57,8 +57,7 @@ $iconSize: 24px; } } - &__backButton, - &__feedbackBackButton { + &__backButton { svg { width: $iconSize; height: $iconSize; @@ -78,14 +77,6 @@ $iconSize: 24px; } } - &__feedbackBackButton { - padding-right: 10px; - - @include breakpoint($fromLarge) { - display: block; - } - } - &__username { cursor: pointer; overflow: hidden; @@ -98,6 +89,7 @@ $iconSize: 24px; &--deactivate { cursor: unset; } + a { text-decoration: none; } @@ -124,32 +116,6 @@ $iconSize: 24px; margin-right: 20px; } - &__feedbackButton { - display: none; - - @include breakpoint($fromLarge) { - display: inline-block; - } - - &--active .button__item { - transform: scale(1.2); - animation: yellowThemeHighlight 1.5s forwards; - - @keyframes yellowThemeHighlight { - 0% { - background-color: $yellow-3; - } - 20% { - background-color: $yellow-4; - } - 100% { - background-color: $yellow-3; - } - } - } - } - - &__feedbackMetaInfo, &__metaInfo { width: 100%; max-width: $xlarge; @@ -174,10 +140,8 @@ $iconSize: 24px; } &--red { - color: var( - --skin-color-primary-contrast-safe, - $primary - ) !important; + color: var(--skin-color-primary-contrast-safe, + $primary) !important; text-transform: uppercase; } @@ -291,9 +255,4 @@ $iconSize: 24px; } } } - &__feedbackMetaInfo { - @include breakpoint($fromLarge) { - padding-left: 36px; - } - } -} +} \ No newline at end of file diff --git a/src/components/sessionHeader/sessionHeader.yellowTheme.styles.scss b/src/components/sessionHeader/sessionHeader.yellowTheme.styles.scss deleted file mode 100644 index 449e576fe..000000000 --- a/src/components/sessionHeader/sessionHeader.yellowTheme.styles.scss +++ /dev/null @@ -1,9 +0,0 @@ -.session--yellowTheme { - .sessionInfo { - background-color: $yellow-1; - - @include breakpoint($fromLarge) { - background-color: var(--skin-color-secondary-light, $yellow-2); - } - } -} diff --git a/src/components/sessionMenu/SessionMenu.tsx b/src/components/sessionMenu/SessionMenu.tsx index d2b19ed51..58a6bca4e 100644 --- a/src/components/sessionMenu/SessionMenu.tsx +++ b/src/components/sessionMenu/SessionMenu.tsx @@ -356,18 +356,6 @@ export const SessionMenu = (props: SessionMenuProps) => { ) }; - const buttonFeedback: ButtonItem = { - type: BUTTON_TYPES.SMALL_ICON, - smallIconBackgroundColor: 'yellow', - icon: ( - - ), - label: translate('chatFlyout.feedback') - }; - const hasVideoCallFeatures = () => hasUserAuthority(AUTHORITIES.CONSULTANT_DEFAULT, userData) && activeSession.isSession && @@ -440,20 +428,6 @@ export const SessionMenu = (props: SessionMenuProps) => {
)} - {!hasUserAuthority(AUTHORITIES.ASKER_DEFAULT, userData) && - type !== SESSION_LIST_TYPES.ENQUIRY && - activeSession.item.feedbackGroupId && ( - -
{requestOverlayVisible && ( diff --git a/src/components/session/AcceptLiveChatView.tsx b/src/components/session/AcceptLiveChatView.tsx index d50bc87cc..977f3c6da 100644 --- a/src/components/session/AcceptLiveChatView.tsx +++ b/src/components/session/AcceptLiveChatView.tsx @@ -76,15 +76,13 @@ export const AcceptLiveChatView = ({ semanticLevel="3" text={`${translate( 'enquiry.anonymous.infoLabel.start' - )}${ - getContact(activeSession)?.username || - translate('sessionList.user.consultantUnknown') - }${translate('enquiry.anonymous.infoLabel.end')}`} + )}${getContact(activeSession)?.username || + translate('sessionList.user.consultantUnknown') + }${translate('enquiry.anonymous.infoLabel.end')}`} />
{ - const { t: translate } = useTranslation(); - const history = useHistory(); - - const { activeSession } = useContext(ActiveSessionContext); - const { userData } = useContext(UserDataContext); - const { path: listPath } = useContext(SessionTypeContext); - const { consultantList, setConsultantList } = useContext( - ConsultantListContext - ); - const [overlayActive, setOverlayActive] = useState(false); - const [overlayItem, setOverlayItem] = useState({}); - const [selectedOption, setSelectedOption] = useState(); - const [isRequestInProgress, setIsRequestInProgress] = useState(false); - - const { isE2eeEnabled } = useContext(E2EEContext); - - const { addNewUsersToEncryptedRoom, encryptRoom } = useE2EE( - activeSession.item.groupId - ); - - const { - visible: e2eeOverlayVisible, - setState: setE2EEState, - overlay: e2eeOverlay - } = useE2EEViewElements(); - - const { visible: requestOverlayVisible, overlay: requestOverlay } = - useTimeoutOverlay( - isRequestInProgress, - null, - userData.userId === selectedOption - ? translate('session.assignSelf.inProgress') - : translate('session.assignOther.inProgress'), - null, - 0 - ); - - const sessionListTab = useSearchParam('sessionListTab'); - const getSessionListTab = () => - `${sessionListTab ? `?sessionListTab=${sessionListTab}` : ''}`; - - const assignOtherOverlay: OverlayItem = useMemo( - () => ({ - svg: CheckIcon, - headline: translate('session.assignOther.overlay.headline.2'), - buttonSet: [ - { - label: translate('session.assignOther.button.label'), - function: OVERLAY_FUNCTIONS.CLOSE, - functionArgs: { - gotoOverview: true - }, - type: BUTTON_TYPES.AUTO_CLOSE - } - ] - }), - [translate] - ); - - const assignSelfOverlay: OverlayItem = useMemo( - () => ({ - svg: CheckIcon, - headline: translate('session.assignSelf.overlay.headline1'), - buttonSet: [ - { - label: translate('session.assignSelf.button1.label'), - function: OVERLAY_FUNCTIONS.REDIRECT, - type: BUTTON_TYPES.PRIMARY - }, - { - label: translate('session.assignSelf.button2.label'), - function: OVERLAY_FUNCTIONS.CLOSE, - type: BUTTON_TYPES.SECONDARY - } - ] - }), - [translate] - ); - - const assignSession: OverlayItem = useMemo( - () => ({ - headline: translate('session.assignSelf.overlay.headline2'), - copy: translate('session.assignSelf.overlay.subtitle'), - buttonSet: [ - { - label: translate( - 'session.assignSelf.overlay.button.cancel' - ), - function: OVERLAY_FUNCTIONS.CLOSE, - type: BUTTON_TYPES.SECONDARY - }, - { - label: translate( - 'session.assignSelf.overlay.button.assign' - ), - function: 'ASSIGN', - type: BUTTON_TYPES.PRIMARY - } - ] - }), - [translate] - ); - - const alreadyAssignedSession: OverlayItem = useMemo( - () => ({ - headline: translate('session.alreadyAssigned.overlay.headline'), - buttonSet: [ - { - label: translate( - 'session.alreadyAssigned.overlay.button.cancel' - ), - function: OVERLAY_FUNCTIONS.CLOSE, - type: BUTTON_TYPES.SECONDARY - }, - { - label: translate( - 'session.alreadyAssigned.overlay.button.redirect' - ), - function: OVERLAY_FUNCTIONS.REDIRECT, - type: BUTTON_TYPES.PRIMARY - } - ] - }), - [translate] - ); - - useEffect(() => { - const agencyId = activeSession.item.agencyId.toString(); - if (consultantList && consultantList.length <= 0) { - apiGetAgencyConsultantList(agencyId) - .then((response) => { - const consultants = - prepareConsultantDataForSelect(response); - setConsultantList(consultants); - }) - .catch((error) => { - console.log(error); - }); - } - }, []); // eslint-disable-line react-hooks/exhaustive-deps - - const initOverlays = useCallback(() => { - const overlay = - userData.userId === selectedOption - ? assignSelfOverlay - : assignOtherOverlay; - setOverlayActive(true); - setOverlayItem(overlay); - }, [ - assignOtherOverlay, - assignSelfOverlay, - selectedOption, - userData.userId - ]); - - const handleE2EEAssign = async (sessionId, userId) => { - if (isE2eeEnabled) { - try { - // If already encrypted this will be skipped - await encryptRoom(setE2EEState); - // If room was already encrypted add new users - await addNewUsersToEncryptedRoom(); - await apiDeleteUserFromRoom(sessionId, userId); - } catch (e) { - console.log('error encrypting new user key'); - } - } - }; - - const handleDatalistSelect = (selectedOption) => { - if ( - userData.userId === activeSession?.consultant?.id && - userData.userId === selectedOption.value - ) { - setOverlayItem(alreadyAssignedSession); - } else { - setOverlayItem(assignSession); - } - setOverlayActive(true); - setSelectedOption(selectedOption.value); - }; - - const handleOverlayAction = ( - buttonFunction: string, - buttonArgs: { [key: string]: any } - ) => { - switch (buttonFunction) { - case 'ASSIGN': - setIsRequestInProgress(true); - apiSessionAssign(activeSession.item.id, selectedOption) - .then(() => - handleE2EEAssign(activeSession.item.id, userData.userId) - ) - .then(() => initOverlays()) - .catch((error) => { - if (error === FETCH_ERRORS.CONFLICT) { - return null; - } else console.log(error); - }) - .finally(() => setIsRequestInProgress(false)); - break; - case OVERLAY_FUNCTIONS.REDIRECT: - setOverlayItem(null); - setOverlayActive(false); - history.push( - `/sessions/consultant/sessionView/${activeSession.item.groupId}/${activeSession.item.id}` - ); - break; - case OVERLAY_FUNCTIONS.CLOSE: - if (buttonArgs?.gotoOverview) { - history.push(listPath + getSessionListTab()); - } - setOverlayItem(null); - setOverlayActive(false); - break; - } - }; - - return ( -
- - {requestOverlayVisible && ( - - )} - {e2eeOverlayVisible && ( - - )} - {overlayActive && ( - - )} -
- ); -}; From 18b687670d7b91c7a2f9d0a65fe51d47b92d1dd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deborah=20K=C3=B6pfer?= Date: Thu, 25 Jul 2024 11:54:56 +0200 Subject: [PATCH 11/37] feat(sessionList-filter): removed sessionList filter / feedback filter --- src/api/apiGetConsultantSessionList.ts | 33 ++--- src/components/sessionsList/SessionsList.tsx | 123 ++++--------------- src/resources/i18n/de/common.json | 8 -- src/resources/i18n/en/common.json | 8 -- 4 files changed, 38 insertions(+), 134 deletions(-) diff --git a/src/api/apiGetConsultantSessionList.ts b/src/api/apiGetConsultantSessionList.ts index a21f2f6fe..bf7b50547 100644 --- a/src/api/apiGetConsultantSessionList.ts +++ b/src/api/apiGetConsultantSessionList.ts @@ -7,15 +7,12 @@ import { 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,7 +21,6 @@ export interface ApiGetConsultantSessionListInterface { export const apiGetConsultantSessionList = async ({ type, - filter = INITIAL_FILTER, offset = INITIAL_OFFSET, sessionListTab, count = SESSION_COUNT, @@ -33,25 +29,22 @@ export const apiGetConsultantSessionList = async ({ 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}` - }`; + url = `${sessionListTab === SESSION_LIST_TAB_ARCHIVE + ? `${endpoints.teamSessionsBase}${SESSION_LIST_TAB_ARCHIVE}?` + : `${endpoints.consultantTeamSessions}` + }`; } else if (type === SESSION_LIST_TYPES.MY_SESSION) { - url = `${ - sessionListTab === SESSION_LIST_TAB_ARCHIVE - ? `${endpoints.myMessagesBase}${SESSION_LIST_TAB_ARCHIVE}?` - : `${endpoints.consultantSessions}` - }`; + 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}${sessionListTab && sessionListTab === SESSION_LIST_TAB_ANONYMOUS + ? `${SESSION_LIST_TAB_ANONYMOUS}` + : '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/components/sessionsList/SessionsList.tsx b/src/components/sessionsList/SessionsList.tsx index f35b6807b..9739cb330 100644 --- a/src/components/sessionsList/SessionsList.tsx +++ b/src/components/sessionsList/SessionsList.tsx @@ -39,15 +39,12 @@ import { } from '../../globalState'; import { ListItemInterface, STATUS_EMPTY } from '../../globalState/interfaces'; import { apiPatchUserData } from '../../api/apiPatchUserData'; -import { SelectDropdown, SelectDropdownItem } from '../select/SelectDropdown'; import { SessionListItemComponent } from '../sessionsListItem/SessionListItemComponent'; import { SessionsListSkeleton } from '../sessionsListItem/SessionsListItemSkeleton'; import { apiGetAskerSessionList, apiGetConsultantSessionList, FETCH_ERRORS, - FILTER_FEEDBACK, - INITIAL_FILTER, SESSION_COUNT } from '../../api'; import { Button } from '../button/Button'; @@ -112,9 +109,6 @@ export const SessionsList = ({ unsubscribe, ready: socketReady } = useContext(RocketChatContext); - const [filter, setFilter] = useState< - typeof INITIAL_FILTER | typeof FILTER_FEEDBACK - >(INITIAL_FILTER); const sessionListTab = useSearchParam('sessionListTab'); @@ -160,7 +154,6 @@ export const SessionsList = ({ return apiGetConsultantSessionList({ type, - filter, offset, sessionListTab: sessionListTab, count: count ?? SESSION_COUNT, @@ -199,13 +192,13 @@ export const SessionsList = ({ return { sessions, total }; }); }, - [filter, sessionListTab, type] + [sessionListTab, type] ); useLiveChatWatcher( !isLoading && - type === SESSION_LIST_TYPES.ENQUIRY && - sessionListTab === SESSION_LIST_TAB_ANONYMOUS, + type === SESSION_LIST_TYPES.ENQUIRY && + sessionListTab === SESSION_LIST_TAB_ANONYMOUS, getConsultantSessionList, currentOffset ); @@ -219,15 +212,15 @@ export const SessionsList = ({ ); const firstItemId = document.querySelector('.sessionsListItem') ? document - .querySelector('.sessionsListItem') - .getAttribute('data-group-id') + .querySelector('.sessionsListItem') + .getAttribute('data-group-id') : null; const lastItemId = wrapper.lastElementChild.querySelector( '.sessionsListItem' ) ? wrapper.lastElementChild - .querySelector('.sessionsListItem') - .getAttribute('data-group-id') + .querySelector('.sessionsListItem') + .getAttribute('data-group-id') : null; if ( initialId.current !== firstItemId && @@ -374,7 +367,7 @@ export const SessionsList = ({ sessionTypes.indexOf(sessionType) < 0 || (sessionType === SESSION_TYPE_ARCHIVED && sessionListTab !== - SESSION_LIST_TAB_ARCHIVE) || + SESSION_LIST_TAB_ARCHIVE) || (sessionType !== SESSION_TYPE_ARCHIVED && sessionListTab === SESSION_LIST_TAB_ARCHIVE) ) { @@ -568,27 +561,6 @@ export const SessionsList = ({ unsubscribe ]); - const [showFilter, setShowFilter] = useState(false); - - useEffect(() => { - const showFilter = - type !== SESSION_LIST_TYPES.ENQUIRY && - sessionListTab !== SESSION_LIST_TAB_ARCHIVE && - ((hasUserAuthority(AUTHORITIES.VIEW_ALL_PEER_SESSIONS, userData) && - type === SESSION_LIST_TYPES.TEAMSESSION) || - (hasUserAuthority(AUTHORITIES.USE_FEEDBACK, userData) && - !hasUserAuthority( - AUTHORITIES.VIEW_ALL_PEER_SESSIONS, - userData - ))); - - setShowFilter(showFilter); - - if (!showFilter) { - setFilter(INITIAL_FILTER); - } - }, [sessionListTab, type, userData]); - const loadMoreSessions = useCallback(() => { setIsLoading(true); getConsultantSessionList(currentOffset + SESSION_COUNT) @@ -633,48 +605,11 @@ export const SessionsList = ({ totalItems ]); - const handleSelect = (selectedOption) => { - setCurrentOffset(0); - setFilter(selectedOption.value); - history.push(listPath); - }; - const handleReloadButton = useCallback(() => { setIsReloadButtonVisible(false); loadMoreSessions(); }, [loadMoreSessions]); - const selectedOptionsSet = [ - { - value: FILTER_FEEDBACK, - label: hasUserAuthority( - AUTHORITIES.VIEW_ALL_PEER_SESSIONS, - userData - ) - ? translate('sessionList.filter.option.feedbackMain') - : translate('sessionList.filter.option.feedbackPeer') - }, - { - value: INITIAL_FILTER, - label: translate('sessionList.filter.option.all') - } - ]; - - const preSelectedOption = - selectedOptionsSet.find((option) => option.value === filter) ?? - selectedOptionsSet[1]; - - const selectDropdown: SelectDropdownItem = { - id: 'listFilterSelect', - selectedOptions: selectedOptionsSet, - handleDropdownSelect: handleSelect, - selectInputLabel: translate('sessionList.filter.placeholder'), - useIconOption: false, - isSearchable: false, - menuPlacement: 'bottom', - defaultValue: preSelectedOption - }; - const showEnquiryTabs = useMemo(() => { return ( hasUserAuthority(AUTHORITIES.CONSULTANT_DEFAULT, userData) && @@ -829,7 +764,7 @@ export const SessionsList = ({ return (
- {(showFilter || showEnquiryTabs || showSessionListTabs) && ( + {(showEnquiryTabs || showSessionListTabs) && (
{showEnquiryTabs && (
@@ -880,11 +815,10 @@ export const SessionsList = ({ 'sessionsList__tabs--active': !sessionListTab })} - to={`/sessions/consultant/${ - type === SESSION_LIST_TYPES.TEAMSESSION - ? 'teamSessionView' - : 'sessionView' - }`} + to={`/sessions/consultant/${type === SESSION_LIST_TYPES.TEAMSESSION + ? 'teamSessionView' + : 'sessionView' + }`} onKeyDown={(e) => handleKeyDownTabs(e)} ref={(el) => (ref_tab_first.current = el)} tabIndex={0} @@ -903,11 +837,10 @@ export const SessionsList = ({ sessionListTab === SESSION_LIST_TAB_ARCHIVE })} - to={`/sessions/consultant/${ - type === SESSION_LIST_TYPES.TEAMSESSION - ? 'teamSessionView' - : 'sessionView' - }?sessionListTab=${SESSION_LIST_TAB_ARCHIVE}`} + to={`/sessions/consultant/${type === SESSION_LIST_TYPES.TEAMSESSION + ? 'teamSessionView' + : 'sessionView' + }?sessionListTab=${SESSION_LIST_TAB_ARCHIVE}`} onKeyDown={(e) => handleKeyDownTabs(e)} ref={(el) => (ref_tab_second.current = el)} tabIndex={-1} @@ -923,11 +856,6 @@ export const SessionsList = ({
)} - {showFilter && ( -
- -
- )}
)}
)}
0 - ? '' - : 'sessionsList__itemsWrapper--centered' - }`} + ? '' + : 'sessionsList__itemsWrapper--centered' + }`} data-cy="sessions-list-items-wrapper" role="tablist" > @@ -988,9 +915,9 @@ export const SessionsList = ({ defaultLanguage } itemRef={(el) => - (ref_list_array.current[ - index - ] = el) + (ref_list_array.current[ + index + ] = el) } handleKeyDownLisItemContent={( e diff --git a/src/resources/i18n/de/common.json b/src/resources/i18n/de/common.json index e82b18126..406f9f012 100644 --- a/src/resources/i18n/de/common.json +++ b/src/resources/i18n/de/common.json @@ -2193,14 +2193,6 @@ "mySessions": "Sie haben zurzeit keine aktiven Beratungen", "teamSessions": "Ihr Team hat keine aktiven Beratungen", }, - "filter": { - "option": { - "all": "Alle Beratungen", - "feedbackMain": "Feedback benötigt", - "feedbackPeer": "Feedback vorhanden" - }, - "placeholder": "Filter" - }, "preview": { "anonymous": { "tab": "Live-Chat Anfragen" diff --git a/src/resources/i18n/en/common.json b/src/resources/i18n/en/common.json index ff43397bb..79eeb9bfb 100644 --- a/src/resources/i18n/en/common.json +++ b/src/resources/i18n/en/common.json @@ -2074,14 +2074,6 @@ "mySessions": "You currently have no active consultations", "teamSessions": "Your team has no active consultations" }, - "filter": { - "option": { - "all": "All consultations", - "feedbackMain": "Feedback needed", - "feedbackPeer": "Feedback available" - }, - "placeholder": "Filter" - }, "preview": { "anonymous": { "tab": "Live chat requests" From 65fccb22e28a73250cf9b46eed9b8d63e8405a47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deborah=20K=C3=B6pfer?= Date: Thu, 25 Jul 2024 11:56:45 +0200 Subject: [PATCH 12/37] feat(cypress-fixtures): remove consulting type u25 --- .../fixtures/service.consultingtypes.u25.json | 146 ------------------ 1 file changed, 146 deletions(-) delete mode 100644 cypress/fixtures/service.consultingtypes.u25.json diff --git a/cypress/fixtures/service.consultingtypes.u25.json b/cypress/fixtures/service.consultingtypes.u25.json deleted file mode 100644 index e7e6ca018..000000000 --- a/cypress/fixtures/service.consultingtypes.u25.json +++ /dev/null @@ -1,146 +0,0 @@ -{ - "id": 1, - "titles": { - "default": "U25", - "short": "U25", - "long": "Beratung für suizidgefährdete junge Menschen [U25]", - "welcome": "Willkommen bei der U25-Hilfe", - "registrationDropdown": "Beratung für suizidgefährdete junge Menschen [U25]" - }, - "urls": { - "requiredAidMissingRedirectUrl": "https://www.u25-deutschland.de/helpmail/" - }, - "registration": { - "minPostcodeSize": 5, - "autoSelectAgency": true, - "autoSelectPostcode": true, - "notes": { - "password": "Bitte notiere Dir Deine Zugangsdaten – ein Passwort-Reset ist nicht möglich!" - }, - "mandatoryFields": { - "age": true, - "state": true - } - }, - "isSubsequentRegistrationAllowed": false, - "isAnonymousConversationAllowed": false, - "isSetEmailAllowed": false, - "slug": "u25", - "languageFormal": false, - "lockedAgencies": false, - "whiteSpot": { - "whiteSpotAgencyAssigned": false - }, - "groupChat": { - "isGroupChat": false, - "groupChatRules": [] - }, - "consultantBoundedToConsultingType": false, - "welcomeMessage": { - "sendWelcomeMessage": true, - "welcomeMessageText": "Lorem ipsum" - }, - "sendFurtherStepsMessage": false, - "sendSaveSessionDataMessage": true, - "sessionDataInitializing": { - "addictiveDrugs": false, - "age": true, - "gender": true, - "relation": false, - "state": true - }, - "roles": { - "consultant": { - "main": ["consultant", "u25-consultant", "u25-main-consultant"], - "peer": ["consultant", "u25-consultant"] - } - }, - "notifications": { - "teamSessions": { - "newMessage": { - "allTeamConsultants": false - } - } - }, - "showAskerProfile": true, - "requiredComponents": { - "age": { - "isEnabled": true, - "options": [ - { - "value": "0", - "label": "unter 12" - }, - { - "value": "1", - "label": "12" - }, - { - "value": "2", - "label": "13" - }, - { - "value": "3", - "label": "14" - }, - { - "value": "4", - "label": "15" - }, - { - "value": "5", - "label": "16" - }, - { - "value": "6", - "label": "17" - }, - { - "value": "7", - "label": "18" - }, - { - "value": "8", - "label": "19" - }, - { - "value": "9", - "label": "20" - }, - { - "value": "10", - "label": "21" - }, - { - "value": "11", - "label": "22" - }, - { - "value": "12", - "label": "23" - }, - { - "value": "13", - "label": "24" - }, - { - "value": "14", - "label": "25" - }, - { - "value": "15", - "label": "über 25" - } - ] - }, - "state": { - "isEnabled": true - } - }, - "welcomeScreen": { - "anonymous": { - "title": "Anonym und kostenfrei", - "text": "Du bleibst anonym und erhältst kostenfreie Beratung und Hilfe" - } - } -} From 2e6e119cf9cbe341f409ddc274adaed2b734e3b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deborah=20K=C3=B6pfer?= Date: Thu, 25 Jul 2024 12:06:07 +0200 Subject: [PATCH 13/37] style(removed-feedback-features): prettier fixes --- src/api/apiGetConsultantSessionList.ts | 27 +- src/components/askerInfo/AskerInfoContent.tsx | 8 +- src/components/devToolbar/DevToolbar.tsx | 2 +- src/components/form/textarea.styles.scss | 8 +- src/components/message/MessageDisplayName.tsx | 4 +- .../message/MessageItemComponent.tsx | 25 +- src/components/message/message.styles.scss | 13 +- .../messageSubmitInterfaceComponent.tsx | 35 +- src/components/session/AcceptLiveChatView.tsx | 7 +- .../session/SessionItemComponent.tsx | 23 +- src/components/session/sessionHelpers.ts | 6 +- .../sessionHeader/SessionHeaderComponent.tsx | 83 +++-- .../sessionHeader/sessionHeader.styles.scss | 8 +- src/components/sessionMenu/SessionMenu.tsx | 5 +- src/components/sessionsList/SessionsList.tsx | 49 +-- .../sessionsList/SessionsListWrapper.tsx | 7 +- .../SessionListItemComponent.tsx | 13 +- .../sessionsListItem.styles.scss | 14 +- src/generated/messageservice.d.ts | 72 ++-- src/generated/uploadservice.d.ts | 24 +- src/generated/userservice.d.ts | 352 +++++++++--------- src/globalState/helpers/stateHelpers.ts | 8 +- .../interfaces/SessionsDataInterface.ts | 10 +- .../provider/RocketChatUnreadProvider.tsx | 4 +- src/resources/i18n/de/common.json | 2 +- src/resources/scripts/config.ts | 4 +- src/resources/styles/settings.scss | 10 +- 27 files changed, 412 insertions(+), 411 deletions(-) diff --git a/src/api/apiGetConsultantSessionList.ts b/src/api/apiGetConsultantSessionList.ts index bf7b50547..dd2383185 100644 --- a/src/api/apiGetConsultantSessionList.ts +++ b/src/api/apiGetConsultantSessionList.ts @@ -29,20 +29,23 @@ export const apiGetConsultantSessionList = async ({ 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}` - }`; + url = `${ + sessionListTab === SESSION_LIST_TAB_ARCHIVE + ? `${endpoints.teamSessionsBase}${SESSION_LIST_TAB_ARCHIVE}?` + : `${endpoints.consultantTeamSessions}` + }`; } else if (type === SESSION_LIST_TYPES.MY_SESSION) { - url = `${sessionListTab === SESSION_LIST_TAB_ARCHIVE - ? `${endpoints.myMessagesBase}${SESSION_LIST_TAB_ARCHIVE}?` - : `${endpoints.consultantSessions}` - }`; + 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}${ + sessionListTab && sessionListTab === SESSION_LIST_TAB_ANONYMOUS + ? `${SESSION_LIST_TAB_ANONYMOUS}` + : 'registered' + }?`; } url = url + `count=${count}&filter=all&offset=${offset}`; diff --git a/src/components/askerInfo/AskerInfoContent.tsx b/src/components/askerInfo/AskerInfoContent.tsx index 286e1dd1f..2fc88ba24 100644 --- a/src/components/askerInfo/AskerInfoContent.tsx +++ b/src/components/askerInfo/AskerInfoContent.tsx @@ -34,11 +34,9 @@ export const AskerInfoContent = () => { } if (isEnquiryListView) { - return ( - hasUserAuthority( - AUTHORITIES.ASSIGN_CONSULTANT_TO_ENQUIRY, - userData - ) + return hasUserAuthority( + AUTHORITIES.ASSIGN_CONSULTANT_TO_ENQUIRY, + userData ); } diff --git a/src/components/devToolbar/DevToolbar.tsx b/src/components/devToolbar/DevToolbar.tsx index a7a6e7e7e..5d2284c24 100644 --- a/src/components/devToolbar/DevToolbar.tsx +++ b/src/components/devToolbar/DevToolbar.tsx @@ -219,7 +219,7 @@ const LOCAL_STORAGE_SWITCHES: (TLocalStorageSwitches | null)[] = [ i18n.changeLanguage( value === 'cimode' ? 'cimode' - : localStorage.getItem(STORAGE_KEY_LOCALE) ?? 'de' + : (localStorage.getItem(STORAGE_KEY_LOCALE) ?? 'de') ); } }, diff --git a/src/components/form/textarea.styles.scss b/src/components/form/textarea.styles.scss index 8834d1ef9..fc1ba3add 100644 --- a/src/components/form/textarea.styles.scss +++ b/src/components/form/textarea.styles.scss @@ -49,8 +49,8 @@ color: transparent; } - &:focus+label, - &:not(:placeholder-shown)+label { + &:focus + label, + &:not(:placeholder-shown) + label { font-size: 12px; top: 2px; transition: @@ -60,7 +60,7 @@ padding-top: $grid-base; } - &:placeholder-shown+label { + &:placeholder-shown + label { top: 4px; } } @@ -79,4 +79,4 @@ } /* stylelint-enable */ -} \ No newline at end of file +} diff --git a/src/components/message/MessageDisplayName.tsx b/src/components/message/MessageDisplayName.tsx index da60cc6e8..5403789ff 100644 --- a/src/components/message/MessageDisplayName.tsx +++ b/src/components/message/MessageDisplayName.tsx @@ -40,9 +40,9 @@ export const MessageDisplayName = ({ } else { return subscriberIsModerator ? translate('session.groupChat.consultant.prefix') + - (displayName || username) + (displayName || username) : translate('session.consultant.prefix') + - (displayName || username); + (displayName || username); } }, [ displayName, diff --git a/src/components/message/MessageItemComponent.tsx b/src/components/message/MessageItemComponent.tsx index 486d9f2a2..bb7aa4ca3 100644 --- a/src/components/message/MessageItemComponent.tsx +++ b/src/components/message/MessageItemComponent.tsx @@ -202,9 +202,9 @@ export const MessageItemComponent = ({ setRenderedMessage( contentStateMessage.hasText() ? sanitizeHtml( - urlifyLinksInText(stateToHTML(contentStateMessage)), - sanitizeHtmlDefaultOptions - ) + urlifyLinksInText(stateToHTML(contentStateMessage)), + sanitizeHtmlDefaultOptions + ) : '' ); }, [decryptedMessage]); @@ -464,7 +464,9 @@ export const MessageItemComponent = ({
{getMessageDate()}
diff --git a/src/components/message/message.styles.scss b/src/components/message/message.styles.scss index 901a14f0c..ca70b459d 100644 --- a/src/components/message/message.styles.scss +++ b/src/components/message/message.styles.scss @@ -118,7 +118,8 @@ $message-attachment-color: $secondary !default; &::after { content: ''; display: inline-block; - border-top: 1px solid var(--skin-color-secondary-contrast-safe, $text-divider-color); + border-top: 1px solid + var(--skin-color-secondary-contrast-safe, $text-divider-color); width: $grid-base-three; vertical-align: middle; margin: 0 $grid-base; @@ -134,7 +135,7 @@ $message-attachment-color: $secondary !default; } } - &+.messageItem__divider { + & + .messageItem__divider { margin-top: 12px; } } @@ -189,11 +190,11 @@ $message-attachment-color: $secondary !default; display: flex; flex-direction: column; - &>* { + & > * { margin-top: $grid-base; } - &>*:first-child { + & > *:first-child { margin-top: 0; } } @@ -496,7 +497,6 @@ $message-attachment-color: $secondary !default; } @keyframes success { - 100%, 0% { transform: translate(-50%, 0) scale(0); @@ -511,7 +511,6 @@ $message-attachment-color: $secondary !default; } @keyframes successCopyReverse { - 100%, 0% { transform: scale(1); @@ -523,4 +522,4 @@ $message-attachment-color: $secondary !default; transform: scale(0); opacity: 0; } -} \ No newline at end of file +} diff --git a/src/components/messageSubmitInterface/messageSubmitInterfaceComponent.tsx b/src/components/messageSubmitInterface/messageSubmitInterfaceComponent.tsx index abf8bf813..04b4791be 100644 --- a/src/components/messageSubmitInterface/messageSubmitInterfaceComponent.tsx +++ b/src/components/messageSubmitInterface/messageSubmitInterfaceComponent.tsx @@ -180,7 +180,7 @@ export const MessageSubmitInterfaceComponent = ({ const [isRichtextActive, setIsRichtextActive] = useState(false); const [isConsultantAbsent, setIsConsultantAbsent] = useState( hasUserAuthority(AUTHORITIES.ASKER_DEFAULT, userData) && - activeSession.consultant?.absent + activeSession.consultant?.absent ); const [isSessionArchived, setIsSessionArchived] = useState( activeSession.item.status === STATUS_ARCHIVED @@ -234,7 +234,7 @@ export const MessageSubmitInterfaceComponent = ({ useTimeoutOverlay( // Disable the request overlay if upload is in progess because upload progress is shown in the ui already isRequestInProgress && - !(uploadProgress > 0 && uploadProgress < 100), + !(uploadProgress > 0 && uploadProgress < 100), null, null, null, @@ -244,13 +244,13 @@ export const MessageSubmitInterfaceComponent = ({ useEffect(() => { setIsConsultantAbsent( hasUserAuthority(AUTHORITIES.ASKER_DEFAULT, userData) && - activeSession.consultant?.absent + activeSession.consultant?.absent ); setIsSessionArchived(activeSession.item.status === STATUS_ARCHIVED); setIsTypingActive(activeSession.isGroup || activeSession.isLive); setIsLiveChatFinished( activeSession.isLive && - activeSession.item.status === STATUS_FINISHED + activeSession.item.status === STATUS_FINISHED ); }, [activeSession, activeSession.item.status, userData]); @@ -373,7 +373,7 @@ export const MessageSubmitInterfaceComponent = ({ if ( draftLoaded && currentEditorState.getCurrentContent() !== - editorState.getCurrentContent() && + editorState.getCurrentContent() && isTyping ) { isTyping(!currentEditorState.getCurrentContent().hasText()); @@ -441,11 +441,11 @@ export const MessageSubmitInterfaceComponent = ({ let textInputStyles = `min-height: ${currentInputHeight}px; ${currentOverflow} ${textInputMarginTop} ${textInputMarginBottom}`; textInputStyles = isRichtextActive ? textInputStyles + - `border-top: none; border-top-right-radius: 0; box-shadow: none;` + `border-top: none; border-top-right-radius: 0; box-shadow: none;` : textInputStyles; textInputStyles = attachmentSelected ? textInputStyles + - `border-bottom: none; border-bottom-right-radius: 0;` + `border-bottom: none; border-bottom-right-radius: 0;` : textInputStyles; textInput?.setAttribute('style', textInputStyles); @@ -504,11 +504,7 @@ export const MessageSubmitInterfaceComponent = ({ }, [onMessageSendSuccess, resizeTextarea]); const sendMessage = useCallback( - async ( - message, - attachment: File, - isEncrypted - ) => { + async (message, attachment: File, isEncrypted) => { const sendToRoomWithId = activeSession.rid || activeSession.item.id; const getSendMailNotificationStatus = () => !activeSession.isGroup && !activeSession.isLive; @@ -665,11 +661,7 @@ export const MessageSubmitInterfaceComponent = ({ return; } - await sendMessage( - message, - attachment, - isEncrypted - ); + await sendMessage(message, attachment, isEncrypted); }, [ encrypted, getTypedMarkdownMessage, @@ -781,10 +773,11 @@ export const MessageSubmitInterfaceComponent = ({ const contact = getContact(activeSession); infoData = { isInfo: true, - infoHeadline: `${contact?.displayName || + infoHeadline: `${ + contact?.displayName || contact?.username || translate('sessionList.user.consultantUnknown') - } ${translate('consultant.absent.message')} `, + } ${translate('consultant.absent.message')} `, infoMessage: activeSession.consultant.absenceMessage }; } else if (activeInfo === INFO_TYPES.ATTACHMENT_SIZE_ERROR) { @@ -886,9 +879,7 @@ export const MessageSubmitInterfaceComponent = ({ )} {activeInfo && } {!isLiveChatFinished && ( - +
diff --git a/src/components/session/AcceptLiveChatView.tsx b/src/components/session/AcceptLiveChatView.tsx index 977f3c6da..86cd2db8a 100644 --- a/src/components/session/AcceptLiveChatView.tsx +++ b/src/components/session/AcceptLiveChatView.tsx @@ -76,9 +76,10 @@ export const AcceptLiveChatView = ({ semanticLevel="3" text={`${translate( 'enquiry.anonymous.infoLabel.start' - )}${getContact(activeSession)?.username || - translate('sessionList.user.consultantUnknown') - }${translate('enquiry.anonymous.infoLabel.end')}`} + )}${ + getContact(activeSession)?.username || + translate('sessionList.user.consultantUnknown') + }${translate('enquiry.anonymous.infoLabel.end')}`} />
diff --git a/src/components/session/SessionItemComponent.tsx b/src/components/session/SessionItemComponent.tsx index 7dca7e695..7fe93dea3 100644 --- a/src/components/session/SessionItemComponent.tsx +++ b/src/components/session/SessionItemComponent.tsx @@ -82,9 +82,7 @@ export const SessionItemComponent = (props: SessionItemProps) => { ); useEffect(() => { - setCanWriteMessage( - type !== SESSION_LIST_TYPES.ENQUIRY - ); + setCanWriteMessage(type !== SESSION_LIST_TYPES.ENQUIRY); }, [type, userData]); const resetUnreadCount = () => { @@ -310,7 +308,7 @@ export const SessionItemComponent = (props: SessionItemProps) => { if ( trackedErrorIndex >= 0 && acc[trackedErrorIndex][1].message === - collectedError.message + collectedError.message ) { if (timestamp > acc[trackedErrorIndex][0]) { acc.splice( @@ -343,14 +341,12 @@ export const SessionItemComponent = (props: SessionItemProps) => { ); return ( -
+
{ ))}
{newMessages > 0 && ( @@ -452,7 +449,7 @@ export const SessionItemComponent = (props: SessionItemProps) => { className={clsx( 'session__submit-interface', !isScrolledToBottom && - 'session__submit-interface--scrolled-up' + 'session__submit-interface--scrolled-up' )} placeholder={getPlaceholder()} typingUsers={props.typingUsers} diff --git a/src/components/session/sessionHelpers.ts b/src/components/session/sessionHelpers.ts index dd58d0139..7e845cde4 100644 --- a/src/components/session/sessionHelpers.ts +++ b/src/components/session/sessionHelpers.ts @@ -96,9 +96,7 @@ export const isLiveChat = ( export const isGroupChat = ( chatItem: SessionItemInterface | GroupChatItemInterface ): chatItem is GroupChatItemInterface => { - return ( - (chatItem as GroupChatItemInterface) && 'moderators' in chatItem - ); + return (chatItem as GroupChatItemInterface) && 'moderators' in chatItem; }; export const isTeamSession = ( @@ -176,7 +174,7 @@ const findLastVideoCallIndex = (messagesData) => message?.alias?.messageType === 'VIDEOCALL' && (!message?.alias?.videoCallMessageDTO || message?.alias?.videoCallMessageDTO?.eventType !== - 'IGNORED_CALL') + 'IGNORED_CALL') ); export const prepareMessages = (messagesData): MessageItem[] => { diff --git a/src/components/sessionHeader/SessionHeaderComponent.tsx b/src/components/sessionHeader/SessionHeaderComponent.tsx index 882e9b891..408943bb8 100644 --- a/src/components/sessionHeader/SessionHeaderComponent.tsx +++ b/src/components/sessionHeader/SessionHeaderComponent.tsx @@ -61,8 +61,8 @@ export const SessionHeaderComponent = (props: SessionHeaderProps) => { const preparedUserSessionData = hasUserAuthority(AUTHORITIES.CONSULTANT_DEFAULT, userData) && - userSessionData && - !activeSession.isLive + userSessionData && + !activeSession.isLive ? convertUserDataObjectToArray(userSessionData) : null; const translateBase = getUserDataTranslateBase( @@ -84,8 +84,9 @@ export const SessionHeaderComponent = (props: SessionHeaderProps) => { }, [isSubscriberFlyoutOpen]); const sessionView = getViewPathForType(type); - const userProfileLink = `/sessions/consultant/${sessionView}/${activeSession.item.groupId - }/${activeSession.item.id}/userProfile${getSessionListTab()}`; + const userProfileLink = `/sessions/consultant/${sessionView}/${ + activeSession.item.groupId + }/${activeSession.item.id}/userProfile${getSessionListTab()}`; const handleBackButton = () => { mobileListView(); @@ -150,12 +151,12 @@ export const SessionHeaderComponent = (props: SessionHeaderProps) => { AUTHORITIES.ANONYMOUS_DEFAULT, userData )) && ( -

- {contact?.displayName || - contact?.username || - translate('sessionList.user.consultantUnknown')} -

- )} +

+ {contact?.displayName || + contact?.username || + translate('sessionList.user.consultantUnknown')} +

+ )} {hasUserAuthority( AUTHORITIES.CONSULTANT_DEFAULT, userData @@ -190,18 +191,18 @@ export const SessionHeaderComponent = (props: SessionHeaderProps) => { {(hasUserAuthority(AUTHORITIES.ASKER_DEFAULT, userData) || hasUserAuthority(AUTHORITIES.CONSULTANT_DEFAULT, userData)) && ( -
- {!activeSession.agency ? ( -
- {topic?.name || ''} -
- ) : null} - {preparedUserSessionData - ? preparedUserSessionData.map((item, index) => +
+ {!activeSession.agency ? ( +
+ {topic?.name || ''} +
+ ) : null} + {preparedUserSessionData + ? preparedUserSessionData.map((item, index) => item.value && - !( - item.type === 'age' && item.value === 'null' - ) ? ( + !( + item.type === 'age' && item.value === 'null' + ) ? (
{
) : null ) - : null} - {activeSession.agency?.name && ( -
- {' '} - {translate( - [ - `agency.${activeSession.agency.id}.name`, - activeSession.agency.name - ], - { ns: 'agencies' } - )}{' '} -
- )} - {activeSession.agency && ( -
- {translate('consultant.jobTitle')} -
- )} -
- )} + : null} + {activeSession.agency?.name && ( +
+ {' '} + {translate( + [ + `agency.${activeSession.agency.id}.name`, + activeSession.agency.name + ], + { ns: 'agencies' } + )}{' '} +
+ )} + {activeSession.agency && ( +
+ {translate('consultant.jobTitle')} +
+ )} +
+ )}
); }; diff --git a/src/components/sessionHeader/sessionHeader.styles.scss b/src/components/sessionHeader/sessionHeader.styles.scss index 491f14422..d7cef697a 100644 --- a/src/components/sessionHeader/sessionHeader.styles.scss +++ b/src/components/sessionHeader/sessionHeader.styles.scss @@ -140,8 +140,10 @@ $iconSize: 24px; } &--red { - color: var(--skin-color-primary-contrast-safe, - $primary) !important; + color: var( + --skin-color-primary-contrast-safe, + $primary + ) !important; text-transform: uppercase; } @@ -255,4 +257,4 @@ $iconSize: 24px; } } } -} \ No newline at end of file +} diff --git a/src/components/sessionMenu/SessionMenu.tsx b/src/components/sessionMenu/SessionMenu.tsx index bdcbb7854..2f48a0bca 100644 --- a/src/components/sessionMenu/SessionMenu.tsx +++ b/src/components/sessionMenu/SessionMenu.tsx @@ -466,8 +466,9 @@ export const SessionMenu = (props: SessionMenuProps) => {
{activeSession.isLive && activeSession.item.status !== STATUS_FINISHED && diff --git a/src/components/sessionsList/SessionsList.tsx b/src/components/sessionsList/SessionsList.tsx index 9739cb330..ab15f2873 100644 --- a/src/components/sessionsList/SessionsList.tsx +++ b/src/components/sessionsList/SessionsList.tsx @@ -197,8 +197,8 @@ export const SessionsList = ({ useLiveChatWatcher( !isLoading && - type === SESSION_LIST_TYPES.ENQUIRY && - sessionListTab === SESSION_LIST_TAB_ANONYMOUS, + type === SESSION_LIST_TYPES.ENQUIRY && + sessionListTab === SESSION_LIST_TAB_ANONYMOUS, getConsultantSessionList, currentOffset ); @@ -212,15 +212,15 @@ export const SessionsList = ({ ); const firstItemId = document.querySelector('.sessionsListItem') ? document - .querySelector('.sessionsListItem') - .getAttribute('data-group-id') + .querySelector('.sessionsListItem') + .getAttribute('data-group-id') : null; const lastItemId = wrapper.lastElementChild.querySelector( '.sessionsListItem' ) ? wrapper.lastElementChild - .querySelector('.sessionsListItem') - .getAttribute('data-group-id') + .querySelector('.sessionsListItem') + .getAttribute('data-group-id') : null; if ( initialId.current !== firstItemId && @@ -367,7 +367,7 @@ export const SessionsList = ({ sessionTypes.indexOf(sessionType) < 0 || (sessionType === SESSION_TYPE_ARCHIVED && sessionListTab !== - SESSION_LIST_TAB_ARCHIVE) || + SESSION_LIST_TAB_ARCHIVE) || (sessionType !== SESSION_TYPE_ARCHIVED && sessionListTab === SESSION_LIST_TAB_ARCHIVE) ) { @@ -815,10 +815,11 @@ export const SessionsList = ({ 'sessionsList__tabs--active': !sessionListTab })} - to={`/sessions/consultant/${type === SESSION_LIST_TYPES.TEAMSESSION - ? 'teamSessionView' - : 'sessionView' - }`} + to={`/sessions/consultant/${ + type === SESSION_LIST_TYPES.TEAMSESSION + ? 'teamSessionView' + : 'sessionView' + }`} onKeyDown={(e) => handleKeyDownTabs(e)} ref={(el) => (ref_tab_first.current = el)} tabIndex={0} @@ -837,10 +838,11 @@ export const SessionsList = ({ sessionListTab === SESSION_LIST_TAB_ARCHIVE })} - to={`/sessions/consultant/${type === SESSION_LIST_TYPES.TEAMSESSION - ? 'teamSessionView' - : 'sessionView' - }?sessionListTab=${SESSION_LIST_TAB_ARCHIVE}`} + to={`/sessions/consultant/${ + type === SESSION_LIST_TYPES.TEAMSESSION + ? 'teamSessionView' + : 'sessionView' + }?sessionListTab=${SESSION_LIST_TAB_ARCHIVE}`} onKeyDown={(e) => handleKeyDownTabs(e)} ref={(el) => (ref_tab_second.current = el)} tabIndex={-1} @@ -870,17 +872,18 @@ export const SessionsList = ({ {hasUserAuthority(AUTHORITIES.ASKER_DEFAULT, userData) && !isLoading && finalSessionsList.length <= - MAX_ITEMS_TO_SHOW_WELCOME_ILLUSTRATION && ( + MAX_ITEMS_TO_SHOW_WELCOME_ILLUSTRATION && ( )}
0 - ? '' - : 'sessionsList__itemsWrapper--centered' - }`} + ? '' + : 'sessionsList__itemsWrapper--centered' + }`} data-cy="sessions-list-items-wrapper" role="tablist" > @@ -915,9 +918,9 @@ export const SessionsList = ({ defaultLanguage } itemRef={(el) => - (ref_list_array.current[ - index - ] = el) + (ref_list_array.current[ + index + ] = el) } handleKeyDownLisItemContent={( e diff --git a/src/components/sessionsList/SessionsListWrapper.tsx b/src/components/sessionsList/SessionsListWrapper.tsx index f76ccbe1d..54c54f0df 100644 --- a/src/components/sessionsList/SessionsListWrapper.tsx +++ b/src/components/sessionsList/SessionsListWrapper.tsx @@ -75,14 +75,15 @@ export const SessionsListWrapper = ({ : null} {type === SESSION_LIST_TYPES.MY_SESSION && - hasUserAuthority(AUTHORITIES.CREATE_NEW_CHAT, userData) ? ( + hasUserAuthority(AUTHORITIES.CREATE_NEW_CHAT, userData) ? ( { if (activeSession.item.groupId && activeSession.item.id !== undefined) { history.push( - `${listPath}/${activeSession.item.groupId}/${activeSession.item.id + `${listPath}/${activeSession.item.groupId}/${ + activeSession.item.id }${getSessionListTab()}` ); } else if ( @@ -292,7 +293,7 @@ export const SessionListItemComponent = ({ className={clsx( 'sessionsListItem__username', activeSession.item.messagesRead && - 'sessionsListItem__username--readLabel' + 'sessionsListItem__username--readLabel' )} > {activeSession.item.topic} @@ -362,8 +363,8 @@ export const SessionListItemComponent = ({
{!isAsker && - !activeSession.isLive && - !autoSelectPostcode + !activeSession.isLive && + !autoSelectPostcode ? activeSession.item.postcode : null}
@@ -394,7 +395,7 @@ export const SessionListItemComponent = ({ className={clsx( 'sessionsListItem__username', activeSession.item.messagesRead && - 'sessionsListItem__username--readLabel' + 'sessionsListItem__username--readLabel' )} > {sessionTopic} diff --git a/src/components/sessionsListItem/sessionsListItem.styles.scss b/src/components/sessionsListItem/sessionsListItem.styles.scss index 374f7b7f5..fbbe492b1 100644 --- a/src/components/sessionsListItem/sessionsListItem.styles.scss +++ b/src/components/sessionsListItem/sessionsListItem.styles.scss @@ -213,7 +213,7 @@ $icon-size-small: 16px; font-style: italic !important; } - &>span { + & > span { display: inline-block; font-style: normal; font-weight: $font-weight-bold; @@ -267,10 +267,12 @@ $icon-size-small: 16px; background-color: $dark-grey; width: 100%; min-height: 18px; - background: linear-gradient(-90deg, - $dark-grey 0%, - $session-list-item-background-active 50%, - $dark-grey 100%); + background: linear-gradient( + -90deg, + $dark-grey 0%, + $session-list-item-background-active 50%, + $dark-grey 100% + ); background-size: 400% 400%; animation: pulse 1.2s ease-in-out infinite; @@ -310,4 +312,4 @@ $icon-size-small: 16px; .skeleton { margin-top: 0; } -} \ No newline at end of file +} diff --git a/src/generated/messageservice.d.ts b/src/generated/messageservice.d.ts index 774d33ef9..0134007bf 100644 --- a/src/generated/messageservice.d.ts +++ b/src/generated/messageservice.d.ts @@ -186,11 +186,11 @@ declare namespace Paths { } export type RequestBody = MessageService.Schemas.MessageDTO; namespace Responses { - export interface $201 { } - export interface $400 { } - export interface $401 { } - export interface $403 { } - export interface $500 { } + export interface $201 {} + export interface $400 {} + export interface $401 {} + export interface $403 {} + export interface $500 {} } } namespace CreateVideoHintMessage { @@ -202,11 +202,11 @@ declare namespace Paths { } export type RequestBody = MessageService.Schemas.VideoCallMessageDTO; namespace Responses { - export interface $201 { } - export interface $400 { } - export interface $401 { } - export interface $403 { } - export interface $500 { } + export interface $201 {} + export interface $400 {} + export interface $401 {} + export interface $403 {} + export interface $500 {} } } namespace FindDraftMessage { @@ -218,11 +218,11 @@ declare namespace Paths { } namespace Responses { export type $200 = string; - export interface $204 { } - export interface $400 { } - export interface $401 { } - export interface $403 { } - export interface $500 { } + export interface $204 {} + export interface $400 {} + export interface $401 {} + export interface $403 {} + export interface $500 {} } } @@ -241,11 +241,11 @@ declare namespace Paths { } namespace Responses { export type $200 = MessageService.Schemas.MessageStreamDTO; - export interface $204 { } - export interface $400 { } - export interface $401 { } - export interface $403 { } - export interface $500 { } + export interface $204 {} + export interface $400 {} + export interface $401 {} + export interface $403 {} + export interface $500 {} } } namespace SaveAliasOnlyMessage { @@ -257,11 +257,11 @@ declare namespace Paths { } export type RequestBody = MessageService.Schemas.AliasOnlyMessageDTO; namespace Responses { - export interface $201 { } - export interface $400 { } - export interface $401 { } - export interface $403 { } - export interface $500 { } + export interface $201 {} + export interface $400 {} + export interface $401 {} + export interface $403 {} + export interface $500 {} } } namespace SaveDraftMessage { @@ -273,22 +273,22 @@ declare namespace Paths { } export type RequestBody = string; namespace Responses { - export interface $200 { } - export interface $201 { } - export interface $400 { } - export interface $401 { } - export interface $403 { } - export interface $500 { } + export interface $200 {} + export interface $201 {} + export interface $400 {} + export interface $401 {} + export interface $403 {} + export interface $500 {} } } namespace UpdateKey { export type RequestBody = MessageService.Schemas.MasterKeyDTO; namespace Responses { - export interface $202 { } - export interface $401 { } - export interface $403 { } - export interface $409 { } - export interface $500 { } + export interface $202 {} + export interface $401 {} + export interface $403 {} + export interface $409 {} + export interface $500 {} } } } diff --git a/src/generated/uploadservice.d.ts b/src/generated/uploadservice.d.ts index ceda09f4d..6fb37da0e 100644 --- a/src/generated/uploadservice.d.ts +++ b/src/generated/uploadservice.d.ts @@ -13,11 +13,11 @@ declare namespace Paths { namespace UpdateKey { export type RequestBody = UploadService.Schemas.MasterKeyDto; namespace Responses { - export interface $202 { } - export interface $401 { } - export interface $403 { } - export interface $409 { } - export interface $500 { } + export interface $202 {} + export interface $401 {} + export interface $403 {} + export interface $409 {} + export interface $500 {} } } @@ -57,13 +57,13 @@ declare namespace Paths { sendNotification: string; } namespace Responses { - export interface $201 { } - export interface $400 { } - export interface $401 { } - export interface $403 { } - export interface $413 { } - export interface $415 { } - export interface $500 { } + export interface $201 {} + export interface $400 {} + export interface $401 {} + export interface $403 {} + export interface $413 {} + export interface $415 {} + export interface $500 {} } } } diff --git a/src/generated/userservice.d.ts b/src/generated/userservice.d.ts index 8ccae7376..aea1caf63 100644 --- a/src/generated/userservice.d.ts +++ b/src/generated/userservice.d.ts @@ -234,7 +234,7 @@ declare namespace UserService { */ groupId: string; } - export interface Date { } + export interface Date {} export interface DeleteUserAccountDTO { /** * example: @@ -250,7 +250,7 @@ declare namespace UserService { message: string; } - export interface HttpStatus { } + export interface HttpStatus {} export interface MandatorySessionDataDTO { /** * mandatory depending on the consulting type @@ -754,12 +754,12 @@ declare namespace Paths { sessionId: Parameters.SessionId /* int64 */; } namespace Responses { - export interface $200 { } - export interface $400 { } - export interface $401 { } - export interface $403 { } - export interface $409 { } - export interface $500 { } + export interface $200 {} + export interface $400 {} + export interface $401 {} + export interface $403 {} + export interface $409 {} + export interface $500 {} } } namespace AssignSession { @@ -772,22 +772,22 @@ declare namespace Paths { consultantId: Parameters.ConsultantId; } namespace Responses { - export interface $200 { } - export interface $400 { } - export interface $401 { } - export interface $403 { } - export interface $409 { } - export interface $500 { } + export interface $200 {} + export interface $400 {} + export interface $401 {} + export interface $403 {} + export interface $409 {} + export interface $500 {} } } namespace CreateChat { export type RequestBody = UserService.Schemas.ChatDTO; namespace Responses { export type $201 = UserService.Schemas.CreateChatResponseDTO; - export interface $400 { } - export interface $403 { } - export interface $409 { } - export interface $500 { } + export interface $400 {} + export interface $403 {} + export interface $409 {} + export interface $500 {} } } namespace CreateEnquiryMessage { @@ -805,22 +805,22 @@ declare namespace Paths { } export type RequestBody = UserService.Schemas.EnquiryMessageDTO; namespace Responses { - export interface $201 { } - export interface $400 { } - export interface $401 { } - export interface $403 { } - export interface $409 { } - export interface $500 { } + export interface $201 {} + export interface $400 {} + export interface $401 {} + export interface $403 {} + export interface $409 {} + export interface $500 {} } } namespace DeactivateAndFlagUserAccountForDeletion { export type RequestBody = UserService.Schemas.DeleteUserAccountDTO; namespace Responses { - export interface $200 { } - export interface $400 { } - export interface $401 { } - export interface $403 { } - export interface $500 { } + export interface $200 {} + export interface $400 {} + export interface $401 {} + export interface $403 {} + export interface $500 {} } } namespace FetchSessionForConsultant { @@ -832,11 +832,11 @@ declare namespace Paths { } namespace Responses { export type $200 = UserService.Schemas.ConsultantSessionDTO; - export interface $400 { } - export interface $401 { } - export interface $403 { } - export interface $404 { } - export interface $500 { } + export interface $400 {} + export interface $401 {} + export interface $403 {} + export interface $404 {} + export interface $500 {} } } namespace GetChat { @@ -848,11 +848,11 @@ declare namespace Paths { } namespace Responses { export type $200 = UserService.Schemas.ChatInfoResponseDTO; - export interface $400 { } - export interface $401 { } - export interface $403 { } - export interface $404 { } - export interface $500 { } + export interface $400 {} + export interface $401 {} + export interface $403 {} + export interface $404 {} + export interface $500 {} } } namespace GetChatMembers { @@ -864,12 +864,12 @@ declare namespace Paths { } namespace Responses { export type $200 = UserService.Schemas.ChatMembersResponseDTO; - export interface $400 { } - export interface $401 { } - export interface $403 { } - export interface $404 { } - export interface $409 { } - export interface $500 { } + export interface $400 {} + export interface $401 {} + export interface $403 {} + export interface $404 {} + export interface $409 {} + export interface $500 {} } } namespace GetConsultants { @@ -881,11 +881,11 @@ declare namespace Paths { } namespace Responses { export type $200 = UserService.Schemas.ConsultantResponseDTO[]; - export interface $204 { } - export interface $400 { } - export interface $401 { } - export interface $403 { } - export interface $500 { } + export interface $204 {} + export interface $400 {} + export interface $401 {} + export interface $403 {} + export interface $500 {} } } namespace GetMonitoring { @@ -897,11 +897,11 @@ declare namespace Paths { } namespace Responses { export type $200 = UserService.Schemas.MonitoringDTO; - export interface $204 { } - export interface $400 { } - export interface $401 { } - export interface $403 { } - export interface $500 { } + export interface $204 {} + export interface $400 {} + export interface $401 {} + export interface $403 {} + export interface $500 {} } } namespace GetSessionsForAuthenticatedConsultant { @@ -924,10 +924,10 @@ declare namespace Paths { namespace Responses { export type $200 = UserService.Schemas.ConsultantSessionListResponseDTO; - export interface $204 { } - export interface $401 { } - export interface $403 { } - export interface $500 { } + export interface $204 {} + export interface $401 {} + export interface $403 {} + export interface $500 {} } } namespace GetSessionsForAuthenticatedUser { @@ -939,11 +939,11 @@ declare namespace Paths { } namespace Responses { export type $200 = UserService.Schemas.UserSessionListResponseDTO; - export interface $204 { } - export interface $400 { } - export interface $401 { } - export interface $403 { } - export interface $500 { } + export interface $204 {} + export interface $400 {} + export interface $401 {} + export interface $403 {} + export interface $500 {} } } namespace GetTeamSessionsForAuthenticatedConsultant { @@ -964,43 +964,43 @@ declare namespace Paths { namespace Responses { export type $200 = UserService.Schemas.ConsultantSessionListResponseDTO; - export interface $204 { } - export interface $401 { } - export interface $403 { } - export interface $500 { } + export interface $204 {} + export interface $401 {} + export interface $403 {} + export interface $500 {} } } namespace GetUserData { namespace Responses { export type $200 = UserService.Schemas.UserDataResponseDTO; - export interface $400 { } - export interface $401 { } - export interface $403 { } - export interface $500 { } + export interface $400 {} + export interface $401 {} + export interface $403 {} + export interface $500 {} } } namespace ImportAskers { namespace Responses { - export interface $200 { } - export interface $400 { } - export interface $401 { } - export interface $500 { } + export interface $200 {} + export interface $400 {} + export interface $401 {} + export interface $500 {} } } namespace ImportAskersWithoutSession { namespace Responses { - export interface $200 { } - export interface $400 { } - export interface $401 { } - export interface $500 { } + export interface $200 {} + export interface $400 {} + export interface $401 {} + export interface $500 {} } } namespace ImportConsultants { namespace Responses { - export interface $200 { } - export interface $400 { } - export interface $401 { } - export interface $500 { } + export interface $200 {} + export interface $400 {} + export interface $401 {} + export interface $500 {} } } namespace JoinChat { @@ -1011,13 +1011,13 @@ declare namespace Paths { chatId: Parameters.ChatId /* int64 */; } namespace Responses { - export interface $200 { } - export interface $400 { } - export interface $401 { } - export interface $403 { } - export interface $404 { } - export interface $409 { } - export interface $500 { } + export interface $200 {} + export interface $400 {} + export interface $401 {} + export interface $403 {} + export interface $404 {} + export interface $409 {} + export interface $500 {} } } namespace LeaveChat { @@ -1028,13 +1028,13 @@ declare namespace Paths { chatId: Parameters.ChatId /* int64 */; } namespace Responses { - export interface $200 { } - export interface $400 { } - export interface $401 { } - export interface $403 { } - export interface $404 { } - export interface $409 { } - export interface $500 { } + export interface $200 {} + export interface $400 {} + export interface $401 {} + export interface $403 {} + export interface $404 {} + export interface $409 {} + export interface $500 {} } } namespace RegisterNewConsultingType { @@ -1049,20 +1049,20 @@ declare namespace Paths { export type RequestBody = UserService.Schemas.NewRegistrationDto; namespace Responses { export type $201 = UserService.Schemas.NewRegistrationResponseDto; - export interface $400 { } - export interface $403 { } - export interface $409 { } - export interface $500 { } + export interface $400 {} + export interface $403 {} + export interface $409 {} + export interface $500 {} } } namespace RegisterUser { export type RequestBody = UserService.Schemas.UserDTO; namespace Responses { - export interface $201 { } - export interface $400 { } - export interface $403 { } - export interface $409 { } - export interface $500 { } + export interface $201 {} + export interface $400 {} + export interface $403 {} + export interface $409 {} + export interface $500 {} } } namespace SendLiveEvent { @@ -1073,22 +1073,22 @@ declare namespace Paths { rcGroupId: Parameters.RcGroupId; } namespace Responses { - export interface $200 { } - export interface $400 { } - export interface $403 { } - export interface $409 { } - export interface $500 { } + export interface $200 {} + export interface $400 {} + export interface $403 {} + export interface $409 {} + export interface $500 {} } } namespace SendNewMessageNotification { export type RequestBody = UserService.Schemas.NewMessageNotificationDTO; namespace Responses { - export interface $200 { } - export interface $400 { } - export interface $401 { } - export interface $409 { } - export interface $500 { } + export interface $200 {} + export interface $400 {} + export interface $401 {} + export interface $409 {} + export interface $500 {} } } namespace StartChat { @@ -1099,12 +1099,12 @@ declare namespace Paths { chatId: Parameters.ChatId /* int64 */; } namespace Responses { - export interface $200 { } - export interface $400 { } - export interface $401 { } - export interface $403 { } - export interface $409 { } - export interface $500 { } + export interface $200 {} + export interface $400 {} + export interface $401 {} + export interface $403 {} + export interface $409 {} + export interface $500 {} } } namespace StopChat { @@ -1115,22 +1115,22 @@ declare namespace Paths { chatId: Parameters.ChatId /* int64 */; } namespace Responses { - export interface $200 { } - export interface $400 { } - export interface $401 { } - export interface $403 { } - export interface $409 { } - export interface $500 { } + export interface $200 {} + export interface $400 {} + export interface $401 {} + export interface $403 {} + export interface $409 {} + export interface $500 {} } } namespace UpdateAbsence { export type RequestBody = UserService.Schemas.AbsenceDTO; namespace Responses { - export interface $200 { } - export interface $400 { } - export interface $401 { } - export interface $403 { } - export interface $500 { } + export interface $200 {} + export interface $400 {} + export interface $401 {} + export interface $403 {} + export interface $500 {} } } namespace UpdateChat { @@ -1143,52 +1143,52 @@ declare namespace Paths { export type RequestBody = UserService.Schemas.ChatDTO; namespace Responses { export type $200 = UserService.Schemas.UpdateChatResponseDTO; - export interface $400 { } - export interface $403 { } - export interface $409 { } - export interface $500 { } + export interface $400 {} + export interface $403 {} + export interface $409 {} + export interface $500 {} } } namespace UpdateConsultantData { export type RequestBody = UserService.Schemas.UpdateConsultantDTO; namespace Responses { - export interface $200 { } - export interface $400 { } - export interface $401 { } - export interface $403 { } - export interface $409 { } - export interface $500 { } + export interface $200 {} + export interface $400 {} + export interface $401 {} + export interface $403 {} + export interface $409 {} + export interface $500 {} } } namespace UpdateEmailAddress { export type RequestBody = string; namespace Responses { - export interface $200 { } - export interface $400 { } - export interface $401 { } - export interface $403 { } - export interface $409 { } - export interface $500 { } + export interface $200 {} + export interface $400 {} + export interface $401 {} + export interface $403 {} + export interface $409 {} + export interface $500 {} } } namespace UpdateKey { export type RequestBody = UserService.Schemas.MasterKeyDTO; namespace Responses { - export interface $202 { } - export interface $401 { } - export interface $403 { } - export interface $409 { } - export interface $500 { } + export interface $202 {} + export interface $401 {} + export interface $403 {} + export interface $409 {} + export interface $500 {} } } namespace UpdateMobileToken { export type RequestBody = UserService.Schemas.MobileTokenDTO; namespace Responses { - export interface $200 { } - export interface $400 { } - export interface $401 { } - export interface $403 { } - export interface $500 { } + export interface $200 {} + export interface $400 {} + export interface $401 {} + export interface $403 {} + export interface $500 {} } } namespace UpdateMonitoring { @@ -1200,21 +1200,21 @@ declare namespace Paths { } export type RequestBody = UserService.Schemas.MonitoringDTO; namespace Responses { - export interface $200 { } - export interface $400 { } - export interface $401 { } - export interface $403 { } - export interface $500 { } + export interface $200 {} + export interface $400 {} + export interface $401 {} + export interface $403 {} + export interface $500 {} } } namespace UpdatePassword { export type RequestBody = UserService.Schemas.PasswordDTO; namespace Responses { - export interface $200 { } - export interface $400 { } - export interface $401 { } - export interface $403 { } - export interface $500 { } + export interface $200 {} + export interface $400 {} + export interface $401 {} + export interface $403 {} + export interface $500 {} } } namespace UpdateSessionData { @@ -1226,12 +1226,12 @@ declare namespace Paths { } export type RequestBody = UserService.Schemas.SessionDataDTO; namespace Responses { - export interface $200 { } - export interface $400 { } - export interface $401 { } - export interface $403 { } - export interface $404 { } - export interface $500 { } + export interface $200 {} + export interface $400 {} + export interface $401 {} + export interface $403 {} + export interface $404 {} + export interface $500 {} } } } diff --git a/src/globalState/helpers/stateHelpers.ts b/src/globalState/helpers/stateHelpers.ts index 087606746..ba65c65fe 100644 --- a/src/globalState/helpers/stateHelpers.ts +++ b/src/globalState/helpers/stateHelpers.ts @@ -26,9 +26,9 @@ export type ExtendedSessionInterface = Omit< 'session' | 'chat' > & { item?: Partial> & - Partial> & { - topic: string | TopicSessionInterface; - }; + Partial> & { + topic: string | TopicSessionInterface; + }; rid: string; type: typeof CHAT_TYPE_GROUP_CHAT | typeof CHAT_TYPE_SINGLE_CHAT; isGroup?: boolean; @@ -144,7 +144,7 @@ export const AUTHORITIES = { CONSULTANT_DEFAULT: 'AUTHORIZATION_CONSULTANT_DEFAULT', CREATE_NEW_CHAT: 'AUTHORIZATION_CREATE_NEW_CHAT', ASKER_DEFAULT: 'AUTHORIZATION_USER_DEFAULT', - VIEW_AGENCY_CONSULTANTS: 'AUTHORIZATION_VIEW_AGENCY_CONSULTANTS', + VIEW_AGENCY_CONSULTANTS: 'AUTHORIZATION_VIEW_AGENCY_CONSULTANTS' }; export const isAnonymousSession = ( diff --git a/src/globalState/interfaces/SessionsDataInterface.ts b/src/globalState/interfaces/SessionsDataInterface.ts index 7c0ec60a2..0d5c4bb2e 100644 --- a/src/globalState/interfaces/SessionsDataInterface.ts +++ b/src/globalState/interfaces/SessionsDataInterface.ts @@ -86,11 +86,11 @@ export interface SessionItemInterface { postcode: number; registrationType: registrationTypeAnonymous | registrationTypeRegistered; status: - | statusEmpty - | statusEnquiry - | statusActive - | statusFinished - | statusArchived; + | statusEmpty + | statusEnquiry + | statusActive + | statusFinished + | statusArchived; isTeamSession: boolean; videoCallMessageDTO: VideoCallMessageDTO; language?: string; diff --git a/src/globalState/provider/RocketChatUnreadProvider.tsx b/src/globalState/provider/RocketChatUnreadProvider.tsx index bad41f3dc..db63a9a12 100644 --- a/src/globalState/provider/RocketChatUnreadProvider.tsx +++ b/src/globalState/provider/RocketChatUnreadProvider.tsx @@ -93,9 +93,7 @@ export function RocketChatUnreadProvider({ const session = sessions.find((s) => { const chatItem = getChatItemForSession(s); - return ( - chatItem.groupId === subscription.rid - ); + return chatItem.groupId === subscription.rid; }); if (!session) { diff --git a/src/resources/i18n/de/common.json b/src/resources/i18n/de/common.json index 406f9f012..531acd332 100644 --- a/src/resources/i18n/de/common.json +++ b/src/resources/i18n/de/common.json @@ -2191,7 +2191,7 @@ "archived": "Es sind noch keine Beratungen archiviert", "known": "Aktuell liegen keine Erstanfragen vor", "mySessions": "Sie haben zurzeit keine aktiven Beratungen", - "teamSessions": "Ihr Team hat keine aktiven Beratungen", + "teamSessions": "Ihr Team hat keine aktiven Beratungen" }, "preview": { "anonymous": { diff --git a/src/resources/scripts/config.ts b/src/resources/scripts/config.ts index 915ddba18..563525604 100644 --- a/src/resources/scripts/config.ts +++ b/src/resources/scripts/config.ts @@ -99,9 +99,7 @@ export const config: AppConfigInterface = { notifications: [ { label: 'profile.notifications.follow.up.email.label', - types: [ - 'NEW_CHAT_MESSAGE_FROM_ADVICE_SEEKER' - ] + types: ['NEW_CHAT_MESSAGE_FROM_ADVICE_SEEKER'] } ] }, diff --git a/src/resources/styles/settings.scss b/src/resources/styles/settings.scss index 52ddf478d..3d610c9bc 100644 --- a/src/resources/styles/settings.scss +++ b/src/resources/styles/settings.scss @@ -232,9 +232,11 @@ $max-input-width: 320px; $message-background-primary: $primary; $message-background-secondary: black; $message-background-rate: 0%; -$message-background: mix($message-background-secondary, - $primary, - $message-background-rate); +$message-background: mix( + $message-background-secondary, + $primary, + $message-background-rate +); $message-submit-interface-textarea-background-color: $dark-grey; $message-submit-interface-textarea-background-color-yellow: $yellow-3; $message-submit-interface-textarea-placeholder-color: $light-grey; @@ -287,4 +289,4 @@ $text-divider-font-weight: $font-weight-regular; $text-divider-text-transform: none; $upload-progress: #80dd92; $waiting-room-illustration-display-after: block; -$welcome-screen-icon-background: $primary; \ No newline at end of file +$welcome-screen-icon-background: $primary; From a758381fb64e4ec084b09bac8f54a0544ce4acc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deborah=20K=C3=B6pfer?= Date: Thu, 25 Jul 2024 12:18:25 +0200 Subject: [PATCH 14/37] fix(prettier-and-build-error): removed deprecated parameter, prettier fix --- .github/workflows/dockerImage.yml | 1 - src/components/sessionsList/SessionsList.tsx | 1 - 2 files changed, 2 deletions(-) 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/src/components/sessionsList/SessionsList.tsx b/src/components/sessionsList/SessionsList.tsx index ab15f2873..4297c05f8 100644 --- a/src/components/sessionsList/SessionsList.tsx +++ b/src/components/sessionsList/SessionsList.tsx @@ -358,7 +358,6 @@ export const SessionsList = ({ const sessionType = getSessionType( session, - rid, userData.userId ); From 14e25ec902e68f73c3ee4be0d8c2f485441efc3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deborah=20K=C3=B6pfer?= Date: Thu, 25 Jul 2024 13:06:46 +0200 Subject: [PATCH 15/37] style(devToolbar): prettier fix --- src/components/devToolbar/DevToolbar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/devToolbar/DevToolbar.tsx b/src/components/devToolbar/DevToolbar.tsx index 5d2284c24..a7a6e7e7e 100644 --- a/src/components/devToolbar/DevToolbar.tsx +++ b/src/components/devToolbar/DevToolbar.tsx @@ -219,7 +219,7 @@ const LOCAL_STORAGE_SWITCHES: (TLocalStorageSwitches | null)[] = [ i18n.changeLanguage( value === 'cimode' ? 'cimode' - : (localStorage.getItem(STORAGE_KEY_LOCALE) ?? 'de') + : localStorage.getItem(STORAGE_KEY_LOCALE) ?? 'de' ); } }, From 12f6d745225a3008bb5b8aec9d51905ee82585c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deborah=20K=C3=B6pfer?= Date: Thu, 25 Jul 2024 13:33:36 +0200 Subject: [PATCH 16/37] fix(list-filter): removed deprecated styles --- src/components/sessionsList/SessionsList.tsx | 1 - src/components/sessionsList/sessionsList.styles.scss | 4 ---- 2 files changed, 5 deletions(-) diff --git a/src/components/sessionsList/SessionsList.tsx b/src/components/sessionsList/SessionsList.tsx index 4297c05f8..8d303d741 100644 --- a/src/components/sessionsList/SessionsList.tsx +++ b/src/components/sessionsList/SessionsList.tsx @@ -861,7 +861,6 @@ export const SessionsList = ({ )}
Date: Thu, 25 Jul 2024 13:59:31 +0200 Subject: [PATCH 17/37] fix(remove-feedback-chat-functions): cleanup, removde unused import, fix eslint issues --- .../message/MessageItemComponent.tsx | 11 ++--------- .../messageSubmitInterfaceComponent.tsx | 2 -- .../session/SessionItemComponent.tsx | 19 ------------------- src/components/sessionsList/EmptyListItem.tsx | 8 +------- src/components/sessionsList/SessionsList.tsx | 2 +- src/globalState/helpers/stateHelpers.ts | 1 - .../provider/RocketChatUnreadProvider.tsx | 1 - 7 files changed, 4 insertions(+), 40 deletions(-) diff --git a/src/components/message/MessageItemComponent.tsx b/src/components/message/MessageItemComponent.tsx index bb7aa4ca3..c886d5c6e 100644 --- a/src/components/message/MessageItemComponent.tsx +++ b/src/components/message/MessageItemComponent.tsx @@ -7,15 +7,11 @@ 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 { STATUS_ARCHIVED } from '../../globalState/interfaces'; +import { isUserModerator } from '../session/sessionHelpers'; import { MessageMetaData } from './MessageMetaData'; import { MessageDisplayName } from './MessageDisplayName'; import { markdownToDraft } from 'markdown-draft-js'; @@ -104,7 +100,6 @@ interface MessageItemComponentProps extends MessageItem { isOnlyEnquiry?: boolean; isMyMessage: boolean; clientName: string; - resortData: ConsultingTypeInterface; isUserBanned: boolean; handleDecryptionErrors: ( id: string, @@ -122,7 +117,6 @@ export const MessageItemComponent = ({ message, messageDate, messageTime, - resortData, isMyMessage, displayName, username, @@ -142,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< diff --git a/src/components/messageSubmitInterface/messageSubmitInterfaceComponent.tsx b/src/components/messageSubmitInterface/messageSubmitInterfaceComponent.tsx index 04b4791be..85d9be55b 100644 --- a/src/components/messageSubmitInterface/messageSubmitInterfaceComponent.tsx +++ b/src/components/messageSubmitInterface/messageSubmitInterfaceComponent.tsx @@ -11,7 +11,6 @@ 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, @@ -671,7 +670,6 @@ export const MessageSubmitInterfaceComponent = ({ preselectedFile, sendEnquiry, sendMessage, - setE2EEState, type, userData ]); diff --git a/src/components/session/SessionItemComponent.tsx b/src/components/session/SessionItemComponent.tsx index 7fe93dea3..9128ddd75 100644 --- a/src/components/session/SessionItemComponent.tsx +++ b/src/components/session/SessionItemComponent.tsx @@ -18,7 +18,6 @@ import { } from '../message/MessageItemComponent'; import { SessionHeaderComponent } from '../sessionHeader/SessionHeaderComponent'; import { Button, BUTTON_TYPES, ButtonItem } from '../button/Button'; -import { apiGetConsultingType } from '../../api'; import { AUTHORITIES, getContact, @@ -28,7 +27,6 @@ import { useTenant, ActiveSessionContext } from '../../globalState'; -import { ConsultingTypeInterface } from '../../globalState/interfaces'; import './session.styles'; import { useDebouncedCallback } from 'use-debounce'; import { ReactComponent as ArrowDoubleDownIcon } from '../../resources/img/icons/arrow-double-down.svg'; @@ -167,22 +165,6 @@ export const SessionItemComponent = (props: SessionItemProps) => { } }, [isScrolledToBottom]); // eslint-disable-line - const [resortData, setResortData] = useState(); - useEffect(() => { - if (activeSession.item.consultingType) { - let isCanceled = false; - apiGetConsultingType({ - consultingTypeId: activeSession.item.consultingType - }).then((response) => { - if (isCanceled) return; - setResortData(response); - }); - return () => { - isCanceled = true; - }; - } - }, [activeSession.item.consultingType]); - const getPlaceholder = () => { if (activeSession.isGroup) { return translate('enquiry.write.input.placeholder.groupChat'); @@ -382,7 +364,6 @@ export const SessionItemComponent = (props: SessionItemProps) => { askerRcId={activeSession.item.askerRcId} isOnlyEnquiry={isOnlyEnquiry} isMyMessage={isMyMessage(message.userId)} - resortData={resortData} isUserBanned={props.bannedUsers.includes( message.username )} diff --git a/src/components/sessionsList/EmptyListItem.tsx b/src/components/sessionsList/EmptyListItem.tsx index c79e481cd..abc2c328d 100644 --- a/src/components/sessionsList/EmptyListItem.tsx +++ b/src/components/sessionsList/EmptyListItem.tsx @@ -9,11 +9,6 @@ import { SESSION_LIST_TYPES, SESSION_LIST_TAB_ANONYMOUS } from '../session/sessionHelpers'; -import { - AUTHORITIES, - hasUserAuthority, - UserDataContext -} from '../../globalState'; interface EmptyListItemProps { type: SESSION_LIST_TYPES; @@ -22,7 +17,6 @@ interface EmptyListItemProps { export const EmptyListItem = ({ type, sessionListTab }: EmptyListItemProps) => { const { t } = useTranslation(); - const { userData } = useContext(UserDataContext); const emptyTitle = useMemo(() => { if (sessionListTab === SESSION_LIST_TAB_ARCHIVE) { @@ -38,7 +32,7 @@ export const EmptyListItem = ({ type, sessionListTab }: EmptyListItemProps) => { default: return t('sessionList.empty.mySessions'); } - }, [sessionListTab, userData, type, t]); + }, [sessionListTab, type, t]); return ( (); const { sessions, dispatch } = useContext(SessionsDataContext); - const { type, path: listPath } = useContext(SessionTypeContext); + const { type } = useContext(SessionTypeContext); const { subscribe, diff --git a/src/globalState/helpers/stateHelpers.ts b/src/globalState/helpers/stateHelpers.ts index ba65c65fe..b5e6bca67 100644 --- a/src/globalState/helpers/stateHelpers.ts +++ b/src/globalState/helpers/stateHelpers.ts @@ -17,7 +17,6 @@ import { CHAT_TYPE_SINGLE_CHAT, getChatItemForSession, getChatTypeForListItem, - isSessionChat, SESSION_LIST_TYPES } from '../../components/session/sessionHelpers'; diff --git a/src/globalState/provider/RocketChatUnreadProvider.tsx b/src/globalState/provider/RocketChatUnreadProvider.tsx index db63a9a12..6381cd52c 100644 --- a/src/globalState/provider/RocketChatUnreadProvider.tsx +++ b/src/globalState/provider/RocketChatUnreadProvider.tsx @@ -12,7 +12,6 @@ import { apiGetSessionRoomsByGroupIds } from '../../api/apiGetSessionRooms'; import { getChatItemForSession, getSessionType, - isGroupChat, SESSION_TYPE_ARCHIVED, SESSION_TYPE_ENQUIRY, SESSION_TYPE_GROUP, From b957eb152812a7ee5a05de7881dec2e993606786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deborah=20K=C3=B6pfer?= Date: Thu, 25 Jul 2024 15:00:51 +0200 Subject: [PATCH 18/37] style(EmptyListItem): remove unused import --- src/components/sessionsList/EmptyListItem.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/sessionsList/EmptyListItem.tsx b/src/components/sessionsList/EmptyListItem.tsx index abc2c328d..0d6a4aa0c 100644 --- a/src/components/sessionsList/EmptyListItem.tsx +++ b/src/components/sessionsList/EmptyListItem.tsx @@ -1,4 +1,3 @@ -import React, { useContext } from 'react'; import { useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { ListInfo } from '../listInfo/ListInfo'; From 2c625b326c25ae0113c0ec4d76e15c0e3fe56366 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deborah=20K=C3=B6pfer?= Date: Thu, 25 Jul 2024 15:29:25 +0200 Subject: [PATCH 19/37] fix(EmptyListItem): missing import --- src/components/sessionsList/EmptyListItem.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/sessionsList/EmptyListItem.tsx b/src/components/sessionsList/EmptyListItem.tsx index 0d6a4aa0c..a03fbe01a 100644 --- a/src/components/sessionsList/EmptyListItem.tsx +++ b/src/components/sessionsList/EmptyListItem.tsx @@ -1,3 +1,4 @@ +import * as React from 'react'; import { useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { ListInfo } from '../listInfo/ListInfo'; From 3e4f0ced05a4669034c132186fcb824569e1f6d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deborah=20K=C3=B6pfer?= Date: Wed, 7 Aug 2024 16:29:21 +0200 Subject: [PATCH 20/37] test(u25-cypress-fixture): revert ct u25 removal --- .../fixtures/service.consultingtypes.u25.json | 146 ++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 cypress/fixtures/service.consultingtypes.u25.json diff --git a/cypress/fixtures/service.consultingtypes.u25.json b/cypress/fixtures/service.consultingtypes.u25.json new file mode 100644 index 000000000..e7e6ca018 --- /dev/null +++ b/cypress/fixtures/service.consultingtypes.u25.json @@ -0,0 +1,146 @@ +{ + "id": 1, + "titles": { + "default": "U25", + "short": "U25", + "long": "Beratung für suizidgefährdete junge Menschen [U25]", + "welcome": "Willkommen bei der U25-Hilfe", + "registrationDropdown": "Beratung für suizidgefährdete junge Menschen [U25]" + }, + "urls": { + "requiredAidMissingRedirectUrl": "https://www.u25-deutschland.de/helpmail/" + }, + "registration": { + "minPostcodeSize": 5, + "autoSelectAgency": true, + "autoSelectPostcode": true, + "notes": { + "password": "Bitte notiere Dir Deine Zugangsdaten – ein Passwort-Reset ist nicht möglich!" + }, + "mandatoryFields": { + "age": true, + "state": true + } + }, + "isSubsequentRegistrationAllowed": false, + "isAnonymousConversationAllowed": false, + "isSetEmailAllowed": false, + "slug": "u25", + "languageFormal": false, + "lockedAgencies": false, + "whiteSpot": { + "whiteSpotAgencyAssigned": false + }, + "groupChat": { + "isGroupChat": false, + "groupChatRules": [] + }, + "consultantBoundedToConsultingType": false, + "welcomeMessage": { + "sendWelcomeMessage": true, + "welcomeMessageText": "Lorem ipsum" + }, + "sendFurtherStepsMessage": false, + "sendSaveSessionDataMessage": true, + "sessionDataInitializing": { + "addictiveDrugs": false, + "age": true, + "gender": true, + "relation": false, + "state": true + }, + "roles": { + "consultant": { + "main": ["consultant", "u25-consultant", "u25-main-consultant"], + "peer": ["consultant", "u25-consultant"] + } + }, + "notifications": { + "teamSessions": { + "newMessage": { + "allTeamConsultants": false + } + } + }, + "showAskerProfile": true, + "requiredComponents": { + "age": { + "isEnabled": true, + "options": [ + { + "value": "0", + "label": "unter 12" + }, + { + "value": "1", + "label": "12" + }, + { + "value": "2", + "label": "13" + }, + { + "value": "3", + "label": "14" + }, + { + "value": "4", + "label": "15" + }, + { + "value": "5", + "label": "16" + }, + { + "value": "6", + "label": "17" + }, + { + "value": "7", + "label": "18" + }, + { + "value": "8", + "label": "19" + }, + { + "value": "9", + "label": "20" + }, + { + "value": "10", + "label": "21" + }, + { + "value": "11", + "label": "22" + }, + { + "value": "12", + "label": "23" + }, + { + "value": "13", + "label": "24" + }, + { + "value": "14", + "label": "25" + }, + { + "value": "15", + "label": "über 25" + } + ] + }, + "state": { + "isEnabled": true + } + }, + "welcomeScreen": { + "anonymous": { + "title": "Anonym und kostenfrei", + "text": "Du bleibst anonym und erhältst kostenfreie Beratung und Hilfe" + } + } +} From c7a0fb75d258991b52fc2b84665885dd5ed89f30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deborah=20K=C3=B6pfer?= Date: Thu, 8 Aug 2024 11:03:55 +0200 Subject: [PATCH 21/37] feat(livechat): rm waiting room/routes/livechat session --- src/components/app/RouterConfig.tsx | 8 +- src/components/app/app.tsx | 14 +- src/components/askerInfo/AskerInfoContent.tsx | 3 +- .../messageSubmitInterfaceComponent.tsx | 328 ++++++------- src/components/session/SessionStream.tsx | 11 - src/components/session/sessionHelpers.ts | 15 - src/components/sessionsList/EmptyListItem.tsx | 13 +- src/components/sessionsList/SessionsList.tsx | 16 +- .../SessionListItemComponent.tsx | 12 +- src/components/waitingRoom/WaitingRoom.tsx | 443 ------------------ .../waitingRoom/WaitingRoomLoader.tsx | 50 -- .../waitingRoom/waitingRoom.styles.scss | 230 --------- .../waitingRoom/waitingRoomHelpers.ts | 32 -- src/globalState/helpers/stateHelpers.ts | 12 +- .../interfaces/SessionsDataInterface.ts | 5 +- .../provider/RocketChatUnreadProvider.tsx | 6 - src/resources/i18n/de/common.json | 46 -- src/resources/i18n/en/common.json | 55 --- src/resources/styles/settings.scss | 1 - 19 files changed, 163 insertions(+), 1137 deletions(-) delete mode 100644 src/components/waitingRoom/WaitingRoom.tsx delete mode 100644 src/components/waitingRoom/WaitingRoomLoader.tsx delete mode 100644 src/components/waitingRoom/waitingRoom.styles.scss delete mode 100644 src/components/waitingRoom/waitingRoomHelpers.ts diff --git a/src/components/app/RouterConfig.tsx b/src/components/app/RouterConfig.tsx index e6ac96284..b56db8bae 100644 --- a/src/components/app/RouterConfig.tsx +++ b/src/components/app/RouterConfig.tsx @@ -6,7 +6,6 @@ import { SESSION_TYPE_ARCHIVED, SESSION_TYPE_ENQUIRY, SESSION_TYPE_GROUP, - SESSION_TYPE_LIVECHAT, SESSION_TYPE_SESSION, SESSION_TYPE_TEAMSESSION } from '../session/sessionHelpers'; @@ -158,7 +157,6 @@ export const RouterConfigUser = ( SESSION_TYPE_SESSION, SESSION_TYPE_ARCHIVED, SESSION_TYPE_GROUP, - SESSION_TYPE_LIVECHAT, SESSION_TYPE_ENQUIRY, SESSION_TYPE_TEAMSESSION ] @@ -171,7 +169,6 @@ export const RouterConfigUser = ( SESSION_TYPE_SESSION, SESSION_TYPE_ARCHIVED, SESSION_TYPE_GROUP, - SESSION_TYPE_LIVECHAT, SESSION_TYPE_ENQUIRY, SESSION_TYPE_TEAMSESSION ] @@ -271,7 +268,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 }, @@ -440,7 +437,7 @@ export const RouterConfigTeamConsultant = ( { path: '/sessions/consultant/sessionPreview/:rcGroupId?/:sessionId?', component: SessionsListWrapper, - sessionTypes: [SESSION_TYPE_LIVECHAT, SESSION_TYPE_ENQUIRY], + sessionTypes: [SESSION_TYPE_ENQUIRY], type: SESSION_LIST_TYPES.ENQUIRY, exact: false }, @@ -592,7 +589,6 @@ export const RouterConfigAnonymousAsker = (): any => { SESSION_TYPE_SESSION, SESSION_TYPE_ARCHIVED, SESSION_TYPE_GROUP, - SESSION_TYPE_LIVECHAT, SESSION_TYPE_ENQUIRY, SESSION_TYPE_TEAMSESSION ] 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/AskerInfoContent.tsx b/src/components/askerInfo/AskerInfoContent.tsx index 2fc88ba24..e327e6faa 100644 --- a/src/components/askerInfo/AskerInfoContent.tsx +++ b/src/components/askerInfo/AskerInfoContent.tsx @@ -24,12 +24,11 @@ export const AskerInfoContent = () => { const { type } = useContext(SessionTypeContext); const isSessionAssignAvailable = useMemo(() => { - 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; } diff --git a/src/components/messageSubmitInterface/messageSubmitInterfaceComponent.tsx b/src/components/messageSubmitInterface/messageSubmitInterfaceComponent.tsx index 85d9be55b..b54deca06 100644 --- a/src/components/messageSubmitInterface/messageSubmitInterfaceComponent.tsx +++ b/src/components/messageSubmitInterface/messageSubmitInterfaceComponent.tsx @@ -187,9 +187,6 @@ export const MessageSubmitInterfaceComponent = ({ const [isTypingActive, setIsTypingActive] = useState( activeSession.isGroup || activeSession.isLive ); - const [isLiveChatFinished, setIsLiveChatFinished] = useState( - activeSession.isLive && activeSession.item.status === STATUS_FINISHED - ); const [showAppointmentButton, setShowAppointmentButton] = useState(false); //Emoji Picker Plugin @@ -247,10 +244,6 @@ export const MessageSubmitInterfaceComponent = ({ ); setIsSessionArchived(activeSession.item.status === STATUS_ARCHIVED); setIsTypingActive(activeSession.isGroup || activeSession.isLive); - setIsLiveChatFinished( - activeSession.isLive && - activeSession.item.status === STATUS_FINISHED - ); }, [activeSession, activeSession.item.status, userData]); const { onChange: onDraftMessageChange, loaded: draftLoaded } = @@ -267,18 +260,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) => { @@ -876,177 +861,166 @@ export const MessageSubmitInterfaceComponent = ({ /> )} {activeInfo && } - {!isLiveChatFinished && ( - -
-
- - - - setIsRichtextActive( - !isRichtextActive - ) - } - title={translate( - 'enquiry.write.input.format' - )} - aria-label={translate( - 'enquiry.write.input.format' - )} - /> - - + + +
+
+ + + + setIsRichtextActive(!isRichtextActive) + } + title={translate( + 'enquiry.write.input.format' + )} + aria-label={translate( + 'enquiry.write.input.format' + )} + /> - + + +
resizeTextarea()} + onFocus={toggleAbsentMessage} + onBlur={toggleAbsentMessage} > -
resizeTextarea()} - onFocus={toggleAbsentMessage} - onBlur={toggleAbsentMessage} - > - - {(externalProps) => ( -
- - - -
- )} -
- - handleEditorBeforeInput(editorState) - } - handlePastedText={( - text: string, - html?: string - ): DraftHandleValue => { - const newEditorState = - handleEditorPastedText( - editorState, - text, - html - ); - if (newEditorState) { - setEditorState(newEditorState); - } - return 'handled'; - }} - plugins={[ - linkifyPlugin, - staticToolbarPlugin, - emojiPlugin - ]} - tabIndex={0} - /> -
- {hasUploadFunctionality && - (!attachmentSelected ? ( - - + {(externalProps) => ( +
+ + + - - ) : ( -
- - - - {getAttachmentIcon( - attachmentSelected.type - )} -

- { - attachmentSelected.name - } -

- - - -
-
- ))} - -
- + + handleEditorBeforeInput(editorState) } + handlePastedText={( + text: string, + html?: string + ): DraftHandleValue => { + const newEditorState = + handleEditorPastedText( + editorState, + text, + html + ); + if (newEditorState) { + setEditorState(newEditorState); + } + return 'handled'; + }} + plugins={[ + linkifyPlugin, + staticToolbarPlugin, + emojiPlugin + ]} + tabIndex={0} />
+ {hasUploadFunctionality && + (!attachmentSelected ? ( + + + + ) : ( +
+ + + + {getAttachmentIcon( + attachmentSelected.type + )} +

+ {attachmentSelected.name} +

+ + + +
+
+
+ ))} + +
+
- {showAppointmentButton && ( -
- -
- )}
- {hasUploadFunctionality && ( - + {showAppointmentButton && ( +
+ +
)} - - )} +
+ {hasUploadFunctionality && ( + + )} + {requestOverlayVisible && ( diff --git a/src/components/session/SessionStream.tsx b/src/components/session/SessionStream.tsx index 6eb3b52d6..00de562fd 100644 --- a/src/components/session/SessionStream.tsx +++ b/src/components/session/SessionStream.tsx @@ -138,17 +138,6 @@ export const SessionStream = ({ return; } - const isLiveChatFinished = - activeSession.isLive && - activeSession.item.status === STATUS_FINISHED; - - if ( - !hasUserAuthority(AUTHORITIES.CONSULTANT_DEFAULT, userData) && - isLiveChatFinished - ) { - return; - } - readActiveSession(); }, [activeSession, readActiveSession, readonly, userData]); diff --git a/src/components/session/sessionHelpers.ts b/src/components/session/sessionHelpers.ts index 7e845cde4..bf9d459a8 100644 --- a/src/components/session/sessionHelpers.ts +++ b/src/components/session/sessionHelpers.ts @@ -1,7 +1,6 @@ import { GroupChatItemInterface, ListItemInterface, - REGISTRATION_TYPE_ANONYMOUS, SessionItemInterface, STATUS_ARCHIVED, STATUS_EMPTY, @@ -30,7 +29,6 @@ export type ChatTypes = | typeof CHAT_TYPE_SINGLE_CHAT; export const SESSION_TYPE_ENQUIRY = 'enquiry'; -export const SESSION_TYPE_LIVECHAT = 'livechat'; export const SESSION_TYPE_ARCHIVED = 'archived'; export const SESSION_TYPE_GROUP = 'group'; export const SESSION_TYPE_SESSION = 'session'; @@ -38,7 +36,6 @@ export const SESSION_TYPE_TEAMSESSION = 'teamsession'; export const SESSION_TYPE_UNKNOWN = 'unknown'; export type SESSION_TYPES = - | typeof SESSION_TYPE_LIVECHAT | typeof SESSION_TYPE_ENQUIRY | typeof SESSION_TYPE_ARCHIVED | typeof SESSION_TYPE_GROUP @@ -54,9 +51,6 @@ export const getSessionType = ( switch (!isGroupChat(chatItem) && chatItem.status) { case STATUS_ENQUIRY: case STATUS_EMPTY: - if (isLiveChat(chatItem)) { - return SESSION_TYPE_LIVECHAT; - } return SESSION_TYPE_ENQUIRY; case STATUS_ARCHIVED: return SESSION_TYPE_ARCHIVED; @@ -84,15 +78,6 @@ export const isSessionChat = ( return chatItem && 'askerRcId' in chatItem; }; -export const isLiveChat = ( - chatItem: SessionItemInterface | GroupChatItemInterface -): chatItem is SessionItemInterface => { - return ( - isSessionChat(chatItem) && - chatItem.registrationType === REGISTRATION_TYPE_ANONYMOUS - ); -}; - export const isGroupChat = ( chatItem: SessionItemInterface | GroupChatItemInterface ): chatItem is GroupChatItemInterface => { diff --git a/src/components/sessionsList/EmptyListItem.tsx b/src/components/sessionsList/EmptyListItem.tsx index a03fbe01a..35f1fe988 100644 --- a/src/components/sessionsList/EmptyListItem.tsx +++ b/src/components/sessionsList/EmptyListItem.tsx @@ -2,12 +2,10 @@ import * as React from 'react'; import { useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { ListInfo } from '../listInfo/ListInfo'; -import { ReactComponent as ChatWaitingIllustration } from '../../resources/img/illustrations/chat-waiting.svg'; import { ReactComponent as NoMessagesIllustration } from '../../resources/img/illustrations/no-messages.svg'; import { SESSION_LIST_TAB_ARCHIVE, - SESSION_LIST_TYPES, - SESSION_LIST_TAB_ANONYMOUS + SESSION_LIST_TYPES } from '../session/sessionHelpers'; interface EmptyListItemProps { @@ -34,13 +32,6 @@ export const EmptyListItem = ({ type, sessionListTab }: EmptyListItemProps) => { } }, [sessionListTab, type, t]); return ( - + ); }; diff --git a/src/components/sessionsList/SessionsList.tsx b/src/components/sessionsList/SessionsList.tsx index e1796311b..4d28e0e28 100644 --- a/src/components/sessionsList/SessionsList.tsx +++ b/src/components/sessionsList/SessionsList.tsx @@ -27,7 +27,6 @@ import { ExtendedSessionInterface, getExtendedSession, hasUserAuthority, - isAnonymousSession, REMOVE_SESSIONS, RocketChatContext, SessionsDataContext, @@ -249,25 +248,12 @@ export const SessionsList = ({ ready: true, sessions }); + // TODO can be reduced? if ( sessions?.length === 1 && sessions[0]?.session?.status === STATUS_EMPTY ) { history.push(`/sessions/user/view/write/`); - } else if ( - sessions.length === 1 && - isAnonymousSession(sessions[0]?.session) && - hasUserAuthority( - AUTHORITIES.ANONYMOUS_DEFAULT, - userData - ) - ) { - const extendedSession = buildExtendedSession( - sessions[0] - ); - history.push( - `/sessions/user/view/${extendedSession?.rid}/${extendedSession?.item?.id}` - ); } }) .then(() => setIsLoading(false)); diff --git a/src/components/sessionsListItem/SessionListItemComponent.tsx b/src/components/sessionsListItem/SessionListItemComponent.tsx index 010a3ecc7..b692c164b 100644 --- a/src/components/sessionsListItem/SessionListItemComponent.tsx +++ b/src/components/sessionsListItem/SessionListItemComponent.tsx @@ -222,8 +222,7 @@ export const SessionListItemComponent = ({ const prettyPrintDate = ( messageDate: number, // seconds since epoch - createDate: string, // ISO8601 string - isLiveChat: boolean + createDate: string // ISO8601 string ) => { const newestDate = Math.max( messageDate * MILLISECONDS_PER_SECOND, @@ -234,11 +233,7 @@ export const SessionListItemComponent = ({ newestDate / MILLISECONDS_PER_SECOND ); - return isLiveChat - ? prettyPrintTimeDifference(newestDate, Date.now()) - : prettyDate.str - ? translate(prettyDate.str) - : prettyDate.date; + return prettyDate.str ? translate(prettyDate.str) : prettyDate.date; }; // Hide sessions if consultingType has been switched to group chat. @@ -382,8 +377,7 @@ export const SessionListItemComponent = ({
{prettyPrintDate( activeSession.item.messageDate, - activeSession.item.createDate, - activeSession.isLive + activeSession.item.createDate )}
diff --git a/src/components/waitingRoom/WaitingRoom.tsx b/src/components/waitingRoom/WaitingRoom.tsx deleted file mode 100644 index e42dc205c..000000000 --- a/src/components/waitingRoom/WaitingRoom.tsx +++ /dev/null @@ -1,443 +0,0 @@ -import * as React from 'react'; -import { Text } from '../text/Text'; -import { v4 as uuid } from 'uuid'; -import './waitingRoom.styles'; -import { ReactComponent as WaitingIllustration } from '../../resources/img/illustrations/waiting.svg'; -import { ReactComponent as ErrorIllustration } from '../../resources/img/illustrations/not-found.svg'; -import { ReactComponent as SecurityIllustration } from '../../resources/img/illustrations/security.svg'; -import { ReactComponent as ClosedIllustration } from '../../resources/img/illustrations/closed.svg'; -import { useCallback, useContext, useEffect, useRef, useState } from 'react'; -import { - AnonymousConversationAvailabilityInterface, - AnonymousRegistrationResponse, - apiAnonymousConversationAvailability, - apiPostAnonymousRegistration, - FETCH_ERRORS -} from '../../api'; -import { Button, ButtonItem, BUTTON_TYPES } from '../button/Button'; -import { decodeUsername } from '../../utils/encryptionHelpers'; -import { - deleteCookieByName, - getValueFromCookie, - removeAllCookies, - setValueInCookie -} from '../sessionCookie/accessSessionCookie'; -import { Overlay, OverlayItem, OVERLAY_FUNCTIONS } from '../overlay/Overlay'; -import { - AnonymousConversationFinishedContext, - AnonymousEnquiryAcceptedContext, - WebsocketConnectionDeactivatedContext, - AnonymousConversationStartedContext -} from '../../globalState'; -import { capitalizeFirstLetter } from '../../utils/capitalizeFirstLetter'; -import { - acceptanceOverlayItem, - rejectionOverlayItem -} from './waitingRoomHelpers'; -import { handleTokenRefresh, setTokens } from '../auth/auth'; -import { handleE2EESetup } from '../registration/autoLogin'; -import { useTranslation } from 'react-i18next'; -import { useHistory } from 'react-router-dom'; -import { LegalLinksContext } from '../../globalState/provider/LegalLinksProvider'; -import { WaitingRoomContent } from './WaitingRoomContent'; -import { StageLayout } from '../stageLayout/StageLayout'; -import { appConfig } from '../../utils/appConfig'; -import { Loading } from '../app/Loading'; -import { GlobalComponentContext } from '../../globalState/provider/GlobalComponentContext'; -import LegalLinks from '../legalLinks/LegalLinks'; -export interface WaitingRoomProps { - consultingTypeSlug: string; - consultingTypeId: number; - onAnonymousRegistration: Function; -} - -// How many retries should run until 409 requests are failing -const USERNAME_CONFLICT_RETRY_LIMIT = 20; -// Slowdown request after every 5 requests to prevent 429 -const USERNAME_CONFLICT_RETRY_SLOWDOWN = 5; - -export const WaitingRoom = (props: WaitingRoomProps) => { - const { t: translate } = useTranslation(); - const history = useHistory(); - - const legalLinks = useContext(LegalLinksContext); - const { Stage } = useContext(GlobalComponentContext); - - const [isDataProtectionViewActive, setIsDataProtectionViewActive] = - useState(true); - const [username, setUsername] = useState(); - const [isConsultantAvailable, setIsConsultantAvailable] = - useState(); - const [isRequestInProgress, setIsRequestInProgress] = useState(false); - const [isErrorPageActive, setIsErrorPageActive] = useState(false); - const [isOverlayActive, setIsOverlayActive] = useState(false); - const [overlayItem, setOverlayItem] = useState(); - const { anonymousEnquiryAccepted, setAnonymousEnquiryAccepted } = - useContext(AnonymousEnquiryAcceptedContext); - const { anonymousConversationFinished, setAnonymousConversationFinished } = - useContext(AnonymousConversationFinishedContext); - const { - websocketConnectionDeactivated, - setWebsocketConnectionDeactivated - } = useContext(WebsocketConnectionDeactivatedContext); - const { anonymousConversationStarted, setAnonymousConversationStarted } = - useContext(AnonymousConversationStartedContext); - const registrationUrl = `/${props.consultingTypeSlug}/registration`; - - const getPseudoPasswordForUser = (rc_uid) => { - let pseudoPassword = localStorage.getItem(`pseudoPassword_${rc_uid}`); - if (!pseudoPassword) { - pseudoPassword = uuid(); - localStorage.setItem(`pseudoPassword_${rc_uid}`, pseudoPassword); - } - return pseudoPassword; - }; - - const afterRegistrationHandler = () => { - const rc_uid = getValueFromCookie('rc_uid'); - const pseuodPassword = getPseudoPasswordForUser(rc_uid); - handleE2EESetup(pseuodPassword, rc_uid, null, true).then(() => - props.onAnonymousRegistration() - ); - }; - - useEffect(() => { - const registeredUsername = getValueFromCookie('registeredUsername'); - const sessionId = getValueFromCookie('anonymousSessionId'); - - // handle a refresh as registered user and not initialize a new user - if (registeredUsername && getValueFromCookie('keycloak') && sessionId) { - setIsDataProtectionViewActive(false); - setUsername(registeredUsername); - handleTokenRefresh() - .then(afterRegistrationHandler) - .then(() => { - return apiAnonymousConversationAvailability( - parseInt(sessionId, 10) - ); - }) - .then( - (response: AnonymousConversationAvailabilityInterface) => { - setIsConsultantAvailable( - response.numAvailableConsultants > 0 - ); - } - ); - } - - document.title = `${translate( - 'anonymous.waitingroom.title.start' - )} ${capitalizeFirstLetter(props.consultingTypeSlug)}`; - }, []); // eslint-disable-line react-hooks/exhaustive-deps - - useEffect(() => { - if (anonymousEnquiryAccepted) { - setOverlayItem(acceptanceOverlayItem); - setIsOverlayActive(true); - setAnonymousEnquiryAccepted(false); - } - }, [anonymousEnquiryAccepted, setAnonymousEnquiryAccepted]); - - useEffect(() => { - if (anonymousConversationStarted) { - setAnonymousConversationStarted(false); - } - }, [anonymousConversationStarted, setAnonymousConversationStarted]); - - useEffect(() => { - if (anonymousConversationFinished === 'NEW') { - setOverlayItem(rejectionOverlayItem); - setIsOverlayActive(true); - removeAllCookies(); - } else { - setIsOverlayActive(false); - } - }, [anonymousConversationFinished, setAnonymousConversationFinished]); - - useEffect(() => { - if (websocketConnectionDeactivated) { - setIsErrorPageActive(true); - setWebsocketConnectionDeactivated(null); - } - }, [websocketConnectionDeactivated, setWebsocketConnectionDeactivated]); - - const getUsernameText = () => { - return ` - ${translate('anonymous.waitingroom.username.text')} -
- ${ - username - ? username - : `${translate( - 'anonymous.waitingroom.username.loading' - )}` - } -
- `; - }; - - const confirmButton: ButtonItem = { - label: translate('anonymous.waitingroom.dataProtection.button'), - type: BUTTON_TYPES.PRIMARY - }; - - const reloadButton: ButtonItem = { - label: translate('anonymous.waitingroom.errorPage.button'), - type: BUTTON_TYPES.PRIMARY - }; - - const retryCount = useRef(1); - const registerAnonymous = useCallback(() => { - return apiPostAnonymousRegistration(props.consultingTypeId).catch( - (err: Error) => { - if ( - err.message === FETCH_ERRORS.CONFLICT && - retryCount.current <= USERNAME_CONFLICT_RETRY_LIMIT - ) { - retryCount.current += 1; - return new Promise( - (resolve) => { - setTimeout( - () => { - resolve(registerAnonymous()); - }, - Math.ceil( - retryCount.current / - USERNAME_CONFLICT_RETRY_SLOWDOWN - ) * 500 - ); - } - ); - } else { - throw err; - } - } - ); - }, [props.consultingTypeId]); - - const handleConfirmButton = () => { - if (!isRequestInProgress) { - setIsRequestInProgress(true); - setIsDataProtectionViewActive(false); - window.scrollTo(0, 0); - registerAnonymous() - .then((response: AnonymousRegistrationResponse) => { - const decodedUsername = decodeUsername(response.userName); - setUsername(decodedUsername); - setValueInCookie('registeredUsername', decodedUsername); - setValueInCookie('rc_token', response.rcToken); - setValueInCookie('rc_uid', response.rcUserId); - setValueInCookie( - 'anonymousSessionId', - `${response.sessionId}` - ); - - setTokens( - response.accessToken, - response.expiresIn, - response.refreshToken, - response.refreshExpiresIn - ); - - handleTokenRefresh().then(afterRegistrationHandler); - return response.sessionId; - }) - .then(apiAnonymousConversationAvailability) - .then( - (response: AnonymousConversationAvailabilityInterface) => { - setIsConsultantAvailable( - response.numAvailableConsultants > 0 - ); - } - ) - .catch((err: Error) => { - console.log(err); - }) - .finally(() => { - retryCount.current = 1; - setIsRequestInProgress(false); - }); - } - }; - - const handleReloadButton = () => { - window.location.reload(); - }; - - const handleOverlayAction = (buttonFunction: string) => { - if (buttonFunction === OVERLAY_FUNCTIONS.REDIRECT) { - history.push(`/app`); - deleteCookieByName('registeredUsername'); - } else if (buttonFunction === OVERLAY_FUNCTIONS.REDIRECT_TO_URL) { - window.location.href = registrationUrl; - } - }; - - const getContent = () => { - if (isDataProtectionViewActive) { - return ( - - } - > - - legalLink.registration} - legalLinks={legalLinks} - params={{ aid: null }} - > - {(label, url) => ( - - - - )} - - -