Skip to content
Snippets Groups Projects
Commit 99f6de34 authored by OZGCloud's avatar OZGCloud
Browse files

Merge pull request 'OZG-7039-bugfix' (#804) from OZG-7039-bugfix into master

parents 391db4c5 a85509b0
No related branches found
No related tags found
No related merge requests found
...@@ -6,10 +6,17 @@ ...@@ -6,10 +6,17 @@
@import 'libs/design-system/src/lib/tailwind-preset/root.css'; @import 'libs/design-system/src/lib/tailwind-preset/root.css';
@import 'libs/ui/src/lib/font/font_material'; @import 'libs/ui/src/lib/font/font_material';
@import 'variables';
@include mat.all-component-typographies(); @include mat.all-component-typographies();
@include mat.core(); @include mat.core();
@include mat.all-component-themes($alfaTheme);
body.dark {
@include mat.all-component-colors($alfaDarkTheme);
}
.heading-1 { .heading-1 {
@apply text-3xl font-medium text-text; @apply text-3xl font-medium text-text;
} }
......
...@@ -2,7 +2,10 @@ ...@@ -2,7 +2,10 @@
<ods-list-item <ods-list-item
*ngFor="let organisationsEinheitResource of organisationsEinheitResources" *ngFor="let organisationsEinheitResource of organisationsEinheitResources"
[routerLink]="getEncodedSelfLink(organisationsEinheitResource)" [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" data-test-id="organisations-einheit-list-item"
> >
<dl class="flex-1 basis-3/4 font-semibold" [class.pl-4]="organisationsEinheitResource.isChild"> <dl class="flex-1 basis-3/4 font-semibold" [class.pl-4]="organisationsEinheitResource.isChild">
...@@ -19,10 +22,16 @@ ...@@ -19,10 +22,16 @@
<dt class="sr-only">Synchronisationsergebnis</dt> <dt class="sr-only">Synchronisationsergebnis</dt>
<dd class="mt-1"> <dd class="mt-1">
<ods-exclamation-icon <ods-exclamation-icon
*ngIf="syncResultIsNotOk(organisationsEinheitResource)" *ngIf="organisationsEinheitResource.syncResult === AdminOrganisationsEinheitSyncResult.NOT_FOUND_IN_PVOG"
matTooltip="Organisationseinheit wurde nicht in den PVOG-Daten gefunden." matTooltip="Organisationseinheit wurde nicht in den PVOG-Daten gefunden."
size="small" size="small"
/> />
<ods-exclamation-icon
*ngIf="
organisationsEinheitResource.syncResult === AdminOrganisationsEinheitSyncResult.ORGANISATIONSEINHEIT_ID_NOT_UNIQUE
"
size="small"
/>
</dd> </dd>
</dl> </dl>
</ods-list-item> </ods-list-item>
......
...@@ -48,7 +48,7 @@ describe('OrganisationsEinheitListComponent', () => { ...@@ -48,7 +48,7 @@ describe('OrganisationsEinheitListComponent', () => {
describe('input', () => { describe('input', () => {
describe('organisationsEinheitResources', () => { describe('organisationsEinheitResources', () => {
const organisationsEinheitResource: AdminOrganisationsEinheitResource = createAdminOrganisationsEinheitResource( const organisationsEinheitResource: AdminOrganisationsEinheitResource = createAdminOrganisationsEinheitResource(
AdminOrganisationsEinheitSyncResult.NAME_MISMATCH, AdminOrganisationsEinheitSyncResult.NOT_FOUND_IN_PVOG,
); );
beforeEach(() => { beforeEach(() => {
...@@ -107,26 +107,6 @@ describe('OrganisationsEinheitListComponent', () => { ...@@ -107,26 +107,6 @@ describe('OrganisationsEinheitListComponent', () => {
expect(component.organisationsEinheitResources[2].isChild).toBeTruthy(); 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', () => { describe('getEncodedSelfLink', () => {
it('should return encoded self link', () => { it('should return encoded self link', () => {
const organisationsEinheitResource: AdminOrganisationsEinheitResource = createAdminOrganisationsEinheitResource(); const organisationsEinheitResource: AdminOrganisationsEinheitResource = createAdminOrganisationsEinheitResource();
......
...@@ -20,6 +20,8 @@ export class OrganisationsEinheitListComponent { ...@@ -20,6 +20,8 @@ export class OrganisationsEinheitListComponent {
this.moveChildrenIntoParentLevel(list); this.moveChildrenIntoParentLevel(list);
} }
public readonly AdminOrganisationsEinheitSyncResult = AdminOrganisationsEinheitSyncResult;
moveChildrenIntoParentLevel(list: AdminOrganisationsEinheitResource[]): void { moveChildrenIntoParentLevel(list: AdminOrganisationsEinheitResource[]): void {
list.forEach((parent) => { list.forEach((parent) => {
this._organisationsEinheitResources.push(parent); this._organisationsEinheitResources.push(parent);
...@@ -33,10 +35,6 @@ export class OrganisationsEinheitListComponent { ...@@ -33,10 +35,6 @@ export class OrganisationsEinheitListComponent {
}); });
} }
syncResultIsNotOk(organisationsEinheitResource: AdminOrganisationsEinheitResource): boolean {
return organisationsEinheitResource.syncResult !== AdminOrganisationsEinheitSyncResult.OK;
}
getEncodedSelfLink(organisationsEinheitResource: AdminOrganisationsEinheitResource): ResourceUri { getEncodedSelfLink(organisationsEinheitResource: AdminOrganisationsEinheitResource): ResourceUri {
const resourceUri: ResourceUri = getLink(organisationsEinheitResource, OrganisationsEinheitLinkRel.SELF).href; const resourceUri: ResourceUri = getLink(organisationsEinheitResource, OrganisationsEinheitLinkRel.SELF).href;
return encodeUrlForEmbedding(resourceUri); return encodeUrlForEmbedding(resourceUri);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment