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

JBPM 8915 : Stunner - Properties panel is being closed when switching assets or views #3129

Closed
wants to merge 2 commits into from

Conversation

inodeman
Copy link
Contributor

Hi @romartin can you review this PR? Will upload War in next comment

@inodeman
Copy link
Contributor Author

Jenkins execute full downstream build

@inodeman
Copy link
Contributor Author

@inodeman
Copy link
Contributor Author

Hi @romartin war was uploaded, can you review it?

@@ -59,6 +65,9 @@
private final SessionManager clientSessionManager;
private final Event<ChangeTitleWidgetEvent> changeTitleNotificationEvent;
private final DiagramEditorScreenView view;
private final Event<ScreenPreMaximizedStateEvent> screenStateEvent;
private final Event<ScreenDiagramModelUnSelectedEvent> screenDiagramModelUnSelectedEventEvent;
Copy link
Member

Choose a reason for hiding this comment

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

Does this need to be called ...EventEvent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My bad @manstis will change it

@@ -59,6 +65,9 @@
private final SessionManager clientSessionManager;
private final Event<ChangeTitleWidgetEvent> changeTitleNotificationEvent;
private final DiagramEditorScreenView view;
private final Event<ScreenPreMaximizedStateEvent> screenStateEvent;
private final Event<ScreenDiagramModelUnSelectedEvent> screenDiagramModelUnSelectedEventEvent;
private final Event<ScreenDiagramPropertiesSwitchingSessionsEvent> screenDiagramPropertiesSwitchingSessionsEventEvent;
Copy link
Member

Choose a reason for hiding this comment

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

Does this need to be called ...EventEvent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My bad @manstis will change it

@@ -81,6 +88,10 @@

private Consumer<Boolean> saveCallback;
private boolean isMigrating = false;
private boolean useTimer = true;
Copy link
Member

Choose a reason for hiding this comment

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

Instead of adding test support with a flag it might be better to do:-

protected void deferOpenPropertiesDocks(final Command command) {
    new Timer() {
        @Override
        public void run() {
            command.execute();
        }
    }.schedule(10);
}
...
@OnFocus
public void onFocus() {
    final boolean shouldOpen = isPropertiesOpenedBeforeSwitchingSessions;

    super.doFocus();

    if (shouldOpen) {
        deferOpenPropertiesDocks( ()-> openPropertiesDocks());
    }
}

Then in the test you can do:-

//I think this is the correct syntax!
doAnswer(i->  ((Command) i.getParameters[0]).execute()).when(diagramEditor).deferOpenPropertiesDocks(any(Command.class)));

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great @manstis thanks for the tip, will change it

@inodeman
Copy link
Contributor Author

Jenkins execute full downstream build

1 similar comment
@inodeman
Copy link
Contributor Author

Jenkins execute full downstream build

@inodeman
Copy link
Contributor Author

Hi @LuboTerifaj I added the changes from the other PR about minimize panel, Explore panel should also work now on this PR

@mbiarnes
Copy link
Contributor

Jenkins execute full downstream build

1 similar comment
@inodeman
Copy link
Contributor Author

Jenkins execute full downstream build

Copy link
Contributor

@LuboTerifaj LuboTerifaj left a comment

Choose a reason for hiding this comment

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

Hello @inodeman ,

the issue is not fixed for every case.

  • If you have two assets with opened Properties or Explore diagram panel and you are switching between them, the panel is being closed.
    You can switch between them either by using dropdown menu or using breadcrumb navigation panel.
    Steps to reproduce:

    1. Create process (or Case Definition or Case Management) "A"
    2. Navigate to project using breadcrumbs.
    3. Create process (or CD or CM) "B"
    4. Open Explore diagram panel (it also applies to Properties panel in CM).
    5. Open process "A" (using drop-down menu or breadcrumbs).
      Explore diagram panel should be open here (it also applies to Properties panel in CM).
    6. Open back process "B".
      Explore diagram panel should be open here (it also applies to Properties panel in CM).
  • The issue when switching between Model, Overview and Documentation is not fixed either.
    Steps to reproduce:
    The first issue:

    1. Ensure that Explore diagram panel is open.
    2. Click on Overview or Documentation panel.
    3. Click on Model
      Explore diagram should be open.

    The second issue:

    1. Ensure that Properties panel is open.
    2. Click on Overview or Documentation panel.
    3. Open Explore diagram panel.
    4. Click on Model
      Explore diagram should be open.
  • There is also the issue with DMN editor. The Properties or Explore diagram panel is always closed when switching between assets. However, this is probably out of scope of this jira.

One more thing, can you please change the commit message since the https://issues.redhat.com/browse/JBPM-8997 is duplicate issue of https://issues.redhat.com/browse/JBPM-8915? I've already closed the former.

Thank you!

@romartin
Copy link
Contributor

romartin commented Feb 5, 2020

