Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,22 @@ <h4 class="header-text ms-2">Edit View: {{ view.name }}</h4>
<app-roles-permissions-select
[team]="teamContainer.team"
></app-roles-permissions-select>
<div>
<mat-checkbox
color="primary"
[checked]="view.defaultTeamId == teamContainer.team.id"
(change)="
setDefaultTeam(
view.defaultTeamId != teamContainer.team.id
? teamContainer.team.id
: null
)
"
matTooltip="If this is the default Team of the View"
>
Default
</mat-checkbox>
</div>
<div class="d-flex justify-content-center">
<button
mat-button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,15 @@ export class AdminViewEditComponent implements OnInit {
});
}

setDefaultTeam(teamId: string) {
this.view.defaultTeamId = teamId;
this.viewService
.updateView(this.view.id, this.view)
.subscribe((updatedView) => {
this.view = updatedView;
});
}

/**
* Delete a team after confirmation
* @param tm The team to delete
Expand Down
1 change: 1 addition & 0 deletions src/app/generated/player-api/model/editViewCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ export interface EditViewCommand {
description?: string | null;
status?: ViewStatus;
isTemplate?: boolean;
defaultTeamId?: string | null;
}

1 change: 1 addition & 0 deletions src/app/generated/player-api/model/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ export interface View {
status?: ViewStatus;
parentViewId?: string | null;
isTemplate?: boolean;
defaultTeamId?: string | null;
}