Disable scale buttons when a deployment is running or ACL forbids it
This commit is contained in:
parent
3b7b5f9649
commit
c664f57361
|
@ -1,6 +1,6 @@
|
|||
import Component from '@ember/component';
|
||||
import { computed, action } from '@ember/object';
|
||||
import { oneWay } from '@ember/object/computed';
|
||||
import { alias, oneWay } from '@ember/object/computed';
|
||||
import { debounce } from '@ember/runloop';
|
||||
import { classNames, tagName } from '@ember-decorators/component';
|
||||
import classic from 'ember-classic-decorator';
|
||||
|
@ -14,6 +14,7 @@ export default class TaskGroupRow extends Component {
|
|||
debounce = 300;
|
||||
|
||||
@oneWay('taskGroup.count') count;
|
||||
@alias('taskGroup.job.runningDeployment') runningDeployment;
|
||||
|
||||
onClick() {}
|
||||
|
||||
|
|
|
@ -6,18 +6,23 @@
|
|||
<td data-test-task-group-count class="nowrap">
|
||||
{{count}}
|
||||
{{#if taskGroup.scaling}}
|
||||
<div class="button-bar is-shadowless is-text bumper-left">
|
||||
<div
|
||||
data-test-scale-controls
|
||||
class="button-bar is-shadowless is-text bumper-left {{if (cannot "scale job") "tooltip"}}"
|
||||
aria-label={{if (cannot "scale job") "You aren't allowed to scale task groups"}}>
|
||||
<button
|
||||
data-test-scale="decrement"
|
||||
role="button"
|
||||
class="button is-xsmall is-light"
|
||||
disabled={{isMinimum}}
|
||||
disabled={{or isMinimum runningDeployment (cannot "scale job")}}
|
||||
onclick={{action "countDown"}}>
|
||||
{{x-icon "minus-plain" class="is-text"}}
|
||||
</button>
|
||||
<button
|
||||
data-test-scale="increment"
|
||||
role="button"
|
||||
class="button is-xsmall is-light"
|
||||
disabled={{isMaximum}}
|
||||
disabled={{or isMaximum runningDeployment (cannot "scale job")}}
|
||||
onclick={{action "countUp"}}>
|
||||
{{x-icon "plus-plain" class="is-text"}}
|
||||
</button>
|
||||
|
|
Loading…
Reference in a new issue