lib Builds nicht mehr notwendig

Co-authored-by: s.neumair@paragon-data.de <s.neumair@paragon-data.de>
This commit is contained in:
Lorenz Hilpert
2020-09-21 16:04:46 +02:00
parent 7b77e8c234
commit 1985d4df51
47 changed files with 810 additions and 427 deletions

View File

@@ -577,6 +577,76 @@
}
}
}
},
"@domain/crm": {
"projectType": "library",
"root": "apps/domain/crm",
"sourceRoot": "apps/domain/crm/src",
"prefix": "crm",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "apps/domain/crm/tsconfig.lib.json",
"project": "apps/domain/crm/ng-package.json"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "apps/domain/crm/src/test.ts",
"tsConfig": "apps/domain/crm/tsconfig.spec.json",
"karmaConfig": "apps/domain/crm/karma.conf.js"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"apps/domain/crm/tsconfig.lib.json",
"apps/domain/crm/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
},
"@domain/checkout": {
"projectType": "library",
"root": "apps/domain/checkout",
"sourceRoot": "apps/domain/checkout/src",
"prefix": "checkout",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "apps/domain/checkout/tsconfig.lib.json",
"project": "apps/domain/checkout/ng-package.json"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "apps/domain/checkout/src/test.ts",
"tsConfig": "apps/domain/checkout/tsconfig.spec.json",
"karmaConfig": "apps/domain/checkout/karma.conf.js"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"apps/domain/checkout/tsconfig.lib.json",
"apps/domain/checkout/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "sales"

View File

@@ -0,0 +1,25 @@
# Checkout
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.2.14.
## Code scaffolding
Run `ng generate component component-name --project checkout` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project checkout`.
> Note: Don't forget to add `--project checkout` or else it will be added to the default project in your `angular.json` file.
## Build
Run `ng build checkout` to build the project. The build artifacts will be stored in the `dist/` directory.
## Publishing
After building your library with `ng build checkout`, go to the dist folder `cd dist/checkout` and run `npm publish`.
## Running unit tests
Run `ng test checkout` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Further help
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

View File

@@ -0,0 +1,32 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma'),
],
client: {
clearContext: false, // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../../../coverage/domain/checkout'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true,
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true,
});
};

View File

@@ -0,0 +1,7 @@
{
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../../dist/domain/checkout",
"lib": {
"entryFile": "src/public-api.ts"
}
}

View File

@@ -0,0 +1,8 @@
{
"name": "@domain/checkout",
"version": "0.0.1",
"peerDependencies": {
"@angular/common": "^8.2.14",
"@angular/core": "^8.2.14"
}
}

View File

@@ -0,0 +1,24 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { CheckoutComponent } from './checkout.component';
describe('CheckoutComponent', () => {
let component: CheckoutComponent;
let fixture: ComponentFixture<CheckoutComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [CheckoutComponent],
}).compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(CheckoutComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -0,0 +1,16 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'checkout-checkout',
template: `
<p>
checkout works!
</p>
`,
styles: [],
})
export class CheckoutComponent implements OnInit {
constructor() {}
ngOnInit() {}
}

View File

@@ -0,0 +1,9 @@
import { NgModule } from '@angular/core';
import { CheckoutComponent } from './checkout.component';
@NgModule({
declarations: [CheckoutComponent],
imports: [],
exports: [CheckoutComponent],
})
export class CheckoutModule {}

View File

@@ -0,0 +1,12 @@
import { TestBed } from '@angular/core/testing';
import { CheckoutService } from './checkout.service';
describe('CheckoutService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: CheckoutService = TestBed.get(CheckoutService);
expect(service).toBeTruthy();
});
});

View File

@@ -0,0 +1,8 @@
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root',
})
export class CheckoutService {
constructor() {}
}

View File

@@ -0,0 +1,7 @@
/*
* Public API Surface of checkout
*/
export * from './lib/checkout.service';
export * from './lib/checkout.component';
export * from './lib/checkout.module';

View File

@@ -0,0 +1,15 @@
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
import 'zone.js/dist/zone';
import 'zone.js/dist/zone-testing';
import { getTestBed } from '@angular/core/testing';
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
declare const require: any;
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);

View File

@@ -0,0 +1,26 @@
{
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "../../../out-tsc/lib",
"target": "es2015",
"declaration": true,
"inlineSources": true,
"types": [],
"lib": [
"dom",
"es2018"
]
},
"angularCompilerOptions": {
"annotateForClosureCompiler": true,
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"enableResourceInlining": true
},
"exclude": [
"src/test.ts",
"**/*.spec.ts"
]
}

View File

@@ -0,0 +1,17 @@
{
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "../../../out-tsc/spec",
"types": [
"jasmine",
"node"
]
},
"files": [
"src/test.ts"
],
"include": [
"**/*.spec.ts",
"**/*.d.ts"
]
}

View File

@@ -0,0 +1,17 @@
{
"extends": "../../../tslint.json",
"rules": {
"directive-selector": [
true,
"attribute",
"checkout",
"camelCase"
],
"component-selector": [
true,
"element",
"checkout",
"kebab-case"
]
}
}

25
apps/domain/crm/README.md Normal file
View File

@@ -0,0 +1,25 @@
# Crm
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.2.14.
## Code scaffolding
Run `ng generate component component-name --project crm` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project crm`.
> Note: Don't forget to add `--project crm` or else it will be added to the default project in your `angular.json` file.
## Build
Run `ng build crm` to build the project. The build artifacts will be stored in the `dist/` directory.
## Publishing
After building your library with `ng build crm`, go to the dist folder `cd dist/crm` and run `npm publish`.
## Running unit tests
Run `ng test crm` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Further help
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

View File

@@ -0,0 +1,32 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma'),
],
client: {
clearContext: false, // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../../../coverage/domain/crm'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true,
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true,
});
};

View File

@@ -0,0 +1,7 @@
{
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../../dist/domain/crm",
"lib": {
"entryFile": "src/public-api.ts"
}
}

View File

@@ -0,0 +1,8 @@
{
"name": "@domain/crm",
"version": "0.0.1",
"peerDependencies": {
"@angular/common": "^8.2.14",
"@angular/core": "^8.2.14"
}
}

View File

@@ -0,0 +1,24 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { CrmComponent } from './crm.component';
describe('CrmComponent', () => {
let component: CrmComponent;
let fixture: ComponentFixture<CrmComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [CrmComponent],
}).compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(CrmComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -0,0 +1,16 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'crm-crm',
template: `
<p>
crm works!
</p>
`,
styles: [],
})
export class CrmComponent implements OnInit {
constructor() {}
ngOnInit() {}
}

View File

@@ -0,0 +1,9 @@
import { NgModule } from '@angular/core';
import { CrmComponent } from './crm.component';
@NgModule({
declarations: [CrmComponent],
imports: [],
exports: [CrmComponent],
})
export class CrmModule {}

View File

@@ -0,0 +1,12 @@
import { TestBed } from '@angular/core/testing';
import { CrmService } from './crm.service';
describe('CrmService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: CrmService = TestBed.get(CrmService);
expect(service).toBeTruthy();
});
});

View File

@@ -0,0 +1,8 @@
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root',
})
export class CrmService {
constructor() {}
}

View File

@@ -0,0 +1,7 @@
/*
* Public API Surface of crm
*/
export * from './lib/crm.service';
export * from './lib/crm.component';
export * from './lib/crm.module';

View File

@@ -0,0 +1,15 @@
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
import 'zone.js/dist/zone';
import 'zone.js/dist/zone-testing';
import { getTestBed } from '@angular/core/testing';
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
declare const require: any;
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);

View File

@@ -0,0 +1,26 @@
{
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "../../../out-tsc/lib",
"target": "es2015",
"declaration": true,
"inlineSources": true,
"types": [],
"lib": [
"dom",
"es2018"
]
},
"angularCompilerOptions": {
"annotateForClosureCompiler": true,
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"enableResourceInlining": true
},
"exclude": [
"src/test.ts",
"**/*.spec.ts"
]
}

View File

@@ -0,0 +1,17 @@
{
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "../../../out-tsc/spec",
"types": [
"jasmine",
"node"
]
},
"files": [
"src/test.ts"
],
"include": [
"**/*.spec.ts",
"**/*.d.ts"
]
}

View File

@@ -0,0 +1,17 @@
{
"extends": "../../../tslint.json",
"rules": {
"directive-selector": [
true,
"attribute",
"crm",
"camelCase"
],
"component-selector": [
true,
"element",
"crm",
"kebab-case"
]
}
}

View File

@@ -9,7 +9,7 @@ import {
Output,
EventEmitter,
} from '@angular/core';
import { AutocompleteDTO } from '@swagger/oms/lib';
import { AutocompleteDTO } from '@swagger/oms';
import { ActiveDescendantKeyManager } from '@angular/cdk/a11y';
import { ResultItemComponent } from './result-item';
import { AutocompleteOptions } from '../../defs';

View File

@@ -1,5 +1,5 @@
import { Component, ChangeDetectionStrategy, Input, HostBinding, Output, EventEmitter } from '@angular/core';
import { AutocompleteDTO } from '@swagger/oms/lib';
import { AutocompleteDTO } from '@swagger/oms';
import { Highlightable } from '@angular/cdk/a11y';
@Component({

View File

@@ -1,4 +1,4 @@
import { VATType } from '@swagger/oms/lib';
import { VATType } from '@swagger/oms';
export const VatTypeName = new Map<VATType, string>([
[0, ''],

View File

@@ -8,7 +8,7 @@ import { FormGroup, FormArray } from '@angular/forms';
import { ProcessingStatusPipe, PickUpDateOptionsToDisplayValuesPipe, ProcessingStatusOptionsPipe } from '../../pipes';
import { DatePipe } from '@angular/common';
import { ShelfNavigationService } from '../../shared/services';
import { OrderItemProcessingStatusValue } from '@swagger/oms/lib';
import { OrderItemProcessingStatusValue } from '@swagger/oms';
import { ErrorService } from 'apps/sales/src/app/core/error/component/error.service';
@Component({

View File

@@ -5,7 +5,7 @@ import { ShelfNavigationService } from '../../shared/services';
import { filter, map, distinctUntilChanged, shareReplay, take, withLatestFrom, first } from 'rxjs/operators';
import { isNullOrUndefined } from 'util';
import { DatePipe } from '@angular/common';
import { OrderItemProcessingStatusValue } from '@swagger/oms/lib';
import { OrderItemProcessingStatusValue } from '@swagger/oms';
import { ShelfEditFormService } from '../../services/shelf-edit-form.service';
import { ProcessingStatusOptionsPipe, ProcessingStatusPipe, PickUpDateOptionsToDisplayValuesPipe } from '../../pipes';
import { ErrorService } from 'apps/sales/src/app/core/error/component/error.service';

View File

@@ -2,7 +2,7 @@ import { Component, ChangeDetectionStrategy, Input, TemplateRef, OnInit } from '
import { HistoryStateFacade } from '@shelf-store/history';
import { DetailsFacade } from '@shelf-store/details';
import { OrderDetailsCardInput } from '../../../components/order-details-card';
import { OrderItemListItemDTO, OrderItemProcessingStatusValue } from '@swagger/oms/lib';
import { OrderItemListItemDTO, OrderItemProcessingStatusValue } from '@swagger/oms';
import { Observable } from 'rxjs';
import { map, filter, shareReplay, take } from 'rxjs/operators';

View File

@@ -1,5 +1,5 @@
import { Pipe, PipeTransform } from '@angular/core';
import { VATDTO } from '@swagger/checkout/lib';
import { VATDTO } from '@swagger/checkout';
@Pipe({
name: 'vatDtoToVatType',

View File

@@ -9,12 +9,9 @@ import {
DeleteLastPreviousPath,
ClearBreadcrumbs,
} from 'apps/sales/src/app/core/store/actions/breadcrumb.actions';
import {
ChangeCurrentRoute,
AddProcess,
} from 'apps/sales/src/app/core/store/actions/process.actions';
import { ChangeCurrentRoute, AddProcess } from 'apps/sales/src/app/core/store/actions/process.actions';
import { Breadcrumb } from 'apps/sales/src/app/core/models/breadcrumb.model';
import { OrderItemListItemDTO } from '@swagger/oms/lib';
import { OrderItemListItemDTO } from '@swagger/oms';
import { ProcessSelectors } from 'apps/sales/src/app/core/store/selectors/process.selectors';
import { Process } from 'apps/sales/src/app/core/models/process.model';
@@ -51,11 +48,7 @@ export class ShelfNavigationService {
}
}
navigateToEdit(order: {
orderNumber?: string;
compartmentCode?: string;
processingStatus?: number;
}) {
navigateToEdit(order: { orderNumber?: string; compartmentCode?: string; processingStatus?: number }) {
if (!order) {
return this.navigateToSearch();
}
@@ -66,11 +59,7 @@ export class ShelfNavigationService {
this.navigateToRoute(path, breadcrumb);
}
updateDetailsNavigation(order: {
orderNumber?: string;
compartmentCode?: string;
processingStatus?: number;
}) {
updateDetailsNavigation(order: { orderNumber?: string; compartmentCode?: string; processingStatus?: number }) {
if (!order) {
return this.navigateToSearch();
}
@@ -88,13 +77,7 @@ export class ShelfNavigationService {
this.replaceRoute(path, breadcrumb);
}
navigateToResultList({
searchQuery,
numberOfHits,
}: {
searchQuery: string;
numberOfHits: number;
}) {
navigateToResultList({ searchQuery, numberOfHits }: { searchQuery: string; numberOfHits: number }) {
this.createTab();
const path = '/shelf/results';
const breadcrumb = this.getResultListBreadcrumb(searchQuery, numberOfHits);
@@ -102,10 +85,7 @@ export class ShelfNavigationService {
}
navigateToHistory(orderitem: OrderItemListItemDTO) {
this.navigateToRoute(
this.getHistoryPath(orderitem),
`Historie ${orderitem.orderItemSubsetId}`
);
this.navigateToRoute(this.getHistoryPath(orderitem), `Historie ${orderitem.orderItemSubsetId}`);
}
getHistoryPath(data: {
@@ -122,24 +102,14 @@ export class ShelfNavigationService {
}
}
updateResultPageBreadcrumb(data: {
numberOfHits: number;
searchQuery: string;
}) {
updateResultPageBreadcrumb(data: { numberOfHits: number; searchQuery: string }) {
this.store.dispatch(new DeleteBreadcrumbsForProcess(1));
this.store.dispatch(
new AddBreadcrumb(
{ name: 'Warenausgabe', path: '/shelf/search' },
'shelf'
)
);
this.store.dispatch(new AddBreadcrumb({ name: 'Warenausgabe', path: '/shelf/search' }, 'shelf'));
const path = '/shelf/results';
this.store.dispatch(
new AddBreadcrumb(
{
name: `${data.searchQuery} (${data.numberOfHits} ${
data.numberOfHits > 1 ? 'Ergebnisse' : 'Ergebnis'
})`,
name: `${data.searchQuery} (${data.numberOfHits} ${data.numberOfHits > 1 ? 'Ergebnisse' : 'Ergebnis'})`,
path,
},
'shelf'
@@ -149,22 +119,15 @@ export class ShelfNavigationService {
private replaceRoute(route: string, breadcrumbName: string) {
this.router.navigate([route]);
this.store.dispatch(
new UpdateCurrentBreadcrumbName(breadcrumbName, 'shelf')
);
this.store.dispatch(new UpdateCurrentBreadcrumbName(breadcrumbName, 'shelf'));
}
private resetBreadcrumbs(): void {
this.store.dispatch(new ClearBreadcrumbs('shelf'));
this.store.dispatch(
new AddBreadcrumb({ name: 'Warenausgabe', path: '/shelf' }, 'shelf', true)
);
this.store.dispatch(new AddBreadcrumb({ name: 'Warenausgabe', path: '/shelf' }, 'shelf', true));
}
private async navigateToRoute(
route: string,
breadcrumbName: string
): Promise<boolean> {
private async navigateToRoute(route: string, breadcrumbName: string): Promise<boolean> {
this.store.dispatch(
new AddBreadcrumb(
<Breadcrumb>{
@@ -195,9 +158,7 @@ export class ShelfNavigationService {
this.store.dispatch(new PopLastBreadcrumbs(this.getEditBreadCrumb()));
if (previous) {
this.store.dispatch(
new PopLastBreadcrumbs(this.getDetailsBreadcrumb(previous))
);
this.store.dispatch(new PopLastBreadcrumbs(this.getDetailsBreadcrumb(previous)));
}
await this.navigateToDetails(data, { replaceLastVisited });
@@ -219,9 +180,7 @@ export class ShelfNavigationService {
}
) {
if (previous) {
this.store.dispatch(
new PopLastBreadcrumbs(this.getDetailsBreadcrumb(previous))
);
this.store.dispatch(new PopLastBreadcrumbs(this.getDetailsBreadcrumb(previous)));
}
this.navigateToDetails(data, { replaceLastVisited: true });
}
@@ -230,17 +189,11 @@ export class ShelfNavigationService {
this.store.dispatch(new DeleteLastPreviousPath());
}
private getResultListBreadcrumb(
searchQuery: string,
numberOfHits: number
): string {
private getResultListBreadcrumb(searchQuery: string, numberOfHits: number): string {
return `${searchQuery} (${numberOfHits} Ergebnisse)`;
}
getDetailsBreadcrumb(data: {
orderNumber?: string;
compartmentCode?: string;
}): string {
getDetailsBreadcrumb(data: { orderNumber?: string; compartmentCode?: string }): string {
if (data.compartmentCode) {
return `${data.compartmentCode}`;
}
@@ -251,12 +204,7 @@ export class ShelfNavigationService {
return 'Bearbeiten';
}
private getDetailsPath(data: {
orderNumber?: string;
compartmentCode?: string;
processingStatus?: number;
edit?: boolean;
}): string {
private getDetailsPath(data: { orderNumber?: string; compartmentCode?: string; processingStatus?: number; edit?: boolean }): string {
let url = '';
if (data.compartmentCode) {
url = `/shelf/details/compartment/${data.compartmentCode}/${data.processingStatus}`;
@@ -272,8 +220,7 @@ export class ShelfNavigationService {
}
private createTab() {
const processExists =
this.store.selectSnapshot(ProcessSelectors.getProcessesCount) > 0;
const processExists = this.store.selectSnapshot(ProcessSelectors.getProcessesCount) > 0;
if (!processExists) {
this.createProcess();
}
@@ -314,27 +261,15 @@ export class ShelfNavigationService {
return false;
}
if (
current.orderNumber &&
previous.orderNumber &&
current.orderNumber !== previous.orderNumber
) {
if (current.orderNumber && previous.orderNumber && current.orderNumber !== previous.orderNumber) {
return true;
}
if (
current.compartmentCode &&
previous.compartmentCode &&
current.compartmentCode !== previous.compartmentCode
) {
if (current.compartmentCode && previous.compartmentCode && current.compartmentCode !== previous.compartmentCode) {
return true;
}
if (
current.processingStatus &&
previous.processingStatus &&
current.processingStatus !== previous.processingStatus
) {
if (current.processingStatus && previous.processingStatus && current.processingStatus !== previous.processingStatus) {
return true;
}

View File

@@ -4,18 +4,13 @@ import { BranchSelectors } from 'apps/sales/src/app/core/store/selectors/branch.
import { Observable, NEVER } from 'rxjs';
import { switchMap, map, take, catchError } from 'rxjs/operators';
import { CollectingShelfService } from 'apps/sales/src/app/core/services/collecting-shelf.service';
import {
AutocompleteTokenDTO,
ResponseArgsOfIEnumerableOfAutocompleteDTO,
} from '@swagger/oms/lib';
import { AutocompleteTokenDTO, ResponseArgsOfIEnumerableOfAutocompleteDTO } from '@swagger/oms';
import { SearchStateFacade } from '@shelf-store';
import { CustomerService } from '@sales/core-services';
@Injectable({ providedIn: 'root' })
export class ShelfSearchFacadeService {
@Select(BranchSelectors.getUserBranch) currentUserBranchId$: Observable<
string
>;
@Select(BranchSelectors.getUserBranch) currentUserBranchId$: Observable<string>;
constructor(
private readonly customerService: CustomerService,
@@ -52,12 +47,9 @@ export class ShelfSearchFacadeService {
allowCustomerCardSearch: true,
}
) {
const searchQuery = await this.getSearchQuery(
this.getBarcodeSearchQuery(barcode),
{
allowCustomerCardSearch: options.allowCustomerCardSearch,
}
);
const searchQuery = await this.getSearchQuery(this.getBarcodeSearchQuery(barcode), {
allowCustomerCardSearch: options.allowCustomerCardSearch,
});
if (!this.isValidSearchQuery(searchQuery)) {
return;
@@ -67,18 +59,13 @@ export class ShelfSearchFacadeService {
return this.requestSearch(true);
}
searchForAutocomplete(
queryString: string,
options: { selectedFilters?: { [key: string]: string } } = {}
) {
searchForAutocomplete(queryString: string, options: { selectedFilters?: { [key: string]: string } } = {}) {
const searchQuery = queryString.trim();
const autoCompleteQuery: AutocompleteTokenDTO = this.generateAutocompleteToken(
{
queryString: searchQuery,
filter: options.selectedFilters || {},
take: 5,
}
);
const autoCompleteQuery: AutocompleteTokenDTO = this.generateAutocompleteToken({
queryString: searchQuery,
filter: options.selectedFilters || {},
take: 5,
});
if (!this.isValidSearchQuery(searchQuery)) {
return NEVER;
@@ -91,10 +78,7 @@ export class ShelfSearchFacadeService {
return this.searchStateFacade.fetchResult({ isNewSearch });
}
private getSearchQuery(
queryString: string,
options: { allowCustomerCardSearch: boolean }
): Promise<string> {
private getSearchQuery(queryString: string, options: { allowCustomerCardSearch: boolean }): Promise<string> {
if (options.allowCustomerCardSearch && this.isCustomerCard(queryString)) {
return this.getCustomerNumber(queryString);
}
@@ -116,16 +100,8 @@ export class ShelfSearchFacadeService {
};
}
private requestAutocompleteSearch(
autocompleteToken: AutocompleteTokenDTO
): Observable<ResponseArgsOfIEnumerableOfAutocompleteDTO> {
return this.currentUserBranchId$.pipe(
switchMap(() =>
this.collectingShelfService.searchWarenausgabeAutocomplete(
autocompleteToken
)
)
);
private requestAutocompleteSearch(autocompleteToken: AutocompleteTokenDTO): Observable<ResponseArgsOfIEnumerableOfAutocompleteDTO> {
return this.currentUserBranchId$.pipe(switchMap(() => this.collectingShelfService.searchWarenausgabeAutocomplete(autocompleteToken)));
}
private isValidSearchQuery(queryString: string): boolean {
@@ -146,9 +122,7 @@ export class ShelfSearchFacadeService {
.searchCustomer(customerCardNumber.trim())
.pipe(
map((response) => response.customers),
map((customers) =>
customers[0] ? customers[0].customerNumber : customerCardNumber
),
map((customers) => (customers[0] ? customers[0].customerNumber : customerCardNumber)),
catchError(() => customerCardNumber),
take(1)
)

View File

@@ -4,7 +4,7 @@ import { Article, File } from '../../defs';
import { Observable, of } from 'rxjs';
import { Store, select } from '@ngrx/store';
import { DisplayInfoDTO } from '@swagger/eis/lib';
import { DisplayInfoDTO } from '@swagger/eis';
import { selectTaskById } from 'apps/sales/src/app/store/branch/task-calendar/task-calendar.selectors';
@Component({

View File

@@ -1,5 +1,5 @@
import { Pipe, PipeTransform } from '@angular/core';
import { DisplayInfoDTO } from '@swagger/eis/lib';
import { DisplayInfoDTO } from '@swagger/eis';
import { Task } from '../defs';
import { fromDisplayInfoToTask } from '../../../store/branch/task-calendar/mappings';

View File

@@ -1,4 +1,4 @@
import { DisplayInfoDTO } from '@swagger/eis/lib';
import { DisplayInfoDTO } from '@swagger/eis';
import { fromDisplayInfoToTask } from './task-mapper';
import { getColorForTask } from 'apps/sales/src/app/modules/task-calendar/helpers';
import { CalendarItem } from 'apps/sales/src/app/modules/task-calendar/defs';

View File

@@ -2,7 +2,7 @@ import { fromProcessStatusToTaskStatus } from './task-status.mapper';
import { taskTypeMapper } from './task-type-mapper';
import { fromTimeToTimeWindow } from './time-window.mapper';
import { taskIsAllDay, taskIsMultiDay } from './task-duration.mapper';
import { DisplayInfoDTO } from '@swagger/eis/lib';
import { DisplayInfoDTO } from '@swagger/eis';
import { Task } from 'apps/sales/src/app/modules/task-calendar/defs';
export function fromDisplayInfoToTask(source: DisplayInfoDTO): Task {

View File

@@ -1,5 +1,5 @@
import { Task } from 'apps/sales/src/app/modules/task-calendar/defs';
import { ProcessingStatus } from '@swagger/eis/lib';
import { ProcessingStatus } from '@swagger/eis';
export function fromProcessStatusToTaskStatus(processingStatus: ProcessingStatus): Task['status'] {
// tslint:disable: no-bitwise

View File

@@ -1,4 +1,4 @@
import { CustomerDTO } from '@swagger/crm/lib';
import { CustomerDTO } from '@swagger/crm';
import { Customer } from '../defs';
import { customerDtoToCustomerBaseData } from './customer-dto-to-customer-base-data.mapper';
import { customerDtoToCustomerAddresses } from './customer-dto-to-customer-addresses.mapper';

452
package-lock.json generated
View File

File diff suppressed because it is too large Load Diff

View File

@@ -8,23 +8,8 @@
"test:isa": "ng test sales",
"lint": "ng lint",
"e2e": "ng e2e",
"build": "npm-run-all -l -n build:lib:* build:sales:dev",
"build-prod": "npm-run-all -l -n build:lib:* build:sales:prod",
"build:sales:dev": "ng build --configuration=development",
"build:sales:prod": "ng build --prod",
"build:lib": "npm-run-all -l -n build:lib:*",
"build:lib:native-container": "ng build native-container",
"build:lib:sso": "ng build sso",
"build:lib:ui": "ng build ui",
"build:lib:isa-remission": "ng build @isa/remission",
"build:lib:swagger-availability": "ng build @swagger/availability",
"build:lib:swagger-cat": "ng build @swagger/cat",
"build:lib:swagger-checkout": "ng build @swagger/checkout",
"build:lib:swagger-crm": "ng build @swagger/crm",
"build:lib:swagger-isa": "ng build @swagger/isa",
"build:lib:swagger-oms": "ng build @swagger/oms",
"build:lib:swagger-print": "ng build @swagger/print",
"build:lib:swagger-eis": "ng build @swagger/eis",
"build": "ng build --configuration=development",
"build-prod": "ng build --prod",
"gen:swagger": "npm-run-all -l -n gen:swagger:*",
"gen:swagger:availability": "ng-swagger-gen --config ng-swagger-gen/availability.json",
"gen:swagger:cat": "ng-swagger-gen --config ng-swagger-gen/cat.json",
@@ -127,4 +112,4 @@
"tslint": "~5.11.0",
"typescript": "~3.5.3"
}
}
}

View File

@@ -39,58 +39,31 @@
"apps/sales/src/app/core/services/index.ts"
],
"@swagger/availability": [
"dist/swagger/availability"
],
"@swagger/availability/*": [
"dist/swagger/availability/*"
"apps/swagger/availability/src/public-api.ts"
],
"@swagger/checkout": [
"dist/swagger/checkout"
],
"@swagger/checkout/*": [
"dist/swagger/checkout/*"
"apps/swagger/checkout/src/public-api.ts"
],
"@swagger/crm": [
"dist/swagger/crm"
],
"@swagger/crm/*": [
"dist/swagger/crm/*"
"apps/swagger/crm/src/public-api.ts"
],
"@swagger/isa": [
"dist/swagger/isa"
],
"@swagger/isa/*": [
"dist/swagger/isa/*"
"apps/swagger/isa/src/public-api.ts"
],
"@swagger/oms": [
"dist/swagger/oms"
],
"@swagger/oms/*": [
"dist/swagger/oms/*"
"apps/swagger/oms/src/public-api.ts"
],
"@swagger/print": [
"dist/swagger/print"
],
"@swagger/print/*": [
"dist/swagger/print/*"
"apps/swagger/print/src/public-api.ts"
],
"@swagger/cat-search": [
"dist/swagger/cat-search"
],
"@swagger/cat-search/*": [
"dist/swagger/cat-search/*"
"apps/swagger/cat-search/src/public-api.ts"
],
"@swagger/cat": [
"dist/swagger/cat"
],
"@swagger/cat/*": [
"dist/swagger/cat/*"
"apps/swagger/cat/src/public-api.ts"
],
"@swagger/eis": [
"dist/swagger/eis"
],
"@swagger/eis/*": [
"dist/swagger/eis/*"
"apps/swagger/eis/src/public-api.ts"
],
"shared": [
"libs/shared/src"
@@ -99,10 +72,7 @@
"libs/shared/src/*"
],
"native-container": [
"dist/native-container"
],
"native-container/*": [
"dist/native-container/*"
"apps/native-container/src/public-api.ts"
],
"@shelf-store": [
"apps/sales/src/app/store/customer/shelf"
@@ -114,10 +84,13 @@
"apps/sales/src/app/modules/ui/*"
],
"@isa/remission": [
"dist/isa/remission"
"apps/isa/remission/src/public-api.ts"
],
"@isa/remission/*": [
"dist/isa/remission/*"
"@domain/crm": [
"apps/domain/crm/src/public-api.ts"
],
"@domain/checkout": [
"apps/domain/checkout/src/public-api.ts"
]
}
}