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(form): hide select options for disabled engines #2534

Merged
merged 2 commits into from
Oct 29, 2021

Conversation

smbea
Copy link
Contributor

@smbea smbea commented Oct 26, 2021

Closes #2512

Removes disabled engine options and checkbox when there is only one choice.

Screenshot:

Screenshot 2021-10-26 at 12 28 59

@bpmn-io-tasks bpmn-io-tasks bot added the needs review Review pending label Oct 26, 2021
@smbea smbea requested review from a team, andreasgeier, philippfromme and barmac and removed request for a team October 26, 2021 11:03
Copy link

@andreasgeier andreasgeier left a comment

Choose a reason for hiding this comment

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

✅ LGTM

Copy link
Contributor

@MaxTru MaxTru left a 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:

  1. Start with --disable-zeebe
  2. Note that you can still create a Form with Cloud profile (:warning: this would be bug no.1, probably to be fixed seperately)
    Screenshot_20211028_091445
  3. 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):
    EngineProfileSelectionBug

WDYT?

return <EngineProfileOption
engineProfile={ engineProfile }
key={ engineProfile.executionPlatform }
onSelectEngineProfile={ onSelectEngineProfile }
selectedEngineProfile={ selectedEngineProfile } />;
selectedEngineProfile={ selectedEngineProfile }
onlyEngine={ enabledEngineOptions.length>1 ? false : true } />;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
onlyEngine={ enabledEngineOptions.length>1 ? false : true } />;
onlyEngine={ enabledEngineOptions.length > 1 ? false : true } />;

@smbea
Copy link
Contributor Author

smbea commented Oct 28, 2021

  1. 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 (⚠️ so this is bug no.2, directly related to this PR I think):

@MaxTru In this case, should it allow to change to Platform and then not allow to go back to Cloud? or maintain both?

@MaxTru
Copy link
Contributor

MaxTru commented Oct 28, 2021

  1. 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):

@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 --disable-zeebe but we opened a zeebe diagram right? So I think:

  • Opening a zeebe form is still valid and should work (when double-clicking a file). It should still show the right profile. (This is as-is / already works) ✔️
  • However, when I opened a zeebe form and then click on platform, it should allow to switch to platform. (This does not work, see gif ⚠️ in my original post)
  • Also, it should not be possible to create a new zeebe form from the menu ⚠️

Does that make sense?

@smbea
Copy link
Contributor Author

smbea commented Oct 28, 2021

  • However, when I opened a zeebe form and then click on platform, it should allow to switch to platform. (This does not work, see gif ⚠️ in my original post)

My want to confirm what happens after I change to platform.

  • I open a zeebe form and change engine to Platform
  • After that, what options appear? Just Platform and the Cloud option disappears? -> example bellow:
Screen.Recording.2021-10-28.at.13.54.46.mov

@MaxTru
Copy link
Contributor

MaxTru commented Oct 28, 2021

  • However, when I opened a zeebe form and then click on platform, it should allow to switch to platform. (This does not work, see gif warning in my original post)

My want to confirm what happens after I change to platform.

  • I open a zeebe form and change engine to Platform
  • After that, what options appear? Just Platform and the Cloud option disappears? -> example bellow:

Screen.Recording.2021-10-28.at.13.54.46.mov

Yes - I would confirm that. The recording looks good to me.

@smbea smbea force-pushed the 2512-remove-disabled-engine-for-forms branch from 574da44 to 8e25113 Compare October 28, 2021 13:45
@smbea
Copy link
Contributor Author

smbea commented Oct 28, 2021

I addressed point 3 according to the recording I sent.
I also fixed point 2, even though it wasn't in the scope of this PR, because it was a simple fix.

@smbea smbea requested a review from MaxTru October 28, 2021 13:48
Copy link
Contributor

@MaxTru MaxTru 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! I only have three minor things, afterwards => good to merge!

@@ -139,6 +143,15 @@ function EngineProfileSelection(props) {
return;
}

if (filterEngineOptions().length===1 && isEngineDisabled(selectedEngineProfile)) {
Copy link
Contributor

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

Suggested change
if (filterEngineOptions().length===1 && isEngineDisabled(selectedEngineProfile)) {
if (enabledEngineOptions.length === 1 && isEngineDisabled(selectedEngineProfile)) {

return <EngineProfileOption
engineProfile={ engineProfile }
key={ engineProfile.executionPlatform }
onSelectEngineProfile={ onSelectEngineProfile }
selectedEngineProfile={ selectedEngineProfile } />;
selectedEngineProfile={ selectedEngineProfile }
onlyEngine={ enabledEngineOptions.length > 1 ? false : true } />;
Copy link
Contributor

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?

Suggested change
onlyEngine={ enabledEngineOptions.length > 1 ? false : true } />;
onlyEngine={ enabledEngineOptions.length === 1 } />;

Copy link
Contributor Author

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() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
describe('show not show disabled engine profile', function() {
describe('not show disabled engine profile', function() {

@smbea smbea force-pushed the 2512-remove-disabled-engine-for-forms branch from 8e25113 to 1587dbb Compare October 29, 2021 07:13
@smbea smbea requested a review from MaxTru October 29, 2021 07:16
Copy link
Contributor

@MaxTru MaxTru left a comment

Choose a reason for hiding this comment

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

🎉

@MaxTru MaxTru merged commit d8da764 into develop Oct 29, 2021
@MaxTru MaxTru deleted the 2512-remove-disabled-engine-for-forms branch October 29, 2021 07:52
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Oct 29, 2021
MaxTru added a commit that referenced this pull request Nov 30, 2021
@bpmn-io-tasks bpmn-io-tasks bot added the in progress Currently worked on label Nov 30, 2021
@bpmn-io-tasks bpmn-io-tasks bot added needs review Review pending and removed in progress Currently worked on labels Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review Review pending
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Engine profile select shows option for disabled engine
3 participants