diff --git a/libs/features/game-tele/src/select-game-tele/select-game-tele.integration.spec.ts b/libs/features/game-tele/src/select-game-tele/select-game-tele.integration.spec.ts index a92ca50aa38..5d929b98f30 100644 --- a/libs/features/game-tele/src/select-game-tele/select-game-tele.integration.spec.ts +++ b/libs/features/game-tele/src/select-game-tele/select-game-tele.integration.spec.ts @@ -92,7 +92,7 @@ describe('SelectConditions integration tests', () => { }, ]) { it(`searching an existing entity should correctly work [id: ${id}, name: ${name}]`, () => { - const { page, _component } = setup(); + const { page } = setup(); querySpy.calls.reset(); // Set input values based on the test case @@ -118,7 +118,7 @@ describe('SelectConditions integration tests', () => { } it('searching and selecting an existing entity from the datatable should correctly work', () => { - const { page, _fixture, _component } = setup(); + const { page } = setup(); const results = [ { id: 1, diff --git a/libs/shared/selectors/src/search/game-tele-search.service.ts b/libs/shared/selectors/src/search/game-tele-search.service.ts new file mode 100644 index 00000000000..e8a7d5a7f8e --- /dev/null +++ b/libs/shared/selectors/src/search/game-tele-search.service.ts @@ -0,0 +1,14 @@ +import { Injectable } from '@angular/core'; +import { MysqlQueryService } from '@keira/shared/db-layer'; +import { GAME_TELE_SEARCH_FIELDS, GAME_TELE_TABLE, GameTele } from '@keira/shared/acore-world-model'; +import { SearchService } from '@keira/shared/base-abstract-classes'; + +@Injectable({ + providedIn: 'root', +}) +export class GameTeleSearchService extends SearchService { + /* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690 + constructor(override readonly queryService: MysqlQueryService) { + super(queryService, GAME_TELE_TABLE, GAME_TELE_SEARCH_FIELDS); + } +} diff --git a/libs/shared/selectors/src/selectors/game-tele-selector/creature-selector-modal.component.ts b/libs/shared/selectors/src/selectors/game-tele-selector/creature-selector-modal.component.ts deleted file mode 100644 index 57ed2aed453..00000000000 --- a/libs/shared/selectors/src/selectors/game-tele-selector/creature-selector-modal.component.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; - -import { CREATURE_TEMPLATE_ID, CreatureTemplate } from '@keira/shared/acore-world-model'; -import { TranslateModule } from '@ngx-translate/core'; -import { NgxDatatableModule } from '@siemens/ngx-datatable'; -import { CreatureSearchService } from '../../search/creature-search.service'; -import { SearchSelectorModalComponent } from '../base-selector/search-selector-modal.component'; - -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { HighlightjsWrapperComponent } from '@keira/shared/base-editor-components'; - -@Component({ - changeDetection: ChangeDetectionStrategy.OnPush, - selector: 'keira-creature-selector-modal', - templateUrl: './creature-selector-modal.component.html', - standalone: true, - imports: [FormsModule, ReactiveFormsModule, HighlightjsWrapperComponent, NgxDatatableModule, TranslateModule], -}) -export class CreatureSelectorModalComponent extends SearchSelectorModalComponent { - protected entityIdField = CREATURE_TEMPLATE_ID; - protected searchService = inject(CreatureSearchService); -} diff --git a/libs/shared/selectors/src/selectors/game-tele-selector/creature-selector-btn.component.spec.ts b/libs/shared/selectors/src/selectors/game-tele-selector/game-tele-selector-btn.component.spec.ts similarity index 53% rename from libs/shared/selectors/src/selectors/game-tele-selector/creature-selector-btn.component.spec.ts rename to libs/shared/selectors/src/selectors/game-tele-selector/game-tele-selector-btn.component.spec.ts index acc0e463f93..5c051540ed3 100644 --- a/libs/shared/selectors/src/selectors/game-tele-selector/creature-selector-btn.component.spec.ts +++ b/libs/shared/selectors/src/selectors/game-tele-selector/game-tele-selector-btn.component.spec.ts @@ -1,20 +1,19 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; - -import { CreatureSelectorBtnComponent } from './creature-selector-btn.component'; +import { GameTeleSelectorBtnComponent } from './game-tele-selector-btn.component'; import { ModalModule } from 'ngx-bootstrap/modal'; -describe('CreatureSelectorBtnComponent', () => { - let component: CreatureSelectorBtnComponent; - let fixture: ComponentFixture; +describe('GameTeleSelectorBtnComponent', () => { + let component: GameTeleSelectorBtnComponent; + let fixture: ComponentFixture; beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ModalModule.forRoot(), CreatureSelectorBtnComponent], + imports: [ModalModule.forRoot(), GameTeleSelectorBtnComponent], }).compileComponents(); })); beforeEach(() => { - fixture = TestBed.createComponent(CreatureSelectorBtnComponent); + fixture = TestBed.createComponent(GameTeleSelectorBtnComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/libs/shared/selectors/src/selectors/game-tele-selector/creature-selector-btn.component.ts b/libs/shared/selectors/src/selectors/game-tele-selector/game-tele-selector-btn.component.ts similarity index 67% rename from libs/shared/selectors/src/selectors/game-tele-selector/creature-selector-btn.component.ts rename to libs/shared/selectors/src/selectors/game-tele-selector/game-tele-selector-btn.component.ts index 3b2462d5ae7..efeb999b6b1 100644 --- a/libs/shared/selectors/src/selectors/game-tele-selector/creature-selector-btn.component.ts +++ b/libs/shared/selectors/src/selectors/game-tele-selector/game-tele-selector-btn.component.ts @@ -1,6 +1,5 @@ import { ChangeDetectionStrategy, Component } from '@angular/core'; - -import { CreatureSelectorModalComponent } from './creature-selector-modal.component'; +import { GameTeleSelectorModalComponent } from './game-tele-selector-modal.component'; import { BaseSelectorBtnComponent } from '../base-selector/base-selector-btn.component'; @Component({ @@ -10,6 +9,6 @@ import { BaseSelectorBtnComponent } from '../base-selector/base-selector-btn.com styleUrls: ['../base-selector/base-selector-btn.component.scss'], standalone: true, }) -export class CreatureSelectorBtnComponent extends BaseSelectorBtnComponent { - protected readonly modalComponentClass = CreatureSelectorModalComponent; +export class GameTeleSelectorBtnComponent extends BaseSelectorBtnComponent { + protected readonly modalComponentClass = GameTeleSelectorModalComponent; } diff --git a/libs/shared/selectors/src/selectors/game-tele-selector/creature-selector-modal.component.html b/libs/shared/selectors/src/selectors/game-tele-selector/game-tele-selector-modal.component.html similarity index 87% rename from libs/shared/selectors/src/selectors/game-tele-selector/creature-selector-modal.component.html rename to libs/shared/selectors/src/selectors/game-tele-selector/game-tele-selector-modal.component.html index ae935293392..bceb08f785c 100644 --- a/libs/shared/selectors/src/selectors/game-tele-selector/creature-selector-modal.component.html +++ b/libs/shared/selectors/src/selectors/game-tele-selector/game-tele-selector-modal.component.html @@ -1,11 +1,11 @@