TP-62631 | External dashboard changes (#845)

This commit is contained in:
Mantri Ramkishor
2024-07-01 19:05:40 +05:30
committed by GitHub
9 changed files with 35 additions and 30 deletions

View File

@@ -134,8 +134,8 @@ def reactNativeArchitectures() {
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
}
def VERSION_CODE = 172
def VERSION_NAME = "2.11.6"
def VERSION_CODE = 173
def VERSION_NAME = "2.11.7"
android {
ndkVersion rootProject.ext.ndkVersion

View File

@@ -1,7 +1,7 @@
{
"name": "AV_APP",
"version": "2.11.6",
"buildNumber": "172",
"version": "2.11.7",
"buildNumber": "173",
"private": true,
"scripts": {
"android:dev": "yarn move:dev && react-native run-android",

View File

@@ -684,6 +684,10 @@ export const CLICKSTREAM_EVENT_NAMES = {
name: 'FA_PERFORMANCE_DASHBOARD_BROKEN_PTP_CASES_LOAD',
description: 'Performance Dashboard Broken PTP Cases Load',
},
FA_PERFORMANCE_DASHBOARD_NEARBY_CASES_CLICKED: {
name: 'FA_PERFORMANCE_DASHBOARD_NEARBY_CASES_CLICKED',
description: 'Performance Dashboard nearby Cases clicked',
},
//Blocker Screen for blacklisted Apps
FA_BLOCKER_SCREEN_LOADED_FOR_BLACKLISTED_APPS: {

View File

@@ -9,6 +9,7 @@ import { addClickstreamEvent } from '../../services/clickstreamEventService';
import PerformanceCardV1 from './PerformanceCardV1';
import PerformanceCardV2 from './PerformanceCardV2';
import {
CurrentAllocationStats,
CurrentAllocationStatsFilterMap,
CurrentAllocationStatsMap,
PerformanceDetailsType,
@@ -21,16 +22,23 @@ import {
import { COMMON_FILTER } from './constants';
import { DashBoardScreensEnum } from './DashBoardScreens';
import { setFilteredListToast } from '@reducers/agentPerformanceSlice';
import { setSortTabSelected } from '@reducers/nearbyCasesSlice';
import { BOTTOM_TAB_ROUTES, TABS_KEYS } from '@screens/allCases/constants';
const ExternalAgentPerformanceCard = () => {
const performanceData = useAppSelector(state => state?.agentPerformance?.performanceData);
const filters = useAppSelector(state => state?.filters?.filters);
const performanceData = useAppSelector((state) => state?.agentPerformance?.performanceData);
const filters = useAppSelector((state) => state?.filters?.filters);
const { cases, feedbackDetails } = performanceData || {};
const performanceDetails = getExternalAgentPerformanceDetails(cases, feedbackDetails);
const dispatch = useAppDispatch();
const handleActionItemClick = (item: PerformanceDetailsType) => {
if (item?.redirectionType === CurrentAllocationStats.NEARBY_CASES) {
dispatch(setSortTabSelected?.(TABS_KEYS.NEAREST_CASE));
navigateToScreen(BOTTOM_TAB_ROUTES.Cases);
return;
}
if (item?.redirectionType) {
addClickstreamEvent(getClickedEventName(item.redirectionType), {});
dispatch(

View File

@@ -9,6 +9,7 @@ import { PerformanceCardProps } from './interface';
const PerformanceCardV1 = (props: PerformanceCardProps) => {
const { item, handleActionItemClick } = props;
const hideTotalNotConverted = item?.hideTotalNotConverted;
return (
<View key={item.convertedText} style={cardStyles.pressableCard}>
<Heading style={cardStyles.totalCount}>{item.totalConverted}</Heading>
@@ -24,7 +25,9 @@ const PerformanceCardV1 = (props: PerformanceCardProps) => {
]}
>
<View style={GenericStyles.row}>
<Text style={[cardStyles.subTitle, cardStyles.fw700]}>{item.totalNotConverted} </Text>
{!hideTotalNotConverted ? (
<Text style={[cardStyles.subTitle, cardStyles.fw700]}>{item.totalNotConverted} </Text>
) : null}
<Text style={cardStyles.subTitle}>{item.notConvertedText}</Text>
</View>
<View style={cardStyles.rightIcon}>

View File

@@ -9,9 +9,7 @@ import EmiCollectedIcon from '../../assets/icons/EmiCollectedIcon';
import PerformanceItem from './PerformanceItem';
import { PerformanceDetails } from './constants';
import { formatAmount } from '../../../RN-UI-LIB/src/utlis/amount';
import SuspiciousFeedbackIcon from '@assets/icons/SuspiciousFeedbackIcon';
import { PerformanceOverviewProps } from './interface';
import { sanatizeSuspisiousFeedback } from './utils';
import { DashBoardScreensEnum } from './DashBoardScreens';
import EmiCashCollectedIcon from '@assets/icons/EmiCashCollectedIcon';
@@ -80,22 +78,6 @@ const PerformanceOverview = (props: PerformanceOverviewProps) => {
</View>
}
/>
{isExternalAgent && (
<>
<View style={[GenericStyles.borderTop, GenericStyles.w100]} />
<PerformanceItem
title={PerformanceDetails.suspiciousFeedback}
icon={<SuspiciousFeedbackIcon />}
rightSideView={
<View style={[GenericStyles.row, GenericStyles.alignCenter]}>
<Text style={[GenericStyles.fontSize16, styles.fw700, styles.leftContent]}>
{sanatizeSuspisiousFeedback(performanceOverviewData?.suspiciousFeedback ?? 0)}%
</Text>
</View>
}
/>
</>
)}
</View>
);
};

View File

@@ -22,6 +22,7 @@ export const PerformanceCardDetails = {
feedbacks: 'feedbacks today',
ptps: 'PTPs',
paid: 'paid',
nearbyCases: 'Nearby cases',
};
export const PerfomanceHeaderTitle = 'Performance summary';

View File

@@ -78,6 +78,7 @@ export enum CurrentAllocationStats {
NON_CONTACTABLE = 'NON_CONTACTABLE',
NON_PTP = 'NON_PTP',
BROKEN_PTP = 'BROKEN_PTP',
NEARBY_CASES = 'NEARBY_CASES',
}
export enum CurrentAllocationStatsFilter {
@@ -156,6 +157,7 @@ interface PerformanceCardItem {
otherDetailsCount?: number;
otherDetailsText?: string;
v1?: boolean;
hideTotalNotConverted?: boolean;
}
export interface PerformanceCardProps {

View File

@@ -133,10 +133,12 @@ export const getExternalAgentPerformanceDetails = (cases: CasesType, feedbackDet
{
totalConverted: todaysFeedbackCount,
convertedText: PerformanceCardDetails.feedbacks,
otherDetailsCount: todaysGenuineFeedbackCount,
otherDetailsText: PerformanceCardDetails.genuine,
totalNotConverted: todaysSuspiciousFeedbackCount,
notConvertedText: PerformanceCardDetails.suspicious,
otherDetailsCount: 0,
otherDetailsText: '',
notConvertedText: PerformanceCardDetails.nearbyCases,
redirectionType: CurrentAllocationStats.NEARBY_CASES,
v1: true,
hideTotalNotConverted: true
},
];
};
@@ -196,6 +198,9 @@ export const getClickedEventName = (item: CurrentAllocationStats) => {
case CurrentAllocationStats.BROKEN_PTP:
return CLICKSTREAM_EVENT_NAMES.FA_PERFORMANCE_DASHBOARD_BROKEN_PTP_CASES_CLICKED;
case CurrentAllocationStats.NEARBY_CASES:
return CLICKSTREAM_EVENT_NAMES.FA_PERFORMANCE_DASHBOARD_NEARBY_CASES_CLICKED;
}
};
@@ -246,7 +251,7 @@ export const getSearchQuery = (
if (isAgentDashboard) return state.agentPerformance?.dashboardSearchQuery;
if (isVisitPlan) return state.allCases?.visitPlanSearchQuery;
return state.allCases?.allCasesViewSearchQuery;
}
};
export const getPerformanceLevel = (level: number) => {
return boxGradientColors.find((box) => box.id === level);