mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-29 11:09:27 -05:00
Reflect disable state for permissions form
This commit is contained in:
parent
4f9fb97618
commit
252c5378f6
@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user