Skip to content

Commit

Permalink
Display nodes that were not executed as skipped.
Browse files Browse the repository at this point in the history
  • Loading branch information
apognu committed Jan 28, 2025
1 parent c2f5308 commit a0dee00
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 2 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
? 'green'
: value
? 'green'
: 'red'
}
>
{t(`common:${value === null ? 'null' : value}`)}
{t(
`common:${evaluation.skipped ? 'skipped' : value === null ? 'null' : value}`,
)}
</Tag>
</div>
);
Expand Down
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 a0dee00

Please sign in to comment.