From 19ab9cd70fa8dcd271f7531a34688c67f8e2686d Mon Sep 17 00:00:00 2001 From: mythilytm Date: Wed, 8 Jan 2025 10:59:22 -0500 Subject: [PATCH 1/9] Add a tile for switchboarding in Queues page --- plugin-hrm-form/src/HrmFormPlugin.tsx | 3 ++ .../queuesView/SwitchboardingCard.tsx | 45 +++++++++++++++++++ .../src/components/queuesView/index.ts | 22 +++++++++ plugin-hrm-form/src/types/types.ts | 1 + 4 files changed, 71 insertions(+) create mode 100644 plugin-hrm-form/src/components/queuesView/SwitchboardingCard.tsx create mode 100644 plugin-hrm-form/src/components/queuesView/index.ts diff --git a/plugin-hrm-form/src/HrmFormPlugin.tsx b/plugin-hrm-form/src/HrmFormPlugin.tsx index 45187f93b9..68c52ebd2d 100644 --- a/plugin-hrm-form/src/HrmFormPlugin.tsx +++ b/plugin-hrm-form/src/HrmFormPlugin.tsx @@ -34,6 +34,7 @@ import { getAseloFeatureFlags, getHrmConfig, initializeConfig, subscribeToConfig import { setUpSharedStateClient } from './utils/sharedState'; import { FeatureFlags } from './types/types'; import { setUpReferrableResources } from './components/resources/setUpReferrableResources'; +import QueuesView from './components/queuesView'; import TeamsView from './components/teamsView'; import { setUpCounselorToolkits } from './components/toolkits/setUpCounselorToolkits'; import { setUpTransferComponents } from './components/transfer/setUpTransferComponents'; @@ -131,6 +132,8 @@ const setUpComponents = ( TeamsView.setUpTeamsViewFilters(); TeamsView.setUpWorkerDirectoryFilters(); + QueuesView.setUpSwitchboarding(); + if (featureFlags.enable_conferencing) setupConferenceComponents(); }; diff --git a/plugin-hrm-form/src/components/queuesView/SwitchboardingCard.tsx b/plugin-hrm-form/src/components/queuesView/SwitchboardingCard.tsx new file mode 100644 index 0000000000..c6ac7894b6 --- /dev/null +++ b/plugin-hrm-form/src/components/queuesView/SwitchboardingCard.tsx @@ -0,0 +1,45 @@ +import React, { useState } from 'react'; +import { QueuesStats, Template, Manager } from '@twilio/flex-ui'; +import { FormLabel, FormGroup, FormControlLabel, FormControl, FormHelperText, Switch } from '@material-ui/core'; + +import { getAseloFeatureFlags } from '../../hrmConfig'; +import { Box } from '../../styles'; + +// eslint-disable-next-line import/no-unused-modules +export const setUpSwitchboarding = () => { + // if (!getAseloFeatureFlags().enable_switchboarding) return; + + QueuesStats.AggregatedQueuesDataTiles.Content.add(, { + sortOrder: -1, + }); +}; + +const SwitchboardingTile = () => { + const [isSwitchboarding, setIsSwitchboarding] = useState(false); + + const handleChange = (event: React.ChangeEvent) => { + setIsSwitchboarding(!isSwitchboarding); + }; + + const renderSwitch = () => ( + + Switchboardingfl + + } + label="Switchboardingl" + /> + + + ); + + const queues = Manager.getInstance()?.store.getState()?.flex?.realtimeQueues?.queuesList; + const queuesConfig = Manager.getInstance()?.store.getState()?.flex?.realtimeQueues?.queuesConfig; + console.log('>>> queues', queues, queuesConfig); + + return ( + <> + {renderSwitch()} + + ); +}; diff --git a/plugin-hrm-form/src/components/queuesView/index.ts b/plugin-hrm-form/src/components/queuesView/index.ts new file mode 100644 index 0000000000..3c7736517b --- /dev/null +++ b/plugin-hrm-form/src/components/queuesView/index.ts @@ -0,0 +1,22 @@ +/** + * Copyright (C) 2021-2023 Technology Matters + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see https://www.gnu.org/licenses/. + */ +import { setUpSwitchboarding } from './SwitchboardingCard'; + +const QueuesView = { + setUpSwitchboarding, +}; + +export default QueuesView; diff --git a/plugin-hrm-form/src/types/types.ts b/plugin-hrm-form/src/types/types.ts index 96e1d5f66b..b97825774a 100644 --- a/plugin-hrm-form/src/types/types.ts +++ b/plugin-hrm-form/src/types/types.ts @@ -289,6 +289,7 @@ export type FeatureFlags = { enable_save_insights: boolean; // Enables Saving Aditional Data on Insights enable_separate_timeline_view: boolean; // Enables a limited inline case timelinbe with a link to the full timeline enable_sort_cases: boolean; // Enables Sorting at Case List + enable_switchboarding: boolean; // Enables Switchboarding enable_teams_view_enhancements2: boolean; // Enables custom Teams View UI with labels enable_transfers: boolean; // Enables Transfering Contacts enable_twilio_transcripts: boolean; // Enables Viewing Transcripts Stored at Twilio From 9d8f28be826578d854175799558d8d14890463dc Mon Sep 17 00:00:00 2001 From: mythilytm Date: Wed, 8 Jan 2025 15:57:22 -0500 Subject: [PATCH 2/9] add a modal for queues --- .../queuesView/SwitchboardingCard.tsx | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/plugin-hrm-form/src/components/queuesView/SwitchboardingCard.tsx b/plugin-hrm-form/src/components/queuesView/SwitchboardingCard.tsx index c6ac7894b6..f68817c658 100644 --- a/plugin-hrm-form/src/components/queuesView/SwitchboardingCard.tsx +++ b/plugin-hrm-form/src/components/queuesView/SwitchboardingCard.tsx @@ -1,3 +1,19 @@ +/** + * Copyright (C) 2021-2023 Technology Matters + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see https://www.gnu.org/licenses/. + */ + import React, { useState } from 'react'; import { QueuesStats, Template, Manager } from '@twilio/flex-ui'; import { FormLabel, FormGroup, FormControlLabel, FormControl, FormHelperText, Switch } from '@material-ui/core'; @@ -16,9 +32,11 @@ export const setUpSwitchboarding = () => { const SwitchboardingTile = () => { const [isSwitchboarding, setIsSwitchboarding] = useState(false); + const [openQueuesModal, setOpenQueuesModal] = useState(false); const handleChange = (event: React.ChangeEvent) => { - setIsSwitchboarding(!isSwitchboarding); + // setIsSwitchboarding(!isSwitchboarding); + setOpenQueuesModal(!openQueuesModal); }; const renderSwitch = () => ( @@ -40,6 +58,24 @@ const SwitchboardingTile = () => { return ( <> {renderSwitch()} + {openQueuesModal && ( + +

Queues

+
    + {Array.isArray(queues) && + queues.map((queue: any) => ( +
  • + {queue.friendlyName} + {queue.sid} + {queuesConfig[queue.sid]?.config?.targetWorkersExpression} +
  • + ))} +
+ +
+ )} ); }; From 22a680399be83b83d3d689ab20dcc4753421b077 Mon Sep 17 00:00:00 2001 From: mythilytm Date: Wed, 8 Jan 2025 15:58:11 -0500 Subject: [PATCH 3/9] change recordings flag --- .../helplines/uscr/configs/service-configuration/common.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twilio-iac/helplines/uscr/configs/service-configuration/common.json b/twilio-iac/helplines/uscr/configs/service-configuration/common.json index 1ce02104ee..8aa4fe0119 100644 --- a/twilio-iac/helplines/uscr/configs/service-configuration/common.json +++ b/twilio-iac/helplines/uscr/configs/service-configuration/common.json @@ -5,7 +5,7 @@ "web" ], "config_flags": { - "enableExternalRecordings": true + "enableExternalRecordings": false }, "feature_flags": { "enable_voice_recordings": true, From 1d3384ae51491051a58fadb535b704402ab7bbdd Mon Sep 17 00:00:00 2001 From: mythilytm Date: Wed, 8 Jan 2025 16:03:13 -0500 Subject: [PATCH 4/9] revert recordings flag --- .../helplines/uscr/configs/service-configuration/common.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twilio-iac/helplines/uscr/configs/service-configuration/common.json b/twilio-iac/helplines/uscr/configs/service-configuration/common.json index 8aa4fe0119..1ce02104ee 100644 --- a/twilio-iac/helplines/uscr/configs/service-configuration/common.json +++ b/twilio-iac/helplines/uscr/configs/service-configuration/common.json @@ -5,7 +5,7 @@ "web" ], "config_flags": { - "enableExternalRecordings": false + "enableExternalRecordings": true }, "feature_flags": { "enable_voice_recordings": true, From c3dd7b6dffc9cc2138c0eab8495c7d4ff704eb5d Mon Sep 17 00:00:00 2001 From: mythilytm Date: Wed, 8 Jan 2025 18:50:09 -0500 Subject: [PATCH 5/9] rename dialog related styled components to be more general --- plugin-hrm-form/src/___tests__/mockStyled.ts | 6 +++--- .../SaveContactCallTypeDialog.tsx | 18 +++++++++--------- .../src/components/callTypeButtons/styles.tsx | 6 +++--- .../src/components/case/CloseCaseDialog.tsx | 6 +++--- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/plugin-hrm-form/src/___tests__/mockStyled.ts b/plugin-hrm-form/src/___tests__/mockStyled.ts index 72b242c31b..aae9e21bdc 100644 --- a/plugin-hrm-form/src/___tests__/mockStyled.ts +++ b/plugin-hrm-form/src/___tests__/mockStyled.ts @@ -150,12 +150,12 @@ jest.mock('../components/callTypeButtons/styles', () => ({ Label: 'Label', DataCallTypeButton: 'DataCallTypeButton', NonDataCallTypeButton: 'NonDataCallTypeButton', - CloseTaskDialog: 'CloseTaskDialog', - CloseTaskDialogText: 'CloseTaskDialogText', + DialogStyled: 'DialogStyled', + DialogStyledText: 'DialogStyledText', ConfirmButton: 'ConfirmButton', CancelButton: 'CancelButton', CloseButton: 'CloseButton', - NonDataCallTypeDialogContainer: 'NonDataCallTypeDialogContainer', + DialogContainer: 'DialogContainer', })); jest.mock('../components/queuesStatus/styles', () => ({ diff --git a/plugin-hrm-form/src/components/callTypeButtons/SaveContactCallTypeDialog.tsx b/plugin-hrm-form/src/components/callTypeButtons/SaveContactCallTypeDialog.tsx index c31b665b34..e9191ab495 100644 --- a/plugin-hrm-form/src/components/callTypeButtons/SaveContactCallTypeDialog.tsx +++ b/plugin-hrm-form/src/components/callTypeButtons/SaveContactCallTypeDialog.tsx @@ -19,9 +19,9 @@ import { Template } from '@twilio/flex-ui'; import { Box, Row, HiddenText } from '../../styles'; import { - CloseTaskDialog, - CloseTaskDialogText, - NonDataCallTypeDialogContainer, + DialogStyled, + DialogStyledText, + DialogContainer, ConfirmButton, CancelButton, CloseButton, @@ -47,18 +47,18 @@ const SaveContactCallTypeDialog: React.FC = ({ handleConfirm, handleCancel, }) => ( - + - +