Skip to content

Commit

Permalink
Rename files to match table
Browse files Browse the repository at this point in the history
  • Loading branch information
Exitare committed Dec 20, 2024
1 parent a3c6d36 commit 23a533e
Show file tree
Hide file tree
Showing 14 changed files with 72 additions and 72 deletions.
12 changes: 6 additions & 6 deletions apps/keira/src/app/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ import {
SelectNpcTextComponent,
SelectPageTextComponent,
} from 'texts';
import { AcoreTextComponent } from '../../../../libs/features/texts/src/acore-text/acore-text.component';
import { AcoreTextHandlerService } from '../../../../libs/features/texts/src/acore-text/acore-text-handler.service';
import { SelectAcoreTextComponent } from '../../../../libs/features/texts/src/acore-text/select-acore-text.component';
import { AcoreStringComponent } from '../../../../libs/features/texts/src/acore-text/acore-string.component';
import { AcoreStringHandlerService } from '../../../../libs/features/texts/src/acore-text/acore-string-handler.service';
import { SelectAcoreStringComponent } from '../../../../libs/features/texts/src/acore-text/select-acore-string.component';

export const KEIRA_ROUTES: Routes = [
{
Expand Down Expand Up @@ -411,12 +411,12 @@ export const KEIRA_ROUTES: Routes = [
},
{
path: 'acore-string',
component: AcoreTextComponent,
canActivate: [AcoreTextHandlerService],
component: AcoreStringComponent,
canActivate: [AcoreStringHandlerService],
},
{
path: 'select-acore-string',
component: SelectAcoreTextComponent,
component: SelectAcoreStringComponent,
},
],
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { AcoreTextHandlerService } from './acore-text-handler.service';
import { AcoreStringHandlerService } from './acore-string-handler.service';
import { ACORE_STRING_TABLE } from '@keira/shared/acore-world-model';

describe(AcoreTextHandlerService.name, () => {
describe(AcoreStringHandlerService.name, () => {
beforeEach(() =>
TestBed.configureTestingModule({
providers: [AcoreTextHandlerService],
providers: [AcoreStringHandlerService],
}),
);

const setup = () => {
const service = TestBed.inject(AcoreTextHandlerService);
const service = TestBed.inject(AcoreStringHandlerService);
return { service };
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ACORE_STRING_TABLE, AcoreString } from '@keira/shared/acore-world-model
@Injectable({
providedIn: 'root',
})
export class AcoreTextHandlerService extends HandlerService<AcoreString> {
export class AcoreStringHandlerService extends HandlerService<AcoreString> {
protected readonly mainEditorRoutePath = 'texts/acore-string';

get isUnsaved(): boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
import { ReactiveFormsModule } from '@angular/forms';
import { AcoreString } from '@keira/shared/acore-world-model';
import { SingleRowEditorComponent } from '@keira/shared/base-abstract-classes';
import { QueryOutputComponent, TopBarComponent } from '@keira/shared/base-editor-components';
import { TranslateModule } from '@ngx-translate/core';
import { TooltipModule } from 'ngx-bootstrap/tooltip';
import { AcoreTextHandlerService } from './acore-text-handler.service';
import { AcoreTextService } from './acore-text.service';
import { AcoreStringHandlerService } from './acore-string-handler.service';
import { AcoreStringService } from './acore-string.service';
import { QueryOutputComponent, TopBarComponent } from '@keira/shared/base-editor-components';

@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
templateUrl: './acore-text.component.html',
templateUrl: './acore-string.component.html',
standalone: true,
imports: [TopBarComponent, TranslateModule, QueryOutputComponent, ReactiveFormsModule, TooltipModule],
imports: [TranslateModule, ReactiveFormsModule, TooltipModule, QueryOutputComponent, TopBarComponent],
})
export class AcoreTextComponent extends SingleRowEditorComponent<AcoreString> {
override readonly editorService = inject(AcoreTextService);
protected override readonly handlerService = inject(AcoreTextHandlerService);
export class AcoreStringComponent extends SingleRowEditorComponent<AcoreString> {
override readonly editorService = inject(AcoreStringService);
protected override readonly handlerService = inject(AcoreStringHandlerService);
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import { ToastrModule } from 'ngx-toastr';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { of } from 'rxjs';
import { KEIRA_APP_CONFIG_TOKEN, KEIRA_MOCK_CONFIG } from '@keira/shared/config';
import { AcoreTextComponent } from './acore-text.component';
import { AcoreTextHandlerService } from './acore-text-handler.service';
import { AcoreStringComponent } from './acore-string.component';
import { AcoreStringHandlerService } from './acore-string-handler.service';

describe('Acore String integration tests', () => {
class Page extends EditorPageObject<AcoreTextComponent> {}
class Page extends EditorPageObject<AcoreStringComponent> {}

const entry = 1234;
const expectedFullCreateQuery =
Expand All @@ -35,13 +35,13 @@ describe('Acore String integration tests', () => {

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [BrowserAnimationsModule, ToastrModule.forRoot(), ModalModule.forRoot(), AcoreTextComponent, TranslateTestingModule],
imports: [BrowserAnimationsModule, ToastrModule.forRoot(), ModalModule.forRoot(), AcoreStringComponent, TranslateTestingModule],
providers: [{ provide: KEIRA_APP_CONFIG_TOKEN, useValue: KEIRA_MOCK_CONFIG }],
}).compileComponents();
}));

function setup(creatingNew: boolean) {
const handlerService = TestBed.inject(AcoreTextHandlerService);
const handlerService = TestBed.inject(AcoreStringHandlerService);
handlerService['_selected'] = `${entry}`;
handlerService.isNew = creatingNew;

Expand All @@ -50,7 +50,7 @@ describe('Acore String integration tests', () => {

spyOn(queryService, 'selectAll').and.returnValue(of(creatingNew ? [] : [originalEntity]));

const fixture = TestBed.createComponent(AcoreTextComponent);
const fixture = TestBed.createComponent(AcoreStringComponent);
const component = fixture.componentInstance;
const page = new Page(fixture);
fixture.autoDetectChanges(true);
Expand Down
17 changes: 17 additions & 0 deletions libs/features/texts/src/acore-text/acore-string.service.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { TestBed } from '@angular/core/testing';
import { AcoreStringService } from './acore-string.service';
import { AcoreStringHandlerService } from './acore-string-handler.service';
import { instance, mock } from 'ts-mockito';
import { ToastrService } from 'ngx-toastr';

describe(AcoreStringService.name, () => {
beforeEach(() =>
TestBed.configureTestingModule({
providers: [AcoreStringHandlerService, { provide: ToastrService, useValue: instance(mock(ToastrService)) }],
}),
);

it('should be created', () => {
expect(TestBed.inject(AcoreStringService)).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { Injectable } from '@angular/core';
import { SingleRowEditorService } from '@keira/shared/base-abstract-classes';
import { AcoreTextHandlerService } from './acore-text-handler.service';
import { AcoreStringHandlerService } from './acore-string-handler.service';
import { ACORE_STRING_DEFAULT, ACORE_STRING_ENTRY, ACORE_STRING_TABLE, AcoreString } from '@keira/shared/acore-world-model';

@Injectable({
providedIn: 'root',
})
export class AcoreTextService extends SingleRowEditorService<AcoreString> {
export class AcoreStringService extends SingleRowEditorService<AcoreString> {
/* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690
constructor(protected override handlerService: AcoreTextHandlerService) {
constructor(protected override handlerService: AcoreStringHandlerService) {
super(AcoreString, ACORE_STRING_TABLE, ACORE_STRING_ENTRY, ACORE_STRING_DEFAULT, true, handlerService);
}
}
17 changes: 0 additions & 17 deletions libs/features/texts/src/acore-text/acore-text.service.spec.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@ import { ACORE_STRING_CUSTOM_STARTING_ID, ACORE_STRING_ENTRY, ACORE_STRING_TABLE
import { NgxDatatableModule } from '@siemens/ngx-datatable';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { TranslateModule } from '@ngx-translate/core';
import { SelectAcoreStringService } from './select-acore-string.service';
import { AcoreStringHandlerService } from './acore-string-handler.service';
import { CreateComponent, HighlightjsWrapperComponent, TopBarComponent } from '@keira/shared/base-editor-components';
import { SelectAcoreTextService } from './select-acore-text.service';
import { AcoreTextHandlerService } from './acore-text-handler.service';

@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
templateUrl: './select-acore-text.component.html',
templateUrl: './select-acore-string.component.html',
standalone: true,
imports: [
TopBarComponent,
CreateComponent,
TranslateModule,
FormsModule,
ReactiveFormsModule,
HighlightjsWrapperComponent,
NgxDatatableModule,
TopBarComponent,
CreateComponent,
HighlightjsWrapperComponent,
],
})
export class SelectAcoreTextComponent extends SelectComponent<AcoreString> {
export class SelectAcoreStringComponent extends SelectComponent<AcoreString> {
readonly entityTable = ACORE_STRING_TABLE;
readonly entityIdField = ACORE_STRING_ENTRY;
readonly customStartingId = ACORE_STRING_CUSTOM_STARTING_ID;
readonly selectService = inject(SelectAcoreTextService);
readonly handlerService = inject(AcoreTextHandlerService);
readonly selectService = inject(SelectAcoreStringService);
readonly handlerService = inject(AcoreStringHandlerService);
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import { ModalModule } from 'ngx-bootstrap/modal';
import { ToastrModule } from 'ngx-toastr';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { of } from 'rxjs';
import { SelectAcoreTextComponent } from './select-acore-text.component';
import { AcoreTextHandlerService } from './acore-text-handler.service';
import { SelectAcoreTextService } from './select-acore-text.service';
import { SelectAcoreStringComponent } from './select-acore-string.component';
import { AcoreStringHandlerService } from './acore-string-handler.service';
import { SelectAcoreStringService } from './select-acore-string.service';

describe(`${SelectAcoreTextComponent.name} integration tests`, () => {
class Page extends SelectPageObject<SelectAcoreTextComponent> {
describe(`${SelectAcoreStringComponent.name} integration tests`, () => {
class Page extends SelectPageObject<SelectAcoreStringComponent> {
override ID_FIELD = ACORE_STRING_ENTRY;
}

Expand All @@ -21,8 +21,8 @@ describe(`${SelectAcoreTextComponent.name} integration tests`, () => {

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [BrowserAnimationsModule, ToastrModule.forRoot(), ModalModule.forRoot(), SelectAcoreTextComponent, TranslateTestingModule],
providers: [AcoreTextHandlerService],
imports: [BrowserAnimationsModule, ToastrModule.forRoot(), ModalModule.forRoot(), SelectAcoreStringComponent, TranslateTestingModule],
providers: [AcoreStringHandlerService],
}).compileComponents();
}));

Expand All @@ -31,9 +31,9 @@ describe(`${SelectAcoreTextComponent.name} integration tests`, () => {
const queryService = TestBed.inject(MysqlQueryService);
const querySpy = spyOn(queryService, 'query').and.returnValue(of([{ max: 1 }]));

const selectService = TestBed.inject(SelectAcoreTextService);
const selectService = TestBed.inject(SelectAcoreStringService);

const fixture = TestBed.createComponent(SelectAcoreTextComponent);
const fixture = TestBed.createComponent(SelectAcoreStringComponent);
const page = new Page(fixture);
const component = fixture.componentInstance;
fixture.autoDetectChanges(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ import { TestBed } from '@angular/core/testing';
import { MysqlQueryService } from '@keira/shared/db-layer';

import { instance, mock } from 'ts-mockito';
import { SelectAcoreTextService } from './select-acore-text.service';
import { AcoreTextHandlerService } from './acore-text-handler.service';
import { SelectAcoreStringService } from './select-acore-string.service';
import { AcoreStringHandlerService } from './acore-string-handler.service';

describe(SelectAcoreTextService.name, () => {
describe(SelectAcoreStringService.name, () => {
beforeEach(() =>
TestBed.configureTestingModule({
providers: [
{ provide: MysqlQueryService, useValue: instance(mock(MysqlQueryService)) },
SelectAcoreTextService,
AcoreTextHandlerService,
SelectAcoreStringService,
AcoreStringHandlerService,
],
}),
);

it('should be created', () => {
expect(TestBed.inject(SelectAcoreTextService)).toBeTruthy();
expect(TestBed.inject(SelectAcoreStringService)).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ import {
ACORE_STRING_TABLE,
AcoreString,
} from '@keira/shared/acore-world-model';
import { AcoreTextHandlerService } from './acore-text-handler.service';
import { AcoreStringHandlerService } from './acore-string-handler.service';

@Injectable({
providedIn: 'root',
})
export class SelectAcoreTextService extends SelectService<AcoreString> {
export class SelectAcoreStringService extends SelectService<AcoreString> {
/* istanbul ignore next */ // because of: https://github.com/gotwarlost/istanbul/issues/690
constructor(
override readonly queryService: MysqlQueryService,
public override readonly handlerService: AcoreTextHandlerService,
public override readonly handlerService: AcoreStringHandlerService,
) {
super(queryService, handlerService, ACORE_STRING_TABLE, ACORE_STRING_ENTRY, ACORE_STRING_DEFAULT, ACORE_STRING_SEARCH_FIELDS);
}
Expand Down

0 comments on commit 23a533e

Please sign in to comment.