TP-22961, TP-22449 | collectionCaseStatus changes and case detail additional information | Aman C (#188)
* TP-22449 | Case Details Additional Information | Aman C * TP-22961 | collectionCaseStatus used to move case to completed * TP-22455 | Rever collectionCaseStatus
This commit is contained in:
committed by
GitHub Enterprise
parent
3063a78b0a
commit
3e476eda1b
@@ -2,6 +2,8 @@ import { CaseTypes } from './interface';
|
||||
|
||||
export const COMPLETED_STATUSES = ['CLOSED', 'EXPIRED', 'FORCED_CLOSE'];
|
||||
|
||||
export const COMPLETED_COLLECTION_STATUSES = ['COMPLETED'];
|
||||
|
||||
export const ListHeaderItems = {
|
||||
BANNER: {
|
||||
type: CaseTypes.BANNER,
|
||||
|
||||
@@ -38,14 +38,18 @@ const OpenStepperRenderer: React.FC<OpenStepperRendererProps> = ({tasks, context
|
||||
<>
|
||||
{
|
||||
tasks.map((task, index) => {
|
||||
if (currentStateMap[task.taskType] === STEPPER_STATE.CURRENT) {
|
||||
const isLastIndex = index === tasks.length - 1;
|
||||
const isCurrentTaskActive = currentStateMap[task.taskType] === STEPPER_STATE.CURRENT;
|
||||
return (
|
||||
<View key={task.taskType} >
|
||||
<View key={task.taskType}>
|
||||
<StepperHeader
|
||||
verdict={verdictMap[task.taskType]}
|
||||
currentState={currentStateMap[task.taskType]}
|
||||
currentState={
|
||||
currentStateMap[task.taskType]
|
||||
}
|
||||
stepNumber={index + 1}
|
||||
header={TaskTitleUIMapping[task.taskType]}
|
||||
isCurrentTaskActive={isCurrentTaskActive}
|
||||
/>
|
||||
<StepperContent
|
||||
content={
|
||||
@@ -56,30 +60,15 @@ const OpenStepperRenderer: React.FC<OpenStepperRendererProps> = ({tasks, context
|
||||
}
|
||||
taskType={task.taskType}
|
||||
caseId={caseReferenceId}
|
||||
isCurrentTaskActive={
|
||||
isCurrentTaskActive
|
||||
}
|
||||
/>
|
||||
}
|
||||
isLastTask={
|
||||
index === tasks.length - 1
|
||||
}
|
||||
isLastTask={isLastIndex}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<View key={task.taskType} style={[index > currentTaskIndex && styles.pendingListContainer]}>
|
||||
<StepperHeader
|
||||
verdict={verdictMap[task.taskType]}
|
||||
stepNumber={index + 1}
|
||||
header={TaskTitleUIMapping[task.taskType]}
|
||||
currentState={currentStateMap[task.taskType]}
|
||||
/>
|
||||
<StepperContent
|
||||
isLastTask={
|
||||
index === tasks.length - 1
|
||||
}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
})
|
||||
}
|
||||
</>
|
||||
|
||||
@@ -20,10 +20,11 @@ interface IStepperHeader {
|
||||
header: string;
|
||||
currentState: STEPPER_STATE;
|
||||
verdict: CONTEXT_TASK_STATUSES;
|
||||
isCurrentTaskActive: boolean;
|
||||
}
|
||||
|
||||
const StepperHeader: React.FC<IStepperHeader> = props => {
|
||||
const {stepNumber, header, verdict, currentState} = props;
|
||||
const {stepNumber, header, verdict, currentState, isCurrentTaskActive} = props;
|
||||
|
||||
switch (currentState) {
|
||||
case STEPPER_STATE.CURRENT:
|
||||
@@ -43,7 +44,7 @@ const StepperHeader: React.FC<IStepperHeader> = props => {
|
||||
);
|
||||
case STEPPER_STATE.DEFAULT:
|
||||
return (
|
||||
<View style={[GenericStyles.row, GenericStyles.alignCenter]}>
|
||||
<View style={[GenericStyles.row, GenericStyles.alignCenter, {opacity: isCurrentTaskActive ? 1 : 0.4}]}>
|
||||
<View style={[GenericStyles.row, styles.stepperDefault]}>
|
||||
<Heading type="h4">{stepNumber}</Heading>
|
||||
</View>
|
||||
@@ -69,7 +70,7 @@ const StepperHeader: React.FC<IStepperHeader> = props => {
|
||||
// );
|
||||
case STEPPER_STATE.SYNCED:
|
||||
return (
|
||||
<View style={[GenericStyles.row, GenericStyles.alignCenter ]}>
|
||||
<View style={[GenericStyles.row, GenericStyles.alignCenter, {opacity: isCurrentTaskActive ? 1 : 0.4} ]}>
|
||||
<View style={[GenericStyles.row, styles.stepperSynced]}>
|
||||
{/*<Heading type="h3">{stepNumber}</Heading>*/}
|
||||
<TickIcon color={COLORS.TEXT.BLUE} />
|
||||
|
||||
@@ -17,11 +17,13 @@ const TaskContent = ({
|
||||
geolocationUrl,
|
||||
taskType,
|
||||
caseId,
|
||||
isCurrentTaskActive
|
||||
}: {
|
||||
address?: any;
|
||||
geolocationUrl: string | undefined;
|
||||
taskType: TaskTitle;
|
||||
caseId: string;
|
||||
isCurrentTaskActive: boolean;
|
||||
}) => {
|
||||
const openGeolocation = () => {
|
||||
addClickstreamEvent(
|
||||
@@ -60,9 +62,9 @@ const TaskContent = ({
|
||||
};
|
||||
return (
|
||||
<View>
|
||||
{address && <Text>{getCommunicationAddress(address)}</Text>}
|
||||
<View style={[GenericStyles.row, GenericStyles.mt12, GenericStyles.wrap,]}>
|
||||
{!!geolocationUrl && (
|
||||
{address && <Text style={styles.disabled}>{getCommunicationAddress(address)}</Text>}
|
||||
<View style={[GenericStyles.row, GenericStyles.mt12, GenericStyles.wrap]}>
|
||||
{!!geolocationUrl ? (
|
||||
<Button
|
||||
style={styles.geolocationBtn}
|
||||
variant="secondary"
|
||||
@@ -71,13 +73,15 @@ const TaskContent = ({
|
||||
leftIcon={<MapPinIcon />}
|
||||
testID={"test_open_map"}
|
||||
/>
|
||||
)}
|
||||
<Button
|
||||
title="Add feedback"
|
||||
onPress={handleAddFeedback}
|
||||
style={styles.feedbackBtn}
|
||||
testID={"test_add_feedback"}
|
||||
/>
|
||||
) : null}
|
||||
{isCurrentTaskActive ?
|
||||
<Button
|
||||
title="Add feedback"
|
||||
onPress={handleAddFeedback}
|
||||
style={styles.feedbackBtn}
|
||||
testID={"test_add_feedback"}
|
||||
/>
|
||||
: null }
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
@@ -91,6 +95,9 @@ const styles = StyleSheet.create({
|
||||
feedbackBtn: {
|
||||
flexBasis: '50%',
|
||||
},
|
||||
disabled: {
|
||||
opacity: 0.4
|
||||
}
|
||||
});
|
||||
|
||||
export default TaskContent;
|
||||
|
||||
Reference in New Issue
Block a user