-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(validation): better evaluation errors (#226)
* feat: better evaluation errors (#211) * feat: disable activate button if errors (#214) * feat(ScenarioValidationError): aggregate errors (#213) * feat(ScenarioValidation): remove error code from error message * refactor(EvaluationError): use code * feat(ScenarioValidationError): aggregate errors * refactor(evaluation): refactor evaluation errors (#216) * refactor(evaluation): refactor evaluation errors * misc fixes --------- Co-authored-by: Zoé Cadé <[email protected]> --------- Co-authored-by: Zoé Cadé <[email protected]>
- Loading branch information
1 parent
23f526a
commit a242536
Showing
19 changed files
with
379 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 12 additions & 2 deletions
14
packages/app-builder/src/components/Scenario/AstBuilder/ErrorMessage.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,28 @@ | ||
import { type EvaluationError } from '@app-builder/models'; | ||
import { useGetNodeEvaluationErrorMessage } from '@app-builder/services/validation'; | ||
import { | ||
adaptEvaluationErrorViewModels, | ||
useGetNodeEvaluationErrorMessage, | ||
} from '@app-builder/services/validation'; | ||
|
||
export interface ErrorMessageProps { | ||
errors?: EvaluationError[]; | ||
} | ||
|
||
/** | ||
* @deprecated Use ScenarioValidationError instead | ||
*/ | ||
export function ErrorMessage({ errors }: ErrorMessageProps) { | ||
const getNodeEvaluationErrorMessage = useGetNodeEvaluationErrorMessage(); | ||
|
||
const firstError = errors?.[0]; | ||
|
||
return ( | ||
<p className="text-s font-medium text-red-100 transition-opacity duration-200 ease-in-out"> | ||
{firstError && getNodeEvaluationErrorMessage(firstError)} | ||
{firstError && | ||
getNodeEvaluationErrorMessage( | ||
// glitch for ISO compatibility with former code | ||
adaptEvaluationErrorViewModels([firstError])[0] | ||
)} | ||
</p> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...p-builder/src/routes/__builder/scenarios/$scenarioId/i/$iterationId/__edit-view/rules.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.