From 77833816a6bb30521c65d0b69b347f81acb35ba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deborah=20K=C3=B6pfer?= Date: Wed, 2 Oct 2024 10:58:23 +0200 Subject: [PATCH 01/14] build(github-workflows): update actions --- .github/workflows/build.yml | 2 +- .github/workflows/dockerImage.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 258425f72..de3775e81 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -70,7 +70,7 @@ jobs: branch: ${{env.BRANCH}} force: true tags: true - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 if: failure() with: name: cypress-videos diff --git a/.github/workflows/dockerImage.yml b/.github/workflows/dockerImage.yml index 04c8a38ec..46ae1adbf 100644 --- a/.github/workflows/dockerImage.yml +++ b/.github/workflows/dockerImage.yml @@ -58,7 +58,7 @@ jobs: echo "127.0.0.1 localhost" | sudo tee -a /etc/hosts echo "fs.inotify.max_user_watches=524288" | sudo tee -a /etc/sysctl.conf npm run test:build - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: buildfiles path: build/**/* @@ -86,7 +86,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Download buildfiles artifact - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: buildfiles path: build From a35855a38a73e8252e2d4870417831ac326af3e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deborah=20K=C3=B6pfer?= Date: Wed, 2 Oct 2024 17:27:54 +0200 Subject: [PATCH 02/14] feat(send-message): add key binding for shift enter --- .../messageSubmitInterfaceComponent.tsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/components/messageSubmitInterface/messageSubmitInterfaceComponent.tsx b/src/components/messageSubmitInterface/messageSubmitInterfaceComponent.tsx index 3cde178c6..a87a56e68 100644 --- a/src/components/messageSubmitInterface/messageSubmitInterfaceComponent.tsx +++ b/src/components/messageSubmitInterface/messageSubmitInterfaceComponent.tsx @@ -44,6 +44,7 @@ import { convertToRaw, DraftHandleValue, EditorState, + getDefaultKeyBinding, RichUtils } from 'draft-js'; import { draftToMarkdown } from 'markdown-draft-js'; @@ -404,9 +405,21 @@ export const MessageSubmitInterfaceComponent = ({ ] ); + const handleCustomKeyBinding = (event) => { + if (event.key === 'Enter' && event.shiftKey) { + return 'shift-enter'; + } + return getDefaultKeyBinding(event); + }; + const handleEditorKeyCommand = useCallback( (command) => { const newState = RichUtils.handleKeyCommand(editorState, command); + if (command === 'shift-enter') { + handleButtonClick(); + return 'handled'; + } + if (newState) { handleEditorChange(newState); return 'handled'; @@ -1026,6 +1039,7 @@ export const MessageSubmitInterfaceComponent = ({ handleKeyCommand={ handleEditorKeyCommand } + keyBindingFn={handleCustomKeyBinding} placeholder={ hasRequestFeedbackCheckbox && requestFeedbackCheckboxChecked From 8ff4d2db9e40def9736c0e6768a4b514caa3f6a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deborah=20K=C3=B6pfer?= Date: Wed, 2 Oct 2024 17:37:35 +0200 Subject: [PATCH 03/14] style(custom-keybinding): useCallback dependency fix --- .../messageSubmitInterfaceComponent.tsx | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/components/messageSubmitInterface/messageSubmitInterfaceComponent.tsx b/src/components/messageSubmitInterface/messageSubmitInterfaceComponent.tsx index a87a56e68..33a5d4b96 100644 --- a/src/components/messageSubmitInterface/messageSubmitInterfaceComponent.tsx +++ b/src/components/messageSubmitInterface/messageSubmitInterfaceComponent.tsx @@ -412,23 +412,6 @@ export const MessageSubmitInterfaceComponent = ({ return getDefaultKeyBinding(event); }; - const handleEditorKeyCommand = useCallback( - (command) => { - const newState = RichUtils.handleKeyCommand(editorState, command); - if (command === 'shift-enter') { - handleButtonClick(); - return 'handled'; - } - - if (newState) { - handleEditorChange(newState); - return 'handled'; - } - return 'not-handled'; - }, - [editorState, handleEditorChange] - ); - const resizeTextarea = useCallback(() => { const textInput: any = textareaInputRef.current; // default values @@ -795,6 +778,23 @@ export const MessageSubmitInterfaceComponent = ({ userData ]); + const handleEditorKeyCommand = useCallback( + (command) => { + const newState = RichUtils.handleKeyCommand(editorState, command); + if (command === 'shift-enter') { + handleButtonClick(); + return 'handled'; + } + + if (newState) { + handleEditorChange(newState); + return 'handled'; + } + return 'not-handled'; + }, + [editorState, handleEditorChange, handleButtonClick] + ); + const handleRequestFeedbackCheckbox = useCallback(() => { setRequestFeedbackCheckboxChecked( (requestFeedbackCheckboxChecked) => !requestFeedbackCheckboxChecked From 3074ebc12cbca6bbecba97301bff318755a30899 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deborah=20K=C3=B6pfer?= Date: Tue, 8 Oct 2024 16:13:52 +0200 Subject: [PATCH 04/14] feat(routing): overview page after login --- src/components/app/Routing.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/app/Routing.tsx b/src/components/app/Routing.tsx index 77e9bc3ed..dec2d8054 100644 --- a/src/components/app/Routing.tsx +++ b/src/components/app/Routing.tsx @@ -384,10 +384,9 @@ export const Routing = (props: RoutingProps) => { From f4e44618f26e1ee229d2f3bbd0d46599df1c65c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deborah=20K=C3=B6pfer?= Date: Thu, 10 Oct 2024 10:24:48 +0200 Subject: [PATCH 05/14] feat(meeting-bookings): redirect to meeting overview DELPHI-192 --- src/containers/bookings/components/Calcom/Cal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/containers/bookings/components/Calcom/Cal.tsx b/src/containers/bookings/components/Calcom/Cal.tsx index 282eba9fa..5ee73e9dc 100644 --- a/src/containers/bookings/components/Calcom/Cal.tsx +++ b/src/containers/bookings/components/Calcom/Cal.tsx @@ -53,7 +53,7 @@ export default function Cal({ action: 'bookingSuccessful', callback: () => { history.push({ - pathname: `/sessions/user/view` + pathname: `/booking/events/gebuchte` }); } }); From b89f51a4c0d051b345290448bc29ba0a2cea9b3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deborah=20K=C3=B6pfer?= Date: Fri, 11 Oct 2024 11:45:57 +0200 Subject: [PATCH 06/14] feat(displayname): success info --- .../profile/ConsultantInformation.tsx | 28 +++++++++++++++++++ src/resources/i18n/de/common.json | 6 +++- src/resources/i18n/en/common.json | 2 ++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/src/components/profile/ConsultantInformation.tsx b/src/components/profile/ConsultantInformation.tsx index 0a98e4f99..aedb9f5a3 100644 --- a/src/components/profile/ConsultantInformation.tsx +++ b/src/components/profile/ConsultantInformation.tsx @@ -21,6 +21,8 @@ import { EditableData } from '../editableData/EditableData'; import { apiPatchUserData } from '../../api/apiPatchUserData'; import { useTranslation } from 'react-i18next'; import { useAppConfig } from '../../hooks/useAppConfig'; +import { Overlay, OVERLAY_FUNCTIONS, OverlayItem } from '../overlay/Overlay'; +import { ReactComponent as CheckIcon } from '../../resources/img/illustrations/check.svg'; export const ConsultantInformation = () => { const { t: translate } = useTranslation(); @@ -30,6 +32,7 @@ export const ConsultantInformation = () => { const [isSaveDisabled, setIsSaveDisabled] = useState(false); const [editedDisplayName, setEditedDisplayName] = useState(''); const [initialDisplayName, setInitialDisplayName] = useState(''); + const [successOverlayActive, setSuccessOverlayActive] = useState(false); const cancelEditButton: ButtonItem = { label: translate('profile.data.edit.button.cancel'), @@ -42,6 +45,18 @@ export const ConsultantInformation = () => { type: BUTTON_TYPES.LINK }; + const overlayItem: OverlayItem = { + svg: CheckIcon, + headline: translate('profile.data.displayNameInfo'), + buttonSet: [ + { + label: translate('profile.data.displayNameInfoClose'), + function: OVERLAY_FUNCTIONS.CLOSE, + type: BUTTON_TYPES.AUTO_CLOSE + } + ] + }; + const handleValidDisplayName = (displayName) => { setEditedDisplayName(displayName); }; @@ -55,6 +70,7 @@ export const ConsultantInformation = () => { .then(() => { reloadUserData().catch(console.log); setInitialDisplayName(editedDisplayName); + setSuccessOverlayActive(true); }) .catch((error) => { addNotification({ @@ -71,6 +87,12 @@ export const ConsultantInformation = () => { }); }; + const handleSuccessOverlayAction = (buttonFunction: string) => { + if (buttonFunction === OVERLAY_FUNCTIONS.CLOSE) { + setSuccessOverlayActive(false); + } + }; + useEffect(() => { if (editedDisplayName) { setIsSaveDisabled(false); @@ -140,6 +162,12 @@ export const ConsultantInformation = () => { /> )} + {successOverlayActive && ( + + )} ); }; diff --git a/src/resources/i18n/de/common.json b/src/resources/i18n/de/common.json index ddec3b044..1630e5d69 100644 --- a/src/resources/i18n/de/common.json +++ b/src/resources/i18n/de/common.json @@ -1413,6 +1413,8 @@ } }, "displayName": "Anzeigename", + "displayNameInfo": "Der Anzeigename wurde erfolgreich geändert. Es kann bis zu einer Stunde dauern, bis dieser angezeigt wird.", + "displayNameInfoClose": "Schließen", "edit": { "button": { "cancel": "Abbrechen", @@ -1930,7 +1932,9 @@ }, "info4": { "text": "Sie bleiben anonym und erhalten kostenfreie Beratung und Hilfe", - "title": "Anonym und kostenfrei" + "title": "Anonym und kostenfrei", + "link": "https://www.suchtberatung.digital", + "linkText": "Mehr Informationen zum Angebot von DigiSucht finden Sie hier." }, "register": { "buttonLabel": "Registrieren", diff --git a/src/resources/i18n/en/common.json b/src/resources/i18n/en/common.json index 8d56861a5..cb8a9c921 100644 --- a/src/resources/i18n/en/common.json +++ b/src/resources/i18n/en/common.json @@ -1398,6 +1398,8 @@ } }, "displayName": "Display name", + "displayNameInfo": "The display name has been successfully changed. It may take up to an hour for this to be displayed.", + "displayNameInfoClose": "Close", "edit": { "button": { "cancel": "Cancel", From aa42756a54b19253a18835bf85c7096c3c31eb82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deborah=20K=C3=B6pfer?= Date: Fri, 11 Oct 2024 15:48:46 +0200 Subject: [PATCH 07/14] feat(extend-welcome-screen): added link to digiSucht website DELPHI-195 --- .../ServiceExplanation.styles.scss | 4 ++++ .../serviceExplanation/ServiceExplanation.tsx | 4 ++-- .../resources/i18n/overwrites/de/common.json | 14 +++++++------- .../i18n/overwrites/de@informal/common.json | 6 +++--- src/resources/i18n/de/common.json | 8 ++++---- src/resources/i18n/en/common.json | 8 ++++---- 6 files changed, 24 insertions(+), 20 deletions(-) diff --git a/src/components/serviceExplanation/ServiceExplanation.styles.scss b/src/components/serviceExplanation/ServiceExplanation.styles.scss index 54a6139a4..e72230a3f 100644 --- a/src/components/serviceExplanation/ServiceExplanation.styles.scss +++ b/src/components/serviceExplanation/ServiceExplanation.styles.scss @@ -24,5 +24,9 @@ $iconSize: 32px; margin-top: $grid-base; color: $text-low-emphasis; } + + &__customLink { + text-decoration: underline; + } } } diff --git a/src/components/serviceExplanation/ServiceExplanation.tsx b/src/components/serviceExplanation/ServiceExplanation.tsx index 9c5993e2b..1c2f80854 100644 --- a/src/components/serviceExplanation/ServiceExplanation.tsx +++ b/src/components/serviceExplanation/ServiceExplanation.tsx @@ -50,7 +50,7 @@ export const ServiceExplanation = ({ ], { ns: ['consultingTypes', 'common'] } ), - text: translate( + text: `${translate( [ `consultingType.${consultingTypeId}.welcomeScreen.anonymous.text`, `consultingType.fallback.welcomeScreen.anonymous.text`, @@ -58,7 +58,7 @@ export const ServiceExplanation = ({ 'registration.welcomeScreen.info4.text' ], { ns: ['consultingTypes', 'common'] } - ) + )} ${translate('registration.welcomeScreen.info4.linkText')}` } ]; diff --git a/src/extensions/resources/i18n/overwrites/de/common.json b/src/extensions/resources/i18n/overwrites/de/common.json index e47a09a07..4f59f55a8 100644 --- a/src/extensions/resources/i18n/overwrites/de/common.json +++ b/src/extensions/resources/i18n/overwrites/de/common.json @@ -130,18 +130,18 @@ "overline": "Herzlich willkommen!", "welcomeScreen": { "info1": { - "text": "Finden Sie eine passende Beratungsstelle" + "text": "Finden Sie eine passende Beratungsstelle." }, "info2": { "title": "Nehmen Sie Kontakt auf", - "text": "Schreiben Sie eine Nachricht oder vereinbaren Sie einen Termin" + "text": "Schreiben Sie eine Nachricht oder vereinbaren Sie einen Termin." }, "subline": "So funktioniert die Beratung auf der DigiSucht Plattform:", "info3": { - "text": "Je nach Verfügbarkeit per Nachricht, im Textchat, im Videochat oder vor Ort" + "text": "Je nach Verfügbarkeit per Nachricht, im Textchat, im Videochat oder vor Ort." }, "info4": { - "text": "Sie bleiben auf Wunsch anonym und werden kostenfrei beraten" + "text": "Sie bleiben auf Wunsch anonym und werden kostenfrei beraten." } }, "overlay": { @@ -198,14 +198,14 @@ "username.step.title": "Bitte wählen Sie Ihren Benutzernamen", "welcomeScreen": { "info1": { - "text": "Finden Sie eine passende Beratungsstelle" + "text": "Finden Sie eine passende Beratungsstelle." }, "info2": { "title": "Nehmen Sie Kontakt auf", - "text": "Schreiben Sie eine Nachricht oder vereinbaren Sie einen Termin" + "text": "Schreiben Sie eine Nachricht oder vereinbaren Sie einen Termin." }, "info4": { - "text": "Schreiben Sie eine Nachricht oder vereinbaren Sie einen Termin" + "text": "Sie bleiben auf Wunsch anonym und werden kostenfrei beraten." } }, "overlay": { diff --git a/src/extensions/resources/i18n/overwrites/de@informal/common.json b/src/extensions/resources/i18n/overwrites/de@informal/common.json index 2871ed9e2..031e49d59 100644 --- a/src/extensions/resources/i18n/overwrites/de@informal/common.json +++ b/src/extensions/resources/i18n/overwrites/de@informal/common.json @@ -51,15 +51,15 @@ "overline": "Herzlich willkommen!", "welcomeScreen": { "info1": { - "text": "Finde eine passende Beratungsstelle" + "text": "Finde eine passende Beratungsstelle." }, "info2": { "title": "Nimm Kontakt auf", - "text": "Schreibe eine Nachricht oder vereinbare einen Termin" + "text": "Schreibe eine Nachricht oder vereinbare einen Termin." }, "subline": "So funktioniert die Beratung auf der DigiSucht Plattform:", "info3": { - "text": "Je nach Verfügbarkeit per Nachricht, im Textchat, im Videochat oder vor Ort" + "text": "Je nach Verfügbarkeit per Nachricht, im Textchat, im Videochat oder vor Ort." }, "info4": { "text": "Bleib auf Wunsch anonym und werde kostenfrei beraten!" diff --git a/src/resources/i18n/de/common.json b/src/resources/i18n/de/common.json index 1630e5d69..5b537d507 100644 --- a/src/resources/i18n/de/common.json +++ b/src/resources/i18n/de/common.json @@ -1919,19 +1919,19 @@ }, "welcomeScreen": { "info1": { - "text": "Für eine individuelle und geschützte Beratung", + "text": "Für eine individuelle und geschützte Beratung.", "title": "Einfache Registrierung" }, "info2": { - "text": "Sie schicken Ihre Nachricht an eine lokale Beratungsstelle", + "text": "Sie schicken Ihre Nachricht an eine lokale Beratungsstelle.", "title": "Nachricht verfassen" }, "info3": { - "text": "Innerhalb von 2 Werktagen bekommen Sie eine Antwort", + "text": "Innerhalb von 2 Werktagen bekommen Sie eine Antwort.", "title": "Persönliche und professionelle Beratung" }, "info4": { - "text": "Sie bleiben anonym und erhalten kostenfreie Beratung und Hilfe", + "text": "Sie bleiben anonym und erhalten kostenfreie Beratung und Hilfe.", "title": "Anonym und kostenfrei", "link": "https://www.suchtberatung.digital", "linkText": "Mehr Informationen zum Angebot von DigiSucht finden Sie hier." diff --git a/src/resources/i18n/en/common.json b/src/resources/i18n/en/common.json index cb8a9c921..4af197c2e 100644 --- a/src/resources/i18n/en/common.json +++ b/src/resources/i18n/en/common.json @@ -1896,19 +1896,19 @@ }, "welcomeScreen": { "info1": { - "text": "For individual and protected consultation", + "text": "For individual and protected consultation.", "title": "Simple registration" }, "info2": { - "text": "You send your message to a local counseling center", + "text": "You send your message to a local counseling center.", "title": "Compose message" }, "info3": { - "text": "Within 2 working days you will get an answer", + "text": "Within 2 working days you will get an answer.", "title": "Personal and professional advice" }, "info4": { - "text": "You remain anonymous and receive free advice and assistance", + "text": "You remain anonymous and receive free advice and assistance.", "title": "Anonymous and free of charge" }, "register": { From 35e823099d302ce42950b76eba9f12719a18b541 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deborah=20K=C3=B6pfer?= Date: Thu, 17 Oct 2024 10:39:00 +0200 Subject: [PATCH 08/14] test(fixing-tests): after routing change --- cypress/e2e/videoconference.cy.ts | 11 ++++------- cypress/support/commands/helper/fastLogin.ts | 6 ++++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/cypress/e2e/videoconference.cy.ts b/cypress/e2e/videoconference.cy.ts index fa0873d2c..dcb62f37f 100644 --- a/cypress/e2e/videoconference.cy.ts +++ b/cypress/e2e/videoconference.cy.ts @@ -140,7 +140,7 @@ describe('videoconference', () => { it('Start moderator video call', () => { cy.get('@appointmentId').then((id: any) => { const videoUrl = config.urls.consultantVideoConference - .replace('/:type', '/app') + .replace('/:type', '/overview') .replace('/:appointmentId', `/${id}`); cy.visit(videoUrl); @@ -151,7 +151,7 @@ describe('videoconference', () => { it('Start non existent moderator video call', () => { const videoUrl = config.urls.consultantVideoConference - .replace('/:type', '/app') + .replace('/:type', '/overview') .replace('/:appointmentId', `/${uuid()}`); cy.visit(videoUrl); @@ -248,10 +248,7 @@ describe('videoconference', () => { cy.visit(videoUrl); - cy.url().should( - 'contain', - '/sessions/consultant/sessionPreview' - ); + cy.url().should('contain', '/overview'); }); }); @@ -262,7 +259,7 @@ describe('videoconference', () => { cy.visit(videoUrl); - cy.url().should('contain', '/sessions/consultant/sessionPreview'); + cy.url().should('contain', '/overview'); }); }); diff --git a/cypress/support/commands/helper/fastLogin.ts b/cypress/support/commands/helper/fastLogin.ts index 6dc722bf4..3704994b8 100644 --- a/cypress/support/commands/helper/fastLogin.ts +++ b/cypress/support/commands/helper/fastLogin.ts @@ -44,11 +44,13 @@ const fastLoginCommand = (getWillReturn, setWillReturn) => tomorrow.getTime().toString() ); - cy.visit('/app'); - cy.wait('@usersData'); if (userId === USER_ASKER) { + cy.visit('/app'); + cy.wait('@usersData'); cy.wait('@askerSessions'); } else { + cy.visit('/sessions/consultant/sessionPreview'); + cy.wait('@usersData'); cy.wait('@consultantEnquiriesBase'); } }); From d69dd21254d9d4e67c29f5b90747f2466c169124 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deborah=20K=C3=B6pfer?= Date: Thu, 17 Oct 2024 10:41:17 +0200 Subject: [PATCH 09/14] ci(github-workflow): updating artifact actions --- .github/workflows/build.yml | 2 +- .github/workflows/dockerImage.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 258425f72..de3775e81 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -70,7 +70,7 @@ jobs: branch: ${{env.BRANCH}} force: true tags: true - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 if: failure() with: name: cypress-videos diff --git a/.github/workflows/dockerImage.yml b/.github/workflows/dockerImage.yml index 04c8a38ec..46ae1adbf 100644 --- a/.github/workflows/dockerImage.yml +++ b/.github/workflows/dockerImage.yml @@ -58,7 +58,7 @@ jobs: echo "127.0.0.1 localhost" | sudo tee -a /etc/hosts echo "fs.inotify.max_user_watches=524288" | sudo tee -a /etc/sysctl.conf npm run test:build - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: buildfiles path: build/**/* @@ -86,7 +86,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Download buildfiles artifact - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: buildfiles path: build From d02d2eac0f1e2d1e9db1afe3d3daa05c532775b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deborah=20K=C3=B6pfer?= Date: Wed, 30 Oct 2024 17:24:52 +0100 Subject: [PATCH 10/14] feat(sessionMenu): add tools and docu link --- src/components/sessionMenu/SessionMenu.tsx | 39 +++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/src/components/sessionMenu/SessionMenu.tsx b/src/components/sessionMenu/SessionMenu.tsx index d2b19ed51..6c61e678a 100644 --- a/src/components/sessionMenu/SessionMenu.tsx +++ b/src/components/sessionMenu/SessionMenu.tsx @@ -14,7 +14,8 @@ import { SessionTypeContext, useConsultingType, UserDataContext, - ActiveSessionContext + ActiveSessionContext, + TenantContext } from '../../globalState'; import { SessionItemInterface, @@ -69,6 +70,9 @@ import { useTranslation } from 'react-i18next'; import { LegalLinksContext } from '../../globalState/provider/LegalLinksProvider'; import { RocketChatUsersOfRoomContext } from '../../globalState/provider/RocketChatUsersOfRoomProvider'; import LegalLinks from '../legalLinks/LegalLinks'; +import { endpoints } from '../../resources/scripts/endpoints'; +import { refreshKeycloakAccessToken } from '../sessionCookie/refreshKeycloakAccessToken'; +import { apiGetUserDataBySessionId } from '../../api/apiGetUserDataBySessionId'; type TReducedSessionItemInterface = Omit< SessionItemInterface, @@ -105,6 +109,9 @@ export const SessionMenu = (props: SessionMenuProps) => { const [redirectToSessionsList, setRedirectToSessionsList] = useState(false); const [isRequestInProgress, setIsRequestInProgress] = useState(false); + const { tenant } = useContext(TenantContext); + const [askerItemId, setAskerItemId] = useState(); + const sessionListTab = useSearchParam('sessionListTab'); const getSessionListTab = () => `${sessionListTab ? `?sessionListTab=${sessionListTab}` : ''}`; @@ -327,6 +334,25 @@ export const SessionMenu = (props: SessionMenuProps) => { subRoute: 'userProfile' }); + const openToolsLink = () => { + refreshKeycloakAccessToken().then((resp) => { + const accessToken = resp.access_token; + window.open( + `${endpoints.budibaseTools( + activeSession.consultant.id + )}/consultantview?userId=${askerItemId}&access_token=${accessToken}`, + '_blank', + 'noopener' + ); + }); + }; + + useEffect(() => { + apiGetUserDataBySessionId(activeSession.item.id).then((resp) => { + setAskerItemId(resp.askerId); + }); + }, [activeSession?.item?.id, askerItemId]); // eslint-disable-line react-hooks/exhaustive-deps + if (redirectToSessionsList) { mobileListView(); return ; @@ -543,6 +569,17 @@ export const SessionMenu = (props: SessionMenuProps) => { )} + {!hasUserAuthority(AUTHORITIES.ASKER_DEFAULT, userData) && + tenant?.settings?.featureToolsEnabled && + activeSession?.item.id && ( +
openToolsLink()} + > + {translate('chatFlyout.toolsDocumentation')} +
+ )} + {!hasUserAuthority(AUTHORITIES.ASKER_DEFAULT, userData) && type !== SESSION_LIST_TYPES.ENQUIRY && activeSession.isSession && From bc04cfdd43da48a57e822df830890e86d43d18e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deborah=20K=C3=B6pfer?= Date: Tue, 26 Nov 2024 11:39:00 +0100 Subject: [PATCH 11/14] feat(sessionMenu): add translations --- src/resources/i18n/de/common.json | 3 ++- src/resources/i18n/en/common.json | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/resources/i18n/de/common.json b/src/resources/i18n/de/common.json index 5b537d507..91b8cda57 100644 --- a/src/resources/i18n/de/common.json +++ b/src/resources/i18n/de/common.json @@ -377,7 +377,8 @@ "imprint": "Impressum", "leaveGroupChat": "Chat verlassen", "remove": "Löschen", - "stopGroupChat": "Chat beenden" + "stopGroupChat": "Chat beenden", + "toolsDocumentation": "Tools und Dokumentation" }, "consultant": { "absent": { diff --git a/src/resources/i18n/en/common.json b/src/resources/i18n/en/common.json index 4af197c2e..bcebad8b5 100644 --- a/src/resources/i18n/en/common.json +++ b/src/resources/i18n/en/common.json @@ -367,7 +367,8 @@ "imprint": "Imprint", "leaveGroupChat": "Leave chat", "remove": "Delete", - "stopGroupChat": "End chat" + "stopGroupChat": "End chat", + "toolsDocumentation": "Tools and documentation" }, "consultant": { "absent": { From 0781a8519d8b320f8fd9b6a0cdedb09f5d21c4d7 Mon Sep 17 00:00:00 2001 From: tkuzynow Date: Fri, 17 Jan 2025 10:08:49 +0100 Subject: [PATCH 12/14] chore: adjust display name info --- src/resources/i18n/de/common.json | 2 +- src/resources/i18n/en/common.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/resources/i18n/de/common.json b/src/resources/i18n/de/common.json index 91b8cda57..d687b3932 100644 --- a/src/resources/i18n/de/common.json +++ b/src/resources/i18n/de/common.json @@ -1414,7 +1414,7 @@ } }, "displayName": "Anzeigename", - "displayNameInfo": "Der Anzeigename wurde erfolgreich geändert. Es kann bis zu einer Stunde dauern, bis dieser angezeigt wird.", + "displayNameInfo": "Der Anzeigename wurde erfolgreich geändert. Es kann bis zu einer Stunde dauern, bis dieser für die Ratsuchenden und in Ihrem Profil angezeigt wird.", "displayNameInfoClose": "Schließen", "edit": { "button": { diff --git a/src/resources/i18n/en/common.json b/src/resources/i18n/en/common.json index bcebad8b5..c632d2ff8 100644 --- a/src/resources/i18n/en/common.json +++ b/src/resources/i18n/en/common.json @@ -1399,7 +1399,7 @@ } }, "displayName": "Display name", - "displayNameInfo": "The display name has been successfully changed. It may take up to an hour for this to be displayed.", + "displayNameInfo": "The display name has been successfully changed. It may take up to an hour for it to appear to those seeking advice and on your profile.", "displayNameInfoClose": "Close", "edit": { "button": { From 0b12886772e74f5cd2865343b21ba42923398a3c Mon Sep 17 00:00:00 2001 From: tkuzynow Date: Fri, 17 Jan 2025 10:13:34 +0100 Subject: [PATCH 13/14] chore: adjust display name info for informal --- src/resources/i18n/de@informal/common.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/resources/i18n/de@informal/common.json b/src/resources/i18n/de@informal/common.json index 7b2629d6c..7ab1b208d 100644 --- a/src/resources/i18n/de@informal/common.json +++ b/src/resources/i18n/de@informal/common.json @@ -443,6 +443,7 @@ } } }, + "displayNameInfo": "Der Anzeigename wurde erfolgreich geändert. Es kann bis zu einer Stunde dauern, bis dieser für die Ratsuchenden und in Deinem Profil angezeigt wird.", "documentation": { "description": "Hast Du Fragen? Im Handbuch findest Du detaillierte Informationen zu den wichtigsten Funktionen der Online-Beratungsplattform." }, From 2d9df1eda268c47439c117386cc2292d7992d5be Mon Sep 17 00:00:00 2001 From: tkuzynow Date: Fri, 17 Jan 2025 11:52:49 +0100 Subject: [PATCH 14/14] chore: adjust display name info --- src/resources/i18n/de/common.json | 2 +- src/resources/i18n/de@informal/common.json | 2 +- src/resources/i18n/en/common.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/resources/i18n/de/common.json b/src/resources/i18n/de/common.json index d687b3932..f2c786a83 100644 --- a/src/resources/i18n/de/common.json +++ b/src/resources/i18n/de/common.json @@ -1414,7 +1414,7 @@ } }, "displayName": "Anzeigename", - "displayNameInfo": "Der Anzeigename wurde erfolgreich geändert. Es kann bis zu einer Stunde dauern, bis dieser für die Ratsuchenden und in Ihrem Profil angezeigt wird.", + "displayNameInfo": "Ihr Anzeigename wurde erfolgreich geändert. Es kann bis zu einer Stunde dauern, bis dieser für die Ratsuchenden und in Ihrem Profil angezeigt wird.", "displayNameInfoClose": "Schließen", "edit": { "button": { diff --git a/src/resources/i18n/de@informal/common.json b/src/resources/i18n/de@informal/common.json index 7ab1b208d..290961021 100644 --- a/src/resources/i18n/de@informal/common.json +++ b/src/resources/i18n/de@informal/common.json @@ -443,7 +443,7 @@ } } }, - "displayNameInfo": "Der Anzeigename wurde erfolgreich geändert. Es kann bis zu einer Stunde dauern, bis dieser für die Ratsuchenden und in Deinem Profil angezeigt wird.", + "displayNameInfo": "Dein Anzeigename wurde erfolgreich geändert. Es kann bis zu einer Stunde dauern, bis dieser für die Ratsuchenden und in Deinem Profil angezeigt wird.", "documentation": { "description": "Hast Du Fragen? Im Handbuch findest Du detaillierte Informationen zu den wichtigsten Funktionen der Online-Beratungsplattform." }, diff --git a/src/resources/i18n/en/common.json b/src/resources/i18n/en/common.json index c632d2ff8..f80090b0e 100644 --- a/src/resources/i18n/en/common.json +++ b/src/resources/i18n/en/common.json @@ -1399,7 +1399,7 @@ } }, "displayName": "Display name", - "displayNameInfo": "The display name has been successfully changed. It may take up to an hour for it to appear to those seeking advice and on your profile.", + "displayNameInfo": "Your display name has been successfully changed. It may take up to an hour for it to appear to those seeking advice and on your profile.", "displayNameInfoClose": "Close", "edit": { "button": {