diff --git a/goofy-client/apps/goofy/src/assets/test-dnd.pdf b/goofy-client/apps/goofy/src/assets/test-dnd.pdf deleted file mode 100644 index 2fe2471277d09eb4453b12c3933bfb204f3db10a..0000000000000000000000000000000000000000 Binary files a/goofy-client/apps/goofy/src/assets/test-dnd.pdf and /dev/null differ diff --git a/goofy-client/apps/goofy/src/assets/test-dnd.png b/goofy-client/apps/goofy/src/assets/test-dnd.png deleted file mode 100644 index f0061fe14e741cd80e64cc8dd672d4a9c1ff9b44..0000000000000000000000000000000000000000 Binary files a/goofy-client/apps/goofy/src/assets/test-dnd.png and /dev/null differ diff --git a/goofy-client/apps/goofy/src/assets/test-dnd.webp b/goofy-client/apps/goofy/src/assets/test-dnd.webp deleted file mode 100644 index 2d2dcaeecc4e04c5b76c7cc39dfbede22987aca1..0000000000000000000000000000000000000000 Binary files a/goofy-client/apps/goofy/src/assets/test-dnd.webp and /dev/null differ diff --git a/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/incomming-mail/incomming-mail.component.html b/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/incomming-mail/incomming-mail.component.html index 1db9ff24bb8003fe74d6e8a5f458b40a51cbff68..a6c3701191a3f3b55a67f4d03b3a656e50f209b2 100644 --- a/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/incomming-mail/incomming-mail.component.html +++ b/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/incomming-mail/incomming-mail.component.html @@ -6,6 +6,12 @@ </div> <goofy-client-postfach-mail-date class="date" [postfachMail]="postfachMail"></goofy-client-postfach-mail-date> </div> - - <div class="message overflow" data-test-id="mail-text">{{ postfachMail.mailBody }}</div> + <div class="second-row"> + <div class="message overflow" data-test-id="mail-text">{{ postfachMail.mailBody }}</div> + <mat-icon *ngIf="(postfachMail | hasLink: postfachNachrichtLinkRel.ATTACHMENTS) && !onPage" data-test-id="postfach-nachricht-attachment-icon">attach_file</mat-icon> + </div> </a> + +<goofy-client-postfach-nachricht-attachments *ngIf="(postfachMail | hasLink: postfachNachrichtLinkRel.ATTACHMENTS) && onPage" data-test-id="postfach-nachricht-attachments-container" + [postfachNachricht]="postfachMail"> +</goofy-client-postfach-nachricht-attachments> diff --git a/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/incomming-mail/incomming-mail.component.scss b/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/incomming-mail/incomming-mail.component.scss index 77749c04e48037ab2035389291852d9cf1ad9771..fe32b075acd347b415941761233e0d52c57b89fa 100644 --- a/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/incomming-mail/incomming-mail.component.scss +++ b/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/incomming-mail/incomming-mail.component.scss @@ -37,3 +37,10 @@ a { justify-content: space-between; width: 100%; } + +.second-row { + display: flex; + white-space: nowrap; + justify-content: space-between; + width: 100%; +} diff --git a/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/incomming-mail/incomming-mail.component.spec.ts b/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/incomming-mail/incomming-mail.component.spec.ts index 21ca37044dd1b8b2afc1ba677b6a4f03abbd1300..1eebf3cbe0c9648873a0c1abb241160151b470fe 100644 --- a/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/incomming-mail/incomming-mail.component.spec.ts +++ b/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/incomming-mail/incomming-mail.component.spec.ts @@ -2,11 +2,14 @@ import { registerLocaleData } from '@angular/common'; import localeDe from '@angular/common/locales/de'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatIcon } from '@angular/material/icon'; -import { FormatDateWithTimePipe } from '@goofy-client/tech-shared'; +import { FormatDateWithTimePipe, HasLinkPipe } from '@goofy-client/tech-shared'; import { MockComponent } from 'ng-mocks'; import { createPostfachMailResource } from '../../../../../../../postfach-shared/test/postfach'; import { PostfachMailDateComponent } from '../postfach-mail-date/postfach-mail-date.component'; import { IncommingMailComponent } from './incomming-mail.component'; +import { getElementFromFixture } from '@goofy-client/test-utils'; +import { ON_PAGE, PostfachMailLinkRel } from '@goofy-client/postfach-shared'; +import { PostfachNachrichtAttachmentsComponent } from '../postfach-nachricht-attachments/postfach-nachricht-attachments.component'; registerLocaleData(localeDe); @@ -14,13 +17,25 @@ describe('IncommingMailComponent', () => { let component: IncommingMailComponent; let fixture: ComponentFixture<IncommingMailComponent>; + const attachmentContainer: string = '[data-test-id="postfach-nachricht-attachments-container"]'; + const attachmentIcon: string = '[data-test-id="postfach-nachricht-attachment-icon"]'; + beforeEach(async () => { await TestBed.configureTestingModule({ declarations: [ IncommingMailComponent, MatIcon, FormatDateWithTimePipe, - MockComponent(PostfachMailDateComponent) + MockComponent(PostfachMailDateComponent), + HasLinkPipe, + MatIcon, + MockComponent(PostfachNachrichtAttachmentsComponent) + ], + providers: [ + { + provide: ON_PAGE, + useValue: undefined + } ] }).compileComponents(); }); @@ -35,4 +50,37 @@ describe('IncommingMailComponent', () => { it('should create', () => { expect(component).toBeTruthy(); }); + + describe('attachments', () => { + + it('should not show attachments loaded if exists', () => { + component.onPage = true; + component.postfachMail = createPostfachMailResource(); + fixture.detectChanges(); + + const element = getElementFromFixture(fixture, attachmentContainer); + + expect(element).not.toBeInstanceOf(HTMLElement); + }) + + it('should be loaded if exists', () => { + component.onPage = true; + component.postfachMail = createPostfachMailResource([PostfachMailLinkRel.ATTACHMENTS]); + fixture.detectChanges(); + + const element = getElementFromFixture(fixture, attachmentContainer); + + expect(element).toBeInstanceOf(HTMLElement); + }) + + it('should only show attachment icon on detail', () => { + component.onPage = false; + component.postfachMail = createPostfachMailResource([PostfachMailLinkRel.ATTACHMENTS]); + fixture.detectChanges(); + + const element = getElementFromFixture(fixture, attachmentIcon); + + expect(element).toBeInstanceOf(HTMLElement); + }) + }) }); diff --git a/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/incomming-mail/incomming-mail.component.ts b/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/incomming-mail/incomming-mail.component.ts index e2e1b1699423195d6bb7792cde92acc90b3e5399..69604e1167f483eb960fb1c7a5f1a98840c36cdc 100644 --- a/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/incomming-mail/incomming-mail.component.ts +++ b/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/incomming-mail/incomming-mail.component.ts @@ -1,5 +1,5 @@ -import { Component, Input } from '@angular/core'; -import { PostfachMailResource } from '@goofy-client/postfach-shared'; +import { Component, Inject, Input } from '@angular/core'; +import { ON_PAGE, PostfachMailLinkRel, PostfachMailResource } from '@goofy-client/postfach-shared'; @Component({ selector: 'goofy-client-incomming-mail', @@ -8,5 +8,9 @@ import { PostfachMailResource } from '@goofy-client/postfach-shared'; }) export class IncommingMailComponent { + readonly postfachNachrichtLinkRel = PostfachMailLinkRel; + + constructor(@Inject(ON_PAGE) public onPage: boolean) {} + @Input() postfachMail: PostfachMailResource; } 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 ce2f6172db9932a00808f6313e48f0eafb3e44cd..a9f29481e327e7bfa33245e95305edcc4ef1855c 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,11 +1,2 @@ <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; else icon"> - <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> -<ng-template #icon> - <mat-icon data-test-id="postfach-nachricht-attachment-icon">attach_file</mat-icon> -</ng-template> \ 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 710a2dc668fd66c74b2dc24c66e6ce23371e2462..d7ceda062f0e23c3d629333eb9bfd332da98f67b 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 @@ -14,24 +14,12 @@ describe('PostfachMailComponent', () => { let component: PostfachMailComponent; let fixture: ComponentFixture<PostfachMailComponent>; - const attachmentContainer: string = '[data-test-id="postfach-nachricht-attachments-container"]'; - const attachmentIcon: string = '[data-test-id="postfach-nachricht-attachment-icon"]'; - beforeEach(async () => { await TestBed.configureTestingModule({ declarations: [ PostfachMailComponent, - HasLinkPipe, - MatIcon, MockComponent(IncommingMailComponent), - MockComponent(OutgoingMailComponent), - MockComponent(PostfachNachrichtAttachmentsComponent) - ], - providers: [ - { - provide: ON_PAGE, - useValue: undefined - } + MockComponent(OutgoingMailComponent) ] }).compileComponents(); }); @@ -46,36 +34,4 @@ describe('PostfachMailComponent', () => { it('should create', () => { expect(component).toBeTruthy(); }); - - describe('attachments', () => { - - it('should not show attachments loaded if exists', () => { - component.onPage = true; - component.postfachMail = createPostfachMailResource(); - fixture.detectChanges(); - - const element = getElementFromFixture(fixture, attachmentContainer); - - expect(element).not.toBeInstanceOf(HTMLElement); - }) - - it('should be loaded if exists', () => { - component.onPage = true; - component.postfachMail = createPostfachMailResource([PostfachMailLinkRel.ATTACHMENTS]); - fixture.detectChanges(); - - const element = getElementFromFixture(fixture, attachmentContainer); - - expect(element).toBeInstanceOf(HTMLElement); - }) - - it('should only show attachment icon on detail', () => { - component.onPage = false; - fixture.detectChanges(); - - const element = getElementFromFixture(fixture, attachmentIcon); - - expect(element).toBeInstanceOf(HTMLElement); - }) - }) -}); \ 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.ts b/goofy-client/libs/postfach/src/lib/postfach-mail-list-container/postfach-mail-list/postfach-mail/postfach-mail.component.ts index c8746cb78c73db2cbbe6a8e2ee5e4535a9a2357e..8cce991e997c49ad95faafa9485ae6aceb650a27 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 @@ -10,11 +10,9 @@ export class PostfachMailComponent { @Input() postfachMail: PostfachMailResource; - readonly postfachNachrichtLinkRel = PostfachMailLinkRel; - - constructor(@Inject(ON_PAGE) public onPage: boolean) { } + constructor() { } get isIncomingMail(): boolean { return isIncomingMail(this.postfachMail); } -} \ No newline at end of file +} diff --git a/goofy-client/libs/ui/src/lib/ui/dialog/dialog.service.ts b/goofy-client/libs/ui/src/lib/ui/dialog/dialog.service.ts index 5071770ad8926b51612ce7e728efadacbc23006b..50d208e98ce2f81c2373323f6af66c6057c5ce10 100644 --- a/goofy-client/libs/ui/src/lib/ui/dialog/dialog.service.ts +++ b/goofy-client/libs/ui/src/lib/ui/dialog/dialog.service.ts @@ -6,20 +6,22 @@ import { FixedDialogComponent } from "@goofy-client/ui"; import { ConnectionTimeoutRetryDialogComponent } from "../http-error-dialog/connection-timeout-retry-dialog/connection-timeout-retry-dialog.component"; import { ConnectionTimeoutRetryFailDialogComponent } from "../http-error-dialog/connection-timeout-retry-fail-dialog/connection-timeout-retry-fail-dialog.component"; import { InternalServerErrorDialogComponent } from "../notification/internal-server-error-dialog/internal-server-error-dialog.component"; +import { NoopScrollStrategy } from '@angular/cdk/overlay'; @Injectable({ providedIn: 'root' }) export class DialogService { - readonly FIXED_DIALOG_CONFIG = { + readonly FIXED_DIALOG_CONFIG: MatDialogConfig = { width: '520px', position: { bottom: '0', right: '30px' }, hasBackdrop: false, panelClass: 'fixed-dialog', disableClose: true, - autoFocus: false + autoFocus: false, + scrollStrategy: new NoopScrollStrategy() }; - readonly SERVER_ERROR_DIALOG_CONFIG = { + readonly SERVER_ERROR_DIALOG_CONFIG: MatDialogConfig = { width: '440px', disableClose: true, panelClass: 'notification-dialog' diff --git a/goofy-client/libs/user-profile/src/lib/assign-user-profile-button-container/assign-user-profile-button-container.component.ts b/goofy-client/libs/user-profile/src/lib/assign-user-profile-button-container/assign-user-profile-button-container.component.ts index da76b6a9f67d4227b4a1c2b731f4edc5e1d75e48..07b29acfd523eab7aecae83a304e96959f5362de 100644 --- a/goofy-client/libs/user-profile/src/lib/assign-user-profile-button-container/assign-user-profile-button-container.component.ts +++ b/goofy-client/libs/user-profile/src/lib/assign-user-profile-button-container/assign-user-profile-button-container.component.ts @@ -16,12 +16,7 @@ export class AssignUserProfileButtonContainerComponent { constructor(private userProfileService: UserProfileService) { } showUserProfileSearch(): void { - this.scrollToTop(); // TODO bessere loesung finden: Zum Element scrollen!? - this.userProfileService.showUserProfileSearch(); - } - - scrollToTop(): void { - const elem = document.getElementsByClassName('l-scroll-area')[0]; - if (elem) elem.scrollTop = 0; + document.documentElement.scrollTop = 0; + this.userProfileService.showUserProfileSearch() } }