Skip to content

Commit

Permalink
Better error messages in aggregation modale
Browse files Browse the repository at this point in the history
rollback: disabled was an error
  • Loading branch information
Pascal-Delange committed Mar 6, 2025
1 parent 03f1844 commit 3410108
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/app-builder/src/locales/ar/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@
"validation.evaluation_error.division_by_zero_other": "{{count}} قسمة على صفر.",
"validation.evaluation_error.payload_field_not_found_one": "لم يتم العثور على حقل الحمولة",
"validation.evaluation_error.payload_field_not_found_other": "{{count}} payload fields not found",
"validation.evaluation_error.aggregation_field_incompatible_with_aggregator": "نوع حقل التجميع غير متوافق مع وظيفة التجميع",
"validation.evaluation_error.aggregation_field_not_chosen": "يجب اختيار مجال التجميع",
"edit_aggregation.title": "إنشاء متغير",
"edit_aggregation.subtitle": "من قاعدة بيانات Marble",
"edit_aggregation.description": "يتم حساب التجميعات على البيانات التي تم استيرادها. (<DocLink>لمعرفة المزيد</DocLink>)",
Expand Down
2 changes: 2 additions & 0 deletions packages/app-builder/src/locales/en/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,8 @@
"validation.evaluation_error.payload_field_not_found_one": "payload field not found",
"validation.evaluation_error.payload_field_not_found_other": "{{count}} payload fields not found",
"validation.evaluation_error.filters_table_not_match": "filter must be applied on the same table than aggregate",
"validation.evaluation_error.aggregation_field_not_chosen": "You must select a field and entity to compute the aggregate on",
"validation.evaluation_error.aggregation_field_incompatible_with_aggregator": "This aggregation function is incompatible with the data type of the field you selected",
"edit_aggregation.title": "Create a variable",
"edit_aggregation.subtitle": "From Marble database",
"edit_aggregation.description": "Computes aggregates on your ingested data (<DocLink>learn more</DocLink>)",
Expand Down
2 changes: 2 additions & 0 deletions packages/app-builder/src/locales/fr/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@
"validation.evaluation_error.undefined_function_one": "requis",
"validation.evaluation_error.undefined_function_other": "{{count}} requis",
"validation.evaluation_error.wrong_number_of_arguments": "mauvais nombre d'arguments",
"validation.evaluation_error.aggregation_field_not_chosen": "Vous devez sélectionner un champ et une entité sur lequel l'agrégation sera effectuée",
"validation.evaluation_error.aggregation_field_incompatible_with_aggregator": "Cette fonction d'agrégation est incompatible avec le champ que vous avez sélectionné",
"custom_list.unknown": "Liste inconnue",
"scenarios.description": "Un scénario permet de détecter un certain type de risque, selon des règles métier spécifiques, pour un événement déclencheur spécifique.",
"trigger_object.description": "L'objet central qui initie le processus de prise de décision. Il est accessible lors de l'exécution du scénario.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ export type EvaluationErrorViewModel =
count: number;
}
| {
error: 'WRONG_NUMBER_OF_ARGUMENTS' | 'FILTERS_TABLE_NOT_MATCH';
error:
| 'WRONG_NUMBER_OF_ARGUMENTS'
| 'FILTERS_TABLE_NOT_MATCH'
| 'AGGREGATION_FIELD_NOT_CHOSEN'
| 'AGGREGATION_FIELD_INCOMPATIBLE_WITH_AGGREGATOR';
};

export function adaptEvaluationErrorViewModels(
Expand Down Expand Up @@ -144,6 +148,12 @@ const commonErrorMessages =
return t('scenarios:validation.evaluation_error.wrong_number_of_arguments');
case 'FILTERS_TABLE_NOT_MATCH':
return t('scenarios:validation.evaluation_error.filters_table_not_match');
case 'AGGREGATION_FIELD_NOT_CHOSEN':
return t('scenarios:validation.evaluation_error.aggregation_field_not_chosen');
case 'AGGREGATION_FIELD_INCOMPATIBLE_WITH_AGGREGATOR':
return t(
'scenarios:validation.evaluation_error.aggregation_field_incompatible_with_aggregator',
);
case 'MISSING_NAMED_ARGUMENT':
return t('scenarios:validation.evaluation_error.missing_named_argument', {
count: evaluationError.count,
Expand Down

0 comments on commit 3410108

Please sign in to comment.