Skip to content

Commit

Permalink
Display nodes that were not executed as skipped. (#668)
Browse files Browse the repository at this point in the history
* Display nodes that were not executed as skipped.

* fix PR feedbacks

---------

Co-authored-by: Antoine Popineau <[email protected]>
Co-authored-by: Christopher DEBOVE <[email protected]>
Co-authored-by: Debove Christopher <[email protected]>
  • Loading branch information
4 people authored Jan 28, 2025
1 parent 87cf094 commit 5565cfd
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,19 @@ function AndOperand({
<Tag
border="square"
className="w-full"
color={value === null ? 'orange' : value ? 'green' : 'red'}
color={
evaluation.skipped
? 'grey'
: value === null
? 'orange'
: value
? 'green'
: 'red'
}
>
{t(`common:${value === null ? 'null' : value}`)}
{t(
`common:${evaluation.skipped ? 'skipped' : value === null ? 'null' : value}`,
)}
</Tag>
</div>
);
Expand Down
3 changes: 2 additions & 1 deletion packages/app-builder/src/locales/ar/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,6 @@
"premium": "ميزة متميزة",
"upgrade": "قم بالترقية الآن",
"errors.backend_unvailable": "لا يمكن لتطبيق Marble التواصل مع الواجهة الخلفية لـ Marble. \nقم إما بالتحقق من التكوين الخاص بك أو حاول مرة أخرى لاحقًا.",
"errors.firebase_network_error": "يواجه الرخام بعض الصعوبات في الاتصال بـ Firebase. \nقم إما بالتحقق من تكوين Firebase أو حاول مرة أخرى لاحقًا."
"errors.firebase_network_error": "يواجه الرخام بعض الصعوبات في الاتصال بـ Firebase. \nقم إما بالتحقق من تكوين Firebase أو حاول مرة أخرى لاحقًا.",
"skipped": "تخطي"
}
1 change: 1 addition & 0 deletions packages/app-builder/src/locales/en/common.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"null": "Null",
"skipped": "Skipped",
"true": "True",
"false": "False",
"from_to": "From <Date>{{start_date}}</Date> to <Date>{{end_date}}</Date>",
Expand Down
1 change: 1 addition & 0 deletions packages/app-builder/src/locales/fr/common.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"null": "Nul",
"skipped": "Omis",
"auth.logout": "Se déconnecter",
"cancel": "Annuler",
"error_one": "erreur",
Expand Down
3 changes: 3 additions & 0 deletions packages/app-builder/src/models/node-evaluation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export interface NodeEvaluation {
errors: EvaluationError[];
children: NodeEvaluation[];
namedChildren: Record<string, NodeEvaluation>;
skipped?: boolean;
}

export function NewNodeEvaluation(): NodeEvaluation {
Expand All @@ -55,6 +56,7 @@ export function NewNodeEvaluation(): NodeEvaluation {
errors: [],
children: [],
namedChildren: {},
skipped: false,
};
}

Expand All @@ -79,5 +81,6 @@ export function adaptNodeEvaluation(dto: NodeEvaluationDto): NodeEvaluation {
namedChildren: dto.named_children
? R.mapValues(dto.named_children, adaptNodeEvaluation)
: {},
skipped: dto.skipped,
};
}
3 changes: 3 additions & 0 deletions packages/marble-api/openapis/marblecore-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5174,6 +5174,9 @@ components:
type: object
additionalProperties:
$ref: '#/components/schemas/NodeEvaluationDto'
skipped:
type: boolean
default: false
ScenarioValidationErrorDto:
type: object
required:
Expand Down
1 change: 1 addition & 0 deletions packages/marble-api/src/generated/marblecore-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export type NodeEvaluationDto = {
named_children?: {
[key: string]: NodeEvaluationDto;
};
skipped?: boolean;
};
export type RuleExecutionDto = {
error?: Error;
Expand Down

0 comments on commit 5565cfd

Please sign in to comment.