TP-22332 | PR Clean | Aman Singh
This commit is contained in:
6
.vscode/settings.json
vendored
6
.vscode/settings.json
vendored
@@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"cSpell.words": [
|
|
||||||
"Pressable",
|
|
||||||
"utlis"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -2,6 +2,6 @@
|
|||||||
"react-native": {
|
"react-native": {
|
||||||
"crashlytics_debug_enabled": false,
|
"crashlytics_debug_enabled": false,
|
||||||
"android_task_executor_maximum_pool_size": 20,
|
"android_task_executor_maximum_pool_size": 20,
|
||||||
"android_task_executor_keep_alive_seconds": 5,
|
"android_task_executor_keep_alive_seconds": 5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -166,16 +166,16 @@ const BlockerScreen = (props: IBlockerScreen) => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (!isTimeSynced) {
|
if (!isTimeSynced) {
|
||||||
// const { heading, instructions } = BLOCKER_SCREEN_DATA.TIME_UNSYNC;
|
const { heading, instructions } = BLOCKER_SCREEN_DATA.TIME_UNSYNC;
|
||||||
// return (
|
return (
|
||||||
// <BlockerInstructions
|
<BlockerInstructions
|
||||||
// heading={heading}
|
heading={heading}
|
||||||
// instructions={instructions}
|
instructions={instructions}
|
||||||
// actionBtn={{ title: 'Go to settings', action: handleOpenSettings }}
|
actionBtn={{ title: 'Go to settings', action: handleOpenSettings }}
|
||||||
// />
|
/>
|
||||||
// );
|
);
|
||||||
// }
|
}
|
||||||
|
|
||||||
if (!isDeviceLocationEnabled) {
|
if (!isDeviceLocationEnabled) {
|
||||||
const { heading, instructions } = BLOCKER_SCREEN_DATA.DEVICE_LOCATION_OFF;
|
const { heading, instructions } = BLOCKER_SCREEN_DATA.DEVICE_LOCATION_OFF;
|
||||||
|
|||||||
@@ -67,18 +67,6 @@ export enum ApiKeys {
|
|||||||
DAILY_COMMITMENT = 'DAILY_COMMITMENT',
|
DAILY_COMMITMENT = 'DAILY_COMMITMENT',
|
||||||
GET_PTP_AMOUNT = 'GET_PTP_AMOUNT',
|
GET_PTP_AMOUNT = 'GET_PTP_AMOUNT',
|
||||||
GET_VISIBILITY_STATUS = 'GET_VISIBILITY_STATUS',
|
GET_VISIBILITY_STATUS = 'GET_VISIBILITY_STATUS',
|
||||||
// csa
|
|
||||||
|
|
||||||
GET_CSA_TICKETS = 'GET_CSA_TICKETS',
|
|
||||||
GET_CSA_SINGLE_TICKET = 'GET_CSA_SINGLE_TICKET',
|
|
||||||
CREATE_TICKET = 'CREATE_TICKET',
|
|
||||||
ACKNOWLEDGE_TICKET = 'ACKNOWLEDGE_TICKET',
|
|
||||||
ADD_COMMENT = 'ADD_COMMENT',
|
|
||||||
UPDATE_TICKET_STATUS = 'UPDATE_TICKET_STATUS',
|
|
||||||
GET_CSA_FILTERS = 'GET_CSA_FILTERS',
|
|
||||||
GET_FORM_OPTIONS = 'GET_FORM_OPTIONS',
|
|
||||||
GET_UPDATE_COUNT = 'GET_UPDATE_COUNT',
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const API_URLS: Record<ApiKeys, string> = {} as Record<ApiKeys, string>;
|
export const API_URLS: Record<ApiKeys, string> = {} as Record<ApiKeys, string>;
|
||||||
@@ -131,16 +119,6 @@ API_URLS[ApiKeys.DAILY_COMMITMENT] = '/daily-commitment';
|
|||||||
API_URLS[ApiKeys.GET_PTP_AMOUNT] = '/ptps-due-view/agent-detail';
|
API_URLS[ApiKeys.GET_PTP_AMOUNT] = '/ptps-due-view/agent-detail';
|
||||||
API_URLS[ApiKeys.GET_VISIBILITY_STATUS] = '/daily-commitment/visibility';
|
API_URLS[ApiKeys.GET_VISIBILITY_STATUS] = '/daily-commitment/visibility';
|
||||||
|
|
||||||
|
|
||||||
API_URLS[ApiKeys.GET_CSA_TICKETS] = '/support-requests/fetch-all';
|
|
||||||
API_URLS[ApiKeys.GET_CSA_SINGLE_TICKET] = '/support-requests/{ticketReferenceId}';
|
|
||||||
API_URLS[ApiKeys.CREATE_TICKET] = '/support-requests';
|
|
||||||
API_URLS[ApiKeys.ACKNOWLEDGE_TICKET] = '/support-requests/{ticketReferenceId}/acknowledge?supportRequestUserType=FE';
|
|
||||||
API_URLS[ApiKeys.ADD_COMMENT] = '/support-requests/{ticketReferenceId}/comments';
|
|
||||||
API_URLS[ApiKeys.UPDATE_TICKET_STATUS] = '/support-requests/{ticketReferenceId}';
|
|
||||||
API_URLS[ApiKeys.GET_CSA_FILTERS] = '/support-requests/filters';
|
|
||||||
API_URLS[ApiKeys.GET_FORM_OPTIONS] = '/support-requests/form'
|
|
||||||
API_URLS[ApiKeys.GET_UPDATE_COUNT] = '/support-requests/summary'
|
|
||||||
export const API_STATUS_CODE = {
|
export const API_STATUS_CODE = {
|
||||||
OK: 200,
|
OK: 200,
|
||||||
CREATED: 201,
|
CREATED: 201,
|
||||||
@@ -285,10 +263,10 @@ axiosInstance.interceptors.response.use(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// if ([API_STATUS_CODE.UNAUTHORIZED, API_STATUS_CODE.FORBIDDEN].includes(response.status)) {
|
if ([API_STATUS_CODE.UNAUTHORIZED, API_STATUS_CODE.FORBIDDEN].includes(response.status)) {
|
||||||
// // Reset user info
|
// Reset user info
|
||||||
// dispatch(handleLogout());
|
dispatch(handleLogout());
|
||||||
// }
|
}
|
||||||
|
|
||||||
return Promise.reject(error);
|
return Promise.reject(error);
|
||||||
}
|
}
|
||||||
@@ -298,12 +276,11 @@ axiosInstance.interceptors.response.use(
|
|||||||
resolve();
|
resolve();
|
||||||
}, 500);
|
}, 500);
|
||||||
});
|
});
|
||||||
return axiosInstance(config);
|
return delayRetryRequest.then(() => axiosInstance(config));
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
axiosInstance.defaults.headers.common['Content-Type'] = 'application/json';
|
axiosInstance.defaults.headers.common['Content-Type'] = 'application/json';
|
||||||
axiosInstance.defaults.headers.common['routing_key'] = '2aeff6e1-c6c8-4cf2-9e47-daf3de565483';
|
|
||||||
axiosInstance.defaults.baseURL = BASE_AV_APP_URL;
|
axiosInstance.defaults.baseURL = BASE_AV_APP_URL;
|
||||||
|
|
||||||
// TODO:: Ideally should happen through middlewares.
|
// TODO:: Ideally should happen through middlewares.
|
||||||
|
|||||||
@@ -1,13 +1,10 @@
|
|||||||
import { createSlice } from '@reduxjs/toolkit';
|
import { createSlice } from '@reduxjs/toolkit';
|
||||||
import { GetTicketCreationPayload, RequestTicket, Summary } from '@screens/cosmosSupport/constant/types';
|
import { GetTicketCreationPayload, RequestTicket, Summary } from '@screens/cosmosSupport/constant/types';
|
||||||
|
|
||||||
interface IConfigData {
|
|
||||||
supportLink: '';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
interface IConfigSlice {
|
|
||||||
data: IConfigData;
|
interface ICSASlice {
|
||||||
loading: boolean;
|
loading: boolean;
|
||||||
ticketCreationData: {
|
ticketCreationData: {
|
||||||
ticketCreationData:GetTicketCreationPayload;
|
ticketCreationData:GetTicketCreationPayload;
|
||||||
@@ -15,11 +12,11 @@ interface IConfigSlice {
|
|||||||
},
|
},
|
||||||
caseLevelTickets: {
|
caseLevelTickets: {
|
||||||
taskForMe: {
|
taskForMe: {
|
||||||
data: Array<any>;
|
data: Array<unknown>;
|
||||||
loading: boolean;
|
loading: boolean;
|
||||||
},
|
},
|
||||||
taskForTele: {
|
taskForTele: {
|
||||||
data: Array<any>;
|
data: Array<unknown>;
|
||||||
loading: boolean;
|
loading: boolean;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -32,12 +29,9 @@ interface IConfigSlice {
|
|||||||
ticketCreationInProgress: boolean;
|
ticketCreationInProgress: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const initialConfigData = {
|
|
||||||
supportLink: '',
|
|
||||||
} as IConfigData;
|
|
||||||
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
data: initialConfigData,
|
|
||||||
loading: false,
|
loading: false,
|
||||||
|
|
||||||
ticketCreationData: {
|
ticketCreationData: {
|
||||||
@@ -74,14 +68,14 @@ const initialState = {
|
|||||||
},
|
},
|
||||||
isSubmittingComment: false,
|
isSubmittingComment: false,
|
||||||
ticketCreationInProgress: false,
|
ticketCreationInProgress: false,
|
||||||
} as IConfigSlice;
|
} as ICSASlice;
|
||||||
|
|
||||||
const CosmosSupport = createSlice({
|
const CosmosSupport = createSlice({
|
||||||
name: 'config',
|
name: 'config',
|
||||||
initialState,
|
initialState,
|
||||||
reducers: {
|
reducers: {
|
||||||
setTicketCreationData: (state, action) => {
|
setTicketCreationData: (state, action) => {
|
||||||
state.data = action.payload;
|
state.ticketCreationData.isLoading = action.payload;
|
||||||
},
|
},
|
||||||
setLoading: (state, action) => {
|
setLoading: (state, action) => {
|
||||||
state.loading = action.payload;
|
state.loading = action.payload;
|
||||||
|
|||||||
@@ -45,12 +45,10 @@ const ProfileStack = () => {
|
|||||||
>
|
>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name={ProfileScreenStackEnum.TELE_SUPPORT}
|
name={ProfileScreenStackEnum.TELE_SUPPORT}
|
||||||
// @ts-ignore
|
|
||||||
component={ViewRequestHistory}
|
component={ViewRequestHistory}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name={ProfileScreenStackEnum.PROFILE_TICKET_DETAIL}
|
name={ProfileScreenStackEnum.PROFILE_TICKET_DETAIL}
|
||||||
// @ts-ignore
|
|
||||||
component={RequestDetail}
|
component={RequestDetail}
|
||||||
/>
|
/>
|
||||||
</Stack.Group>
|
</Stack.Group>
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ const AllCasesMain = () => {
|
|||||||
component: () => (
|
component: () => (
|
||||||
<>
|
<>
|
||||||
<CasesList casesList={[...pendingList, ...pinnedList, ...completedList]} allCasesView />
|
<CasesList casesList={[...pendingList, ...pinnedList, ...completedList]} allCasesView />
|
||||||
{shouldShowBanner || true ? <FloatingBannerCta
|
{shouldShowBanner ? <FloatingBannerCta
|
||||||
title={"Update your daily commitment"}
|
title={"Update your daily commitment"}
|
||||||
onPressHandler={openCommitmentScreen}
|
onPressHandler={openCommitmentScreen}
|
||||||
containerStyle={styles.container}
|
containerStyle={styles.container}
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ const CustomerCard: React.FC<ICustomerCard> = (props) => {
|
|||||||
header='Mark as done'
|
header='Mark as done'
|
||||||
moveForKeyboard={0.2}
|
moveForKeyboard={0.2}
|
||||||
>
|
>
|
||||||
<SafeAreaView style={[GenericStyles.p16, GenericStyles.fill, { paddingTop: 0 }]}>
|
<SafeAreaView style={[GenericStyles.p16, GenericStyles.fill,styles.pt0]}>
|
||||||
<View style={[GenericStyles.fill]}>
|
<View style={[GenericStyles.fill]}>
|
||||||
<TextInput
|
<TextInput
|
||||||
numberOfLines={5}
|
numberOfLines={5}
|
||||||
@@ -189,6 +189,9 @@ const styles = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
flexBasis48:{
|
flexBasis48:{
|
||||||
flexBasis: '48%'
|
flexBasis: '48%'
|
||||||
|
},
|
||||||
|
pt0: {
|
||||||
|
paddingTop: 0
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
69
src/screens/cosmosSupport/CustomerDetailListItem.tsx
Normal file
69
src/screens/cosmosSupport/CustomerDetailListItem.tsx
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
import { Pressable, StyleSheet, View } from 'react-native'
|
||||||
|
import React from 'react'
|
||||||
|
import Heading from '@rn-ui-lib/components/Heading'
|
||||||
|
import { GenericStyles } from '@rn-ui-lib/styles'
|
||||||
|
import { formatAmount } from '@rn-ui-lib/utils/amount'
|
||||||
|
import Text from '@rn-ui-lib/components/Text'
|
||||||
|
import { COLORS } from '@rn-ui-lib/colors'
|
||||||
|
|
||||||
|
interface ICustomerDetailListItem {
|
||||||
|
item: any;
|
||||||
|
viewTaskCta: string;
|
||||||
|
handleNavigation: () => void;
|
||||||
|
handleNavigationTODetails: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const CustomerDetailListItem: React.FC<ICustomerDetailListItem> = (props) => {
|
||||||
|
const { item, viewTaskCta, handleNavigation, handleNavigationTODetails } = props;
|
||||||
|
return (
|
||||||
|
<View>
|
||||||
|
<Heading style={GenericStyles.mt16} type='h5' dark>{item.customerName}</Heading>
|
||||||
|
<View style={[GenericStyles.row, GenericStyles.mt8]}>
|
||||||
|
<View>
|
||||||
|
<Text>{formatAmount(item?.overdueAmount?.value)}</Text>
|
||||||
|
<Text style={styles.tagColor} small>Overdue Amount</Text>
|
||||||
|
</View>
|
||||||
|
<View style={styles.marginLeft60}>
|
||||||
|
<Text>{item?.loanAccountNumber}</Text>
|
||||||
|
<Text style={styles.tagColor} small>LAN</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
<View style={[GenericStyles.row, GenericStyles.mt16]}>
|
||||||
|
<Pressable
|
||||||
|
onPress={handleNavigationTODetails}
|
||||||
|
>
|
||||||
|
<Text
|
||||||
|
style={styles.buttonText}
|
||||||
|
>
|
||||||
|
{viewTaskCta} </Text>
|
||||||
|
</Pressable>
|
||||||
|
<Pressable
|
||||||
|
style={GenericStyles.ml16}
|
||||||
|
onPress={handleNavigation}
|
||||||
|
>
|
||||||
|
<Text
|
||||||
|
style={styles.buttonText}
|
||||||
|
>
|
||||||
|
Go to customer details
|
||||||
|
</Text>
|
||||||
|
</Pressable>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
tagColor: {
|
||||||
|
color: COLORS.BORDER.SECONDARY
|
||||||
|
},
|
||||||
|
marginLeft60: {
|
||||||
|
marginLeft: 60
|
||||||
|
},
|
||||||
|
buttonText: {
|
||||||
|
fontWeight: "500",
|
||||||
|
color: COLORS.BASE.BLUE
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
export default CustomerDetailListItem;
|
||||||
24
src/screens/cosmosSupport/HeaderNode.tsx
Normal file
24
src/screens/cosmosSupport/HeaderNode.tsx
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
import Heading from "@rn-ui-lib/components/Heading"
|
||||||
|
import { GenericStyles } from "@rn-ui-lib/styles"
|
||||||
|
import React from "react";
|
||||||
|
import { View } from "react-native"
|
||||||
|
|
||||||
|
|
||||||
|
interface IHeaderNode {
|
||||||
|
title: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const HeaderNode:React.FC<IHeaderNode> = (props) => {
|
||||||
|
return (
|
||||||
|
<View
|
||||||
|
style={[
|
||||||
|
GenericStyles.ph16,
|
||||||
|
GenericStyles.pb16,
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<Heading dark type='h3'>{props.title}</Heading>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default HeaderNode
|
||||||
@@ -1,28 +1,26 @@
|
|||||||
import { navigateToScreen } from '@components/utlis/navigationUtlis'
|
import { navigateToScreen } from '@components/utlis/navigationUtlis'
|
||||||
|
import { useAppDispatch } from '@hooks'
|
||||||
|
import { resetSingleViewRequestTicket } from '@reducers/cosmosSupportSlice'
|
||||||
import { COLORS } from '@rn-ui-lib/colors'
|
import { COLORS } from '@rn-ui-lib/colors'
|
||||||
import Tag, { TagVariant } from '@rn-ui-lib/components/Tag'
|
import Tag, { TagVariant } from '@rn-ui-lib/components/Tag'
|
||||||
import Text from '@rn-ui-lib/components/Text'
|
import Text from '@rn-ui-lib/components/Text'
|
||||||
import ArrowRightOutlineIcon from '@rn-ui-lib/icons/ArrowRightOutlineIcon'
|
import ArrowRightOutlineIcon from '@rn-ui-lib/icons/ArrowRightOutlineIcon'
|
||||||
import { GenericStyles } from '@rn-ui-lib/styles'
|
import { GenericStyles } from '@rn-ui-lib/styles'
|
||||||
|
import { ProfileScreenStackEnum } from '@screens/Profile/ProfileStack'
|
||||||
|
import { PageRouteEnum } from '@screens/auth/ProtectedRouter'
|
||||||
import { CaseDetailStackEnum } from '@screens/caseDetails/CaseDetailStack'
|
import { CaseDetailStackEnum } from '@screens/caseDetails/CaseDetailStack'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Pressable, StyleSheet, TouchableHighlight, View } from 'react-native'
|
import { StyleSheet, TouchableHighlight, View } from 'react-native'
|
||||||
|
import CustomerDetailListItem from './CustomerDetailListItem'
|
||||||
import RelativeTime from './RelativeTime'
|
import RelativeTime from './RelativeTime'
|
||||||
import { ProfileScreenStackEnum } from '@screens/Profile/ProfileStack'
|
import { Mapping, SCREEN_MAP, StatusColorMapping } from './constant'
|
||||||
import { RequestTypeReadableString, SCREEN_MAP, StatusColorMapping } from './constant'
|
|
||||||
import Heading from '@rn-ui-lib/components/Heading'
|
|
||||||
import { formatAmount } from '@rn-ui-lib/utils/amount'
|
|
||||||
import Button from '@rn-ui-lib/components/Button'
|
|
||||||
import { PageRouteEnum } from '@screens/auth/ProtectedRouter'
|
|
||||||
import { useAppDispatch } from '@hooks'
|
|
||||||
import { resetSingleViewRequestTicket } from '@reducers/cosmosSupportSlice'
|
|
||||||
|
|
||||||
const ListItem = (props: any) => {
|
const ListItem = (props: any) => {
|
||||||
const { form, route, item, task } = props;
|
const { form, route, item, task } = props;
|
||||||
|
|
||||||
const viewTaskCta = task === SCREEN_MAP.TASK_FOR_ME ? "View task details": "View request details";
|
const viewTaskCta = task === SCREEN_MAP.TASK_FOR_ME ? "View task details" : "View request details";
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
const Component = form === "profile" ? View : TouchableHighlight;
|
const Component = form === Mapping.FORM_PROFILE ? View : TouchableHighlight;
|
||||||
const handleNavigation = () => {
|
const handleNavigation = () => {
|
||||||
navigateToScreen(PageRouteEnum.CASE_DETAIL_STACK, {
|
navigateToScreen(PageRouteEnum.CASE_DETAIL_STACK, {
|
||||||
screen: CaseDetailStackEnum.COLLECTION_CASE_DETAIL,
|
screen: CaseDetailStackEnum.COLLECTION_CASE_DETAIL,
|
||||||
@@ -32,7 +30,7 @@ const ListItem = (props: any) => {
|
|||||||
|
|
||||||
const handleNavigationTODetails = () => {
|
const handleNavigationTODetails = () => {
|
||||||
dispatch(resetSingleViewRequestTicket(null))
|
dispatch(resetSingleViewRequestTicket(null))
|
||||||
navigateToScreen(form === "profile" ? ProfileScreenStackEnum.PROFILE_TICKET_DETAIL : CaseDetailStackEnum.VIEW_REQUEST_DETAIL, { ticketId: item?.referenceId, task })
|
navigateToScreen(form === Mapping.FORM_PROFILE ? ProfileScreenStackEnum.PROFILE_TICKET_DETAIL : CaseDetailStackEnum.VIEW_REQUEST_DETAIL, { ticketId: item?.referenceId, task })
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<Component
|
<Component
|
||||||
@@ -75,41 +73,9 @@ const ListItem = (props: any) => {
|
|||||||
<Tag style={[GenericStyles.ml10]} variant={StatusColorMapping[item?.status as keyof typeof StatusColorMapping] as any || TagVariant.violet} text={item?.statusLabel} />
|
<Tag style={[GenericStyles.ml10]} variant={StatusColorMapping[item?.status as keyof typeof StatusColorMapping] as any || TagVariant.violet} text={item?.statusLabel} />
|
||||||
</View>
|
</View>
|
||||||
<RelativeTime prefix='Requested' date={new Date(item?.createdAt).toString()} />
|
<RelativeTime prefix='Requested' date={new Date(item?.createdAt).toString()} />
|
||||||
{form === "profile" ? <View>
|
{form ===Mapping.FORM_PROFILE ? <CustomerDetailListItem item={item} handleNavigation={handleNavigation} handleNavigationTODetails={handleNavigationTODetails} viewTaskCta={viewTaskCta} /> : null}
|
||||||
<Heading style={GenericStyles.mt16} type='h5' dark>Aman kumar singh</Heading>
|
|
||||||
<View style={[GenericStyles.row, GenericStyles.mt8]}>
|
|
||||||
<View>
|
|
||||||
<Text>{formatAmount(item?.overdueAmount?.value)}</Text>
|
|
||||||
<Text style={styles.tagColor} small>Overdue Amount</Text>
|
|
||||||
</View>
|
|
||||||
<View style={styles.marginLeft60}>
|
|
||||||
<Text>{item?.loanAccountNumber}</Text>
|
|
||||||
<Text style={styles.tagColor} small>LAN</Text>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
<View style={[GenericStyles.row, GenericStyles.mt16]}>
|
|
||||||
<Pressable
|
|
||||||
onPress={handleNavigationTODetails}
|
|
||||||
>
|
|
||||||
<Text
|
|
||||||
style={styles.buttonText}
|
|
||||||
>
|
|
||||||
{viewTaskCta} </Text>
|
|
||||||
</Pressable>
|
|
||||||
<Pressable
|
|
||||||
style={GenericStyles.ml16}
|
|
||||||
onPress={handleNavigation}
|
|
||||||
>
|
|
||||||
<Text
|
|
||||||
style={styles.buttonText}
|
|
||||||
>
|
|
||||||
Go to customer details
|
|
||||||
</Text>
|
|
||||||
</Pressable>
|
|
||||||
</View>
|
|
||||||
</View> : null}
|
|
||||||
</View>
|
</View>
|
||||||
{form === "profile" ? null : <ArrowRightOutlineIcon fillColor={COLORS.BASE.BLUE} />}
|
{form ===Mapping.FORM_PROFILE ? null : <ArrowRightOutlineIcon fillColor={COLORS.BASE.BLUE} />}
|
||||||
</>
|
</>
|
||||||
</Component>
|
</Component>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -85,19 +85,9 @@ const CardComponent: React.FC<ICardComponent> = (props) => {
|
|||||||
<RelativeTime prefix='' date={time} />
|
<RelativeTime prefix='' date={time} />
|
||||||
</SuspenseLoader>
|
</SuspenseLoader>
|
||||||
</View>
|
</View>
|
||||||
{/* <SuspenseLoader
|
|
||||||
loading={!comment}
|
|
||||||
fallBack={
|
|
||||||
<View style={[GenericStyles.mt6, GenericStyles.ml4]}>
|
|
||||||
<LineLoader height={14} width={"100%"} />
|
|
||||||
<LineLoader style={GenericStyles.mt4} height={14} width={"100%"} />
|
|
||||||
</View>
|
|
||||||
}
|
|
||||||
> */}
|
|
||||||
<Text selectable style={[GenericStyles.ml4]}>
|
<Text selectable style={[GenericStyles.ml4]}>
|
||||||
{comment}
|
{comment}
|
||||||
</Text>
|
</Text>
|
||||||
{/* </SuspenseLoader> */}
|
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -28,18 +28,15 @@ interface IRequestDetail {
|
|||||||
|
|
||||||
const RequestDetail: React.FC<IRequestDetail> = (props) => {
|
const RequestDetail: React.FC<IRequestDetail> = (props) => {
|
||||||
|
|
||||||
// const [isRefreshing, setRefreshing] = useState(false);
|
const {data, isRefreshing, user} = useAppSelector(state => ({
|
||||||
const {data, isRefreshing} = useAppSelector(state => ({
|
|
||||||
data: state.cosmosSupport.currentViewRequestTicket.data,
|
data: state.cosmosSupport.currentViewRequestTicket.data,
|
||||||
isRefreshing: state.cosmosSupport.currentViewRequestTicket.loading
|
isRefreshing: state.cosmosSupport.currentViewRequestTicket.loading,
|
||||||
|
user: state.user.user
|
||||||
}))
|
}))
|
||||||
const scrollViewRef = React.useRef<ScrollView>(null);
|
const scrollViewRef = React.useRef<ScrollView>(null);
|
||||||
const [comment, setComment] = React.useState<string>('');
|
const [comment, setComment] = React.useState<string>('');
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
|
|
||||||
const {user} = useAppSelector((state) => ({
|
|
||||||
user: state.user.user
|
|
||||||
}));
|
|
||||||
|
|
||||||
const onRefresh = () => {
|
const onRefresh = () => {
|
||||||
if (!props?.route?.params?.ticketId) return;
|
if (!props?.route?.params?.ticketId) return;
|
||||||
@@ -114,7 +111,7 @@ const RequestDetail: React.FC<IRequestDetail> = (props) => {
|
|||||||
Pos={data?.customerDetails?.outstandingAmount || 0}
|
Pos={data?.customerDetails?.outstandingAmount || 0}
|
||||||
customerName={data?.customerDetails?.customerName || ''}
|
customerName={data?.customerDetails?.customerName || ''}
|
||||||
status={data?.status || ''}
|
status={data?.status || ''}
|
||||||
refId={data?.referenceId} //todo
|
refId={data?.referenceId}
|
||||||
isRefreshing={isRefreshing}
|
isRefreshing={isRefreshing}
|
||||||
isEditable={Boolean(props?.route?.params?.task)}
|
isEditable={Boolean(props?.route?.params?.task)}
|
||||||
ticketStatusChange={loadData}
|
ticketStatusChange={loadData}
|
||||||
|
|||||||
@@ -1,41 +1,21 @@
|
|||||||
import { SafeAreaView, ScrollView, StyleSheet, View } from 'react-native'
|
|
||||||
import React, { useEffect } from 'react'
|
|
||||||
import { GenericStyles } from '@rn-ui-lib/styles';
|
|
||||||
import NavigationHeader from '@rn-ui-lib/components/NavigationHeader';
|
|
||||||
import { goBack } from '@components/utlis/navigationUtlis';
|
|
||||||
import Text from '@rn-ui-lib/components/Text';
|
|
||||||
import Tag, { TagVariant } from '@rn-ui-lib/components/Tag';
|
|
||||||
import Chip from '@screens/caseDetails/Chip';
|
|
||||||
import { Controller, useForm } from 'react-hook-form';
|
|
||||||
import TextInput from '@rn-ui-lib/components/TextInput';
|
|
||||||
import Button from '@rn-ui-lib/components/Button';
|
|
||||||
import PressableChip from '@rn-ui-lib/components/PressableChip';
|
|
||||||
import { useAppDispatch, useAppSelector } from '@hooks';
|
|
||||||
import { createTicket, getDataForTicketCreation } from './actions';
|
|
||||||
import LineLoader from '@rn-ui-lib/components/suspense_loader/LineLoader';
|
|
||||||
import { CreateTicketPayload, GetTicketCreationPayload } from './constant/types';
|
|
||||||
import SuspenseLoader from '@rn-ui-lib/components/suspense_loader/SuspenseLoader';
|
|
||||||
import FullScreenLoaderWrapper from '@common/FullScreenLoaderWrapper';
|
import FullScreenLoaderWrapper from '@common/FullScreenLoaderWrapper';
|
||||||
import { useDispatch } from 'react-redux';
|
import { goBack } from '@components/utlis/navigationUtlis';
|
||||||
|
import { useAppDispatch, useAppSelector } from '@hooks';
|
||||||
|
import Button from '@rn-ui-lib/components/Button';
|
||||||
|
import NavigationHeader from '@rn-ui-lib/components/NavigationHeader';
|
||||||
|
import PressableChip from '@rn-ui-lib/components/PressableChip';
|
||||||
|
import Text from '@rn-ui-lib/components/Text';
|
||||||
|
import TextInput from '@rn-ui-lib/components/TextInput';
|
||||||
|
import LineLoader from '@rn-ui-lib/components/suspense_loader/LineLoader';
|
||||||
|
import SuspenseLoader from '@rn-ui-lib/components/suspense_loader/SuspenseLoader';
|
||||||
|
import { GenericStyles } from '@rn-ui-lib/styles';
|
||||||
|
import React, { useEffect } from 'react';
|
||||||
|
import { Controller, useForm } from 'react-hook-form';
|
||||||
|
import { SafeAreaView, ScrollView, StyleSheet, View } from 'react-native';
|
||||||
|
import { createTicket, getDataForTicketCreation } from './actions';
|
||||||
|
import { CreateTicketPayload } from './constant/types';
|
||||||
|
|
||||||
|
|
||||||
const supportTypes = [
|
|
||||||
{
|
|
||||||
label: "Soft calling",
|
|
||||||
value: "SOFT_CALLING"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Hard calling",
|
|
||||||
value: "HARD_CALLING"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "PTP follow up",
|
|
||||||
value: "PTP_FOLLOW_UP"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Skip Tracing",
|
|
||||||
value: "SKIP_TRACING"
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
|
|
||||||
const LoadingChips = () => {
|
const LoadingChips = () => {
|
||||||
@@ -44,7 +24,7 @@ const LoadingChips = () => {
|
|||||||
{[...Array(5)].map((type, index) => (
|
{[...Array(5)].map((type, index) => (
|
||||||
<LineLoader
|
<LineLoader
|
||||||
key={index}
|
key={index}
|
||||||
style={[GenericStyles.mr8, GenericStyles.br8, { marginVertical: 10 }]}
|
style={[GenericStyles.mr8, GenericStyles.br8, styles.mv10]}
|
||||||
height={32}
|
height={32}
|
||||||
width={100}
|
width={100}
|
||||||
/>
|
/>
|
||||||
@@ -138,7 +118,7 @@ const RequestSupport: React.FC<RequestSupportProps> = (props) => {
|
|||||||
fallBack={<LoadingChips />}
|
fallBack={<LoadingChips />}
|
||||||
>
|
>
|
||||||
<View style={[GenericStyles.row, GenericStyles.flexWrap]}>
|
<View style={[GenericStyles.row, GenericStyles.flexWrap]}>
|
||||||
{supportTypes.map((type, index) => (
|
{data?.requestForm?.map((type, index) => (
|
||||||
<Controller
|
<Controller
|
||||||
key={type.value}
|
key={type.value}
|
||||||
control={control}
|
control={control}
|
||||||
@@ -151,7 +131,6 @@ const RequestSupport: React.FC<RequestSupportProps> = (props) => {
|
|||||||
onSelectionChange={(meta, data) => onChange(data)}
|
onSelectionChange={(meta, data) => onChange(data)}
|
||||||
checked={value === type.value}
|
checked={value === type.value}
|
||||||
meta={type.value}
|
meta={type.value}
|
||||||
containerStyles={{margin:0}}
|
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
@@ -173,7 +152,6 @@ const RequestSupport: React.FC<RequestSupportProps> = (props) => {
|
|||||||
placeholder='Enter comments...'
|
placeholder='Enter comments...'
|
||||||
onChangeText={onChange}
|
onChangeText={onChange}
|
||||||
value={value}
|
value={value}
|
||||||
// Adjust other TextInput props as needed
|
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
/> }
|
/> }
|
||||||
@@ -216,6 +194,9 @@ const styles = StyleSheet.create({
|
|||||||
textAlignVertical: 'top',
|
textAlignVertical: 'top',
|
||||||
maxHeight: 100,
|
maxHeight: 100,
|
||||||
},
|
},
|
||||||
|
mv10:{
|
||||||
|
marginVertical:10
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import { StyleSheet, Text, View } from 'react-native'
|
import Tag, { TagVariant } from '@rn-ui-lib/components/Tag';
|
||||||
import React from 'react'
|
|
||||||
import Tag, { TagVariant } from '@rn-ui-lib/components/Tag'
|
|
||||||
import { COLORS } from '@rn-ui-lib/colors';
|
|
||||||
import { GenericStyles } from '@rn-ui-lib/styles';
|
import { GenericStyles } from '@rn-ui-lib/styles';
|
||||||
|
import React from 'react';
|
||||||
|
import { View } from 'react-native';
|
||||||
|
|
||||||
interface ITagComponent {
|
interface ITagComponent {
|
||||||
text: string;
|
text: string;
|
||||||
@@ -21,11 +20,6 @@ const TagComponent: React.FC<ITagComponent> = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
|
||||||
|
|
||||||
container: {
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
export default TagComponent;
|
export default TagComponent;
|
||||||
@@ -5,7 +5,7 @@ import { ListRenderItemInfo, RefreshControl, View, VirtualizedList } from 'react
|
|||||||
import { ListItemLoading } from './';
|
import { ListItemLoading } from './';
|
||||||
import CSAFilters from './CSAFilters';
|
import CSAFilters from './CSAFilters';
|
||||||
import ListItem from './ListItem';
|
import ListItem from './ListItem';
|
||||||
import { SCREEN_MAP } from './constant';
|
import { SCREEN_MAP, loadingData } from './constant';
|
||||||
import { useAppDispatch, useAppSelector } from '@hooks';
|
import { useAppDispatch, useAppSelector } from '@hooks';
|
||||||
import { fetchTicketList } from './actions';
|
import { fetchTicketList } from './actions';
|
||||||
import { setCaseLevelTicketsForMe, setCaseLevelTicketsForMeLoading } from '@reducers/cosmosSupportSlice';
|
import { setCaseLevelTicketsForMe, setCaseLevelTicketsForMeLoading } from '@reducers/cosmosSupportSlice';
|
||||||
@@ -14,16 +14,13 @@ import Text from '@rn-ui-lib/components/Text';
|
|||||||
import { From } from './ViewRequestHistory';
|
import { From } from './ViewRequestHistory';
|
||||||
import { GetAllTicketFilters, GetAllTicketsPayload, IFilterStatus, Status } from './constant/types';
|
import { GetAllTicketFilters, GetAllTicketsPayload, IFilterStatus, Status } from './constant/types';
|
||||||
|
|
||||||
// Define the item type
|
|
||||||
interface ListItem {
|
interface ListItem {
|
||||||
id: string;
|
id: string;
|
||||||
text: string;
|
text: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const loadingData: ListItem[] = Array.from({ length: 10 }, (_, index) => ({
|
|
||||||
id: index.toString(),
|
|
||||||
text: `Item ${index + 1}`,
|
|
||||||
}));
|
|
||||||
|
|
||||||
interface ITaskForMe {
|
interface ITaskForMe {
|
||||||
route: {
|
route: {
|
||||||
@@ -121,14 +118,14 @@ const TaskForMe: React.FC<ITaskForMe> = (props) => {
|
|||||||
renderItem={apiCallInProgress ? renderItemLoadingState : renderItem}
|
renderItem={apiCallInProgress ? renderItemLoadingState : renderItem}
|
||||||
getItemCount={getItemCount}
|
getItemCount={getItemCount}
|
||||||
getItem={getItem}
|
getItem={getItem}
|
||||||
initialNumToRender={5} // Adjust as needed
|
initialNumToRender={5}
|
||||||
maxToRenderPerBatch={10} // Adjust as needed
|
maxToRenderPerBatch={10}
|
||||||
windowSize={10} // Adjust as needed
|
windowSize={10}
|
||||||
refreshControl={
|
refreshControl={
|
||||||
<RefreshControl
|
<RefreshControl
|
||||||
refreshing={isRefreshing}
|
refreshing={isRefreshing}
|
||||||
onRefresh={onRefresh}
|
onRefresh={onRefresh}
|
||||||
colors={[COLORS.BASE.BLUE]} // Adjust the color as needed
|
colors={[COLORS.BASE.BLUE]}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
ListEmptyComponent={() => (
|
ListEmptyComponent={() => (
|
||||||
|
|||||||
@@ -8,13 +8,12 @@ import { ListItemLoading } from './';
|
|||||||
import CSAFilters from './CSAFilters';
|
import CSAFilters from './CSAFilters';
|
||||||
import ListItem from './ListItem';
|
import ListItem from './ListItem';
|
||||||
import { fetchTicketList } from './actions';
|
import { fetchTicketList } from './actions';
|
||||||
import { SCREEN_MAP } from './constant';
|
import { SCREEN_MAP, loadingData } from './constant';
|
||||||
import TaskForMeEmptyScreen from '@assets/icons/TaskForMeEmptyScreen';
|
import TaskForMeEmptyScreen from '@assets/icons/TaskForMeEmptyScreen';
|
||||||
import Text from '@rn-ui-lib/components/Text';
|
import Text from '@rn-ui-lib/components/Text';
|
||||||
import { From } from './ViewRequestHistory';
|
import { From } from './ViewRequestHistory';
|
||||||
import { GetAllTicketFilters, IFilterStatus, Status } from './constant/types';
|
import { GetAllTicketFilters, IFilterStatus, Status } from './constant/types';
|
||||||
|
|
||||||
// Define the item type
|
|
||||||
interface ListItem {
|
interface ListItem {
|
||||||
id: string;
|
id: string;
|
||||||
text: string;
|
text: string;
|
||||||
@@ -32,14 +31,10 @@ interface ITaskForMe {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
const loadingData: ListItem[] = Array.from({ length: 10 }, (_, index) => ({
|
|
||||||
id: index.toString(),
|
|
||||||
text: `Item ${index + 1}`,
|
|
||||||
}));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Define the component type
|
|
||||||
const TeleSupport: React.FC<ITaskForMe> = (props) => {
|
const TeleSupport: React.FC<ITaskForMe> = (props) => {
|
||||||
|
|
||||||
const { from, route, lan, forScreen } = props;
|
const { from, route, lan, forScreen } = props;
|
||||||
@@ -54,7 +49,6 @@ const TeleSupport: React.FC<ITaskForMe> = (props) => {
|
|||||||
const [isRefreshing, setRefreshing] = useState(false);
|
const [isRefreshing, setRefreshing] = useState(false);
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
const onRefresh = () => {
|
const onRefresh = () => {
|
||||||
// Simulate a refresh process
|
|
||||||
loadData();
|
loadData();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -107,7 +101,6 @@ const TeleSupport: React.FC<ITaskForMe> = (props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const failureCallback = () => {
|
const failureCallback = () => {
|
||||||
console.log('failureCallback')
|
|
||||||
setRefreshing(false);
|
setRefreshing(false);
|
||||||
dispatch(setCaseLevelTicketsForTeleLoading(false));
|
dispatch(setCaseLevelTicketsForTeleLoading(false));
|
||||||
};
|
};
|
||||||
@@ -130,19 +123,16 @@ const TeleSupport: React.FC<ITaskForMe> = (props) => {
|
|||||||
renderItem={apiCallInProgress ? renderItemLoadingState : renderItem}
|
renderItem={apiCallInProgress ? renderItemLoadingState : renderItem}
|
||||||
getItemCount={getItemCount}
|
getItemCount={getItemCount}
|
||||||
getItem={getItem}
|
getItem={getItem}
|
||||||
initialNumToRender={5} // Adjust as needed
|
initialNumToRender={5}
|
||||||
maxToRenderPerBatch={10} // Adjust as needed
|
maxToRenderPerBatch={10}
|
||||||
windowSize={10} // Adjust as needed
|
windowSize={10}
|
||||||
refreshControl={
|
refreshControl={
|
||||||
<RefreshControl
|
<RefreshControl
|
||||||
refreshing={isRefreshing}
|
refreshing={isRefreshing}
|
||||||
onRefresh={onRefresh}
|
onRefresh={onRefresh}
|
||||||
colors={[COLORS.BASE.BLUE]} // Adjust the color as needed
|
colors={[COLORS.BASE.BLUE]}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
onEndReached={() => {
|
|
||||||
//todo api call for next page
|
|
||||||
}}
|
|
||||||
ListEmptyComponent={() => (
|
ListEmptyComponent={() => (
|
||||||
<View style={[GenericStyles.fill, GenericStyles.alignCenter, GenericStyles.mt32]}>
|
<View style={[GenericStyles.fill, GenericStyles.alignCenter, GenericStyles.mt32]}>
|
||||||
<TaskForMeEmptyScreen />
|
<TaskForMeEmptyScreen />
|
||||||
|
|||||||
@@ -25,6 +25,17 @@ const TextFieldWithInput: React.FC<ITextFieldWithInput> = (props) => {
|
|||||||
}
|
}
|
||||||
}, [addingComment])
|
}, [addingComment])
|
||||||
|
|
||||||
|
const onPress = () => {
|
||||||
|
if (!comment) {
|
||||||
|
Toast.show({
|
||||||
|
type: 'error',
|
||||||
|
text1: 'Comment is required',
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
onPressSend(comment);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={[
|
<View style={[
|
||||||
@@ -43,18 +54,9 @@ const TextFieldWithInput: React.FC<ITextFieldWithInput> = (props) => {
|
|||||||
<Pressable
|
<Pressable
|
||||||
disabled={addingComment}
|
disabled={addingComment}
|
||||||
style={styles.buttonStyle}
|
style={styles.buttonStyle}
|
||||||
onPress={() => {
|
onPress={onPress}
|
||||||
if (!comment) {
|
|
||||||
Toast.show({
|
|
||||||
type: 'error',
|
|
||||||
text1: 'Comment is required',
|
|
||||||
})
|
|
||||||
return;
|
|
||||||
};
|
|
||||||
onPressSend(comment)
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<SendIcon fillColor={addingComment ? "red" : undefined} />
|
<SendIcon />
|
||||||
</Pressable>
|
</Pressable>
|
||||||
<FullScreenLoaderWrapper
|
<FullScreenLoaderWrapper
|
||||||
loading={addingComment}
|
loading={addingComment}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import { TaskForMe, TeleSupport } from './';
|
|||||||
import TagComponent from './TagComponent';
|
import TagComponent from './TagComponent';
|
||||||
import { SCREEN_MAP } from './constant';
|
import { SCREEN_MAP } from './constant';
|
||||||
import { getSummary } from './actions';
|
import { getSummary } from './actions';
|
||||||
|
import { ParamListBase } from '@react-navigation/native';
|
||||||
|
|
||||||
|
|
||||||
type SCENE = keyof typeof SCREEN_MAP
|
type SCENE = keyof typeof SCREEN_MAP
|
||||||
|
|||||||
@@ -30,3 +30,8 @@ export enum Mapping {
|
|||||||
COMMENT_TYPE = 'COMMENT_ADDITION',
|
COMMENT_TYPE = 'COMMENT_ADDITION',
|
||||||
FORM_PROFILE = 'profile',
|
FORM_PROFILE = 'profile',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const loadingData = Array.from({ length: 10 }, (_, index) => ({
|
||||||
|
id: index.toString(),
|
||||||
|
text: `Item ${index + 1}`,
|
||||||
|
}));
|
||||||
Reference in New Issue
Block a user