-
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.
Added team-wide ready for external game admin.
- Loading branch information
1 parent
46a5f29
commit 5bc1261
Showing
13 changed files
with
93 additions
and
43 deletions.
There are no files selected for viewing
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
17 changes: 17 additions & 0 deletions
17
...ents/deployment-admin-team-context-menu/deployment-admin-team-context-menu.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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<div class="btn-group" *ngIf="team" dropdown> | ||
<button [id]="'external-game-admin-context-menu-' + team.id" dropdownToggle type="button" | ||
class="btn ctx-menu-button rounded-circle" aria-controls="dropdown-basic" | ||
tooltip="Additional actions for this team"> | ||
<fa-icon [icon]="fa.ellipsisVertical"></fa-icon> | ||
</button> | ||
<ul id="dropdown-basic" *dropdownMenu class="dropdown-menu" role="menu" aria-labelledby="button-basic"> | ||
<li role="menuitem"> | ||
<button class="dropdown-item btn" (click)="handleTeamReadyStatusToggled(team, isReady)"> | ||
{{ (isReady ? "Unready" : "Ready") + " Team \"" + team.name + "\"" }} | ||
</button> | ||
</li> | ||
<li role="menuitem"> | ||
<button class="dropdown-item btn" (click)="handleCopyClicked(team.id)">Copy team ID</button> | ||
</li> | ||
</ul> | ||
</div> |
Empty file.
35 changes: 35 additions & 0 deletions
35
...onents/deployment-admin-team-context-menu/deployment-admin-team-context-menu.component.ts
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Component, EventEmitter, Input, Output } from '@angular/core'; | ||
import { fa } from '@/services/font-awesome.service'; | ||
import { SimpleEntity } from '@/api/models'; | ||
import { SyncStartService } from '@/services/sync-start.service'; | ||
import { firstValueFrom } from 'rxjs'; | ||
import { ClipboardService } from '@/utility/services/clipboard.service'; | ||
import { ToastService } from '@/utility/services/toast.service'; | ||
|
||
@Component({ | ||
selector: 'app-deployment-admin-team-context-menu', | ||
templateUrl: './deployment-admin-team-context-menu.component.html', | ||
styleUrls: ['./deployment-admin-team-context-menu.component.scss'] | ||
}) | ||
export class DeploymentAdminTeamContextMenuComponent { | ||
@Input() team?: SimpleEntity; | ||
@Input() isReady = false; | ||
@Output() teamReadyStateToggled = new EventEmitter<{ teamId: string, isReady: boolean }>(); | ||
|
||
protected fa = fa; | ||
|
||
constructor( | ||
private clipboardService: ClipboardService, | ||
private syncStartService: SyncStartService, | ||
private toastService: ToastService) { } | ||
|
||
protected handleCopyClicked(text: string) { | ||
this.clipboardService.copy(text); | ||
this.toastService.showMessage(`Copied team ID "${text}" to your clipboard.`); | ||
} | ||
|
||
protected async handleTeamReadyStatusToggled(team: SimpleEntity, isReady: boolean) { | ||
await firstValueFrom(this.syncStartService.updateTeamReadyState(team.id, { isReady: !isReady })); | ||
this.teamReadyStateToggled.emit({ teamId: team.id, isReady: !isReady }); | ||
} | ||
} |
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
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
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
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
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
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
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
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
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