-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(workflow): Move story to other workflow
- Loading branch information
Showing
17 changed files
with
337 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
...project/story-detail/components/story-detail-workflow/story-detail-workflow.component.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
This Source Code Form is subject to the terms of the Mozilla Public | ||
License, v. 2.0. If a copy of the MPL was not distributed with this | ||
file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
Copyright (c) 2023-present Kaleidos INC | ||
*/ | ||
|
||
@import url("tools/typography.css"); | ||
@import url("shared/option-list.css"); | ||
|
||
:host { | ||
display: block; | ||
} | ||
|
||
.workflow-selector-wrapper { | ||
inline-size: 245px; | ||
} | ||
|
||
.workflow-list-header { | ||
@mixin font-small; | ||
|
||
color: var(--color-gray100); | ||
padding-block: var(--spacing-4) var(--spacing-8); | ||
padding-inline: var(--spacing-4); | ||
text-transform: uppercase; | ||
} | ||
|
||
.separator { | ||
@mixin separator; | ||
|
||
margin-inline: 0; | ||
} | ||
|
||
.workflow-btn { | ||
@mixin font-inline; | ||
|
||
align-items: center; | ||
color: var(--color-gray90); | ||
display: flex; | ||
gap: var(--spacing-8); | ||
justify-content: flex-start; | ||
} | ||
|
||
.workflow-icon { | ||
color: var(--color-gray40); | ||
} | ||
|
||
.workflow-name { | ||
@mixin ellipsis; | ||
|
||
&:hover { | ||
background: var(--color-gray20); | ||
color: var(--color-secondary80); | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
...roject/story-detail/components/story-detail-workflow/story-detail-workflow.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<!-- | ||
This Source Code Form is subject to the terms of the Mozilla Public | ||
License, v. 2.0. If a copy of the MPL was not distributed with this | ||
file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
Copyright (c) 2023-present Kaleidos INC | ||
--> | ||
|
||
<ng-container *transloco="let t"> | ||
<tg-ui-breadcrumb | ||
class="story-breadcrumb" | ||
[collapsable]="true" | ||
[crumbs]="[t('kanban.workflow'), story.workflow.name]"> | ||
<tui-hosted-dropdown | ||
*ngIf="canEdit" | ||
data-slot="workflow-action" | ||
class="status-options-menu" | ||
tuiDropdownAlign="left" | ||
[content]="workflowListDropdown" | ||
[(open)]="openWorkflowList"> | ||
<button | ||
aria-haspopup="true" | ||
[attr.aria-expanded]="openWorkflowList" | ||
data-slot="workflow-action" | ||
[attr.aria-label]="'move story'" | ||
icon="change" | ||
appearance="tertiary" | ||
class="move-story-to-workflow-button" | ||
tuiIconButton | ||
[pseudoActive]="openWorkflowList || null" | ||
type="button"></button> | ||
</tui-hosted-dropdown> | ||
<ng-template #workflowListDropdown> | ||
<div class="workflow-selector-wrapper"> | ||
<tui-data-list> | ||
<div class="workflow-list-header"> | ||
{{ t('kanban.move_to_workflow') }} | ||
</div> | ||
<hr class="separator" /> | ||
<tui-opt-group> | ||
<button | ||
*ngFor=" | ||
let workflow of filteredWorkflows; | ||
trackBy: trackByWorkflowId | ||
" | ||
class="workflow-btn" | ||
tuiOption | ||
type="button" | ||
(click)="moveToWorkflow(workflow)"> | ||
<tui-svg | ||
src="kanban" | ||
class="workflow-icon"></tui-svg> | ||
<span class="workflow-name"> | ||
{{ workflow.name }} | ||
</span> | ||
</button> | ||
</tui-opt-group> | ||
</tui-data-list> | ||
</div> | ||
</ng-template> | ||
</tg-ui-breadcrumb> | ||
</ng-container> |
81 changes: 81 additions & 0 deletions
81
.../project/story-detail/components/story-detail-workflow/story-detail-workflow.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/** | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
* | ||
* Copyright (c) 2023-present Kaleidos INC | ||
*/ | ||
|
||
import { | ||
ChangeDetectionStrategy, | ||
Component, | ||
EventEmitter, | ||
Input, | ||
OnChanges, | ||
Output, | ||
ViewChild, | ||
} from '@angular/core'; | ||
|
||
import { CommonModule } from '@angular/common'; | ||
import { TranslocoDirective } from '@ngneat/transloco'; | ||
import { | ||
TuiButtonModule, | ||
TuiDataListModule, | ||
TuiHostedDropdownComponent, | ||
TuiHostedDropdownModule, | ||
TuiSvgModule, | ||
} from '@taiga-ui/core'; | ||
import { StoryDetail, Workflow } from '@taiga/data'; | ||
import { BreadcrumbComponent } from '@taiga/ui/breadcrumb/breadcrumb.component'; | ||
|
||
@Component({ | ||
selector: 'tg-story-detail-workflow', | ||
templateUrl: './story-detail-workflow.component.html', | ||
styleUrls: ['./story-detail-workflow.component.css'], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
standalone: true, | ||
imports: [ | ||
CommonModule, | ||
TranslocoDirective, | ||
BreadcrumbComponent, | ||
TuiButtonModule, | ||
TuiHostedDropdownModule, | ||
TuiDataListModule, | ||
TuiSvgModule, | ||
], | ||
}) | ||
export class StoryDetailWorkflowComponent implements OnChanges { | ||
@Input({ required: true }) | ||
public story!: StoryDetail; | ||
|
||
@Input({ required: true }) | ||
public workflows!: Workflow[]; | ||
|
||
@Input() | ||
public canEdit = false; | ||
|
||
@ViewChild(TuiHostedDropdownComponent) | ||
public component?: TuiHostedDropdownComponent; | ||
|
||
@Output() | ||
public toWorkflow = new EventEmitter<Workflow>(); | ||
|
||
public openWorkflowList = false; | ||
public filteredWorkflows: Workflow[] = []; | ||
|
||
public ngOnChanges(): void { | ||
this.filteredWorkflows = this.workflows.filter( | ||
(workflow) => workflow.slug !== this.story.workflow.slug | ||
); | ||
} | ||
|
||
public trackByWorkflowId(_index: number, workflow: Workflow) { | ||
return workflow.id; | ||
} | ||
|
||
public moveToWorkflow(workflow: Workflow) { | ||
this.openWorkflowList = false; | ||
this.component?.nativeFocusableElement?.focus(); | ||
this.toWorkflow.emit(workflow); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.