Skip to content

Commit

Permalink
Add an error for calculating accessibility map
Browse files Browse the repository at this point in the history
Fixes #1063
  • Loading branch information
samuel-duhaime authored and tahini committed Dec 18, 2024
1 parent b53753a commit faa8147
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion locales/en/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@
"ShowExceptionForCopy": "If you want to report an issue, you may copy-paste the exception below",
"Exception": "Exception",
"RoutingModeNotEnabled": "Routing mode '{{mode}}' is not enabled",
"InvalidFormFields": "Some fields are invalid"
"InvalidFormFields": "Some fields are invalid",
"ErrorCalculatingAccessibilityMap": "Error calculating accessibility map. Try to reduce the maximum total travel time."
},
"places": {
"categories": {
Expand Down
3 changes: 2 additions & 1 deletion locales/fr/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@
"ShowExceptionForCopy": "Si vous voulez rapporter un problème, vous pouvez copier/coller l'exception ci-dessous",
"Exception": "Exception",
"RoutingModeNotEnabled": "Mode de calcul '{{mode}}' n'est pas activé",
"InvalidFormFields": "Certains champs sont invalides"
"InvalidFormFields": "Certains champs sont invalides",
"ErrorCalculatingAccessibilityMap": "Erreur lors du calcul de la carte d'accessibilité. Essayez de réduire le temps de parcours maximal."
},
"places": {
"categories": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ class AccessibilityMapForm extends ChangeEventsForm<AccessibilityMapFormProps, T
}
this.polygonCalculated(currentResult);
} catch (error) {
// TODO: Handle error
this.setState({
routingErrors: ['main:errors:ErrorCalculatingAccessibilityMap']
});
} finally {
serviceLocator.eventManager.emit('progress', { name: 'CalculateAccessibilityMap', progress: 1.0 });
this.setState({ loading: false });
Expand Down Expand Up @@ -370,6 +372,9 @@ class AccessibilityMapForm extends ChangeEventsForm<AccessibilityMapFormProps, T
</Collapsible>

{this.hasInvalidFields() && <FormErrors errors={['main:errors:InvalidFormFields']} />}

{this.state.routingErrors && <FormErrors errors={this.state.routingErrors} />}

<FormErrors errors={routing.errors} />

<div>
Expand Down

0 comments on commit faa8147

Please sign in to comment.