Skip to content
Snippets Groups Projects
Verified Commit 8d29bfd6 authored by Sebastian Bergandy's avatar Sebastian Bergandy :keyboard:
Browse files

OZG-73743 rename statistik to aggregation-mapping

parent 5ba126a6
No related branches found
No related tags found
1 merge request!104Administration: Neu hinzugefügte Felder für Statistik speichern
Showing
with 72 additions and 67 deletions
import { enterWith } from '../../support/cypress.util'; import { enterWith } from '../../support/cypress.util';
export class StatistikFieldsFormE2EComponent { export class AggregationMappingFormE2EComponent {
private readonly formEngineInput: string = 'form-engine-name-text-input'; private readonly formEngineInput: string = 'form-engine-name-text-input';
private readonly formIdInput: string = 'form-id-text-input'; private readonly formIdInput: string = 'form-id-text-input';
private readonly formDataFieldInput: string = 'mapping-field-'; private readonly formDataFieldInput: string = 'mapping-field-';
......
export class StatistikE2EComponent { export class AggregationMappingE2EComponent {
private readonly locatorHeaderText: string = 'statistik-header-text'; private readonly locatorHeaderText: string = 'aggregation-mapping-header-text';
private readonly locatorWeitereFelderAuswertenButton = 'weitere-felder-auswerten-button'; private readonly locatorWeitereFelderAuswertenButton = 'weitere-felder-auswerten-button';
public getHeaderText(): Cypress.Chainable<Element> { public getHeaderText(): Cypress.Chainable<Element> {
......
import { StatistikE2EComponent } from 'apps/admin-e2e/src/components/statistik/statistik.e2e.component'; import { AggregationMappingFormE2EComponent } from '../../../components/aggregation-mapping/aggregation-mapping-form.e2e.component';
import { StatistikFieldsFormE2EComponent } from '../../../components/statistik/statistik-fields-form.e2e.component'; import { AggregationMappingE2EComponent } from '../../../components/aggregation-mapping/aggregation-mapping.e2e.component';
import { exist, haveText, haveValue } from '../../../support/cypress.util'; import { exist, haveValue } from '../../../support/cypress.util';
import { loginAsDaria } from '../../../support/user-util'; import { loginAsDaria } from '../../../support/user-util';
describe('Felder in Statistik hinzufügen', () => { describe('Aggregation Mapping hinzufügen', () => {
const component: StatistikE2EComponent = new StatistikE2EComponent(); const component: AggregationMappingE2EComponent = new AggregationMappingE2EComponent();
const fieldsFormComponent: StatistikFieldsFormE2EComponent = new StatistikFieldsFormE2EComponent(); const fieldsFormComponent: AggregationMappingFormE2EComponent = new AggregationMappingFormE2EComponent();
const dataText1: string = 'Eingabe A'; const dataText1: string = 'Eingabe A';
const dataText2: string = 'Eingabe B'; const dataText2: string = 'Eingabe B';
...@@ -49,7 +49,7 @@ describe('Felder in Statistik hinzufügen', () => { ...@@ -49,7 +49,7 @@ describe('Felder in Statistik hinzufügen', () => {
haveValue(fieldsFormComponent.getDataFieldInput(0), dataText2); haveValue(fieldsFormComponent.getDataFieldInput(0), dataText2);
}); });
it('should navigate to statistik on cancel', () => { it('should navigate to aggregation mapping on cancel', () => {
fieldsFormComponent.cancel(); fieldsFormComponent.cancel();
exist(component.getWeitereFelderAuswertenButton()); exist(component.getWeitereFelderAuswertenButton());
......
...@@ -26,10 +26,10 @@ import { ROUTES } from '@admin-client/shared'; ...@@ -26,10 +26,10 @@ import { ROUTES } from '@admin-client/shared';
import { UserFormComponent } from '@admin-client/user'; import { UserFormComponent } from '@admin-client/user';
import { ApiRootLinkRel } from '@alfa-client/api-root-shared'; import { ApiRootLinkRel } from '@alfa-client/api-root-shared';
import { Route } from '@angular/router'; import { Route } from '@angular/router';
import { AggregationMappingFormPageComponent } from '../pages/aggregation-mapping/aggregation-mapping-form-page/aggregation-mapping-form-page.component';
import { AggregationMappingListPageComponent } from '../pages/aggregation-mapping/aggregation-mapping-list-page/aggregation-mapping-list-page.component';
import { OrganisationsEinheitPageComponent } from '../pages/organisationseinheit/organisationseinheit-page/organisationseinheit-page.component'; import { OrganisationsEinheitPageComponent } from '../pages/organisationseinheit/organisationseinheit-page/organisationseinheit-page.component';
import { PostfachPageComponent } from '../pages/postfach/postfach-page/postfach-page.component'; import { PostfachPageComponent } from '../pages/postfach/postfach-page/postfach-page.component';
import { StatistikFieldsFormPageComponent } from '../pages/statistik/statistik-fields-form-page/statistik-fields-form-page.component';
import { StatistikPageComponent } from '../pages/statistik/statistik-page/statistik-page.component';
import { UnavailablePageComponent } from '../pages/unavailable/unavailable-page/unavailable-page.component'; import { UnavailablePageComponent } from '../pages/unavailable/unavailable-page/unavailable-page.component';
import { UserFormPageComponent } from '../pages/user/user-form-page/user-form-page.component'; import { UserFormPageComponent } from '../pages/user/user-form-page/user-form-page.component';
import { UserListPageComponent } from '../pages/user/user-list-page/user-list-page.component'; import { UserListPageComponent } from '../pages/user/user-list-page/user-list-page.component';
...@@ -84,7 +84,7 @@ export const appRoutes: Route[] = [ ...@@ -84,7 +84,7 @@ export const appRoutes: Route[] = [
}, },
{ {
path: ROUTES.AGGREGATION_MAPPING, path: ROUTES.AGGREGATION_MAPPING,
component: StatistikPageComponent, component: AggregationMappingListPageComponent,
title: 'Admin | Statistik', title: 'Admin | Statistik',
runGuardsAndResolvers: 'always', runGuardsAndResolvers: 'always',
canActivate: [configurationGuard], canActivate: [configurationGuard],
...@@ -92,7 +92,7 @@ export const appRoutes: Route[] = [ ...@@ -92,7 +92,7 @@ export const appRoutes: Route[] = [
}, },
{ {
path: ROUTES.AGGREGATION_MAPPING_NEU, path: ROUTES.AGGREGATION_MAPPING_NEU,
component: StatistikFieldsFormPageComponent, component: AggregationMappingFormPageComponent,
title: 'Admin | Statistik weitere Felder auswerten', title: 'Admin | Statistik weitere Felder auswerten',
runGuardsAndResolvers: 'always', runGuardsAndResolvers: 'always',
canActivate: [configurationGuard], canActivate: [configurationGuard],
...@@ -100,7 +100,7 @@ export const appRoutes: Route[] = [ ...@@ -100,7 +100,7 @@ export const appRoutes: Route[] = [
}, },
{ {
path: ROUTES.AGGREGATION_MAPPING_ID, path: ROUTES.AGGREGATION_MAPPING_ID,
component: StatistikFieldsFormPageComponent, component: AggregationMappingFormPageComponent,
title: 'Admin | Statistik weitere Felder auswerten', title: 'Admin | Statistik weitere Felder auswerten',
runGuardsAndResolvers: 'always', runGuardsAndResolvers: 'always',
canActivate: [configurationGuard], canActivate: [configurationGuard],
......
import { AggregationMappingFormContainerComponent } from '@admin-client/statistik'; import { AggregationMappingFormContainerComponent } from '@admin-client/aggregation-mapping';
import { expectComponentExistsInTemplate } from '@alfa-client/test-utils'; import { expectComponentExistsInTemplate } from '@alfa-client/test-utils';
import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MockComponent } from 'ng-mocks'; import { MockComponent } from 'ng-mocks';
import { StatistikFieldsFormPageComponent } from './statistik-fields-form-page.component'; import { AggregationMappingFormPageComponent } from './aggregation-mapping-form-page.component';
describe('StatistikFieldsFormPageComponent', () => { describe('AggregationMappingFormPageComponent', () => {
let component: StatistikFieldsFormPageComponent; let component: AggregationMappingFormPageComponent;
let fixture: ComponentFixture<StatistikFieldsFormPageComponent>; let fixture: ComponentFixture<AggregationMappingFormPageComponent>;
beforeEach(async () => { beforeEach(async () => {
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
imports: [StatistikFieldsFormPageComponent, MockComponent(AggregationMappingFormContainerComponent)], imports: [AggregationMappingFormPageComponent, MockComponent(AggregationMappingFormContainerComponent)],
}).compileComponents(); }).compileComponents();
fixture = TestBed.createComponent(StatistikFieldsFormPageComponent); fixture = TestBed.createComponent(AggregationMappingFormPageComponent);
component = fixture.componentInstance; component = fixture.componentInstance;
fixture.detectChanges(); fixture.detectChanges();
}); });
......
import { AggregationMappingFormContainerComponent } from '@admin-client/statistik'; import { AggregationMappingFormContainerComponent } from '@admin-client/aggregation-mapping';
import { Component } from '@angular/core'; import { Component } from '@angular/core';
@Component({ @Component({
selector: 'statistik-fields-form-page', selector: 'admin-aggregation-mapping-form-page',
standalone: true, standalone: true,
imports: [AggregationMappingFormContainerComponent], imports: [AggregationMappingFormContainerComponent],
templateUrl: './statistik-fields-form-page.component.html', templateUrl: './aggregation-mapping-form-page.component.html',
}) })
export class StatistikFieldsFormPageComponent {} export class AggregationMappingFormPageComponent {}
...@@ -23,4 +23,4 @@ ...@@ -23,4 +23,4 @@
unter der Lizenz sind dem Lizenztext zu entnehmen. unter der Lizenz sind dem Lizenztext zu entnehmen.
--> -->
<admin-statistik-container data-test-id="statistik-container" /> <admin-aggregation-mapping-list-container data-test-id="aggregation-mapping-container" />
...@@ -21,24 +21,23 @@ ...@@ -21,24 +21,23 @@
* Die sprachspezifischen Genehmigungen und Beschränkungen * Die sprachspezifischen Genehmigungen und Beschränkungen
* unter der Lizenz sind dem Lizenztext zu entnehmen. * unter der Lizenz sind dem Lizenztext zu entnehmen.
*/ */
import { StatistikContainerComponent } from '@admin-client/statistik'; import { AggregationMappingListContainerComponent } from '@admin-client/aggregation-mapping';
import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MockComponent } from 'ng-mocks'; import { MockComponent } from 'ng-mocks';
import { StatistikPageComponent } from './statistik-page.component'; import { AggregationMappingListPageComponent } from './aggregation-mapping-list-page.component';
describe('StatistikPageComponent', () => { describe('AggregationMappingListPageComponent', () => {
let component: StatistikPageComponent; let component: AggregationMappingListPageComponent;
let fixture: ComponentFixture<StatistikPageComponent>; let fixture: ComponentFixture<AggregationMappingListPageComponent>;
beforeEach(async () => { beforeEach(async () => {
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
imports: [], imports: [AggregationMappingListPageComponent, MockComponent(AggregationMappingListContainerComponent)],
declarations: [StatistikPageComponent, MockComponent(StatistikContainerComponent)],
}).compileComponents(); }).compileComponents();
}); });
beforeEach(() => { beforeEach(() => {
fixture = TestBed.createComponent(StatistikPageComponent); fixture = TestBed.createComponent(AggregationMappingListPageComponent);
component = fixture.componentInstance; component = fixture.componentInstance;
fixture.detectChanges(); fixture.detectChanges();
......
...@@ -21,13 +21,13 @@ ...@@ -21,13 +21,13 @@
* Die sprachspezifischen Genehmigungen und Beschränkungen * Die sprachspezifischen Genehmigungen und Beschränkungen
* unter der Lizenz sind dem Lizenztext zu entnehmen. * unter der Lizenz sind dem Lizenztext zu entnehmen.
*/ */
import { StatistikContainerComponent } from '@admin-client/statistik'; import { AggregationMappingListContainerComponent } from '@admin-client/aggregation-mapping';
import { Component } from '@angular/core'; import { Component } from '@angular/core';
@Component({ @Component({
selector: 'statistik-page', selector: 'admin-aggregation-mapping-list-page',
standalone: true, standalone: true,
imports: [StatistikContainerComponent], imports: [AggregationMappingListContainerComponent],
templateUrl: './statistik-page.component.html', templateUrl: './aggregation-mapping-list-page.component.html',
}) })
export class StatistikPageComponent {} export class AggregationMappingListPageComponent {}
# Aggregation Mapping
\ No newline at end of file
export default { export default {
displayName: 'admin-statistik', displayName: 'admin-aggregation-mapping',
preset: '../../../jest.preset.js', preset: '../../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'], setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
coverageDirectory: '../../../coverage/libs/admin/statistik', coverageDirectory: '../../../coverage/libs/admin/aggregation-mapping',
transform: { transform: {
'^.+\\.(ts|mjs|js|html)$': [ '^.+\\.(ts|mjs|js|html)$': [
'jest-preset-angular', 'jest-preset-angular',
......
{ {
"name": "admin-statistik", "name": "admin-aggregation-mapping",
"$schema": "../../../node_modules/nx/schemas/project-schema.json", "$schema": "../../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/admin/statistik/src", "sourceRoot": "libs/admin/aggregation-mapping/src",
"prefix": "admin", "prefix": "admin",
"projectType": "library", "projectType": "library",
"tags": [], "tags": [],
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
"executor": "@nx/jest:jest", "executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"], "outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": { "options": {
"tsConfig": "libs/admin/statistik/tsconfig.lib.json", "tsConfig": "libs/admin/aggregation-mapping/tsconfig.lib.json",
"jestConfig": "libs/admin/statistik/jest.config.ts" "jestConfig": "libs/admin/aggregation-mapping/jest.config.ts"
} }
}, },
"lint": { "lint": {
......
export * from './lib/aggregation-mapping-form-container/aggregation-mapping-form-container.component'; export * from './lib/aggregation-mapping-form-container/aggregation-mapping-form-container.component';
export * from './lib/statistik-container/statistik-container.component'; export * from './lib/aggregation-mapping-list-container/aggregation-mapping-list-container.component';
export * from './lib/statistik-fields-form/statistik-fields-form.component';
<ods-spinner [stateResource]="listStateResource$ | async"> <ods-spinner [stateResource]="listStateResource$ | async">
<admin-statistik-fields-form data-test-id="evaluate-fields-form"></admin-statistik-fields-form> <admin-aggregation-mapping-form data-test-id="evaluate-fields-form"></admin-aggregation-mapping-form>
</ods-spinner> </ods-spinner>
import { AggregationMappingFormContainerComponent } from '@admin-client/aggregation-mapping';
import { AggregationMappingService } from '@admin-client/reporting-shared'; import { AggregationMappingService } from '@admin-client/reporting-shared';
import { StatistikFieldsFormComponent } from '@admin-client/statistik';
import { Mock, mock } from '@alfa-client/test-utils'; import { Mock, mock } from '@alfa-client/test-utils';
import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing';
import { expect } from '@jest/globals'; import { expect } from '@jest/globals';
import { SpinnerComponent } from '@ods/component'; import { SpinnerComponent } from '@ods/component';
import { MockComponent } from 'ng-mocks'; import { MockComponent } from 'ng-mocks';
import { AggregationMappingFormContainerComponent } from './aggregation-mapping-form-container.component'; import { AggregationMappingFormComponent } from './aggregation-mapping-form/aggregation-mapping-form.component';
describe('AggregationMappingFormContainerComponent', () => { describe('AggregationMappingFormContainerComponent', () => {
let component: AggregationMappingFormContainerComponent; let component: AggregationMappingFormContainerComponent;
...@@ -20,7 +20,7 @@ describe('AggregationMappingFormContainerComponent', () => { ...@@ -20,7 +20,7 @@ describe('AggregationMappingFormContainerComponent', () => {
imports: [ imports: [
AggregationMappingFormContainerComponent, AggregationMappingFormContainerComponent,
MockComponent(SpinnerComponent), MockComponent(SpinnerComponent),
MockComponent(StatistikFieldsFormComponent), MockComponent(AggregationMappingFormComponent),
], ],
providers: [ providers: [
{ {
......
...@@ -4,12 +4,12 @@ import { AsyncPipe } from '@angular/common'; ...@@ -4,12 +4,12 @@ import { AsyncPipe } from '@angular/common';
import { Component, inject, OnDestroy } from '@angular/core'; import { Component, inject, OnDestroy } from '@angular/core';
import { SpinnerComponent } from '@ods/component'; import { SpinnerComponent } from '@ods/component';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { StatistikFieldsFormComponent } from '../statistik-fields-form/statistik-fields-form.component'; import { AggregationMappingFormComponent } from './aggregation-mapping-form/aggregation-mapping-form.component';
@Component({ @Component({
selector: 'admin-aggregation-mapping-form-container', selector: 'admin-aggregation-mapping-form-container',
standalone: true, standalone: true,
imports: [SpinnerComponent, AsyncPipe, StatistikFieldsFormComponent], imports: [SpinnerComponent, AsyncPipe, AggregationMappingFormComponent],
templateUrl: './aggregation-mapping-form-container.component.html', templateUrl: './aggregation-mapping-form-container.component.html',
}) })
export class AggregationMappingFormContainerComponent implements OnDestroy { export class AggregationMappingFormContainerComponent implements OnDestroy {
......
<form [formGroup]="formService.form"> <form [formGroup]="formService.form">
<ng-container [formArrayName]="StatistikFieldsFormService.FIELD_MAPPINGS"> <ng-container [formArrayName]="AggregationMappingFormService.FIELD_MAPPINGS">
<ng-container [formGroupName]="index"> <ng-container [formGroupName]="index">
<div class="flex w-full flex-col gap-2 mt-4 bg-gray-100 p-4 rounded-md"> <div class="flex w-full flex-col gap-2 mt-4 bg-gray-100 p-4 rounded-md">
<div class="flex flex-row items-center justify-between"> <div class="flex flex-row items-center justify-between">
......
...@@ -7,13 +7,13 @@ import { expect } from '@jest/globals'; ...@@ -7,13 +7,13 @@ import { expect } from '@jest/globals';
import { TextEditorComponent } from '@ods/component'; import { TextEditorComponent } from '@ods/component';
import { ButtonComponent, DeleteIconComponent } from '@ods/system'; import { ButtonComponent, DeleteIconComponent } from '@ods/system';
import { MockComponent } from 'ng-mocks'; import { MockComponent } from 'ng-mocks';
import { getDataTestIdOf } from '../../../../../../../tech-shared/test/data-test'; import { getDataTestIdOf } from '../../../../../../../../tech-shared/test/data-test';
import { StatistikFieldsFormService } from '../../statistik-fields.formservice'; import { AggregationMappingFormService } from '../../aggregation-mapping-form.service';
import { StatistikFieldMappingFormComponent } from './statistik-field-mapping-form.component'; import { AggregationMappingFieldFormComponent } from './aggregation-mapping-field-form.component';
describe('AdminStatistikFieldMappingFormComponent', () => { describe('AggregationMappingFieldFormComponent', () => {
let component: StatistikFieldMappingFormComponent; let component: AggregationMappingFieldFormComponent;
let fixture: ComponentFixture<StatistikFieldMappingFormComponent>; let fixture: ComponentFixture<AggregationMappingFieldFormComponent>;
const formBuilder: FormBuilder = new FormBuilder(); const formBuilder: FormBuilder = new FormBuilder();
const fieldIndex: number = 0; const fieldIndex: number = 0;
...@@ -21,20 +21,20 @@ describe('AdminStatistikFieldMappingFormComponent', () => { ...@@ -21,20 +21,20 @@ describe('AdminStatistikFieldMappingFormComponent', () => {
const targetPathEditorTestId: string = getDataTestIdOf('target-mapping-field-0'); const targetPathEditorTestId: string = getDataTestIdOf('target-mapping-field-0');
const removeMappingButtonTestId: string = getDataTestIdOf('remove-mapping-0'); const removeMappingButtonTestId: string = getDataTestIdOf('remove-mapping-0');
let formService: Mock<StatistikFieldsFormService>; let formService: Mock<AggregationMappingFormService>;
beforeEach(async () => { beforeEach(async () => {
const form: FormGroup = formBuilder.group({ const form: FormGroup = formBuilder.group({
[StatistikFieldsFormService.FIELD_MAPPINGS]: formBuilder.array([ [AggregationMappingFormService.FIELD_MAPPINGS]: formBuilder.array([
new FormGroup({ new FormGroup({
[StatistikFieldsFormService.FIELD_MAPPING_SOURCE_PATH]: new FormControl(EMPTY_STRING), [AggregationMappingFormService.FIELD_MAPPING_SOURCE_PATH]: new FormControl(EMPTY_STRING),
[StatistikFieldsFormService.FIELD_MAPPING_TARGET_PATH]: new FormControl(EMPTY_STRING), [AggregationMappingFormService.FIELD_MAPPING_TARGET_PATH]: new FormControl(EMPTY_STRING),
}), }),
]), ]),
}); });
formService = <any>{ formService = <any>{
...mock(StatistikFieldsFormService), ...mock(AggregationMappingFormService),
form, form,
addMapping: jest.fn(), addMapping: jest.fn(),
removeMapping: jest.fn(), removeMapping: jest.fn(),
...@@ -42,13 +42,13 @@ describe('AdminStatistikFieldMappingFormComponent', () => { ...@@ -42,13 +42,13 @@ describe('AdminStatistikFieldMappingFormComponent', () => {
mockGetValue( mockGetValue(
formService, formService,
StatistikFieldsFormService.FIELD_MAPPINGS, AggregationMappingFormService.FIELD_MAPPINGS,
form.controls[StatistikFieldsFormService.FIELD_MAPPINGS], form.controls[AggregationMappingFormService.FIELD_MAPPINGS],
); );
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
imports: [ imports: [
StatistikFieldMappingFormComponent, AggregationMappingFieldFormComponent,
MockComponent(TextEditorComponent), MockComponent(TextEditorComponent),
MockComponent(ButtonComponent), MockComponent(ButtonComponent),
MockComponent(DeleteIconComponent), MockComponent(DeleteIconComponent),
...@@ -61,7 +61,7 @@ describe('AdminStatistikFieldMappingFormComponent', () => { ...@@ -61,7 +61,7 @@ describe('AdminStatistikFieldMappingFormComponent', () => {
], ],
}).compileComponents(); }).compileComponents();
fixture = TestBed.createComponent(StatistikFieldMappingFormComponent); fixture = TestBed.createComponent(AggregationMappingFieldFormComponent);
component = fixture.componentInstance; component = fixture.componentInstance;
component.index = fieldIndex; component.index = fieldIndex;
fixture.detectChanges(); fixture.detectChanges();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment