Merge branch 'RED-9887' into 'master'
RED-9887: fixed save button being disabled. See merge request redactmanager/red-ui!555
This commit is contained in:
commit
7d449d3ff7
@ -54,7 +54,7 @@
|
||||
<div class="editing-actions">
|
||||
<iqser-icon-button
|
||||
(action)="save()"
|
||||
[disabled]="disabled()"
|
||||
[disabled]="disabled"
|
||||
[label]="'component-management.actions.save' | translate"
|
||||
[type]="iconButtonTypes.primary"
|
||||
></iqser-icon-button>
|
||||
|
||||
@ -48,14 +48,6 @@ export class EditableStructuredComponentValueComponent implements OnInit {
|
||||
protected entryLabel: string;
|
||||
protected editing = false;
|
||||
protected initialEntry: IComponentLogEntry;
|
||||
disabled = computed(() => {
|
||||
for (let i = 0; i < this.currentEntry().componentValues.length; i++) {
|
||||
if (this.currentEntry().componentValues[i].value !== this.initialEntry.componentValues[i]?.value) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return this.currentEntry().componentValues.length === this.initialEntry.componentValues.length;
|
||||
});
|
||||
protected readonly iconButtonTypes = IconButtonTypes;
|
||||
|
||||
constructor(
|
||||
@ -64,6 +56,15 @@ export class EditableStructuredComponentValueComponent implements OnInit {
|
||||
private readonly _state: FilePreviewStateService,
|
||||
) {}
|
||||
|
||||
get disabled() {
|
||||
for (let i = 0; i < this.currentEntry().componentValues.length; i++) {
|
||||
if (this.currentEntry().componentValues[i].value !== this.initialEntry.componentValues[i]?.value) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return this.currentEntry().componentValues.length === this.initialEntry.componentValues.length;
|
||||
}
|
||||
|
||||
get #initialEntry() {
|
||||
return JSON.parse(JSON.stringify(this.entry()));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user