fixed tests after angular 10 upgrade

This commit is contained in:
Giuseppe Digilio
2020-12-03 19:45:05 +01:00
parent 9ed1c74f29
commit 10d0c2e518
212 changed files with 1461 additions and 1333 deletions

View File

@@ -29,7 +29,7 @@ import { ACCESS_CONTROL_MODULE_PATH } from '../../+admin/admin-routing-paths';
interface ResourcePolicyCheckboxEntry {
id: string;
policy: ResourcePolicy;
checked: boolean
checked: boolean;
}
@Component({
@@ -123,10 +123,10 @@ export class ResourcePoliciesComponent implements OnInit, OnDestroy {
canDelete(): Observable<boolean> {
return observableFrom(this.resourcePoliciesEntries$.value).pipe(
filter((entry: ResourcePolicyCheckboxEntry) => entry.checked),
reduce((acc: any, value: any) => [...acc, ...value], []),
reduce((acc: any, value: any) => [...acc, value], []),
map((entries: ResourcePolicyCheckboxEntry[]) => isNotEmpty(entries)),
distinctUntilChanged()
)
);
}
/**
@@ -139,7 +139,7 @@ export class ResourcePoliciesComponent implements OnInit, OnDestroy {
this.subs.push(
observableFrom(policiesToDelete).pipe(
concatMap((entry: ResourcePolicyCheckboxEntry) => this.resourcePolicyService.delete(entry.policy.id)),
scan((acc: any, value: any) => [...acc, ...value], []),
scan((acc: any, value: any) => [...acc, value], []),
filter((results: boolean[]) => results.length === policiesToDelete.length),
take(1),
).subscribe((results: boolean[]) => {
@@ -152,7 +152,7 @@ export class ResourcePoliciesComponent implements OnInit, OnDestroy {
this.initResourcePolicyLIst();
this.processingDelete$.next(false);
})
)
);
}
/**
@@ -178,7 +178,7 @@ export class ResourcePoliciesComponent implements OnInit, OnDestroy {
getFirstSucceededRemoteDataWithNotEmptyPayload(),
map((eperson: EPerson) => this.dsoNameService.getName(eperson)),
startWith('')
)
);
}
/**
@@ -194,7 +194,7 @@ export class ResourcePoliciesComponent implements OnInit, OnDestroy {
getFirstSucceededRemoteDataWithNotEmptyPayload(),
map((group: Group) => this.dsoNameService.getName(group)),
startWith('')
)
);
}
/**
@@ -220,7 +220,7 @@ export class ResourcePoliciesComponent implements OnInit, OnDestroy {
getFirstSucceededRemoteDataPayload(),
map((eperson: EPerson) => isNotEmpty(eperson)),
startWith(false)
)
);
}
/**
@@ -237,7 +237,7 @@ export class ResourcePoliciesComponent implements OnInit, OnDestroy {
getFirstSucceededRemoteDataPayload(),
map((group: Group) => isNotEmpty(group)),
startWith(false)
)
);
}
/**
@@ -281,7 +281,7 @@ export class ResourcePoliciesComponent implements OnInit, OnDestroy {
policyTargetId: this.resourceUUID,
targetType: this.resourceType
}
})
});
}
/**
@@ -295,7 +295,7 @@ export class ResourcePoliciesComponent implements OnInit, OnDestroy {
queryParams: {
policyId: policy.id
}
})
});
}
/**
@@ -311,9 +311,9 @@ export class ResourcePoliciesComponent implements OnInit, OnDestroy {
getFirstSucceededRemoteDataPayload(),
map((group: Group) => group.id)
).subscribe((groupUUID) => {
this.router.navigate([ADMIN_MODULE_PATH, ACCESS_CONTROL_MODULE_PATH, GROUP_EDIT_PATH, groupUUID])
this.router.navigate([ADMIN_MODULE_PATH, ACCESS_CONTROL_MODULE_PATH, GROUP_EDIT_PATH, groupUUID]);
})
)
);
}
/**
@@ -339,7 +339,7 @@ export class ResourcePoliciesComponent implements OnInit, OnDestroy {
this.resourcePoliciesEntries$ = null;
this.subs
.filter((subscription) => hasValue(subscription))
.forEach((subscription) => subscription.unsubscribe())
.forEach((subscription) => subscription.unsubscribe());
}
}