Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@red-hat-developer-hub/backstage-plugin-orchestrator-form-react': patch
---

Scope async validate:url calls to the active step in multi-step forms.
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,22 @@
let _extraErrors: ErrorSchema<JsonObject> | undefined = undefined;
let _validationError: Error | undefined = undefined;
const activeKey = getActiveKey();
const shouldScopeExtraErrors =
Boolean(activeKey) && Boolean(uiSchema?.[activeKey as string]);

Check warning on line 95 in workspaces/orchestrator/plugins/orchestrator-form-react/src/components/OrchestratorFormWrapper.tsx

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This assertion is unnecessary since it does not change the type of the expression.

See more on https://sonarcloud.io/project/issues?id=redhat-developer_rhdh-plugins&issues=AZ0kzDv_J4aHkTZfsgmS&open=AZ0kzDv_J4aHkTZfsgmS&pullRequest=2602
const extraErrorsFormData = (_formData ?? formData) as JsonObject;
const extraErrorsUiSchema = shouldScopeExtraErrors
? ({
[activeKey as string]: uiSchema?.[activeKey as string],

Check warning on line 99 in workspaces/orchestrator/plugins/orchestrator-form-react/src/components/OrchestratorFormWrapper.tsx

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This assertion is unnecessary since it does not change the type of the expression.

See more on https://sonarcloud.io/project/issues?id=redhat-developer_rhdh-plugins&issues=AZ0kzDv_J4aHkTZfsgmV&open=AZ0kzDv_J4aHkTZfsgmV&pullRequest=2602

Check warning on line 99 in workspaces/orchestrator/plugins/orchestrator-form-react/src/components/OrchestratorFormWrapper.tsx

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This assertion is unnecessary since it does not change the type of the expression.

See more on https://sonarcloud.io/project/issues?id=redhat-developer_rhdh-plugins&issues=AZ0kzDv_J4aHkTZfsgmW&open=AZ0kzDv_J4aHkTZfsgmW&pullRequest=2602
} as OrchestratorFormContextProps['uiSchema'])
: uiSchema;

if (decoratorProps.getExtraErrors) {
try {
handleValidateStarted();
_extraErrors = await decoratorProps.getExtraErrors(formData, uiSchema);
_extraErrors = await decoratorProps.getExtraErrors(
extraErrorsFormData,
extraErrorsUiSchema,
);

if (activeKey) {
setExtraErrors(
Expand Down
Loading