From edb72d17018c814784ec2698e9b0214d67d73790 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20G=C3=B3reczny?= Date: Sun, 10 Jan 2021 15:28:14 +0100 Subject: [PATCH] SES-139 added dialog on character click in gm screen --- .../ClientApp/src/app/app.module.ts | 5 +++++ ...ter-character-actions-dialog.component.css | 12 ++++++++++ ...er-character-actions-dialog.component.html | 5 +++++ ...ster-character-actions-dialog.component.ts | 22 +++++++++++++++++++ .../game-master-dashboard.component.html | 2 +- .../game-master-dashboard.component.ts | 14 +++++++++++- 6 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-character-actions-dialog/game-master-character-actions-dialog.component.css create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-character-actions-dialog/game-master-character-actions-dialog.component.html create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-character-actions-dialog/game-master-character-actions-dialog.component.ts diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts index 260c784..198fa74 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts @@ -25,6 +25,7 @@ import { MatPaginatorModule, MatTableModule, MatSortModule, + MatDialogModule, } from '@angular/material'; import { UserService } from '../services/user.service'; import { StoreModule } from '@ngrx/store'; @@ -35,6 +36,7 @@ import { CharacterService } from '../services/character.service'; import { AbilityCardComponent } from './components/ability-card/ability-card.component'; import { GameMasterSpellsTableComponent } from './components/game-master-spells-table/game-master-spells-table.component'; import { GameMasterArmorsTableComponent } from './components/game-master-armors-table/game-master-armors-table.component'; +import { GameMasterCharacterActionsDialogComponent } from './components/game-master-character-actions-dialog/game-master-character-actions-dialog.component'; @NgModule({ declarations: [ @@ -48,6 +50,7 @@ import { GameMasterArmorsTableComponent } from './components/game-master-armors- AbilityCardComponent, GameMasterSpellsTableComponent, GameMasterArmorsTableComponent, + GameMasterCharacterActionsDialogComponent, ], imports: [ BrowserModule.withServerTransition({ appId: 'ng-cli-universal' }), @@ -66,6 +69,7 @@ import { GameMasterArmorsTableComponent } from './components/game-master-armors- MatSidenavModule, MatToolbarModule, MatListModule, + MatDialogModule, MatPaginatorModule, StoreModule.forRoot(reducers), StoreDevtoolsModule.instrument({ @@ -79,6 +83,7 @@ import { GameMasterArmorsTableComponent } from './components/game-master-armors- entryComponents: [ GameMasterSpellsTableComponent, GameMasterArmorsTableComponent, + GameMasterCharacterActionsDialogComponent, ], }) export class AppModule {} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-character-actions-dialog/game-master-character-actions-dialog.component.css b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-character-actions-dialog/game-master-character-actions-dialog.component.css new file mode 100644 index 0000000..411b4bb --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-character-actions-dialog/game-master-character-actions-dialog.component.css @@ -0,0 +1,12 @@ +.character-dialog-title { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +::ng-deep .mat-dialog-container { + background-color: #4a5867; + color: whitesmoke; + box-shadow: 0 11px 15px -7px rgba(0, 0, 0, 0.2), + 0 24px 38px 3px rgba(0, 0, 0, 0.14), 0px 5px 20px 4px #d8d8d8; +} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-character-actions-dialog/game-master-character-actions-dialog.component.html b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-character-actions-dialog/game-master-character-actions-dialog.component.html new file mode 100644 index 0000000..9445b81 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-character-actions-dialog/game-master-character-actions-dialog.component.html @@ -0,0 +1,5 @@ +

+ {{characterName}} +

+
+
diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-character-actions-dialog/game-master-character-actions-dialog.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-character-actions-dialog/game-master-character-actions-dialog.component.ts new file mode 100644 index 0000000..ac8b921 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-character-actions-dialog/game-master-character-actions-dialog.component.ts @@ -0,0 +1,22 @@ +import { Component, Inject, OnInit } from '@angular/core'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material'; + +@Component({ + selector: 'app-game-master-character-actions-dialog', + templateUrl: './game-master-character-actions-dialog.component.html', + styleUrls: ['./game-master-character-actions-dialog.component.css'], +}) +export class GameMasterCharacterActionsDialogComponent implements OnInit { + characterId: number; + characterName: string; + + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any + ) {} + + ngOnInit() { + this.characterId = this.data.characterid; + this.characterName = this.data.characterName; + } +} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.html b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.html index 0e0db4c..a610274 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.html +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.html @@ -79,7 +79,7 @@ - +