From 45dd69ea9653e35f8470241277fb8d1eae041c59 Mon Sep 17 00:00:00 2001 From: Kesava Krishnan Madavan Date: Wed, 19 Nov 2025 08:16:02 +0530 Subject: [PATCH 1/2] fix(station-login): visibility toggle for desktop login --- .../components/StationLogin/station-login.tsx | 8 +- .../StationLogin/station-login.types.ts | 8 ++ .../components/StationLogin/station-login.tsx | 91 +++++++++++++++++++ .../station-login/src/station-login/index.tsx | 3 +- .../src/station-login/station-login.types.ts | 9 +- playwright/Utils/stationLoginUtils.ts | 28 ++++++ playwright/tests/station-login-test.spec.ts | 43 ++++++++- .../cc/samples-cc-react-app/src/App.tsx | 61 ++++++++++--- 8 files changed, 235 insertions(+), 16 deletions(-) diff --git a/packages/contact-center/cc-components/src/components/StationLogin/station-login.tsx b/packages/contact-center/cc-components/src/components/StationLogin/station-login.tsx index 5d61f896f..ec38232ba 100644 --- a/packages/contact-center/cc-components/src/components/StationLogin/station-login.tsx +++ b/packages/contact-center/cc-components/src/components/StationLogin/station-login.tsx @@ -48,6 +48,7 @@ const StationLoginComponent: React.FunctionComponent selectedDeviceType, dialNumberValue, setSelectedTeamId, + hideDesktopLogin, } = props; const [dialNumberLabel, setDialNumberLabel] = useState(''); @@ -59,6 +60,9 @@ const StationLoginComponent: React.FunctionComponent const [dnErrorText, setDNErrorText] = useState(''); const {multiSignInModalRef, ccSignOutModalRef, saveConfirmDialogRef} = createStationLoginRefs(logger); + // Filter out Desktop mode if hideDesktopLogin is true + const filteredLoginOptions = hideDesktopLogin ? loginOptions.filter((option) => option !== DESKTOP) : loginOptions; + useEffect(() => { if (deviceType !== DESKTOP && Object.keys(LoginOptions).includes(deviceType)) { updateDialNumberLabel(deviceType, setDialNumberLabel, setDialNumberPlaceholder, logger); @@ -227,8 +231,8 @@ const StationLoginComponent: React.FunctionComponent selectedValueText={LoginOptions[selectedDeviceType]} > {Object.keys(LoginOptions).map((option: string, index: number) => { - // only show loginOptions provided by store - if (loginOptions.includes(option)) { + // only show loginOptions provided by store and filtered by hideDesktopLogin + if (filteredLoginOptions.includes(option)) { return (