Skip to content

Commit

Permalink
display correct options for draft and use replay subject
Browse files Browse the repository at this point in the history
  • Loading branch information
kcinay055679 committed Nov 5, 2024
1 parent 5e7d3f0 commit 6eb1217
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
test

<div *ngIf="objective$ | async as objective">
<div
(click)="openObjectiveDetail(objective.id)"
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/app/components/objective/objective.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, Input, OnInit } from '@angular/core';
import { ObjectiveMin } from '../../shared/types/model/ObjectiveMin';
import { Router } from '@angular/router';
import { map, Subject } from 'rxjs';
import { map, ReplaySubject } from 'rxjs';
import { RefreshDataService } from '../../services/refresh-data.service';
import { ObjectiveService } from '../../services/objective.service';
import { trackByFn } from '../../shared/common';
Expand All @@ -18,7 +18,7 @@ import { State } from '../../shared/types/enums/State';
})
export class ObjectiveComponent implements OnInit {
@Input() isWritable!: boolean;
public objective$ = new Subject<ObjectiveMin>();
public objective$ = new ReplaySubject<ObjectiveMin>();
menuEntries = this.objective$.pipe(map((objective) => this.objectiveMenuActionsService.getMenu(objective)));
protected readonly trackByFn = trackByFn;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class ObjectiveMenuActionsService {
}

private getDraftMenuActions(objective: ObjectiveMin): ObjectiveMenuEntry[] {
return [this.getReleaseAction(objective)];
return [this.getReleaseAction(objective), this.actions.editObjectiveAction(objective)];
}

private getOngoingMenuActions(objective: ObjectiveMin): ObjectiveMenuEntry[] {
Expand Down

0 comments on commit 6eb1217

Please sign in to comment.