diff --git a/goofy-client/libs/postfach-message-shared/src/lib/postfach-message.model.ts b/goofy-client/libs/postfach-message-shared/src/lib/postfach-message.model.ts index d130bb22e269c0e8357cb9d8e2bea73685846fd4..a5d15f0cd846e4b93f4ffd26c283bf23533ad735 100644 --- a/goofy-client/libs/postfach-message-shared/src/lib/postfach-message.model.ts +++ b/goofy-client/libs/postfach-message-shared/src/lib/postfach-message.model.ts @@ -3,6 +3,7 @@ import { CreateCommand } from '@goofy-client/command-shared'; export interface PostfachMessage { receiver: string; subject: string; + message: string; reply: PostfachMessageReply; } @@ -19,4 +20,4 @@ export enum PostfachOrder { export interface CreateSendPostfacheMessageCommand extends CreateCommand { order: PostfachOrder; postfachMessage: PostfachMessage -} \ No newline at end of file +} diff --git a/goofy-client/libs/postfach-message-shared/test/postfach-message.ts b/goofy-client/libs/postfach-message-shared/test/postfach-message.ts index d32b17a91cc9d9c50bd0d846b249106318df2dbf..6707f0ec96a1887855898993bec6bb89439f44ff 100644 --- a/goofy-client/libs/postfach-message-shared/test/postfach-message.ts +++ b/goofy-client/libs/postfach-message-shared/test/postfach-message.ts @@ -4,7 +4,8 @@ import { PostfachMessage, PostfachMessageReply } from '../src/lib/postfach-messa export function createPostfachMessage(): PostfachMessage { return { receiver: faker.internet.email(), - subject: faker.random.words(10), + subject: faker.random.words(3), + message: faker.random.words(30), reply: PostfachMessageReply.POSSIBLE } -} \ No newline at end of file +} diff --git a/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list-container.component.html b/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list-container.component.html index a1ae110bca432bab464ecbcc1a1debba4c775b30..64ffafd8c3420ea35f96a222aa046dfc069d8a9a 100644 --- a/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list-container.component.html +++ b/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list-container.component.html @@ -1,4 +1,6 @@ -<goofy-client-expansion-panel headline="Nachrichten"></goofy-client-expansion-panel> +<goofy-client-expansion-panel headline="Nachrichten"> + <!--goofy-client-postfach-message-list class="list" [messageBlockList]="[[1,2,3], '2', [5,6,3,2], 4]"></goofy-client-postfach-message-list--> +</goofy-client-expansion-panel> <goofy-client-new-postfach-message-icon-button-container *ngIf="vorgang | hasLink: vorgangHeaderLinkRel.SEND_POSTFACH_MESSAGE" [vorgang]="vorgang"> </goofy-client-new-postfach-message-icon-button-container> diff --git a/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list-container.component.spec.ts b/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list-container.component.spec.ts index bbcacedae1ab915bcd7691423ea0aef8b130e905..53741aac95c2c54faed1d49246e0f21b64a01f9d 100644 --- a/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list-container.component.spec.ts +++ b/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list-container.component.spec.ts @@ -4,6 +4,7 @@ import { MockComponent } from 'ng-mocks'; import { ExpansionPanelComponent } from '@goofy-client/ui'; import { NewPostfachMessageIconButtonContainerComponent } from '@goofy-client/postfach-message'; import { HasLinkPipe } from '@goofy-client/tech-shared'; +import { PostfachMessageListComponent } from './postfach-message-list/postfach-message-list.component'; describe('PostfachMessageListContainerComponent', () => { let component: PostfachMessageListContainerComponent; @@ -15,6 +16,7 @@ describe('PostfachMessageListContainerComponent', () => { PostfachMessageListContainerComponent, HasLinkPipe, MockComponent(ExpansionPanelComponent), + MockComponent(PostfachMessageListComponent), MockComponent(NewPostfachMessageIconButtonContainerComponent) ] }) diff --git a/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list/postfach-message-block/postfach-message-block.component.html b/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list/postfach-message-block/postfach-message-block.component.html new file mode 100644 index 0000000000000000000000000000000000000000..3baf6a5bcae3b502181ca246a9a79c7e3bee8b79 --- /dev/null +++ b/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list/postfach-message-block/postfach-message-block.component.html @@ -0,0 +1 @@ +<goofy-client-postfach-message *ngFor="let message of messageBlock"></goofy-client-postfach-message> diff --git a/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list/postfach-message-block/postfach-message-block.component.scss b/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list/postfach-message-block/postfach-message-block.component.scss new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list/postfach-message-block/postfach-message-block.component.spec.ts b/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list/postfach-message-block/postfach-message-block.component.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..ab1fb3a53dd62f191ddb811a4e69d8882818a48b --- /dev/null +++ b/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list/postfach-message-block/postfach-message-block.component.spec.ts @@ -0,0 +1,30 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PostfachMessageBlockComponent } from './postfach-message-block.component'; +import { MockComponent } from 'ng-mocks'; +import { PostfachMessageComponent } from './postfach-message/postfach-message.component'; + +describe('PostfachMessageBlockComponent', () => { + let component: PostfachMessageBlockComponent; + let fixture: ComponentFixture<PostfachMessageBlockComponent>; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ + PostfachMessageBlockComponent, + MockComponent(PostfachMessageComponent) + ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(PostfachMessageBlockComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list/postfach-message-block/postfach-message-block.component.ts b/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list/postfach-message-block/postfach-message-block.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..7660130ce62817d2e0134e46bfb430a8b8fb66fe --- /dev/null +++ b/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list/postfach-message-block/postfach-message-block.component.ts @@ -0,0 +1,11 @@ +import { Component, Input, OnInit } from '@angular/core'; + +@Component({ + selector: 'goofy-client-postfach-message-block', + templateUrl: './postfach-message-block.component.html', + styleUrls: ['./postfach-message-block.component.scss'] +}) +export class PostfachMessageBlockComponent { + + @Input() messageBlock: []; +} diff --git a/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list/postfach-message-block/postfach-message/postfach-message.component.html b/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list/postfach-message-block/postfach-message/postfach-message.component.html new file mode 100644 index 0000000000000000000000000000000000000000..36235efa3243b334f9ff177409f2b82e2304ec09 --- /dev/null +++ b/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list/postfach-message-block/postfach-message/postfach-message.component.html @@ -0,0 +1,8 @@ +<div class="line"> + <div class="receiver">Max Mustermann</div> +</div> +<div class="line"> + <div class="subject">Fehlende Unterlagen</div> + <div class="date">28.2.2022</div> +</div> +<div class="message">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</div> diff --git a/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list/postfach-message-block/postfach-message/postfach-message.component.scss b/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list/postfach-message-block/postfach-message/postfach-message.component.scss new file mode 100644 index 0000000000000000000000000000000000000000..32cc417950808717d573b88c62ab7ccca0400e23 --- /dev/null +++ b/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list/postfach-message-block/postfach-message/postfach-message.component.scss @@ -0,0 +1,30 @@ +:host { + display: flex; + flex-direction: column; + margin-bottom: 16px; + + .line { + display: flex; + justify-content: space-between; + } + + .message { + display: block; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + .receiver { + font-weight: 500; + } + + .date { + font-size: 12px; + color: rgba(#000, 0.4); + } + + .message { + color: rgba(#000, 0.4); + } +} diff --git a/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list/postfach-message-block/postfach-message/postfach-message.component.spec.ts b/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list/postfach-message-block/postfach-message/postfach-message.component.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..3cd8e03b4b59306275bb7d6209337d245ca23a5b --- /dev/null +++ b/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list/postfach-message-block/postfach-message/postfach-message.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PostfachMessageComponent } from './postfach-message.component'; + +describe('PostfachMessageComponent', () => { + let component: PostfachMessageComponent; + let fixture: ComponentFixture<PostfachMessageComponent>; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ PostfachMessageComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(PostfachMessageComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list/postfach-message-block/postfach-message/postfach-message.component.ts b/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list/postfach-message-block/postfach-message/postfach-message.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..5b8bbd0721bcfc69a442749703bd2fdd032c88f1 --- /dev/null +++ b/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list/postfach-message-block/postfach-message/postfach-message.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'goofy-client-postfach-message', + templateUrl: './postfach-message.component.html', + styleUrls: ['./postfach-message.component.scss'] +}) +export class PostfachMessageComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list/postfach-message-list.component.html b/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list/postfach-message-list.component.html new file mode 100644 index 0000000000000000000000000000000000000000..18bb58de31c70a9a8b1bcda66bb41e1f354061e7 --- /dev/null +++ b/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list/postfach-message-list.component.html @@ -0,0 +1,3 @@ +<goofy-client-postfach-message-block *ngFor="let messageBlock of messageBlockList" + [messageBlock]="messageBlock"> +</goofy-client-postfach-message-block> diff --git a/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list/postfach-message-list.component.scss b/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list/postfach-message-list.component.scss new file mode 100644 index 0000000000000000000000000000000000000000..ecec51ece14cff09cb74a8a13ecb665d7a56b364 --- /dev/null +++ b/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list/postfach-message-list.component.scss @@ -0,0 +1,4 @@ +:host { + margin-right: 8px; + display: block; +} diff --git a/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list/postfach-message-list.component.spec.ts b/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list/postfach-message-list.component.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..358b283d813ff66892b095b5d48f748532c46b0b --- /dev/null +++ b/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list/postfach-message-list.component.spec.ts @@ -0,0 +1,30 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PostfachMessageListComponent } from './postfach-message-list.component'; +import { MockComponent } from 'ng-mocks'; +import { PostfachMessageBlockComponent } from './postfach-message-block/postfach-message-block.component'; + +describe('PostfachMessageListComponent', () => { + let component: PostfachMessageListComponent; + let fixture: ComponentFixture<PostfachMessageListComponent>; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ + PostfachMessageListComponent, + MockComponent(PostfachMessageBlockComponent) + ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(PostfachMessageListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list/postfach-message-list.component.ts b/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list/postfach-message-list.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..ec2e3a26dc615652bd2daa4499e7da525788f17b --- /dev/null +++ b/goofy-client/libs/postfach-message/src/lib/postfach-message-list-container/postfach-message-list/postfach-message-list.component.ts @@ -0,0 +1,12 @@ +import { Component, Input, OnInit } from '@angular/core'; + +@Component({ + selector: 'goofy-client-postfach-message-list', + templateUrl: './postfach-message-list.component.html', + styleUrls: ['./postfach-message-list.component.scss'] +}) +export class PostfachMessageListComponent { + + @Input() messageBlockList: []; + +} diff --git a/goofy-client/libs/postfach-message/src/lib/postfach-message.module.ts b/goofy-client/libs/postfach-message/src/lib/postfach-message.module.ts index 68908792d7d9c67fe0a8114030cff571be03106a..2d312ee58d728c351cbfce047e776f29b4b0c4c0 100644 --- a/goofy-client/libs/postfach-message/src/lib/postfach-message.module.ts +++ b/goofy-client/libs/postfach-message/src/lib/postfach-message.module.ts @@ -5,6 +5,9 @@ import { UiModule } from '@goofy-client/ui'; import { NewPostfachMessageIconButtonContainerComponent } from './new-postfach-message-icon-button-container/new-postfach-message-icon-button-container.component'; import { NewPostfachMessageFormComponent } from './new-postfach-message-form/new-postfach-message-form.component'; import { PostfachMessageSharedModule } from '@goofy-client/postfach-message-shared'; +import { PostfachMessageListComponent } from './postfach-message-list-container/postfach-message-list/postfach-message-list.component'; +import { PostfachMessageComponent } from './postfach-message-list-container/postfach-message-list/postfach-message-block/postfach-message/postfach-message.component'; +import { PostfachMessageBlockComponent } from './postfach-message-list-container/postfach-message-list/postfach-message-block/postfach-message-block.component'; @NgModule({ imports: [ @@ -15,7 +18,10 @@ import { PostfachMessageSharedModule } from '@goofy-client/postfach-message-shar declarations: [ PostfachMessageListContainerComponent, NewPostfachMessageIconButtonContainerComponent, - NewPostfachMessageFormComponent + NewPostfachMessageFormComponent, + PostfachMessageListComponent, + PostfachMessageComponent, + PostfachMessageBlockComponent ], exports: [ PostfachMessageListContainerComponent,