Address concatenation fix | Aman C (#51)
* firestore * cases list refresh added * Firestore integration fixes * fix firestore deleting * Fixes - tab count, highlight new case, unsynced case detail icon * reset data om logout * Case statuses added, toast notification added for all firestore updates, fixed bugs | Aman C * Address concatenation fix
This commit is contained in:
committed by
GitHub Enterprise
parent
daf7683201
commit
6dba109963
@@ -1,3 +1,5 @@
|
||||
import { Address } from "../../screens/caseDetails/interface";
|
||||
|
||||
export const decideLoadingState = (textData: string): boolean => {
|
||||
if (!textData) {
|
||||
return true;
|
||||
@@ -7,3 +9,11 @@ export const decideLoadingState = (textData: string): boolean => {
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
export const getCommunicationAddress = (address: Address) => {
|
||||
if(!address) {
|
||||
return '';
|
||||
}
|
||||
const { houseNumber, lineOne, lineTwo, locality, street, city, state, pinCode } = address;
|
||||
return [houseNumber, lineOne, lineTwo, locality, street, city, state, pinCode].filter(element => element).join(', ');
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import {
|
||||
TaskTitleUIMapping,
|
||||
} from './interface';
|
||||
import { COLORS } from '../../../RN-UI-LIB/src/styles/colors';
|
||||
import { getCommunicationAddress } from '../../components/utlis/commonFunctions';
|
||||
|
||||
interface IListItem {
|
||||
caseData: ICaseItem;
|
||||
@@ -85,19 +86,8 @@ const ListItem: React.FC<IListItem> = props => {
|
||||
const taskTitle =
|
||||
detail.currentTask?.taskType || detail?.currentTask?.title;
|
||||
|
||||
const displayAddress = address
|
||||
? address.lineOne +
|
||||
' ' +
|
||||
address.lineTwo +
|
||||
' ' +
|
||||
address.locality +
|
||||
' ' +
|
||||
address.city +
|
||||
' ' +
|
||||
address.pinCode
|
||||
: poneNumber
|
||||
? poneNumber
|
||||
: '';
|
||||
const communicationAddress = getCommunicationAddress(address);
|
||||
const displayAddress = communicationAddress || poneNumber || '';
|
||||
|
||||
// @ts-ignore
|
||||
const caseStatus = displayStatuses[detail.caseStatus] || displayStatuses[detail.caseVerdict];
|
||||
|
||||
@@ -6,6 +6,7 @@ import React from 'react';
|
||||
import MapPinIcon from '../../../../RN-UI-LIB/src/Icons/MapPinIcon';
|
||||
import {TaskTitle} from "../../allCases/interface";
|
||||
import {navigateToScreen} from "../../../components/utlis/navigationUtlis";
|
||||
import { getCommunicationAddress } from '../../../components/utlis/commonFunctions';
|
||||
const templateData = require('../../../data/RealTemplateData.json');
|
||||
|
||||
const TaskContent = ({
|
||||
@@ -26,7 +27,7 @@ const TaskContent = ({
|
||||
<View>
|
||||
{address && (
|
||||
<Text>
|
||||
{`${address.houseNumber}, ${address.lineOne} , ${address.lineTwo} , ${address.locality} , ${address.street} , ${address.city} , ${address.state} - ${address.pincode}`}
|
||||
{getCommunicationAddress(address)}
|
||||
</Text>
|
||||
)}
|
||||
<View style={[GenericStyles.row , GenericStyles.mt12]}>
|
||||
|
||||
Reference in New Issue
Block a user