Skip to content

Ui/small replication action fixes#9387

Merged
Monkeychip merged 17 commits into
masterfrom
ui/small-replication-action-fixes
Jul 7, 2020
Merged

Ui/small replication action fixes#9387
Monkeychip merged 17 commits into
masterfrom
ui/small-replication-action-fixes

Conversation

@Monkeychip
Copy link
Copy Markdown
Contributor

@Monkeychip Monkeychip commented Jul 2, 2020

This PR fixes the following issues:

  1. Fix breadcrumb link. If a DR cluster was not enabled, the breadcrumb link on the landing page did not work. I changed it so now if replication is not enabled the link takes you back to the index page vault.cluster.replication.index. I also changed the breadcrumb label to "Replication" whereas before it was Disaster Recovery. This label change only happens if the DR is not enabled.

breadcrumb1

  1. Another breadcrumb change. Before when you were on the manage page and you clicked the breadcrumb it was trying to redirect you to the manage page. I confirmed with Design that in the case of a DR Secondary, there should be no breadcrumb because you only have two routes in this state: manage and details, and toggle back and forth between those with a breadcrumb didn't make much sense. Here's an image of a DR secondary, with no breadcrumb.

image

  1. We had two situations where the transition needed some help (no errors just look/feel fixes). The first fix was to add a black nav during the initialization of a secondary DR cluster. To reproduce, add a secondary DR cluster. Before it showed only a loader. Now you can see a black nav bar above the loader. (in the gif, I wait for the network request so that the state of the loader is on the screen the longest).

transition1

  1. The second transition issue occurred after you enabled a DR secondary and then demoted that same DR. This was fixed by adding a new property to the cluster to capture the drMode. I then saved the initial drMode when the route's model was generated and set it on a property called drModeInit. Because the mode changes before any transition, to capture the change (computed properties did not work here), I compared the saved drModeInit property to the drMode property in the template. This situation only occurs when the drMode goes from primary to secondary (e.g. during demotion). Once the transition is complete the model is reset and the loader will go away.

*note, not very often the drMode will be 'disabled' and not 'primary' during the transition. In this case, the loader will not show. However, because this is rare, and I can't really seem to understand under which circumstance this happens. I feel better about not trying to capture this particular situation and be ok with the occasional flash of template screen and no loader. My feelings are that this is a feel/look fix, and if the fix is wrong the user could end up seeing a loader and not getting out of it, and that's a much worse situation than fixing a flash of the template page.

Here is a gif with a debugger so you can see the two properties.
transition2

Here is a gif without the debugger so you can see how it looks.
transition3

  1. The last fix was to prevent the super slow modal issues we were seeing after demoting a cluster. This issue was happening because the shamir-modal was not found as it was not in the addon component library. The fix was to move the shamir-modal and shamir-modal-flow into the addon components so it could be accessed from the replication engine.

…k. Now if DR not enabled, the breadcrumb says replication and links back to rep index.
…d for menu items and because NavHeader component and the icon live in the app and not addons I cannot access them without moving them. I figured the black bar was enough, and it wasn't worth moving just for that
…what page they are currently on (details or manage). Before the breadcrumb link didn't do anything if they were on the manage page
…odal not being in the addon engine and erroring out.
…perty on cluster and compare the mode of the dr which changes from primary to secondary during demotion. If dr mode changes, showing loading status
@Monkeychip Monkeychip added the ui label Jul 2, 2020
@Monkeychip Monkeychip added this to the 1.5 milestone Jul 2, 2020
<ReplicationPage @model={{model}} as |Page|>
<Page.header
@showTabs={{true}}
@pageType="manage"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

used to determine on manage page or not, and if you are change the link the breadcrumb uses.

Copy link
Copy Markdown
Contributor

@chelshaw chelshaw left a comment

Choose a reason for hiding this comment

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

A couple pending questions, but generally the changes look good! Awesome work figuring out the navbar disappearing act 👏