Please @inodeman this need rebase and rebuilds, otherwise we cannot proceed with the testing. thansk!

@inodeman
Copy link
Contributor Author

inodeman commented Feb 5, 2020

Hi @romartin as requested by @LuboTerifaj I am making changes so that Case Definition Diagrams are also supported, the changes I initially made are for BPMN Diagrams only, also requested DMN Diagrams, so I need to add those 2 scenarios

@romartin
Copy link
Contributor

romartin commented Feb 5, 2020

ok thanks @inodeman , in fact it makes sense all editors behave the same way. But in case issues appears on other editors (CM/DMN) I would suggest creating a new ticket and merging this one, at least, which fixes the concrete issue requested.
Also please do the rebase and re-fire builds... Thanx!

@inodeman
Copy link
Contributor Author

inodeman commented Feb 5, 2020

Very well @romartin will do, also I think it is a good idea that this PR be merged into this one, since some of the code is shared, this particular PR includes everything from #3127, what do you think?

@inodeman
Copy link
Contributor Author

inodeman commented Feb 5, 2020

Jenkins execute full downstream build

@inodeman
Copy link
Contributor Author

inodeman commented Feb 5, 2020

Hi @romartin rebased and resolved conflicts now

@inodeman
Copy link
Contributor Author

inodeman commented Feb 5, 2020

Jenkins execute full downstream build

@inodeman
Copy link
Contributor Author

inodeman commented Feb 6, 2020

Hi @LuboTerifaj artifacts generated, can you check this PR?

Copy link
Contributor

@LuboTerifaj LuboTerifaj left a comment

Choose a reason for hiding this comment

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

Hello @inodeman , @romartin ,

Neither of the issues mentioned in my previous review is fixed.

See the summary below.

If you have two assets with opened Properties or Explore diagram panel and you are switching between them, the panel is being closed.

  • You can switch between them either by using dropdown menu or using breadcrumb navigation panel.
    Steps to reproduce:
    1. Create process (or Case Definition or Case Management) "A"
    2. [Optional] Open Explore diagram panel.
    3. Navigate to project using breadcrumbs.
    4. Create process (or CD, CM) "B".
    5. [Optional] Open Explore diagram panel.
    6. Open process "A" (using drop-down menu or breadcrumbs).
      Neither Properties nor Explore diagram panel is open.
    7. Open back process "B".
      Neither Properties nor Explore diagram panel is open.

The issues when switching between Model, Overview and Documentation are still not fixed.

Steps to reproduce:

  • The first issue:

    1. Ensure that Explore diagram panel is open.
    2. Click on Overview or Documentation panel.
    3. Click on Model.
      Explore diagram is not open.
  • The second issue:

    1. Ensure that Properties panel is open.
    2. Click on Overview or Documentation panel.
    3. Open Explore diagram panel.
    4. Click on Model.
      Explore diagram is not open. Properties panel is open instead.

The commit message is not changed.

Kie code style is not applied in every file. See my comments inline.

import org.kie.workbench.common.stunner.core.client.session.event.BaseSessionEvent;

