From 812f4e018cc0822a617294032862b2b09616e8d3 Mon Sep 17 00:00:00 2001 From: tkubica-edu Date: Wed, 6 Nov 2024 14:05:43 +0100 Subject: [PATCH] feat: move buttons to add a swimlane between the swimlanes in order to determine the position more easy --- .../add-swimlane-border-button.component.html | 17 +++++++ .../add-swimlane-border-button.component.scss | 45 +++++++++++++++++++ .../add-swimlane-border-button.component.ts | 26 +++++++++++ .../template/template.component.html | 36 +++++++-------- .../template/template.component.scss | 7 +-- .../wlo-search/template/template.component.ts | 16 +++---- 6 files changed, 114 insertions(+), 33 deletions(-) create mode 100644 src/app/wlo-search/template/add-swimlane-button/add-swimlane-border-button.component.html create mode 100644 src/app/wlo-search/template/add-swimlane-button/add-swimlane-border-button.component.scss create mode 100644 src/app/wlo-search/template/add-swimlane-button/add-swimlane-border-button.component.ts diff --git a/src/app/wlo-search/template/add-swimlane-button/add-swimlane-border-button.component.html b/src/app/wlo-search/template/add-swimlane-button/add-swimlane-border-button.component.html new file mode 100644 index 00000000..dcd5538d --- /dev/null +++ b/src/app/wlo-search/template/add-swimlane-button/add-swimlane-border-button.component.html @@ -0,0 +1,17 @@ +
+
+ +
+ + + +
diff --git a/src/app/wlo-search/template/add-swimlane-button/add-swimlane-border-button.component.scss b/src/app/wlo-search/template/add-swimlane-button/add-swimlane-border-button.component.scss new file mode 100644 index 00000000..888851d8 --- /dev/null +++ b/src/app/wlo-search/template/add-swimlane-button/add-swimlane-border-button.component.scss @@ -0,0 +1,45 @@ +:host { + --position-left: 24px; +} + +.add-swimlane-container { + position: absolute; + top: calc(-30px / 2); + left: var(--position-left); + width: calc(100% - 2 * var(--position-left)); + z-index: 1000; + display: flex; + align-items: center; + + &.position-bottom { + top: unset; + bottom: calc(-30px / 2); + } + + .container-border { + border-bottom: 2px solid rgba(0, 0, 0, 0.7); + border-radius: 1px; + width: calc(50% - var(--position-left)); + } + + .add-swimlane-btn { + margin-left: 8px; + margin-right: 8px; + padding: 0; + width: 30px; + height: 30px; + border: 2px solid rgba(0, 0, 0, 0.7); + border-radius: 6px; + display: flex; + align-items: center; + justify-content: center; + color: rgba(0, 0, 0, 0.7); + + i.mat-icon, + i.mat-mdc-icon { + font-size: 22px; + width: 22px; + height: 22px; + } + } +} diff --git a/src/app/wlo-search/template/add-swimlane-button/add-swimlane-border-button.component.ts b/src/app/wlo-search/template/add-swimlane-button/add-swimlane-border-button.component.ts new file mode 100644 index 00000000..bc2ccf9f --- /dev/null +++ b/src/app/wlo-search/template/add-swimlane-button/add-swimlane-border-button.component.ts @@ -0,0 +1,26 @@ +import { Component, EventEmitter, Input, Output } from '@angular/core'; +import { EduSharingUiCommonModule } from 'ngx-edu-sharing-ui'; +import { SharedModule } from '../../shared/shared.module'; +import { swimlaneTypeOptions } from '../custom-definitions'; +import { SelectOption } from '../swimlane/swimlane-settings-dialog/select-option'; + +@Component({ + selector: 'app-add-swimlane-border-button', + standalone: true, + imports: [EduSharingUiCommonModule, SharedModule], + templateUrl: './add-swimlane-border-button.component.html', + styleUrl: './add-swimlane-border-button.component.scss', +}) +export class AddSwimlaneBorderButtonComponent { + @Input() position: string = 'top'; + @Input() requestInProgress: boolean = false; + @Output() addSwimlaneTriggered: EventEmitter = new EventEmitter(); + + protected readonly swimlaneTypeOptions: SelectOption[] = swimlaneTypeOptions.concat([ + { value: 'spacer', viewValue: 'Trennlinie' }, + ]); + + addSwimlane(type: string): void { + this.addSwimlaneTriggered.emit(type); + } +} diff --git a/src/app/wlo-search/template/template.component.html b/src/app/wlo-search/template/template.component.html index e4c01d75..61ad9b8d 100644 --- a/src/app/wlo-search/template/template.component.html +++ b/src/app/wlo-search/template/template.component.html @@ -41,27 +41,6 @@ > edit - - - - @@ -156,7 +135,22 @@

Inhalte von {{ topic() }}

swimlane.backgroundColor ? swimlane.backgroundColor : '#f4f4f4' " > + + + + + +