NTP-50551 | Side NavBar Revamp Hotfix (#1430)
* NTP-50551 | Side NavBar Revamp Hotfix * NTP-50551 | Side NavBar Revamp Hotfix
This commit is contained in:
@@ -137,7 +137,7 @@ const SideBarItems = [
|
||||
clickStreamEvent: CLICKSTREAM_EVENT_NAMES.LH_TELE_SENSEI_SidePanelIconClick,
|
||||
isEnabled: {
|
||||
featureFlags: [],
|
||||
roles: []
|
||||
roles: [Roles.ROLE_NAVI_TELE_INHOUSE_TEAM_LEAD]
|
||||
}
|
||||
},
|
||||
// Allocation
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
import axiosInstance, { ApiKeys, getApiUrl, logError } from '@cp/src/utils/ApiHelper';
|
||||
import axiosInstance, {
|
||||
API_STATUS_CODE,
|
||||
ApiKeys,
|
||||
getApiUrl,
|
||||
logError
|
||||
} from '@cp/src/utils/ApiHelper';
|
||||
import { getFileDownload } from '@cp/src/utils/commonUtils';
|
||||
import { IFeedbackLevelReportPayload } from './interface';
|
||||
import { toast } from '@navi/web-ui/lib/primitives/Toast';
|
||||
@@ -35,6 +40,9 @@ export const handleReportDownload = (reportType: string, payload?: IFeedbackLeve
|
||||
getFileDownload(fileUrl, true);
|
||||
toast.success('You will receive an email shortly!');
|
||||
}
|
||||
if (response.status === API_STATUS_CODE.OK) {
|
||||
toast.success('You will receive an email shortly!');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
logError(error);
|
||||
|
||||
@@ -15,7 +15,9 @@ import {
|
||||
isCase1630FieldReportVisible,
|
||||
isFeedback1630FieldReportVisible,
|
||||
isCaseInHouseFieldReportVisible,
|
||||
isAgencyCaseReportVisible
|
||||
isAgencyCaseReportVisible,
|
||||
isCase1630FieldReportVisibleForReportee,
|
||||
isFeedback1630FieldReportVisibleForReportee
|
||||
} from './utils';
|
||||
|
||||
export enum ReportType {
|
||||
@@ -90,9 +92,9 @@ export const REPORTS: ReportTypes[] = [
|
||||
// INTERACTION_VIEW_FIELD
|
||||
{
|
||||
id: 'feedback',
|
||||
title: 'Feedback report',
|
||||
title: 'Feedback level report',
|
||||
type: ReportType.INTERACTION_VIEW_FIELD,
|
||||
description: 'Feedback report for field',
|
||||
description: 'Feedback level report for field',
|
||||
isVisible: isFeedbackReportVisible,
|
||||
clickStreamEvent: CLICKSTREAM_EVENT_NAMES.LH_Reports_Feedback_DownloadClick
|
||||
},
|
||||
@@ -114,15 +116,33 @@ export const REPORTS: ReportTypes[] = [
|
||||
isVisible: isCase1630FieldReportVisible,
|
||||
clickStreamEvent: CLICKSTREAM_EVENT_NAMES.LH_Reports_Case1630_DownloadClick
|
||||
},
|
||||
// LAN_VIEW_FIELD_16_30_REPORTEE
|
||||
{
|
||||
id: 'case-16-30-reportee',
|
||||
title: 'Case level report for 16-30 field',
|
||||
type: ReportType.LAN_REPORTEE_VIEW_FIELD_16_30,
|
||||
description: 'Case level report for 16-30 field',
|
||||
isVisible: isCase1630FieldReportVisibleForReportee,
|
||||
clickStreamEvent: CLICKSTREAM_EVENT_NAMES.LH_Reports_Case1630_DownloadClick
|
||||
},
|
||||
// INTERACTION_VIEW_FIELD_16_30
|
||||
{
|
||||
id: 'feedback-16-30',
|
||||
title: 'Feedback report for 16-30 field',
|
||||
title: 'Feedback level report for 16-30 field',
|
||||
type: ReportType.INTERACTION_VIEW_FIELD_16_30,
|
||||
description: 'Feedback report for 16-30 field',
|
||||
description: 'Feedback level report for 16-30 field',
|
||||
isVisible: isFeedback1630FieldReportVisible,
|
||||
clickStreamEvent: CLICKSTREAM_EVENT_NAMES.LH_Reports_Feedback1630_DownloadClick
|
||||
},
|
||||
// INTERACTION_REPORTEE_VIEW_FIELD_16_30
|
||||
{
|
||||
id: 'feedback-16-30-reportee',
|
||||
title: 'Feedback level report for 16-30 field',
|
||||
type: ReportType.INTERACTION_REPORTEE_VIEW_FIELD_16_30,
|
||||
description: 'Feedback level report for 16-30 field',
|
||||
isVisible: isFeedback1630FieldReportVisibleForReportee,
|
||||
clickStreamEvent: CLICKSTREAM_EVENT_NAMES.LH_Reports_Feedback1630_DownloadClick
|
||||
},
|
||||
// LAN_VIEW_INHOUSE_FIELD
|
||||
{
|
||||
id: 'case-inhouse',
|
||||
@@ -135,9 +155,9 @@ export const REPORTS: ReportTypes[] = [
|
||||
// AGENCY_CASE_LEVEL_VIEW
|
||||
{
|
||||
id: 'agency-case',
|
||||
title: 'Agency case level report',
|
||||
title: 'Case level report for Agency',
|
||||
type: ReportType.AGENCY_CASE_LEVEL_VIEW,
|
||||
description: 'Agency case level report',
|
||||
description: 'Case level report for Agency',
|
||||
isVisible: isAgencyCaseReportVisible,
|
||||
clickStreamEvent: CLICKSTREAM_EVENT_NAMES.LH_Reports_AgencyCase_DownloadClick
|
||||
},
|
||||
@@ -153,16 +173,16 @@ export const REPORTS: ReportTypes[] = [
|
||||
// INTERACTION_VIEW_TELE
|
||||
{
|
||||
id: 'feedback-inhouse-tele',
|
||||
title: 'Feedback report for inhouse tele',
|
||||
title: 'Feedback level report for inhouse tele',
|
||||
type: ReportType.INTERACTION_VIEW_TELE,
|
||||
description: 'Feedback report for inhouse tele',
|
||||
description: 'Feedback level report for inhouse tele',
|
||||
isVisible: isFeedbackInHouseTeleReportVisible,
|
||||
clickStreamEvent: CLICKSTREAM_EVENT_NAMES.LH_Reports_FeedbackInhouseTele_DownloadClick
|
||||
},
|
||||
// AGENT_VIEW_TELE
|
||||
{
|
||||
id: 'agent-inhouse-tele',
|
||||
title: 'Agent report for inhouse tele',
|
||||
title: 'Agent level report for inhouse tele',
|
||||
type: ReportType.AGENT_VIEW_TELE,
|
||||
description: 'Agent report for inhouse tele',
|
||||
isVisible: isAgentInHouseTeleReportVisible,
|
||||
@@ -171,9 +191,9 @@ export const REPORTS: ReportTypes[] = [
|
||||
// COSMOS_AGENTS_CASE_LEVEL_VIEW
|
||||
{
|
||||
id: 'cosmos-agent',
|
||||
title: 'Cosmos agent report',
|
||||
title: 'Case level report for Cosmos Support Agents',
|
||||
type: ReportType.COSMOS_AGENTS_CASE_LEVEL_VIEW,
|
||||
description: 'Cosmos agent report',
|
||||
description: 'Case level report for Cosmos Support Agents',
|
||||
isVisible: isCosmosAgentReportVisible,
|
||||
clickStreamEvent: CLICKSTREAM_EVENT_NAMES.LH_Reports_CosmosAgent_DownloadClick
|
||||
},
|
||||
@@ -182,16 +202,16 @@ export const REPORTS: ReportTypes[] = [
|
||||
id: 'case-30plus',
|
||||
title: 'Case level report for 30 plus tele',
|
||||
type: ReportType.LAN_VIEW_TELE_30_PLUS,
|
||||
description: 'Detailed report for cases over 30 days in telemarketing queue',
|
||||
description: 'Case level report for 30 plus tele',
|
||||
isVisible: isCase30PlusTeleReportVisible,
|
||||
clickStreamEvent: CLICKSTREAM_EVENT_NAMES.LH_Reports_Case30Plus_DownloadClick
|
||||
},
|
||||
// INTERACTION_VIEW_TELE_30_PLUS
|
||||
{
|
||||
id: 'feedback-30plus',
|
||||
title: 'Feedback report for 30 plus tele',
|
||||
title: 'Feedback level report for 30 plus tele',
|
||||
type: ReportType.INTERACTION_VIEW_TELE_30_PLUS,
|
||||
description: 'Feedback report for 30 plus tele',
|
||||
description: 'Feedback level report for 30 plus tele',
|
||||
isVisible: isFeedback30PlusTeleReportVisible,
|
||||
clickStreamEvent: CLICKSTREAM_EVENT_NAMES.LH_Reports_Feedback30Plus_DownloadClick
|
||||
}
|
||||
|
||||
@@ -43,30 +43,49 @@ export const useUserRoles = (roles: string[] = []): ReturnType<typeof checkRoles
|
||||
|
||||
export const isCosmosAgentReportVisible = (roles: string[]): boolean =>
|
||||
checkRoles(roles).isNaviTeleInhouseTeamLead();
|
||||
|
||||
export const isInHouseTeleReportVisible = (roles: string[]): boolean =>
|
||||
checkRoles(roles).isNaviTeleInhouseTeamLead();
|
||||
|
||||
export const isFeedbackInHouseTeleReportVisible = (roles: string[]): boolean =>
|
||||
checkRoles(roles).isNaviTeleInhouseTeamLead();
|
||||
|
||||
export const isAgentInHouseTeleReportVisible = (roles: string[]): boolean =>
|
||||
checkRoles(roles).isNaviTeleInhouseTeamLead();
|
||||
|
||||
export const isCase30PlusTeleReportVisible = (roles: string[]): boolean =>
|
||||
checkRoles(roles).isNavi30PlusCallingTeamLead();
|
||||
|
||||
export const isFeedback30PlusTeleReportVisible = (roles: string[]): boolean =>
|
||||
checkRoles(roles).isNavi30PlusCallingTeamLead();
|
||||
|
||||
export const isCaseLevelReportVisible = (roles: string[]): boolean =>
|
||||
checkRoles(roles).isNaviFieldExternalTeamLead();
|
||||
|
||||
export const isAggregatedNotificationReportVisible = (roles: string[]): boolean =>
|
||||
checkRoles(roles).isNaviFieldExternalTeamLead();
|
||||
|
||||
export const isFeedbackReportVisible = (roles: string[]): boolean =>
|
||||
checkRoles(roles).isNaviFieldExternalTeamLead();
|
||||
|
||||
export const isPaymentReportVisible = (roles: string[]): boolean =>
|
||||
checkRoles(roles).isNaviFieldExternalTeamLead();
|
||||
|
||||
export const isCase1630FieldReportVisible = (roles: string[]): boolean =>
|
||||
checkRoles(roles).isNavi1630FieldAgencyManager();
|
||||
|
||||
export const isFeedback1630FieldReportVisible = (roles: string[]): boolean =>
|
||||
checkRoles(roles).isNavi1630FieldAgencyManager();
|
||||
|
||||
export const isCase1630FieldReportVisibleForReportee = (roles: string[]): boolean =>
|
||||
checkRoles(roles).isNavi1630FieldTeamLead();
|
||||
|
||||
export const isFeedback1630FieldReportVisibleForReportee = (roles: string[]): boolean =>
|
||||
checkRoles(roles).isNavi1630FieldTeamLead();
|
||||
|
||||
export const isCaseInHouseFieldReportVisible = (roles: string[]): boolean =>
|
||||
checkRoles(roles).isNaviFieldTeamLead();
|
||||
|
||||
export const isAgencyCaseReportVisible = (roles: string[]): boolean =>
|
||||
checkRoles(roles).isNaviFieldAgencyTeamLead();
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ import {
|
||||
} from './constants/AuthConstants';
|
||||
import { setAgencyRankingData } from '@cp/src/reducers/AgencyDetailsSlice';
|
||||
import logger from '@cp/src/utils/logger';
|
||||
import APP_ROUTES from '@cp/src/layout/Routes';
|
||||
import APP_ROUTES, { LOGIN_PATH } from '@cp/src/layout/Routes';
|
||||
|
||||
const defaultGuestUserMsClarityData: IMsClarityData = {
|
||||
referenceId: 'guestUser',
|
||||
@@ -235,6 +235,7 @@ export const fetchCurrentDate = () => (dispatch: Dispatch) => {
|
||||
};
|
||||
|
||||
export const verifyUserSession = () => {
|
||||
const ALLOWED_ROUTES_FOR_SELF_NAVIGATION = [APP_ROUTES.IMPERSONATION.path, LOGIN_PATH];
|
||||
const url = getApiUrl(ApiKeys.VERIFY_USER_SESSION);
|
||||
return async function (dispatch: (arg0: { payload: any; type: string }) => void) {
|
||||
await axiosInstance
|
||||
@@ -244,12 +245,16 @@ export const verifyUserSession = () => {
|
||||
GLOBAL.AGENT_BUSINESS_VERTICAL = agentBusinessVertical;
|
||||
dispatch(setAgentBusinessVertical(agentBusinessVertical));
|
||||
dispatch(setAuthData(response?.data));
|
||||
if (response.data.roles?.includes(Roles.ROLE_TEAM_LEAD)) {
|
||||
navigate(APP_ROUTES.TEAM_LEAD_DASHBOARD.path);
|
||||
} else {
|
||||
navigate(APP_ROUTES.CASES.path);
|
||||
const isSelfRedirectionAllowed = ALLOWED_ROUTES_FOR_SELF_NAVIGATION.some(route =>
|
||||
window.location.pathname.includes(route)
|
||||
);
|
||||
if (isSelfRedirectionAllowed) {
|
||||
if (response.data.roles?.includes(Roles.ROLE_TEAM_LEAD)) {
|
||||
navigate(APP_ROUTES.TEAM_LEAD_DASHBOARD.path);
|
||||
} else {
|
||||
navigate(APP_ROUTES.CASES.path);
|
||||
}
|
||||
}
|
||||
|
||||
if (response?.data) {
|
||||
setMsClarityData({
|
||||
referenceId: response.data.referenceId,
|
||||
|
||||
Reference in New Issue
Block a user