Comment thread ui/lib/replication/addon/templates/mode.hbs
{{/link-to}}
{{else}}
{{#if (eq pageType "manage")}}
{{#link-to "vault.cluster.replication-dr-promote.details"}}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A little curious why this link wouldn't go back to general Replication dashboard (vault.cluster.replication.index) instead. Or at the very least, maybe naming the breadcrumbs Disaster Recovery Details and Disaster Recovery Manage to be more indicative of what it's doing.

Copy link
Copy Markdown
Contributor Author

@Monkeychip Monkeychip Jul 2, 2020

Choose a reason for hiding this comment

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

Good thoughts. Amending my previous response. This is because it doesn't exist. We're a DR secondary and the index replication is no longer around. See gif below. There are only two routes when you're a DR secondary (manage or details).

I could see us removing the breadcrumbs entirely, but honestly, I think it's nice to have them. I'll check with design later today.

Screen Recording 2020-07-06 at 09 43 AM

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Confirmed with design that we'll remove breadcrumbs if it's a DR Secondary.

<PageHeader as |p|>
<p.top>
{{#if (not isSummaryDashboard) }}
{{#if (not (or isSummaryDashboard isSecondary)) }}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If is drSecondary then don't show breadcrumb, there is a conditional higher up that is making sure this is DR.

</span>
{{#link-to "vault.cluster.replication-dr-promote"}}
Disaster Recovery
{{#link-to "vault.cluster.replication.index"}}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The only time a breadcrumb shows on the route ui/vault/replication-dr-promote/details or the ui/vault/replication-dr-promote/ is when there is no DR Secondary and you land on the empty state component. In this case. you can use the breadcrumb to navigate back to the replication index page which lets you setup replication. See image here:
image

<PageHeader as |p|>
<p.top>
<nav class="key-value-header breadcrumb">
{{#if (and (eq model.drMode "secondary") (eq model.drModeInit "primary"))}}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The rest of this is indentation changes due to wrapping everything in conditional

@Monkeychip Monkeychip requested a review from andaley July 6, 2020 21:04
<section class="section">
<div class="container is-widescreen">
{{#if model.replicationIsInitializing }}
<nav class="navbar"></nav>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nice fix! ✨

Copy link
Copy Markdown
Contributor

@andaley andaley left a comment

Choose a reason for hiding this comment

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

this is fantastic. thank you for including such thorough descriptions and screenshots. code looks solid all around, too. nice work!

@Monkeychip Monkeychip merged commit 4e73f1b into master Jul 7, 2020
@Monkeychip Monkeychip deleted the ui/small-replication-action-fixes branch July 7, 2020 19:09
Monkeychip added a commit that referenced this pull request Jul 7, 2020
* fix issue where if dr is not enabled, the breadcrumb link did not work.  Now if DR not enabled, the breadcrumb says replication and links back to rep index.

* show black nav when cluster is not initialized and is loading, no need for menu items and because NavHeader component and the icon live in the app and not addons I cannot access them without moving them.  I figured the black bar was enough, and it wasn't worth moving just for that

* conditional change the breadcrumb link in Disaster Recovery based on what page they are currently on (details or manage).  Before the breadcrumb link didn't do anything if they were on the manage page

* fix slow modal loading after demoting a dr secondary.  due to shamir modal not being in the addon engine and erroring out.

* to prevent confusing transition state during dr demotion, set new property on cluster and compare the mode of the dr which changes from primary to secondary during demotion.  If dr mode changes, showing loading status

* get more specific about conditional so loader does not some on disabling, but only on demote

* remove concurrency from onSubmit

* revert all concurency, I think this is solved by the removal of shamir in the dom

* reverse order

* cleanup

* forgot that tricky layout, hopefull this will fix test

* remove page container, it's not needed

* remove breadcrumbs if DR secondary

* remove pageType no now longer using

* remove conditional that is no longer hit
Monkeychip added a commit that referenced this pull request Jul 7, 2020
* fix issue where if dr is not enabled, the breadcrumb link did not work.  Now if DR not enabled, the breadcrumb says replication and links back to rep index.

* show black nav when cluster is not initialized and is loading, no need for menu items and because NavHeader component and the icon live in the app and not addons I cannot access them without moving them.  I figured the black bar was enough, and it wasn't worth moving just for that

* conditional change the breadcrumb link in Disaster Recovery based on what page they are currently on (details or manage).  Before the breadcrumb link didn't do anything if they were on the manage page

* fix slow modal loading after demoting a dr secondary.  due to shamir modal not being in the addon engine and erroring out.

* to prevent confusing transition state during dr demotion, set new property on cluster and compare the mode of the dr which changes from primary to secondary during demotion.  If dr mode changes, showing loading status

* get more specific about conditional so loader does not some on disabling, but only on demote

* remove concurrency from onSubmit

* revert all concurency, I think this is solved by the removal of shamir in the dom

* reverse order

* cleanup

* forgot that tricky layout, hopefull this will fix test

* remove page container, it's not needed

* remove breadcrumbs if DR secondary

* remove pageType no now longer using

* remove conditional that is no longer hit
andaley pushed a commit that referenced this pull request Jul 17, 2020
* fix issue where if dr is not enabled, the breadcrumb link did not work.  Now if DR not enabled, the breadcrumb says replication and links back to rep index.

* show black nav when cluster is not initialized and is loading, no need for menu items and because NavHeader component and the icon live in the app and not addons I cannot access them without moving them.  I figured the black bar was enough, and it wasn't worth moving just for that

* conditional change the breadcrumb link in Disaster Recovery based on what page they are currently on (details or manage).  Before the breadcrumb link didn't do anything if they were on the manage page

* fix slow modal loading after demoting a dr secondary.  due to shamir modal not being in the addon engine and erroring out.

* to prevent confusing transition state during dr demotion, set new property on cluster and compare the mode of the dr which changes from primary to secondary during demotion.  If dr mode changes, showing loading status

* get more specific about conditional so loader does not some on disabling, but only on demote

* remove concurrency from onSubmit

* revert all concurency, I think this is solved by the removal of shamir in the dom

* reverse order

* cleanup

* forgot that tricky layout, hopefull this will fix test

* remove page container, it's not needed

* remove breadcrumbs if DR secondary

* remove pageType no now longer using

* remove conditional that is no longer hit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants