diff --git a/goofy-client/libs/postfach-shared/src/index.ts b/goofy-client/libs/postfach-shared/src/index.ts index 1771d50b4d7027501598da6995c19ac851703926..68b5a581b61c86db9e2d6138b5eb1c6d6af407bd 100644 --- a/goofy-client/libs/postfach-shared/src/index.ts +++ b/goofy-client/libs/postfach-shared/src/index.ts @@ -3,4 +3,5 @@ export * from './lib/postfach.facade'; export * from './lib/postfach.linkrel'; export * from './lib/postfach.model'; export * from './lib/postfach.service'; +export * from './lib/postfach.tokens'; export * from './lib/postfach.util'; diff --git a/goofy-client/libs/postfach-shared/src/lib/postfach.tokens.ts b/goofy-client/libs/postfach-shared/src/lib/postfach.tokens.ts new file mode 100644 index 0000000000000000000000000000000000000000..e25d44638e4b1037eca83a52d4ba12c20fa543d2 --- /dev/null +++ b/goofy-client/libs/postfach-shared/src/lib/postfach.tokens.ts @@ -0,0 +1,3 @@ +import { InjectionToken } from '@angular/core'; + +export const ON_PAGE = new InjectionToken<boolean>('ON_PAGE'); \ No newline at end of file diff --git a/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list-container.component.ts b/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list-container.component.ts index 261a1609d528654b53c7f07f5ecb52d2d3e7003c..bb58842880c0bd6b67de29423b21a2484a6fff43 100644 --- a/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list-container.component.ts +++ b/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list-container.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnChanges } from '@angular/core'; -import { PostfachMailListResource, PostfachMailResource, PostfachService } from '@goofy-client/postfach-shared'; +import { ON_PAGE, PostfachMailListResource, PostfachService } from '@goofy-client/postfach-shared'; import { StateResource } from '@goofy-client/tech-shared'; import { VorgangWithEingangResource } from '@goofy-client/vorgang-shared'; import { isNull } from 'lodash-es'; @@ -8,7 +8,8 @@ import { Observable } from 'rxjs'; @Component({ selector: 'goofy-client-postfach-mail-list-container', templateUrl: './postfach-mail-list-container.component.html', - styleUrls: ['./postfach-mail-list-container.component.scss'] + styleUrls: ['./postfach-mail-list-container.component.scss'], + providers: [{ provide: ON_PAGE, useValue: false }] }) export class PostfachMailListContainerComponent implements OnChanges { diff --git a/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/postfach-mail.component.html b/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/postfach-mail.component.html index c4a3e458ec0dbb6fa348c124b28587f073568322..7ce109e37c4a657ca237db2bad059662781cf0d9 100644 --- a/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/postfach-mail.component.html +++ b/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/postfach-mail.component.html @@ -1,6 +1,8 @@ <goofy-client-incomming-mail *ngIf="isIncomingMail" [postfachMail]="postfachMail"></goofy-client-incomming-mail> <goofy-client-outgoing-mail *ngIf="!isIncomingMail" [postfachMail]="postfachMail"></goofy-client-outgoing-mail> -<goofy-client-postfach-nachricht-attachments *ngIf="postfachMail | hasLink: postfachNachrichtLinkRel.ATTACHMENTS" data-test-id="postfach-nachricht-attachments-container" - [postfachNachricht]="postfachMail"> -</goofy-client-postfach-nachricht-attachments> \ No newline at end of file +<ng-container *ngIf="onPage"> + <goofy-client-postfach-nachricht-attachments *ngIf="postfachMail | hasLink: postfachNachrichtLinkRel.ATTACHMENTS" data-test-id="postfach-nachricht-attachments-container" + [postfachNachricht]="postfachMail"> + </goofy-client-postfach-nachricht-attachments> +</ng-container> \ No newline at end of file diff --git a/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/postfach-mail.component.spec.ts b/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/postfach-mail.component.spec.ts index 42f95adf689442904b6b9a1164f6451c2d30dc85..4581cbc0174a86c837ceb44011acdaf496ba1cfe 100644 --- a/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/postfach-mail.component.spec.ts +++ b/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/postfach-mail.component.spec.ts @@ -1,5 +1,5 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { PostfachMailLinkRel } from '@goofy-client/postfach-shared'; +import { ON_PAGE, PostfachMailLinkRel } from '@goofy-client/postfach-shared'; import { HasLinkPipe } from '@goofy-client/tech-shared'; import { getElementFromFixture } from '@goofy-client/test-utils'; import { createPostfachMailResource } from 'libs/postfach-shared/test/postfach'; @@ -23,6 +23,12 @@ describe('PostfachMailComponent', () => { MockComponent(IncommingMailComponent), MockComponent(OutgoingMailComponent), MockComponent(PostfachNachrichtAttachmentsComponent) + ], + providers: [ + { + provide: ON_PAGE, + useValue: true + } ] }).compileComponents(); }); diff --git a/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/postfach-mail.component.ts b/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/postfach-mail.component.ts index eb1a68b3d0ae60228d1455107b26d790bac0b54a..c8746cb78c73db2cbbe6a8e2ee5e4535a9a2357e 100644 --- a/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/postfach-mail.component.ts +++ b/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/postfach-mail.component.ts @@ -1,5 +1,5 @@ -import { Component, Input } from '@angular/core'; -import { isIncomingMail, PostfachMailLinkRel, PostfachMailResource } from '@goofy-client/postfach-shared'; +import { Component, Inject, Input } from '@angular/core'; +import { isIncomingMail, ON_PAGE, PostfachMailLinkRel, PostfachMailResource } from '@goofy-client/postfach-shared'; @Component({ selector: 'goofy-client-postfach-mail', @@ -12,6 +12,8 @@ export class PostfachMailComponent { readonly postfachNachrichtLinkRel = PostfachMailLinkRel; + constructor(@Inject(ON_PAGE) public onPage: boolean) { } + get isIncomingMail(): boolean { return isIncomingMail(this.postfachMail); } diff --git a/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/postfach-nachricht-attachments/postfach-nachricht-attachments.component.html b/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/postfach-nachricht-attachments/postfach-nachricht-attachments.component.html index 75ca2304cdc4600ea7103dbcfc06941b958c6897..bb1c5a6c42977f513eb080eeb43ed578646a0631 100644 --- a/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/postfach-nachricht-attachments/postfach-nachricht-attachments.component.html +++ b/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/postfach-nachricht-attachments/postfach-nachricht-attachments.component.html @@ -6,4 +6,4 @@ </goofy-client-ozg-file-container> </div> </goofy-client-spinner> -</ng-container> +</ng-container> \ No newline at end of file diff --git a/goofy-client/libs/postfach/src/lib/postfach-page-container/postfach-page-container.component.ts b/goofy-client/libs/postfach/src/lib/postfach-page-container/postfach-page-container.component.ts index a78652d5519e3705c34e4a5dc810ad77b44b9d10..65ba0830c4dad67108953376c16d0f688559e9ed 100644 --- a/goofy-client/libs/postfach/src/lib/postfach-page-container/postfach-page-container.component.ts +++ b/goofy-client/libs/postfach/src/lib/postfach-page-container/postfach-page-container.component.ts @@ -1,12 +1,14 @@ import { Component, OnInit } from '@angular/core'; -import { PostfachMailListResource, PostfachService } from '@goofy-client/postfach-shared'; +import { ON_PAGE, PostfachMailListResource, PostfachService } from '@goofy-client/postfach-shared'; import { StateResource } from '@goofy-client/tech-shared'; import { Observable } from 'rxjs'; @Component({ selector: 'goofy-client-postfach-page-container', templateUrl: './postfach-page-container.component.html', - styleUrls: ['./postfach-page-container.component.scss'] + styleUrls: ['./postfach-page-container.component.scss'], + providers: [{ provide: ON_PAGE, useValue: true } + ] }) export class PostfachPageContainerComponent implements OnInit { diff --git a/goofy-client/libs/postfach/src/lib/postfach.module.ts b/goofy-client/libs/postfach/src/lib/postfach.module.ts index e026b01fdeb2a36f160500f7a3c93cc2f5e4f9f1..ba6f00774c115999fa1b744b280d4033027854a3 100644 --- a/goofy-client/libs/postfach/src/lib/postfach.module.ts +++ b/goofy-client/libs/postfach/src/lib/postfach.module.ts @@ -2,7 +2,7 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; import { OzgFileModule } from '@goofy-client/ozg-file'; -import { PostfachSharedModule } from '@goofy-client/postfach-shared'; +import { ON_PAGE, PostfachSharedModule } from '@goofy-client/postfach-shared'; import { UiModule } from '@goofy-client/ui'; import { UserProfileModule } from '@goofy-client/user-profile'; import { VorgangSharedModule } from '@goofy-client/vorgang-shared'; @@ -61,6 +61,12 @@ const routes: Routes = [ PostfachMailListContainerComponent, PostfachMailButtonContainerComponent, PostfachMailFormComponent + ], + providers: [ + { + provide: ON_PAGE, + useValue: undefined + } ] }) export class PostfachModule { }