-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Ui/replication merge cleanup #9188
Ui/replication merge cleanup #9188
Conversation
… when Not defined
…in the known secondaries card
primaryClusterAddr: computed('replcationDetails.{primaryClusterAddr}', function() { | ||
return this.replicationDetails.primaryClusterAddr; | ||
primaryClusterAddr: computed('replicationDetails.{primaryClusterAddr}', function() { | ||
return this.replicationDetails.primaryClusterAddr || 'Not defined'; |
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.
i was wondering about whether to display a default value here too, but when i spoke to ivana about it yesterday we decided not the show the primary_cluster_addr
if one wasn't explicitly set. this is because the primary_cluster_addr
is an optional field. showing Not defined
here is a little confusing because it almost sounds like an error -- like the user should have defined one but didn't, when in actuality they don't need to define one. what do you think?
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.
Let's chat during sync or after. I also spoke with Ivana and that's where I came up with the text. Probably best to make sure we are all on the same page.
ui/lib/replication/addon/templates/components/known-secondaries-card.hbs
Show resolved
Hide resolved
oh boy, i love a good cleanup PR. thanks so much for doing this! ✅ making the modal submit by pressing 'enter' sounds awesome other than that, the code looks good. let me know when you need a final 👁️ ! |
…e former deals with input on the modal footer, the later get's caught in replication actions.
class="input has-margin-top" | ||
autocomplete="off" | ||
spellcheck="false" | ||
enter=onConfirm |
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.
Handle enter on modals that have inputs (e.g. demote where you have to type in the mode to confirm).
|
||
export default Actions.extend({ | ||
layout, | ||
onSubmit() {}, |
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.
You'll see this added to each replicationAction component. The sole purpose of this is to handle the escape action. The only two modals that don't have this are the demote and disable modals, as they require you type in a confirmationText. If I try and handle the keypress value at this level, I don't know if they've confirmed the text or not, and thus can't handle it this high up. Instead, the escape action is handled on the ConfrimationModal level for these two components.
|
||
export default Actions.extend({ | ||
layout, | ||
onSubmit() {}, |
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.
You'll see this added to each replicationAction component. The sole purpose of this is to handle the escape action. The only two modals that don't have this are the demote and disable modals, as they require you type in a confirmationText. If I try and handle the keypress value at this level, I don't know if they've confirmed the text or not, and thus can't handle it this high up. Instead, the escape action is handled on the ConfrimationModal level for these two components.
Promote this cluster to a {{replicationDisplayMode}} primary | ||
</p> | ||
</div> | ||
<div onkeyup={{action "onSubmit" "promote" model.replicationAttrs.modeForUrl (hash dr_operation_token=dr_operation_token primary_cluster_addr=primary_cluster_addr force=force)}}> |
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.
wrapping div on all replicationAction components (but disable and demote) so that they trigger the check on escape.
id="primary_cluster_addr" | ||
name="primary_cluster_addr" | ||
value=primary_cluster_addr | ||
enter=(action "onSubmit" "promote" model.replicationAttrs.modeForUrl (hash dr_operation_token=dr_operation_token primary_cluster_addr=primary_cluster_addr force=force)) |
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.
allowing the enter button to submit when you are in the input of the primary_cluster_addr
@header="cluster_addr" | ||
@items={{knownPrimaryClusterAddrs}} | ||
/> | ||
{{#if (is-empty knownPrimaryClusterAddrs)}} |
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.
class="input has-margin-top" | ||
autocomplete="off" | ||
spellcheck="false" | ||
enter=(if (eq confirmationInput confirmText) onConfirm) |
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.
handling enter and escape on the confirmation modal used by the replicationAction disable and demote.
Attempt recovery if replication is in a bad state. | ||
</p> | ||
</div> | ||
<div onkeyup={{action "onSubmit" "recover"}}> |
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.
Another wrapping div to handle the escape
<p> | ||
Reindex the local data storage | ||
</p> | ||
<div onkeyup={{action 'onSubmit' 'reindex'}}> |
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.
Another wrapping div to handle the escape
Change this secondary's assigned primary cluster | ||
</p> | ||
</div> | ||
<div onkeyup={{action "onSubmit" "update-primary" model.replicationAttrs.modeForUrl (hash token=token primary_api_addr=primary_api_addr ca_path=ca_path ca_file=ca_file)}}> |
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.
Another wrapping div to handle the escape
We removed the changes that were not the modal enter/escape changes and made a new PR. The modal enter/escape functionality is going to be a separate ticket/project that needs more consideration and research regarding accessibility. |
This PR address a couple of minor fixes I noticed after the merge. These fixes are not related to the merge, but just things I came across while double-checking.
Fixes in PR:
confirmText
andconfirmationText
are the same. It gets super complicated handling the submit action after that. The only way I could see to get it to work (if I was actually able to do it) added way more complexity than it was worth.Here is a gif of the modal actions. I am not using my mouse in any of these, I'm just using the keyboard. If you wanted to test this yourself, make sure to not only hit enter and escape but other keys and try to use your mouse as well. I've tested this pretty extensively, but more testing wouldn't hurt.
Note: There is an error currently when you demote to a DR secondary. Chelsea is fixing that in another PR.