public class ScreenDiagramModelUnSelectedEvent extends BaseSessionEvent {
public ScreenDiagramModelUnSelectedEvent(final ClientSession session) {
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
public ScreenDiagramModelUnSelectedEvent(final ClientSession session) {
public ScreenDiagramModelUnSelectedEvent(final ClientSession session) {

import org.kie.workbench.common.stunner.core.client.session.event.BaseSessionEvent;

public class ScreenDiagramPropertiesSwitchingSessionsEvent extends BaseSessionEvent {
public ScreenDiagramPropertiesSwitchingSessionsEvent(final ClientSession session) {
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
public ScreenDiagramPropertiesSwitchingSessionsEvent(final ClientSession session) {
public ScreenDiagramPropertiesSwitchingSessionsEvent(final ClientSession session) {


private final boolean isExplorerScreen;

public ScreenPreMaximizedStateEvent(final boolean isExplorerScreen ) {
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
public ScreenPreMaximizedStateEvent(final boolean isExplorerScreen ) {
public ScreenPreMaximizedStateEvent(final boolean isExplorerScreen) {

@@ -172,7 +172,7 @@ public void checkDestructionReleasesResources() {

@Test
public void checkOnScreenMaximisedDiagramEditor() {
final ScreenMaximizedEvent event = new ScreenMaximizedEvent(true);
final ScreenMaximizedEvent event = new ScreenMaximizedEvent(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
final ScreenMaximizedEvent event = new ScreenMaximizedEvent(true );
final ScreenMaximizedEvent event = new ScreenMaximizedEvent(true);

@inodeman inodeman changed the title JBPM 8997 : Stunner - Properties panel is being closed when switching assets or views JBPM 8915 : Stunner - Properties panel is being closed when switching assets or views Feb 6, 2020
@inodeman
Copy link
Contributor Author

inodeman commented Feb 6, 2020

Jenkins execute full downstream build

@inodeman
Copy link
Contributor Author

inodeman commented Feb 6, 2020

Jenkins retest please

@inodeman
Copy link
Contributor Author

inodeman commented Feb 6, 2020

Hi @LuboTerifaj right now on the ticket fix works for BPMN files (Explore Panel not included, as it was not mentioned on ticket, will need additional time), for DMN and Case Management will need more time, you can check the issues with BPMN file and I can create jiras for Case and DMN or I can send the fix in a couple of days, let me know what you think? The code style, for some reason was not aplying, I rechecked it now, should be ok, also the commit message

@LuboTerifaj
Copy link
Contributor

Hello @inodeman the issue is not fixed for Properties panel either.

See my previous comment for more details.

The first mentioned issue in that comment is also the part of steps to reproduce in JBPM-8915 jira.

Hence, the main issue is still not fixed.

@inodeman
Copy link
Contributor Author

inodeman commented Feb 7, 2020

Hi @LuboTerifaj no problem, I will add Case Management and DMN, should be done early next week

@romartin
Copy link
Contributor

@inodeman please do not forget this one. I know we're focused on kogito, but that was expected for the previous release and it's a customer request as well, so we shoud complete it anyway.
Thanks!

@inodeman
Copy link
Contributor Author

no problem @romartin I can start on this tomorrow, just finished the quickstart examples its updates and the error issues creation

@inodeman
Copy link
Contributor Author

Jenkins execute full downstream build

@inodeman
Copy link
Contributor Author

Hi @LuboTerifaj , @romartin can you review this PR? @LuboTerifaj note this change only applies to bpmn models, you can test the cases when the user 1) maximizes and minimizes with both explore and properties panel, 2) switches views (Documentation, Overview and back to Diagram) for both the properties and explore, 3) Switching Sessions (Properties and Explore Panels), after you can verify how it is supposed to behave, I will go ahead and include DMN and Case Management models, I think this way, I can code it faster after I get your approval on desired behaviour, let me know

@sonarcloud
Copy link

sonarcloud bot commented Feb 15, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 7 Code Smells

64.2% 64.2% Coverage
2.5% 2.5% Duplication

@LuboTerifaj
Copy link
Contributor

Jenkins execute full downstream build

1 similar comment
@LuboTerifaj
Copy link
Contributor

Jenkins execute full downstream build

Copy link
Contributor

@LuboTerifaj LuboTerifaj left a comment

Choose a reason for hiding this comment

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

Hello @inodeman ,

switching between panels behaviour is not unified. The state of Properties/Explore diagram panel is not remembered for every case. There are two issues:
Steps to reproduce:

  1. Ensure Properties (Explore diagram) panel is open in Model view.
  2. Switch to Overview or Documentation.
  3. Open Explore diagram (Properties) panel and close it back.
  4. Open Model back.
    Actual result: Explore diagram (Properties) panel is open.
    Expected result: Properties (Explore diagram) panel is open.

Steps to reproduce:

  1. Ensure Properties (Explore diagram) panel is closed in Model view.
  2. Switch to Overview or Documentation.
  3. Open Explore diagram (Properties) panel and close it back.
  4. Open Model back.
    Actual result: Explore diagram (Properties) panel is open.
    Expected result: No panel is open.

Switching between assets is still not fixed. For more information see my review above.

Thanks!

@inodeman
Copy link
Contributor Author

Hi @LuboTerifaj @romartin this PR is ready for review again.

This will apply to BPMN process and Case Definition Only, since as commented by @romartin there is no case in doing it for Case Management featture.

I fixed some issues in changing tabs, now it should behave as expected. Made a change, where you open Overview or Documentation and Open Properties or Explorer and you change to Documentation or Overview, they will remain open.

War can be found here https://drive.google.com/file/d/1i9Q_J8QxTODQ2c1Nj8z4Xt74U15Q3uFG/view?usp=sharing

… assets or views

JBPM-8915 : Stunner - Properties panel is being closed when switching assets or views Added Logs

JBPM-8915 : Stunner - Properties panel is being closed when switching assets or views Fixed Maximize / Switching Assets Views
@inodeman
Copy link
Contributor Author

inodeman commented Feb 5, 2021

Jenkins retest this

@inodeman
Copy link
Contributor Author

inodeman commented Feb 5, 2021

jenkins do fdb

@sonarcloud
Copy link

sonarcloud bot commented Feb 5, 2021

@inodeman
Copy link
Contributor Author

inodeman commented Feb 8, 2021

Jenkins retest this

@inodeman
Copy link
Contributor Author

inodeman commented Feb 8, 2021

jenkins do fdb

@inodeman
Copy link
Contributor Author

Jenkins retest this

@inodeman
Copy link
Contributor Author

jenkins do fdb

@romartin
Copy link
Contributor

Closing - out of date and issue closed

@romartin romartin closed this Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants