Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: redirect back to specific form section on creation error [WD-8681] #646

Merged
merged 1 commit into from
Feb 13, 2024

Conversation

mas-who
Copy link
Contributor

@mas-who mas-who commented Feb 13, 2024

Done

  • If a custom yaml error occurs on instance creation, the error notification will now redirect to the yaml config page with previously set values.

QA

  1. Run the LXD-UI:
    • On the demo server via the link posted by @webteam-app below. This is only available for PRs created by collaborators of the repo. Ask @lorumic or @edlerd for access.
    • With a local copy of this branch, run as described here.
  2. Perform the following QA steps:
    • Go to the instance creation form, then navigate to the YAML configuration section and enter some nonsense. Submit the form by clicking the create/create and start button. This should result in an error and a notification should appear at the top of the page. Click on Check configuration within the error notification, this should redirect you back to the YAML configuration section within the instance creation form. You should also see the erroneous values you have previously entered in the YAML editor.

Screenshots

[if relevant, include a screenshot or screen capture]

Signed-off-by: Mason Hu <mason.hu@canonical.com>
@webteam-app
Copy link

Demo starting at https://lxd-ui-646.demos.haus

@@ -259,14 +263,20 @@ const CreateInstance: FC = () => {
operation.metadata.id,
() => creationCompletedHandler(instanceName, shouldStart, isIsoImage),
(msg) =>
notifyCreationFailed(new Error(msg), formUrl, values, "toast"),
notifyCreationFailed(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made this a bit more generic, if any error occurs the error notification would redirect to the relevant instance creation section. I think this is better than just redirecting back to the relevant section specifically for YAML errors

@mas-who mas-who changed the title fix: redirect back to specific form section on creation error fix: redirect back to specific form section on creation error [WD-8681] Feb 13, 2024
Copy link
Collaborator

@edlerd edlerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well, thanks for fixing this!

@edlerd edlerd merged commit 2496a2b into canonical:main Feb 13, 2024
8 checks passed
github-actions bot pushed a commit that referenced this pull request Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants