From 086224d87737388b25e5c9d2c82325414a4b1db0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francesco=20Borz=C3=AC?= Date: Fri, 12 Apr 2024 22:38:52 +0200 Subject: [PATCH] refactor(editor-components): replace constructors with inject() (#2875) --- apps/keira/src/app/app.component.ts | 4 ++-- .../src/edit-conditions/conditions.component.ts | 11 +++-------- .../creature-equip-template.component.ts | 11 +++-------- .../creature-loot-template.component.ts | 11 +++-------- .../creature-onkill-reputation.component.ts | 11 +++-------- .../creature-questitem.component.ts | 11 +++-------- .../creature-spawn-addon.component.ts | 11 +++-------- .../creature-spawn/creature-spawn.component.ts | 11 +++-------- .../creature-template-addon.component.ts | 11 +++-------- .../creature-template-movement.component.ts | 11 +++-------- .../creature-template-resistance.component.ts | 11 +++-------- .../creature-template-spell.component.ts | 11 +++-------- .../creature-template.component.ts | 11 +++-------- .../src/npc-trainer/npc-trainer.component.ts | 13 ++++--------- .../src/npc-vendor/npc-vendor.component.ts | 11 +++-------- .../pickpocketing-loot-template.component.ts | 11 +++-------- .../src/sai-creature/sai-creature.component.ts | 11 +++-------- .../skinning-loot-template.component.ts | 11 +++-------- .../gameobject-loot-template.component.ts | 11 +++-------- .../gameobject-questitem.component.ts | 11 +++-------- .../gameobject-spawn-addon.component.ts | 11 +++-------- .../gameobject-spawn.component.ts | 11 +++-------- .../gameobject-template-addon.component.ts | 11 +++-------- .../gameobject-template.component.ts | 11 +++-------- .../sai-gameobject/sai-gameobject.component.ts | 11 +++-------- .../gossip-menu-option.component.ts | 11 +++-------- .../src/gossip-menu/gossip-menu.component.ts | 13 ++++--------- .../disenchant-loot-template.component.ts | 11 +++-------- .../item-enchantment-template.component.ts | 11 +++-------- .../item-loot-template.component.ts | 11 +++-------- .../item-template/item-template.component.ts | 17 ++++++----------- .../milling-loot-template.component.ts | 11 +++-------- .../prospecting-loot-template.component.ts | 11 +++-------- .../fishing-loot-template.component.ts | 11 +++-------- .../mail-loot/mail-loot-template.component.ts | 11 +++-------- .../reference-loot-template.component.ts | 11 +++-------- .../spell-loot/spell-loot-template.component.ts | 11 +++-------- .../creature-questender.component.ts | 13 ++++--------- .../creature-queststarter.component.ts | 13 ++++--------- .../gameobject-questender.component.ts | 13 ++++--------- .../gameobject-queststarter.component.ts | 13 ++++--------- .../quest-offer-reward.component.ts | 13 ++++--------- .../quest-request-items.component.ts | 15 +++++---------- .../quest-template-addon.component.ts | 15 +++++---------- .../quest-template/quest-template.component.ts | 15 +++++---------- .../spell/src/spell-dbc/spell-dbc.component.ts | 11 +++-------- .../src/components/editors/editor.component.ts | 10 +++------- .../loot-template/loot-template-id.component.ts | 11 +++-------- .../editors/multi-row-editor.component.ts | 11 +++-------- .../editors/single-row-editor.component.ts | 9 ++------- .../sai-editor/src/sai-editor.component.ts | 13 ++++--------- .../src/switch-language.component.ts | 2 +- 52 files changed, 169 insertions(+), 418 deletions(-) diff --git a/apps/keira/src/app/app.component.ts b/apps/keira/src/app/app.component.ts index 7d20b704e4..d5153e51ea 100644 --- a/apps/keira/src/app/app.component.ts +++ b/apps/keira/src/app/app.component.ts @@ -31,8 +31,8 @@ export class AppComponent extends SubscriptionHandler implements OnInit { sqliteResult: { id: number; name: string }; constructor( - public readonly mysqlService: MysqlService, - public readonly toastrService: ToastrService, + readonly mysqlService: MysqlService, + readonly toastrService: ToastrService, private readonly sqliteQueryService: SqliteQueryService, private readonly electronService: ElectronService, private readonly http: HttpClient, diff --git a/libs/features/conditions/src/edit-conditions/conditions.component.ts b/libs/features/conditions/src/edit-conditions/conditions.component.ts index 7677f0b501..34c0e42db6 100644 --- a/libs/features/conditions/src/edit-conditions/conditions.component.ts +++ b/libs/features/conditions/src/edit-conditions/conditions.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { SingleRowEditorComponent } from '@keira/shared/base-abstract-classes'; import { CONDITION_DISTANCE_TO_CV3, @@ -145,11 +145,6 @@ export class ConditionsComponent extends SingleRowEditorComponent { return this.conditionType === CONDITION_TYPES.CONDITION_STAND_STATE; } - /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 - constructor( - public editorService: ConditionsService, - public handlerService: ConditionsHandlerService, - ) { - super(editorService, handlerService); - } + readonly editorService = inject(ConditionsService); + readonly handlerService = inject(ConditionsHandlerService); } diff --git a/libs/features/creature/src/creature-equip-template/creature-equip-template.component.ts b/libs/features/creature/src/creature-equip-template/creature-equip-template.component.ts index d6976af54c..ece98dbf59 100644 --- a/libs/features/creature/src/creature-equip-template/creature-equip-template.component.ts +++ b/libs/features/creature/src/creature-equip-template/creature-equip-template.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { SingleRowEditorComponent } from '@keira/shared/base-abstract-classes'; import { CreatureEquipTemplate } from '@keira/shared/acore-world-model'; import { CreatureHandlerService } from '../creature-handler.service'; @@ -28,11 +28,6 @@ import { TopBarComponent } from '@keira/shared/base-editor-components'; ], }) export class CreatureEquipTemplateComponent extends SingleRowEditorComponent { - /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 - constructor( - public editorService: CreatureEquipTemplateService, - public handlerService: CreatureHandlerService, - ) { - super(editorService, handlerService); - } + readonly editorService = inject(CreatureEquipTemplateService); + readonly handlerService = inject(CreatureHandlerService); } diff --git a/libs/features/creature/src/creature-loot-template/creature-loot-template.component.ts b/libs/features/creature/src/creature-loot-template/creature-loot-template.component.ts index ec463c7cf7..aa0a2bf31d 100644 --- a/libs/features/creature/src/creature-loot-template/creature-loot-template.component.ts +++ b/libs/features/creature/src/creature-loot-template/creature-loot-template.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { LootTemplateIdComponent } from '@keira/shared/base-abstract-classes'; import { CreatureLootTemplate } from '@keira/shared/acore-world-model'; import { CreatureHandlerService } from '../creature-handler.service'; @@ -15,11 +15,6 @@ import { TopBarComponent } from '@keira/shared/base-editor-components'; imports: [TopBarComponent, LootEditorComponent], }) export class CreatureLootTemplateComponent extends LootTemplateIdComponent { - /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 - constructor( - public editorService: CreatureLootTemplateService, - public handlerService: CreatureHandlerService, - ) { - super(editorService, handlerService); - } + readonly editorService = inject(CreatureLootTemplateService); + readonly handlerService = inject(CreatureHandlerService); } diff --git a/libs/features/creature/src/creature-onkill-reputation/creature-onkill-reputation.component.ts b/libs/features/creature/src/creature-onkill-reputation/creature-onkill-reputation.component.ts index b4f2f0605f..fd3a11c741 100644 --- a/libs/features/creature/src/creature-onkill-reputation/creature-onkill-reputation.component.ts +++ b/libs/features/creature/src/creature-onkill-reputation/creature-onkill-reputation.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { SingleRowEditorComponent } from '@keira/shared/base-abstract-classes'; import { CreatureOnkillReputation, FACTION_RANK } from '@keira/shared/acore-world-model'; import { CreatureHandlerService } from '../creature-handler.service'; @@ -32,11 +32,6 @@ import { TopBarComponent } from '@keira/shared/base-editor-components'; export class CreatureOnkillReputationComponent extends SingleRowEditorComponent { readonly FACTION_RANK = FACTION_RANK; - /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 - constructor( - public editorService: CreatureOnkillReputationService, - public handlerService: CreatureHandlerService, - ) { - super(editorService, handlerService); - } + readonly editorService = inject(CreatureOnkillReputationService); + readonly handlerService = inject(CreatureHandlerService); } diff --git a/libs/features/creature/src/creature-questitem/creature-questitem.component.ts b/libs/features/creature/src/creature-questitem/creature-questitem.component.ts index 9d8fcefb9d..a4a623437e 100644 --- a/libs/features/creature/src/creature-questitem/creature-questitem.component.ts +++ b/libs/features/creature/src/creature-questitem/creature-questitem.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { MultiRowEditorComponent } from '@keira/shared/base-abstract-classes'; import { CreatureQuestitem } from '@keira/shared/acore-world-model'; import { CreatureHandlerService } from '../creature-handler.service'; @@ -33,11 +33,6 @@ import { TopBarComponent } from '@keira/shared/base-editor-components'; ], }) export class CreatureQuestitemComponent extends MultiRowEditorComponent { - /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 - constructor( - public editorService: CreatureQuestitemService, - public handlerService: CreatureHandlerService, - ) { - super(editorService, handlerService); - } + readonly editorService = inject(CreatureQuestitemService); + readonly handlerService = inject(CreatureHandlerService); } diff --git a/libs/features/creature/src/creature-spawn-addon/creature-spawn-addon.component.ts b/libs/features/creature/src/creature-spawn-addon/creature-spawn-addon.component.ts index 24def37fa7..1dc9045364 100644 --- a/libs/features/creature/src/creature-spawn-addon/creature-spawn-addon.component.ts +++ b/libs/features/creature/src/creature-spawn-addon/creature-spawn-addon.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { MultiRowEditorComponent } from '@keira/shared/base-abstract-classes'; import { CREATURE_ADDON_BYTES_1, CREATURE_ADDON_BYTES_2, CreatureSpawnAddon, EMOTE } from '@keira/shared/acore-world-model'; import { CreatureHandlerService } from '../creature-handler.service'; @@ -34,11 +34,6 @@ export class CreatureSpawnAddonComponent extends MultiRowEditorComponent { - /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 - constructor( - public editorService: NpcTrainerService, - public handlerService: CreatureHandlerService, - readonly sqliteQueryService: SqliteQueryService, - ) { - super(editorService, handlerService); - } + readonly editorService = inject(NpcTrainerService); + readonly handlerService = inject(CreatureHandlerService); + readonly sqliteQueryService = inject(SqliteQueryService); } diff --git a/libs/features/creature/src/npc-vendor/npc-vendor.component.ts b/libs/features/creature/src/npc-vendor/npc-vendor.component.ts index d82e827314..0b67a45fb9 100644 --- a/libs/features/creature/src/npc-vendor/npc-vendor.component.ts +++ b/libs/features/creature/src/npc-vendor/npc-vendor.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { MultiRowEditorComponent } from '@keira/shared/base-abstract-classes'; import { NpcVendor } from '@keira/shared/acore-world-model'; import { CreatureHandlerService } from '../creature-handler.service'; @@ -36,11 +36,6 @@ import { TopBarComponent } from '@keira/shared/base-editor-components'; ], }) export class NpcVendorComponent extends MultiRowEditorComponent { - /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 - constructor( - public editorService: NpcVendorService, - public handlerService: CreatureHandlerService, - ) { - super(editorService, handlerService); - } + readonly editorService = inject(NpcVendorService); + readonly handlerService = inject(CreatureHandlerService); } diff --git a/libs/features/creature/src/pickpocketing-loot-template/pickpocketing-loot-template.component.ts b/libs/features/creature/src/pickpocketing-loot-template/pickpocketing-loot-template.component.ts index aefe337afe..7240a2fba4 100644 --- a/libs/features/creature/src/pickpocketing-loot-template/pickpocketing-loot-template.component.ts +++ b/libs/features/creature/src/pickpocketing-loot-template/pickpocketing-loot-template.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { LootTemplateIdComponent } from '@keira/shared/base-abstract-classes'; import { PickpocketingLootTemplate } from '@keira/shared/acore-world-model'; import { CreatureHandlerService } from '../creature-handler.service'; @@ -15,11 +15,6 @@ import { TopBarComponent } from '@keira/shared/base-editor-components'; imports: [TopBarComponent, NgIf, LootEditorComponent], }) export class PickpocketingLootTemplateComponent extends LootTemplateIdComponent { - /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 - constructor( - public editorService: PickpocketingLootTemplateService, - public handlerService: CreatureHandlerService, - ) { - super(editorService, handlerService); - } + readonly editorService = inject(PickpocketingLootTemplateService); + readonly handlerService = inject(CreatureHandlerService); } diff --git a/libs/features/creature/src/sai-creature/sai-creature.component.ts b/libs/features/creature/src/sai-creature/sai-creature.component.ts index 4b5ccc6e96..9a25a8ec22 100644 --- a/libs/features/creature/src/sai-creature/sai-creature.component.ts +++ b/libs/features/creature/src/sai-creature/sai-creature.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { SaiEditorComponent } from '@keira/shared/sai-editor'; import { SaiCreatureHandlerService } from '../sai-creature-handler.service'; import { SaiCreatureEditorService } from './sai-creature-editor.service'; @@ -33,11 +33,6 @@ import { SaiTopBarComponent } from '@keira/shared/sai-editor'; ], }) export class SaiCreatureComponent extends SaiEditorComponent { - /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 - constructor( - public editorService: SaiCreatureEditorService, - protected handlerService: SaiCreatureHandlerService, - ) { - super(editorService, handlerService); - } + readonly editorService = inject(SaiCreatureEditorService); + protected readonly handlerService = inject(SaiCreatureHandlerService); } diff --git a/libs/features/creature/src/skinning-loot-template/skinning-loot-template.component.ts b/libs/features/creature/src/skinning-loot-template/skinning-loot-template.component.ts index 1a0b9b4958..faf37ae169 100644 --- a/libs/features/creature/src/skinning-loot-template/skinning-loot-template.component.ts +++ b/libs/features/creature/src/skinning-loot-template/skinning-loot-template.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { LootTemplateIdComponent } from '@keira/shared/base-abstract-classes'; import { SkinningLootTemplate } from '@keira/shared/acore-world-model'; import { CreatureHandlerService } from '../creature-handler.service'; @@ -15,11 +15,6 @@ import { TopBarComponent } from '@keira/shared/base-editor-components'; imports: [TopBarComponent, NgIf, LootEditorComponent], }) export class SkinningLootTemplateComponent extends LootTemplateIdComponent { - /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 - constructor( - public editorService: SkinningLootTemplateService, - public handlerService: CreatureHandlerService, - ) { - super(editorService, handlerService); - } + readonly editorService = inject(SkinningLootTemplateService); + readonly handlerService = inject(CreatureHandlerService); } diff --git a/libs/features/gameobject/src/gameobject-loot-template/gameobject-loot-template.component.ts b/libs/features/gameobject/src/gameobject-loot-template/gameobject-loot-template.component.ts index a799b238c6..0b692b4b1c 100644 --- a/libs/features/gameobject/src/gameobject-loot-template/gameobject-loot-template.component.ts +++ b/libs/features/gameobject/src/gameobject-loot-template/gameobject-loot-template.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject, OnInit } from '@angular/core'; import { LootTemplateIdComponent } from '@keira/shared/base-abstract-classes'; import { GameobjectLootTemplate } from '@keira/shared/acore-world-model'; import { QueryError } from 'mysql2'; @@ -36,13 +36,8 @@ export class GameobjectLootTemplateComponent extends LootTemplateIdComponent { - /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 - constructor( - public editorService: GameobjectQuestitemService, - public handlerService: GameobjectHandlerService, - ) { - super(editorService, handlerService); - } + readonly editorService = inject(GameobjectQuestitemService); + readonly handlerService = inject(GameobjectHandlerService); } diff --git a/libs/features/gameobject/src/gameobject-spawn-addon/gameobject-spawn-addon.component.ts b/libs/features/gameobject/src/gameobject-spawn-addon/gameobject-spawn-addon.component.ts index 4aa76af267..3c55424b47 100644 --- a/libs/features/gameobject/src/gameobject-spawn-addon/gameobject-spawn-addon.component.ts +++ b/libs/features/gameobject/src/gameobject-spawn-addon/gameobject-spawn-addon.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { MultiRowEditorComponent } from '@keira/shared/base-abstract-classes'; import { GameobjectSpawnAddon, INVISIBILITY_TYPE } from '@keira/shared/acore-world-model'; import { GameobjectHandlerService } from '../gameobject-handler.service'; @@ -31,11 +31,6 @@ import { TopBarComponent } from '@keira/shared/base-editor-components'; export class GameobjectSpawnAddonComponent extends MultiRowEditorComponent { readonly INVISIBILITY_TYPE = INVISIBILITY_TYPE; - /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 - constructor( - public editorService: GameobjectSpawnAddonService, - public handlerService: GameobjectHandlerService, - ) { - super(editorService, handlerService); - } + readonly editorService = inject(GameobjectSpawnAddonService); + readonly handlerService = inject(GameobjectHandlerService); } diff --git a/libs/features/gameobject/src/gameobject-spawn/gameobject-spawn.component.ts b/libs/features/gameobject/src/gameobject-spawn/gameobject-spawn.component.ts index df55f420a2..4a7ff54c9e 100644 --- a/libs/features/gameobject/src/gameobject-spawn/gameobject-spawn.component.ts +++ b/libs/features/gameobject/src/gameobject-spawn/gameobject-spawn.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { MultiRowEditorComponent } from '@keira/shared/base-abstract-classes'; import { GameobjectSpawn, PHASE_MASK, SPAWN_MASK } from '@keira/shared/acore-world-model'; import { GameobjectHandlerService } from '../gameobject-handler.service'; @@ -37,11 +37,6 @@ export class GameobjectSpawnComponent extends MultiRowEditorComponent { readonly GAMEOBJECT_FLAGS = GAMEOBJECT_FLAGS; - /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 - constructor( - public editorService: GameobjectTemplateAddonService, - public handlerService: GameobjectHandlerService, - ) { - super(editorService, handlerService); - } + readonly editorService = inject(GameobjectTemplateAddonService); + readonly handlerService = inject(GameobjectHandlerService); } diff --git a/libs/features/gameobject/src/gameobject-template/gameobject-template.component.ts b/libs/features/gameobject/src/gameobject-template/gameobject-template.component.ts index 4676b67a00..0aa7fa1138 100644 --- a/libs/features/gameobject/src/gameobject-template/gameobject-template.component.ts +++ b/libs/features/gameobject/src/gameobject-template/gameobject-template.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { SingleRowEditorComponent } from '@keira/shared/base-abstract-classes'; import { GAMEOBJECT_ICON, GAMEOBJECT_TYPE, GameobjectTemplate } from '@keira/shared/acore-world-model'; import { FieldDefinition } from '@keira/shared/constants'; @@ -38,13 +38,8 @@ export class GameobjectTemplateComponent extends SingleRowEditorComponent { - /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 - constructor( - public editorService: GossipMenuService, - public handlerService: GossipHandlerService, - readonly queryService: MysqlQueryService, - ) { - super(editorService, handlerService); - } + readonly editorService = inject(GossipMenuService); + readonly handlerService = inject(GossipHandlerService); + readonly queryService = inject(MysqlQueryService); } diff --git a/libs/features/item/src/disenchant-loot-template/disenchant-loot-template.component.ts b/libs/features/item/src/disenchant-loot-template/disenchant-loot-template.component.ts index 6f4589c6a1..fd7752a2aa 100644 --- a/libs/features/item/src/disenchant-loot-template/disenchant-loot-template.component.ts +++ b/libs/features/item/src/disenchant-loot-template/disenchant-loot-template.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { LootTemplateIdComponent } from '@keira/shared/base-abstract-classes'; import { DisenchantLootTemplate } from '@keira/shared/acore-world-model'; import { ItemHandlerService } from '../item-handler.service'; @@ -15,11 +15,6 @@ import { TopBarComponent } from '@keira/shared/base-editor-components'; imports: [TopBarComponent, NgIf, LootEditorComponent], }) export class DisenchantLootTemplateComponent extends LootTemplateIdComponent { - /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 - constructor( - public editorService: DisenchantLootTemplateService, - public handlerService: ItemHandlerService, - ) { - super(editorService, handlerService); - } + readonly editorService = inject(DisenchantLootTemplateService); + readonly handlerService = inject(ItemHandlerService); } diff --git a/libs/features/item/src/item-enchantment/item-enchantment-template.component.ts b/libs/features/item/src/item-enchantment/item-enchantment-template.component.ts index 53aeef107b..0c9b59a129 100644 --- a/libs/features/item/src/item-enchantment/item-enchantment-template.component.ts +++ b/libs/features/item/src/item-enchantment/item-enchantment-template.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { MultiRowEditorComponent } from '@keira/shared/base-abstract-classes'; import { ItemEnchantmentTemplate } from '@keira/shared/acore-world-model'; import { ItemHandlerService } from '../item-handler.service'; @@ -25,11 +25,6 @@ import { TranslateModule } from '@ngx-translate/core'; ], }) export class ItemEnchantmentTemplateComponent extends MultiRowEditorComponent { - /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 - constructor( - public editorService: ItemEnchantmentTemplateService, - public handlerService: ItemHandlerService, - ) { - super(editorService, handlerService); - } + readonly editorService = inject(ItemEnchantmentTemplateService); + readonly handlerService = inject(ItemHandlerService); } diff --git a/libs/features/item/src/item-loot-template/item-loot-template.component.ts b/libs/features/item/src/item-loot-template/item-loot-template.component.ts index 6a79f91d64..5e17866687 100644 --- a/libs/features/item/src/item-loot-template/item-loot-template.component.ts +++ b/libs/features/item/src/item-loot-template/item-loot-template.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { LootTemplateComponent } from '@keira/shared/base-abstract-classes'; import { ItemLootTemplate } from '@keira/shared/acore-world-model'; import { ItemHandlerService } from '../item-handler.service'; @@ -15,11 +15,6 @@ import { TopBarComponent } from '@keira/shared/base-editor-components'; imports: [TopBarComponent, LootEditorComponent], }) export class ItemLootTemplateComponent extends LootTemplateComponent { - /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 - constructor( - public editorService: ItemLootTemplateService, - public handlerService: ItemHandlerService, - ) { - super(editorService, handlerService); - } + readonly editorService = inject(ItemLootTemplateService); + readonly handlerService = inject(ItemHandlerService); } diff --git a/libs/features/item/src/item-template/item-template.component.ts b/libs/features/item/src/item-template/item-template.component.ts index 87822c876a..a61ce34587 100644 --- a/libs/features/item/src/item-template/item-template.component.ts +++ b/libs/features/item/src/item-template/item-template.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject, OnInit } from '@angular/core'; import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; import { SingleRowEditorComponent } from '@keira/shared/base-abstract-classes'; import { @@ -82,6 +82,11 @@ import { NgClass } from '@angular/common'; ], }) export class ItemTemplateComponent extends SingleRowEditorComponent implements OnInit { + readonly editorService = inject(ItemTemplateService); + readonly handlerService = inject(ItemHandlerService); + private readonly itemPreviewService = inject(ItemPreviewService); + private readonly sanitizer = inject(DomSanitizer); + readonly ITEM_CLASS = ITEM_CLASS; readonly ITEM_SUBCLASS = ITEM_SUBCLASS; readonly ITEM_QUALITY = ITEM_QUALITY; @@ -107,16 +112,6 @@ export class ItemTemplateComponent extends SingleRowEditorComponent { diff --git a/libs/features/item/src/milling-loot-template/milling-loot-template.component.ts b/libs/features/item/src/milling-loot-template/milling-loot-template.component.ts index acac545fb1..7f18160fff 100644 --- a/libs/features/item/src/milling-loot-template/milling-loot-template.component.ts +++ b/libs/features/item/src/milling-loot-template/milling-loot-template.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { LootTemplateComponent } from '@keira/shared/base-abstract-classes'; import { MillingLootTemplate } from '@keira/shared/acore-world-model'; import { ItemHandlerService } from '../item-handler.service'; @@ -15,11 +15,6 @@ import { TopBarComponent } from '@keira/shared/base-editor-components'; imports: [TopBarComponent, NgIf, LootEditorComponent], }) export class MillingLootTemplateComponent extends LootTemplateComponent { - /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 - constructor( - public editorService: MillingLootTemplateService, - public handlerService: ItemHandlerService, - ) { - super(editorService, handlerService); - } + readonly editorService = inject(MillingLootTemplateService); + readonly handlerService = inject(ItemHandlerService); } diff --git a/libs/features/item/src/prospecting-loot-template/prospecting-loot-template.component.ts b/libs/features/item/src/prospecting-loot-template/prospecting-loot-template.component.ts index b2080983d4..c6f0887a91 100644 --- a/libs/features/item/src/prospecting-loot-template/prospecting-loot-template.component.ts +++ b/libs/features/item/src/prospecting-loot-template/prospecting-loot-template.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { LootTemplateComponent } from '@keira/shared/base-abstract-classes'; import { ProspectingLootTemplate } from '@keira/shared/acore-world-model'; import { ItemHandlerService } from '../item-handler.service'; @@ -15,11 +15,6 @@ import { TopBarComponent } from '@keira/shared/base-editor-components'; imports: [TopBarComponent, NgIf, LootEditorComponent], }) export class ProspectingLootTemplateComponent extends LootTemplateComponent { - /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 - constructor( - public editorService: ProspectingLootTemplateService, - public handlerService: ItemHandlerService, - ) { - super(editorService, handlerService); - } + readonly editorService = inject(ProspectingLootTemplateService); + readonly handlerService = inject(ItemHandlerService); } diff --git a/libs/features/other-loots/src/fishing-loot/fishing-loot-template.component.ts b/libs/features/other-loots/src/fishing-loot/fishing-loot-template.component.ts index 7e920d6aee..060542ab88 100644 --- a/libs/features/other-loots/src/fishing-loot/fishing-loot-template.component.ts +++ b/libs/features/other-loots/src/fishing-loot/fishing-loot-template.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { LootTemplateComponent } from '@keira/shared/base-abstract-classes'; import { FishingLootTemplate } from '@keira/shared/acore-world-model'; import { FishingLootHandlerService } from './fishing-loot-handler.service'; @@ -16,11 +16,6 @@ import { TopBarComponent } from '@keira/shared/base-editor-components'; imports: [TopBarComponent, NgIf, TranslateModule, LootEditorComponent], }) export class FishingLootTemplateComponent extends LootTemplateComponent { - /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 - constructor( - public editorService: FishingLootTemplateService, - public handlerService: FishingLootHandlerService, - ) { - super(editorService, handlerService); - } + readonly editorService = inject(FishingLootTemplateService); + readonly handlerService = inject(FishingLootHandlerService); } diff --git a/libs/features/other-loots/src/mail-loot/mail-loot-template.component.ts b/libs/features/other-loots/src/mail-loot/mail-loot-template.component.ts index 70a84ec8f8..3a71c0dd85 100644 --- a/libs/features/other-loots/src/mail-loot/mail-loot-template.component.ts +++ b/libs/features/other-loots/src/mail-loot/mail-loot-template.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { LootTemplateComponent } from '@keira/shared/base-abstract-classes'; import { MailLootTemplate } from '@keira/shared/acore-world-model'; import { MailLootHandlerService } from './mail-loot-handler.service'; @@ -16,11 +16,6 @@ import { TopBarComponent } from '@keira/shared/base-editor-components'; imports: [TopBarComponent, NgIf, TranslateModule, LootEditorComponent], }) export class MailLootTemplateComponent extends LootTemplateComponent { - /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 - constructor( - public editorService: MailLootTemplateService, - public handlerService: MailLootHandlerService, - ) { - super(editorService, handlerService); - } + readonly editorService = inject(MailLootTemplateService); + readonly handlerService = inject(MailLootHandlerService); } diff --git a/libs/features/other-loots/src/reference-loot/reference-loot-template.component.ts b/libs/features/other-loots/src/reference-loot/reference-loot-template.component.ts index 4b68253bca..b8e77bdd05 100644 --- a/libs/features/other-loots/src/reference-loot/reference-loot-template.component.ts +++ b/libs/features/other-loots/src/reference-loot/reference-loot-template.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { LootTemplateComponent } from '@keira/shared/base-abstract-classes'; import { ReferenceLootTemplate } from '@keira/shared/acore-world-model'; import { ReferenceLootHandlerService } from './reference-loot-handler.service'; @@ -16,11 +16,6 @@ import { TopBarComponent } from '@keira/shared/base-editor-components'; imports: [TopBarComponent, NgIf, TranslateModule, LootEditorComponent], }) export class ReferenceLootTemplateComponent extends LootTemplateComponent { - /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 - constructor( - public editorService: ReferenceLootTemplateService, - public handlerService: ReferenceLootHandlerService, - ) { - super(editorService, handlerService); - } + readonly editorService = inject(ReferenceLootTemplateService); + readonly handlerService = inject(ReferenceLootHandlerService); } diff --git a/libs/features/other-loots/src/spell-loot/spell-loot-template.component.ts b/libs/features/other-loots/src/spell-loot/spell-loot-template.component.ts index 4a50a637eb..44c97a4dc8 100644 --- a/libs/features/other-loots/src/spell-loot/spell-loot-template.component.ts +++ b/libs/features/other-loots/src/spell-loot/spell-loot-template.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { LootTemplateComponent } from '@keira/shared/base-abstract-classes'; import { SpellLootTemplate } from '@keira/shared/acore-world-model'; import { SpellLootHandlerService } from './spell-loot-handler.service'; @@ -16,11 +16,6 @@ import { LootEditorComponent } from '@keira/shared/loot-editor'; imports: [TopBarComponent, NgIf, TranslateModule, LootEditorComponent], }) export class SpellLootTemplateComponent extends LootTemplateComponent { - /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 - constructor( - public editorService: SpellLootTemplateService, - public handlerService: SpellLootHandlerService, - ) { - super(editorService, handlerService); - } + readonly editorService = inject(SpellLootTemplateService); + readonly handlerService = inject(SpellLootHandlerService); } diff --git a/libs/features/quest/src/creature-questender/creature-questender.component.ts b/libs/features/quest/src/creature-questender/creature-questender.component.ts index e635f0bbb4..60c3df4cac 100644 --- a/libs/features/quest/src/creature-questender/creature-questender.component.ts +++ b/libs/features/quest/src/creature-questender/creature-questender.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { MultiRowEditorComponent } from '@keira/shared/base-abstract-classes'; import { CreatureQuestender } from '@keira/shared/acore-world-model'; import { QuestHandlerService } from '../quest-handler.service'; @@ -35,12 +35,7 @@ import { AsyncPipe, NgClass } from '@angular/common'; ], }) export class CreatureQuestenderComponent extends MultiRowEditorComponent { - /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 - constructor( - public editorService: CreatureQuestenderService, - public handlerService: QuestHandlerService, - readonly questPreviewService: QuestPreviewService, - ) { - super(editorService, handlerService); - } + readonly editorService = inject(CreatureQuestenderService); + readonly handlerService = inject(QuestHandlerService); + readonly questPreviewService = inject(QuestPreviewService); } diff --git a/libs/features/quest/src/creature-queststarter/creature-queststarter.component.ts b/libs/features/quest/src/creature-queststarter/creature-queststarter.component.ts index 0ba7b48e5b..e8f13f6b9e 100644 --- a/libs/features/quest/src/creature-queststarter/creature-queststarter.component.ts +++ b/libs/features/quest/src/creature-queststarter/creature-queststarter.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { MultiRowEditorComponent } from '@keira/shared/base-abstract-classes'; import { CreatureQueststarter } from '@keira/shared/acore-world-model'; import { QuestHandlerService } from '../quest-handler.service'; @@ -35,12 +35,7 @@ import { AsyncPipe, NgClass } from '@angular/common'; ], }) export class CreatureQueststarterComponent extends MultiRowEditorComponent { - /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 - constructor( - public editorService: CreatureQueststarterService, - public handlerService: QuestHandlerService, - readonly questPreviewService: QuestPreviewService, - ) { - super(editorService, handlerService); - } + readonly editorService = inject(CreatureQueststarterService); + readonly handlerService = inject(QuestHandlerService); + readonly questPreviewService = inject(QuestPreviewService); } diff --git a/libs/features/quest/src/gameobject-questender/gameobject-questender.component.ts b/libs/features/quest/src/gameobject-questender/gameobject-questender.component.ts index 1938c03bc3..abadcc8268 100644 --- a/libs/features/quest/src/gameobject-questender/gameobject-questender.component.ts +++ b/libs/features/quest/src/gameobject-questender/gameobject-questender.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { MultiRowEditorComponent } from '@keira/shared/base-abstract-classes'; import { GameobjectQuestender } from '@keira/shared/acore-world-model'; import { QuestHandlerService } from '../quest-handler.service'; @@ -35,12 +35,7 @@ import { AsyncPipe, NgClass } from '@angular/common'; ], }) export class GameobjectQuestenderComponent extends MultiRowEditorComponent { - /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 - constructor( - public editorService: GameobjectQuestenderService, - public handlerService: QuestHandlerService, - readonly questPreviewService: QuestPreviewService, - ) { - super(editorService, handlerService); - } + readonly editorService = inject(GameobjectQuestenderService); + readonly handlerService = inject(QuestHandlerService); + readonly questPreviewService = inject(QuestPreviewService); } diff --git a/libs/features/quest/src/gameobject-queststarter/gameobject-queststarter.component.ts b/libs/features/quest/src/gameobject-queststarter/gameobject-queststarter.component.ts index 5bf921e190..fcdeead8b1 100644 --- a/libs/features/quest/src/gameobject-queststarter/gameobject-queststarter.component.ts +++ b/libs/features/quest/src/gameobject-queststarter/gameobject-queststarter.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { MultiRowEditorComponent } from '@keira/shared/base-abstract-classes'; import { GameobjectQueststarter } from '@keira/shared/acore-world-model'; import { QuestHandlerService } from '../quest-handler.service'; @@ -35,12 +35,7 @@ import { AsyncPipe, NgClass } from '@angular/common'; ], }) export class GameobjectQueststarterComponent extends MultiRowEditorComponent { - /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 - constructor( - public editorService: GameobjectQueststarterService, - public handlerService: QuestHandlerService, - readonly questPreviewService: QuestPreviewService, - ) { - super(editorService, handlerService); - } + readonly editorService = inject(GameobjectQueststarterService); + readonly handlerService = inject(QuestHandlerService); + readonly questPreviewService = inject(QuestPreviewService); } diff --git a/libs/features/quest/src/quest-offer-reward/quest-offer-reward.component.ts b/libs/features/quest/src/quest-offer-reward/quest-offer-reward.component.ts index 880ad7ffee..d1042d6261 100644 --- a/libs/features/quest/src/quest-offer-reward/quest-offer-reward.component.ts +++ b/libs/features/quest/src/quest-offer-reward/quest-offer-reward.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { SingleRowEditorComponent } from '@keira/shared/base-abstract-classes'; import { EMOTE, QuestOfferReward } from '@keira/shared/acore-world-model'; import { QuestHandlerService } from '../quest-handler.service'; @@ -33,12 +33,7 @@ import { NgClass } from '@angular/common'; export class QuestOfferRewardComponent extends SingleRowEditorComponent { readonly EMOTE = EMOTE; - /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 - constructor( - public editorService: QuestOfferRewardService, - public handlerService: QuestHandlerService, - readonly questPreviewService: QuestPreviewService, - ) { - super(editorService, handlerService); - } + readonly editorService = inject(QuestOfferRewardService); + readonly handlerService = inject(QuestHandlerService); + readonly questPreviewService = inject(QuestPreviewService); } diff --git a/libs/features/quest/src/quest-request-items/quest-request-items.component.ts b/libs/features/quest/src/quest-request-items/quest-request-items.component.ts index bb48debf63..dc136543ff 100644 --- a/libs/features/quest/src/quest-request-items/quest-request-items.component.ts +++ b/libs/features/quest/src/quest-request-items/quest-request-items.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { SingleRowEditorComponent } from '@keira/shared/base-abstract-classes'; import { EMOTE, QuestRequestItems } from '@keira/shared/acore-world-model'; import { QuestHandlerService } from '../quest-handler.service'; @@ -31,14 +31,9 @@ import { NgClass } from '@angular/common'; ], }) export class QuestRequestItemsComponent extends SingleRowEditorComponent { - readonly EMOTE = EMOTE; + readonly editorService = inject(QuestRequestItemsService); + readonly handlerService = inject(QuestHandlerService); + readonly questPreviewService = inject(QuestPreviewService); - /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 - constructor( - public editorService: QuestRequestItemsService, - public handlerService: QuestHandlerService, - readonly questPreviewService: QuestPreviewService, - ) { - super(editorService, handlerService); - } + readonly EMOTE = EMOTE; } diff --git a/libs/features/quest/src/quest-template-addon/quest-template-addon.component.ts b/libs/features/quest/src/quest-template-addon/quest-template-addon.component.ts index 424c95accd..3ee474c01b 100644 --- a/libs/features/quest/src/quest-template-addon/quest-template-addon.component.ts +++ b/libs/features/quest/src/quest-template-addon/quest-template-addon.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { SingleRowEditorComponent } from '@keira/shared/base-abstract-classes'; import { ALLOWABLE_CLASSES, QuestTemplateAddon, SPECIAL_FLAGS } from '@keira/shared/acore-world-model'; import { QuestHandlerService } from '../quest-handler.service'; @@ -41,15 +41,10 @@ import { NgClass } from '@angular/common'; ], }) export class QuestTemplateAddonComponent extends SingleRowEditorComponent { + readonly editorService = inject(QuestTemplateAddonService); + readonly handlerService = inject(QuestHandlerService); + readonly questPreviewService = inject(QuestPreviewService); + readonly ALLOWABLE_CLASSES = ALLOWABLE_CLASSES; readonly SPECIAL_FLAGS = SPECIAL_FLAGS; - - /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 - constructor( - public editorService: QuestTemplateAddonService, - public handlerService: QuestHandlerService, - readonly questPreviewService: QuestPreviewService, - ) { - super(editorService, handlerService); - } } diff --git a/libs/features/quest/src/quest-template/quest-template.component.ts b/libs/features/quest/src/quest-template/quest-template.component.ts index f1565f0b2a..8239e318b5 100644 --- a/libs/features/quest/src/quest-template/quest-template.component.ts +++ b/libs/features/quest/src/quest-template/quest-template.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { SingleRowEditorComponent } from '@keira/shared/base-abstract-classes'; import { ALLOWABLE_RACES, QUEST_FLAGS, QUEST_INFO, QUEST_TYPE, QuestTemplate } from '@keira/shared/acore-world-model'; import { QuestHandlerService } from '../quest-handler.service'; @@ -44,17 +44,12 @@ import { NgClass } from '@angular/common'; ], }) export class QuestTemplateComponent extends SingleRowEditorComponent { + readonly editorService = inject(QuestTemplateService); + readonly handlerService = inject(QuestHandlerService); + readonly questPreviewService = inject(QuestPreviewService); + readonly QUEST_FLAGS = QUEST_FLAGS; readonly QUEST_TYPE = QUEST_TYPE; readonly ALLOWABLE_RACES = ALLOWABLE_RACES; readonly QUEST_INFO = QUEST_INFO; - - /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 - constructor( - public editorService: QuestTemplateService, - public handlerService: QuestHandlerService, - readonly questPreviewService: QuestPreviewService, - ) { - super(editorService, handlerService); - } } diff --git a/libs/features/spell/src/spell-dbc/spell-dbc.component.ts b/libs/features/spell/src/spell-dbc/spell-dbc.component.ts index fe8dffa28c..1120877c8f 100644 --- a/libs/features/spell/src/spell-dbc/spell-dbc.component.ts +++ b/libs/features/spell/src/spell-dbc/spell-dbc.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { SingleRowEditorComponent } from '@keira/shared/base-abstract-classes'; import { SpellDbc } from '@keira/shared/acore-world-model'; import { SpellHandlerService } from '../spell-handler.service'; @@ -36,11 +36,6 @@ import { QueryOutputComponent, TopBarComponent } from '@keira/shared/base-editor ], }) export class SpellDbcComponent extends SingleRowEditorComponent { - /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 - constructor( - public editorService: SpellDbcService, - public handlerService: SpellHandlerService, - ) { - super(editorService, handlerService); - } + readonly editorService = inject(SpellDbcService); + readonly handlerService = inject(SpellHandlerService); } diff --git a/libs/shared/base-abstract-classes/src/components/editors/editor.component.ts b/libs/shared/base-abstract-classes/src/components/editors/editor.component.ts index 4abd9bc17c..1c870cffad 100644 --- a/libs/shared/base-abstract-classes/src/components/editors/editor.component.ts +++ b/libs/shared/base-abstract-classes/src/components/editors/editor.component.ts @@ -11,6 +11,9 @@ import { compareObjFn, SubscriptionHandler } from '@keira/shared/utils'; template: '', }) export abstract class EditorComponent extends SubscriptionHandler implements OnInit { + public abstract readonly editorService: EditorService; + protected abstract readonly handlerService: HandlerService; + readonly WIKI_BASE_URL = WIKI_BASE_URL; protected readonly changeDetectorRef = inject(ChangeDetectorRef); @@ -19,13 +22,6 @@ export abstract class EditorComponent extends SubscriptionHa return this.WIKI_BASE_URL + this.editorService.entityTable; } - constructor( - public editorService: EditorService, - protected handlerService: HandlerService, - ) { - super(); - } - ngOnInit() { this.editorService.clearCache(); diff --git a/libs/shared/base-abstract-classes/src/components/editors/loot-template/loot-template-id.component.ts b/libs/shared/base-abstract-classes/src/components/editors/loot-template/loot-template-id.component.ts index 02fa1b1398..f394ef35a6 100644 --- a/libs/shared/base-abstract-classes/src/components/editors/loot-template/loot-template-id.component.ts +++ b/libs/shared/base-abstract-classes/src/components/editors/loot-template/loot-template-id.component.ts @@ -13,6 +13,9 @@ import { LootTemplateComponent } from './loot-template.component'; template: '', }) export abstract class LootTemplateIdComponent extends LootTemplateComponent implements OnInit { + public abstract editorService: LootEditorIdService; + protected abstract handlerService: HandlerService; + protected _lootId: number; get lootId(): number { return this._lootId; @@ -42,14 +45,6 @@ export abstract class LootTemplateIdComponent extends Lo ); } - /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 - constructor( - public editorService: LootEditorIdService, - protected handlerService: HandlerService, - ) { - super(editorService, handlerService); - } - ngOnInit() { this.editorService.clearCache(); this.checkTemplateLootId(); diff --git a/libs/shared/base-abstract-classes/src/components/editors/multi-row-editor.component.ts b/libs/shared/base-abstract-classes/src/components/editors/multi-row-editor.component.ts index c3d4f479c3..bb2d5cb988 100644 --- a/libs/shared/base-abstract-classes/src/components/editors/multi-row-editor.component.ts +++ b/libs/shared/base-abstract-classes/src/components/editors/multi-row-editor.component.ts @@ -10,13 +10,8 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; template: '', }) export abstract class MultiRowEditorComponent extends EditorComponent { - readonly DTCFG = DTCFG; + public abstract readonly editorService: MultiRowEditorService; + protected abstract readonly handlerService: HandlerService; - /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 - constructor( - public editorService: MultiRowEditorService, - protected handlerService: HandlerService, - ) { - super(editorService, handlerService); - } + readonly DTCFG = DTCFG; } diff --git a/libs/shared/base-abstract-classes/src/components/editors/single-row-editor.component.ts b/libs/shared/base-abstract-classes/src/components/editors/single-row-editor.component.ts index 73e1ee20db..b6a43542ab 100644 --- a/libs/shared/base-abstract-classes/src/components/editors/single-row-editor.component.ts +++ b/libs/shared/base-abstract-classes/src/components/editors/single-row-editor.component.ts @@ -9,11 +9,6 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; template: '', }) export abstract class SingleRowEditorComponent extends EditorComponent { - /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 - constructor( - public editorService: SingleRowEditorService, - protected handlerService: HandlerService, - ) { - super(editorService, handlerService); - } + public abstract readonly editorService: SingleRowEditorService; + protected abstract readonly handlerService: HandlerService; } diff --git a/libs/shared/sai-editor/src/sai-editor.component.ts b/libs/shared/sai-editor/src/sai-editor.component.ts index c924c5346b..0ed416ef54 100644 --- a/libs/shared/sai-editor/src/sai-editor.component.ts +++ b/libs/shared/sai-editor/src/sai-editor.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject, OnInit } from '@angular/core'; import { EVENT_PHASE_MASK, SAI_TYPES, SMART_EVENT_FLAGS, SmartScripts } from '@keira/shared/acore-world-model'; import { SAI_ACTION_PARAM1_NAMES, @@ -90,6 +90,9 @@ import { EditorButtonsComponent, QueryOutputComponent } from '@keira/shared/base ], }) export class SaiEditorComponent extends MultiRowEditorComponent implements OnInit { + readonly editorService = inject(SaiEditorService); + protected readonly handlerService = inject(SaiHandlerService); + readonly EVENT_PHASE_MASK = EVENT_PHASE_MASK; readonly SMART_EVENT_FLAGS = SMART_EVENT_FLAGS; readonly SAI_EVENTS = SAI_EVENTS; @@ -168,14 +171,6 @@ export class SaiEditorComponent extends MultiRowEditorComponent im return this.handlerService.parsedSelected.entryorguid; } - /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 - constructor( - public editorService: SaiEditorService, - protected handlerService: SaiHandlerService, - ) { - super(editorService, handlerService); - } - getName(defaultParamName: string, value: string | undefined): string { return value ? value : defaultParamName; } diff --git a/libs/shared/switch-language/src/switch-language.component.ts b/libs/shared/switch-language/src/switch-language.component.ts index 2efb489441..c00e6303ac 100644 --- a/libs/shared/switch-language/src/switch-language.component.ts +++ b/libs/shared/switch-language/src/switch-language.component.ts @@ -15,5 +15,5 @@ import { NgClass } from '@angular/common'; export class SwitchLanguageComponent { @Input() longVersion = true; - constructor(public readonly switchLanguageService: SwitchLanguageService) {} + constructor(readonly switchLanguageService: SwitchLanguageService) {} }