Skip to content
Snippets Groups Projects
Commit 83c6f2ba authored by OZGCloud's avatar OZGCloud
Browse files

Merge pull request 'OZG-6719 OZG-7046 Fix wrong routerLink property' (#807)...

Merge pull request 'OZG-6719 OZG-7046 Fix wrong routerLink property' (#807) from OZG-6719-bugfix into master

Reviewed-on: https://git.ozg-sh.de/ozgcloud-app/alfa/pulls/807


Reviewed-by: default avatarOZGCloud <ozgcloud@mgm-tp.com>
parents 99f6de34 1fea8ef4
Branches
Tags
No related merge requests found
<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)" [path]="getEncodedSelfLink(organisationsEinheitResource)"
[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
......
<h1 class="heading-1">Benutzer & Rollen</h1> <h1 class="heading-1">Benutzer & Rollen</h1>
<ods-button-with-spinner text="Benutzer hinzufügen" class="py-8" dataTestId="add-user-button" /> <ods-button-with-spinner text="Benutzer hinzufügen" class="py-8" dataTestId="add-user-button" />
<ods-list *ngIf="users$ | async as users"> <ods-list *ngIf="users$ | async as users">
<ods-list-item *ngFor="let user of users.resource" [routerLink]="user.username"> <ods-list-item *ngFor="let user of users.resource" [path]="user.username">
<div class="flex-1 basis-1/2"> <div class="flex-1 basis-1/2">
<div class="mb-2 flex flex-wrap items-center gap-3"> <div class="mb-2 flex flex-wrap items-center gap-3">
<h3 class="text-md font-semibold">{{ user | toUserName }}</h3> <h3 class="text-md font-semibold">{{ user | toUserName }}</h3>
......
...@@ -27,8 +27,8 @@ describe('ListItemComponent', () => { ...@@ -27,8 +27,8 @@ describe('ListItemComponent', () => {
describe('input', () => { describe('input', () => {
describe('routerLink', () => { describe('routerLink', () => {
it('should set href attribute', () => { it('should set href attribute', () => {
component.routerLink = faker.system.filePath(); component.path = faker.system.filePath();
const resultingLink: string = 'http://localhost' + component.routerLink; const resultingLink: string = 'http://localhost' + component.path;
const linkElement: HTMLLinkElement = getElementFromFixture(fixture, getDataTestClassOf('list-item-link')); const linkElement: HTMLLinkElement = getElementFromFixture(fixture, getDataTestClassOf('list-item-link'));
fixture.detectChanges(); fixture.detectChanges();
......
...@@ -8,7 +8,7 @@ import { RouterLink } from '@angular/router'; ...@@ -8,7 +8,7 @@ import { RouterLink } from '@angular/router';
imports: [CommonModule, RouterLink], imports: [CommonModule, RouterLink],
template: `<li> template: `<li>
<a <a
[routerLink]="routerLink" [routerLink]="path"
data-test-class="list-item-link" data-test-class="list-item-link"
class="flex flex-col items-start justify-between gap-6 border-primary-600/50 px-6 py-4 hover:bg-background-150 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus lg:flex-row" class="flex flex-col items-start justify-between gap-6 border-primary-600/50 px-6 py-4 hover:bg-background-150 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus lg:flex-row"
><ng-content ><ng-content
...@@ -17,5 +17,5 @@ import { RouterLink } from '@angular/router'; ...@@ -17,5 +17,5 @@ import { RouterLink } from '@angular/router';
styles: [':host { @apply block w-full }'], styles: [':host { @apply block w-full }'],
}) })
export class ListItemComponent { export class ListItemComponent {
@Input() routerLink: string; @Input() path: string;
} }
...@@ -34,9 +34,9 @@ export const Default: Story = { ...@@ -34,9 +34,9 @@ export const Default: Story = {
render: () => ({ render: () => ({
template: ` template: `
<ods-list> <ods-list>
<ods-list-item routerLink="/pfad/1">List Item 1</ods-list-item> <ods-list-item path="/pfad/1">List Item 1</ods-list-item>
<ods-list-item routerLink="/pfad/2">List Item 2</ods-list-item> <ods-list-item path="/pfad/2">List Item 2</ods-list-item>
<ods-list-item routerLink="/pfad/3">List Item 3</ods-list-item> <ods-list-item path="/pfad/3">List Item 3</ods-list-item>
</ods-list>`, </ods-list>`,
}), }),
}; };
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment