-
Notifications
You must be signed in to change notification settings - Fork 481
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(form): hide select options for disabled engines #2534
Conversation
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.
✅ LGTM
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.
In general: looks great.
I have two issues / bugs:
- Start with
--disable-zeebe
- Note that you can still create a Form with
Cloud profile
(:warning: this would be bug no.1, probably to be fixed seperately)
- Now, as soon as I created a "Cloud" Form (probably also if I would open an existing Cloud form), I cannot switch the profile to platform (:warning: so this is bug no.2, directly related to this PR I think):
WDYT?
client/src/app/tabs/EngineProfile.js
Outdated
return <EngineProfileOption | ||
engineProfile={ engineProfile } | ||
key={ engineProfile.executionPlatform } | ||
onSelectEngineProfile={ onSelectEngineProfile } | ||
selectedEngineProfile={ selectedEngineProfile } />; | ||
selectedEngineProfile={ selectedEngineProfile } | ||
onlyEngine={ enabledEngineOptions.length>1 ? false : true } />; |
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.
onlyEngine={ enabledEngineOptions.length>1 ? false : true } />; | |
onlyEngine={ enabledEngineOptions.length > 1 ? false : true } />; |
@MaxTru In this case, should it allow to change to Platform and then not allow to go back to Cloud? or maintain both? |
Well in this case we have
Does that make sense? |
My want to confirm what happens after I change to platform.
Screen.Recording.2021-10-28.at.13.54.46.mov |
Yes - I would confirm that. The recording looks good to me. |
574da44
to
8e25113
Compare
I addressed point 3 according to the recording I sent. |
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.
Looks good! I only have three minor things, afterwards => good to merge!
client/src/app/tabs/EngineProfile.js
Outdated
@@ -139,6 +143,15 @@ function EngineProfileSelection(props) { | |||
return; | |||
} | |||
|
|||
if (filterEngineOptions().length===1 && isEngineDisabled(selectedEngineProfile)) { |
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.
We already called the filterEngineOptions()
before here
if (filterEngineOptions().length===1 && isEngineDisabled(selectedEngineProfile)) { | |
if (enabledEngineOptions.length === 1 && isEngineDisabled(selectedEngineProfile)) { |
client/src/app/tabs/EngineProfile.js
Outdated
return <EngineProfileOption | ||
engineProfile={ engineProfile } | ||
key={ engineProfile.executionPlatform } | ||
onSelectEngineProfile={ onSelectEngineProfile } | ||
selectedEngineProfile={ selectedEngineProfile } />; | ||
selectedEngineProfile={ selectedEngineProfile } | ||
onlyEngine={ enabledEngineOptions.length > 1 ? false : true } />; |
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.
In line 146 we check explicitly for length === 1, so should we not apply the same logic here as well? Is there a reason to be inconsistent?
onlyEngine={ enabledEngineOptions.length > 1 ? false : true } />; | |
onlyEngine={ enabledEngineOptions.length === 1 } />; |
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.
We should. I changed this one to match line 146
@@ -237,6 +239,70 @@ describe('<EngineProfile>', function() { | |||
}); | |||
|
|||
|
|||
describe('show not show disabled engine profile', function() { |
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.
describe('show not show disabled engine profile', function() { | |
describe('not show disabled engine profile', function() { |
8e25113
to
1587dbb
Compare
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.
🎉
Closes #2512
Removes disabled engine options and checkbox when there is only one choice.
Screenshot: