From a5132d7ea1baf399a585a301506b201efcad64c4 Mon Sep 17 00:00:00 2001 From: Podili Varshitha Date: Thu, 27 Mar 2025 17:57:22 +0530 Subject: [PATCH] NTP-37553| extension deprecation for ameyo| varshitha (#1386) * NTP-37553|hrc testing| varshitha * NTP-47834|creating bundle and assets folder|varshitha * NTP-47834|creating bundle and assets folder|varshitha * NTP-00000| action fix | varshitha * NTP-00000| action fix | varshitha * NTP-00000| action fix | varshitha * NTP-50190 | removed hardcode checks | varshitha * NTP-28813| call connected event data| varshitha * NTP-28813| call connected event data| varshitha --- config.template.js | 4 ++- configuration.js | 4 ++- package.json | 4 +-- .../Ameyo/AmeyoCollapsibleToolbarV4.tsx | 22 +++++++++++----- src/pages/DashboardV3/HrDashBoardV3.tsx | 23 ++++++++++------ src/types/AppConfig.ts | 2 ++ vite.config.ts | 10 +++++++ yarn.lock | 26 +++++++++---------- 8 files changed, 63 insertions(+), 32 deletions(-) diff --git a/config.template.js b/config.template.js index 57f66de0..ac9cfcd9 100644 --- a/config.template.js +++ b/config.template.js @@ -24,5 +24,7 @@ window.config = { ALLOCATION_VIEW_GOOGLE_MAP_ID: '', HRC_CALL_AUTO_ACCEPT_TIMEOUT: '', SENTRY_DSN: '', - ALFRED_URL: '' + ALFRED_URL: '', + AMEYO_HRC_URL: '', + AMEYO_TELE_URL: '' }; diff --git a/configuration.js b/configuration.js index 02a465ef..82d3cb57 100644 --- a/configuration.js +++ b/configuration.js @@ -25,5 +25,7 @@ window.config = { GOOGLE_MAPS_KEY: "", GOOGLE_MAP_ID: "", HRC_CALL_AUTO_ACCEPT_TIMEOUT: '2', - ALFRED_URL: 'https://qa-alfred-ingester.np.navi-sa.in/v2/ingest/web/sessions' + ALFRED_URL: 'https://qa-alfred-ingester.np.navi-sa.in/v2/ingest/web/sessions', + AMEYO_HRC_URL: 'https://app8.ameyoemerge.in:7443', + AMEYO_TELE_URL: 'https://naviapp1.ameyo.net:8443', }; diff --git a/package.json b/package.json index aa1e52e5..828fe144 100644 --- a/package.json +++ b/package.json @@ -68,8 +68,8 @@ "@types/react-infinite-scroller": "1.2.5", "@types/react-transition-group": "^4.4.5", "@types/uuid": "^9.0.2", - "@universal-call-sdk/adapter-ameyo": "1.3.3", - "@universal-call-sdk/core": "1.3.3", + "@universal-call-sdk/adapter-ameyo": "2.0.6", + "@universal-call-sdk/core": "2.0.4", "ag-grid-community": "^28.1.1", "ag-grid-react": "^28.1.1", "autoprefixer": "^10.4.16", diff --git a/src/components/Ameyo/AmeyoCollapsibleToolbarV4.tsx b/src/components/Ameyo/AmeyoCollapsibleToolbarV4.tsx index 1e222c51..d40ee444 100644 --- a/src/components/Ameyo/AmeyoCollapsibleToolbarV4.tsx +++ b/src/components/Ameyo/AmeyoCollapsibleToolbarV4.tsx @@ -158,6 +158,20 @@ export const AmeyoCollapsibleToolbarV4 = (props: { }>({ lan: '', phoneNumber: '', crtObjectId: '' }); const [callCountEnabled, setCallCountEnabled] = useState(false); const ameyoCallsCountIntervalRef = useRef<() => void>(); + + const configUrl = window?.config?.AMEYO_TELE_URL; + const adapterOptions = useMemo( + () => + ({ + baseUrl: `${configUrl}/ameyoTele`, + loginUrl: 'naviapp1.ameyo.net', + eventListenerUrl: `${configUrl}/ameyorestapi/pushes?`, + userName: authData?.email, + password: authData?.ameyoKey + } as any), + [authData?.email, authData?.ameyoKey] + ); + const { acceptCall: acceptCallNew, rejectCall: rejectCallNew, @@ -212,13 +226,7 @@ export const AmeyoCollapsibleToolbarV4 = (props: { ); } }, - adapterOptions: { - baseUrl: 'https://naviapp1.ameyo.net:8443', - loginUrl: 'naviapp1.ameyo.net', - eventListenerUrl: 'https://naviapp1.ameyo.net:8443/ameyorestapi/pushes?', - userName: authData?.email, - password: authData?.ameyoKey - } + adapterOptions }); const [multiTabDialerDisabled, setMultiTabDialerDisabled] = useState(false); diff --git a/src/pages/DashboardV3/HrDashBoardV3.tsx b/src/pages/DashboardV3/HrDashBoardV3.tsx index 78008368..412dc364 100644 --- a/src/pages/DashboardV3/HrDashBoardV3.tsx +++ b/src/pages/DashboardV3/HrDashBoardV3.tsx @@ -1,4 +1,4 @@ -import { useEffect, useRef, useState } from 'react'; +import { useEffect, useMemo, useRef, useState } from 'react'; import Layout from 'src/layout/Layout'; import styles from '../DashboardV2/HrDashboard.module.scss'; import { @@ -119,6 +119,19 @@ const HrDashBoardV3 = () => { const authData = useSelector((state: RootState) => state.common.userData); + const configUrl = window?.config?.AMEYO_HRC_URL; + const adapterOptions = useMemo( + () => + ({ + baseUrl: `${configUrl}/ameyoHrc`, + loginUrl: 'app8.ameyoemerge.in', + eventListenerUrl: `${configUrl}/ameyorestapi/pushes?`, + userName: authData?.email, + password: authData?.ameyoKey + } as any), + [authData?.email, authData?.ameyoKey] + ); + const { acceptCall: acceptCallNew, rejectCall: rejectCallNew, @@ -176,13 +189,7 @@ const HrDashBoardV3 = () => { ); } }, - adapterOptions: { - baseUrl: 'https://app8.ameyoemerge.in:7443', - loginUrl: 'app8.ameyoemerge.in', - eventListenerUrl: 'https://app8.ameyoemerge.in:7443/ameyorestapi/pushes?', - userName: authData?.email, - password: authData?.ameyoKey - } as any + adapterOptions }); const callDisconnectSource = useRef(null); diff --git a/src/types/AppConfig.ts b/src/types/AppConfig.ts index 4e7aec3d..a9250124 100644 --- a/src/types/AppConfig.ts +++ b/src/types/AppConfig.ts @@ -26,6 +26,8 @@ export interface AppConfig { ALLOCATION_VIEW_GOOGLE_MAP_ID: string; HRC_CALL_AUTO_ACCEPT_TIMEOUT: string; ALFRED_URL: string; + AMEYO_HRC_URL: string; + AMEYO_TELE_URL: string; } export enum XREDIRECTTO { diff --git a/vite.config.ts b/vite.config.ts index e3ee972d..2693e91f 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -109,6 +109,16 @@ export default async ({ mode }) => { target: 'https://qa-crm-ops-portal.np.navi-ppl.in/otlp/v1/logs', changeOrigin: true, rewrite: path => path.replace(/^\/cybertron-logs/, '') + }, + '/ameyoHrc': { + target: 'https://app8.ameyoemerge.in:7443', + changeOrigin: true, + rewrite: path => path.replace(/^\/ameyoHrc/, '') + }, + '/ameyoTele': { + target: 'https://naviapp1.ameyo.net:8443', + changeOrigin: true, + rewrite: path => path.replace(/^\/ameyoTele/, '') } } }, diff --git a/yarn.lock b/yarn.lock index 59d6b3fa..a7137668 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3390,23 +3390,23 @@ "@typescript-eslint/types" "5.56.0" eslint-visitor-keys "^3.3.0" -"@universal-call-sdk/adapter-ameyo@1.3.3": - version "1.3.3" - resolved "https://nexus.cmd.navi-tech.in/repository/npm-packages/@universal-call-sdk/adapter-ameyo/-/adapter-ameyo-1.3.3.tgz#e0efbe273b8d7d12a1d29314200dfc221c365cfe" - integrity sha512-abMbhxXVp4J0F5rwXcwG3HJRkKVoPCp5cPHbgYQvz5sSFRC2I7IIRyuOOzpncqqqx7v0s6NPkD/Tl2ye2kGaxQ== +"@universal-call-sdk/adapter-ameyo@2.0.6": + version "2.0.6" + resolved "https://nexus.cmd.navi-tech.in/repository/npm-packages/@universal-call-sdk/adapter-ameyo/-/adapter-ameyo-2.0.6.tgz#37892fa8e46bd63a05978ea465ac7723306c1559" + integrity sha512-hcqgi/u7Q+b2PO7JCSVTKVKQ9JuupekvdD1HSgnngXn8/TY/hz+ns4bUoOn7lU3gIBwlNX6Z+Fk74PZ+2GTfLA== dependencies: - "@universal-call-sdk/common" "^1.3.3" + "@universal-call-sdk/common" "^2.0.6" uuid "^11.0.3" -"@universal-call-sdk/common@^1.3.3": - version "1.3.3" - resolved "https://nexus.cmd.navi-tech.in/repository/npm-packages/@universal-call-sdk/common/-/common-1.3.3.tgz#616b4a4933ea6b3c83da0b79f4643b8bb901f119" - integrity sha512-BK3lU5G2tJGSSzmw25u29CjpAn97osSqw/ken49yUsIWRurW1zgoAktIyFQgVDt3ixt0dukkGPQi/PiByOF06g== +"@universal-call-sdk/common@^2.0.6": + version "2.0.6" + resolved "https://nexus.cmd.navi-tech.in/repository/npm-packages/@universal-call-sdk/common/-/common-2.0.6.tgz#c1ff64dea07a630dbf49acf5e08e2dfc52c337b5" + integrity sha512-CoDYOyBdEKvy4LSxENWRCdU0OTs+Op6CABcqRFzg3Fug/+smqM2TNcYNLFGrRmzF+Cg8qbu2O/9FJPtxYnf02Q== -"@universal-call-sdk/core@1.3.3": - version "1.3.3" - resolved "https://nexus.cmd.navi-tech.in/repository/npm-packages/@universal-call-sdk/core/-/core-1.3.3.tgz#ad811b55e39f3da14ad2fd65386423a7622729b5" - integrity sha512-QFzeTSt6NKYpExAOlmvwfdktVu4MypxaTxfZ5Ugj1nkuX3chFRTqITCmXISgafMJzycH7XZBV655JhxiPeQTyQ== +"@universal-call-sdk/core@2.0.4": + version "2.0.4" + resolved "https://nexus.cmd.navi-tech.in/repository/npm-packages/@universal-call-sdk/core/-/core-2.0.4.tgz#a4f68b8fdbbf7e9cf67493472d3d24111d438bde" + integrity sha512-j4kdd8l5J/gosltH/NiFzmDgH6/ucWv654wLHfplXgd5jOvkoQQZ7jkTsVo7t1L59Ed38jf+Ev5nnO4ZUQYsJQ== dependencies: "@types/node" "^22.7.7" path "^0.12.7"