diff --git a/alfa-client/libs/navigation-shared/src/lib/navigation.service.spec.ts b/alfa-client/libs/navigation-shared/src/lib/navigation.service.spec.ts index 2dfb53b8b701d62064bc186796bcb2ec4edfacb8..04f3545432eb35d5708831e03e7fb0587ca47248 100644 --- a/alfa-client/libs/navigation-shared/src/lib/navigation.service.spec.ts +++ b/alfa-client/libs/navigation-shared/src/lib/navigation.service.spec.ts @@ -78,10 +78,7 @@ describe('NavigationService', () => { service.navigateToVorgangList(); - expect(router.navigate).toHaveBeenCalledWith([ - NavigationService.ROOT_PATH, - NavigationService.URL_PARAM_ALLE, - ]); + expect(router.navigate).toHaveBeenCalledWith([NavigationService.ROOT_PATH, NavigationService.URL_PARAM_ALLE]); }); it('should navigate to meine with url containing "meine"', () => { @@ -89,10 +86,7 @@ describe('NavigationService', () => { service.navigateToVorgangList(); - expect(router.navigate).toHaveBeenCalledWith([ - NavigationService.ROOT_PATH, - NavigationService.URL_PARAM_MY_VORGAENGE, - ]); + expect(router.navigate).toHaveBeenCalledWith([NavigationService.ROOT_PATH, NavigationService.URL_PARAM_MY_VORGAENGE]); }); it('should navigate to all with url containing "alle"', () => { @@ -100,10 +94,7 @@ describe('NavigationService', () => { service.navigateToVorgangList(); - expect(router.navigate).toHaveBeenCalledWith([ - NavigationService.ROOT_PATH, - NavigationService.URL_PARAM_ALLE, - ]); + expect(router.navigate).toHaveBeenCalledWith([NavigationService.ROOT_PATH, NavigationService.URL_PARAM_ALLE]); }); it('should navigate to unassigned with url containing "unassigned"', () => { @@ -111,10 +102,7 @@ describe('NavigationService', () => { service.navigateToVorgangList(); - expect(router.navigate).toHaveBeenCalledWith([ - NavigationService.ROOT_PATH, - NavigationService.URL_PARAM_UNASSIGNED, - ]); + expect(router.navigate).toHaveBeenCalledWith([NavigationService.ROOT_PATH, NavigationService.URL_PARAM_UNASSIGNED]); }); }); @@ -243,6 +231,21 @@ describe('NavigationService', () => { }); }); + describe('navigate to postfach', () => { + it('should navigate to postfach', () => { + const linkUri: string = 'dummyUri'; + + service.navigateToPostfach(linkUri); + + expect(router.navigate).toHaveBeenCalledWith([ + NavigationService.ROOT_PATH, + NavigationService.URL_PARAM_POSTFACH, + linkUri, + NavigationService.URL_PARAM_POSTFACH, + ]); + }); + }); + describe('is postfach page', () => { it('should return true if "postfach" exists in url', () => { service.routeUrlSegment$.next(<any>[{ path: 'postfach' }]); diff --git a/alfa-client/libs/navigation-shared/src/lib/navigation.service.ts b/alfa-client/libs/navigation-shared/src/lib/navigation.service.ts index 7b1c65e93ef278fb0fd09c73a5fcb5403ab5ea36..bbed71d0f1ba1d099ea158c114108f7d0a87d8e1 100644 --- a/alfa-client/libs/navigation-shared/src/lib/navigation.service.ts +++ b/alfa-client/libs/navigation-shared/src/lib/navigation.service.ts @@ -21,22 +21,9 @@ * Die sprachspezifischen Genehmigungen und Beschränkungen * unter der Lizenz sind dem Lizenztext zu entnehmen. */ -import { - decodeUrlFromEmbedding, - isEmptyObject, - isNotNil, - isNotNull, - isNotUndefined, -} from '@alfa-client/tech-shared'; +import { decodeUrlFromEmbedding, isEmptyObject, isNotNil, isNotNull, isNotUndefined } from '@alfa-client/tech-shared'; import { Injectable } from '@angular/core'; -import { - ActivatedRoute, - NavigationEnd, - PRIMARY_OUTLET, - Params, - Router, - UrlSegment, -} from '@angular/router'; +import { ActivatedRoute, NavigationEnd, PRIMARY_OUTLET, Params, Router, UrlSegment } from '@angular/router'; import { ResourceUri } from '@ngxp/rest'; import { OAuthService } from 'angular-oauth2-oidc'; import { has, isNil, isUndefined } from 'lodash-es'; @@ -55,6 +42,7 @@ export class NavigationService { public static readonly URL_PARAM_MY_VORGAENGE: string = 'meine'; public static readonly URL_PARAM_MY_VORGANG: string = 'vorgang'; + public static readonly URL_PARAM_POSTFACH: string = 'postfach'; public static readonly URL_PARAM_ALLE: string = 'alle'; public static readonly URL_PARAM_SEARCH: string = 'search'; public static readonly URL_PARAM_UNASSIGNED: string = 'unassigned'; @@ -62,12 +50,10 @@ export class NavigationService { public readonly VORGANG_WITH_EINGANG_URL: string = 'vorgangWithEingangUrl'; static readonly ROOT_PATH: string = '/'; - static readonly VORGANG_BASE_PATH: string = - NavigationService.ROOT_PATH + NavigationService.URL_PARAM_MY_VORGANG + '/'; + static readonly VORGANG_BASE_PATH: string = NavigationService.ROOT_PATH + NavigationService.URL_PARAM_MY_VORGANG + '/'; public static readonly MEINE_VORGAENGE_PATH: string = NavigationService.ROOT_PATH + NavigationService.URL_PARAM_MY_VORGAENGE + '/'; - public static readonly ALLE_VORGAENGE_PATH: string = - NavigationService.ROOT_PATH + NavigationService.URL_PARAM_ALLE + '/'; + public static readonly ALLE_VORGAENGE_PATH: string = NavigationService.ROOT_PATH + NavigationService.URL_PARAM_ALLE + '/'; public static readonly UNASSIGNED_VORGAENGE_PATH: string = NavigationService.ROOT_PATH + NavigationService.URL_PARAM_UNASSIGNED + '/'; @@ -90,9 +76,7 @@ export class NavigationService { } private prefillRouterData(): void { - this.getLastFirstChild(this.activatedRoute.root).params.subscribe((params: Params) => - this.routeParameter$.next(params), - ); + this.getLastFirstChild(this.activatedRoute.root).params.subscribe((params: Params) => this.routeParameter$.next(params)); } private subscribeToRouterEvents(): void { @@ -170,10 +154,7 @@ export class NavigationService { } private isParamPresent(paramName: string): boolean { - return ( - isEmptyObject(this.routeParameter$.value) || - isUndefined(this.routeParameter$.value[paramName]) - ); + return isEmptyObject(this.routeParameter$.value) || isUndefined(this.routeParameter$.value[paramName]); } static isVorgangListPage(params: Params): boolean { @@ -207,9 +188,7 @@ export class NavigationService { getFilterPathSegment(): string { const firstPathSegment: string = this.router.url.split('/')[1]; - return this.isFilterPathSegment(firstPathSegment) ? firstPathSegment : ( - NavigationService.URL_PARAM_ALLE - ); + return this.isFilterPathSegment(firstPathSegment) ? firstPathSegment : NavigationService.URL_PARAM_ALLE; } isFilterPathSegment(pathSegment: string): boolean { @@ -225,10 +204,15 @@ export class NavigationService { } public navigateToVorgang(linkUri: ResourceUri): void { + this.router.navigate([NavigationService.ROOT_PATH, NavigationService.URL_PARAM_MY_VORGANG, linkUri]); + } + + public navigateToPostfach(linkUri: string): void { this.router.navigate([ NavigationService.ROOT_PATH, NavigationService.URL_PARAM_MY_VORGANG, linkUri, + NavigationService.URL_PARAM_POSTFACH, ]); } diff --git a/alfa-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/outgoing-mail/outgoing-mail.component.html b/alfa-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/outgoing-mail/outgoing-mail.component.html index a3d8233fccdc8cd9d12bf0a8bc3537284981e667..a68841eeddb6af5686cbe780c717eb93925ebe79 100644 --- a/alfa-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/outgoing-mail/outgoing-mail.component.html +++ b/alfa-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/outgoing-mail/outgoing-mail.component.html @@ -25,7 +25,7 @@ --> <a [ngClass]="{ error: postfachMail | hasLink: postfachNachrichtLinkRel.RESEND_POSTFACH_MAIL }" - [routerLink]="onPage ? null : 'postfach'" + (click)="navigateToPostfach()" data-test-class="outgoing-mail-routing" > <div class="mail-head"> diff --git a/alfa-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/outgoing-mail/outgoing-mail.component.spec.ts b/alfa-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/outgoing-mail/outgoing-mail.component.spec.ts index 1c5549014cf02065fcac328e8e38dbd3505f9f98..9e7f0160b17a65ff76f6781c04e3630da52062f4 100644 --- a/alfa-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/outgoing-mail/outgoing-mail.component.spec.ts +++ b/alfa-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/outgoing-mail/outgoing-mail.component.spec.ts @@ -21,20 +21,21 @@ * Die sprachspezifischen Genehmigungen und Beschränkungen * unter der Lizenz sind dem Lizenztext zu entnehmen. */ -import { ON_PAGE, PostfachMailLinkRel, PostfachMailResource } from '@alfa-client/postfach-shared'; +import { ON_PAGE, PostfachMailLinkRel, PostfachMailResource, PostfachService } from '@alfa-client/postfach-shared'; import { createStateResource, HasLinkPipe, StateResource } from '@alfa-client/tech-shared'; import { + dispatchEventFromFixture, existsAsHtmlElement, - getDebugElementFromFixtureByCss, getElementFromFixture, getMockComponent, + Mock, + mock, notExistsAsHtmlElement, } from '@alfa-client/test-utils'; import { UserProfileInPostfachMailContainerComponent } from '@alfa-client/user-profile'; import { VorgangWithEingangResource } from '@alfa-client/vorgang-shared'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatIcon } from '@angular/material/icon'; -import { provideRouter, RouterLinkWithHref, RouterModule } from '@angular/router'; import { getDataTestClassOf, getDataTestIdOf } from 'libs/tech-shared/test/data-test'; import { createVorgangWithEingangResource } from 'libs/vorgang-shared/test/vorgang'; import { MockComponent } from 'ng-mocks'; @@ -48,6 +49,8 @@ describe('OutgoingMailComponent', () => { let component: OutgoingMailComponent; let fixture: ComponentFixture<OutgoingMailComponent>; + let postfachService: Mock<PostfachService>; + const attachmentIcon: string = getDataTestIdOf('postfach-nachricht-attachment-icon'); const postfachEditButton: string = getDataTestIdOf('postfach-nachricht-edit-button-container'); const postfachOutgoingNachrichtDate: string = getDataTestIdOf('postfach-outgoing-nachricht-date'); @@ -55,6 +58,7 @@ describe('OutgoingMailComponent', () => { const routing: string = getDataTestClassOf('outgoing-mail-routing'); beforeEach(async () => { + postfachService = mock(PostfachService); await TestBed.configureTestingModule({ declarations: [ OutgoingMailComponent, @@ -66,13 +70,15 @@ describe('OutgoingMailComponent', () => { MockComponent(PostfachMailDateComponent), MockComponent(PostfachNachrichtEditButtonContainerComponent), ], - imports: [RouterModule], providers: [ - provideRouter([]), { provide: ON_PAGE, useValue: undefined, }, + { + provide: PostfachService, + useValue: postfachService, + }, ], }).compileComponents(); }); @@ -88,125 +94,125 @@ describe('OutgoingMailComponent', () => { expect(component).toBeTruthy(); }); - describe('attachments', () => { - it('should only show attachment icon on detail', () => { - component.onPage = false; - component.postfachMail = createPostfachMailResource([PostfachMailLinkRel.ATTACHMENTS]); - fixture.detectChanges(); + describe('template', () => { + describe('attachments', () => { + it('should only show attachment icon on detail', () => { + component.onPage = false; + component.postfachMail = createPostfachMailResource([PostfachMailLinkRel.ATTACHMENTS]); + fixture.detectChanges(); - const element = getElementFromFixture(fixture, attachmentIcon); + const element = getElementFromFixture(fixture, attachmentIcon); - expect(element).toBeInstanceOf(HTMLElement); + expect(element).toBeInstanceOf(HTMLElement); + }); }); - }); - describe('edit button container component', () => { - const postfachNachricht: PostfachMailResource = createPostfachMailResource([PostfachMailLinkRel.EDIT]); + describe('edit button container component', () => { + const postfachNachricht: PostfachMailResource = createPostfachMailResource([PostfachMailLinkRel.EDIT]); - describe('on existing edit link', () => { - beforeEach(() => { - component.postfachMail = postfachNachricht; + describe('on existing edit link', () => { + beforeEach(() => { + component.postfachMail = postfachNachricht; + }); + + it('should be visbile', () => { + fixture.detectChanges(); + + existsAsHtmlElement(fixture, postfachEditButton); + }); + + it('should be called with postfachNachricht', () => { + fixture.detectChanges(); + + const editButtonComponent: PostfachNachrichtEditButtonContainerComponent = getMockComponent( + fixture, + PostfachNachrichtEditButtonContainerComponent, + ); + expect(editButtonComponent.postfachNachricht).toBe(postfachNachricht); + }); + + it('should be called with vorgangStateResource', () => { + const vorgangStateResource: StateResource<VorgangWithEingangResource> = createStateResource( + createVorgangWithEingangResource(), + ); + component.vorgangStateResource = vorgangStateResource; + + fixture.detectChanges(); + + const editButtonComponent: PostfachNachrichtEditButtonContainerComponent = getMockComponent( + fixture, + PostfachNachrichtEditButtonContainerComponent, + ); + expect(editButtonComponent.vorgangStateResource).toBe(vorgangStateResource); + }); }); - it('should be visbile', () => { - fixture.detectChanges(); + describe('on missing edit link', () => { + const postfachNachricht: PostfachMailResource = createPostfachMailResource(); - existsAsHtmlElement(fixture, postfachEditButton); - }); + beforeEach(() => { + component.postfachMail = postfachNachricht; + }); - it('should be called with postfachNachricht', () => { - fixture.detectChanges(); + it('should not be visible', () => { + fixture.detectChanges(); - const editButtonComponent: PostfachNachrichtEditButtonContainerComponent = getMockComponent( - fixture, - PostfachNachrichtEditButtonContainerComponent, - ); - expect(editButtonComponent.postfachNachricht).toBe(postfachNachricht); + notExistsAsHtmlElement(fixture, postfachEditButton); + }); }); - it('should be called with vorgangStateResource', () => { - const vorgangStateResource: StateResource<VorgangWithEingangResource> = createStateResource( - createVorgangWithEingangResource(), - ); - component.vorgangStateResource = vorgangStateResource; + describe('in detail context', () => { + const postfachNachricht: PostfachMailResource = createPostfachMailResource([PostfachMailLinkRel.EDIT]); - fixture.detectChanges(); + beforeEach(() => { + component.onPage = true; + component.postfachMail = postfachNachricht; + }); + + it('should not be visible', () => { + fixture.detectChanges(); - const editButtonComponent: PostfachNachrichtEditButtonContainerComponent = getMockComponent( - fixture, - PostfachNachrichtEditButtonContainerComponent, - ); - expect(editButtonComponent.vorgangStateResource).toBe(vorgangStateResource); + notExistsAsHtmlElement(fixture, postfachEditButton); + }); }); }); - describe('on missing edit link', () => { - const postfachNachricht: PostfachMailResource = createPostfachMailResource(); + describe('date', () => { + it('should be visible if exists', () => { + component.postfachMail = createPostfachMailResource(); - beforeEach(() => { - component.postfachMail = postfachNachricht; - }); - - it('should not be visible', () => { fixture.detectChanges(); - notExistsAsHtmlElement(fixture, postfachEditButton); + existsAsHtmlElement(fixture, postfachOutgoingNachrichtDate); }); - }); - describe('in detail context', () => { - const postfachNachricht: PostfachMailResource = createPostfachMailResource([PostfachMailLinkRel.EDIT]); - - beforeEach(() => { - component.onPage = true; - component.postfachMail = postfachNachricht; - }); + it('should not be visible if not exists', () => { + component.postfachMail = { ...createPostfachMailResource(), sentAt: null }; - it('should not be visible', () => { fixture.detectChanges(); - notExistsAsHtmlElement(fixture, postfachEditButton); + notExistsAsHtmlElement(fixture, postfachOutgoingNachrichtDate); }); }); - }); - - describe('date', () => { - it('should be visible if exists', () => { - component.postfachMail = createPostfachMailResource(); - - fixture.detectChanges(); - - existsAsHtmlElement(fixture, postfachOutgoingNachrichtDate); - }); - it('should not be visible if not exists', () => { - component.postfachMail = { ...createPostfachMailResource(), sentAt: null }; + describe('link', () => { + it('should navigate to postfach click', () => { + component.navigateToPostfach = jest.fn(); - fixture.detectChanges(); + dispatchEventFromFixture(fixture, routing, 'click'); - notExistsAsHtmlElement(fixture, postfachOutgoingNachrichtDate); + expect(component.navigateToPostfach).toHaveBeenCalled(); + }); }); }); - describe('routing should be', () => { - it('null on page site', () => { - component.onPage = false; - - fixture.detectChanges(); - - const routerElement = getDebugElementFromFixtureByCss(fixture, routing); - const routerLinkInstance: RouterLinkWithHref = routerElement.injector.get(RouterLinkWithHref); - expect((<any>routerLinkInstance).routerLinkInput[0]).toEqual('postfach'); - }); + describe('component', () => { + describe('navigate to postfach', () => { + it('should call postfachService', () => { + component.navigateToPostfach(); - it('"postfach" on detail site', () => { - component.onPage = true; - - fixture.detectChanges(); - - const routerElement = getDebugElementFromFixtureByCss(fixture, routing); - const routerLinkInstance: RouterLinkWithHref = routerElement.injector.get(RouterLinkWithHref); - expect((<any>routerLinkInstance).routerLinkInput).toBeNull(); + expect(postfachService.navigateToPostfach).toHaveBeenCalled(); + }); }); }); }); diff --git a/alfa-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/outgoing-mail/outgoing-mail.component.ts b/alfa-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/outgoing-mail/outgoing-mail.component.ts index 36a1250f9a9eadfc80bca7917a70cae655bd46a9..61e9be8687e78514359cba117bd99291df075a21 100644 --- a/alfa-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/outgoing-mail/outgoing-mail.component.ts +++ b/alfa-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/outgoing-mail/outgoing-mail.component.ts @@ -21,10 +21,10 @@ * Die sprachspezifischen Genehmigungen und Beschränkungen * unter der Lizenz sind dem Lizenztext zu entnehmen. */ -import { ON_PAGE, PostfachMailLinkRel, PostfachMailResource } from '@alfa-client/postfach-shared'; +import { ON_PAGE, PostfachMailLinkRel, PostfachMailResource, PostfachService } from '@alfa-client/postfach-shared'; import { StateResource } from '@alfa-client/tech-shared'; import { VorgangWithEingangResource } from '@alfa-client/vorgang-shared'; -import { Component, Inject, Input } from '@angular/core'; +import { Component, inject, Inject, Input } from '@angular/core'; @Component({ selector: 'alfa-outgoing-mail', @@ -32,10 +32,16 @@ import { Component, Inject, Input } from '@angular/core'; styleUrls: ['./outgoing-mail.component.scss'], }) export class OutgoingMailComponent { + public readonly postfachService = inject(PostfachService); + @Input() postfachMail: PostfachMailResource; @Input() vorgangStateResource: StateResource<VorgangWithEingangResource>; readonly postfachNachrichtLinkRel = PostfachMailLinkRel; constructor(@Inject(ON_PAGE) public onPage: boolean) {} + + public navigateToPostfach(): void { + this.postfachService.navigateToPostfach(); + } } diff --git a/alfa-client/libs/postfach/src/lib/postfach-page-container/postfach-page/mail-unread-button/mail-unread-button-link-container.component.html b/alfa-client/libs/postfach/src/lib/postfach-page-container/postfach-page/mail-unread-button/mail-unread-button-link-container.component.html index a836bbda9567e3066f30ca4d1280df8787b389a6..617abb23dfe032aa974dd451cce361768a82a5a5 100644 --- a/alfa-client/libs/postfach/src/lib/postfach-page-container/postfach-page/mail-unread-button/mail-unread-button-link-container.component.html +++ b/alfa-client/libs/postfach/src/lib/postfach-page-container/postfach-page/mail-unread-button/mail-unread-button-link-container.component.html @@ -1,30 +1,26 @@ @if (postfachMailListStateResource.resource | hasLink: PostfachMailListLinkRel.SET_HAS_NEW_POSTFACH_NACHRICHT) { @if (showAsIconButton) { - <a [routerLink]="'../'" tabindex="-1"> - <ods-button - (clickEmitter)="markMailAsUnread()" - [tooltip]="'Nachrichten als ungelesen markieren'" - tooltipAriaType="aria-labelledby" - variant="ghost" - size="fit" - dataTestId="mail-unread-icon-button-link" - data-test-id="mail-unread-icon-button-link-host" - > - <ods-mail-unread-icon icon /> - </ods-button> - </a> + <ods-button + (clickEmitter)="markMailAsUnread()" + [tooltip]="'Nachrichten als ungelesen markieren'" + tooltipAriaType="aria-labelledby" + variant="ghost" + size="fit" + dataTestId="mail-unread-icon-button-link" + data-test-id="mail-unread-icon-button-link-host" + > + <ods-mail-unread-icon icon /> + </ods-button> } @else { - <a [routerLink]="'../'" tabindex="-1"> - <ods-button - (clickEmitter)="markMailAsUnread()" - [tooltip]="'Nachrichten als ungelesen markieren'" - text="Als ungelesen markieren" - variant="outline" - dataTestId="mail-unread-button-link" - data-test-id="mail-unread-button-link-host" - > - <ods-mail-unread-icon icon class="fill-primary"/> - </ods-button> - </a> + <ods-button + (clickEmitter)="markMailAsUnread()" + [tooltip]="'Nachrichten als ungelesen markieren'" + text="Als ungelesen markieren" + variant="outline" + dataTestId="mail-unread-button-link" + data-test-id="mail-unread-button-link-host" + > + <ods-mail-unread-icon icon class="fill-primary" /> + </ods-button> } } diff --git a/alfa-client/libs/postfach/src/lib/postfach-page-container/postfach-page/mail-unread-button/mail-unread-button-link-container.component.spec.ts b/alfa-client/libs/postfach/src/lib/postfach-page-container/postfach-page/mail-unread-button/mail-unread-button-link-container.component.spec.ts index 37d5c2efd99a21a8c73ec7e87ea336d367b12268..2cdf6d0ed466f56b746675cf951907010991f36b 100644 --- a/alfa-client/libs/postfach/src/lib/postfach-page-container/postfach-page/mail-unread-button/mail-unread-button-link-container.component.spec.ts +++ b/alfa-client/libs/postfach/src/lib/postfach-page-container/postfach-page/mail-unread-button/mail-unread-button-link-container.component.spec.ts @@ -9,7 +9,6 @@ import { notExistsAsHtmlElement, } from '@alfa-client/test-utils'; import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { RouterModule } from '@angular/router'; import { ButtonComponent, MailUnreadIconComponent } from '@ods/system'; import { MockComponent } from 'ng-mocks'; import { createPostfachMailListResource } from '../../../../../../postfach-shared/test/postfach'; @@ -33,7 +32,7 @@ describe('MailUnreadButtonLinkContainerComponent', () => { postfachService = mock(PostfachService); await TestBed.configureTestingModule({ - imports: [MailUnreadButtonLinkContainerComponent, HasLinkPipe, RouterModule.forRoot([])], + imports: [MailUnreadButtonLinkContainerComponent, HasLinkPipe], declarations: [MockComponent(ButtonComponent), MockComponent(MailUnreadIconComponent)], providers: [ { diff --git a/alfa-client/libs/postfach/src/lib/postfach-page-container/postfach-page/mail-unread-button/mail-unread-button-link-container.component.ts b/alfa-client/libs/postfach/src/lib/postfach-page-container/postfach-page/mail-unread-button/mail-unread-button-link-container.component.ts index 678e0beb0db2f43ff86c5a57d8f30b8cae0dd370..375e450d81f979eab07cbdf1a3c9f93d820addc0 100644 --- a/alfa-client/libs/postfach/src/lib/postfach-page-container/postfach-page/mail-unread-button/mail-unread-button-link-container.component.ts +++ b/alfa-client/libs/postfach/src/lib/postfach-page-container/postfach-page/mail-unread-button/mail-unread-button-link-container.component.ts @@ -2,14 +2,13 @@ import { CommandResource } from '@alfa-client/command-shared'; import { PostfachMailListLinkRel, PostfachMailListResource, PostfachService } from '@alfa-client/postfach-shared'; import { createEmptyStateResource, HasLinkPipe, StateResource } from '@alfa-client/tech-shared'; import { Component, inject, Input } from '@angular/core'; -import { RouterLink } from '@angular/router'; import { ButtonComponent, MailUnreadIconComponent, TooltipDirective } from '@ods/system'; import { Observable, of } from 'rxjs'; @Component({ selector: 'alfa-mail-unread-button-link-container', standalone: true, - imports: [HasLinkPipe, MailUnreadIconComponent, TooltipDirective, ButtonComponent, RouterLink], + imports: [HasLinkPipe, MailUnreadIconComponent, TooltipDirective, ButtonComponent], templateUrl: './mail-unread-button-link-container.component.html', }) export class MailUnreadButtonLinkContainerComponent { diff --git a/alfa-client/libs/vorgang-shared/src/lib/vorgang-navigation.util.ts b/alfa-client/libs/vorgang-shared/src/lib/vorgang-navigation.util.ts index 053d9eb1c84a2b396d86b45fbf8908b4790f76a9..31e236a31c13420adf23b3b391b2ef6a3a09e3ab 100644 --- a/alfa-client/libs/vorgang-shared/src/lib/vorgang-navigation.util.ts +++ b/alfa-client/libs/vorgang-shared/src/lib/vorgang-navigation.util.ts @@ -231,6 +231,10 @@ function hasVorgangParam(routeData: RouteData): boolean { return isNotNull(routeData.queryParameter[VORGANG_WITH_EINGANG_ROUTE_PARAM]); } +export function getVorgangParam(routeData: RouteData): string { + return routeData.queryParameter[VORGANG_WITH_EINGANG_ROUTE_PARAM]; +} + function hasSegements(routeData: RouteData, numberOfSegements: number): boolean { return routeData.urlSegments.length === numberOfSegements; }