Skip to content
Snippets Groups Projects
Commit 35f1901c authored by OZGCloud's avatar OZGCloud
Browse files

OZG-1194 hide attachments in vorgang detail

parent d4cb7f3b
No related branches found
No related tags found
No related merge requests found
Showing
with 35 additions and 12 deletions
......@@ -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';
import { InjectionToken } from '@angular/core';
export const ON_PAGE = new InjectionToken<boolean>('ON_PAGE');
\ No newline at end of file
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 {
......
<goofy-client-incomming-mail *ngIf="isIncomingMail" [postfachMail]="postfachMail"></goofy-client-incomming-mail>
<goofy-client-outgoing-mail *ngIf="!isIncomingMail" [postfachMail]="postfachMail"></goofy-client-outgoing-mail>
<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
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();
});
......
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);
}
......
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 {
......
......@@ -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 { }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment