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(custom-targets): lock form Create button until successful test #1262

Merged
merged 2 commits into from
May 31, 2024

Conversation

andrewazores
Copy link
Member

@andrewazores andrewazores commented May 31, 2024

  • fix(custom-targets): handle case where response does not include data or reason fields
  • fix(custom-targets): lock form Create button until successful test

Welcome to Cryostat! 👋

Before contributing, make sure you have:

  • Read the contributing guidelines
  • Linked a relevant issue which this PR resolves
  • Linked any other relevant issues, PR's, or documentation, if any
  • Resolved all conflicts, if any
  • Rebased your branch PR on top of the latest upstream main branch
  • Attached at least one of the following labels to the PR: [chore, ci, docs, feat, fix, test]
  • Signed all commits using a GPG signature

To recreate commits with GPG signature git fetch upstream && git rebase --force --gpg-sign upstream/main


Fixes: #1261

Description of the change:

  • handles the case where the response body does not have .data.reason fields. This can happen if the server encounters an unexpected error and responds with an HTTP 500, in which case the response format is not a Cryostat API V2 format but a standard Quarkus 500 format.
  • locks the Custom Target creation form Create button until a successful connection test is performed. If the form is updated (URL or credentials) the button is re-locked.

Motivation for the change:

When creating a custom target the server will already perform a connection test anyway. However, the UI is more informative and makes more sense if the user is first required to perform a successful connection test before they can create the target definition.

How to manually test:

  1. Check out and build cryostat3 with this PR
  2. ./smoketest.bash -Otr
  3. Try to create some custom target definitions, like cryostat3:9091, localhost:0, sample-app-1:9093, reports:11124, jfr-datasource:11223, cryostat:9091

aali309
aali309 previously approved these changes May 31, 2024
Copy link

Test image available:

CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat-web:pr-1262-0ed25c938de2425a66ea3bcecc523f9bb77a087a bash smoketest.bash # then open http://localhost:8080

Copy link
Contributor

@aali309 aali309 left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@andrewazores andrewazores merged commit 759e8ae into cryostatio:main May 31, 2024
28 of 29 checks passed
@andrewazores andrewazores deleted the custom-target-form-lock branch May 31, 2024 19:38
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.

[Bug] Custom Target creation form allows creation before connection test succeeds
2 participants