diff --git a/SessionCompanion/SessionCompanion/ClientApp/angular.json b/SessionCompanion/SessionCompanion/ClientApp/angular.json index 1559646..b79e913 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/angular.json +++ b/SessionCompanion/SessionCompanion/ClientApp/angular.json @@ -26,6 +26,7 @@ "styles": [ "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css", "node_modules/bootstrap/dist/css/bootstrap.min.css", + "node_modules/rpg-awesome/css/rpg-awesome.min.css", "src/styles.css" ], "scripts": [] @@ -148,4 +149,4 @@ } }, "defaultProject": "SessionCompanion" -} \ No newline at end of file +} diff --git a/SessionCompanion/SessionCompanion/ClientApp/package-lock.json b/SessionCompanion/SessionCompanion/ClientApp/package-lock.json index d012404..b59a411 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/package-lock.json +++ b/SessionCompanion/SessionCompanion/ClientApp/package-lock.json @@ -10513,6 +10513,11 @@ "inherits": "^2.0.1" } }, + "rpg-awesome": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/rpg-awesome/-/rpg-awesome-0.2.0.tgz", + "integrity": "sha512-+jTuYWHOs8iZV5+XKvI/7Ojr0k4pLX/dRpa2LHXReGMQI6h0cGvNxIh/AQY1zhAC7LPcNXnPTliD1/ugB/DbRA==" + }, "run-async": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", @@ -12046,12 +12051,6 @@ } } }, - "tslint-config-prettier": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/tslint-config-prettier/-/tslint-config-prettier-1.18.0.tgz", - "integrity": "sha512-xPw9PgNPLG3iKRxmK7DWr+Ea/SzrvfHtjFt5LBl61gk2UBG/DB9kCXRjv+xyIU1rUtnayLeMUVJBcMX8Z17nDg==", - "dev": true - }, "tsutils": { "version": "2.29.0", "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", diff --git a/SessionCompanion/SessionCompanion/ClientApp/package.json b/SessionCompanion/SessionCompanion/ClientApp/package.json index 5e89112..ca095c7 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/package.json +++ b/SessionCompanion/SessionCompanion/ClientApp/package.json @@ -34,6 +34,7 @@ "jquery": "3.4.1", "oidc-client": "^1.9.1", "popper.js": "^1.16.0", + "rpg-awesome": "^0.2.0", "rxjs": "^6.5.3", "zone.js": "0.9.1" }, diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts index d829109..ccc3c8a 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts @@ -8,8 +8,8 @@ import { appRoutingModule } from '../app.routing'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { SignInComponent } from './components/sign-in/sign-in.component'; import { RegistrationComponent } from './components/registration/registration.component'; -import { GameMasterDashboardComponent} from './components/game-master-dashboard/game-master-dashboard.component'; -import {PlayerDashboardComponent} from './components/player-dashboard/player-dashboard.component'; +import { GameMasterDashboardComponent } from './components/game-master-dashboard/game-master-dashboard.component'; +import { PlayerDashboardComponent } from './components/player-dashboard/player-dashboard.component'; import { SelectCharacterComponent } from './components/select-character/select-character.component'; import { MatCardModule, @@ -18,15 +18,22 @@ import { MatInputModule, MatButtonModule, MatCheckboxModule, - MatIconModule, MatSidenavModule, MatToolbarModule, MatListModule + MatIconModule, + MatSidenavModule, + MatToolbarModule, + MatListModule, + MatPaginatorModule, + MatTableModule, + MatSortModule, } from '@angular/material'; -import {UserService} from '../services/user.service'; +import { UserService } from '../services/user.service'; import { StoreModule } from '@ngrx/store'; import { StoreDevtoolsModule } from '@ngrx/store-devtools'; -import {environment} from '../environments/environment'; -import {reducers} from './store/models/app-state.model'; -import {CharacterService} from '../services/character.service'; +import { environment } from '../environments/environment'; +import { reducers } from './store/models/app-state.model'; +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'; @NgModule({ declarations: [ @@ -38,9 +45,10 @@ import { AbilityCardComponent } from './components/ability-card/ability-card.com PlayerDashboardComponent, SelectCharacterComponent, AbilityCardComponent, + GameMasterSpellsTableComponent, ], imports: [ -BrowserModule.withServerTransition({ appId: 'ng-cli-universal' }), + BrowserModule.withServerTransition({ appId: 'ng-cli-universal' }), HttpClientModule, FormsModule, ReactiveFormsModule, @@ -56,15 +64,16 @@ BrowserModule.withServerTransition({ appId: 'ng-cli-universal' }), MatSidenavModule, MatToolbarModule, MatListModule, + MatPaginatorModule, StoreModule.forRoot(reducers), StoreDevtoolsModule.instrument({ - logOnly: environment.production - }) + logOnly: environment.production, + }), + MatTableModule, + MatSortModule, ], - providers: [ - UserService, - CharacterService - ], - bootstrap: [AppComponent] + providers: [UserService, CharacterService], + bootstrap: [AppComponent], + entryComponents: [GameMasterSpellsTableComponent], }) -export class AppModule { } +export class AppModule {} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.css b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.css index 49d12fc..af117d2 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.css +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.css @@ -10,6 +10,16 @@ right: 0; } +.no-wrap { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.left-nav-item *{ + padding-right: 0px !important; +} + .leftnav{ background-color: #3D4751; border-right:none; 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 34918b5..a89fb07 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 @@ -17,36 +17,41 @@ - - folder - Link 1 - - - folder - Link 2 - - - folder - Link 3 - +
+ + + + {{item.displayName}} + + expand_more + expand_less + + + + +
+
+ + + + {{child.displayName}} + + + +
+
+
SessionCompanion +
+ + + +
{ if ( diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-spells-table/game-master-spells-table.component.css b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-spells-table/game-master-spells-table.component.css new file mode 100644 index 0000000..0144f37 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-spells-table/game-master-spells-table.component.css @@ -0,0 +1,38 @@ +table { + width: 100%; + background-color: initial; +} + +mat-paginator{ + background-color: initial; + color: white; +} + +th{ + color: whitesmoke; +} + +td{ + color: whitesmoke; +} + +::ng-deep .mat-select-arrow{ + color: whitesmoke; +} + +::ng-deep .mat-select-value { + color: white +} + +.mat-sort-header-container{ + color: whitesmoke !important; +} + +.mat-form-field { + font-size: 14px; + width: 100%; +} + +td, th { + width: 25%; +} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-spells-table/game-master-spells-table.component.html b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-spells-table/game-master-spells-table.component.html new file mode 100644 index 0000000..f7f460f --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-spells-table/game-master-spells-table.component.html @@ -0,0 +1,43 @@ + + Filter + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name {{row.name}} Range {{row.range}}% Level {{row.level}} School {{row.school}}
No data matching the filter "{{input.value}}"
+ + +
diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-spells-table/game-master-spells-table.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-spells-table/game-master-spells-table.component.ts new file mode 100644 index 0000000..8da89fa --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-spells-table/game-master-spells-table.component.ts @@ -0,0 +1,48 @@ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { MatPaginator } from '@angular/material/paginator'; +import { MatSort } from '@angular/material/sort'; +import { MatTableDataSource } from '@angular/material/table'; + +export interface SpellData { + name: string; + range: string; + level: number; + school: string; +} + +@Component({ + selector: 'app-game-master-spells-table', + templateUrl: './game-master-spells-table.component.html', + styleUrls: ['./game-master-spells-table.component.css'], +}) +export class GameMasterSpellsTableComponent implements OnInit { + displayedColumns: string[] = ['Name', 'Range', 'Level', 'School']; + dataSource: MatTableDataSource; + + @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator; + @ViewChild(MatSort, { static: true }) sort: MatSort; + + constructor() { + const users = Array.from({ length: 100 }, (_, k) => this.createSepll()); + + this.dataSource = new MatTableDataSource(users); + } + + createSepll(): SpellData { + return { name: 'test', range: 'asd', level: 2, school: 'UAM!!!!' }; + } + + ngOnInit() { + this.dataSource.paginator = this.paginator; + this.dataSource.sort = this.sort; + } + + applyFilter(event: Event) { + const filterValue = (event.target as HTMLInputElement).value; + this.dataSource.filter = filterValue.trim().toLowerCase(); + + if (this.dataSource.paginator) { + this.dataSource.paginator.firstPage(); + } + } +} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/types/LeftNavItem.ts b/SessionCompanion/SessionCompanion/ClientApp/src/types/LeftNavItem.ts new file mode 100644 index 0000000..abc8e1e --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/types/LeftNavItem.ts @@ -0,0 +1,7 @@ +export interface LeftNavItem { + displayName: string; + iconName: string; + componentToDisplay?: string; + expanded: boolean; + children?: LeftNavItem[]; +} diff --git a/SessionCompanion/SessionCompanion/ClientApp/tsconfig.json b/SessionCompanion/SessionCompanion/ClientApp/tsconfig.json index b93cbfc..7f31595 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/tsconfig.json +++ b/SessionCompanion/SessionCompanion/ClientApp/tsconfig.json @@ -1,6 +1,7 @@ { "compileOnSave": false, "compilerOptions": { + "skipLibCheck": true, "baseUrl": "./", "module": "esnext", "outDir": "./dist/out-tsc",