From e2a91b466fda9c798afe0452a2993279ca4d43bb Mon Sep 17 00:00:00 2001 From: Podili Varshitha Date: Wed, 24 Jan 2024 15:20:12 +0530 Subject: [PATCH] TP-45652 | generatePassword fix (#802) * Basic Layout AmeyoUtility| Varshitha * Added new components| Varshitha * UploadNumbers layout| Varshitha * Some Api's,success and error msgs| Varshitha * Drawer with pagination,Api's | Varshitha * Api response catch error| Varshitha * Integration and Design changes| Varshitha * Added Loader| Varshitha * Added Loader| Varshitha * polling and msg change| Varshitha * toast and seperator added| Varshitha * changed file download| Varshitha * constants changed| Varshitha * separator changes| Varshitha * design changes| Varshitha * design changes| Varshitha * Height fix| Varshitha * successToast msg| Varshitha * uat changes| Varshitha * polling issue fix| Varshitha * routes fix from merge conflicts, removed unused code| Varshitha * TP-45652| no row data handle| Varshitha * TP-45652 | review resolve pr * TP- 45652 | pr changes| Varshitha * failed case added| Varshitha * TP-45652 | message handle| Varshitha * uat changes| Varshitha * pr review changes| Varshitha * updated roles| Varshitha * TP-45652 | whitelist change * TP-45652 | whitelist change | Varshitha * TP-45652 | generatePassword fix| Varshitha * TP-45652 | flagResponse Change| Varshitha --------- Co-authored-by: Varnit Goyal --- src/components/sidebar/SideNavBar.tsx | 21 +++++++++++++++++++-- src/layout/Routes.tsx | 5 +++++ src/reducers/commonSlice.ts | 5 +++++ src/service/clickStream.constant.ts | 4 ++++ 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/components/sidebar/SideNavBar.tsx b/src/components/sidebar/SideNavBar.tsx index d984f822..eeedb355 100644 --- a/src/components/sidebar/SideNavBar.tsx +++ b/src/components/sidebar/SideNavBar.tsx @@ -73,7 +73,8 @@ function SideNavBar({ isDc97User, isHRCChatUser }: ISideNavbarProps) { isPincodeMappingVisible, isInternalTeamLead, fieldTLAndClusterAndZonalManagers, - isAmeyoUtilityVisible + isAmeyoUtilityVisible, + isAmeyoGeneratePasswordVisible } = useSelector((state: RootState) => ({ user: state.common.userData, isPerformanceDashboardVisible: state?.common?.isPerformanceDashboardVisible, @@ -82,7 +83,8 @@ function SideNavBar({ isDc97User, isHRCChatUser }: ISideNavbarProps) { isTeamLead: state?.common?.isTeamLead, isInternalTeamLead: state?.common?.isInternalTeamLead, fieldTLAndClusterAndZonalManagers: state?.common?.fieldTLAndClusterAndZonalManagers, - isAmeyoUtilityVisible: state?.common?.isAmeyoUtilityVisible + isAmeyoUtilityVisible: state?.common?.isAmeyoUtilityVisible, + isAmeyoGeneratePasswordVisible: state?.common?.isAmeyoGeneratePasswordVisible })); const newDashboard = user?.revampedDashboardViewAllowed; @@ -416,6 +418,21 @@ function SideNavBar({ isDc97User, isHRCChatUser }: ISideNavbarProps) { clickStreamEvent={CLICKSTREAM_EVENT_NAMES.LH_LEAVE_MANAGEMENT_PAGE_CLICKED} /> ) : null} + {!isAmeyoUtilityVisible && isAmeyoGeneratePasswordVisible ? ( + } + inActiveIcon={} + name={'Ameyo Password'} + route={APP_ROUTES.TL_GENERATE_AMEYO_PASSWORD.path} + linkClickHandler={linkClickHandler} + currentPathname={pathname} + currentSearch={search} + clickStreamEvent={ + CLICKSTREAM_EVENT_NAMES.LH_TL_GENERATE_AMEYO_PASSWORD_SidePanelIconClick + } + /> + ) : null} {isAmeyoUtilityVisible ? ( + }, + TL_GENERATE_AMEYO_PASSWORD: { + path: '/generate-ameyo-password', + element: , + exact: true } }; diff --git a/src/reducers/commonSlice.ts b/src/reducers/commonSlice.ts index 3fc04cda..5deff651 100644 --- a/src/reducers/commonSlice.ts +++ b/src/reducers/commonSlice.ts @@ -244,6 +244,7 @@ export interface CommonState { feedbackFilters: string; serverDate: Date | string; isAmeyoUtilityVisible?: boolean; + isAmeyoGeneratePasswordVisible?: boolean; } export const CHECK_LOGIN = 'CHECK_LOGIN'; @@ -283,6 +284,7 @@ const initialState = { isPerformanceDashboardVisible: false, isPincodeMappingVisible: false, isAmeyoUtilityVisible: false, + isAmeyoGeneratePasswordVisible: false, isIdCardApprovalVisible: false, humanReminderCustomerDetailsLoading: false, generateAmeyoPassword: { @@ -323,9 +325,12 @@ export const commonSlice = createSlice({ const isPincodeMappingVisible = action.payload?.featureFlags?.agencyServiceability ?? false; const isAmeyoUtilityVisible = action.payload?.featureFlags?.ameyoSelfServeFlag ?? false; + const isAmeyoGeneratePasswordVisible = + action.payload?.featureFlags?.ameyoGeneratePasswordFlag ?? false; state.isIdCardApprovalVisible = isIdCardApprovalVisible; state.isAmeyoUtilityVisible = isAmeyoUtilityVisible; + state.isAmeyoGeneratePasswordVisible = isAmeyoGeneratePasswordVisible; state.isPincodeMappingVisible = isPincodeMappingVisible; state.isCallingAgent = roles?.includes(Roles.ROLE_CALLING_AGENT); diff --git a/src/service/clickStream.constant.ts b/src/service/clickStream.constant.ts index 905a5a9e..0278e1c5 100644 --- a/src/service/clickStream.constant.ts +++ b/src/service/clickStream.constant.ts @@ -74,6 +74,10 @@ export const CLICKSTREAM_EVENT_NAMES = Object.freeze({ name: 'LH_AMEYO_UTILITY_PAGE_CLICKED', description: 'Click on Ameyo Utility option on Side Panel' }, + LH_TL_GENERATE_AMEYO_PASSWORD_SidePanelIconClick: { + name: 'LH_TL_GENERATE_AMEYO_PASSWORD_SidePanelIconClick', + description: 'Click on TL Generate ameyo password option on Side Panel' + }, LH_LEAVE_MANAGEMENT_PAGE_CLICKED: { name: 'LH_LEAVE_MANAGEMENT_PAGE_CLICKED', description: 'Click on leave management option on Side Panel'