-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement new objective dialog start
- Loading branch information
1 parent
cb9f330
commit eb52525
Showing
3 changed files
with
185 additions
and
188 deletions.
There are no files selected for viewing
151 changes: 76 additions & 75 deletions
151
frontend/src/app/components/objective/objective.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 |
---|---|---|
@@ -1,81 +1,82 @@ | ||
<div | ||
(click)="openObjectiveDetail()" | ||
(keydown.enter)="openObjectiveDetail()" | ||
*ngIf="objective$ | async as objective" | ||
[attr.data-testId]="'objective'" | ||
class="objective rounded-3 bg-white w-100 cursor-pointer focus-outline" | ||
tabindex="0" | ||
> | ||
<div class="row mx-1"> | ||
<section class="d-flex mb-3 mt-3 justify-content-between pe-0"> | ||
<section class="d-flex gap-2 align-items-start fit-content objective-title"> | ||
<img | ||
<div *ngIf="objective$ | async as objective"> | ||
<div | ||
(click)="openObjectiveDetail(objective.id)" | ||
(keydown.enter)="openObjectiveDetail(objective.id)" | ||
[attr.data-testId]="'objective'" | ||
class="objective rounded-3 bg-white w-100 cursor-pointer focus-outline" | ||
tabindex="0" | ||
> | ||
<div class="row mx-1"> | ||
<section class="d-flex mb-3 mt-3 justify-content-between pe-0"> | ||
<section class="d-flex gap-2 align-items-start fit-content objective-title"> | ||
<img | ||
(click)="$event.stopPropagation()" | ||
[attr.data-testId]="'objective-state'" | ||
[src]="'assets/icons/' + objective.state" | ||
alt="The objectives state" | ||
class="icon" | ||
matTooltip="{{ getStateTooltip() + ' ' + formatObjectiveState(objective.state) }}" | ||
matTooltipPosition="above" | ||
/> | ||
<h2 class="title fit-content">{{ objective.title }}</h2> | ||
</section> | ||
<button | ||
#menuButton | ||
*ngIf="isWritable" | ||
class="icon-button three-dot-menu focus-outline" | ||
[matMenuTriggerFor]="objectiveMenu" | ||
(click)="$event.stopPropagation()" | ||
[attr.data-testId]="'objective-state'" | ||
[src]="'assets/icons/' + objective.state" | ||
alt="The objectives state" | ||
class="icon" | ||
matTooltip="{{ getStateTooltip() + ' ' + formatObjectiveState(objective.state) }}" | ||
matTooltipPosition="above" | ||
/> | ||
<h2 class="title fit-content">{{ objective.title }}</h2> | ||
(keydown.enter)="$event.stopPropagation()" | ||
[attr.data-testId]="'three-dot-menu'" | ||
> | ||
<img src="../assets/icons/three-dot-menu-icon.svg" alt="menu icon" class="text-white menu-scale" /> | ||
</button> | ||
</section> | ||
<button | ||
#menuButton | ||
*ngIf="isWritable" | ||
class="icon-button three-dot-menu focus-outline" | ||
[matMenuTriggerFor]="objectiveMenu" | ||
(click)="$event.stopPropagation(); getMenu()" | ||
(keydown.enter)="$event.stopPropagation()" | ||
[attr.data-testId]="'three-dot-menu'" | ||
> | ||
<img src="../assets/icons/three-dot-menu-icon.svg" alt="menu icon" class="text-white menu-scale" /> | ||
</button> | ||
</section> | ||
|
||
<div class="d-flex px-3 gap-3 flex-column"> | ||
<app-keyresult | ||
*ngFor="let keyResult of objective.keyResults; trackBy: trackByFn" | ||
class="border-0 p-0" | ||
(click)="$event.stopPropagation()" | ||
(keydown.enter)="$event.stopPropagation()" | ||
[keyResult]="keyResult" | ||
[attr.data-testId]="'keyresult'" | ||
></app-keyresult> | ||
</div> | ||
<div class="d-flex px-3 gap-3 flex-column"> | ||
<app-keyresult | ||
*ngFor="let keyResult of objective.keyResults; trackBy: trackByFn" | ||
class="border-0 p-0" | ||
(click)="$event.stopPropagation()" | ||
(keydown.enter)="$event.stopPropagation()" | ||
[keyResult]="keyResult" | ||
[attr.data-testId]="'keyresult'" | ||
></app-keyresult> | ||
</div> | ||
|
||
<section class="p-0 py-2 m-0"> | ||
<button | ||
*ngIf="!isComplete && isWritable" | ||
mat-button | ||
color="primary" | ||
class="fw-bold px-0 pe-2 ms-2" | ||
[attr.data-testId]="'add-keyResult'" | ||
(click)="openAddKeyResultDialog(); $event.stopPropagation()" | ||
(keydown.enter)="$event.stopPropagation()" | ||
> | ||
<span class="d-flex align-items-center add-text"> | ||
<img alt="Add key-result button" class="add-cross-button" src="../../../assets/icons/new-icon.svg" /> | ||
Key Result hinzufügen | ||
</span> | ||
</button> | ||
</section> | ||
<section class="p-0 py-2 m-0"> | ||
<button | ||
*ngIf="!isObjectiveComplete(this.objective) && isWritable" | ||
mat-button | ||
color="primary" | ||
class="fw-bold px-0 pe-2 ms-2" | ||
[attr.data-testId]="'add-keyResult'" | ||
(click)="openAddKeyResultDialog(); $event.stopPropagation()" | ||
(keydown.enter)="$event.stopPropagation()" | ||
> | ||
<span class="d-flex align-items-center add-text"> | ||
<img alt="Add key-result button" class="add-cross-button" src="../../../assets/icons/new-icon.svg" /> | ||
Key Result hinzufügen | ||
</span> | ||
</button> | ||
</section> | ||
</div> | ||
</div> | ||
</div> | ||
<mat-menu | ||
#objectiveMenu="matMenu" | ||
[class]="'objective-three-dot-menu'" | ||
class="pt-2 pb-2" | ||
xPosition="before" | ||
yPosition="below" | ||
> | ||
<button | ||
(click)="redirect(menuEntry)" | ||
*ngFor="let menuEntry of menuEntries" | ||
[attr.data-testId]="'objective-menu'" | ||
class="objective-menu-option" | ||
mat-menu-item | ||
<mat-menu | ||
#objectiveMenu="matMenu" | ||
[class]="'objective-three-dot-menu'" | ||
class="pt-2 pb-2" | ||
xPosition="before" | ||
yPosition="below" | ||
> | ||
{{ menuEntry.displayName }} | ||
</button> | ||
</mat-menu> | ||
<button | ||
(click)="$event.stopPropagation(); console.log('menuEntry', menuEntry)" | ||
*ngFor="let menuEntry of getMenu(objective)" | ||
[attr.data-testId]="'objective-menu'" | ||
class="objective-menu-option" | ||
mat-menu-item | ||
> | ||
{{ menuEntry.displayName }}123 | ||
</button> | ||
</mat-menu> | ||
</div> |
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.