From 5658ee03c3daad55588bb4c5b6b2396377b6f201 Mon Sep 17 00:00:00 2001 From: develite98 Date: Wed, 8 Nov 2023 11:52:03 +0700 Subject: [PATCH] feat(): update task swimlane --- .../task-create/task-create.component.html | 2 +- .../task-parent-card.component.html | 8 +++++- .../task-parent-card.component.scss | 6 +++++ .../task-parent-card.component.ts | 27 ++++++++++++++++--- .../task-manage/task-manage.component.html | 20 +++++++------- .../task-manage/task-manage.component.scss | 6 ++--- 6 files changed, 50 insertions(+), 19 deletions(-) diff --git a/libs/mix-share/src/modules/task-manage/components/task-create/task-create.component.html b/libs/mix-share/src/modules/task-manage/components/task-create/task-create.component.html index b05513cb..194b02bb 100644 --- a/libs/mix-share/src/modules/task-manage/components/task-create/task-create.component.html +++ b/libs/mix-share/src/modules/task-manage/components/task-create/task-create.component.html @@ -1,5 +1,5 @@
-
Create Task
+
Add New {{ parentTask ? 'Task' : 'Swimlane' }}
Task Type
diff --git a/libs/mix-share/src/modules/task-manage/components/task-parent-card/task-parent-card.component.html b/libs/mix-share/src/modules/task-manage/components/task-parent-card/task-parent-card.component.html index c8d3d309..75a26e3f 100644 --- a/libs/mix-share/src/modules/task-manage/components/task-parent-card/task-parent-card.component.html +++ b/libs/mix-share/src/modules/task-manage/components/task-parent-card/task-parent-card.component.html @@ -3,7 +3,13 @@ >expand_more - + + + {{ task.title }} diff --git a/libs/mix-share/src/modules/task-manage/components/task-parent-card/task-parent-card.component.scss b/libs/mix-share/src/modules/task-manage/components/task-parent-card/task-parent-card.component.scss index 7515e756..d0beff2a 100644 --- a/libs/mix-share/src/modules/task-manage/components/task-parent-card/task-parent-card.component.scss +++ b/libs/mix-share/src/modules/task-manage/components/task-parent-card/task-parent-card.component.scss @@ -11,6 +11,12 @@ transform: rotate(-90deg); } + &__title { + max-width: 240px; + overflow: hidden; + text-overflow: ellipsis; + } + &.--open { color: var(--blue-02, #008aa8); border-bottom: unset; diff --git a/libs/mix-share/src/modules/task-manage/components/task-parent-card/task-parent-card.component.ts b/libs/mix-share/src/modules/task-manage/components/task-parent-card/task-parent-card.component.ts index 070f63ff..29bc3cb7 100644 --- a/libs/mix-share/src/modules/task-manage/components/task-parent-card/task-parent-card.component.ts +++ b/libs/mix-share/src/modules/task-manage/components/task-parent-card/task-parent-card.component.ts @@ -1,14 +1,24 @@ import { CommonModule } from '@angular/common'; -import { Component, EventEmitter, Input, Output, inject } from '@angular/core'; -import { MixTaskNew } from '@mixcore/lib/model'; +import { + Component, + EventEmitter, + Input, + Output, + inject, + signal, +} from '@angular/core'; +import { MixTaskNew, UserListVm } from '@mixcore/lib/model'; +import { UserAvatarComponent } from '@mixcore/share/components'; +import { UserInfoStore } from '@mixcore/share/stores'; import { MixButtonComponent } from '@mixcore/ui/button'; import { DialogService } from '@ngneat/dialog'; +import { take } from 'rxjs'; import { TaskCreateComponent } from '../task-create/task-create.component'; @Component({ selector: 'mix-task-parent-card', standalone: true, - imports: [CommonModule, MixButtonComponent], + imports: [CommonModule, MixButtonComponent, UserAvatarComponent], templateUrl: './task-parent-card.component.html', styleUrls: ['./task-parent-card.component.scss'], }) @@ -17,6 +27,8 @@ export class TaskParentCardComponent { @Input() public open = true; @Output() public expandClick = new EventEmitter(); public dialog = inject(DialogService); + public userInfoStore = inject(UserInfoStore); + public userInfo = signal(undefined); public addTask() { this.dialog.open(TaskCreateComponent, { @@ -26,4 +38,13 @@ export class TaskParentCardComponent { }, }); } + + public ngOnInit() { + if (!this.task.reporter) return; + + this.userInfoStore + .getUserById(this.task.reporter) + .pipe(take(1)) + .subscribe((info) => this.userInfo.set(info)); + } } diff --git a/libs/mix-share/src/modules/task-manage/task-manage.component.html b/libs/mix-share/src/modules/task-manage/task-manage.component.html index ce1e6134..19c79251 100644 --- a/libs/mix-share/src/modules/task-manage/task-manage.component.html +++ b/libs/mix-share/src/modules/task-manage/task-manage.component.html @@ -13,21 +13,21 @@ -
-
- {{ TaskStatusDisplay[status] }} -
-
-
+
+
+ {{ TaskStatusDisplay[status] }} +
+
+