-
Notifications
You must be signed in to change notification settings - Fork 25
EVG-19954: Force save when changing providers #2028
Conversation
Passing run #12716 ↗︎
Details:
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. |
@@ -12,4 +12,48 @@ describe("using the distro dropdown", () => { | |||
cy.location("pathname").should("not.contain", "localhost"); | |||
cy.location("pathname").should("contain", "rhel71-power8-large"); | |||
}); | |||
|
|||
it("warns when navigating away from distro settings with unsaved changes and allows returning to distro settings", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: It may be more organized to put these tests under a describe statement labeled "Warning modal"
Because you have modified the distro provider, your changes must be | ||
saved before navigating to a new page. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because you have modified the distro provider, your changes must be | |
saved before navigating to a new page. | |
Your distro provider changes must be saved or reverted before navigating to a new page. |
}); | ||
|
||
const handleSave = () => { | ||
// Only perform the save operation is the tab is valid. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Only perform the save operation is the tab is valid. | |
// Only perform the save operation if the tab is valid. |
const handleSave = () => { | ||
// Only perform the save operation is the tab is valid. | ||
// eslint-disable-next-line no-prototype-builtins | ||
if (formToGqlMap.hasOwnProperty(tab)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This kind of implies that the modal may appear when it's not supposed to. Do you know how to get it in that state -- I wasn't able to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interestingly, omitting this check introduces a CodeQL error. You can see that here: #2014 (review)
Edit: looks like using Object.prototype
introduces the same problem!
// eslint-disable-next-line no-prototype-builtins | ||
if (formToGqlMap.hasOwnProperty(tab)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// eslint-disable-next-line no-prototype-builtins | |
if (formToGqlMap.hasOwnProperty(tab)) { | |
if (Object.prototype.hasOwnProperty.call(formToGqlMap, tab) { |
EVG-19954
Description
Screenshots
Testing