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

View File

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

View File

@ -455,7 +455,38 @@ const ModifierFeuilleSoinScreen = ({
} }
}, [getUserByNameOrNumber]); }, [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(() => { useEffect(() => {
@ -2450,7 +2481,8 @@ const ModifierFeuilleSoinScreen = ({
pregnancy_end_at: values.pregnancy_end_at, pregnancy_end_at: values.pregnancy_end_at,
performances: consultation.performances, performances: consultation.performances,
prescriptions: consultation.prescriptions, 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, pregnancy_end_at: values.pregnancy_end_at,
performances: prestations, performances: prestations,
prescriptions: prescriptions, prescriptions: prescriptions,
exams: examens exams: examens,
tmp_sheet_id: Date.now()
}) })
} }
}, },

View File

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