Skip to content

Commit 1597ade

Browse files
added selection of a default team for a view (#654)
1 parent 0192e21 commit 1597ade

File tree

4 files changed

+27
-0
lines changed

4 files changed

+27
-0
lines changed

src/app/components/admin-app/admin-view-search/admin-view-edit/admin-view-edit.component.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,22 @@ <h4 class="header-text ms-2">Edit View: {{ view.name }}</h4>
227227
<app-roles-permissions-select
228228
[team]="teamContainer.team"
229229
></app-roles-permissions-select>
230+
<div>
231+
<mat-checkbox
232+
color="primary"
233+
[checked]="view.defaultTeamId == teamContainer.team.id"
234+
(change)="
235+
setDefaultTeam(
236+
view.defaultTeamId != teamContainer.team.id
237+
? teamContainer.team.id
238+
: null
239+
)
240+
"
241+
matTooltip="If this is the default Team of the View"
242+
>
243+
Default
244+
</mat-checkbox>
245+
</div>
230246
<div class="d-flex justify-content-center">
231247
<button
232248
mat-button

src/app/components/admin-app/admin-view-search/admin-view-edit/admin-view-edit.component.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,15 @@ export class AdminViewEditComponent implements OnInit {
318318
});
319319
}
320320

321+
setDefaultTeam(teamId: string) {
322+
this.view.defaultTeamId = teamId;
323+
this.viewService
324+
.updateView(this.view.id, this.view)
325+
.subscribe((updatedView) => {
326+
this.view = updatedView;
327+
});
328+
}
329+
321330
/**
322331
* Delete a team after confirmation
323332
* @param tm The team to delete

src/app/generated/player-api/model/editViewCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@ export interface EditViewCommand {
2222
description?: string | null;
2323
status?: ViewStatus;
2424
isTemplate?: boolean;
25+
defaultTeamId?: string | null;
2526
}
2627

src/app/generated/player-api/model/view.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@ export interface View {
2424
status?: ViewStatus;
2525
parentViewId?: string | null;
2626
isTemplate?: boolean;
27+
defaultTeamId?: string | null;
2728
}
2829

0 commit comments

Comments
 (0)