Ui/small replication action fixes#9387
Conversation
…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
…ing, but only on demote
| <ReplicationPage @model={{model}} as |Page|> | ||
| <Page.header | ||
| @showTabs={{true}} | ||
| @pageType="manage" |
There was a problem hiding this comment.
used to determine on manage page or not, and if you are change the link the breadcrumb uses.
chelshaw
left a comment
There was a problem hiding this comment.
A couple pending questions, but generally the changes look good! Awesome work figuring out the navbar disappearing act 👏
| {{/link-to}} | ||
| {{else}} | ||
| {{#if (eq pageType "manage")}} | ||
| {{#link-to "vault.cluster.replication-dr-promote.details"}} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)) }} |
There was a problem hiding this comment.
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"}} |
There was a problem hiding this comment.
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:

| <PageHeader as |p|> | ||
| <p.top> | ||
| <nav class="key-value-header breadcrumb"> | ||
| {{#if (and (eq model.drMode "secondary") (eq model.drModeInit "primary"))}} |
There was a problem hiding this comment.
The rest of this is indentation changes due to wrapping everything in conditional
| <section class="section"> | ||
| <div class="container is-widescreen"> | ||
| {{#if model.replicationIsInitializing }} | ||
| <nav class="navbar"></nav> |
andaley
left a comment
There was a problem hiding this comment.
this is fantastic. thank you for including such thorough descriptions and screenshots. code looks solid all around, too. nice work!
* 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
* 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
* 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

This PR fixes the following issues:
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.drMode. I then saved the initial drMode when the route's model was generated and set it on a property calleddrModeInit. Because the mode changes before any transition, to capture the change (computed properties did not work here), I compared the saveddrModeInitproperty to thedrModeproperty in the template. This situation only occurs when thedrModegoes 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
drModewill 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.

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

shamir-modalwas not found as it was not in the addon component library. The fix was to move theshamir-modalandshamir-modal-flowinto the addon components so it could be accessed from the replication engine.