Skip to content
Snippets Groups Projects
Commit 709aeb26 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-6720 CR Kommentare

parent 1b2e3c65
No related branches found
No related tags found
No related merge requests found
...@@ -18,5 +18,5 @@ export class OrganisationsEinheitContainerComponent implements OnInit { ...@@ -18,5 +18,5 @@ export class OrganisationsEinheitContainerComponent implements OnInit {
this.organisationsEinheitListStateResource$ = this.organisationsEinheitService.getList(); this.organisationsEinheitListStateResource$ = this.organisationsEinheitService.getList();
} }
protected readonly organisationsEinheitListLinkRel = OrganisationsEinheitListLinkRel; public readonly organisationsEinheitListLinkRel = OrganisationsEinheitListLinkRel;
} }
<ods-list *ngIf="organisationsEinheitResources.length > 0" data-test-id="organisations-einheit-list"> <ods-list *ngIf="organisationsEinheitResources.length > 0" data-test-id="organisations-einheit-list">
<ods-list-item <ods-list-item
*ngFor="let organisationsEinheitResource of organisationsEinheitResources" *ngFor="let organisationsEinheitResource of organisationsEinheitResources"
[routerLink]="getEncodedSelfLink(organisationsEinheitResource)" [routerLink]="organisationsEinheitResource | toResourceUri: OrganisationsEinheitLinkRel.SELF"
[class.text-red-500]=" [class.text-red-500]="
organisationsEinheitResource.syncResult === AdminOrganisationsEinheitSyncResult.NOT_FOUND_IN_PVOG || organisationsEinheitResource.syncResult === AdminOrganisationsEinheitSyncResult.NOT_FOUND_IN_PVOG ||
organisationsEinheitResource.syncResult === AdminOrganisationsEinheitSyncResult.ORGANISATIONSEINHEIT_ID_NOT_UNIQUE organisationsEinheitResource.syncResult === AdminOrganisationsEinheitSyncResult.ORGANISATIONSEINHEIT_ID_NOT_UNIQUE
......
...@@ -10,7 +10,6 @@ import { ...@@ -10,7 +10,6 @@ import {
import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MatTooltipModule } from '@angular/material/tooltip'; import { MatTooltipModule } from '@angular/material/tooltip';
import { ActivatedRoute } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import { ResourceUri } from '@ngxp/rest';
import { ExclamationIconComponent, ListComponent, ListItemComponent } from '@ods/system'; import { ExclamationIconComponent, ListComponent, ListItemComponent } from '@ods/system';
import { getDataTestIdOf } from 'libs/tech-shared/test/data-test'; import { getDataTestIdOf } from 'libs/tech-shared/test/data-test';
import { MockModule } from 'ng-mocks'; import { MockModule } from 'ng-mocks';
...@@ -25,6 +24,7 @@ describe('OrganisationsEinheitListComponent', () => { ...@@ -25,6 +24,7 @@ describe('OrganisationsEinheitListComponent', () => {
const listItemSelector: string = getDataTestIdOf('organisations-einheit-list-item'); const listItemSelector: string = getDataTestIdOf('organisations-einheit-list-item');
const organisationsEinheitResource: AdminOrganisationsEinheitResource = createAdminOrganisationsEinheitResource(); const organisationsEinheitResource: AdminOrganisationsEinheitResource = createAdminOrganisationsEinheitResource();
organisationsEinheitResource.syncResult = AdminOrganisationsEinheitSyncResult.NOT_FOUND_IN_PVOG;
beforeEach(async () => { beforeEach(async () => {
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
...@@ -49,8 +49,6 @@ describe('OrganisationsEinheitListComponent', () => { ...@@ -49,8 +49,6 @@ describe('OrganisationsEinheitListComponent', () => {
describe('input', () => { describe('input', () => {
describe('organisationsEinheitResources', () => { describe('organisationsEinheitResources', () => {
organisationsEinheitResource.syncResult = AdminOrganisationsEinheitSyncResult.NOT_FOUND_IN_PVOG;
let listItemElement: HTMLElement; let listItemElement: HTMLElement;
let nameElement: Element; let nameElement: Element;
let idElement: Element; let idElement: Element;
...@@ -108,15 +106,6 @@ describe('OrganisationsEinheitListComponent', () => { ...@@ -108,15 +106,6 @@ describe('OrganisationsEinheitListComponent', () => {
expect(component.organisationsEinheitResources[2].isChild).toBeTruthy(); expect(component.organisationsEinheitResources[2].isChild).toBeTruthy();
}); });
}); });
describe('getEncodedSelfLink', () => {
it('should return encoded self link', () => {
const organisationsEinheitResource: AdminOrganisationsEinheitResource = createAdminOrganisationsEinheitResource();
const result: ResourceUri = component.getEncodedSelfLink(organisationsEinheitResource);
expect(result).toBeDefined();
});
});
}); });
describe('template', () => { describe('template', () => {
......
import { AdminOrganisationsEinheitResource, AdminOrganisationsEinheitSyncResult } from '@admin-client/admin-settings'; import { AdminOrganisationsEinheitResource, AdminOrganisationsEinheitSyncResult } from '@admin-client/admin-settings';
import { encodeUrlForEmbedding, toResourceUri } from '@alfa-client/tech-shared';
import { Component, Input } from '@angular/core'; import { Component, Input } from '@angular/core';
import { ResourceUri } from '@ngxp/rest';
import { OrganisationsEinheitLinkRel } from '../../organisations-einheit.linkrel'; import { OrganisationsEinheitLinkRel } from '../../organisations-einheit.linkrel';
@Component({ @Component({
...@@ -20,10 +18,8 @@ export class OrganisationsEinheitListComponent { ...@@ -20,10 +18,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: AdminOrganisationsEinheitResource) => {
this._organisationsEinheitResources.push(parent); this._organisationsEinheitResources.push(parent);
if (parent._embedded && Array.isArray(parent._embedded.childList)) { if (parent._embedded && Array.isArray(parent._embedded.childList)) {
...@@ -35,8 +31,6 @@ export class OrganisationsEinheitListComponent { ...@@ -35,8 +31,6 @@ export class OrganisationsEinheitListComponent {
}); });
} }
getEncodedSelfLink(organisationsEinheitResource: AdminOrganisationsEinheitResource): ResourceUri { public readonly AdminOrganisationsEinheitSyncResult = AdminOrganisationsEinheitSyncResult;
const resourceUri: ResourceUri = toResourceUri(organisationsEinheitResource, OrganisationsEinheitLinkRel.SELF); public readonly OrganisationsEinheitLinkRel = OrganisationsEinheitLinkRel;
return encodeUrlForEmbedding(resourceUri);
}
} }
...@@ -120,11 +120,11 @@ export abstract class ResourceService<B extends Resource, T extends Resource> { ...@@ -120,11 +120,11 @@ export abstract class ResourceService<B extends Resource, T extends Resource> {
} }
public save(toSave: unknown): Observable<StateResource<T>> { public save(toSave: unknown): Observable<StateResource<T>> {
return this.persist(this.doSave, toSave); return this.persist(this.doSave.bind(this), toSave);
} }
public patch(toPatch: unknown): Observable<StateResource<T>> { public patch(toPatch: unknown): Observable<StateResource<T>> {
return this.persist(this.doPatch, toPatch); return this.persist(this.doPatch.bind(this), toPatch);
} }
private persist( private persist(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment