mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-09-01 01:46:16 +00:00
Fix: frontend better reflect global perms for bulk edit, disabled form state (#8469)
This commit is contained in:
@@ -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()
|
||||
})
|
||||
})
|
||||
|
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user