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": {
|
||||
"crashlytics_debug_enabled": false,
|
||||
"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) {
|
||||
// const { heading, instructions } = BLOCKER_SCREEN_DATA.TIME_UNSYNC;
|
||||
// return (
|
||||
// <BlockerInstructions
|
||||
// heading={heading}
|
||||
// instructions={instructions}
|
||||
// actionBtn={{ title: 'Go to settings', action: handleOpenSettings }}
|
||||
// />
|
||||
// );
|
||||
// }
|
||||
if (!isTimeSynced) {
|
||||
const { heading, instructions } = BLOCKER_SCREEN_DATA.TIME_UNSYNC;
|
||||
return (
|
||||
<BlockerInstructions
|
||||
heading={heading}
|
||||
instructions={instructions}
|
||||
actionBtn={{ title: 'Go to settings', action: handleOpenSettings }}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
if (!isDeviceLocationEnabled) {
|
||||
const { heading, instructions } = BLOCKER_SCREEN_DATA.DEVICE_LOCATION_OFF;
|
||||
|
||||
@@ -67,18 +67,6 @@ export enum ApiKeys {
|
||||
DAILY_COMMITMENT = 'DAILY_COMMITMENT',
|
||||
GET_PTP_AMOUNT = 'GET_PTP_AMOUNT',
|
||||
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>;
|
||||
@@ -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_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 = {
|
||||
OK: 200,
|
||||
CREATED: 201,
|
||||
@@ -285,10 +263,10 @@ axiosInstance.interceptors.response.use(
|
||||
});
|
||||
}
|
||||
|
||||
// if ([API_STATUS_CODE.UNAUTHORIZED, API_STATUS_CODE.FORBIDDEN].includes(response.status)) {
|
||||
// // Reset user info
|
||||
// dispatch(handleLogout());
|
||||
// }
|
||||
if ([API_STATUS_CODE.UNAUTHORIZED, API_STATUS_CODE.FORBIDDEN].includes(response.status)) {
|
||||
// Reset user info
|
||||
dispatch(handleLogout());
|
||||
}
|
||||
|
||||
return Promise.reject(error);
|
||||
}
|
||||
@@ -298,12 +276,11 @@ axiosInstance.interceptors.response.use(
|
||||
resolve();
|
||||
}, 500);
|
||||
});
|
||||
return axiosInstance(config);
|
||||
return delayRetryRequest.then(() => axiosInstance(config));
|
||||
}
|
||||
);
|
||||
|
||||
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;
|
||||
|
||||
// TODO:: Ideally should happen through middlewares.
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
import { createSlice } from '@reduxjs/toolkit';
|
||||
import { GetTicketCreationPayload, RequestTicket, Summary } from '@screens/cosmosSupport/constant/types';
|
||||
|
||||
interface IConfigData {
|
||||
supportLink: '';
|
||||
}
|
||||
|
||||
|
||||
interface IConfigSlice {
|
||||
data: IConfigData;
|
||||
|
||||
interface ICSASlice {
|
||||
loading: boolean;
|
||||
ticketCreationData: {
|
||||
ticketCreationData:GetTicketCreationPayload;
|
||||
@@ -15,11 +12,11 @@ interface IConfigSlice {
|
||||
},
|
||||
caseLevelTickets: {
|
||||
taskForMe: {
|
||||
data: Array<any>;
|
||||
data: Array<unknown>;
|
||||
loading: boolean;
|
||||
},
|
||||
taskForTele: {
|
||||
data: Array<any>;
|
||||
data: Array<unknown>;
|
||||
loading: boolean;
|
||||
}
|
||||
},
|
||||
@@ -32,12 +29,9 @@ interface IConfigSlice {
|
||||
ticketCreationInProgress: boolean;
|
||||
}
|
||||
|
||||
export const initialConfigData = {
|
||||
supportLink: '',
|
||||
} as IConfigData;
|
||||
|
||||
|
||||
const initialState = {
|
||||
data: initialConfigData,
|
||||
loading: false,
|
||||
|
||||
ticketCreationData: {
|
||||
@@ -74,14 +68,14 @@ const initialState = {
|
||||
},
|
||||
isSubmittingComment: false,
|
||||
ticketCreationInProgress: false,
|
||||
} as IConfigSlice;
|
||||
} as ICSASlice;
|
||||
|
||||
const CosmosSupport = createSlice({
|
||||
name: 'config',
|
||||
initialState,
|
||||
reducers: {
|
||||
setTicketCreationData: (state, action) => {
|
||||
state.data = action.payload;
|
||||
state.ticketCreationData.isLoading = action.payload;
|
||||
},
|
||||
setLoading: (state, action) => {
|
||||
state.loading = action.payload;
|
||||
|
||||
@@ -45,12 +45,10 @@ const ProfileStack = () => {
|
||||
>
|
||||
<Stack.Screen
|
||||
name={ProfileScreenStackEnum.TELE_SUPPORT}
|
||||
// @ts-ignore
|
||||
component={ViewRequestHistory}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name={ProfileScreenStackEnum.PROFILE_TICKET_DETAIL}
|
||||
// @ts-ignore
|
||||
component={RequestDetail}
|
||||
/>
|
||||
</Stack.Group>
|
||||
|
||||
@@ -108,7 +108,7 @@ const AllCasesMain = () => {
|
||||
component: () => (
|
||||
<>
|
||||
<CasesList casesList={[...pendingList, ...pinnedList, ...completedList]} allCasesView />
|
||||
{shouldShowBanner || true ? <FloatingBannerCta
|
||||
{shouldShowBanner ? <FloatingBannerCta
|
||||
title={"Update your daily commitment"}
|
||||
onPressHandler={openCommitmentScreen}
|
||||
containerStyle={styles.container}
|
||||
|
||||
@@ -144,7 +144,7 @@ const CustomerCard: React.FC<ICustomerCard> = (props) => {
|
||||
header='Mark as done'
|
||||
moveForKeyboard={0.2}
|
||||
>
|
||||
<SafeAreaView style={[GenericStyles.p16, GenericStyles.fill, { paddingTop: 0 }]}>
|
||||
<SafeAreaView style={[GenericStyles.p16, GenericStyles.fill,styles.pt0]}>
|
||||
<View style={[GenericStyles.fill]}>
|
||||
<TextInput
|
||||
numberOfLines={5}
|
||||
@@ -189,6 +189,9 @@ const styles = StyleSheet.create({
|
||||
},
|
||||
flexBasis48:{
|
||||
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 { useAppDispatch } from '@hooks'
|
||||
import { resetSingleViewRequestTicket } from '@reducers/cosmosSupportSlice'
|
||||
import { COLORS } from '@rn-ui-lib/colors'
|
||||
import Tag, { TagVariant } from '@rn-ui-lib/components/Tag'
|
||||
import Text from '@rn-ui-lib/components/Text'
|
||||
import ArrowRightOutlineIcon from '@rn-ui-lib/icons/ArrowRightOutlineIcon'
|
||||
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 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 { ProfileScreenStackEnum } from '@screens/Profile/ProfileStack'
|
||||
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'
|
||||
import { Mapping, SCREEN_MAP, StatusColorMapping } from './constant'
|
||||
|
||||
const ListItem = (props: any) => {
|
||||
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 Component = form === "profile" ? View : TouchableHighlight;
|
||||
const Component = form === Mapping.FORM_PROFILE ? View : TouchableHighlight;
|
||||
const handleNavigation = () => {
|
||||
navigateToScreen(PageRouteEnum.CASE_DETAIL_STACK, {
|
||||
screen: CaseDetailStackEnum.COLLECTION_CASE_DETAIL,
|
||||
@@ -32,7 +30,7 @@ const ListItem = (props: any) => {
|
||||
|
||||
const handleNavigationTODetails = () => {
|
||||
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 (
|
||||
<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} />
|
||||
</View>
|
||||
<RelativeTime prefix='Requested' date={new Date(item?.createdAt).toString()} />
|
||||
{form === "profile" ? <View>
|
||||
<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}
|
||||
{form ===Mapping.FORM_PROFILE ? <CustomerDetailListItem item={item} handleNavigation={handleNavigation} handleNavigationTODetails={handleNavigationTODetails} viewTaskCta={viewTaskCta} /> : null}
|
||||
</View>
|
||||
{form === "profile" ? null : <ArrowRightOutlineIcon fillColor={COLORS.BASE.BLUE} />}
|
||||
{form ===Mapping.FORM_PROFILE ? null : <ArrowRightOutlineIcon fillColor={COLORS.BASE.BLUE} />}
|
||||
</>
|
||||
</Component>
|
||||
)
|
||||
|
||||
@@ -85,19 +85,9 @@ const CardComponent: React.FC<ICardComponent> = (props) => {
|
||||
<RelativeTime prefix='' date={time} />
|
||||
</SuspenseLoader>
|
||||
</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]}>
|
||||
{comment}
|
||||
</Text>
|
||||
{/* </SuspenseLoader> */}
|
||||
</View>
|
||||
</View>
|
||||
)
|
||||
|
||||
@@ -28,19 +28,16 @@ interface IRequestDetail {
|
||||
|
||||
const RequestDetail: React.FC<IRequestDetail> = (props) => {
|
||||
|
||||
// const [isRefreshing, setRefreshing] = useState(false);
|
||||
const {data, isRefreshing} = useAppSelector(state => ({
|
||||
const {data, isRefreshing, user} = useAppSelector(state => ({
|
||||
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 [comment, setComment] = React.useState<string>('');
|
||||
const dispatch = useAppDispatch();
|
||||
|
||||
const {user} = useAppSelector((state) => ({
|
||||
user: state.user.user
|
||||
}));
|
||||
|
||||
|
||||
const onRefresh = () => {
|
||||
if (!props?.route?.params?.ticketId) return;
|
||||
loadData(props?.route?.params?.ticketId);
|
||||
@@ -114,7 +111,7 @@ const RequestDetail: React.FC<IRequestDetail> = (props) => {
|
||||
Pos={data?.customerDetails?.outstandingAmount || 0}
|
||||
customerName={data?.customerDetails?.customerName || ''}
|
||||
status={data?.status || ''}
|
||||
refId={data?.referenceId} //todo
|
||||
refId={data?.referenceId}
|
||||
isRefreshing={isRefreshing}
|
||||
isEditable={Boolean(props?.route?.params?.task)}
|
||||
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 { 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 = () => {
|
||||
@@ -44,7 +24,7 @@ const LoadingChips = () => {
|
||||
{[...Array(5)].map((type, index) => (
|
||||
<LineLoader
|
||||
key={index}
|
||||
style={[GenericStyles.mr8, GenericStyles.br8, { marginVertical: 10 }]}
|
||||
style={[GenericStyles.mr8, GenericStyles.br8, styles.mv10]}
|
||||
height={32}
|
||||
width={100}
|
||||
/>
|
||||
@@ -138,7 +118,7 @@ const RequestSupport: React.FC<RequestSupportProps> = (props) => {
|
||||
fallBack={<LoadingChips />}
|
||||
>
|
||||
<View style={[GenericStyles.row, GenericStyles.flexWrap]}>
|
||||
{supportTypes.map((type, index) => (
|
||||
{data?.requestForm?.map((type, index) => (
|
||||
<Controller
|
||||
key={type.value}
|
||||
control={control}
|
||||
@@ -151,7 +131,6 @@ const RequestSupport: React.FC<RequestSupportProps> = (props) => {
|
||||
onSelectionChange={(meta, data) => onChange(data)}
|
||||
checked={value === type.value}
|
||||
meta={type.value}
|
||||
containerStyles={{margin:0}}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
@@ -173,7 +152,6 @@ const RequestSupport: React.FC<RequestSupportProps> = (props) => {
|
||||
placeholder='Enter comments...'
|
||||
onChangeText={onChange}
|
||||
value={value}
|
||||
// Adjust other TextInput props as needed
|
||||
/>
|
||||
)}
|
||||
/> }
|
||||
@@ -216,6 +194,9 @@ const styles = StyleSheet.create({
|
||||
textAlignVertical: 'top',
|
||||
maxHeight: 100,
|
||||
},
|
||||
mv10:{
|
||||
marginVertical:10
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { StyleSheet, Text, View } from 'react-native'
|
||||
import React from 'react'
|
||||
import Tag, { TagVariant } from '@rn-ui-lib/components/Tag'
|
||||
import { COLORS } from '@rn-ui-lib/colors';
|
||||
import Tag, { TagVariant } from '@rn-ui-lib/components/Tag';
|
||||
import { GenericStyles } from '@rn-ui-lib/styles';
|
||||
import React from 'react';
|
||||
import { View } from 'react-native';
|
||||
|
||||
interface ITagComponent {
|
||||
text: string;
|
||||
@@ -21,11 +20,6 @@ const TagComponent: React.FC<ITagComponent> = (props) => {
|
||||
}
|
||||
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
|
||||
container: {
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
export default TagComponent;
|
||||
@@ -5,7 +5,7 @@ import { ListRenderItemInfo, RefreshControl, View, VirtualizedList } from 'react
|
||||
import { ListItemLoading } from './';
|
||||
import CSAFilters from './CSAFilters';
|
||||
import ListItem from './ListItem';
|
||||
import { SCREEN_MAP } from './constant';
|
||||
import { SCREEN_MAP, loadingData } from './constant';
|
||||
import { useAppDispatch, useAppSelector } from '@hooks';
|
||||
import { fetchTicketList } from './actions';
|
||||
import { setCaseLevelTicketsForMe, setCaseLevelTicketsForMeLoading } from '@reducers/cosmosSupportSlice';
|
||||
@@ -14,16 +14,13 @@ import Text from '@rn-ui-lib/components/Text';
|
||||
import { From } from './ViewRequestHistory';
|
||||
import { GetAllTicketFilters, GetAllTicketsPayload, IFilterStatus, Status } from './constant/types';
|
||||
|
||||
// Define the item type
|
||||
|
||||
interface ListItem {
|
||||
id: string;
|
||||
text: string;
|
||||
}
|
||||
|
||||
const loadingData: ListItem[] = Array.from({ length: 10 }, (_, index) => ({
|
||||
id: index.toString(),
|
||||
text: `Item ${index + 1}`,
|
||||
}));
|
||||
|
||||
|
||||
interface ITaskForMe {
|
||||
route: {
|
||||
@@ -121,14 +118,14 @@ const TaskForMe: React.FC<ITaskForMe> = (props) => {
|
||||
renderItem={apiCallInProgress ? renderItemLoadingState : renderItem}
|
||||
getItemCount={getItemCount}
|
||||
getItem={getItem}
|
||||
initialNumToRender={5} // Adjust as needed
|
||||
maxToRenderPerBatch={10} // Adjust as needed
|
||||
windowSize={10} // Adjust as needed
|
||||
initialNumToRender={5}
|
||||
maxToRenderPerBatch={10}
|
||||
windowSize={10}
|
||||
refreshControl={
|
||||
<RefreshControl
|
||||
refreshing={isRefreshing}
|
||||
onRefresh={onRefresh}
|
||||
colors={[COLORS.BASE.BLUE]} // Adjust the color as needed
|
||||
colors={[COLORS.BASE.BLUE]}
|
||||
/>
|
||||
}
|
||||
ListEmptyComponent={() => (
|
||||
|
||||
@@ -8,13 +8,12 @@ import { ListItemLoading } from './';
|
||||
import CSAFilters from './CSAFilters';
|
||||
import ListItem from './ListItem';
|
||||
import { fetchTicketList } from './actions';
|
||||
import { SCREEN_MAP } from './constant';
|
||||
import { SCREEN_MAP, loadingData } from './constant';
|
||||
import TaskForMeEmptyScreen from '@assets/icons/TaskForMeEmptyScreen';
|
||||
import Text from '@rn-ui-lib/components/Text';
|
||||
import { From } from './ViewRequestHistory';
|
||||
import { GetAllTicketFilters, IFilterStatus, Status } from './constant/types';
|
||||
|
||||
// Define the item type
|
||||
interface ListItem {
|
||||
id: 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 { from, route, lan, forScreen } = props;
|
||||
@@ -54,7 +49,6 @@ const TeleSupport: React.FC<ITaskForMe> = (props) => {
|
||||
const [isRefreshing, setRefreshing] = useState(false);
|
||||
const dispatch = useAppDispatch();
|
||||
const onRefresh = () => {
|
||||
// Simulate a refresh process
|
||||
loadData();
|
||||
};
|
||||
|
||||
@@ -107,7 +101,6 @@ const TeleSupport: React.FC<ITaskForMe> = (props) => {
|
||||
};
|
||||
|
||||
const failureCallback = () => {
|
||||
console.log('failureCallback')
|
||||
setRefreshing(false);
|
||||
dispatch(setCaseLevelTicketsForTeleLoading(false));
|
||||
};
|
||||
@@ -130,19 +123,16 @@ const TeleSupport: React.FC<ITaskForMe> = (props) => {
|
||||
renderItem={apiCallInProgress ? renderItemLoadingState : renderItem}
|
||||
getItemCount={getItemCount}
|
||||
getItem={getItem}
|
||||
initialNumToRender={5} // Adjust as needed
|
||||
maxToRenderPerBatch={10} // Adjust as needed
|
||||
windowSize={10} // Adjust as needed
|
||||
initialNumToRender={5}
|
||||
maxToRenderPerBatch={10}
|
||||
windowSize={10}
|
||||
refreshControl={
|
||||
<RefreshControl
|
||||
refreshing={isRefreshing}
|
||||
onRefresh={onRefresh}
|
||||
colors={[COLORS.BASE.BLUE]} // Adjust the color as needed
|
||||
colors={[COLORS.BASE.BLUE]}
|
||||
/>
|
||||
}
|
||||
onEndReached={() => {
|
||||
//todo api call for next page
|
||||
}}
|
||||
ListEmptyComponent={() => (
|
||||
<View style={[GenericStyles.fill, GenericStyles.alignCenter, GenericStyles.mt32]}>
|
||||
<TaskForMeEmptyScreen />
|
||||
|
||||
@@ -25,6 +25,17 @@ const TextFieldWithInput: React.FC<ITextFieldWithInput> = (props) => {
|
||||
}
|
||||
}, [addingComment])
|
||||
|
||||
const onPress = () => {
|
||||
if (!comment) {
|
||||
Toast.show({
|
||||
type: 'error',
|
||||
text1: 'Comment is required',
|
||||
})
|
||||
return;
|
||||
};
|
||||
onPressSend(comment);
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<View style={[
|
||||
@@ -43,18 +54,9 @@ const TextFieldWithInput: React.FC<ITextFieldWithInput> = (props) => {
|
||||
<Pressable
|
||||
disabled={addingComment}
|
||||
style={styles.buttonStyle}
|
||||
onPress={() => {
|
||||
if (!comment) {
|
||||
Toast.show({
|
||||
type: 'error',
|
||||
text1: 'Comment is required',
|
||||
})
|
||||
return;
|
||||
};
|
||||
onPressSend(comment)
|
||||
}}
|
||||
onPress={onPress}
|
||||
>
|
||||
<SendIcon fillColor={addingComment ? "red" : undefined} />
|
||||
<SendIcon />
|
||||
</Pressable>
|
||||
<FullScreenLoaderWrapper
|
||||
loading={addingComment}
|
||||
|
||||
@@ -18,6 +18,7 @@ import { TaskForMe, TeleSupport } from './';
|
||||
import TagComponent from './TagComponent';
|
||||
import { SCREEN_MAP } from './constant';
|
||||
import { getSummary } from './actions';
|
||||
import { ParamListBase } from '@react-navigation/native';
|
||||
|
||||
|
||||
type SCENE = keyof typeof SCREEN_MAP
|
||||
|
||||
@@ -29,4 +29,9 @@ export enum Mapping {
|
||||
USER_TYPE = 'FE',
|
||||
COMMENT_TYPE = 'COMMENT_ADDITION',
|
||||
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