Fix: frontend better reflect global perms for bulk edit, disabled form state (#8469)

This commit is contained in:
shamoon
2024-12-11 01:05:23 -08:00
committed by GitHub
parent beb8ed8313
commit 2ac2a6dec6
14 changed files with 150 additions and 108 deletions

View File

@@ -14,7 +14,7 @@
div, .ng-arrow-wrapper, input {
cursor: not-allowed;
}
background-color: var(--pngx-bg-alt) !important;
background-color: var(--pngx-bg-disabled) !important;
}
}
}

View File

@@ -66,4 +66,11 @@ describe('PermissionsFormComponent', () => {
},
})
})
it('should disable form on disabled state change', () => {
component.setDisabledState(false)
expect(component.form.disabled).toBeFalsy()
component.setDisabledState(true)
expect(component.form.disabled).toBeTruthy()
})
})

View File

@@ -66,4 +66,12 @@ export class PermissionsFormComponent
writeValue(newValue: any): void {
this.form.patchValue(newValue, { emitEvent: false })
}
public setDisabledState(isDisabled: boolean): void {
if (isDisabled) {
this.form.disable()
} else {
this.form.enable()
}
}
}

View File

@@ -5,7 +5,7 @@
pointer-events: none;
.ng-select-container {
background-color: var(--pngx-bg-alt) !important;
background-color: var(--pngx-bg-disabled) !important;
}
}
}

View File

@@ -5,7 +5,7 @@
pointer-events: none;
.ng-select-container {
background-color: var(--pngx-bg-alt) !important;
background-color: var(--pngx-bg-disabled) !important;
}
}
}

View File

@@ -9,7 +9,7 @@
pointer-events: none;
.ng-select-container {
background-color: var(--pngx-bg-alt) !important;
background-color: var(--pngx-bg-disabled) !important;
}
}
}

View File

@@ -16,7 +16,7 @@
pointer-events: none;
.ng-select-container {
background-color: var(--pngx-bg-alt) !important;
background-color: var(--pngx-bg-disabled) !important;
}
}
}