Merge pull request #577 from navi-medici/employment-details
TP-38653 | Employment Details
This commit is contained in:
@@ -131,8 +131,8 @@ def reactNativeArchitectures() {
|
||||
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
|
||||
}
|
||||
|
||||
def VERSION_CODE = 83
|
||||
def VERSION_NAME = "2.3.10"
|
||||
def VERSION_CODE = 85
|
||||
def VERSION_NAME = "2.4.1"
|
||||
|
||||
android {
|
||||
packagingOptions {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "AV_APP",
|
||||
"version": "2.4.0",
|
||||
"version": "2.4.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"android:dev": "yarn move:dev && react-native run-android",
|
||||
|
||||
@@ -334,6 +334,10 @@ export const CLICKSTREAM_EVENT_NAMES = {
|
||||
description: 'FA_COLLECT_MONEY_NUMBER_CHANGED',
|
||||
},
|
||||
FA_COPY_LAN_CLICKED: { name: 'FA_COPY_LAN_CLICKED', description: 'FA_COPY_LAN_CLICKED' },
|
||||
FA_COPY_EMPLOYER_NAME_CLICKED: {
|
||||
name: 'FA_COPY_EMPLOYER_NAME_CLICKED',
|
||||
description: 'FA_COPY_EMPLOYER_NAME_CLICKED',
|
||||
},
|
||||
FA_COPY_LINK_CLICKED: { name: 'FA_COPY_LINK_CLICKED', description: 'FA_COPY_LINK_CLICKED' },
|
||||
FA_COPY_LINK_FAILED: { name: 'FA_COPY_LINK_FAILED', description: 'FA_COPY_LINK_FAILED' },
|
||||
FA_PAST_FEEDBACKS_FEEDBACK_CLICKED: {
|
||||
|
||||
@@ -54,7 +54,9 @@ export const EmptyListMessages = {
|
||||
export const ToastMessages = {
|
||||
VISIT_PLAN_OFFLINE: 'Please connect to the internet to update the visit plan',
|
||||
ERROR_COPYING_LAN: 'Error copying LAN!!',
|
||||
ERROR_COPYING_EMPLOYER_NAME: 'Error copying employer name!!',
|
||||
SUCCESS_COPYING_LAN: 'LAN Copied Successfully!!',
|
||||
SUCCESS_COPYING_EMPLOYER_NAME: 'Employer Name Copied Successfully!!',
|
||||
FEEDBACK_SUCCESSFUL: 'Feedback submitted successfully!',
|
||||
FEEDBACK_FAILED: 'Feedback submission failed',
|
||||
FIRESTORE_SIGNIN_FAILED: 'Error signing in to Firestore',
|
||||
|
||||
95
src/screens/caseDetails/Chip.tsx
Normal file
95
src/screens/caseDetails/Chip.tsx
Normal file
@@ -0,0 +1,95 @@
|
||||
import { StyleProp, TextStyle, TouchableHighlight, View, ViewStyle } from 'react-native';
|
||||
import React from 'react';
|
||||
import { GenericStyles } from '../../../RN-UI-LIB/src/styles';
|
||||
import { toast } from '../../../RN-UI-LIB/src/components/toast';
|
||||
import { copyToClipboard } from '../../components/utlis/commonFunctions';
|
||||
import Text from '../../../RN-UI-LIB/src/components/Text';
|
||||
import CopyIcon from '../../../RN-UI-LIB/src/Icons/CopyIcon';
|
||||
|
||||
interface IChip {
|
||||
text: string;
|
||||
containerStyle: StyleProp<ViewStyle>;
|
||||
subText?: string;
|
||||
numberOfLines?: number;
|
||||
clipCount?: number;
|
||||
showCopyBtn?: boolean;
|
||||
clickstreamEvent?: () => void;
|
||||
successMessage?: string;
|
||||
errorMessage?: string;
|
||||
textStyle?: StyleProp<TextStyle>;
|
||||
}
|
||||
|
||||
const Chip: React.FC<IChip> = (props) => {
|
||||
const {
|
||||
text,
|
||||
containerStyle,
|
||||
subText,
|
||||
numberOfLines = 1,
|
||||
clipCount = 0,
|
||||
showCopyBtn = false,
|
||||
clickstreamEvent,
|
||||
successMessage = 'Copied Successfully!!',
|
||||
errorMessage = 'Error copying!!',
|
||||
textStyle,
|
||||
} = props;
|
||||
|
||||
const copyData = () => {
|
||||
clickstreamEvent?.();
|
||||
if (!showCopyBtn) return;
|
||||
if (text) {
|
||||
copyToClipboard(text);
|
||||
toast({
|
||||
text1: successMessage,
|
||||
type: 'info',
|
||||
});
|
||||
} else {
|
||||
toast({
|
||||
text1: errorMessage,
|
||||
type: 'error',
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const isClipped = text?.length >= clipCount;
|
||||
const clippedStyle = isClipped ? GenericStyles.fill : {};
|
||||
|
||||
const renderChip = () => {
|
||||
return (
|
||||
<View
|
||||
style={[
|
||||
GenericStyles.chip,
|
||||
GenericStyles.whiteBackground,
|
||||
GenericStyles.row,
|
||||
GenericStyles.alignCenter,
|
||||
]}
|
||||
>
|
||||
<View style={clippedStyle}>
|
||||
<Text
|
||||
numberOfLines={numberOfLines}
|
||||
ellipsizeMode={isClipped ? 'tail' : undefined}
|
||||
small
|
||||
style={textStyle}
|
||||
>
|
||||
{subText && subText}
|
||||
{text}
|
||||
</Text>
|
||||
</View>
|
||||
{showCopyBtn && (
|
||||
<View style={GenericStyles.ml4}>
|
||||
<CopyIcon />
|
||||
</View>
|
||||
)}
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
return showCopyBtn ? (
|
||||
<TouchableHighlight style={[containerStyle, clippedStyle]} onPress={copyData}>
|
||||
{renderChip()}
|
||||
</TouchableHighlight>
|
||||
) : (
|
||||
<View style={[containerStyle, clippedStyle]}>{renderChip()}</View>
|
||||
);
|
||||
};
|
||||
|
||||
export default Chip;
|
||||
@@ -5,8 +5,12 @@ import { GenericStyles } from '../../../RN-UI-LIB/src/styles';
|
||||
import { COLORS } from '../../../RN-UI-LIB/src/styles/colors';
|
||||
import Text from '../../../RN-UI-LIB/src/components/Text';
|
||||
import { formatAmount } from '../../../RN-UI-LIB/src/utlis/amount';
|
||||
import LANChip from './LANChip';
|
||||
import Tag from '../../../RN-UI-LIB/src/components/Tag';
|
||||
import Chip from './Chip';
|
||||
import EmploymentDetails from './EmploymentDetails';
|
||||
import { addClickstreamEvent } from '../../services/clickstreamEventService';
|
||||
import { CLICKSTREAM_EVENT_NAMES } from '../../common/Constants';
|
||||
import { ToastMessages } from '../allCases/constants';
|
||||
import { toTileCase } from '../../components/utlis/commonFunctions';
|
||||
|
||||
interface ICollectionCaseData {
|
||||
caseData: CaseDetail;
|
||||
@@ -23,22 +27,38 @@ const CollectionCaseData: React.FC<ICollectionCaseData> = ({ caseData }) => {
|
||||
employmentDetail,
|
||||
} = caseData;
|
||||
|
||||
const showEmploymentDetails = false;
|
||||
|
||||
return (
|
||||
<View>
|
||||
{fatherName && (
|
||||
<Text style={[styles.headerText]} small>
|
||||
S/O {fatherName}
|
||||
Parent name: {toTileCase(fatherName)}
|
||||
</Text>
|
||||
)}
|
||||
<View style={[GenericStyles.row, GenericStyles.mv8]}>
|
||||
<Text style={[GenericStyles.chip, GenericStyles.whiteBackground]} small>
|
||||
Current DPD {currentDpd}
|
||||
</Text>
|
||||
{loanAccountNumber && <LANChip loanAccountNumber={loanAccountNumber} />}
|
||||
{loanAccountNumber && (
|
||||
<Chip
|
||||
text={loanAccountNumber}
|
||||
showCopyBtn
|
||||
containerStyle={GenericStyles.ml8}
|
||||
subText="LAN "
|
||||
clickstreamEvent={() =>
|
||||
addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.FA_COPY_LAN_CLICKED, {
|
||||
lan: loanAccountNumber,
|
||||
})
|
||||
}
|
||||
successMessage={ToastMessages.SUCCESS_COPYING_LAN}
|
||||
errorMessage={ToastMessages.ERROR_COPYING_LAN}
|
||||
clipCount={14}
|
||||
/>
|
||||
)}
|
||||
</View>
|
||||
<View style={[GenericStyles.row, GenericStyles.alignCenter, GenericStyles.mt4]}>
|
||||
<EmploymentDetails employmentDetail={employmentDetail} />
|
||||
</View>
|
||||
<View style={[GenericStyles.row, GenericStyles.alignCenter, GenericStyles.mt8]}>
|
||||
<Text style={[styles.greyText]} small>
|
||||
DPD bucket {dpdBucket}
|
||||
</Text>
|
||||
@@ -46,29 +66,15 @@ const CollectionCaseData: React.FC<ICollectionCaseData> = ({ caseData }) => {
|
||||
<Text style={[styles.greyText]} small>
|
||||
POS {formatAmount(pos)}
|
||||
</Text>
|
||||
</View>
|
||||
{showEmploymentDetails ? (
|
||||
<View style={[GenericStyles.row, GenericStyles.alignCenter, GenericStyles.mt4]}>
|
||||
{employmentDetail?.employmentType && (
|
||||
<Text style={[styles.greyText]} small>
|
||||
{employmentDetail.employmentType}
|
||||
</Text>
|
||||
)}
|
||||
{employmentDetail?.employmentType && employmentDetail?.employerName && (
|
||||
{collectionTag ? (
|
||||
<>
|
||||
<View style={styles.lineStyle} />
|
||||
)}
|
||||
{employmentDetail?.employerName && (
|
||||
<Text style={[styles.greyText]} small numberOfLines={1}>
|
||||
{employmentDetail.employerName}
|
||||
<Text style={[styles.greyText]} small>
|
||||
{collectionTag}
|
||||
</Text>
|
||||
)}
|
||||
</View>
|
||||
) : null}
|
||||
{collectionTag ? (
|
||||
<Text style={[styles.greyText]} small>
|
||||
{collectionTag}
|
||||
</Text>
|
||||
) : null}
|
||||
</>
|
||||
) : null}
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
47
src/screens/caseDetails/EmploymentDetails.tsx
Normal file
47
src/screens/caseDetails/EmploymentDetails.tsx
Normal file
@@ -0,0 +1,47 @@
|
||||
import React from 'react';
|
||||
import { StyleSheet } from 'react-native';
|
||||
import { GenericStyles } from '../../../RN-UI-LIB/src/styles';
|
||||
import { CLICKSTREAM_EVENT_NAMES } from '../../common/Constants';
|
||||
import { addClickstreamEvent } from '../../services/clickstreamEventService';
|
||||
import { ToastMessages } from '../allCases/constants';
|
||||
import Chip from './Chip';
|
||||
|
||||
const EmploymentDetails = ({ employmentDetail }: any) => {
|
||||
if (employmentDetail?.employerName) {
|
||||
return (
|
||||
<Chip
|
||||
text={employmentDetail.employerName}
|
||||
numberOfLines={0}
|
||||
showCopyBtn
|
||||
containerStyle={GenericStyles.mr8}
|
||||
clipCount={42}
|
||||
clickstreamEvent={() =>
|
||||
addClickstreamEvent(CLICKSTREAM_EVENT_NAMES.FA_COPY_EMPLOYER_NAME_CLICKED, {
|
||||
employerName: employmentDetail.employerName,
|
||||
})
|
||||
}
|
||||
successMessage={ToastMessages.SUCCESS_COPYING_EMPLOYER_NAME}
|
||||
errorMessage={ToastMessages.ERROR_COPYING_EMPLOYER_NAME}
|
||||
textStyle={styles.lineHeight}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
if (employmentDetail?.employmentType) {
|
||||
return (
|
||||
<Chip
|
||||
text={employmentDetail.employmentType}
|
||||
containerStyle={GenericStyles.mr8}
|
||||
clipCount={20}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
export default EmploymentDetails;
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
lineHeight: { lineHeight: 20, paddingVertical: 1.6 },
|
||||
});
|
||||
Reference in New Issue
Block a user