TP-36903 | App Crash Issue Fix
This commit is contained in:
@@ -3,9 +3,9 @@ import React from 'react';
|
||||
import Dashboard from '.';
|
||||
import { SCREEN_ANIMATION_DURATION } from '../../common/Constants';
|
||||
import { useAppSelector } from '../../hooks';
|
||||
import CasesList from '../allCases/CasesList';
|
||||
import { PageRouteEnum } from '../auth/ProtectedRouter';
|
||||
import CashCollected from '../cashCollected';
|
||||
import FilteredCases from '../filteredCases';
|
||||
|
||||
const Stack = createNativeStackNavigator();
|
||||
|
||||
@@ -31,15 +31,7 @@ function DashBoardScreens() {
|
||||
}}
|
||||
/>
|
||||
<Stack.Screen name={PageRouteEnum.CASH_COLLECTED} component={CashCollected} />
|
||||
<Stack.Screen
|
||||
name={PageRouteEnum.FILTERED_CASES}
|
||||
component={() => (
|
||||
<CasesList
|
||||
casesList={[...pendingList, ...pinnedList, ...completedList]}
|
||||
isAgentDashboard
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
<Stack.Screen name={PageRouteEnum.FILTERED_CASES} component={FilteredCases} />
|
||||
</Stack.Navigator>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ export const getPerformanceDetailFilter = (item: CurrentAllocationStats, applyFi
|
||||
return { VISIT_STATUS: { false: true } };
|
||||
|
||||
case CurrentAllocationStats.NON_CONTACTABLE:
|
||||
return { CONTACTABILITY: { false: true } };
|
||||
return { CONTACTABILITY: { true: true } };
|
||||
|
||||
case CurrentAllocationStats.NON_PTP:
|
||||
return { PTP_STATUS: { false: true } };
|
||||
|
||||
@@ -14,6 +14,7 @@ interface ICaseItemProps extends ViewProps {
|
||||
isCompleted?: boolean;
|
||||
isTodoItem?: boolean;
|
||||
shouldBatchAvatar?: boolean;
|
||||
isAgentDashboard?: boolean;
|
||||
}
|
||||
|
||||
const CaseItem: React.FC<ICaseItemProps> = ({
|
||||
@@ -22,6 +23,7 @@ const CaseItem: React.FC<ICaseItemProps> = ({
|
||||
isCompleted = false,
|
||||
isTodoItem = false,
|
||||
shouldBatchAvatar = false,
|
||||
isAgentDashboard = false,
|
||||
...restProps
|
||||
}) => {
|
||||
const { ADD_VISIT_PLAN, ATTEMPTED_CASES } = CaseTypes;
|
||||
@@ -85,6 +87,7 @@ const CaseItem: React.FC<ICaseItemProps> = ({
|
||||
shouldBatchAvatar={shouldBatchAvatar}
|
||||
isCompleted={isCompleted}
|
||||
isTodoItem={isTodoItem}
|
||||
isAgentDashboard={isAgentDashboard}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
|
||||
@@ -271,6 +271,7 @@ const CasesList: React.FC<ICasesList> = ({ casesList = [], isVisitPlan, isAgentD
|
||||
caseDetailObj={caseItemDetailObj}
|
||||
shouldBatchAvatar={true}
|
||||
testID={`case-${type === CaseTypes.TODO ? 'todo' : ''}-${row.index}`}
|
||||
isAgentDashboard={isAgentDashboard}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -39,6 +39,7 @@ interface IListItem {
|
||||
isTodoItem?: boolean;
|
||||
isCompleted?: boolean;
|
||||
shouldBatchAvatar?: boolean;
|
||||
isAgentDashboard?: boolean;
|
||||
}
|
||||
|
||||
const paymentStatusMapping: Record<
|
||||
@@ -55,7 +56,8 @@ const paymentStatusMapping: Record<
|
||||
};
|
||||
|
||||
const ListItem: React.FC<IListItem> = (props) => {
|
||||
const { caseListItemDetailObj, isCompleted, isTodoItem, shouldBatchAvatar } = props;
|
||||
const { caseListItemDetailObj, isCompleted, isTodoItem, shouldBatchAvatar, isAgentDashboard } =
|
||||
props;
|
||||
const {
|
||||
id: caseId,
|
||||
isIntermediateOrSelectedTodoCaseItem,
|
||||
@@ -79,10 +81,6 @@ const ListItem: React.FC<IListItem> = (props) => {
|
||||
|
||||
const dispatch = useAppDispatch();
|
||||
|
||||
if (!isCompleted && caseStatus === CaseStatuses.CLOSED) {
|
||||
return null;
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (isNewlyAdded) {
|
||||
setTimeout(() => dispatch(toggleNewlyAddedCase(caseId)), 1000);
|
||||
@@ -169,6 +167,10 @@ const ListItem: React.FC<IListItem> = (props) => {
|
||||
]
|
||||
);
|
||||
|
||||
if (!isCompleted && caseStatus === CaseStatuses.CLOSED && !isAgentDashboard) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Pressable onPress={handleCaseClick}>
|
||||
<View
|
||||
|
||||
@@ -38,14 +38,13 @@ const CashCollectedItem = (props: CashCollectedItemProps) => {
|
||||
<View style={GenericStyles.pl12}>
|
||||
<Text style={styles.textHeading}>{sanitizeString(customerName)}</Text>
|
||||
<Text style={styles.subText}>
|
||||
Collected :{' '}
|
||||
<Text style={amountCollected >= totalOverdueAmount ? styles.green : styles.red}>
|
||||
{formatAmount(Number(amountCollected.toFixed(2)), false)}
|
||||
</Text>
|
||||
Collected : <Text>{formatAmount(Number(amountCollected?.toFixed(2)), false)}</Text>
|
||||
</Text>
|
||||
<Text style={styles.subText}>
|
||||
Current outstanding :{' '}
|
||||
<Text style={styles.overdueAmountColor}>{formatAmount(totalOverdueAmount, false)}</Text>
|
||||
<Text style={totalOverdueAmount > 0 ? styles.red : styles.overdueAmountColor}>
|
||||
{formatAmount(totalOverdueAmount, false)}
|
||||
</Text>
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
@@ -75,9 +74,6 @@ const styles = StyleSheet.create({
|
||||
overdueAmountColor: {
|
||||
color: COLORS.TEXT.BLACK,
|
||||
},
|
||||
green: {
|
||||
color: COLORS.TEXT.GREEN,
|
||||
},
|
||||
red: {
|
||||
color: COLORS.TEXT.RED,
|
||||
},
|
||||
|
||||
13
src/screens/filteredCases/index.tsx
Normal file
13
src/screens/filteredCases/index.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import React from 'react';
|
||||
import { useAppSelector } from '../../hooks';
|
||||
import CasesList from '../allCases/CasesList';
|
||||
|
||||
const FilteredCases = () => {
|
||||
const { pendingList, pinnedList, completedList } = useAppSelector((state) => state.allCases);
|
||||
|
||||
return (
|
||||
<CasesList casesList={[...pendingList, ...pinnedList, ...completedList]} isAgentDashboard />
|
||||
);
|
||||
};
|
||||
|
||||
export default FilteredCases;
|
||||
Reference in New Issue
Block a user