UI: Fixed disabled queue name
This commit is contained in:
parent
c8d28ed672
commit
784ab8cb65
@ -14,7 +14,7 @@
|
|||||||
/// limitations under the License.
|
/// limitations under the License.
|
||||||
///
|
///
|
||||||
|
|
||||||
import { Component, forwardRef, Input, OnDestroy } from '@angular/core';
|
import { Component, forwardRef, Input, OnDestroy, OnInit } from '@angular/core';
|
||||||
import {
|
import {
|
||||||
AbstractControl,
|
AbstractControl,
|
||||||
ControlValueAccessor,
|
ControlValueAccessor,
|
||||||
@ -53,7 +53,7 @@ import { takeUntil } from 'rxjs/operators';
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class TenantProfileQueuesComponent implements ControlValueAccessor, Validator, OnDestroy {
|
export class TenantProfileQueuesComponent implements ControlValueAccessor, Validator, OnDestroy, OnInit {
|
||||||
|
|
||||||
tenantProfileQueuesFormGroup: UntypedFormGroup;
|
tenantProfileQueuesFormGroup: UntypedFormGroup;
|
||||||
newQueue = false;
|
newQueue = false;
|
||||||
@ -107,6 +107,7 @@ export class TenantProfileQueuesComponent implements ControlValueAccessor, Valid
|
|||||||
|
|
||||||
setDisabledState(isDisabled: boolean): void {
|
setDisabledState(isDisabled: boolean): void {
|
||||||
this.disabled = isDisabled;
|
this.disabled = isDisabled;
|
||||||
|
this.newQueue = false;
|
||||||
if (this.disabled) {
|
if (this.disabled) {
|
||||||
this.tenantProfileQueuesFormGroup.disable({emitEvent: false});
|
this.tenantProfileQueuesFormGroup.disable({emitEvent: false});
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -129,11 +129,6 @@ export class QueueFormComponent implements ControlValueAccessor, OnInit, OnDestr
|
|||||||
this.queueFormGroup.get('submitStrategy').get('type').valueChanges.subscribe(() => {
|
this.queueFormGroup.get('submitStrategy').get('type').valueChanges.subscribe(() => {
|
||||||
this.submitStrategyTypeChanged();
|
this.submitStrategyTypeChanged();
|
||||||
});
|
});
|
||||||
if (this.newQueue) {
|
|
||||||
this.queueFormGroup.get('name').enable({emitEvent: false});
|
|
||||||
} else {
|
|
||||||
this.queueFormGroup.get('name').disable({emitEvent: false});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
@ -149,9 +144,13 @@ export class QueueFormComponent implements ControlValueAccessor, OnInit, OnDestr
|
|||||||
this.queueFormGroup.disable({emitEvent: false});
|
this.queueFormGroup.disable({emitEvent: false});
|
||||||
} else {
|
} else {
|
||||||
this.queueFormGroup.enable({emitEvent: false});
|
this.queueFormGroup.enable({emitEvent: false});
|
||||||
|
if (this.newQueue) {
|
||||||
|
this.queueFormGroup.get('name').enable({emitEvent: false});
|
||||||
|
} else {
|
||||||
this.queueFormGroup.get('name').disable({emitEvent: false});
|
this.queueFormGroup.get('name').disable({emitEvent: false});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
writeValue(value: QueueInfo): void {
|
writeValue(value: QueueInfo): void {
|
||||||
this.propagateChangePending = false;
|
this.propagateChangePending = false;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user