Correction des bugs

This commit is contained in:
Brice Zele 2022-02-28 13:24:50 +01:00
parent 38868291b8
commit 1755385e39
6 changed files with 223 additions and 133 deletions

File diff suppressed because one or more lines are too long

View File

@ -65,6 +65,13 @@ import chunk from "lodash/chunk";
import _ from "lodash";
import FontAwesome from "react-native-vector-icons/FontAwesome";
import FontAwesome5 from "react-native-vector-icons/FontAwesome5";
import {
fetchGetConsultationReset,
fetchGetDrugAppareilReset, fetchGetNetworkActsReset, fetchGetProviderClassReset,
fetchGetSubscriptionListReset, fetchGetUserByIdQRCodeReset,
fetchGetUserByNameOrNumberReset
} from "../../redux/insurance/insurance.actions";
import {facturerSoinReset} from "../../webservice/NanoCreditApi";
let moment = require('moment-timezone');
const thousands = require('thousands');
@ -113,6 +120,14 @@ class WalletDetail extends Component {
this.props.getWalletTransactionHistoryReset();
this.props.depositActionReset();
this.props.resetWalletListDetailReducer();
this.props.fetchGetSubscriptionListReset();
this.props.fetchGetDrugAppareilReset();
this.props.fetchGetUserByNameOrNumberReset();
this.props.fetchGetUserByIdQRCodeReset();
this.props.fetchGetProviderClassReset();
this.props.fetchGetConsultationReset();
this.props.fetchGetNetworkActsReset();
this.props.facturerSoinReset();
this.currentLocale = I18n.locale.includes("fr") ? "fr" : "en-gb";
moment.locale(this.currentLocale);
@ -155,6 +170,14 @@ class WalletDetail extends Component {
this.willFocus = this.props.navigation.addListener(
'willFocus',
payload => {
this.props.fetchGetSubscriptionListReset();
this.props.fetchGetDrugAppareilReset();
this.props.fetchGetUserByNameOrNumberReset();
this.props.fetchGetUserByIdQRCodeReset();
this.props.fetchGetProviderClassReset();
this.props.fetchGetConsultationReset();
this.props.fetchGetNetworkActsReset();
this.props.facturerSoinReset();
const {result} = this.props;
console.warn("will focus detail");
this.getWalletDetail();
@ -1307,68 +1330,87 @@ class WalletDetail extends Component {
)
}
renderItem = (options, isOneElement, index) => (
isOneElement ?
<>
<View key={index} style={[styles.containerTouch]}>
renderItem = (options, isOneElement, index) => {
console.log("OPTIONS", options);
return (
isOneElement ?
<>
<View key={index} style={[styles.containerTouch]}>
<TouchableOpacity style={styles.contain}
onPress={() => {
this.props.navigation.push(options.screen)
}}
activeOpacity={0.9}>
<TouchableOpacity style={styles.contain}
onPress={() => {
this.props.navigation.push(options.screen)
}}
activeOpacity={0.9}>
<FontAwesome5 name={options.icon}
color={Color.primaryColor}
size={24}
style={styles.imageBanner}/>
{
options.hasOwnProperty('iconType') ?
<FontAwesome5 name={options.icon}
color={Color.primaryColor}
size={24}
style={styles.imageBanner}/>
: <Icon name={options.icon}
color={Color.primaryColor}
size={24}
style={styles.imageBanner}/>
<View style={[styles.content]}>
}
<View style={[styles.content]}>
<View style={[styles.contentTitle], {paddingTop: options.title.length > 20 ? 0 : 5}}>
<Text style={[Typography.headline, Typography.semibold]}>
{I18n.t(options.title)}
</Text>
</View>
<View style={[styles.contentTitle], {paddingTop: options.title.length > 20 ? 0 : 5}}>
<Text style={[Typography.headline, Typography.semibold]}>
{I18n.t(options.title)}
</Text>
</View>
</TouchableOpacity>
</View>
</View>
</TouchableOpacity>
</View>
<View style={{flex: 1}}/>
</> :
<>
<View style={[styles.containerTouch]}>
<View style={{flex: 1}}/>
</> :
<>
<View style={[styles.containerTouch]}>
<TouchableOpacity style={styles.contain}
onPress={() => {
this.props.navigation.push(options.screen)
}}
activeOpacity={0.9}>
<TouchableOpacity style={styles.contain}
onPress={() => {
this.props.navigation.push(options.screen)
}}
activeOpacity={0.9}>
{
options.hasOwnProperty('iconType') ?
<FontAwesome5 name={options.icon}
color={Color.primaryColor}
size={24}
style={styles.imageBanner}/>
: <Icon name={options.icon}
color={Color.primaryColor}
size={24}
style={styles.imageBanner}/>
<FontAwesome5 name={options.icon}
color={Color.primaryColor}
size={24}
style={styles.imageBanner}/>
}
<View style={[styles.content]}>
<View style={[styles.content]}>
<View style={[styles.contentTitle], {paddingTop: options.title.length > 20 ? 0 : 5}}>
<Text style={[Typography.headline, Typography.semibold]}>
{I18n.t(options.title)}
</Text>
</View>
<View style={{flex: 1}}>
</View>
<View style={[styles.contentTitle], {paddingTop: options.title.length > 20 ? 0 : 5}}>
<Text style={[Typography.headline, Typography.semibold]}>
{I18n.t(options.title)}
</Text>
</View>
</TouchableOpacity>
</View>
</>
<View style={{flex: 1}}>
</View>
</View>
</TouchableOpacity>
</View>
</>
);
)
};
renderDetailWallet = (wallet) => {
return (
@ -2006,7 +2048,17 @@ const mapDispatchToProps = dispatch => bindActionCreators({
getWalletTransactionHistoryReset,
depositActionReset,
getHyperSuperTransactionHistoryAction,
getHyperSuperTransactionHistoryReset
getHyperSuperTransactionHistoryReset,
fetchGetSubscriptionListReset,
fetchGetDrugAppareilReset,
fetchGetUserByNameOrNumberReset,
fetchGetUserByIdQRCodeReset,
fetchGetProviderClassReset,
fetchGetConsultationReset,
fetchGetNetworkActsReset,
facturerSoinReset,
}, dispatch);
export default connect(mapStateToProps, mapDispatchToProps)(WalletDetail);

View File

@ -322,106 +322,104 @@ class WalletOptionSelect extends Component {
}
renderItem = (options, isOneElement, index) => (
isOneElement ?
<>
<View key={index} style={[styles.containerTouch]}>
renderItem = (options, isOneElement, index) => {
console.log("OPTIONS", options);
return (
isOneElement ?
<>
<View key={index} style={[styles.containerTouch]}>
<TouchableOpacity style={styles.contain}
onPress={() => {
this.redirectToRoute(options);
}}
activeOpacity={0.9}>
<TouchableOpacity style={styles.contain}
onPress={() => {
this.redirectToRoute(options);
}}
activeOpacity={0.9}>
<Icon name={options.icon}
color={Color.primaryColor}
size={30}
style={styles.imageBanner}/>
{
options.hasOwnProperty('iconType') ?
<FontAwesome5 name={options.icon}
color={Color.primaryColor}
size={24}
style={styles.imageBanner}/>
: <Icon name={options.icon}
color={Color.primaryColor}
size={24}
style={styles.imageBanner}/>
{
options.hasOwnProperty('iconType') ?
<FontAwesome5 name={options.icon}
color={Color.primaryColor}
size={24}
style={styles.imageBanner}/>
: <Icon name={options.icon}
color={Color.primaryColor}
size={24}
style={styles.imageBanner}/>
}
}
<View style={[styles.content]}>
<View style={[styles.content]}>
<View style={[styles.contentTitle], {paddingTop: options.title.length > 20 ? 0 : 5}}>
<Text style={[Typography.headline, Typography.semibold]}>
{I18n.t(options.title)}
</Text>
</View>
<View style={[styles.contentTitle], {paddingTop: options.title.length > 20 ? 0 : 5}}>
<Text style={[Typography.headline, Typography.semibold]}>
{I18n.t(options.title)}
</Text>
</View>
</TouchableOpacity>
</View>
</View>
</TouchableOpacity>
</View>
<View style={{flex: 1}}/>
</> :
<View style={{flex: 1}}/>
</> :
<>
<View style={[styles.containerTouch]}>
<>
<View style={[styles.containerTouch]}>
<TouchableOpacity style={styles.contain}
onPress={() => {
if (!_.isNil(this.state.isIdentified)) {
console.log(options);
if (_.isEqual(options.screen, 'createIdentificationUser')) {
if (this.state.isIdentified)
displayToast(I18n.t('ALREADY_IDENTIFIED'));
else
this.redirectToRoute(options);
} else if (_.isEqual(options.screen, 'modifyIdentificationUser')) {
if (!this.state.isIdentified)
displayToast(I18n.t('NOT_YET_IDENTIFY'));
else
<TouchableOpacity style={styles.contain}
onPress={() => {
if (!_.isNil(this.state.isIdentified)) {
console.log(options);
if (_.isEqual(options.screen, 'createIdentificationUser')) {
if (this.state.isIdentified)
displayToast(I18n.t('ALREADY_IDENTIFIED'));
else
this.redirectToRoute(options);
} else if (_.isEqual(options.screen, 'modifyIdentificationUser')) {
if (!this.state.isIdentified)
displayToast(I18n.t('NOT_YET_IDENTIFY'));
else
this.redirectToRoute(options);
} else
this.redirectToRoute(options);
} else
this.redirectToRoute(options);
} else
this.redirectToRoute(options);
}}
activeOpacity={0.9}>
}}
activeOpacity={0.9}>
{
options.hasOwnProperty('iconType') ?
<FontAwesome5 name={options.icon}
color={Color.primaryColor}
size={24}
style={styles.imageBanner}/>
: <Icon name={options.icon}
color={Color.primaryColor}
size={24}
style={styles.imageBanner}/>
{
options.hasOwnProperty('iconType') ?
<FontAwesome5 name={options.icon}
color={Color.primaryColor}
size={24}
style={styles.imageBanner}/>
: <Icon name={options.icon}
color={Color.primaryColor}
size={24}
style={styles.imageBanner}/>
}
}
<View style={[styles.content]}>
<View style={[styles.content]}>
<View style={[styles.contentTitle], {paddingTop: options.title.length > 20 ? 0 : 5}}>
<Text style={[Typography.headline, Typography.semibold]}>
{I18n.t(options.title)}
</Text>
</View>
<View style={{flex: 1}}>
</View>
<View style={[styles.contentTitle], {paddingTop: options.title.length > 20 ? 0 : 5}}>
<Text style={[Typography.headline, Typography.semibold]}>
{I18n.t(options.title)}
</Text>
</View>
</TouchableOpacity>
</View>
</>
<View style={{flex: 1}}>
</View>
</View>
</TouchableOpacity>
</View>
</>
);
)
};
updateLangue() {
this.props.navigation.setParams({name: I18n.t('WALLET')})

View File

@ -455,7 +455,38 @@ const ModifierFeuilleSoinScreen = ({
}
}, [getUserByNameOrNumber]);
useEffect(() => {
if (checkInsuranceCoverageAmount.result !== null) {
if (checkInsuranceCoverageAmount.result.response !== null) {
if(consultation.performances.length >= 1) {
setModalPrestation(false);
Utils.displayToast(I18n.t('PRESTATION_SUCCESSFULLY_ADD'));
}
dispatch(fetchCheckInsuranceCoverageAmountReset());
}
}
if (checkInsuranceCoverageAmount.error) {
Alert.alert(
I18n.t("ERROR_LABLE"),
Utils.getErrorMsg(checkInsuranceCoverageAmount),
[
{
text: I18n.t("OK"), onPress: () => {
if(consultation.performances.length >= 1) {
setConsultation({...consultation, performances: [...consultationClone.performances]});
setModalPrestation(false);
}
dispatch(fetchCheckInsuranceCoverageAmountReset());
}
}
],
{ cancelable: false }
);
}
}, [checkInsuranceCoverageAmount]);
useEffect(() => {
@ -2450,7 +2481,8 @@ const ModifierFeuilleSoinScreen = ({
pregnancy_end_at: values.pregnancy_end_at,
performances: consultation.performances,
prescriptions: consultation.prescriptions,
exams: consultation.exams
exams: consultation.exams,
tmp_sheet_id: Date.now()
});
},
});

View File

@ -1577,7 +1577,8 @@ const SaisirFeuilleSoinScreen = ({
pregnancy_end_at: values.pregnancy_end_at,
performances: prestations,
prescriptions: prescriptions,
exams: examens
exams: examens,
tmp_sheet_id: Date.now()
})
}
},

View File

@ -674,7 +674,14 @@ export const optionNanoSanteAgentScreen = {
icon: 'history',
title: 'HISTORY',
iconType:"FontAwesome5"
},
{
screen: route.createIdentification,
icon: 'user',
iconType:"FontAwesome5",
title: 'CREATION_IDENTIFICATION_DESCRIPTION_SUBSCREEN',
}
]
}