mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
feat(return-review): create return review library and connect to routing
Initialize the return-review feature library with basic component structure and connect it to the existing routing system in both return-process and return-summary features. Update navigation in ReturnSummaryComponent to redirect to the review page after successful return completion. Ref: #4942
This commit is contained in:
@@ -8,4 +8,9 @@ export const routes: Route[] = [
|
|||||||
loadChildren: () =>
|
loadChildren: () =>
|
||||||
import('@isa/oms/feature/return-summary').then((feat) => feat.routes),
|
import('@isa/oms/feature/return-summary').then((feat) => feat.routes),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'review',
|
||||||
|
loadChildren: () =>
|
||||||
|
import('@isa/oms/feature/return-review').then((feat) => feat.routes),
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
7
libs/oms/feature/return-review/README.md
Normal file
7
libs/oms/feature/return-review/README.md
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# return-review
|
||||||
|
|
||||||
|
This library was generated with [Nx](https://nx.dev).
|
||||||
|
|
||||||
|
## Running unit tests
|
||||||
|
|
||||||
|
Run `nx test return-review` to execute the unit tests.
|
||||||
34
libs/oms/feature/return-review/eslint.config.mjs
Normal file
34
libs/oms/feature/return-review/eslint.config.mjs
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
import nx from '@nx/eslint-plugin';
|
||||||
|
import baseConfig from '../../../../eslint.config.mjs';
|
||||||
|
|
||||||
|
export default [
|
||||||
|
...baseConfig,
|
||||||
|
...nx.configs['flat/angular'],
|
||||||
|
...nx.configs['flat/angular-template'],
|
||||||
|
{
|
||||||
|
files: ['**/*.ts'],
|
||||||
|
rules: {
|
||||||
|
'@angular-eslint/directive-selector': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
type: 'attribute',
|
||||||
|
prefix: 'omsFeature',
|
||||||
|
style: 'camelCase',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'@angular-eslint/component-selector': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
type: 'element',
|
||||||
|
prefix: 'oms-feature',
|
||||||
|
style: 'kebab-case',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['**/*.html'],
|
||||||
|
// Override or add rules here
|
||||||
|
rules: {},
|
||||||
|
},
|
||||||
|
];
|
||||||
21
libs/oms/feature/return-review/jest.config.ts
Normal file
21
libs/oms/feature/return-review/jest.config.ts
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
export default {
|
||||||
|
displayName: 'return-review',
|
||||||
|
preset: '../../../../jest.preset.js',
|
||||||
|
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
|
||||||
|
coverageDirectory: '../../../../coverage/libs/oms/feature/return-review',
|
||||||
|
transform: {
|
||||||
|
'^.+\\.(ts|mjs|js|html)$': [
|
||||||
|
'jest-preset-angular',
|
||||||
|
{
|
||||||
|
tsconfig: '<rootDir>/tsconfig.spec.json',
|
||||||
|
stringifyContentPathRegex: '\\.(html|svg)$',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
|
||||||
|
snapshotSerializers: [
|
||||||
|
'jest-preset-angular/build/serializers/no-ng-attributes',
|
||||||
|
'jest-preset-angular/build/serializers/ng-snapshot',
|
||||||
|
'jest-preset-angular/build/serializers/html-comment',
|
||||||
|
],
|
||||||
|
};
|
||||||
20
libs/oms/feature/return-review/project.json
Normal file
20
libs/oms/feature/return-review/project.json
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"name": "return-review",
|
||||||
|
"$schema": "../../../../node_modules/nx/schemas/project-schema.json",
|
||||||
|
"sourceRoot": "libs/oms/feature/return-review/src",
|
||||||
|
"prefix": "oms-feature",
|
||||||
|
"projectType": "library",
|
||||||
|
"tags": [],
|
||||||
|
"targets": {
|
||||||
|
"test": {
|
||||||
|
"executor": "@nx/jest:jest",
|
||||||
|
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
||||||
|
"options": {
|
||||||
|
"jestConfig": "libs/oms/feature/return-review/jest.config.ts"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lint": {
|
||||||
|
"executor": "@nx/eslint:lint"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
1
libs/oms/feature/return-review/src/index.ts
Normal file
1
libs/oms/feature/return-review/src/index.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export { routes } from './lib/routes';
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<p>ReturnReview works!</p>
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
import { ReturnReviewComponent } from './return-review.component';
|
||||||
|
|
||||||
|
describe('ReturnReviewComponent', () => {
|
||||||
|
let component: ReturnReviewComponent;
|
||||||
|
let fixture: ComponentFixture<ReturnReviewComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [ReturnReviewComponent],
|
||||||
|
}).compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(ReturnReviewComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'oms-feature-return-review',
|
||||||
|
imports: [CommonModule],
|
||||||
|
templateUrl: './return-review.component.html',
|
||||||
|
styleUrl: './return-review.component.scss',
|
||||||
|
})
|
||||||
|
export class ReturnReviewComponent {}
|
||||||
4
libs/oms/feature/return-review/src/lib/routes.ts
Normal file
4
libs/oms/feature/return-review/src/lib/routes.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
import { Routes } from '@angular/router';
|
||||||
|
import { ReturnReviewComponent } from './return-review.component';
|
||||||
|
|
||||||
|
export const routes: Routes = [{ path: '', component: ReturnReviewComponent }];
|
||||||
6
libs/oms/feature/return-review/src/test-setup.ts
Normal file
6
libs/oms/feature/return-review/src/test-setup.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import { setupZoneTestEnv } from 'jest-preset-angular/setup-env/zone';
|
||||||
|
|
||||||
|
setupZoneTestEnv({
|
||||||
|
errorOnUnknownElements: true,
|
||||||
|
errorOnUnknownProperties: true,
|
||||||
|
});
|
||||||
28
libs/oms/feature/return-review/tsconfig.json
Normal file
28
libs/oms/feature/return-review/tsconfig.json
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "es2022",
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"strict": true,
|
||||||
|
"noImplicitOverride": true,
|
||||||
|
"noPropertyAccessFromIndexSignature": true,
|
||||||
|
"noImplicitReturns": true,
|
||||||
|
"noFallthroughCasesInSwitch": true
|
||||||
|
},
|
||||||
|
"files": [],
|
||||||
|
"include": [],
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"path": "./tsconfig.lib.json"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "./tsconfig.spec.json"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"extends": "../../../../tsconfig.base.json",
|
||||||
|
"angularCompilerOptions": {
|
||||||
|
"enableI18nLegacyMessageIdFormat": false,
|
||||||
|
"strictInjectionParameters": true,
|
||||||
|
"strictInputAccessModifiers": true,
|
||||||
|
"strictTemplates": true
|
||||||
|
}
|
||||||
|
}
|
||||||
17
libs/oms/feature/return-review/tsconfig.lib.json
Normal file
17
libs/oms/feature/return-review/tsconfig.lib.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "../../../../dist/out-tsc",
|
||||||
|
"declaration": true,
|
||||||
|
"declarationMap": true,
|
||||||
|
"inlineSources": true,
|
||||||
|
"types": []
|
||||||
|
},
|
||||||
|
"exclude": [
|
||||||
|
"src/**/*.spec.ts",
|
||||||
|
"src/test-setup.ts",
|
||||||
|
"jest.config.ts",
|
||||||
|
"src/**/*.test.ts"
|
||||||
|
],
|
||||||
|
"include": ["src/**/*.ts"]
|
||||||
|
}
|
||||||
16
libs/oms/feature/return-review/tsconfig.spec.json
Normal file
16
libs/oms/feature/return-review/tsconfig.spec.json
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "../../../../dist/out-tsc",
|
||||||
|
"module": "commonjs",
|
||||||
|
"target": "es2016",
|
||||||
|
"types": ["jest", "node"]
|
||||||
|
},
|
||||||
|
"files": ["src/test-setup.ts"],
|
||||||
|
"include": [
|
||||||
|
"jest.config.ts",
|
||||||
|
"src/**/*.test.ts",
|
||||||
|
"src/**/*.spec.ts",
|
||||||
|
"src/**/*.d.ts"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -20,10 +20,12 @@ export const routes: Routes = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'receipt',
|
path: 'receipt',
|
||||||
loadChildren: () => import('@isa/oms/feature/return-details').then((feat) => feat.routes),
|
loadChildren: () =>
|
||||||
|
import('@isa/oms/feature/return-details').then((feat) => feat.routes),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'process',
|
path: 'process',
|
||||||
loadChildren: () => import('@isa/oms/feature/return-process').then((feat) => feat.routes),
|
loadChildren: () =>
|
||||||
|
import('@isa/oms/feature/return-process').then((feat) => feat.routes),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -113,8 +113,7 @@ export class ReturnSummaryComponent {
|
|||||||
});
|
});
|
||||||
this.returnItemsAndPrintReciptStatus.set('success');
|
this.returnItemsAndPrintReciptStatus.set('success');
|
||||||
|
|
||||||
// TODO: Navigation to "Rückgabe war erfolgreich" page
|
await this.#router.navigate(['../', 'review'], {
|
||||||
await this.#router.navigate(['../../'], {
|
|
||||||
relativeTo: this.#activatedRoute,
|
relativeTo: this.#activatedRoute,
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -1,4 +1,11 @@
|
|||||||
import { Routes } from '@angular/router';
|
import { Routes } from '@angular/router';
|
||||||
import { ReturnSummaryComponent } from './return-summary.component';
|
import { ReturnSummaryComponent } from './return-summary.component';
|
||||||
|
|
||||||
export const routes: Routes = [{ path: '', component: ReturnSummaryComponent }];
|
export const routes: Routes = [
|
||||||
|
{ path: '', component: ReturnSummaryComponent },
|
||||||
|
{
|
||||||
|
path: 'review',
|
||||||
|
loadChildren: () =>
|
||||||
|
import('@isa/oms/feature/return-review').then((feat) => feat.routes),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|||||||
@@ -55,6 +55,9 @@
|
|||||||
"@isa/oms/feature/return-process": [
|
"@isa/oms/feature/return-process": [
|
||||||
"libs/oms/feature/return-process/src/index.ts"
|
"libs/oms/feature/return-process/src/index.ts"
|
||||||
],
|
],
|
||||||
|
"@isa/oms/feature/return-review": [
|
||||||
|
"libs/oms/feature/return-review/src/index.ts"
|
||||||
|
],
|
||||||
"@isa/oms/feature/return-search": [
|
"@isa/oms/feature/return-search": [
|
||||||
"libs/oms/feature/return-search/src/index.ts"
|
"libs/oms/feature/return-search/src/index.ts"
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user