From fe5921fa578662f8a0d1f2db6950d30c9dab0a0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20G=C3=B3reczny?= Date: Sun, 27 Dec 2020 21:17:00 +0100 Subject: [PATCH 1/7] SES-116 Small fix on backend --- .../SessionCompanion.Services/Profiles/CharacterProfile.cs | 3 ++- .../SessionCompanion.Services/Services/CharacterService.cs | 1 + .../CharacterViewModels/CharacterBasicStatsViewModel.cs | 5 +++++ .../SessionCompanion.ViewModels.xml | 5 +++++ .../SessionCompanion/Controllers/CharacterController.cs | 3 +++ 5 files changed, 16 insertions(+), 1 deletion(-) diff --git a/SessionCompanion/SessionCompanion.Services/Profiles/CharacterProfile.cs b/SessionCompanion/SessionCompanion.Services/Profiles/CharacterProfile.cs index 7f1417b..0262a5f 100644 --- a/SessionCompanion/SessionCompanion.Services/Profiles/CharacterProfile.cs +++ b/SessionCompanion/SessionCompanion.Services/Profiles/CharacterProfile.cs @@ -23,7 +23,8 @@ namespace SessionCompanion.Services.Profiles CreateMap() .ForMember(vm => vm.Name, conf => conf.MapFrom(charact => charact.Biography.Name)) .ForMember(vm => vm.Level, conf => conf.MapFrom(charact => charact.Statistics.Level)) - .ForMember(vm => vm.CurrentHealthPoints, conf => conf.MapFrom(charact => charact.Statistics.CurrentHealthPoints)).ReverseMap(); + .ForMember(vm => vm.CurrentHealthPoints, conf => conf.MapFrom(charact => charact.Statistics.CurrentHealthPoints)) + .ForMember(vm => vm.Class, conf => conf.MapFrom(charact => charact.Biography.Class.Name)).ReverseMap(); } } } diff --git a/SessionCompanion/SessionCompanion.Services/Services/CharacterService.cs b/SessionCompanion/SessionCompanion.Services/Services/CharacterService.cs index a336d42..a07f53c 100644 --- a/SessionCompanion/SessionCompanion.Services/Services/CharacterService.cs +++ b/SessionCompanion/SessionCompanion.Services/Services/CharacterService.cs @@ -46,6 +46,7 @@ namespace SessionCompanion.Services.Services { var characters = await Repository.Get(c => charactersId.Contains(c.Id)) .Include(x => x.Biography) + .ThenInclude(x => x.Class) .Include(x => x.Statistics).ToListAsync(); var result = Mapper.Map>(characters); return result; diff --git a/SessionCompanion/SessionCompanion.ViewModels/CharacterViewModels/CharacterBasicStatsViewModel.cs b/SessionCompanion/SessionCompanion.ViewModels/CharacterViewModels/CharacterBasicStatsViewModel.cs index 525419f..adbfafd 100644 --- a/SessionCompanion/SessionCompanion.ViewModels/CharacterViewModels/CharacterBasicStatsViewModel.cs +++ b/SessionCompanion/SessionCompanion.ViewModels/CharacterViewModels/CharacterBasicStatsViewModel.cs @@ -21,5 +21,10 @@ /// Aktualna ilość życia postaci /// public int CurrentHealthPoints { get; set; } + + /// + /// Klasa postaci + /// + public string Class { get; set; } } } diff --git a/SessionCompanion/SessionCompanion.ViewModels/SessionCompanion.ViewModels.xml b/SessionCompanion/SessionCompanion.ViewModels/SessionCompanion.ViewModels.xml index 71e048b..20c6929 100644 --- a/SessionCompanion/SessionCompanion.ViewModels/SessionCompanion.ViewModels.xml +++ b/SessionCompanion/SessionCompanion.ViewModels/SessionCompanion.ViewModels.xml @@ -100,6 +100,11 @@ Aktualna ilość życia postaci + + + Klasa postaci + + Identyfikator postaci diff --git a/SessionCompanion/SessionCompanion/Controllers/CharacterController.cs b/SessionCompanion/SessionCompanion/Controllers/CharacterController.cs index d35eb6f..1545fc1 100644 --- a/SessionCompanion/SessionCompanion/Controllers/CharacterController.cs +++ b/SessionCompanion/SessionCompanion/Controllers/CharacterController.cs @@ -72,6 +72,9 @@ namespace SessionCompanion.Controllers public async Task, ErrorResponse>> GetLoggedUsersCharacters() { var connectedCharacters = _sessionHubData.ConnectedCharacters_Prop; + connectedCharacters.Add("a", 1); + connectedCharacters.Add("s", 2); + connectedCharacters.Add("d", 3); var characters = await _service.GetBasicCharactersData(connectedCharacters.Values.ToList()); return characters.ToList(); From 2a5e04bbd1867046ca16755d76129069bf88b5f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20G=C3=B3reczny?= Date: Sun, 27 Dec 2020 21:17:19 +0100 Subject: [PATCH 2/7] SES-116 Get lsit of logged characters --- .../ClientApp/src/app/app.module.ts | 4 +- .../game-master-dashboard.component.ts | 39 +++++++++++++++++-- .../signalR-service/gm-signalR.service.ts | 12 +++++- .../src/services/character.service.ts | 29 ++++++++++++++ .../LoggedCharactersViewModel.ts | 6 +++ 5 files changed, 84 insertions(+), 6 deletions(-) create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/services/character.service.ts create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/character-viewmodels/LoggedCharactersViewModel.ts diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts index 6bed2fc..0088ea4 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts @@ -26,6 +26,7 @@ import { StoreDevtoolsModule } from '@ngrx/store-devtools'; import { reducers} from './reducers'; import {AppReducer} from './store/reducers/app.reducer'; import {environment} from '../environments/environment'; +import {CharacterService} from '../services/character.service'; @NgModule({ declarations: [ @@ -60,7 +61,8 @@ BrowserModule.withServerTransition({ appId: 'ng-cli-universal' }), }) ], providers: [ - UserService + UserService, + CharacterService ], bootstrap: [AppComponent] }) diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.ts index 1b303b8..2739bdb 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.ts @@ -1,6 +1,10 @@ -import {Component, OnInit} from '@angular/core'; +import {Component, OnDestroy, OnInit} from '@angular/core'; import {animateText, onSideNavChange} from '../../shared/animations/sidenav-animations'; import {GMSignalRService} from '../../shared/signalR-service/gm-signalR.service'; +import {CharacterService} from '../../../services/character.service'; +import {Subscription} from 'rxjs'; +import {ErrorResponse} from '../../../types/ErrorResponse'; +import {HttpErrorResponse} from '@angular/common/http'; @Component({ selector: 'app-game-master-dashboard', @@ -8,13 +12,16 @@ import {GMSignalRService} from '../../shared/signalR-service/gm-signalR.service' styleUrls: ['./game-master-dashboard.component.css'], animations: [onSideNavChange, animateText] }) -export class GameMasterDashboardComponent implements OnInit { +export class GameMasterDashboardComponent implements OnInit, OnDestroy { + allSubscriptions = new Subscription(); leftSidenavExpanded = false; leftSidenavTextExpanded = false; rightSidenavExpanded = false; rightSidenavTextExpanded = false; - constructor(private signalRService: GMSignalRService) {} + constructor(private signalRService: GMSignalRService, private characterService: CharacterService) { + this.SubscribeToEvents(); + } ngOnInit() { this.signalRService.Login(); @@ -36,4 +43,30 @@ export class GameMasterDashboardComponent implements OnInit { break; } } + + UpdateCharactersList(): void { + this.allSubscriptions.add( + this.characterService.getLoggedCharacters().subscribe((success) => { + console.log(success); + }, + (error: ErrorResponse | HttpErrorResponse) => { + if (error instanceof HttpErrorResponse) { + error = error.error as ErrorResponse; + } + console.error(error.message); + })); + } + + private SubscribeToEvents(): void { + debugger + this.signalRService.message.subscribe((message: string) => { + if (message === 'New player connected' || message === 'Player disconnected') { + this.UpdateCharactersList(); + } + }); + } + + ngOnDestroy() { + this.allSubscriptions.unsubscribe(); + } } diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/signalR-service/gm-signalR.service.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/signalR-service/gm-signalR.service.ts index 4ca94db..08cf425 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/signalR-service/gm-signalR.service.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/signalR-service/gm-signalR.service.ts @@ -1,12 +1,15 @@ import { Inject, Injectable } from '@angular/core'; import { SignalRService } from './base/signalR.service'; +import {Subject} from 'rxjs'; @Injectable({ providedIn: 'root' }) export class GMSignalRService { signalR: SignalRService; + message: Subject; constructor(@Inject('BASE_URL') baseUrl: string) { this.signalR = new SignalRService(baseUrl); + this.message = new Subject(); this.registerOnServerEvents(); } @@ -17,10 +20,15 @@ export class GMSignalRService { if (this.signalR.connectionEstablished$.getValue() === true) { this.signalR.hubConnection.send('GameMasterLogin'); } - }); + }).unsubscribe(); } private registerOnServerEvents(): void { - + this.signalR.hubConnection.on('Welcome', (message: string) => { + this.message.next('New player connected'); + }); + this.signalR.hubConnection.on('GoodBye', (message: string) => { + this.message.next('Player disconnected'); + }); } } diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/services/character.service.ts b/SessionCompanion/SessionCompanion/ClientApp/src/services/character.service.ts new file mode 100644 index 0000000..b166270 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/services/character.service.ts @@ -0,0 +1,29 @@ +import {Inject, Injectable} from '@angular/core'; +import {HttpClient} from '@angular/common/http'; +import {Observable, of, throwError} from 'rxjs'; +import {ErrorResponse} from '../types/ErrorResponse'; +import {Either} from '../types/Either'; +import {switchMap} from 'rxjs/operators'; +import {LoggedCharactersViewModel} from '../types/viewmodels/character-viewmodels/LoggedCharactersViewModel'; + +Injectable({ + providedIn: 'root' +}) +export class CharacterService { + private baseUrl = 'api/character/'; + constructor(private http: HttpClient, @Inject('BASE_URL') baseUrl: string) { + this.baseUrl = baseUrl + this.baseUrl; + } + + getLoggedCharacters(): Observable { + return this.http.get>(this.baseUrl + 'loggedCharacters').pipe( + switchMap(response => { + if (response.isLeft) { + return of(response.left); + } else { + return throwError(response.right); + } + }) + ); + } +} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/character-viewmodels/LoggedCharactersViewModel.ts b/SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/character-viewmodels/LoggedCharactersViewModel.ts new file mode 100644 index 0000000..c61a496 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/character-viewmodels/LoggedCharactersViewModel.ts @@ -0,0 +1,6 @@ +export interface LoggedCharactersViewModel { + id: number; + name: string; + level: number; + currentHealthPoints: number; +} From 7b430e05cbb25ca5ecb8bf4795daf656a88b8fae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20G=C3=B3reczny?= Date: Mon, 28 Dec 2020 14:59:42 +0100 Subject: [PATCH 3/7] SES-116 Database update and icons fix --- .../20201228114303_Class name fix.Designer.cs | 838 ++++++++++++++++++ .../20201228114303_Class name fix.cs | 55 ++ .../ApplicationDbContextModelSnapshot.cs | 6 +- .../SessionCompanion.Database/SeedData.cs | 6 +- .../ClientApp/src/app/app.component.ts | 12 +- .../ClientApp/src/app/app.module.ts | 2 - .../game-master-dashboard.component.html | 14 +- .../game-master-dashboard.component.ts | 18 +- ...ession-companion-icons-registry.service.ts | 30 +- .../session-companion-icons.component.ts | 36 - .../session-companion-icons.module.ts | 12 - .../src/services/character.service.ts | 5 +- .../LoggedCharactersViewModel.ts | 1 + .../Controllers/CharacterController.cs | 9 +- 14 files changed, 942 insertions(+), 102 deletions(-) create mode 100644 SessionCompanion/SessionCompanion.Database/Migrations/20201228114303_Class name fix.Designer.cs create mode 100644 SessionCompanion/SessionCompanion.Database/Migrations/20201228114303_Class name fix.cs delete mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.component.ts delete mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.module.ts diff --git a/SessionCompanion/SessionCompanion.Database/Migrations/20201228114303_Class name fix.Designer.cs b/SessionCompanion/SessionCompanion.Database/Migrations/20201228114303_Class name fix.Designer.cs new file mode 100644 index 0000000..7bbd955 --- /dev/null +++ b/SessionCompanion/SessionCompanion.Database/Migrations/20201228114303_Class name fix.Designer.cs @@ -0,0 +1,838 @@ +// +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using SessionCompanion.Database; + +namespace SessionCompanion.Database.Migrations +{ + [DbContext(typeof(ApplicationDbContext))] + [Migration("20201228114303_Class name fix")] + partial class Classnamefix + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .UseIdentityColumns() + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("ProductVersion", "5.0.0"); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Alignment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.HasKey("Id"); + + b.ToTable("Alignments"); + + b.HasData( + new + { + Id = 1 + }, + new + { + Id = 2 + }, + new + { + Id = 3 + }); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Background", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.HasKey("Id"); + + b.ToTable("Backgrounds"); + + b.HasData( + new + { + Id = 1 + }, + new + { + Id = 2 + }, + new + { + Id = 3 + }); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Biography", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("AlignmentId") + .HasColumnType("int"); + + b.Property("BackgroundId") + .HasColumnType("int"); + + b.Property("CharacterId") + .HasColumnType("int"); + + b.Property("ClassId") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("RaceId") + .HasColumnType("int"); + + b.Property("Sex") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("AlignmentId"); + + b.HasIndex("BackgroundId"); + + b.HasIndex("CharacterId") + .IsUnique(); + + b.HasIndex("ClassId"); + + b.HasIndex("RaceId"); + + b.ToTable("Biographies"); + + b.HasData( + new + { + Id = 1, + AlignmentId = 1, + BackgroundId = 1, + CharacterId = 1, + ClassId = 1, + Name = "Bob", + RaceId = 1, + Sex = "Male" + }, + new + { + Id = 2, + AlignmentId = 2, + BackgroundId = 2, + CharacterId = 2, + ClassId = 2, + Name = "Queen Daenerys Stormborn of the House Targaryen, the First of Her Name, Queen of the Andals, the Rhoynar and the First Men, Lady of the Seven Kingdoms and Protector of the Realm, Lady of Dragonstone, Queen of Meereen, Khaleesi of the Great Grass Sea, the Unburnt, Breaker of Chains and Mother of Dragons.", + RaceId = 2, + Sex = "Female" + }, + new + { + Id = 3, + AlignmentId = 3, + BackgroundId = 3, + CharacterId = 3, + ClassId = 3, + Name = "Gandalf the White", + RaceId = 3, + Sex = "Both" + }); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Character", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Characters"); + + b.HasData( + new + { + Id = 1, + UserId = 1 + }, + new + { + Id = 2, + UserId = 2 + }, + new + { + Id = 3, + UserId = 3 + }); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Charisma", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("CanDeception") + .HasColumnType("bit"); + + b.Property("CanIntimidation") + .HasColumnType("bit"); + + b.Property("CanPerformance") + .HasColumnType("bit"); + + b.Property("CanPersuasion") + .HasColumnType("bit"); + + b.Property("CanSaveThrows") + .HasColumnType("bit"); + + b.Property("CharacterId") + .HasColumnType("int"); + + b.Property("Deception") + .HasColumnType("int"); + + b.Property("Intimidation") + .HasColumnType("int"); + + b.Property("Modification") + .HasColumnType("int"); + + b.Property("Performance") + .HasColumnType("int"); + + b.Property("Persuasion") + .HasColumnType("int"); + + b.Property("SavingThrows") + .HasColumnType("int"); + + b.Property("Value") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId") + .IsUnique(); + + b.ToTable("Charismas"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Class", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Classes"); + + b.HasData( + new + { + Id = 1, + Name = "Fighter" + }, + new + { + Id = 2, + Name = "Paladin" + }, + new + { + Id = 3, + Name = "Cleric" + }); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Constitution", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("CanSaveThrows") + .HasColumnType("bit"); + + b.Property("CharacterId") + .HasColumnType("int"); + + b.Property("Modification") + .HasColumnType("int"); + + b.Property("SavingThrows") + .HasColumnType("int"); + + b.Property("Value") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId") + .IsUnique(); + + b.ToTable("Constitutions"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Dexterity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("Acrobatics") + .HasColumnType("int"); + + b.Property("CanAcrobatics") + .HasColumnType("bit"); + + b.Property("CanSaveThrows") + .HasColumnType("bit"); + + b.Property("CanSleightOfHand") + .HasColumnType("bit"); + + b.Property("CanStealth") + .HasColumnType("bit"); + + b.Property("CharacterId") + .HasColumnType("int"); + + b.Property("Modification") + .HasColumnType("int"); + + b.Property("SavingThrows") + .HasColumnType("int"); + + b.Property("SleightOfHand") + .HasColumnType("int"); + + b.Property("Stealth") + .HasColumnType("int"); + + b.Property("Value") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId") + .IsUnique(); + + b.ToTable("Dexterities"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Intelligence", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("Arcana") + .HasColumnType("int"); + + b.Property("CanArcana") + .HasColumnType("bit"); + + b.Property("CanHistory") + .HasColumnType("bit"); + + b.Property("CanInvestigation") + .HasColumnType("bit"); + + b.Property("CanNature") + .HasColumnType("bit"); + + b.Property("CanReligion") + .HasColumnType("bit"); + + b.Property("CanSaveThrows") + .HasColumnType("bit"); + + b.Property("CharacterId") + .HasColumnType("int"); + + b.Property("History") + .HasColumnType("int"); + + b.Property("Investigation") + .HasColumnType("int"); + + b.Property("Modification") + .HasColumnType("int"); + + b.Property("Nature") + .HasColumnType("int"); + + b.Property("Religion") + .HasColumnType("int"); + + b.Property("SavingThrows") + .HasColumnType("int"); + + b.Property("Value") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId") + .IsUnique(); + + b.ToTable("Intelligences"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Race", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Races"); + + b.HasData( + new + { + Id = 1, + Name = "Human" + }, + new + { + Id = 2, + Name = "Dwarf" + }, + new + { + Id = 3, + Name = "Elf" + }); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Statistics", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("ArmorClass") + .HasColumnType("int"); + + b.Property("CharacterId") + .HasColumnType("int"); + + b.Property("CurrentHealthPoints") + .HasColumnType("int"); + + b.Property("ExperiencePoints") + .HasColumnType("int"); + + b.Property("HealthPoints") + .HasColumnType("int"); + + b.Property("Initiative") + .HasColumnType("int"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Proficiency") + .HasColumnType("int"); + + b.Property("Speed") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId") + .IsUnique(); + + b.ToTable("Statistics"); + + b.HasData( + new + { + Id = 1, + ArmorClass = 9, + CharacterId = 1, + CurrentHealthPoints = 18, + ExperiencePoints = 2, + HealthPoints = 20, + Initiative = 12, + Level = 1, + Proficiency = 1, + Speed = 5 + }, + new + { + Id = 2, + ArmorClass = 12, + CharacterId = 2, + CurrentHealthPoints = 26, + ExperiencePoints = 0, + HealthPoints = 26, + Initiative = 7, + Level = 1, + Proficiency = 1, + Speed = 10 + }, + new + { + Id = 3, + ArmorClass = 2, + CharacterId = 3, + CurrentHealthPoints = 7, + ExperiencePoints = 24, + HealthPoints = 7, + Initiative = 18, + Level = 1, + Proficiency = 2, + Speed = 15 + }); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Strength", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("Athletics") + .HasColumnType("int"); + + b.Property("CanAthletics") + .HasColumnType("bit"); + + b.Property("CanSaveThrows") + .HasColumnType("bit"); + + b.Property("CharacterId") + .HasColumnType("int"); + + b.Property("Modification") + .HasColumnType("int"); + + b.Property("SavingThrows") + .HasColumnType("int"); + + b.Property("Value") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId") + .IsUnique(); + + b.ToTable("Strengths"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("Password") + .HasColumnType("nvarchar(max)"); + + b.Property("Username") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Users"); + + b.HasData( + new + { + Id = 1, + Password = "123", + Username = "Morwiec" + }, + new + { + Id = 2, + Password = "123", + Username = "Cichoklepiec" + }, + new + { + Id = 3, + Password = "123", + Username = "Ruletka" + }); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Wisdom", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .UseIdentityColumn(); + + b.Property("AnimalHandling") + .HasColumnType("int"); + + b.Property("CanAnimalHandling") + .HasColumnType("bit"); + + b.Property("CanInsight") + .HasColumnType("bit"); + + b.Property("CanMedicine") + .HasColumnType("bit"); + + b.Property("CanPerception") + .HasColumnType("bit"); + + b.Property("CanSaveThrows") + .HasColumnType("bit"); + + b.Property("CanSurvival") + .HasColumnType("bit"); + + b.Property("CharacterId") + .HasColumnType("int"); + + b.Property("Insight") + .HasColumnType("int"); + + b.Property("Medicine") + .HasColumnType("int"); + + b.Property("Modification") + .HasColumnType("int"); + + b.Property("Perception") + .HasColumnType("int"); + + b.Property("SavingThrows") + .HasColumnType("int"); + + b.Property("Survival") + .HasColumnType("int"); + + b.Property("Value") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CharacterId") + .IsUnique(); + + b.ToTable("Wisdoms"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Biography", b => + { + b.HasOne("SessionCompanion.Database.Tables.Alignment", "Alignment") + .WithMany("Biography") + .HasForeignKey("AlignmentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SessionCompanion.Database.Tables.Background", "Background") + .WithMany("Biography") + .HasForeignKey("BackgroundId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SessionCompanion.Database.Tables.Character", "Character") + .WithOne("Biography") + .HasForeignKey("SessionCompanion.Database.Tables.Biography", "CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SessionCompanion.Database.Tables.Class", "Class") + .WithMany("Biography") + .HasForeignKey("ClassId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SessionCompanion.Database.Tables.Race", "Race") + .WithMany("Biography") + .HasForeignKey("RaceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Alignment"); + + b.Navigation("Background"); + + b.Navigation("Character"); + + b.Navigation("Class"); + + b.Navigation("Race"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Character", b => + { + b.HasOne("SessionCompanion.Database.Tables.User", "User") + .WithMany("Character") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Charisma", b => + { + b.HasOne("SessionCompanion.Database.Tables.Character", "Character") + .WithOne("Charisma") + .HasForeignKey("SessionCompanion.Database.Tables.Charisma", "CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Character"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Constitution", b => + { + b.HasOne("SessionCompanion.Database.Tables.Character", "Character") + .WithOne("Constitution") + .HasForeignKey("SessionCompanion.Database.Tables.Constitution", "CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Character"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Dexterity", b => + { + b.HasOne("SessionCompanion.Database.Tables.Character", "Character") + .WithOne("Dexterity") + .HasForeignKey("SessionCompanion.Database.Tables.Dexterity", "CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Character"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Intelligence", b => + { + b.HasOne("SessionCompanion.Database.Tables.Character", "Character") + .WithOne("Intelligence") + .HasForeignKey("SessionCompanion.Database.Tables.Intelligence", "CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Character"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Statistics", b => + { + b.HasOne("SessionCompanion.Database.Tables.Character", "Character") + .WithOne("Statistics") + .HasForeignKey("SessionCompanion.Database.Tables.Statistics", "CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Character"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Strength", b => + { + b.HasOne("SessionCompanion.Database.Tables.Character", "Character") + .WithOne("Strength") + .HasForeignKey("SessionCompanion.Database.Tables.Strength", "CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Character"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Wisdom", b => + { + b.HasOne("SessionCompanion.Database.Tables.Character", "Character") + .WithOne("Wisdom") + .HasForeignKey("SessionCompanion.Database.Tables.Wisdom", "CharacterId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Character"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Alignment", b => + { + b.Navigation("Biography"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Background", b => + { + b.Navigation("Biography"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Character", b => + { + b.Navigation("Biography"); + + b.Navigation("Charisma"); + + b.Navigation("Constitution"); + + b.Navigation("Dexterity"); + + b.Navigation("Intelligence"); + + b.Navigation("Statistics"); + + b.Navigation("Strength"); + + b.Navigation("Wisdom"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Class", b => + { + b.Navigation("Biography"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.Race", b => + { + b.Navigation("Biography"); + }); + + modelBuilder.Entity("SessionCompanion.Database.Tables.User", b => + { + b.Navigation("Character"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/SessionCompanion/SessionCompanion.Database/Migrations/20201228114303_Class name fix.cs b/SessionCompanion/SessionCompanion.Database/Migrations/20201228114303_Class name fix.cs new file mode 100644 index 0000000..c0633fa --- /dev/null +++ b/SessionCompanion/SessionCompanion.Database/Migrations/20201228114303_Class name fix.cs @@ -0,0 +1,55 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace SessionCompanion.Database.Migrations +{ + public partial class Classnamefix : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.UpdateData( + table: "Classes", + keyColumn: "Id", + keyValue: 1, + column: "Name", + value: "Fighter"); + + migrationBuilder.UpdateData( + table: "Classes", + keyColumn: "Id", + keyValue: 2, + column: "Name", + value: "Paladin"); + + migrationBuilder.UpdateData( + table: "Classes", + keyColumn: "Id", + keyValue: 3, + column: "Name", + value: "Cleric"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.UpdateData( + table: "Classes", + keyColumn: "Id", + keyValue: 1, + column: "Name", + value: "Warrior"); + + migrationBuilder.UpdateData( + table: "Classes", + keyColumn: "Id", + keyValue: 2, + column: "Name", + value: "Knight"); + + migrationBuilder.UpdateData( + table: "Classes", + keyColumn: "Id", + keyValue: 3, + column: "Name", + value: "Priest"); + } + } +} diff --git a/SessionCompanion/SessionCompanion.Database/Migrations/ApplicationDbContextModelSnapshot.cs b/SessionCompanion/SessionCompanion.Database/Migrations/ApplicationDbContextModelSnapshot.cs index 7898310..e4915a1 100644 --- a/SessionCompanion/SessionCompanion.Database/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/SessionCompanion/SessionCompanion.Database/Migrations/ApplicationDbContextModelSnapshot.cs @@ -255,17 +255,17 @@ namespace SessionCompanion.Database.Migrations new { Id = 1, - Name = "Warrior" + Name = "Fighter" }, new { Id = 2, - Name = "Knight" + Name = "Paladin" }, new { Id = 3, - Name = "Priest" + Name = "Cleric" }); }); diff --git a/SessionCompanion/SessionCompanion.Database/SeedData.cs b/SessionCompanion/SessionCompanion.Database/SeedData.cs index 81a9f5e..38fda48 100644 --- a/SessionCompanion/SessionCompanion.Database/SeedData.cs +++ b/SessionCompanion/SessionCompanion.Database/SeedData.cs @@ -66,17 +66,17 @@ namespace SessionCompanion.Database new Class { Id = 1, - Name = "Warrior" + Name = "Fighter" }, new Class { Id = 2, - Name = "Knight" + Name = "Paladin" }, new Class { Id = 3, - Name = "Priest" + Name = "Cleric" } }; return classes; diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/app.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/app.component.ts index b7b309e..96d886d 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/app.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/app.component.ts @@ -1,9 +1,17 @@ -import { Component } from '@angular/core'; +import {Component, OnInit} from '@angular/core'; +import {SessionCompanionIconsRegistry} from './shared/sc-icons/session-companion-icons-registry.service'; @Component({ selector: 'app-root', templateUrl: './app.component.html' }) -export class AppComponent { +export class AppComponent implements OnInit{ title = 'Session Companion'; + + constructor(private iconService: SessionCompanionIconsRegistry) { + } + + ngOnInit() { + this.iconService.registerIcons(); + } } diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts index 66c1ab2..29d4a9b 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/app.module.ts @@ -24,7 +24,6 @@ import {UserService} from '../services/user.service'; import { StoreModule } from '@ngrx/store'; import { StoreDevtoolsModule } from '@ngrx/store-devtools'; import {environment} from '../environments/environment'; -import {SessionCompanionIconsModule} from './shared/sc-icons/session-companion-icons.module'; import {reducers} from './store/models/app-state.model'; import {CharacterService} from '../services/character.service'; @@ -55,7 +54,6 @@ BrowserModule.withServerTransition({ appId: 'ng-cli-universal' }), MatSidenavModule, MatToolbarModule, MatListModule, - SessionCompanionIconsModule, StoreModule.forRoot(reducers), StoreDevtoolsModule.instrument({ logOnly: environment.production 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 6b72c96..f727744 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 @@ -38,17 +38,9 @@ - - folder - Link 1 - - - folder - Link 2 - - - folder - Link 3 + + + {{(loggedCharacter.name.length>12)? (loggedCharacter.name | slice:0:12)+'..':(loggedCharacter.name)}} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.ts index 2739bdb..69c942d 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.ts @@ -5,6 +5,9 @@ import {CharacterService} from '../../../services/character.service'; import {Subscription} from 'rxjs'; import {ErrorResponse} from '../../../types/ErrorResponse'; import {HttpErrorResponse} from '@angular/common/http'; +import {LoggedCharactersViewModel} from '../../../types/viewmodels/character-viewmodels/LoggedCharactersViewModel'; +import {SessionCompanionIconsRegistry} from '../../shared/sc-icons/session-companion-icons-registry.service'; +import { first, take } from 'rxjs/operators'; @Component({ selector: 'app-game-master-dashboard', @@ -19,7 +22,10 @@ export class GameMasterDashboardComponent implements OnInit, OnDestroy { rightSidenavExpanded = false; rightSidenavTextExpanded = false; - constructor(private signalRService: GMSignalRService, private characterService: CharacterService) { + loggedCharacters: LoggedCharactersViewModel[]; + + constructor(private signalRService: GMSignalRService, private characterService: CharacterService, + private iconsRegister: SessionCompanionIconsRegistry) { this.SubscribeToEvents(); } @@ -45,20 +51,18 @@ export class GameMasterDashboardComponent implements OnInit, OnDestroy { } UpdateCharactersList(): void { - this.allSubscriptions.add( - this.characterService.getLoggedCharacters().subscribe((success) => { - console.log(success); + this.characterService.getLoggedCharacters().pipe(first()).subscribe((success) => { + this.loggedCharacters = success; }, - (error: ErrorResponse | HttpErrorResponse) => { + (error: ErrorResponse | HttpErrorResponse) => { if (error instanceof HttpErrorResponse) { error = error.error as ErrorResponse; } console.error(error.message); - })); + }); } private SubscribeToEvents(): void { - debugger this.signalRService.message.subscribe((message: string) => { if (message === 'New player connected' || message === 'Player disconnected') { this.UpdateCharactersList(); diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons-registry.service.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons-registry.service.ts index 0870b10..5815b11 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons-registry.service.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons-registry.service.ts @@ -1,31 +1,19 @@ import {Injectable} from '@angular/core'; -import { SessionCompanionIcon } from './icons/sc-icon.model'; +import { SessionCompanionIcon, scIcon } from './icons/sc-icon.model'; +import {MatIconRegistry} from '@angular/material'; +import {DomSanitizer} from '@angular/platform-browser'; @Injectable({ providedIn: 'root' }) export class SessionCompanionIconsRegistry { + constructor(private registry: MatIconRegistry, private sanitizer: DomSanitizer) { + } - private registry = new Map(); - - public registerIcons(icons: SessionCompanionIcon[]): void { - icons.forEach((icon: SessionCompanionIcon) => { - if (!this.registry.has(icon.name)) { - this.registry.set(icon.name, icon.data); - } + public registerIcons(): void { + const icons = require('./icons/sc-icon.model'); + Object.values(icons).forEach((icon: SessionCompanionIcon) => { + this.registry.addSvgIconLiteral(icon.name, this.sanitizer.bypassSecurityTrustHtml(icon.data)); }); } - - public registerIcon(icon: SessionCompanionIcon): void { - if (!this.registry.has(icon.name)) { - this.registry.set(icon.name, icon.data); - } - } - - public getIcon(iconName: string): string | undefined { - if (!this.registry.has(iconName)) { - console.warn(`We could not find the Icon with the name ${iconName}, did you add it to the Icon registry?`); - } - return this.registry.get(iconName); - } } diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.component.ts deleted file mode 100644 index 5752798..0000000 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.component.ts +++ /dev/null @@ -1,36 +0,0 @@ -import {ChangeDetectionStrategy, Component, ElementRef, Inject, Input, Optional} from '@angular/core'; -import {SessionCompanionIconsRegistry} from './session-companion-icons-registry.service'; -import { DOCUMENT } from '@angular/common'; - -@Component({ - selector: 'app-sc-icons', - template: ` - - `, - styles: [':host::ng-deep svg{width: 50px; height: 50px}'], - changeDetection: ChangeDetectionStrategy.OnPush -}) -export class SessionCompanionIconsComponent { - - private svgIcon: SVGElement; - - @Input() - set name(iconName: string) { - if (this.svgIcon) { - this.element.nativeElement.removeChild(this.svgIcon); - } - const svgData = this.scIconRegistry.getIcon(iconName); - this.svgIcon = this.svgElementFromString(svgData); - this.element.nativeElement.appendChild(this.svgIcon); - } - - constructor(private element: ElementRef, private scIconRegistry: SessionCompanionIconsRegistry, - @Optional() @Inject(DOCUMENT) private document: any) { - } - - private svgElementFromString(svgContent: string): SVGElement { - const div = this.document.createElement('DIV'); - div.innerHTML = svgContent; - return div.querySelector('svg') || this.document.createElementNS('http://www.w3.org/2000/svg', 'path'); - } -} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.module.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.module.ts deleted file mode 100644 index eb9152a..0000000 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons.module.ts +++ /dev/null @@ -1,12 +0,0 @@ -import {NgModule} from '@angular/core'; -import {SessionCompanionIconsComponent} from './session-companion-icons.component'; - -@NgModule({ - declarations: [SessionCompanionIconsComponent], - imports: [], - exports: [ - SessionCompanionIconsComponent - ] -}) -export class SessionCompanionIconsModule { -} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/services/character.service.ts b/SessionCompanion/SessionCompanion/ClientApp/src/services/character.service.ts index b166270..ea14dc8 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/services/character.service.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/services/character.service.ts @@ -3,7 +3,7 @@ import {HttpClient} from '@angular/common/http'; import {Observable, of, throwError} from 'rxjs'; import {ErrorResponse} from '../types/ErrorResponse'; import {Either} from '../types/Either'; -import {switchMap} from 'rxjs/operators'; +import {switchMap, retry} from 'rxjs/operators'; import {LoggedCharactersViewModel} from '../types/viewmodels/character-viewmodels/LoggedCharactersViewModel'; Injectable({ @@ -23,7 +23,8 @@ export class CharacterService { } else { return throwError(response.right); } - }) + }), + retry(3) ); } } diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/character-viewmodels/LoggedCharactersViewModel.ts b/SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/character-viewmodels/LoggedCharactersViewModel.ts index c61a496..36ea974 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/character-viewmodels/LoggedCharactersViewModel.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/types/viewmodels/character-viewmodels/LoggedCharactersViewModel.ts @@ -3,4 +3,5 @@ export interface LoggedCharactersViewModel { name: string; level: number; currentHealthPoints: number; + class: string; } diff --git a/SessionCompanion/SessionCompanion/Controllers/CharacterController.cs b/SessionCompanion/SessionCompanion/Controllers/CharacterController.cs index 1545fc1..15b16d9 100644 --- a/SessionCompanion/SessionCompanion/Controllers/CharacterController.cs +++ b/SessionCompanion/SessionCompanion/Controllers/CharacterController.cs @@ -72,9 +72,12 @@ namespace SessionCompanion.Controllers public async Task, ErrorResponse>> GetLoggedUsersCharacters() { var connectedCharacters = _sessionHubData.ConnectedCharacters_Prop; - connectedCharacters.Add("a", 1); - connectedCharacters.Add("s", 2); - connectedCharacters.Add("d", 3); + if (_sessionHubData.ConnectedCharacters_Prop.Count() == 0) + { + connectedCharacters.Add("a", 1); + connectedCharacters.Add("s", 2); + connectedCharacters.Add("d", 3); + } var characters = await _service.GetBasicCharactersData(connectedCharacters.Values.ToList()); return characters.ToList(); From f75e20876b4f57b55fd833634b3b1e0fb7579d05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20G=C3=B3reczny?= Date: Wed, 30 Dec 2020 11:38:58 +0100 Subject: [PATCH 4/7] SES-116 Fix Icons on right panel --- .../game-master-dashboard.component.html | 4 +- .../game-master-dashboard.component.ts | 6 +- .../shared/sc-icons/icons/sc-icon.model.ts | 105 ------------------ .../sc-icons/icons/svg-icons/barbarian.svg | 1 - .../shared/sc-icons/icons/svg-icons/bard.svg | 1 - .../sc-icons/icons/svg-icons/cleric.svg | 1 - .../shared/sc-icons/icons/svg-icons/druid.svg | 1 - .../sc-icons/icons/svg-icons/fighter.svg | 1 - .../shared/sc-icons/icons/svg-icons/monk.svg | 1 - .../sc-icons/icons/svg-icons/paladin.svg | 1 - .../sc-icons/icons/svg-icons/ranger.svg | 1 - .../shared/sc-icons/icons/svg-icons/rogue.svg | 1 - .../sc-icons/icons/svg-icons/sorcerer.svg | 1 - .../sc-icons/icons/svg-icons/warlock.svg | 1 - .../sc-icons/icons/svg-icons/wizard.svg | 1 - ...ession-companion-icons-registry.service.ts | 11 +- .../src/assets/icons/sc-icon.model.ts | 14 +++ .../src/assets/icons/svg-icons/barbarian.svg | 1 + .../src/assets/icons/svg-icons/bard.svg | 1 + .../src/assets/icons/svg-icons/cleric.svg | 1 + .../src/assets/icons/svg-icons/druid.svg | 1 + .../src/assets/icons/svg-icons/fighter.svg | 1 + .../src/assets/icons/svg-icons/monk.svg | 1 + .../src/assets/icons/svg-icons/paladin.svg | 1 + .../src/assets/icons/svg-icons/ranger.svg | 1 + .../src/assets/icons/svg-icons/rogue.svg | 1 + .../src/assets/icons/svg-icons/sorcerer.svg | 1 + .../src/assets/icons/svg-icons/warlock.svg | 1 + .../src/assets/icons/svg-icons/wizard.svg | 1 + 29 files changed, 37 insertions(+), 127 deletions(-) delete mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/sc-icon.model.ts delete mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/barbarian.svg delete mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/bard.svg delete mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/cleric.svg delete mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/druid.svg delete mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/fighter.svg delete mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/monk.svg delete mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/paladin.svg delete mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/ranger.svg delete mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/rogue.svg delete mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/sorcerer.svg delete mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/warlock.svg delete mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/wizard.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/sc-icon.model.ts create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/barbarian.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/bard.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/cleric.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/druid.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/fighter.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/monk.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/paladin.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/ranger.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/rogue.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/sorcerer.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/warlock.svg create mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/wizard.svg 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 f727744..da56f17 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 @@ -39,8 +39,8 @@ - - {{(loggedCharacter.name.length>12)? (loggedCharacter.name | slice:0:12)+'..':(loggedCharacter.name)}} + + {{(loggedCharacter.name.length>12)? (loggedCharacter.name | slice:0:12)+'..':(loggedCharacter.name)}} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.ts index 69c942d..5f6a7b4 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.ts @@ -6,8 +6,7 @@ import {Subscription} from 'rxjs'; import {ErrorResponse} from '../../../types/ErrorResponse'; import {HttpErrorResponse} from '@angular/common/http'; import {LoggedCharactersViewModel} from '../../../types/viewmodels/character-viewmodels/LoggedCharactersViewModel'; -import {SessionCompanionIconsRegistry} from '../../shared/sc-icons/session-companion-icons-registry.service'; -import { first, take } from 'rxjs/operators'; +import { first } from 'rxjs/operators'; @Component({ selector: 'app-game-master-dashboard', @@ -24,8 +23,7 @@ export class GameMasterDashboardComponent implements OnInit, OnDestroy { rightSidenavTextExpanded = false; loggedCharacters: LoggedCharactersViewModel[]; - constructor(private signalRService: GMSignalRService, private characterService: CharacterService, - private iconsRegister: SessionCompanionIconsRegistry) { + constructor(private signalRService: GMSignalRService, private characterService: CharacterService) { this.SubscribeToEvents(); } diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/sc-icon.model.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/sc-icon.model.ts deleted file mode 100644 index 840ea40..0000000 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/sc-icon.model.ts +++ /dev/null @@ -1,105 +0,0 @@ -/* 🤖 this file was generated by svg-to-ts*/ -export const scIconBarbarian: { - name: 'barbarian'; - data: string; -} = { - name: 'barbarian', - data: `` -}; -export const scIconBard: { - name: 'bard'; - data: string; -} = { - name: 'bard', - data: `` -}; -export const scIconCleric: { - name: 'cleric'; - data: string; -} = { - name: 'cleric', - data: `` -}; -export const scIconDruid: { - name: 'druid'; - data: string; -} = { - name: 'druid', - data: `` -}; -export const scIconFighter: { - name: 'fighter'; - data: string; -} = { - name: 'fighter', - data: `` -}; -export const scIconMonk: { - name: 'monk'; - data: string; -} = { - name: 'monk', - data: `` -}; -export const scIconPaladin: { - name: 'paladin'; - data: string; -} = { - name: 'paladin', - data: `` -}; -export const scIconRanger: { - name: 'ranger'; - data: string; -} = { - name: 'ranger', - data: `` -}; -export const scIconRogue: { - name: 'rogue'; - data: string; -} = { - name: 'rogue', - data: `` -}; -export const scIconSorcerer: { - name: 'sorcerer'; - data: string; -} = { - name: 'sorcerer', - data: `` -}; -export const scIconWarlock: { - name: 'warlock'; - data: string; -} = { - name: 'warlock', - data: `` -}; -export const scIconWizard: { - name: 'wizard'; - data: string; -} = { - name: 'wizard', - data: `` -}; -export type scIcon = - | 'barbarian' - | 'bard' - | 'cleric' - | 'druid' - | 'fighter' - | 'monk' - | 'paladin' - | 'ranger' - | 'rogue' - | 'sorcerer' - | 'warlock' - | 'wizard'; -export interface SessionCompanionIcon { - name: scIcon; - data: string; -} -export type SessionCompanionIconNameSubset< - T extends Readonly -> = T[number]['name']; diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/barbarian.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/barbarian.svg deleted file mode 100644 index a4d948e..0000000 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/barbarian.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/bard.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/bard.svg deleted file mode 100644 index 565ebe9..0000000 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/bard.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/cleric.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/cleric.svg deleted file mode 100644 index df1b7e5..0000000 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/cleric.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/druid.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/druid.svg deleted file mode 100644 index 036adc9..0000000 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/druid.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/fighter.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/fighter.svg deleted file mode 100644 index 4fa6997..0000000 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/fighter.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/monk.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/monk.svg deleted file mode 100644 index 3590be6..0000000 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/monk.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/paladin.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/paladin.svg deleted file mode 100644 index 0fb47a7..0000000 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/paladin.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/ranger.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/ranger.svg deleted file mode 100644 index 4d9aca2..0000000 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/ranger.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/rogue.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/rogue.svg deleted file mode 100644 index 2e89550..0000000 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/rogue.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/sorcerer.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/sorcerer.svg deleted file mode 100644 index e26b851..0000000 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/sorcerer.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/warlock.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/warlock.svg deleted file mode 100644 index 329c82f..0000000 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/warlock.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/wizard.svg b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/wizard.svg deleted file mode 100644 index c61b956..0000000 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/icons/svg-icons/wizard.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons-registry.service.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons-registry.service.ts index 5815b11..6d48cad 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons-registry.service.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/session-companion-icons-registry.service.ts @@ -1,5 +1,5 @@ import {Injectable} from '@angular/core'; -import { SessionCompanionIcon, scIcon } from './icons/sc-icon.model'; +import {scIcon} from '../../../assets/icons/sc-icon.model'; import {MatIconRegistry} from '@angular/material'; import {DomSanitizer} from '@angular/platform-browser'; @@ -11,9 +11,12 @@ export class SessionCompanionIconsRegistry { } public registerIcons(): void { - const icons = require('./icons/sc-icon.model'); - Object.values(icons).forEach((icon: SessionCompanionIcon) => { - this.registry.addSvgIconLiteral(icon.name, this.sanitizer.bypassSecurityTrustHtml(icon.data)); + this.loadIcons(Object.values(scIcon), '../assets/icons/svg-icons'); + } + + private loadIcons(iconKeys: string[], iconUrl: string): void { + iconKeys.forEach((icon: string) => { + this.registry.addSvgIcon(icon, this.sanitizer.bypassSecurityTrustResourceUrl(`${iconUrl}/${icon}.svg`)); }); } } diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/sc-icon.model.ts b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/sc-icon.model.ts new file mode 100644 index 0000000..e3537d1 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/sc-icon.model.ts @@ -0,0 +1,14 @@ +export enum scIcon { + Barbarian = 'barbarian', + Bard = 'bard', + Cleric = 'cleric', + Druid = 'druid', + Fighter = 'fighter', + Monk = 'monk', + Paladin = 'paladin', + Ranger = 'ranger', + rogue = 'rogue', + Sorcerer = 'sorcerer', + Warlock = 'warlock', + Wizard = 'wizard' +} diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/barbarian.svg b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/barbarian.svg new file mode 100644 index 0000000..ea18fd3 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/barbarian.svg @@ -0,0 +1 @@ + diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/bard.svg b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/bard.svg new file mode 100644 index 0000000..1e139d8 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/bard.svg @@ -0,0 +1 @@ + diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/cleric.svg b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/cleric.svg new file mode 100644 index 0000000..f7a6586 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/cleric.svg @@ -0,0 +1 @@ + diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/druid.svg b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/druid.svg new file mode 100644 index 0000000..8290333b --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/druid.svg @@ -0,0 +1 @@ + diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/fighter.svg b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/fighter.svg new file mode 100644 index 0000000..0f55a43 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/fighter.svg @@ -0,0 +1 @@ + diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/monk.svg b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/monk.svg new file mode 100644 index 0000000..dccf6ac --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/monk.svg @@ -0,0 +1 @@ + diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/paladin.svg b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/paladin.svg new file mode 100644 index 0000000..615bc8f --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/paladin.svg @@ -0,0 +1 @@ + diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/ranger.svg b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/ranger.svg new file mode 100644 index 0000000..8defce6 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/ranger.svg @@ -0,0 +1 @@ + diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/rogue.svg b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/rogue.svg new file mode 100644 index 0000000..a5ebf42 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/rogue.svg @@ -0,0 +1 @@ + diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/sorcerer.svg b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/sorcerer.svg new file mode 100644 index 0000000..6fa42fb --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/sorcerer.svg @@ -0,0 +1 @@ + diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/warlock.svg b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/warlock.svg new file mode 100644 index 0000000..d84762e --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/warlock.svg @@ -0,0 +1 @@ + diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/wizard.svg b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/wizard.svg new file mode 100644 index 0000000..1df2853 --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/src/assets/icons/svg-icons/wizard.svg @@ -0,0 +1 @@ + From a7aaacb2e56b79e109dd7d4de06e229a08fdd863 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20G=C3=B3reczny?= Date: Wed, 30 Dec 2020 11:41:24 +0100 Subject: [PATCH 5/7] SES-116 Update icons rmd and package json --- .../SessionCompanion/ClientApp/package.json | 14 --------- .../src/app/shared/sc-icons/how-to.RMD | 29 ++---------------- .../src/app/shared/sc-icons/warning.png | Bin 3385 -> 0 bytes 3 files changed, 2 insertions(+), 41 deletions(-) delete mode 100644 SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/warning.png diff --git a/SessionCompanion/SessionCompanion/ClientApp/package.json b/SessionCompanion/SessionCompanion/ClientApp/package.json index 35cdd9e..8d97cb5 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/package.json +++ b/SessionCompanion/SessionCompanion/ClientApp/package.json @@ -6,23 +6,10 @@ "start": "ng serve", "build": "ng build", "build:ssr": "ng run SessionCompanion:server:dev", - "generate-icons": "svg-to-ts", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, - "svg-to-ts": { - "conversionType": "constants", - "srcFiles": [ - "./src/app/shared/sc-icons/icons/**/*.svg" - ], - "outputDirectory": "./src/app/shared/sc-icons/icons", - "interfaceName": "SessionCompanionIcon", - "typeName": "scIcon", - "prefix": "scIcon", - "fileName": "sc-icon.model", - "compileSources": true - }, "private": true, "dependencies": { "@angular/animations": "8.2.12", @@ -66,7 +53,6 @@ "karma-coverage-istanbul-reporter": "~2.1.0", "karma-jasmine": "~2.0.1", "karma-jasmine-html-reporter": "^1.4.2", - "svg-to-ts": "^6.0.0", "typescript": "3.5.3" }, "optionalDependencies": { diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/how-to.RMD b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/how-to.RMD index 5ba5504..b0d9081 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/how-to.RMD +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/how-to.RMD @@ -1,29 +1,4 @@ Moduł został już dodany i wstrzyknięty do roota apki. -Aby dodać nową ikonkę, plik svg wstawiamy do folderu icons/svg-icons. -Następnie wpisujemy w konsoli polecenie: -npm run generate-icons - -Zostaną wtedy utworzone nowe klasy z dodaną ikonką. - -Jeśli po tym będziemy chcieli użyć gdzieś naszej ikonki, nie pojawi się ona... -Jest to spowodowane tym, że nie chcemy, aby aplikacja wczytywała w jednym momencie wszystkie nasze ikonki a jedynie te potrzebne -Musi więc ją dodać w odpowiednim momencie do rejestru, w innym wypadku w konsoli dostaniemy komunikat: -![img.png](warning.png) - -Teraz zarejestrujmy naszą ikonkę: - -Dodajemy w konstruktorze danego komponentu: -```typescript -iconRegister: SessionCompanionIconsRegistry -``` - -Następnie dodajemy interesującą nas ikonkę: -```typescript -this.iconRegister.registerIcon(scIconBarbarian); -``` - -Samą ikonkę ładujemy w tagu -```html - -``` +Aby dodać nową ikonkę, plik svg wstawiamy do folderu assets/icons/svg-icons. +Oraz dodajym kolejnego enuma w pliku sc-icon.model.ts diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/warning.png b/SessionCompanion/SessionCompanion/ClientApp/src/app/shared/sc-icons/warning.png deleted file mode 100644 index d36ffcbb6a41427fd8599e13f441f4286f73b6ce..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3385 zcma)p@b#@;&+nh#AHP5D`*mH{{rcSZ{kmS){kq>*hMUW2IT>{s zF)=Z@KOF5m#Ka^(+xG9$QrokFBKpyGTTVxoC8L0Vi{ zRta#PdQ$dQdWyNp8|jptF#A07H3G1!%@!05B$yb&51JfNe#2bbX9rT&kpd7po(8=$ z{_S@KsbDL=gm2EhbuWf4^A{kPKEV!X10R0(`Rav=myHdK;Mw(}DDC)!gg+HdO8<6K zfl#Ei2lT@_nf~nQ!=J&E&LQq@<5yWZzuedwUENCD>c4JT%1?!~@!o&MUH>a~ko>iI zph@2D+YEGAC~EVGRa`YwFL z=h)C9tCYIrl_!5fUlp}^q1Crg8Hr^1`frqwxK_wu8vTN^X#H@YpafJ2Y=>LDgWE zc3#U#(q5%hyL^4Ht%1SxG=b(Qy-)!m(S6~Ps^ebai} zZe3lM2bL#_srl_C+^mXO+Vq`~t8hejh_0Cdp=(w++c=*AUiV;)NAwS2b8W7d zcjO$N&-Y-t2P#`?{^?utT5}968R^rP8uul}?NiMHl9Jy8WcFdv4&JAG8f0WZvWyZR z6_9El*bk(9*Doom9u=RsD3X{mHt>Q46q|2Wx`QXp8Vrx_dpA+KJ^(jzuDXD|HD$5J zk`>-+TcTyi|3i%FTsUnylBQIS@5PgS^Hu04VSf>}TqdmC zJTjfPb;R6g)8M|s*TQy}(J`wM# zPF++qyx%4vgghLF%7nzP6)YrcFpCcmp@*8kwn9#uinD{Xail#E{j7*4CZ?!OM5!;5 zM@MqLSv>4@DbQ(x6!Nx5MJHYtuAQUBCrwK*=>D=iHTt0jzfAEt2Ts-1cVm<+`EK>c zP5lH3KmNK{qgQIL;~+4vHTB`5S+zI+pY!Q7LWmpiY)?%rp0$fO=BY=u;xU5F0a z-+L^aJc$@e#q6L~dJ+u9}=bE1!CkY}LJ4^D0-^^S4QSdW_R}XC;Es^fxGHk_{7fXF#VZVP~`Yte= z-vgQy`l;b76t|5aFlOS!hO@LZfVO1xx(>z1El(v&N=^dJAN$+Cmwy{3Aux8oUSm-s zES!ig4(n5L$3^S)-vq`eta2V-&T$5?)#h~I82$RDJ+{{iT2rN{e54&V)sZXBGghZVh%)peJ`%zZyJY?T+MV>AVXcaLd`V#s^80Jf z^!OytBG%|f+Wr=_Bc87sDz?konVN4F=RFpL2TxTC_pKdITGe8yIpT*n~ikG`yJo9lq7;_E4vi69E-&s3v;u7C9HZks;xk& zDZjwN1ZS>7loNK(S5!Ul&|qE1^wm8pDu^6hkl@h^@8>CoNCf%MzB;3-x)=#eYB9md z=3KhsduG9i>3t>=4j7?bqLFtp(Tcg1)R|5fiWz2nSsPjCG6znN%}$S2MWv`- z$eDr&0WxPeI9?xOZ8~t9ez*B^O`?;ZS}zOF_tK1W_*&9 z<%kpmi!goUFy9xwDkIwI6vlc=C*6^yUI++U%7nlXh#3qGavGcev^@ng$?If;v}`FQ z1+|_gEvU0EHxGCj>QvK`69&0$d4k*zfLwelN1?s(c&Odk;rsIMGF#TVRtO>8*Uv7{ zmzOD@%f4nnmdYsQas9q-ldi>;hjshlX4ZmtWXY{ZwKe=~`rWFOPkpzx;`CEK>N!fM zBX<9_iS&qeyWk$cJI zDer4(8P`~0%-<}Rk|zZbF5EP3JG$B!OJxA4{8@MbX*+>yamdZW@)x3$G|r55D`vCc zJ;!r@|9D3-*nglD$gJ-y7r?!vZw=F8v-?(bx5Vjhhu(2Ad+~m%qf)cyRB(+)Z3aw| z0t0wxp|7PKGO@>W))q*7lEy9J+v{25X=D?PFNn=MBF=#^!&V-$_9(A3F6=|m0TFx3 z)NMd~%4dEsB7c1u%e`}LFevG=-%}s!{TfK7uN!r~TrXptZFwkabZ-=D9);co0@XDO zbbM1s-BvN+xzRL} z8V;?b45_0F_fk6?0c!_f^(a7AV7O zC2Ht>$noAZ=V9H1@EGf!G*2ya?Q!`2A_iwNND{h?r_7_5rZ5YaqLQtMaU4Obar&n> z+#>vFvp>ojT0aV)(n-B+;81Vdl#UfOGy>91F7P5(cxIQ8uQRS~f8OE9HHaDl89Wy1 z|3MQlF*DB~X35<2!rt=XMCvXQ)#sFM(Q{fC@hZMM{Zdo(TzeIZ*(zj^}MLmV{W$Y?n%w#1n8Bq^1#kVpn<6KjlB4!KmN> From 329ac81ed233e82a9eb87cc96516c82f39a07a3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20G=C3=B3reczny?= Date: Wed, 30 Dec 2020 11:43:57 +0100 Subject: [PATCH 6/7] SES-116 backend fix --- .../SessionCompanion/Controllers/CharacterController.cs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/SessionCompanion/SessionCompanion/Controllers/CharacterController.cs b/SessionCompanion/SessionCompanion/Controllers/CharacterController.cs index 15b16d9..d35eb6f 100644 --- a/SessionCompanion/SessionCompanion/Controllers/CharacterController.cs +++ b/SessionCompanion/SessionCompanion/Controllers/CharacterController.cs @@ -72,12 +72,6 @@ namespace SessionCompanion.Controllers public async Task, ErrorResponse>> GetLoggedUsersCharacters() { var connectedCharacters = _sessionHubData.ConnectedCharacters_Prop; - if (_sessionHubData.ConnectedCharacters_Prop.Count() == 0) - { - connectedCharacters.Add("a", 1); - connectedCharacters.Add("s", 2); - connectedCharacters.Add("d", 3); - } var characters = await _service.GetBasicCharactersData(connectedCharacters.Values.ToList()); return characters.ToList(); From 02d7304de347bdb2d86d7770abf6343061829f10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20G=C3=B3reczny?= Date: Wed, 30 Dec 2020 12:17:31 +0100 Subject: [PATCH 7/7] prettier config --- .../SessionCompanion/ClientApp/.prettierrc | 3 + .../ClientApp/package-lock.json | 707 +----------------- .../SessionCompanion/ClientApp/package.json | 1 + .../game-master-dashboard.component.html | 142 ++-- .../game-master-dashboard.component.ts | 52 +- 5 files changed, 145 insertions(+), 760 deletions(-) create mode 100644 SessionCompanion/SessionCompanion/ClientApp/.prettierrc diff --git a/SessionCompanion/SessionCompanion/ClientApp/.prettierrc b/SessionCompanion/SessionCompanion/ClientApp/.prettierrc new file mode 100644 index 0000000..544138b --- /dev/null +++ b/SessionCompanion/SessionCompanion/ClientApp/.prettierrc @@ -0,0 +1,3 @@ +{ + "singleQuote": true +} diff --git a/SessionCompanion/SessionCompanion/ClientApp/package-lock.json b/SessionCompanion/SessionCompanion/ClientApp/package-lock.json index a4391a2..d012404 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/package-lock.json +++ b/SessionCompanion/SessionCompanion/ClientApp/package-lock.json @@ -2976,12 +2976,6 @@ "integrity": "sha512-JNbGaHFCLwgHn/iCckiGSOZ1XYHsKFwREtzPwSGCVld1SGhOlmZw2D4ZI94HQCrBHbADzW9m4LER/8olJTRGHA==", "dev": true }, - "@types/parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", - "dev": true - }, "@types/q": { "version": "0.0.32", "resolved": "https://registry.npmjs.org/@types/q/-/q-0.0.32.tgz", @@ -3880,12 +3874,6 @@ "multicast-dns-service-types": "^1.1.0" } }, - "boolbase": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", - "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=", - "dev": true - }, "bootstrap": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.4.1.tgz", @@ -4321,12 +4309,6 @@ "restore-cursor": "^3.1.0" } }, - "cli-spinners": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.5.0.tgz", - "integrity": "sha512-PC+AmIuK04E6aeSs/pUccSujsTzBhu4HzC2dL+CfJB/Jcc2qTRbEwZQDfIUpt2Xl8BodYBEq8w4fc0kU2I9DjQ==", - "dev": true - }, "cli-width": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", @@ -4361,54 +4343,6 @@ "shallow-clone": "^3.0.0" } }, - "coa": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/coa/-/coa-2.0.2.tgz", - "integrity": "sha512-q5/jG+YQnSy4nRTV4F7lPepBJZ8qBNJJDBuJdoejDyLXgmL7IEo+Le2JDZudFTFt7mrCqIRaSjws4ygRCTCAXA==", - "dev": true, - "requires": { - "@types/q": "^1.5.1", - "chalk": "^2.4.1", - "q": "^1.1.2" - }, - "dependencies": { - "@types/q": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.4.tgz", - "integrity": "sha512-1HcDas8SEj4z1Wc696tH56G8OlRaH/sqZOynNNB+HF0WOeXPaxTtbYzJY2oEfiUxjSKjhCKr+MvR7dCHcEelug==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", @@ -4947,24 +4881,6 @@ "integrity": "sha1-Mh9s9zeCpv91ERE5D8BeLGV9jJs=", "dev": true }, - "css-select": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-2.1.0.tgz", - "integrity": "sha512-Dqk7LQKpwLoH3VovzZnkzegqNSuAziQyNZUcrdDM401iY+R5NkGBXGmtO05/yaXQziALuPogeG0b7UAgjnTJTQ==", - "dev": true, - "requires": { - "boolbase": "^1.0.0", - "css-what": "^3.2.1", - "domutils": "^1.7.0", - "nth-check": "^1.0.2" - } - }, - "css-select-base-adapter": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/css-select-base-adapter/-/css-select-base-adapter-0.1.1.tgz", - "integrity": "sha512-jQVeeRG70QI08vSTwf1jHxp74JoZsr2XSgETae8/xC8ovSnL2WF87GTLO86Sbwdt2lK4Umg4HnnwMO4YF3Ce7w==", - "dev": true - }, "css-selector-tokenizer": { "version": "0.7.1", "resolved": "https://registry.npmjs.org/css-selector-tokenizer/-/css-selector-tokenizer-0.7.1.tgz", @@ -5016,30 +4932,6 @@ } } }, - "css-tree": { - "version": "1.0.0-alpha.37", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha.37.tgz", - "integrity": "sha512-DMxWJg0rnz7UgxKT0Q1HU/L9BeJI0M6ksor0OgqOnF+aRCDWg/N2641HmVyU9KVIu0OVVWOb2IpC9A+BJRnejg==", - "dev": true, - "requires": { - "mdn-data": "2.0.4", - "source-map": "^0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "css-what": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-3.4.2.tgz", - "integrity": "sha512-ACUm3L0/jiZTqfzRM3Hi9Q8eZqd6IK37mMWPLz9PJxkLWllYeRf+EHUSHYEtFop2Eqytaq1FizFVh7XfBnXCDQ==", - "dev": true - }, "cssauron": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/cssauron/-/cssauron-1.4.0.tgz", @@ -5049,39 +4941,6 @@ "through": "X.X.X" } }, - "csso": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/csso/-/csso-4.2.0.tgz", - "integrity": "sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==", - "dev": true, - "requires": { - "css-tree": "^1.1.2" - }, - "dependencies": { - "css-tree": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.2.tgz", - "integrity": "sha512-wCoWush5Aeo48GLhfHPbmvZs59Z+M7k5+B1xDnXbdWNcEF423DoFdqSWE0PM5aNk5nI5cp1q7ms36zGApY/sKQ==", - "dev": true, - "requires": { - "mdn-data": "2.0.14", - "source-map": "^0.6.1" - } - }, - "mdn-data": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz", - "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, "currently-unhandled": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", @@ -5189,23 +5048,6 @@ } } }, - "defaults": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", - "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", - "dev": true, - "requires": { - "clone": "^1.0.2" - }, - "dependencies": { - "clone": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", - "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", - "dev": true - } - } - }, "define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", @@ -5412,24 +5254,6 @@ "void-elements": "^2.0.0" } }, - "dom-serializer": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", - "integrity": "sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==", - "dev": true, - "requires": { - "domelementtype": "^2.0.1", - "entities": "^2.0.0" - }, - "dependencies": { - "domelementtype": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.1.0.tgz", - "integrity": "sha512-LsTgx/L5VpD+Q8lmsXSHW2WpA+eBlZ9HPf3erD1IoPF00/3JKHZ3BknUVA2QGDNu69ZNmyFmCWBSO45XjYKC5w==", - "dev": true - } - } - }, "domain-browser": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", @@ -5451,27 +5275,11 @@ "isomorphic-fetch": "^2.2.1" } }, - "domelementtype": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", - "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==", - "dev": true - }, "domino": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/domino/-/domino-2.1.4.tgz", "integrity": "sha512-l70mlQ7IjPKC8kT7GljQXJZmt5OqFL+RE91ik5y5WWQtsd9wP8R7gpFnNu96fK5MqAAZRXfLLsnzKtkty5fWGQ==" }, - "domutils": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz", - "integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==", - "dev": true, - "requires": { - "dom-serializer": "0", - "domelementtype": "1" - } - }, "duplexify": { "version": "3.7.1", "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", @@ -5685,12 +5493,6 @@ "integrity": "sha1-6WQhkyWiHQX0RGai9obtbOX13R0=", "dev": true }, - "entities": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz", - "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==", - "dev": true - }, "err-code": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/err-code/-/err-code-1.1.2.tgz", @@ -7375,12 +7177,6 @@ "is-extglob": "^2.1.1" } }, - "is-interactive": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", - "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", - "dev": true - }, "is-negative-zero": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", @@ -8240,12 +8036,6 @@ "immediate": "~3.0.5" } }, - "lines-and-columns": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", - "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", - "dev": true - }, "load-json-file": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", @@ -8297,90 +8087,12 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" }, - "lodash.camelcase": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=", - "dev": true - }, "lodash.clonedeep": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", "dev": true }, - "lodash.kebabcase": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz", - "integrity": "sha1-hImxyw0p/4gZXM7KRI/21swpXDY=", - "dev": true - }, - "lodash.snakecase": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", - "integrity": "sha1-OdcUo1NXFHg3rv1ktdy7Fr7Nj40=", - "dev": true - }, - "log-symbols": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", - "integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==", - "dev": true, - "requires": { - "chalk": "^4.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, "log4js": { "version": "4.5.1", "resolved": "https://registry.npmjs.org/log4js/-/log4js-4.5.1.tgz", @@ -8555,12 +8267,6 @@ "safe-buffer": "^5.1.2" } }, - "mdn-data": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.4.tgz", - "integrity": "sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA==", - "dev": true - }, "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -9248,15 +8954,6 @@ "set-blocking": "~2.0.0" } }, - "nth-check": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz", - "integrity": "sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==", - "dev": true, - "requires": { - "boolbase": "~1.0.0" - } - }, "num2fraction": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/num2fraction/-/num2fraction-1.2.2.tgz", @@ -9454,73 +9151,6 @@ "isobject": "^3.0.1" } }, - "object.values": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.2.tgz", - "integrity": "sha512-MYC0jvJopr8EK6dPBiO8Nb9mvjdypOachO5REGk6MXzujbBrAisKo3HmdEI6kZDL6fC31Mwee/5YbtMebixeag==", - "dev": true, - "requires": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "es-abstract": "^1.18.0-next.1", - "has": "^1.0.3" - }, - "dependencies": { - "es-abstract": { - "version": "1.18.0-next.1", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz", - "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==", - "dev": true, - "requires": { - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.2.2", - "is-negative-zero": "^2.0.0", - "is-regex": "^1.1.1", - "object-inspect": "^1.8.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.1", - "string.prototype.trimend": "^1.0.1", - "string.prototype.trimstart": "^1.0.1" - } - }, - "is-callable": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", - "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==", - "dev": true - }, - "is-regex": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", - "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", - "dev": true, - "requires": { - "has-symbols": "^1.0.1" - } - }, - "object-inspect": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.9.0.tgz", - "integrity": "sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw==", - "dev": true - }, - "object.assign": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", - "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", - "dev": true, - "requires": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "has-symbols": "^1.0.1", - "object-keys": "^1.1.1" - } - } - } - }, "obuf": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", @@ -9595,88 +9225,6 @@ "is-wsl": "^1.1.0" } }, - "ora": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/ora/-/ora-5.1.0.tgz", - "integrity": "sha512-9tXIMPvjZ7hPTbk8DFq1f7Kow/HU/pQYB60JbNq+QnGwcyhWVZaQ4hM9zQDEsPxw/muLpgiHSaumUZxCAmod/w==", - "dev": true, - "requires": { - "chalk": "^4.1.0", - "cli-cursor": "^3.1.0", - "cli-spinners": "^2.4.0", - "is-interactive": "^1.0.0", - "log-symbols": "^4.0.0", - "mute-stream": "0.0.8", - "strip-ansi": "^6.0.0", - "wcwidth": "^1.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, "original": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/original/-/original-1.0.2.tgz", @@ -9865,23 +9413,6 @@ "readable-stream": "^2.1.5" } }, - "parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "requires": { - "callsites": "^3.0.0" - }, - "dependencies": { - "callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true - } - } - }, "parse-asn1": { "version": "5.1.5", "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.5.tgz", @@ -10217,9 +9748,9 @@ "dev": true }, "prettier": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", - "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.2.1.tgz", + "integrity": "sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==", "dev": true }, "private": { @@ -10526,7 +10057,8 @@ "q": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/q/-/q-1.4.1.tgz", - "integrity": "sha1-VXBbzZPF82c1MMLCy8DCs63cKG4=" + "integrity": "sha1-VXBbzZPF82c1MMLCy8DCs63cKG4=", + "optional": true }, "qjobs": { "version": "1.2.0", @@ -11077,7 +10609,8 @@ "sax": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "optional": true }, "schema-utils": { "version": "1.0.0", @@ -11923,12 +11456,6 @@ "figgy-pudding": "^3.5.1" } }, - "stable": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz", - "integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==", - "dev": true - }, "static-extend": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", @@ -12208,187 +11735,6 @@ "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", "optional": true }, - "svg-to-ts": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/svg-to-ts/-/svg-to-ts-6.0.0.tgz", - "integrity": "sha512-QdznpIJfuTjP//zY007BhOYAe4ZOII1XviNgmvhgfEnl6MxTyLJWL20JgECvjGJHD+F8DqKOnt7YU7UmUFD6LQ==", - "dev": true, - "requires": { - "chalk": "^3.0.0", - "commander": "^4.0.1", - "cosmiconfig": "^6.0.0", - "glob": "^7.1.6", - "lodash.camelcase": "^4.3.0", - "lodash.kebabcase": "^4.1.1", - "lodash.snakecase": "^4.1.1", - "ora": "^5.1.0", - "prettier": "^1.19.1", - "svgo": "^1.3.2", - "typescript": "^3.7.2" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", - "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "commander": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", - "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", - "dev": true - }, - "cosmiconfig": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", - "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", - "dev": true, - "requires": { - "@types/parse-json": "^4.0.0", - "import-fresh": "^3.1.0", - "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.7.2" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "requires": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - } - }, - "parse-json": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz", - "integrity": "sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" - } - }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true - }, - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - }, - "typescript": { - "version": "3.9.7", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz", - "integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==", - "dev": true - } - } - }, - "svgo": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/svgo/-/svgo-1.3.2.tgz", - "integrity": "sha512-yhy/sQYxR5BkC98CY7o31VGsg014AKLEPxdfhora76l36hD9Rdy5NZA/Ocn6yayNPgSamYdtX2rFJdcv07AYVw==", - "dev": true, - "requires": { - "chalk": "^2.4.1", - "coa": "^2.0.2", - "css-select": "^2.0.0", - "css-select-base-adapter": "^0.1.1", - "css-tree": "1.0.0-alpha.37", - "csso": "^4.0.2", - "js-yaml": "^3.13.1", - "mkdirp": "~0.5.1", - "object.values": "^1.1.0", - "sax": "~1.2.4", - "stable": "^0.1.8", - "unquote": "~1.1.1", - "util.promisify": "~1.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, "symbol-observable": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", @@ -12700,6 +12046,12 @@ } } }, + "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", @@ -12860,12 +12212,6 @@ "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", "dev": true }, - "unquote": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/unquote/-/unquote-1.1.1.tgz", - "integrity": "sha1-j97XMk7G6IoP+LkF58CYzcCG1UQ=", - "dev": true - }, "unset-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", @@ -12990,18 +12336,6 @@ "object.getownpropertydescriptors": "^2.0.3" } }, - "util.promisify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.1.tgz", - "integrity": "sha512-g9JpC/3He3bm38zsLupWryXHoEcS22YHthuPQSJdMy6KNrzIRzWqcsHzD/WUnqe45whVou4VIsPew37DoXWNrA==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.2", - "has-symbols": "^1.0.1", - "object.getownpropertydescriptors": "^2.1.0" - } - }, "utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", @@ -13766,15 +13100,6 @@ "minimalistic-assert": "^1.0.0" } }, - "wcwidth": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", - "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", - "dev": true, - "requires": { - "defaults": "^1.0.3" - } - }, "webdriver-js-extender": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/webdriver-js-extender/-/webdriver-js-extender-2.1.0.tgz", @@ -14992,12 +14317,6 @@ "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", "optional": true }, - "yaml": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.0.tgz", - "integrity": "sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg==", - "dev": true - }, "yargs": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz", diff --git a/SessionCompanion/SessionCompanion/ClientApp/package.json b/SessionCompanion/SessionCompanion/ClientApp/package.json index 8d97cb5..5e89112 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/package.json +++ b/SessionCompanion/SessionCompanion/ClientApp/package.json @@ -53,6 +53,7 @@ "karma-coverage-istanbul-reporter": "~2.1.0", "karma-jasmine": "~2.0.1", "karma-jasmine-html-reporter": "^1.4.2", + "prettier": "2.2.1", "typescript": "3.5.3" }, "optionalDependencies": { 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 da56f17..34918b5 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 @@ -1,48 +1,96 @@ -
- - -
- -
- - - - folder - Link 1 - - - folder - Link 2 - - - folder - Link 3 - - -
- - - SessionCompanion - - - -
- - -
- - - - - {{(loggedCharacter.name.length>12)? (loggedCharacter.name | slice:0:12)+'..':(loggedCharacter.name)}} - - -
-
+
+ + +
+ +
+ + + + folder + Link 1 + + + folder + Link 2 + + + folder + Link 3 + + +
+ + + SessionCompanion + + + +
+ + +
+ + + + + {{ + loggedCharacter.name.length > 12 + ? (loggedCharacter.name | slice: 0:12) + '..' + : loggedCharacter.name + }} + + +
+
diff --git a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.ts b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.ts index 5f6a7b4..d93a20e 100644 --- a/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.ts +++ b/SessionCompanion/SessionCompanion/ClientApp/src/app/components/game-master-dashboard/game-master-dashboard.component.ts @@ -1,18 +1,21 @@ -import {Component, OnDestroy, OnInit} from '@angular/core'; -import {animateText, onSideNavChange} from '../../shared/animations/sidenav-animations'; -import {GMSignalRService} from '../../shared/signalR-service/gm-signalR.service'; -import {CharacterService} from '../../../services/character.service'; -import {Subscription} from 'rxjs'; -import {ErrorResponse} from '../../../types/ErrorResponse'; -import {HttpErrorResponse} from '@angular/common/http'; -import {LoggedCharactersViewModel} from '../../../types/viewmodels/character-viewmodels/LoggedCharactersViewModel'; +import { Component, OnDestroy, OnInit } from '@angular/core'; +import { + animateText, + onSideNavChange, +} from '../../shared/animations/sidenav-animations'; +import { GMSignalRService } from '../../shared/signalR-service/gm-signalR.service'; +import { CharacterService } from '../../../services/character.service'; +import { Subscription } from 'rxjs'; +import { ErrorResponse } from '../../../types/ErrorResponse'; +import { HttpErrorResponse } from '@angular/common/http'; +import { LoggedCharactersViewModel } from '../../../types/viewmodels/character-viewmodels/LoggedCharactersViewModel'; import { first } from 'rxjs/operators'; @Component({ selector: 'app-game-master-dashboard', templateUrl: './game-master-dashboard.component.html', styleUrls: ['./game-master-dashboard.component.css'], - animations: [onSideNavChange, animateText] + animations: [onSideNavChange, animateText], }) export class GameMasterDashboardComponent implements OnInit, OnDestroy { allSubscriptions = new Subscription(); @@ -23,7 +26,10 @@ export class GameMasterDashboardComponent implements OnInit, OnDestroy { rightSidenavTextExpanded = false; loggedCharacters: LoggedCharactersViewModel[]; - constructor(private signalRService: GMSignalRService, private characterService: CharacterService) { + constructor( + private signalRService: GMSignalRService, + private characterService: CharacterService + ) { this.SubscribeToEvents(); } @@ -49,20 +55,28 @@ export class GameMasterDashboardComponent implements OnInit, OnDestroy { } UpdateCharactersList(): void { - this.characterService.getLoggedCharacters().pipe(first()).subscribe((success) => { - this.loggedCharacters = success; - }, - (error: ErrorResponse | HttpErrorResponse) => { - if (error instanceof HttpErrorResponse) { - error = error.error as ErrorResponse; + this.characterService + .getLoggedCharacters() + .pipe(first()) + .subscribe( + (success) => { + this.loggedCharacters = success; + }, + (error: ErrorResponse | HttpErrorResponse) => { + if (error instanceof HttpErrorResponse) { + error = error.error as ErrorResponse; + } + console.error(error.message); } - console.error(error.message); - }); + ); } private SubscribeToEvents(): void { this.signalRService.message.subscribe((message: string) => { - if (message === 'New player connected' || message === 'Player disconnected') { + if ( + message === 'New player connected' || + message === 'Player disconnected' + ) { this.UpdateCharactersList(); } });