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

UI - add force option when promoting a replication secondary #5438

Merged
merged 1 commit into from
Oct 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ui/app/components/replication-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const DEFAULTS = {
errors: [],
id: null,
replicationMode: null,
force: false,
};

export default Component.extend(ReplicationActions, DEFAULTS, {
Expand Down
37 changes: 35 additions & 2 deletions ui/app/templates/partials/replication/promote.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,23 @@
Overrides the cluster address that the primary gives to secondary nodes.
</p>
</div>

<div class="field">
<div class="b-checkbox">
<input type="checkbox"
id="forcePromote"
class="styled"
checked={{force}}
onchange={{action (mut force) value="target.checked"}}
/>
<label for="forcePromote" class="is-label">
Force promotion of this cluster
</label>
</div>
<p class="help has-text-grey">
Promote the cluster even if certain safety checks fail.
</p>
</div>
</div>
{{/if}}
</div>
Expand All @@ -40,7 +57,7 @@
<div class="control">
{{#confirm-action
buttonClasses="button is-primary"
onConfirmAction=(action "onSubmit" "promote" model.replicationAttrs.modeForUrl (hash dr_operation_token=dr_operation_token primary_cluster_addr=primary_cluster_addr))
onConfirmAction=(action "onSubmit" "promote" model.replicationAttrs.modeForUrl (hash dr_operation_token=dr_operation_token primary_cluster_addr=primary_cluster_addr force=force))
confirmMessage="Are you sure you want to promote this cluster?"
confirmButtonText="Promote cluster"
cancelButtonText="Cancel"
Expand Down Expand Up @@ -71,12 +88,28 @@
Overrides the cluster address that the primary gives to secondary nodes.
</p>
</div>
<div class="field">
<div class="b-checkbox">
<input type="checkbox"
id="forcePromote"
class="styled"
checked={{force}}
onchange={{action (mut force) value="target.checked"}}
/>
<label for="forcePromote" class="is-label">
Force promotion of this cluster
</label>
</div>
<p class="help has-text-grey">
Promote the cluster even if certain safety checks fail.
</p>
</div>
</div>
<div class="field">
<div class="control">
{{#confirm-action
buttonClasses="button is-primary"
onConfirmAction=(action "onSubmit" "promote" model.replicationAttrs.modeForUrl (hash primary_cluster_addr=primary_cluster_addr))
onConfirmAction=(action "onSubmit" "promote" model.replicationAttrs.modeForUrl (hash primary_cluster_addr=primary_cluster_addr force=force))
confirmMessage="Are you sure you want to promote this cluster?"
confirmButtonText="Promote cluster"
cancelButtonText="Cancel"
Expand Down