Added pristineWarning if no changes has been made to edit employee form
This commit is contained in:
@@ -4,14 +4,15 @@ import { TreeNode } from '@msfa-shared/components/tree-nodes-selector/services/t
|
||||
export class TreeNodeValidator {
|
||||
static IsValidTreeNode(
|
||||
validationFn: (treeNode: TreeNode | null | undefined) => boolean,
|
||||
nameOfError: string
|
||||
nameOfError: string,
|
||||
allUtforandeVerksamheterFormControl: AbstractControl
|
||||
): ValidatorFn {
|
||||
return (control: AbstractControl): { [key: string]: unknown } => {
|
||||
const isValid = validationFn(control.value);
|
||||
|
||||
const validationObj = {};
|
||||
|
||||
if (isValid) {
|
||||
if (isValid || allUtforandeVerksamheterFormControl?.value) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user