Skip to content
Snippets Groups Projects
Commit 3fa57c97 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-6719 OZG-7044 show syncResult according to AKs

parent c7de5796
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,10 @@
<ods-list-item
*ngFor="let organisationsEinheitResource of organisationsEinheitResources"
[routerLink]="getEncodedSelfLink(organisationsEinheitResource)"
[class.text-red-500]="syncResultIsNotOk(organisationsEinheitResource)"
[class.text-red-500]="
organisationsEinheitResource.syncResult === AdminOrganisationsEinheitSyncResult.NOT_FOUND_IN_PVOG ||
organisationsEinheitResource.syncResult === AdminOrganisationsEinheitSyncResult.ORGANISATIONSEINHEIT_ID_NOT_UNIQUE
"
data-test-id="organisations-einheit-list-item"
>
<dl class="flex-1 basis-3/4 font-semibold" [class.pl-4]="organisationsEinheitResource.isChild">
......@@ -19,10 +22,16 @@
<dt class="sr-only">Synchronisationsergebnis</dt>
<dd class="mt-1">
<ods-exclamation-icon
*ngIf="syncResultIsNotOk(organisationsEinheitResource)"
*ngIf="organisationsEinheitResource.syncResult === AdminOrganisationsEinheitSyncResult.NOT_FOUND_IN_PVOG"
matTooltip="Organisationseinheit wurde nicht in den PVOG-Daten gefunden."
size="small"
/>
<ods-exclamation-icon
*ngIf="
organisationsEinheitResource.syncResult === AdminOrganisationsEinheitSyncResult.ORGANISATIONSEINHEIT_ID_NOT_UNIQUE
"
size="small"
/>
</dd>
</dl>
</ods-list-item>
......
......@@ -48,7 +48,7 @@ describe('OrganisationsEinheitListComponent', () => {
describe('input', () => {
describe('organisationsEinheitResources', () => {
const organisationsEinheitResource: AdminOrganisationsEinheitResource = createAdminOrganisationsEinheitResource(
AdminOrganisationsEinheitSyncResult.NAME_MISMATCH,
AdminOrganisationsEinheitSyncResult.NOT_FOUND_IN_PVOG,
);
beforeEach(() => {
......@@ -107,26 +107,6 @@ describe('OrganisationsEinheitListComponent', () => {
expect(component.organisationsEinheitResources[2].isChild).toBeTruthy();
});
});
describe('syncResultIsNotOk', () => {
it('should return true', () => {
const organisationsEinheitResource: AdminOrganisationsEinheitResource = createAdminOrganisationsEinheitResource(
AdminOrganisationsEinheitSyncResult.NAME_MISMATCH,
);
const result: boolean = component.syncResultIsNotOk(organisationsEinheitResource);
expect(result).toBeTruthy();
});
it('should return false', () => {
const organisationsEinheitResource: AdminOrganisationsEinheitResource = createAdminOrganisationsEinheitResource(
AdminOrganisationsEinheitSyncResult.OK,
);
const result: boolean = component.syncResultIsNotOk(organisationsEinheitResource);
expect(result).toBeFalsy();
});
});
describe('getEncodedSelfLink', () => {
it('should return encoded self link', () => {
const organisationsEinheitResource: AdminOrganisationsEinheitResource = createAdminOrganisationsEinheitResource();
......
......@@ -20,6 +20,8 @@ export class OrganisationsEinheitListComponent {
this.moveChildrenIntoParentLevel(list);
}
public readonly AdminOrganisationsEinheitSyncResult = AdminOrganisationsEinheitSyncResult;
moveChildrenIntoParentLevel(list: AdminOrganisationsEinheitResource[]): void {
list.forEach((parent) => {
this._organisationsEinheitResources.push(parent);
......@@ -33,10 +35,6 @@ export class OrganisationsEinheitListComponent {
});
}
syncResultIsNotOk(organisationsEinheitResource: AdminOrganisationsEinheitResource): boolean {
return organisationsEinheitResource.syncResult !== AdminOrganisationsEinheitSyncResult.OK;
}
getEncodedSelfLink(organisationsEinheitResource: AdminOrganisationsEinheitResource): ResourceUri {
const resourceUri: ResourceUri = getLink(organisationsEinheitResource, OrganisationsEinheitLinkRel.SELF).href;
return encodeUrlForEmbedding(resourceUri);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment