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

Fixes 4826: prevent adding systems if env not yet created #362

Merged
merged 2 commits into from
Oct 30, 2024

Conversation

xbhouse
Copy link
Contributor

@xbhouse xbhouse commented Oct 22, 2024

Summary

  • Checks if environment is created (rhsm_environment_created == true) before allowing user to assign the template to a system
  • Displays an error if the environment has not been created but the template's update task has finished
  • (You will see some unintended behavior here when adding multiple templates until this PR is merged)

Testing steps

Since this depends on Patch's API, this needs to be tested on stage (npm run start:stage). You will also need to have registered at least one system on stage. This also cannot be tested in ephemeral as the task that sets the rhsm_environment_created flag depends on candlepin.

  1. Create a template and select Create template and add to systems to navigate to the AddSystemModal
  2. Select a system. The Assign button should be disabled for a few seconds and have a tooltip. Once the template's update task has finished and the environment was created, the button should be enabled

@jlsherrill
Copy link
Member

@xbhouse xbhouse marked this pull request as ready for review October 22, 2024 15:08
@swadeley
Copy link
Member

/retest

@xbhouse
Copy link
Contributor Author

xbhouse commented Oct 25, 2024

seeing something weird here, it seems like rhsm_environment_created doesn't stay true if the template sits for a while? if we try to assign a template to a system an hour or so after the template was created, its rhsm_environment_created value will be false after initially being set to true, so we won't be able to assign it unless we update the template. looking into it now.

EDIT: i was actually just creating or editing a template an hour or so after 😆 had nothing to do with the time. PR to fix that here

@rverdile rverdile self-assigned this Oct 28, 2024
Copy link
Member

@Andrewgdewar Andrewgdewar left a comment

Choose a reason for hiding this comment

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

Ack!

@swadeley
Copy link
Member

/retest

@swadeley swadeley merged commit 05af5f7 into content-services:main Oct 30, 2024
7 checks passed
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.

5 participants