TP-38288 | PR comments resolved
This commit is contained in:
@@ -5,6 +5,7 @@ import { SCREEN_ANIMATION_DURATION } from '../../common/Constants';
|
||||
import { PageRouteEnum } from '../auth/ProtectedRouter';
|
||||
import CashCollected from '../cashCollected';
|
||||
import FilteredCases from '../filteredCases';
|
||||
import { Animation } from './interface';
|
||||
|
||||
const Stack = createNativeStackNavigator();
|
||||
|
||||
@@ -34,7 +35,7 @@ function DashBoardScreens() {
|
||||
options={{
|
||||
header: () => null,
|
||||
animationDuration: SCREEN_ANIMATION_DURATION,
|
||||
animation: 'slide_from_right',
|
||||
animation: Animation.SLIDE_FROM_RIGHT,
|
||||
}}
|
||||
/>
|
||||
</Stack.Navigator>
|
||||
|
||||
@@ -20,11 +20,12 @@ import {
|
||||
getExternalAgentPerformanceDetails,
|
||||
getPerformanceDetailFilter,
|
||||
} from './utils';
|
||||
import { COMMON_FILTER } from './constants';
|
||||
|
||||
const ExternalAgentPerformanceCard = () => {
|
||||
const { performanceData, filters } = useAppSelector((state) => ({
|
||||
performanceData: state.agentPerformance.performanceData,
|
||||
filters: state.filters.filters,
|
||||
performanceData: state?.agentPerformance?.performanceData,
|
||||
filters: state?.filters?.filters,
|
||||
}));
|
||||
const { cases, feedbackDetails } = performanceData || {};
|
||||
const performanceDetails = getExternalAgentPerformanceDetails(cases, feedbackDetails);
|
||||
@@ -32,13 +33,13 @@ const ExternalAgentPerformanceCard = () => {
|
||||
const dispatch = useAppDispatch();
|
||||
|
||||
const handleActionItemClick = (item: PerformanceDetailsType) => {
|
||||
if (item.redirectionType) {
|
||||
if (item?.redirectionType) {
|
||||
addClickstreamEvent(getClickedEventName(item.redirectionType), {});
|
||||
dispatch(
|
||||
setSelectedAgentDashboardFilter(
|
||||
getPerformanceDetailFilter(
|
||||
item.redirectionType,
|
||||
Object.keys(filters?.['COMMON']?.filters ?? {})?.includes(
|
||||
Object.keys(filters?.[COMMON_FILTER]?.filters ?? {})?.includes(
|
||||
CurrentAllocationStatsFilterMap[item.redirectionType]
|
||||
)
|
||||
)
|
||||
|
||||
@@ -47,7 +47,11 @@ const PerformanceCardV2 = (props: PerformanceCardProps) => {
|
||||
</>
|
||||
)}
|
||||
{item?.redirectionType && (
|
||||
<TouchableOpacity onPress={() => handleActionItemClick(item)} activeOpacity={0.8}>
|
||||
<TouchableOpacity
|
||||
onPress={() => handleActionItemClick(item)}
|
||||
activeOpacity={0.8}
|
||||
hitSlop={{ left: 12, right: 12 }}
|
||||
>
|
||||
<View style={[GenericStyles.borderTop, GenericStyles.w100]} />
|
||||
<View
|
||||
style={[
|
||||
|
||||
@@ -38,8 +38,8 @@ const PerformanceLevelGraph = () => {
|
||||
const isBiggerBox = (box: Box) => box.id === performanceLevel?.currentLevel;
|
||||
|
||||
const selfLevelPosition =
|
||||
((cashCollectedTillDate.self - cashCollectedTillDate.belowLevel) * 100) /
|
||||
(cashCollectedTillDate.aboveLevel - cashCollectedTillDate.belowLevel + 1); // if denominator difference is 0 we are adding it to 1, to avoid calculation error, this should never happen i
|
||||
((cashCollectedTillDate?.self - cashCollectedTillDate?.belowLevel) * 100) /
|
||||
(cashCollectedTillDate?.aboveLevel - cashCollectedTillDate?.belowLevel + 1); // if denominator difference is 0 we are adding it to 1, to avoid calculation error, this should never happen i
|
||||
|
||||
const getBoxStyles = (box: Box) => {
|
||||
return {
|
||||
|
||||
@@ -76,3 +76,5 @@ export const BIGGER_BOX_SIZE_MULTIPLIER = 1.25;
|
||||
|
||||
export const xAxisLabels = ['6th', '13th', '20th', '27th'];
|
||||
export const yAxisLabels = [4, 3, 2, 1];
|
||||
|
||||
export const COMMON_FILTER = 'COMMON';
|
||||
|
||||
@@ -160,3 +160,7 @@ export interface PerformanceCardProps {
|
||||
item: PerformanceCardItem;
|
||||
handleActionItemClick: (item: PerformanceDetailsType) => void;
|
||||
}
|
||||
|
||||
export enum Animation {
|
||||
SLIDE_FROM_RIGHT = 'slide_from_right',
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import { useAppSelector } from '../../hooks';
|
||||
import { VisitPlanStatus } from '../../reducer/userSlice';
|
||||
import { FeedbackStatus } from '../caseDetails/interface';
|
||||
import { RootState } from '@store';
|
||||
import { FiltePlaceholderText } from './interface';
|
||||
|
||||
interface IFilters {
|
||||
searchQuery: string;
|
||||
@@ -52,9 +53,9 @@ const Filters: React.FC<IFilters> = ({
|
||||
};
|
||||
|
||||
const getTextInputPlaceholder = () => {
|
||||
if (isVisitPlan) return 'visit plan';
|
||||
if (caseType && isAgentDashboard) return `${caseType} cases`;
|
||||
return 'my cases';
|
||||
if (isVisitPlan) return FiltePlaceholderText.VISIT_PLAN;
|
||||
if (caseType && isAgentDashboard) return `${caseType} ${FiltePlaceholderText.CASES}`;
|
||||
return FiltePlaceholderText.MY_CASES;
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -338,3 +338,9 @@ export interface IReportee {
|
||||
agencyCode: string;
|
||||
agencyName: string;
|
||||
}
|
||||
|
||||
export enum FiltePlaceholderText {
|
||||
VISIT_PLAN = 'visit plan',
|
||||
CASES = 'cases',
|
||||
MY_CASES = 'my cases',
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user