Skip to content

Commit e4839f6

Browse files
committed
feat(votes): pass committee queryParams on vote edit navigation
Add editQueryParams input to lfx-votes-table and wire [queryParams] onto the edit routerLink so writerGuard receives project and committee_uid when a committee manager navigates to edit a draft vote — mirrors the meetings fix (PR #1025). - votes-table: add editQueryParams input (defaults to {}; non-breaking for all existing usages outside committee context) - votes-table: bind [queryParams]="editQueryParams()" on edit <a> - committee-votes: add editVoteQueryParams computed signal via buildCommitteeCreateQueryParams; pass to [editQueryParams] binding Signed-off-by: Rashad <mrashad@contractor.linuxfoundation.org>
1 parent 1b0e903 commit e4839f6

4 files changed

Lines changed: 4 additions & 1 deletion

File tree

apps/lfx-one/src/app/modules/committees/components/committee-votes/committee-votes.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
[hasPMOAccess]="canEdit()"
99
[loading]="loading()"
1010
[totalRecords]="votes().length"
11+
[editQueryParams]="editVoteQueryParams()"
1112
(viewResults)="viewVoteResults($event)"
1213
(viewVote)="viewVoteResults($event)">
1314
@if (canEdit()) {

apps/lfx-one/src/app/modules/committees/components/committee-votes/committee-votes.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export class CommitteeVotesComponent {
4343
// Data
4444
public votes: Signal<Vote[]> = this.initVotes();
4545
public createVoteQueryParams: Signal<Record<string, string>> = this.initCreateVoteQueryParams();
46+
public editVoteQueryParams: Signal<Record<string, string>> = computed(() => buildCommitteeCreateQueryParams(this.committee()));
4647

4748
/** Checks committee write permission fresh before navigating to the create-vote route.
4849
* Redirects to project overview with _notice=votes if permission has been revoked

apps/lfx-one/src/app/modules/votes/components/votes-table/votes-table.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156
<div class="flex items-center justify-end gap-1">
157157
@if (hasPMOAccess()) {
158158
@if (vote.status === PollStatus.DISABLED) {
159-
<a [routerLink]="['/votes', vote.uid, 'edit']">
159+
<a [routerLink]="['/votes', vote.uid, 'edit']" [queryParams]="editQueryParams()">
160160
<lfx-button label="Edit" severity="primary" size="small" [text]="true" [attr.data-testid]="'votes-edit-' + vote.uid"> </lfx-button>
161161
</a>
162162
<lfx-button

apps/lfx-one/src/app/modules/votes/components/votes-table/votes-table.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ export class VotesTableComponent {
7777
public readonly showProjectFilter = input<boolean>(false);
7878
// Draft tab is only meaningful in management contexts (project/committee lens); hide it in the Me lens.
7979
public readonly showDraftTab = input<boolean>(true);
80+
public readonly editQueryParams = input<Record<string, string>>({});
8081

8182
// === Outputs ===
8283
public readonly viewVote = output<string>();

0 commit comments

Comments
 (0)