mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
Angular Update 9
This commit is contained in:
112
angular.json
112
angular.json
@@ -15,7 +15,12 @@
|
||||
"tsConfig": "libs/ui/tsconfig.lib.json",
|
||||
"project": "libs/ui/ng-package.json"
|
||||
}
|
||||
},
|
||||
, "configurations": {
|
||||
"production": {
|
||||
"tsConfig": "libs/ui/tsconfig.lib.prod.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
@@ -48,6 +53,7 @@
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:browser",
|
||||
"options": {
|
||||
"aot": true,
|
||||
"outputPath": "dist/sales",
|
||||
"outputHashing": "all",
|
||||
"index": "apps/sales/src/index.html",
|
||||
@@ -93,11 +99,22 @@
|
||||
"type": "initial",
|
||||
"maximumWarning": "2mb",
|
||||
"maximumError": "5mb"
|
||||
},
|
||||
{
|
||||
"type": "anyComponentStyle",
|
||||
"maximumWarning": "6kb"
|
||||
}
|
||||
],
|
||||
"serviceWorker": true
|
||||
},
|
||||
"development": {}
|
||||
"development": {
|
||||
"budgets": [
|
||||
{
|
||||
"type": "anyComponentStyle",
|
||||
"maximumWarning": "6kb"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"serve": {
|
||||
@@ -206,7 +223,12 @@
|
||||
"tsConfig": "libs/sso/tsconfig.lib.json",
|
||||
"project": "libs/sso/ng-package.json"
|
||||
}
|
||||
},
|
||||
, "configurations": {
|
||||
"production": {
|
||||
"tsConfig": "libs/sso/tsconfig.lib.prod.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
@@ -241,7 +263,12 @@
|
||||
"tsConfig": "apps/swagger/availability/tsconfig.lib.json",
|
||||
"project": "apps/swagger/availability/ng-package.json"
|
||||
}
|
||||
},
|
||||
, "configurations": {
|
||||
"production": {
|
||||
"tsConfig": "apps/swagger/availability/tsconfig.lib.prod.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
@@ -276,7 +303,12 @@
|
||||
"tsConfig": "apps/swagger/checkout/tsconfig.lib.json",
|
||||
"project": "apps/swagger/checkout/ng-package.json"
|
||||
}
|
||||
},
|
||||
, "configurations": {
|
||||
"production": {
|
||||
"tsConfig": "apps/swagger/checkout/tsconfig.lib.prod.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
@@ -311,7 +343,12 @@
|
||||
"tsConfig": "apps/swagger/crm/tsconfig.lib.json",
|
||||
"project": "apps/swagger/crm/ng-package.json"
|
||||
}
|
||||
},
|
||||
, "configurations": {
|
||||
"production": {
|
||||
"tsConfig": "apps/swagger/crm/tsconfig.lib.prod.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
@@ -346,7 +383,12 @@
|
||||
"tsConfig": "apps/swagger/isa/tsconfig.lib.json",
|
||||
"project": "apps/swagger/isa/ng-package.json"
|
||||
}
|
||||
},
|
||||
, "configurations": {
|
||||
"production": {
|
||||
"tsConfig": "apps/swagger/isa/tsconfig.lib.prod.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
@@ -381,7 +423,12 @@
|
||||
"tsConfig": "apps/swagger/oms/tsconfig.lib.json",
|
||||
"project": "apps/swagger/oms/ng-package.json"
|
||||
}
|
||||
},
|
||||
, "configurations": {
|
||||
"production": {
|
||||
"tsConfig": "apps/swagger/oms/tsconfig.lib.prod.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
@@ -416,7 +463,12 @@
|
||||
"tsConfig": "apps/swagger/print/tsconfig.lib.json",
|
||||
"project": "apps/swagger/print/ng-package.json"
|
||||
}
|
||||
},
|
||||
, "configurations": {
|
||||
"production": {
|
||||
"tsConfig": "apps/swagger/print/tsconfig.lib.prod.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
@@ -451,7 +503,12 @@
|
||||
"tsConfig": "apps/swagger/cat/tsconfig.lib.json",
|
||||
"project": "apps/swagger/cat/ng-package.json"
|
||||
}
|
||||
},
|
||||
, "configurations": {
|
||||
"production": {
|
||||
"tsConfig": "apps/swagger/cat/tsconfig.lib.prod.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
@@ -486,7 +543,12 @@
|
||||
"tsConfig": "apps/swagger/eis/tsconfig.lib.json",
|
||||
"project": "apps/swagger/eis/ng-package.json"
|
||||
}
|
||||
},
|
||||
, "configurations": {
|
||||
"production": {
|
||||
"tsConfig": "apps/swagger/eis/tsconfig.lib.prod.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
@@ -521,7 +583,12 @@
|
||||
"tsConfig": "apps/native-container/tsconfig.lib.json",
|
||||
"project": "apps/native-container/ng-package.json"
|
||||
}
|
||||
},
|
||||
, "configurations": {
|
||||
"production": {
|
||||
"tsConfig": "apps/native-container/tsconfig.lib.prod.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
@@ -556,7 +623,12 @@
|
||||
"tsConfig": "apps/isa/remission/tsconfig.lib.json",
|
||||
"project": "apps/isa/remission/ng-package.json"
|
||||
}
|
||||
},
|
||||
, "configurations": {
|
||||
"production": {
|
||||
"tsConfig": "apps/isa/remission/tsconfig.lib.prod.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
@@ -591,7 +663,12 @@
|
||||
"tsConfig": "apps/domain/crm/tsconfig.lib.json",
|
||||
"project": "apps/domain/crm/ng-package.json"
|
||||
}
|
||||
},
|
||||
, "configurations": {
|
||||
"production": {
|
||||
"tsConfig": "apps/domain/crm/tsconfig.lib.prod.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
@@ -626,7 +703,12 @@
|
||||
"tsConfig": "apps/domain/checkout/tsconfig.lib.json",
|
||||
"project": "apps/domain/checkout/ng-package.json"
|
||||
}
|
||||
},
|
||||
, "configurations": {
|
||||
"production": {
|
||||
"tsConfig": "apps/domain/checkout/tsconfig.lib.prod.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
]
|
||||
},
|
||||
"angularCompilerOptions": {
|
||||
"annotateForClosureCompiler": true,
|
||||
"skipTemplateCodegen": true,
|
||||
"strictMetadataEmit": true,
|
||||
"fullTemplateTypeCheck": true,
|
||||
|
||||
6
apps/domain/checkout/tsconfig.lib.prod.json
Normal file
6
apps/domain/checkout/tsconfig.lib.prod.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.lib.json",
|
||||
"angularCompilerOptions": {
|
||||
"enableIvy": false
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,6 @@
|
||||
]
|
||||
},
|
||||
"angularCompilerOptions": {
|
||||
"annotateForClosureCompiler": true,
|
||||
"skipTemplateCodegen": true,
|
||||
"strictMetadataEmit": true,
|
||||
"fullTemplateTypeCheck": true,
|
||||
|
||||
6
apps/domain/crm/tsconfig.lib.prod.json
Normal file
6
apps/domain/crm/tsconfig.lib.prod.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.lib.json",
|
||||
"angularCompilerOptions": {
|
||||
"enableIvy": false
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ export class MappingService {
|
||||
constructor(private injector: Injector) {}
|
||||
|
||||
get<T extends Mapper>(sourceName: string, targetName: string): T {
|
||||
const mappers = this.injector.get(Mapper) as Mapper[];
|
||||
const mappers = (this.injector.get(Mapper) as unknown) as Mapper[];
|
||||
return mappers.find((f) => f.sourceName === sourceName && f.targetName === targetName) as T;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ export function remissionServiceFactory(options: RemissionModuleOptions, rest: R
|
||||
exports: [],
|
||||
})
|
||||
export class RemissionModule {
|
||||
static forRoot(options: RemissionModuleOptions): ModuleWithProviders {
|
||||
static forRoot(options: RemissionModuleOptions): ModuleWithProviders<RemissionModule> {
|
||||
return {
|
||||
ngModule: RemissionModule,
|
||||
providers: [
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
]
|
||||
},
|
||||
"angularCompilerOptions": {
|
||||
"annotateForClosureCompiler": true,
|
||||
"skipTemplateCodegen": true,
|
||||
"strictMetadataEmit": true,
|
||||
"fullTemplateTypeCheck": true,
|
||||
|
||||
6
apps/isa/remission/tsconfig.lib.prod.json
Normal file
6
apps/isa/remission/tsconfig.lib.prod.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.lib.json",
|
||||
"angularCompilerOptions": {
|
||||
"enableIvy": false
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,6 @@
|
||||
]
|
||||
},
|
||||
"angularCompilerOptions": {
|
||||
"annotateForClosureCompiler": true,
|
||||
"skipTemplateCodegen": true,
|
||||
"strictMetadataEmit": true,
|
||||
"fullTemplateTypeCheck": true,
|
||||
|
||||
6
apps/native-container/tsconfig.lib.prod.json
Normal file
6
apps/native-container/tsconfig.lib.prod.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.lib.json",
|
||||
"angularCompilerOptions": {
|
||||
"enableIvy": false
|
||||
}
|
||||
}
|
||||
@@ -14,21 +14,21 @@ const routes: Routes = [
|
||||
{ path: 'dashboard', component: DashboardComponent },
|
||||
{
|
||||
path: 'product',
|
||||
loadChildren: './modules/product/product.module#ProductModule',
|
||||
loadChildren: () => import('./modules/product/product.module').then((m) => m.ProductModule),
|
||||
},
|
||||
{
|
||||
path: 'customer',
|
||||
loadChildren: './modules/customer/customer.module#CustomerModule',
|
||||
loadChildren: () => import('./modules/customer/customer.module').then((m) => m.CustomerModule),
|
||||
},
|
||||
{
|
||||
path: 'branch',
|
||||
loadChildren: './modules/branch/branch.module#BranchModule',
|
||||
loadChildren: () => import('./modules/branch/branch.module').then((m) => m.BranchModule),
|
||||
},
|
||||
{ path: 'shelf', loadChildren: './modules/shelf/shelf.module#ShelfModule' },
|
||||
{ path: 'cart', loadChildren: './modules/cart/cart.module#CartModule' },
|
||||
{ path: 'debug', loadChildren: './modules/debug/debug.module#DebugModule' },
|
||||
{ path: 'goodsin', loadChildren: './modules/goods-in/goods-in.module#GoodsInModule' },
|
||||
{ path: 'remission', loadChildren: './modules/remission/remission-client.module#RemissionClientModule' },
|
||||
{ path: 'shelf', loadChildren: () => import('./modules/shelf/shelf.module').then((m) => m.ShelfModule) },
|
||||
{ path: 'cart', loadChildren: () => import('./modules/cart/cart.module').then((m) => m.CartModule) },
|
||||
{ path: 'debug', loadChildren: () => import('./modules/debug/debug.module').then((m) => m.DebugModule) },
|
||||
{ path: 'goodsin', loadChildren: () => import('./modules/goods-in/goods-in.module').then((m) => m.GoodsInModule) },
|
||||
{ path: 'remission', loadChildren: () => import('./modules/remission/remission-client.module').then((m) => m.RemissionClientModule) },
|
||||
// { path: 'task-calendar', loadChildren: './modules/task-calendar/task-calendar.module#TaskCalendarModule'}
|
||||
];
|
||||
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import {
|
||||
NgModule,
|
||||
ErrorHandler,
|
||||
LOCALE_ID,
|
||||
APP_INITIALIZER,
|
||||
} from '@angular/core';
|
||||
import { NgModule, ErrorHandler, LOCALE_ID, APP_INITIALIZER } from '@angular/core';
|
||||
|
||||
import { AppRoutingModule } from './app-routing.module';
|
||||
import { AppComponent } from './app.component';
|
||||
@@ -32,14 +27,10 @@ import { AppState } from './core/store/state/app.state';
|
||||
import { CartEntryState } from './core/store/state/cart-entry.state';
|
||||
import { BranchState } from './core/store/state/branches.state';
|
||||
import { SsoModule, SsoInterface } from 'sso';
|
||||
import {
|
||||
SsoAuthorizationInterceptor,
|
||||
HttpErrorHandlerInterceptor,
|
||||
} from './core/interceptors';
|
||||
import { SsoAuthorizationInterceptor, HttpErrorHandlerInterceptor } from './core/interceptors';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { CountryState } from './core/store/state/countries.state';
|
||||
import { HimaSalesErrorHandler } from './core/error/hima-sales.error-handler';
|
||||
import { NgCircleProgressModule } from 'ng-circle-progress';
|
||||
import { CollectingShelfState } from './core/store/state/collecting-shelf.state';
|
||||
import 'apps/sales/src/app/core/utils/app.prototypes';
|
||||
import { VatState } from './core/store/state/vat.state';
|
||||
@@ -93,9 +84,7 @@ export function noop() {
|
||||
return function () {};
|
||||
}
|
||||
|
||||
export function remissionModuleOptionsFactory(
|
||||
config: AppConfiguration
|
||||
): RemissionModuleOptions {
|
||||
export function remissionModuleOptionsFactory(config: AppConfiguration): RemissionModuleOptions {
|
||||
return config.remissionModuleOptions;
|
||||
}
|
||||
|
||||
@@ -121,11 +110,6 @@ export function remissionModuleOptionsFactory(
|
||||
ModalModule.forRoot(),
|
||||
SsoModule.forRoot(environment.production),
|
||||
OfflineOverlayModule,
|
||||
NgCircleProgressModule.forRoot({
|
||||
animation: true,
|
||||
animationDuration: 300,
|
||||
clockwise: true,
|
||||
}),
|
||||
NgIdleKeepaliveModule.forRoot(),
|
||||
RemissionModule.forRoot(undefined),
|
||||
OverlayModule,
|
||||
|
||||
@@ -31,7 +31,7 @@ import { FILIALE_LANDING_PAGE } from '../../core/utils/app.constants';
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class BreadcrumbsComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||
@ViewChild('container', { read: ElementRef, static: false })
|
||||
@ViewChild('container', { read: ElementRef })
|
||||
public container: ElementRef<any>;
|
||||
@Select(SharedSelectors.getBreadcrumbs) breadcrumbs$: Observable<Breadcrumb[]>;
|
||||
@Select(SharedSelectors.getCurrentProcess) currentProcess$: Observable<Process>;
|
||||
|
||||
@@ -18,7 +18,7 @@ import { BreadcrumbsState } from '../../core/store/state/breadcrumbs.state';
|
||||
styleUrls: ['./header.component.scss'],
|
||||
})
|
||||
export class HeaderComponent implements OnInit, OnDestroy {
|
||||
@ViewChild('logOut', { static: false }) logOutDialog: LogOutComponent;
|
||||
@ViewChild('logOut') logOutDialog: LogOutComponent;
|
||||
doubleChoiceSwitch: DoubleChoiceSwitch;
|
||||
module: ModuleSwitcher = ModuleSwitcher.Customer;
|
||||
destroy$ = new Subject();
|
||||
|
||||
@@ -25,7 +25,7 @@ export class PrinterSelectionComponent implements OnInit, OnDestroy {
|
||||
submited = false;
|
||||
@Output() print: EventEmitter<string> = new EventEmitter();
|
||||
@Output() closed = new EventEmitter();
|
||||
@ViewChild('printBtn', { static: false }) printBtn: ButtonComponent;
|
||||
@ViewChild('printBtn') printBtn: ButtonComponent;
|
||||
|
||||
constructor(private printerService: PrinterService, private modalService: ModalService, private cdr: ChangeDetectorRef) {}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import { ModuleSwitcher } from '../../core/models/app-switcher.enum';
|
||||
})
|
||||
export class ProcessHeaderComponent implements OnInit, OnDestroy {
|
||||
startProcessLabel = 'VORGANG STARTEN';
|
||||
@ViewChild('panel', { read: ElementRef, static: false }) public panel: ElementRef<any>;
|
||||
@ViewChild('panel', { read: ElementRef }) public panel: ElementRef<any>;
|
||||
@Select(ProcessSelectors.getProcesses) process$: Observable<Process[]>;
|
||||
@Select(ProcessSelectors.getCurrentProcess) selectedProcess$: Observable<Process>;
|
||||
@Input() module: ModuleSwitcher;
|
||||
|
||||
@@ -67,7 +67,7 @@ export class ProcessTabComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||
@Select(SharedSelectors.cartHasDownloadForProcess) cartHasDownloadForProcess$: Observable<{ status: boolean; currentProcessId: number }>;
|
||||
@Select(AppState.getCurrentProcessId) currentProcessId$: Observable<number>;
|
||||
destroy$ = new Subject();
|
||||
@ViewChild('deleteporcessdialog', { static: false })
|
||||
@ViewChild('deleteporcessdialog')
|
||||
processDeleteDialogComponent: ProcessDeleteDialogComponent;
|
||||
cartCount = 0;
|
||||
cartanimation = '';
|
||||
|
||||
@@ -10,10 +10,7 @@ import {
|
||||
import { LoadBranches, LoadUserBranch } from '../actions/branch.actions';
|
||||
import { BranchSelectors } from '../selectors/branch.selector';
|
||||
import { isNullOrUndefined } from 'util';
|
||||
import {
|
||||
RemoveProcessNewState,
|
||||
ReloadProcessData,
|
||||
} from '../actions/process.actions';
|
||||
import { RemoveProcessNewState, ReloadProcessData } from '../actions/process.actions';
|
||||
import { UserStateService } from '../../services/user-state.service';
|
||||
import { UserStateSyncData } from '../../models/user-state-sync.model';
|
||||
import { ReloadCustomersData } from '../actions/customer.actions';
|
||||
@@ -33,6 +30,7 @@ import { ReloadBranchProcess } from '../actions/branch-process.actions';
|
||||
import { ReloadRemission } from '../actions/remission.actions';
|
||||
import { ReloadFormState } from '../actions/forms.actions';
|
||||
import { FILIALE_LANDING_PAGE } from '../../utils/app.constants';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
export const SYNC_DATA_VERSION = 219;
|
||||
|
||||
@@ -54,6 +52,7 @@ export class AppStateModel {
|
||||
syncedUserData: '',
|
||||
},
|
||||
})
|
||||
@Injectable()
|
||||
export class AppState {
|
||||
userStateService$ = new Subject<string>();
|
||||
|
||||
@@ -104,13 +103,9 @@ export class AppState {
|
||||
}
|
||||
|
||||
@Action(AppSetCurrentProcess)
|
||||
appSetCurrentProcess(
|
||||
ctx: StateContext<AppStateModel>,
|
||||
{ payload }: AppSetCurrentProcess
|
||||
) {
|
||||
appSetCurrentProcess(ctx: StateContext<AppStateModel>, { payload }: AppSetCurrentProcess) {
|
||||
const state = ctx.getState();
|
||||
const processExists =
|
||||
state.processIds.findIndex((t) => t === payload) !== -1;
|
||||
const processExists = state.processIds.findIndex((t) => t === payload) !== -1;
|
||||
if (processExists) {
|
||||
ctx.patchState({
|
||||
currentProcesssId: payload,
|
||||
@@ -122,23 +117,18 @@ export class AppState {
|
||||
@Action(AppAddProcess)
|
||||
appAddProcess(ctx: StateContext<AppStateModel>, { payload }: AppAddProcess) {
|
||||
const state = ctx.getState();
|
||||
const processExists =
|
||||
state.processIds.findIndex((t) => t === payload) !== -1;
|
||||
const processExists = state.processIds.findIndex((t) => t === payload) !== -1;
|
||||
if (!processExists) {
|
||||
const processIds = [...state.processIds, payload];
|
||||
const currentProcesssId = payload;
|
||||
ctx.patchState({ currentProcesssId, processIds });
|
||||
|
||||
const branchesLoaded = this.store.selectSnapshot(
|
||||
BranchSelectors.getBranches
|
||||
);
|
||||
const branchesLoaded = this.store.selectSnapshot(BranchSelectors.getBranches);
|
||||
if (!branchesLoaded || Object.keys(branchesLoaded).length === 0) {
|
||||
this.store.dispatch(new LoadBranches());
|
||||
}
|
||||
|
||||
const userBranch = this.store.selectSnapshot(
|
||||
BranchSelectors.getUserBranch
|
||||
);
|
||||
const userBranch = this.store.selectSnapshot(BranchSelectors.getUserBranch);
|
||||
if (isNullOrUndefined(userBranch)) {
|
||||
this.store.dispatch(new LoadUserBranch());
|
||||
}
|
||||
@@ -148,10 +138,7 @@ export class AppState {
|
||||
}
|
||||
|
||||
@Action(AppDeleteProcess)
|
||||
appDeleteProcess(
|
||||
ctx: StateContext<AppStateModel>,
|
||||
{ payload }: AppDeleteProcess
|
||||
) {
|
||||
appDeleteProcess(ctx: StateContext<AppStateModel>, { payload }: AppDeleteProcess) {
|
||||
const state = ctx.getState();
|
||||
const currentIds = state.processIds;
|
||||
if (currentIds) {
|
||||
@@ -162,10 +149,7 @@ export class AppState {
|
||||
}
|
||||
|
||||
@Action(AppSwitchModule)
|
||||
appSwitchModule(
|
||||
ctx: StateContext<AppStateModel>,
|
||||
{ payload }: AppSwitchModule
|
||||
) {
|
||||
appSwitchModule(ctx: StateContext<AppStateModel>, { payload }: AppSwitchModule) {
|
||||
const state = ctx.getState();
|
||||
ctx.patchState({ activeModule: payload });
|
||||
this.syncApiState(state.processIds, payload);
|
||||
@@ -175,10 +159,7 @@ export class AppState {
|
||||
* Save store data on backend
|
||||
*/
|
||||
@Action(AppUserDataSync)
|
||||
appUserDataSynced(
|
||||
ctx: StateContext<AppStateModel>,
|
||||
{ data, sync }: AppUserDataSync
|
||||
) {
|
||||
appUserDataSynced(ctx: StateContext<AppStateModel>, { data, sync }: AppUserDataSync) {
|
||||
const state = ctx.getState();
|
||||
|
||||
let currentUserData: UserStateSyncData = {};
|
||||
@@ -205,10 +186,7 @@ export class AppState {
|
||||
* Initial store loading from API, triggered once on page load
|
||||
*/
|
||||
@Action(ReloadSavedState)
|
||||
reloadSavedState(
|
||||
ctx: StateContext<AppStateModel>,
|
||||
{ data, sync }: ReloadSavedState
|
||||
) {
|
||||
reloadSavedState(ctx: StateContext<AppStateModel>, { data, sync }: ReloadSavedState) {
|
||||
const state = ctx.getState();
|
||||
|
||||
let currentUserData: UserStateSyncData = {};
|
||||
@@ -232,10 +210,7 @@ export class AppState {
|
||||
if (sync && syncedData.version === SYNC_DATA_VERSION) {
|
||||
this.reloadDataFromAPI(syncedData);
|
||||
|
||||
if (
|
||||
syncedData.currentProcesssId ||
|
||||
syncedData.activeModule === ModuleSwitcher.Branch
|
||||
) {
|
||||
if (syncedData.currentProcesssId || syncedData.activeModule === ModuleSwitcher.Branch) {
|
||||
ctx.patchState({
|
||||
...state,
|
||||
synced: true,
|
||||
@@ -262,19 +237,11 @@ export class AppState {
|
||||
return;
|
||||
}
|
||||
if (data.customers) {
|
||||
this.store.dispatch(
|
||||
new ReloadCustomersData(
|
||||
data.customers,
|
||||
data.lastCreatedCustomerId,
|
||||
data.cachedCustomerSearch
|
||||
)
|
||||
);
|
||||
this.store.dispatch(new ReloadCustomersData(data.customers, data.lastCreatedCustomerId, data.cachedCustomerSearch));
|
||||
}
|
||||
|
||||
if (data.products) {
|
||||
this.store.dispatch(
|
||||
new ReloadProductsData(data.products, data.cachedProductResults)
|
||||
);
|
||||
this.store.dispatch(new ReloadProductsData(data.products, data.cachedProductResults));
|
||||
}
|
||||
|
||||
if (data.carts) {
|
||||
@@ -294,9 +261,7 @@ export class AppState {
|
||||
}
|
||||
|
||||
if (data.processes) {
|
||||
this.store.dispatch(
|
||||
new ReloadProcessData(data.processes, data.recentArticles)
|
||||
);
|
||||
this.store.dispatch(new ReloadProcessData(data.processes, data.recentArticles));
|
||||
}
|
||||
|
||||
if (data.formsState) {
|
||||
@@ -304,20 +269,11 @@ export class AppState {
|
||||
}
|
||||
|
||||
if (data.activeModule === ModuleSwitcher.Customer) {
|
||||
if (
|
||||
data.processes &&
|
||||
data.currentProcesssId &&
|
||||
data.processes[data.currentProcesssId]
|
||||
) {
|
||||
if (data.processes && data.currentProcesssId && data.processes[data.currentProcesssId]) {
|
||||
const currentProcesssId = data.currentProcesssId;
|
||||
const currentRoute = data.processes[currentProcesssId].currentRoute;
|
||||
if (currentRoute && currentRoute.length > 0) {
|
||||
this.routingAvailableAction(
|
||||
data,
|
||||
currentProcesssId,
|
||||
currentRoute,
|
||||
data.activeModule
|
||||
);
|
||||
this.routingAvailableAction(data, currentProcesssId, currentRoute, data.activeModule);
|
||||
} else {
|
||||
this.router.navigate(['/dashboard']);
|
||||
}
|
||||
@@ -329,12 +285,7 @@ export class AppState {
|
||||
const currentProcesssId = -1;
|
||||
const currentRoute = data.branchProcess.currentRoute;
|
||||
if (currentRoute && currentRoute.length > 0) {
|
||||
this.routingAvailableAction(
|
||||
data,
|
||||
currentProcesssId,
|
||||
currentRoute,
|
||||
data.activeModule
|
||||
);
|
||||
this.routingAvailableAction(data, currentProcesssId, currentRoute, data.activeModule);
|
||||
} else {
|
||||
this.router.navigate([FILIALE_LANDING_PAGE]);
|
||||
}
|
||||
@@ -348,24 +299,11 @@ export class AppState {
|
||||
}
|
||||
|
||||
if (data.activeModule === ModuleSwitcher.Branch) {
|
||||
this.moduleSwitcherService.switch(
|
||||
ModuleSwitcher.Branch,
|
||||
data.branchProcess
|
||||
);
|
||||
this.moduleSwitcherService.switch(ModuleSwitcher.Branch, data.branchProcess);
|
||||
}
|
||||
|
||||
if (
|
||||
data.processesBreadcrumbs &&
|
||||
data.activeCrumbs &&
|
||||
(data.currentProcesssId || data.activeModule === ModuleSwitcher.Branch)
|
||||
) {
|
||||
this.store.dispatch(
|
||||
new ReloadBreadcrumbsData(
|
||||
data.processesBreadcrumbs,
|
||||
data.activeCrumbs,
|
||||
data.previusMenuPath
|
||||
)
|
||||
);
|
||||
if (data.processesBreadcrumbs && data.activeCrumbs && (data.currentProcesssId || data.activeModule === ModuleSwitcher.Branch)) {
|
||||
this.store.dispatch(new ReloadBreadcrumbsData(data.processesBreadcrumbs, data.activeCrumbs, data.previusMenuPath));
|
||||
}
|
||||
|
||||
if (data.filters && data.processesSelectedFilters && data.dropdownFilters) {
|
||||
@@ -391,28 +329,16 @@ export class AppState {
|
||||
);
|
||||
}
|
||||
|
||||
private routingAvailableAction(
|
||||
data: UserStateSyncData,
|
||||
currentProcesssId: number,
|
||||
currentRoute: string,
|
||||
module: ModuleSwitcher
|
||||
) {
|
||||
const hasActiveCrumbsAvailableForProcess =
|
||||
data.activeCrumbs && data.activeCrumbs[currentProcesssId];
|
||||
private routingAvailableAction(data: UserStateSyncData, currentProcesssId: number, currentRoute: string, module: ModuleSwitcher) {
|
||||
const hasActiveCrumbsAvailableForProcess = data.activeCrumbs && data.activeCrumbs[currentProcesssId];
|
||||
const activeCrumbs = data.activeCrumbs[currentProcesssId];
|
||||
const hasProcessBreadcrumbsAvailableForProcess =
|
||||
data.processesBreadcrumbs && data.processesBreadcrumbs[activeCrumbs];
|
||||
const hasProcessBreadcrumbsAvailableForProcess = data.processesBreadcrumbs && data.processesBreadcrumbs[activeCrumbs];
|
||||
|
||||
const breadcrumb = hasProcessBreadcrumbsAvailableForProcess
|
||||
? data.processesBreadcrumbs[activeCrumbs].find(
|
||||
(t) => t.processId === currentProcesssId
|
||||
)
|
||||
? data.processesBreadcrumbs[activeCrumbs].find((t) => t.processId === currentProcesssId)
|
||||
: null;
|
||||
|
||||
const breadcrumbPath =
|
||||
breadcrumb && breadcrumb.breadcrumbs
|
||||
? breadcrumb.breadcrumbs.find((t) => t && t.path === currentRoute)
|
||||
: null;
|
||||
const breadcrumbPath = breadcrumb && breadcrumb.breadcrumbs ? breadcrumb.breadcrumbs.find((t) => t && t.path === currentRoute) : null;
|
||||
|
||||
if (
|
||||
hasActiveCrumbsAvailableForProcess &&
|
||||
|
||||
@@ -5,6 +5,7 @@ import { tap, map, takeUntil } from 'rxjs/operators';
|
||||
import { AutocompleteDTO } from '@swagger/cat';
|
||||
import { AutocompleteResults } from '../../models/autocomplete-results.model';
|
||||
import { timer } from 'rxjs';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
const AUTOCOMPLETE_MAX_ITEMS = 10;
|
||||
|
||||
@@ -18,6 +19,7 @@ export class AutocompleteStateModel {
|
||||
result: [],
|
||||
},
|
||||
})
|
||||
@Injectable()
|
||||
export class AutocompleteState {
|
||||
constructor(private productService: ProductService, private actions$: Actions) {}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import { AppUserDataSync } from '../actions/app.actions';
|
||||
import { BranchProcess } from '../../models/branch-process.model';
|
||||
import { PopLastBreadcrumbs } from '../actions/breadcrumb.actions';
|
||||
import { FILIALE_LANDING_PAGE } from '../../utils/app.constants';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
export class BranchProcessStateModel {
|
||||
branchProcess: BranchProcess;
|
||||
@@ -16,6 +17,7 @@ export class BranchProcessStateModel {
|
||||
branchProcess: { id: -1, currentRoute: undefined },
|
||||
},
|
||||
})
|
||||
@Injectable()
|
||||
export class BranchProcessState {
|
||||
constructor(private store: Store) {}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import { tap } from 'rxjs/operators';
|
||||
import { CheckoutService } from '../../services/checkout.service';
|
||||
import { BranchDTO } from '@swagger/checkout';
|
||||
import { SsoService } from 'sso';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
export class BranchesStateModel {
|
||||
branches: { [key: number]: BranchDTO };
|
||||
@@ -17,6 +18,7 @@ export class BranchesStateModel {
|
||||
userBranch: undefined,
|
||||
},
|
||||
})
|
||||
@Injectable()
|
||||
export class BranchState {
|
||||
constructor(private branchService: CheckoutService, private ssoService: SsoService, private store: Store) {}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ import { SharedSelectors } from '../selectors/shared.selectors';
|
||||
import { AppSelectors } from '../selectors/app.selectors';
|
||||
import { FILIALE_LANDING_PAGE } from '../../utils/app.constants';
|
||||
import { Router } from '@angular/router';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
export class BreadcrumbsStateModel {
|
||||
processesBreadcrumbs: ProcessBreadcrumb;
|
||||
@@ -43,6 +44,7 @@ export class BreadcrumbsStateModel {
|
||||
previusMenuPath: {},
|
||||
},
|
||||
})
|
||||
@Injectable()
|
||||
export class BreadcrumbsState {
|
||||
@Selector()
|
||||
static hasRemissionBreadcrumbs(breadcrumbsState: BreadcrumbsStateModel) {
|
||||
|
||||
@@ -31,6 +31,7 @@ import { User } from '../../models/user.model';
|
||||
import { CustomerMapping } from '../../mappings/customer.mapping';
|
||||
import { CustomerSelectors } from '../selectors/customer.selectors';
|
||||
import { CartState } from './cart.state';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
export class CartEntryStateModel {
|
||||
cartEntries: { [key: number]: CartEntry };
|
||||
@@ -42,6 +43,7 @@ export class CartEntryStateModel {
|
||||
cartEntries: {},
|
||||
},
|
||||
})
|
||||
@Injectable()
|
||||
export class CartEntryState {
|
||||
constructor(private store: Store, private checkoutService: CheckoutService, private customerMapping: CustomerMapping) {}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ import { Router } from '@angular/router';
|
||||
import { Breadcrumb } from '../../models/breadcrumb.model';
|
||||
import { AddBreadcrumb } from '../actions/breadcrumb.actions';
|
||||
import { CartService } from '../../../modules/cart/pages/services/cart.service';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
export class CartStateModel {
|
||||
carts: { [key: number]: number[] };
|
||||
@@ -29,6 +30,7 @@ export class CartStateModel {
|
||||
carts: {},
|
||||
},
|
||||
})
|
||||
@Injectable()
|
||||
export class CartState {
|
||||
constructor(
|
||||
private store: Store,
|
||||
|
||||
@@ -5,6 +5,7 @@ import { UserStateSyncData } from '../../models/user-state-sync.model';
|
||||
import { AppUserDataSync } from '../actions/app.actions';
|
||||
import { CollectingShelfOrder } from '../../models/collecting-shelf-order.model';
|
||||
import { OrderDTO } from '@swagger/oms';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
export interface CollectingShelfStateModel {
|
||||
orders: { [key: number]: { [key: number]: CollectingShelfOrder } };
|
||||
@@ -22,6 +23,7 @@ export interface CollectingShelfStateModel {
|
||||
useCache: {},
|
||||
},
|
||||
})
|
||||
@Injectable()
|
||||
export class CollectingShelfState {
|
||||
constructor(private store: Store) {}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import { State, Action, StateContext } from '@ngxs/store';
|
||||
import { LoadCountries } from '../actions/countries.actions';
|
||||
import { CustomerService } from '../../services/customer.service';
|
||||
import { tap } from 'rxjs/operators';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
export class CountryStateModel {
|
||||
countries: { [id: number]: Country };
|
||||
@@ -14,6 +15,7 @@ export class CountryStateModel {
|
||||
countries: [],
|
||||
},
|
||||
})
|
||||
@Injectable()
|
||||
export class CountryState {
|
||||
constructor(private customerService: CustomerService) {}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ import { isNullOrUndefined } from 'util';
|
||||
import { UserStateSyncData } from '../../models/user-state-sync.model';
|
||||
import { AppUserDataSync } from '../actions/app.actions';
|
||||
import { AppState } from './app.state';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
export class CustomerStateModel {
|
||||
customers: { [id: number]: User };
|
||||
@@ -36,6 +37,7 @@ export class CustomerStateModel {
|
||||
cachedCustomerSearch: {},
|
||||
},
|
||||
})
|
||||
@Injectable()
|
||||
export class CustomerState {
|
||||
constructor(private store: Store, private customerService: CustomerService) {}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import { UserStateSyncData } from '../../models/user-state-sync.model';
|
||||
import { AppUserDataSync } from '../actions/app.actions';
|
||||
import { FilterType } from '../../models/filter-type.enum';
|
||||
import { Observable } from 'rxjs';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
export class FilterStateModel {
|
||||
filters: Filter[];
|
||||
@@ -34,6 +35,7 @@ export class FilterStateModel {
|
||||
filterType: [],
|
||||
},
|
||||
})
|
||||
@Injectable()
|
||||
export class FilterState {
|
||||
constructor(private filterService: FilterService, private store: Store) {}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import { SaveFormState, DeleteFormState, ReloadFormState } from '../actions/form
|
||||
import { AppState } from './app.state';
|
||||
import { UserStateSyncData } from '../../models/user-state-sync.model';
|
||||
import { AppUserDataSync } from '../actions/app.actions';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
export interface FormsStateModel {
|
||||
form: { [id: number]: { [key: string]: string } };
|
||||
@@ -14,6 +15,7 @@ export interface FormsStateModel {
|
||||
form: [],
|
||||
},
|
||||
})
|
||||
@Injectable()
|
||||
export class FormsState {
|
||||
constructor(private store: Store) {}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import { State, Store, Action, StateContext } from '@ngxs/store';
|
||||
import * as actions from '../actions/goods-in.actions';
|
||||
import { UserStateSyncData } from '../../models/user-state-sync.model';
|
||||
import { AppUserDataSync } from '../actions/app.actions';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
export class GoodsInStateModel {
|
||||
goodsIn: GoodsIn;
|
||||
@@ -14,6 +15,7 @@ export class GoodsInStateModel {
|
||||
goodsIn: {},
|
||||
},
|
||||
})
|
||||
@Injectable()
|
||||
export class GoodsInState {
|
||||
constructor(private store: Store) {}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { State, Selector, Action, StateContext } from '@ngxs/store';
|
||||
import { Notify } from '../actions/notifier.actions';
|
||||
|
||||
@@ -11,6 +12,7 @@ export class NotifierStateModel {
|
||||
processId: null,
|
||||
},
|
||||
})
|
||||
@Injectable()
|
||||
export class NotifierState {
|
||||
@Selector()
|
||||
static getNotifier(state: NotifierStateModel) {
|
||||
|
||||
@@ -1,38 +1,15 @@
|
||||
import { Process, CustomerFormState } from '../../models/process.model';
|
||||
import {
|
||||
State,
|
||||
Action,
|
||||
StateContext,
|
||||
Store,
|
||||
Select,
|
||||
Selector,
|
||||
} from '@ngxs/store';
|
||||
import { State, Action, StateContext, Store, Select, Selector } from '@ngxs/store';
|
||||
import * as actions from '../actions/process.actions';
|
||||
import { ProductService } from '../../services/product.service';
|
||||
import { RecentArticleSearch } from '../../models/recent-article-search.model';
|
||||
import {
|
||||
LoadRecentProducts,
|
||||
AddSelectedProduct,
|
||||
DeleteProductsForProcess,
|
||||
} from '../actions/product.actions';
|
||||
import {
|
||||
PopLastBreadcrumbs,
|
||||
DeleteBreadcrumbsForProcess,
|
||||
} from '../actions/breadcrumb.actions';
|
||||
import { LoadRecentProducts, AddSelectedProduct, DeleteProductsForProcess } from '../actions/product.actions';
|
||||
import { PopLastBreadcrumbs, DeleteBreadcrumbsForProcess } from '../actions/breadcrumb.actions';
|
||||
import { SetCartToProcess, DeleteCart } from '../actions/cart.actions';
|
||||
import {
|
||||
DeleteSelectedFiltersForProcess,
|
||||
LoadFilters,
|
||||
SetFilterType,
|
||||
} from '../actions/filter.actions';
|
||||
import { DeleteSelectedFiltersForProcess, LoadFilters, SetFilterType } from '../actions/filter.actions';
|
||||
import { tap } from 'rxjs/operators';
|
||||
import { AppState, AppStateModel } from './app.state';
|
||||
import {
|
||||
AppSetCurrentProcess,
|
||||
AppDeleteProcess,
|
||||
AppAddProcess,
|
||||
AppUserDataSync,
|
||||
} from '../actions/app.actions';
|
||||
import { AppSetCurrentProcess, AppDeleteProcess, AppAddProcess, AppUserDataSync } from '../actions/app.actions';
|
||||
import { patch, append } from '@ngxs/store/operators';
|
||||
import { CurrentCustomerPageLoaded } from '../actions/customer.actions';
|
||||
import { UserStateSyncData } from '../../models/user-state-sync.model';
|
||||
@@ -42,6 +19,7 @@ import { SetPreviusPath } from '../actions/process.actions';
|
||||
import { isNullOrUndefined } from 'util';
|
||||
import { DeleteCollectingShelfForProcess } from '../actions/collecting-shelf.action';
|
||||
import { FilterType } from '../../models/filter-type.enum';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
export interface ProcessStateModel {
|
||||
processes: { [id: number]: Process };
|
||||
@@ -55,15 +33,14 @@ export interface ProcessStateModel {
|
||||
recentArticles: [],
|
||||
},
|
||||
})
|
||||
@Injectable()
|
||||
export class ProcessState {
|
||||
constructor(protected productService: ProductService, private store: Store) {}
|
||||
|
||||
@Selector([AppState])
|
||||
static userData(process: ProcessStateModel, state: AppStateModel) {
|
||||
const processId = state.currentProcesssId;
|
||||
return processId && process.processes[processId]
|
||||
? process.processes[processId].userData
|
||||
: null;
|
||||
return processId && process.processes[processId] ? process.processes[processId].userData : null;
|
||||
}
|
||||
|
||||
@Action(actions.AddProcess)
|
||||
@@ -127,19 +104,14 @@ export class ProcessState {
|
||||
}
|
||||
|
||||
@Action(actions.AddCartToProcess)
|
||||
addCart(
|
||||
ctx: StateContext<ProcessStateModel>,
|
||||
{ cartId }: actions.AddCartToProcess
|
||||
) {
|
||||
addCart(ctx: StateContext<ProcessStateModel>, { cartId }: actions.AddCartToProcess) {
|
||||
const state = ctx.getState();
|
||||
if (!state) {
|
||||
return;
|
||||
}
|
||||
const currentProcesses = state.processes;
|
||||
const recentArticles = state.recentArticles;
|
||||
const currentProcessId = this.store.selectSnapshot(
|
||||
AppState.getCurrentProcessId
|
||||
);
|
||||
const currentProcessId = this.store.selectSnapshot(AppState.getCurrentProcessId);
|
||||
|
||||
const isValidCustomerProcess = (processId) => processId > 0;
|
||||
|
||||
@@ -157,17 +129,12 @@ export class ProcessState {
|
||||
}
|
||||
|
||||
@Action(actions.DeleteProcess)
|
||||
delete(
|
||||
ctx: StateContext<ProcessStateModel>,
|
||||
{ payload }: actions.DeleteProcess
|
||||
) {
|
||||
delete(ctx: StateContext<ProcessStateModel>, { payload }: actions.DeleteProcess) {
|
||||
const state = ctx.getState();
|
||||
if (!state) {
|
||||
return;
|
||||
}
|
||||
const currentProcessId = this.store.selectSnapshot(
|
||||
AppState.getCurrentProcessId
|
||||
);
|
||||
const currentProcessId = this.store.selectSnapshot(AppState.getCurrentProcessId);
|
||||
const currentProcess = state.processes[currentProcessId];
|
||||
if (!currentProcess) {
|
||||
return;
|
||||
@@ -177,9 +144,7 @@ export class ProcessState {
|
||||
const processIds = this.store.selectSnapshot(AppState.getProcessIds);
|
||||
const indexOfProcessToDelete = processIds.indexOf(payload.id);
|
||||
if (indexOfProcessToDelete !== 0) {
|
||||
this.store.dispatch(
|
||||
new AppSetCurrentProcess(processIds[indexOfProcessToDelete - 1])
|
||||
);
|
||||
this.store.dispatch(new AppSetCurrentProcess(processIds[indexOfProcessToDelete - 1]));
|
||||
} else if (indexOfProcessToDelete === 0 && processIds.length > 1) {
|
||||
this.store.dispatch(new AppSetCurrentProcess(processIds[1]));
|
||||
}
|
||||
@@ -201,19 +166,14 @@ export class ProcessState {
|
||||
}
|
||||
|
||||
@Action(actions.AddSearch)
|
||||
addSearch(
|
||||
ctx: StateContext<ProcessStateModel>,
|
||||
{ payload }: actions.AddSearch
|
||||
) {
|
||||
addSearch(ctx: StateContext<ProcessStateModel>, { payload }: actions.AddSearch) {
|
||||
const state = ctx.getState();
|
||||
if (!state) {
|
||||
return;
|
||||
}
|
||||
const currentProcesses = state.processes;
|
||||
const recentArticles = state.recentArticles;
|
||||
const currentProcessId = this.store.selectSnapshot(
|
||||
AppState.getCurrentProcessId
|
||||
);
|
||||
const currentProcessId = this.store.selectSnapshot(AppState.getCurrentProcessId);
|
||||
const process = { ...currentProcesses[currentProcessId], search: payload };
|
||||
ctx.setState(this.updateProcess(process));
|
||||
|
||||
@@ -227,19 +187,14 @@ export class ProcessState {
|
||||
}
|
||||
|
||||
@Action(actions.AddCustomerSearch)
|
||||
addCustomerSearch(
|
||||
ctx: StateContext<ProcessStateModel>,
|
||||
{ payload }: actions.AddCustomerSearch
|
||||
) {
|
||||
addCustomerSearch(ctx: StateContext<ProcessStateModel>, { payload }: actions.AddCustomerSearch) {
|
||||
const state = ctx.getState();
|
||||
if (!state) {
|
||||
return;
|
||||
}
|
||||
const currentProcesses = state.processes;
|
||||
const recentArticles = state.recentArticles;
|
||||
const currentProcessId = this.store.selectSnapshot(
|
||||
AppState.getCurrentProcessId
|
||||
);
|
||||
const currentProcessId = this.store.selectSnapshot(AppState.getCurrentProcessId);
|
||||
const process = {
|
||||
...currentProcesses[currentProcessId],
|
||||
customerSearch: payload,
|
||||
@@ -252,30 +207,19 @@ export class ProcessState {
|
||||
}
|
||||
|
||||
@Action(actions.ChangeCurrentRoute)
|
||||
changeCurrentRoute(
|
||||
ctx: StateContext<ProcessStateModel>,
|
||||
{ payload, removeLastBreadcrumb, queryParams }: actions.ChangeCurrentRoute
|
||||
) {
|
||||
changeCurrentRoute(ctx: StateContext<ProcessStateModel>, { payload, removeLastBreadcrumb, queryParams }: actions.ChangeCurrentRoute) {
|
||||
const state = ctx.getState();
|
||||
if (!state) {
|
||||
return;
|
||||
}
|
||||
const currentProcesses = state.processes;
|
||||
const currentProcessId = this.store.selectSnapshot(
|
||||
AppState.getCurrentProcessId
|
||||
);
|
||||
const currentProcessId = this.store.selectSnapshot(AppState.getCurrentProcessId);
|
||||
const recentArticles = state.recentArticles;
|
||||
|
||||
if (
|
||||
currentProcesses &&
|
||||
currentProcessId &&
|
||||
currentProcesses[currentProcessId] &&
|
||||
payload
|
||||
) {
|
||||
if (currentProcesses && currentProcessId && currentProcesses[currentProcessId] && payload) {
|
||||
let previousRoute = currentProcesses[currentProcessId].currentRoute;
|
||||
const pathData = payload.split('/');
|
||||
const lastCrumbInCustomerMenu =
|
||||
pathData.length > 0 ? pathData[pathData.length - 1] : '';
|
||||
const lastCrumbInCustomerMenu = pathData.length > 0 ? pathData[pathData.length - 1] : '';
|
||||
|
||||
if (
|
||||
payload.substring(0, 14) === '/customer/edit' &&
|
||||
@@ -326,18 +270,13 @@ export class ProcessState {
|
||||
}
|
||||
|
||||
@Action(SetPreviusPath)
|
||||
UpdatePreviusPath(
|
||||
ctx: StateContext<ProcessStateModel>,
|
||||
{ path }: SetPreviusPath
|
||||
) {
|
||||
UpdatePreviusPath(ctx: StateContext<ProcessStateModel>, { path }: SetPreviusPath) {
|
||||
const state = ctx.getState();
|
||||
if (!state) {
|
||||
return;
|
||||
}
|
||||
const currentProcesses = state.processes;
|
||||
const currentProcessId = this.store.selectSnapshot(
|
||||
AppState.getCurrentProcessId
|
||||
);
|
||||
const currentProcessId = this.store.selectSnapshot(AppState.getCurrentProcessId);
|
||||
const process = {
|
||||
...currentProcesses[currentProcessId],
|
||||
previousRoute: path,
|
||||
@@ -346,18 +285,13 @@ export class ProcessState {
|
||||
}
|
||||
|
||||
@Action(AddSelectedProduct)
|
||||
AddSelectedProduct(
|
||||
ctx: StateContext<ProcessStateModel>,
|
||||
{ payload, index }: AddSelectedProduct
|
||||
) {
|
||||
AddSelectedProduct(ctx: StateContext<ProcessStateModel>, { payload, index }: AddSelectedProduct) {
|
||||
const state = ctx.getState();
|
||||
if (!state) {
|
||||
return;
|
||||
}
|
||||
const currentProcesses = state.processes;
|
||||
const currentProcessId = this.store.selectSnapshot(
|
||||
AppState.getCurrentProcessId
|
||||
);
|
||||
const currentProcessId = this.store.selectSnapshot(AppState.getCurrentProcessId);
|
||||
const process = {
|
||||
...currentProcesses[currentProcessId],
|
||||
selectedItem: payload,
|
||||
@@ -373,9 +307,7 @@ export class ProcessState {
|
||||
return;
|
||||
}
|
||||
const currentProcesses = state.processes;
|
||||
const currentProcessId = this.store.selectSnapshot(
|
||||
AppState.getCurrentProcessId
|
||||
);
|
||||
const currentProcessId = this.store.selectSnapshot(AppState.getCurrentProcessId);
|
||||
const process = {
|
||||
...currentProcesses[currentProcessId],
|
||||
preventLoading: true,
|
||||
@@ -390,9 +322,7 @@ export class ProcessState {
|
||||
return;
|
||||
}
|
||||
const currentProcesses = state.processes;
|
||||
const currentProcessId = this.store.selectSnapshot(
|
||||
AppState.getCurrentProcessId
|
||||
);
|
||||
const currentProcessId = this.store.selectSnapshot(AppState.getCurrentProcessId);
|
||||
const process = {
|
||||
...currentProcesses[currentProcessId],
|
||||
preventLoading: false,
|
||||
@@ -401,18 +331,13 @@ export class ProcessState {
|
||||
}
|
||||
|
||||
@Action(actions.UpdateCurrentRouteQueryParams)
|
||||
updateCurrentRouteQueryParams(
|
||||
ctx: StateContext<ProcessStateModel>,
|
||||
{ queryParams }: actions.UpdateCurrentRouteQueryParams
|
||||
) {
|
||||
updateCurrentRouteQueryParams(ctx: StateContext<ProcessStateModel>, { queryParams }: actions.UpdateCurrentRouteQueryParams) {
|
||||
const state = ctx.getState();
|
||||
if (!state) {
|
||||
return;
|
||||
}
|
||||
const currentProcesses = state.processes;
|
||||
const currentProcessId = this.store.selectSnapshot(
|
||||
AppState.getCurrentProcessId
|
||||
);
|
||||
const currentProcessId = this.store.selectSnapshot(AppState.getCurrentProcessId);
|
||||
const process = {
|
||||
...currentProcesses[currentProcessId],
|
||||
currentRouteQueryParams: queryParams,
|
||||
@@ -421,18 +346,13 @@ export class ProcessState {
|
||||
}
|
||||
|
||||
@Action(CurrentCustomerPageLoaded)
|
||||
setCurrentCustomerPage(
|
||||
ctx: StateContext<ProcessStateModel>,
|
||||
{ page }: CurrentCustomerPageLoaded
|
||||
) {
|
||||
setCurrentCustomerPage(ctx: StateContext<ProcessStateModel>, { page }: CurrentCustomerPageLoaded) {
|
||||
const state = ctx.getState();
|
||||
if (!state) {
|
||||
return;
|
||||
}
|
||||
const currentProcesses = state.processes;
|
||||
const currentProcessId = this.store.selectSnapshot(
|
||||
AppState.getCurrentProcessId
|
||||
);
|
||||
const currentProcessId = this.store.selectSnapshot(AppState.getCurrentProcessId);
|
||||
const process = {
|
||||
...currentProcesses[currentProcessId],
|
||||
CurrentCustomerPageLoaded: page,
|
||||
@@ -447,9 +367,7 @@ export class ProcessState {
|
||||
return;
|
||||
}
|
||||
const currentProcesses = state.processes;
|
||||
const currentProcessId = this.store.selectSnapshot(
|
||||
AppState.getCurrentProcessId
|
||||
);
|
||||
const currentProcessId = this.store.selectSnapshot(AppState.getCurrentProcessId);
|
||||
const process = {
|
||||
...currentProcesses[currentProcessId],
|
||||
finishedOrder: undefined,
|
||||
@@ -458,23 +376,14 @@ export class ProcessState {
|
||||
}
|
||||
|
||||
@Action(actions.SetArticleSearchErrorStatus)
|
||||
setArticleSearchErrorStatus(
|
||||
ctx: StateContext<ProcessStateModel>,
|
||||
{ status }: actions.SetArticleSearchErrorStatus
|
||||
) {
|
||||
setArticleSearchErrorStatus(ctx: StateContext<ProcessStateModel>, { status }: actions.SetArticleSearchErrorStatus) {
|
||||
const state = ctx.getState();
|
||||
if (!state) {
|
||||
return;
|
||||
}
|
||||
const currentProcesses = state.processes;
|
||||
const currentProcessId = this.store.selectSnapshot(
|
||||
AppState.getCurrentProcessId
|
||||
);
|
||||
if (
|
||||
currentProcesses &&
|
||||
currentProcessId &&
|
||||
currentProcesses[currentProcessId]
|
||||
) {
|
||||
const currentProcessId = this.store.selectSnapshot(AppState.getCurrentProcessId);
|
||||
if (currentProcesses && currentProcessId && currentProcesses[currentProcessId]) {
|
||||
const process = {
|
||||
...currentProcesses[currentProcessId],
|
||||
articleSearchErrorStatus: status,
|
||||
@@ -484,23 +393,14 @@ export class ProcessState {
|
||||
}
|
||||
|
||||
@Action(actions.SetShelfSearch)
|
||||
setShelfSearch(
|
||||
ctx: StateContext<ProcessStateModel>,
|
||||
{ shelfSearch }: actions.SetShelfSearch
|
||||
) {
|
||||
setShelfSearch(ctx: StateContext<ProcessStateModel>, { shelfSearch }: actions.SetShelfSearch) {
|
||||
const state = ctx.getState();
|
||||
if (!state) {
|
||||
return;
|
||||
}
|
||||
const currentProcesses = state.processes;
|
||||
const currentProcessId = this.store.selectSnapshot(
|
||||
AppState.getCurrentProcessId
|
||||
);
|
||||
if (
|
||||
currentProcesses &&
|
||||
currentProcessId &&
|
||||
currentProcesses[currentProcessId]
|
||||
) {
|
||||
const currentProcessId = this.store.selectSnapshot(AppState.getCurrentProcessId);
|
||||
if (currentProcesses && currentProcessId && currentProcesses[currentProcessId]) {
|
||||
const process = {
|
||||
...currentProcesses[currentProcessId],
|
||||
shelfSearch: shelfSearch,
|
||||
@@ -510,23 +410,14 @@ export class ProcessState {
|
||||
}
|
||||
|
||||
@Action(actions.SetCustomerNotificationFlag)
|
||||
setCustomerNotificationFlag(
|
||||
ctx: StateContext<ProcessStateModel>,
|
||||
{ flag }: actions.SetCustomerNotificationFlag
|
||||
) {
|
||||
setCustomerNotificationFlag(ctx: StateContext<ProcessStateModel>, { flag }: actions.SetCustomerNotificationFlag) {
|
||||
const state = ctx.getState();
|
||||
if (!state) {
|
||||
return;
|
||||
}
|
||||
const currentProcesses = state.processes;
|
||||
const currentProcessId = this.store.selectSnapshot(
|
||||
AppState.getCurrentProcessId
|
||||
);
|
||||
if (
|
||||
currentProcesses &&
|
||||
currentProcessId &&
|
||||
currentProcesses[currentProcessId]
|
||||
) {
|
||||
const currentProcessId = this.store.selectSnapshot(AppState.getCurrentProcessId);
|
||||
if (currentProcesses && currentProcessId && currentProcesses[currentProcessId]) {
|
||||
const process = {
|
||||
...currentProcesses[currentProcessId],
|
||||
customerNotificationFlag: flag,
|
||||
@@ -540,14 +431,8 @@ export class ProcessState {
|
||||
const state = ctx.getState();
|
||||
if (state) {
|
||||
const currentProcesses = state.processes;
|
||||
const currentProcessId = this.store.selectSnapshot(
|
||||
AppState.getCurrentProcessId
|
||||
);
|
||||
if (
|
||||
currentProcesses[currentProcessId] &&
|
||||
currentProcesses[currentProcessId].id &&
|
||||
currentProcesses[currentProcessId].new
|
||||
) {
|
||||
const currentProcessId = this.store.selectSnapshot(AppState.getCurrentProcessId);
|
||||
if (currentProcesses[currentProcessId] && currentProcesses[currentProcessId].id && currentProcesses[currentProcessId].new) {
|
||||
const process = { ...currentProcesses[currentProcessId], new: false };
|
||||
ctx.setState(this.updateProcess(process));
|
||||
}
|
||||
@@ -555,20 +440,12 @@ export class ProcessState {
|
||||
}
|
||||
|
||||
@Action(actions.SetOnlineCustomerCreationStatus)
|
||||
setOnlineCustomerCreationStatus(
|
||||
ctx: StateContext<ProcessStateModel>,
|
||||
{ error }: actions.SetOnlineCustomerCreationStatus
|
||||
) {
|
||||
setOnlineCustomerCreationStatus(ctx: StateContext<ProcessStateModel>, { error }: actions.SetOnlineCustomerCreationStatus) {
|
||||
const state = ctx.getState();
|
||||
if (state) {
|
||||
const currentProcesses = state.processes;
|
||||
const currentProcessId = this.store.selectSnapshot(
|
||||
AppState.getCurrentProcessId
|
||||
);
|
||||
if (
|
||||
currentProcesses[currentProcessId] &&
|
||||
currentProcesses[currentProcessId].id
|
||||
) {
|
||||
const currentProcessId = this.store.selectSnapshot(AppState.getCurrentProcessId);
|
||||
if (currentProcesses[currentProcessId] && currentProcesses[currentProcessId].id) {
|
||||
const process = {
|
||||
...currentProcesses[currentProcessId],
|
||||
onlineCustomerCreationError: error,
|
||||
@@ -579,22 +456,13 @@ export class ProcessState {
|
||||
}
|
||||
|
||||
@Action(actions.ClearPartOfCustomerCreationStatus)
|
||||
clearPartOfCustomerCreationStatus(
|
||||
ctx: StateContext<ProcessStateModel>,
|
||||
{ field }: actions.ClearPartOfCustomerCreationStatus
|
||||
) {
|
||||
clearPartOfCustomerCreationStatus(ctx: StateContext<ProcessStateModel>, { field }: actions.ClearPartOfCustomerCreationStatus) {
|
||||
const state = ctx.getState();
|
||||
if (state) {
|
||||
const currentProcesses = state.processes;
|
||||
const currentProcessId = this.store.selectSnapshot(
|
||||
AppState.getCurrentProcessId
|
||||
);
|
||||
if (
|
||||
currentProcesses[currentProcessId] &&
|
||||
currentProcesses[currentProcessId].id
|
||||
) {
|
||||
const onlineCustomerCreationError =
|
||||
currentProcesses[currentProcessId].onlineCustomerCreationError;
|
||||
const currentProcessId = this.store.selectSnapshot(AppState.getCurrentProcessId);
|
||||
if (currentProcesses[currentProcessId] && currentProcesses[currentProcessId].id) {
|
||||
const onlineCustomerCreationError = currentProcesses[currentProcessId].onlineCustomerCreationError;
|
||||
if (onlineCustomerCreationError && onlineCustomerCreationError.error) {
|
||||
const updatedOnlineCustomerCreationError = {
|
||||
...onlineCustomerCreationError,
|
||||
@@ -603,10 +471,7 @@ export class ProcessState {
|
||||
[field]: undefined,
|
||||
},
|
||||
};
|
||||
if (
|
||||
Object.keys(updatedOnlineCustomerCreationError.invalidProperties)
|
||||
.length < 1
|
||||
) {
|
||||
if (Object.keys(updatedOnlineCustomerCreationError.invalidProperties).length < 1) {
|
||||
updatedOnlineCustomerCreationError.error = false;
|
||||
}
|
||||
const process = {
|
||||
@@ -620,19 +485,14 @@ export class ProcessState {
|
||||
}
|
||||
|
||||
@Action(actions.UpdateProcessName)
|
||||
updateProcessName(
|
||||
ctx: StateContext<ProcessStateModel>,
|
||||
{ payload }: actions.UpdateProcessName
|
||||
) {
|
||||
updateProcessName(ctx: StateContext<ProcessStateModel>, { payload }: actions.UpdateProcessName) {
|
||||
const state = ctx.getState();
|
||||
if (!state) {
|
||||
return;
|
||||
}
|
||||
const currentProcesses = state.processes;
|
||||
const recentArticles = state.recentArticles;
|
||||
const currentProcessId = this.store.selectSnapshot(
|
||||
AppState.getCurrentProcessId
|
||||
);
|
||||
const currentProcessId = this.store.selectSnapshot(AppState.getCurrentProcessId);
|
||||
const process = { ...currentProcesses[currentProcessId], name: payload };
|
||||
ctx.setState(this.updateProcess(process));
|
||||
|
||||
@@ -642,19 +502,14 @@ export class ProcessState {
|
||||
}
|
||||
|
||||
@Action(actions.UpdateCustomerFormState)
|
||||
updateCustomerFormState(
|
||||
ctx: StateContext<ProcessStateModel>,
|
||||
{ payload }: actions.UpdateCustomerFormState
|
||||
) {
|
||||
updateCustomerFormState(ctx: StateContext<ProcessStateModel>, { payload }: actions.UpdateCustomerFormState) {
|
||||
const state = ctx.getState();
|
||||
if (!state) {
|
||||
return;
|
||||
}
|
||||
const currentProcesses = state.processes;
|
||||
const recentArticles = state.recentArticles;
|
||||
const currentProcessId = this.store.selectSnapshot(
|
||||
AppState.getCurrentProcessId
|
||||
);
|
||||
const currentProcessId = this.store.selectSnapshot(AppState.getCurrentProcessId);
|
||||
const process = {
|
||||
...currentProcesses[currentProcessId],
|
||||
customerFormState: payload,
|
||||
@@ -674,14 +529,8 @@ export class ProcessState {
|
||||
}
|
||||
const currentProcesses = state.processes;
|
||||
const recentArticles = state.recentArticles;
|
||||
const currentProcessId = this.store.selectSnapshot(
|
||||
AppState.getCurrentProcessId
|
||||
);
|
||||
if (
|
||||
currentProcesses &&
|
||||
currentProcessId &&
|
||||
currentProcesses[currentProcessId]
|
||||
) {
|
||||
const currentProcessId = this.store.selectSnapshot(AppState.getCurrentProcessId);
|
||||
if (currentProcesses && currentProcessId && currentProcesses[currentProcessId]) {
|
||||
const process = { ...currentProcesses[currentProcessId], new: false };
|
||||
ctx.setState(this.updateProcess(process));
|
||||
|
||||
@@ -692,19 +541,14 @@ export class ProcessState {
|
||||
}
|
||||
|
||||
@Action(actions.AddCustomerId)
|
||||
addCustomerId(
|
||||
ctx: StateContext<ProcessStateModel>,
|
||||
{ payload }: actions.AddCustomerId
|
||||
) {
|
||||
addCustomerId(ctx: StateContext<ProcessStateModel>, { payload }: actions.AddCustomerId) {
|
||||
const state = ctx.getState();
|
||||
if (!state) {
|
||||
return;
|
||||
}
|
||||
const currentProcesses = state.processes;
|
||||
const recentArticles = state.recentArticles;
|
||||
const currentProcessId = this.store.selectSnapshot(
|
||||
AppState.getCurrentProcessId
|
||||
);
|
||||
const currentProcessId = this.store.selectSnapshot(AppState.getCurrentProcessId);
|
||||
const currentCustomerIds = currentProcesses[currentProcessId].customerIds;
|
||||
if (!currentCustomerIds.includes(payload)) {
|
||||
const customerIds = append([payload])(currentCustomerIds);
|
||||
@@ -718,19 +562,14 @@ export class ProcessState {
|
||||
}
|
||||
|
||||
@Action(actions.AddCustomerIds)
|
||||
addCustomerIds(
|
||||
ctx: StateContext<ProcessStateModel>,
|
||||
{ payload }: actions.AddCustomerIds
|
||||
) {
|
||||
addCustomerIds(ctx: StateContext<ProcessStateModel>, { payload }: actions.AddCustomerIds) {
|
||||
const state = ctx.getState();
|
||||
if (!state) {
|
||||
return;
|
||||
}
|
||||
const currentProcesses = state.processes;
|
||||
const recentArticles = state.recentArticles;
|
||||
const currentProcessId = this.store.selectSnapshot(
|
||||
AppState.getCurrentProcessId
|
||||
);
|
||||
const currentProcessId = this.store.selectSnapshot(AppState.getCurrentProcessId);
|
||||
if (currentProcessId < 1) {
|
||||
return;
|
||||
}
|
||||
@@ -745,19 +584,14 @@ export class ProcessState {
|
||||
}
|
||||
|
||||
@Action(actions.RemoveCustomerId)
|
||||
removeCustomerId(
|
||||
ctx: StateContext<ProcessStateModel>,
|
||||
{ payload }: actions.RemoveCustomerId
|
||||
) {
|
||||
removeCustomerId(ctx: StateContext<ProcessStateModel>, { payload }: actions.RemoveCustomerId) {
|
||||
const state = ctx.getState();
|
||||
if (!state) {
|
||||
return;
|
||||
}
|
||||
const currentProcesses = state.processes;
|
||||
const recentArticles = state.recentArticles;
|
||||
const currentProcessId = this.store.selectSnapshot(
|
||||
AppState.getCurrentProcessId
|
||||
);
|
||||
const currentProcessId = this.store.selectSnapshot(AppState.getCurrentProcessId);
|
||||
const currentCustomerIds = currentProcesses[currentProcessId].customerIds;
|
||||
const customerIds = currentCustomerIds.filter((t) => t !== payload);
|
||||
const process = { ...currentProcesses[currentProcessId], customerIds };
|
||||
@@ -769,18 +603,13 @@ export class ProcessState {
|
||||
}
|
||||
|
||||
@Action(actions.SetActiveCustomer)
|
||||
setActiveCustomerId(
|
||||
ctx: StateContext<ProcessStateModel>,
|
||||
{ payload }: actions.SetActiveCustomer
|
||||
) {
|
||||
setActiveCustomerId(ctx: StateContext<ProcessStateModel>, { payload }: actions.SetActiveCustomer) {
|
||||
const state = ctx.getState();
|
||||
if (!state) {
|
||||
return;
|
||||
}
|
||||
const currentProcesses = state.processes;
|
||||
const currentProcessId = this.store.selectSnapshot(
|
||||
AppState.getCurrentProcessId
|
||||
);
|
||||
const currentProcessId = this.store.selectSnapshot(AppState.getCurrentProcessId);
|
||||
const process = {
|
||||
...currentProcesses[currentProcessId],
|
||||
activeCustomer: payload,
|
||||
@@ -790,18 +619,13 @@ export class ProcessState {
|
||||
}
|
||||
|
||||
@Action(actions.SetDetailsCustomer)
|
||||
setDetailsustomerId(
|
||||
ctx: StateContext<ProcessStateModel>,
|
||||
{ payload }: actions.SetDetailsCustomer
|
||||
) {
|
||||
setDetailsustomerId(ctx: StateContext<ProcessStateModel>, { payload }: actions.SetDetailsCustomer) {
|
||||
const state = ctx.getState();
|
||||
if (!state) {
|
||||
return;
|
||||
}
|
||||
const currentProcesses = state.processes;
|
||||
const currentProcessId = this.store.selectSnapshot(
|
||||
AppState.getCurrentProcessId
|
||||
);
|
||||
const currentProcessId = this.store.selectSnapshot(AppState.getCurrentProcessId);
|
||||
const process = {
|
||||
...currentProcesses[currentProcessId],
|
||||
detailsCustomer: payload,
|
||||
@@ -817,9 +641,7 @@ export class ProcessState {
|
||||
}
|
||||
const currentProcesses = state.processes;
|
||||
const recentArticles = state.recentArticles;
|
||||
const currentProcessId = this.store.selectSnapshot(
|
||||
AppState.getCurrentProcessId
|
||||
);
|
||||
const currentProcessId = this.store.selectSnapshot(AppState.getCurrentProcessId);
|
||||
const oldProcess = { ...currentProcesses[currentProcessId] };
|
||||
if (!oldProcess) {
|
||||
return;
|
||||
@@ -851,19 +673,14 @@ export class ProcessState {
|
||||
}
|
||||
|
||||
@Action(actions.SetFinishedOrderData)
|
||||
setFinishedOrder(
|
||||
ctx: StateContext<ProcessStateModel>,
|
||||
{ order }: actions.SetFinishedOrderData
|
||||
) {
|
||||
setFinishedOrder(ctx: StateContext<ProcessStateModel>, { order }: actions.SetFinishedOrderData) {
|
||||
const state = ctx.getState();
|
||||
if (!state) {
|
||||
return;
|
||||
}
|
||||
const currentProcesses = state.processes;
|
||||
const recentArticles = state.recentArticles;
|
||||
const currentProcessId = this.store.selectSnapshot(
|
||||
AppState.getCurrentProcessId
|
||||
);
|
||||
const currentProcessId = this.store.selectSnapshot(AppState.getCurrentProcessId);
|
||||
const process = {
|
||||
...currentProcesses[currentProcessId],
|
||||
finishedOrder: order,
|
||||
@@ -876,10 +693,7 @@ export class ProcessState {
|
||||
}
|
||||
|
||||
@Action(actions.ReloadProcessData)
|
||||
reloadProcesses(
|
||||
ctx: StateContext<ProcessStateModel>,
|
||||
{ processes, recentArticles }: actions.ReloadProcessData
|
||||
) {
|
||||
reloadProcesses(ctx: StateContext<ProcessStateModel>, { processes, recentArticles }: actions.ReloadProcessData) {
|
||||
const isValidProcess = (process: Process) => {
|
||||
return process.id && process.name;
|
||||
};
|
||||
@@ -895,19 +709,14 @@ export class ProcessState {
|
||||
}
|
||||
|
||||
@Action(actions.CustomerOrdersVisited)
|
||||
ordersVisited(
|
||||
ctx: StateContext<ProcessStateModel>,
|
||||
{ visited }: actions.CustomerOrdersVisited
|
||||
) {
|
||||
ordersVisited(ctx: StateContext<ProcessStateModel>, { visited }: actions.CustomerOrdersVisited) {
|
||||
const state = ctx.getState();
|
||||
if (!state) {
|
||||
return;
|
||||
}
|
||||
const currentProcesses = state.processes;
|
||||
const recentArticles = state.recentArticles;
|
||||
const currentProcessId = this.store.selectSnapshot(
|
||||
AppState.getCurrentProcessId
|
||||
);
|
||||
const currentProcessId = this.store.selectSnapshot(AppState.getCurrentProcessId);
|
||||
const process = {
|
||||
...currentProcesses[currentProcessId],
|
||||
ordersOpenend: visited,
|
||||
@@ -920,19 +729,14 @@ export class ProcessState {
|
||||
}
|
||||
|
||||
@Action(actions.SetProcessProductFilters)
|
||||
updateProductFilters(
|
||||
ctx: StateContext<ProcessStateModel>,
|
||||
{ filters }: actions.SetProcessProductFilters
|
||||
) {
|
||||
updateProductFilters(ctx: StateContext<ProcessStateModel>, { filters }: actions.SetProcessProductFilters) {
|
||||
const state = ctx.getState();
|
||||
if (!state) {
|
||||
return;
|
||||
}
|
||||
const currentProcesses = state.processes;
|
||||
const recentArticles = state.recentArticles;
|
||||
const currentProcessId = this.store.selectSnapshot(
|
||||
AppState.getCurrentProcessId
|
||||
);
|
||||
const currentProcessId = this.store.selectSnapshot(AppState.getCurrentProcessId);
|
||||
const process = {
|
||||
...currentProcesses[currentProcessId],
|
||||
productSearchFilters: filters,
|
||||
@@ -951,16 +755,9 @@ export class ProcessState {
|
||||
return;
|
||||
}
|
||||
const currentProcesses = state.processes;
|
||||
const currentProcessId = this.store.selectSnapshot(
|
||||
AppState.getCurrentProcessId
|
||||
);
|
||||
if (
|
||||
currentProcesses &&
|
||||
currentProcessId &&
|
||||
currentProcesses[currentProcessId]
|
||||
) {
|
||||
const currentProductSearchFilters =
|
||||
currentProcesses[currentProcessId].productSearchFilters;
|
||||
const currentProcessId = this.store.selectSnapshot(AppState.getCurrentProcessId);
|
||||
if (currentProcesses && currentProcessId && currentProcesses[currentProcessId]) {
|
||||
const currentProductSearchFilters = currentProcesses[currentProcessId].productSearchFilters;
|
||||
|
||||
try {
|
||||
const process = {
|
||||
@@ -999,34 +796,21 @@ export class ProcessState {
|
||||
}
|
||||
|
||||
@Action(actions.SetSelectedItemIfMissingOrChanged)
|
||||
setSelectedItemIfMissingOrChanged(
|
||||
ctx: StateContext<ProcessStateModel>,
|
||||
{ item }: actions.SetSelectedItemIfMissingOrChanged
|
||||
) {
|
||||
setSelectedItemIfMissingOrChanged(ctx: StateContext<ProcessStateModel>, { item }: actions.SetSelectedItemIfMissingOrChanged) {
|
||||
const state = ctx.getState();
|
||||
if (!state) {
|
||||
return;
|
||||
}
|
||||
const currentProcesses = state.processes;
|
||||
const currentProcessId = this.store.selectSnapshot(
|
||||
AppState.getCurrentProcessId
|
||||
);
|
||||
if (
|
||||
currentProcesses &&
|
||||
currentProcessId &&
|
||||
currentProcesses[currentProcessId]
|
||||
) {
|
||||
const currentProcessId = this.store.selectSnapshot(AppState.getCurrentProcessId);
|
||||
if (currentProcesses && currentProcessId && currentProcesses[currentProcessId]) {
|
||||
const process = currentProcesses[currentProcessId];
|
||||
let updatedProcess: Process = { ...process };
|
||||
let changed = false;
|
||||
if (isNullOrUndefined(process.selectedItem)) {
|
||||
updatedProcess = { ...process, selectedItem: item };
|
||||
changed = true;
|
||||
} else if (
|
||||
process.selectedItem &&
|
||||
item &&
|
||||
process.selectedItem.id !== item.id
|
||||
) {
|
||||
} else if (process.selectedItem && item && process.selectedItem.id !== item.id) {
|
||||
updatedProcess = { ...process, selectedItem: item };
|
||||
changed = true;
|
||||
}
|
||||
@@ -1044,9 +828,7 @@ export class ProcessState {
|
||||
}
|
||||
const currentProcesses = state.processes;
|
||||
const recentArticles = state.recentArticles;
|
||||
const currentProcessId = this.store.selectSnapshot(
|
||||
AppState.getCurrentProcessId
|
||||
);
|
||||
const currentProcessId = this.store.selectSnapshot(AppState.getCurrentProcessId);
|
||||
const process = {
|
||||
...currentProcesses[currentProcessId],
|
||||
selectedItem: undefined,
|
||||
@@ -1067,11 +849,7 @@ export class ProcessState {
|
||||
});
|
||||
}
|
||||
|
||||
private syncApiState(
|
||||
currentProcesssId: number,
|
||||
processes: { [id: number]: Process },
|
||||
recentArticles: RecentArticleSearch[]
|
||||
) {
|
||||
private syncApiState(currentProcesssId: number, processes: { [id: number]: Process }, recentArticles: RecentArticleSearch[]) {
|
||||
const userSyncData: UserStateSyncData = {
|
||||
currentProcesssId,
|
||||
processes,
|
||||
|
||||
@@ -13,6 +13,7 @@ import { AppState } from './app.state';
|
||||
import { UserStateSyncData } from '../../models/user-state-sync.model';
|
||||
import { AppUserDataSync } from '../actions/app.actions';
|
||||
import { ClearCachedResults } from '../actions/collecting-shelf.action';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
export class ProductStateModel {
|
||||
products: { [key: number]: { [key: number]: ItemDTO } };
|
||||
@@ -26,6 +27,7 @@ export class ProductStateModel {
|
||||
cachedProductResults: {},
|
||||
},
|
||||
})
|
||||
@Injectable()
|
||||
export class ProductState {
|
||||
constructor(private store: Store) {}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Remission } from '../../models/remission.model';
|
||||
import { RemissionExistingOverview } from '../../models/remission-existing-overview.model';
|
||||
import { State, Action, StateContext, Store } from '@ngxs/store';
|
||||
@@ -5,10 +6,7 @@ import * as actions from '../actions/remission.actions';
|
||||
import { UserStateSyncData } from '../../models/user-state-sync.model';
|
||||
import { AppUserDataSync } from '../actions/app.actions';
|
||||
import { isNullOrUndefined } from 'util';
|
||||
import {
|
||||
RemissionResourceType,
|
||||
RemissionTargetType,
|
||||
} from '../../../modules/remission/models/remission-resource-type.model';
|
||||
import { RemissionResourceType, RemissionTargetType } from '../../../modules/remission/models/remission-resource-type.model';
|
||||
import { RemissionService, RemissionProcess } from '@isa/remission';
|
||||
import { RemissionFinishingProcessStatus } from '../../../modules/remission/models/remission-finishing-process-status.enum';
|
||||
import get from 'lodash/get';
|
||||
@@ -28,14 +26,12 @@ export class RemissionStateModel {
|
||||
isLoading: true,
|
||||
},
|
||||
})
|
||||
@Injectable()
|
||||
export class RemissionState {
|
||||
constructor(private store: Store) {}
|
||||
|
||||
@Action(actions.SetRemissionCreated)
|
||||
setRemissionCreated(
|
||||
ctx: StateContext<RemissionStateModel>,
|
||||
{ status }: actions.SetRemissionCreated
|
||||
) {
|
||||
setRemissionCreated(ctx: StateContext<RemissionStateModel>, { status }: actions.SetRemissionCreated) {
|
||||
const state = ctx.getState();
|
||||
const currentRemission = state.remission;
|
||||
const remission: Remission = {
|
||||
@@ -48,10 +44,7 @@ export class RemissionState {
|
||||
}
|
||||
|
||||
@Action(actions.SetRemissionStarted)
|
||||
setRemissionStarted(
|
||||
ctx: StateContext<RemissionStateModel>,
|
||||
{ status }: actions.SetRemissionStarted
|
||||
) {
|
||||
setRemissionStarted(ctx: StateContext<RemissionStateModel>, { status }: actions.SetRemissionStarted) {
|
||||
const state = ctx.getState();
|
||||
const currentRemission = state.remission;
|
||||
const remission: Remission = {
|
||||
@@ -63,10 +56,7 @@ export class RemissionState {
|
||||
}
|
||||
|
||||
@Action(actions.SetRemissionCompleted)
|
||||
setRemissionCompleted(
|
||||
ctx: StateContext<RemissionStateModel>,
|
||||
{ status }: actions.SetRemissionCompleted
|
||||
) {
|
||||
setRemissionCompleted(ctx: StateContext<RemissionStateModel>, { status }: actions.SetRemissionCompleted) {
|
||||
const state = ctx.getState();
|
||||
const currentRemission = state.remission;
|
||||
const remission: Remission = {
|
||||
@@ -78,19 +68,14 @@ export class RemissionState {
|
||||
}
|
||||
|
||||
@Action(actions.SetRemissionProcess)
|
||||
setRemissionProcess(
|
||||
ctx: StateContext<RemissionStateModel>,
|
||||
{ remissionProcess, initialValue }: actions.SetRemissionProcess
|
||||
) {
|
||||
setRemissionProcess(ctx: StateContext<RemissionStateModel>, { remissionProcess, initialValue }: actions.SetRemissionProcess) {
|
||||
const state = ctx.getState();
|
||||
const currentRemission = state.remission;
|
||||
const filter = get(remissionProcess, 'filter.filter', null);
|
||||
const remissionWithEmptyFilters =
|
||||
filter === null ||
|
||||
Object.keys(filter).every((sourceKey) =>
|
||||
Object.keys(filter[sourceKey]).every(
|
||||
(targetKey) => Object.keys(filter[sourceKey][targetKey]).length === 0
|
||||
)
|
||||
Object.keys(filter[sourceKey]).every((targetKey) => Object.keys(filter[sourceKey][targetKey]).length === 0)
|
||||
);
|
||||
const remission: Remission = {
|
||||
...currentRemission,
|
||||
@@ -118,10 +103,7 @@ export class RemissionState {
|
||||
}
|
||||
|
||||
@Action(actions.SetRemissionFinishedProcessStatus)
|
||||
setRemissionFinishedProcessStatus(
|
||||
ctx: StateContext<RemissionStateModel>,
|
||||
{ status }: actions.SetRemissionFinishedProcessStatus
|
||||
) {
|
||||
setRemissionFinishedProcessStatus(ctx: StateContext<RemissionStateModel>, { status }: actions.SetRemissionFinishedProcessStatus) {
|
||||
const state = ctx.getState();
|
||||
const currentRemission = state.remission;
|
||||
const remission: Remission = {
|
||||
@@ -133,10 +115,7 @@ export class RemissionState {
|
||||
}
|
||||
|
||||
@Action(actions.SetRemissionScannedContainerId)
|
||||
setRemissionScannedContainerId(
|
||||
ctx: StateContext<RemissionStateModel>,
|
||||
{ containerId }: actions.SetRemissionScannedContainerId
|
||||
) {
|
||||
setRemissionScannedContainerId(ctx: StateContext<RemissionStateModel>, { containerId }: actions.SetRemissionScannedContainerId) {
|
||||
const state = ctx.getState();
|
||||
const currentRemission = state.remission;
|
||||
const remission: Remission = {
|
||||
@@ -148,10 +127,7 @@ export class RemissionState {
|
||||
}
|
||||
|
||||
@Action(actions.SetRemissionTarget)
|
||||
setRemissionTarget(
|
||||
ctx: StateContext<RemissionStateModel>,
|
||||
{ target, source }: actions.SetRemissionTarget
|
||||
) {
|
||||
setRemissionTarget(ctx: StateContext<RemissionStateModel>, { target, source }: actions.SetRemissionTarget) {
|
||||
const state = ctx.getState();
|
||||
const currentRemission = state.remission;
|
||||
let remission: Remission;
|
||||
@@ -164,10 +140,7 @@ export class RemissionState {
|
||||
}
|
||||
|
||||
@Action(actions.SetRemissionSource)
|
||||
setRemissionSource(
|
||||
ctx: StateContext<RemissionStateModel>,
|
||||
{ source }: actions.SetRemissionSource
|
||||
) {
|
||||
setRemissionSource(ctx: StateContext<RemissionStateModel>, { source }: actions.SetRemissionSource) {
|
||||
const state = ctx.getState();
|
||||
const currentRemission = state.remission;
|
||||
const remission: Remission = {
|
||||
@@ -186,10 +159,7 @@ export class RemissionState {
|
||||
}
|
||||
|
||||
@Action(actions.SetRemissionProducts)
|
||||
setRemissionProducts(
|
||||
ctx: StateContext<RemissionStateModel>,
|
||||
{ products }: actions.SetRemissionProducts
|
||||
) {
|
||||
setRemissionProducts(ctx: StateContext<RemissionStateModel>, { products }: actions.SetRemissionProducts) {
|
||||
const state = ctx.getState();
|
||||
const currentRemission = state.remission;
|
||||
const remission: Remission = {
|
||||
@@ -201,10 +171,7 @@ export class RemissionState {
|
||||
}
|
||||
|
||||
@Action(actions.SetRemissionSearchedProduct)
|
||||
setRemissionSearchedProduct(
|
||||
ctx: StateContext<RemissionStateModel>,
|
||||
{ product }: actions.SetRemissionSearchedProduct
|
||||
) {
|
||||
setRemissionSearchedProduct(ctx: StateContext<RemissionStateModel>, { product }: actions.SetRemissionSearchedProduct) {
|
||||
const state = ctx.getState();
|
||||
const currentRemission = state.remission;
|
||||
const remission: Remission = {
|
||||
@@ -242,10 +209,7 @@ export class RemissionState {
|
||||
}
|
||||
|
||||
@Action(actions.CompleteRemissionShippingDocument)
|
||||
completeRemissionShippingDocument(
|
||||
ctx: StateContext<RemissionStateModel>,
|
||||
{ shippingDocument }: actions.SetRemissionShippingDocument
|
||||
) {
|
||||
completeRemissionShippingDocument(ctx: StateContext<RemissionStateModel>, { shippingDocument }: actions.SetRemissionShippingDocument) {
|
||||
const state = ctx.getState();
|
||||
const currentRemission = state.remission;
|
||||
const currentRemissionProcess = currentRemission.remissionProcess;
|
||||
@@ -255,9 +219,7 @@ export class RemissionState {
|
||||
|
||||
if (currentRemissionProcess.shippingDocuments) {
|
||||
const shippingDocumentAlreadyExists =
|
||||
currentRemissionProcess.shippingDocuments.findIndex(
|
||||
(sd) => sd.id === shippingDocument.id
|
||||
) !== -1;
|
||||
currentRemissionProcess.shippingDocuments.findIndex((sd) => sd.id === shippingDocument.id) !== -1;
|
||||
if (shippingDocumentAlreadyExists) {
|
||||
updatedRemissionProcess = {
|
||||
...updatedRemissionProcess,
|
||||
@@ -277,8 +239,7 @@ export class RemissionState {
|
||||
}
|
||||
const remission: Remission = {
|
||||
...currentRemission,
|
||||
remissionFinishingProcessStatus:
|
||||
RemissionFinishingProcessStatus.containerScanned,
|
||||
remissionFinishingProcessStatus: RemissionFinishingProcessStatus.containerScanned,
|
||||
remissionProcess: updatedRemissionProcess,
|
||||
};
|
||||
ctx.patchState({ remission });
|
||||
@@ -286,10 +247,7 @@ export class RemissionState {
|
||||
}
|
||||
|
||||
@Action(actions.DeleteRemissionShippingDocument)
|
||||
deleteShippingDocument(
|
||||
ctx: StateContext<RemissionStateModel>,
|
||||
{ remissionProcessId }: actions.DeleteRemissionShippingDocument
|
||||
) {
|
||||
deleteShippingDocument(ctx: StateContext<RemissionStateModel>, { remissionProcessId }: actions.DeleteRemissionShippingDocument) {
|
||||
const state = ctx.getState();
|
||||
const currentRemission = state.remission;
|
||||
|
||||
@@ -305,10 +263,7 @@ export class RemissionState {
|
||||
}
|
||||
|
||||
@Action(actions.SetRemissionShippingDocument)
|
||||
setRemissionShippingDocument(
|
||||
ctx: StateContext<RemissionStateModel>,
|
||||
{ shippingDocument }: actions.SetRemissionShippingDocument
|
||||
) {
|
||||
setRemissionShippingDocument(ctx: StateContext<RemissionStateModel>, { shippingDocument }: actions.SetRemissionShippingDocument) {
|
||||
const state = ctx.getState();
|
||||
const currentRemission = state.remission;
|
||||
const currentRemissionProcess = currentRemission.remissionProcess;
|
||||
@@ -316,9 +271,7 @@ export class RemissionState {
|
||||
|
||||
if (currentRemissionProcess.shippingDocuments) {
|
||||
const shippingDocumentAlreadyExists =
|
||||
currentRemissionProcess.shippingDocuments.findIndex(
|
||||
(sd) => sd.id === shippingDocument.id
|
||||
) !== -1;
|
||||
currentRemissionProcess.shippingDocuments.findIndex((sd) => sd.id === shippingDocument.id) !== -1;
|
||||
if (shippingDocumentAlreadyExists) {
|
||||
updatedRemissionProcess = {
|
||||
...currentRemission.remissionProcess,
|
||||
@@ -334,19 +287,13 @@ export class RemissionState {
|
||||
} else {
|
||||
updatedRemissionProcess = {
|
||||
...currentRemission.remissionProcess,
|
||||
shippingDocuments: [
|
||||
...(currentRemission.remissionProcess.shippingDocuments || []),
|
||||
shippingDocument,
|
||||
],
|
||||
shippingDocuments: [...(currentRemission.remissionProcess.shippingDocuments || []), shippingDocument],
|
||||
};
|
||||
}
|
||||
} else {
|
||||
updatedRemissionProcess = {
|
||||
...currentRemission.remissionProcess,
|
||||
shippingDocuments: [
|
||||
...(currentRemission.remissionProcess.shippingDocuments || []),
|
||||
shippingDocument,
|
||||
],
|
||||
shippingDocuments: [...(currentRemission.remissionProcess.shippingDocuments || []), shippingDocument],
|
||||
};
|
||||
}
|
||||
const remission: Remission = {
|
||||
@@ -419,10 +366,7 @@ export class RemissionState {
|
||||
}
|
||||
|
||||
@Action(actions.ReloadRemission)
|
||||
reload(
|
||||
ctx: StateContext<RemissionStateModel>,
|
||||
{ remission }: actions.ReloadRemission
|
||||
) {
|
||||
reload(ctx: StateContext<RemissionStateModel>, { remission }: actions.ReloadRemission) {
|
||||
ctx.patchState({
|
||||
remission: {
|
||||
...remission,
|
||||
@@ -434,10 +378,7 @@ export class RemissionState {
|
||||
}
|
||||
|
||||
@Action(actions.SetAllOpenExistingRemissions)
|
||||
setAllOpenExistingRemissions(
|
||||
ctx: StateContext<RemissionStateModel>,
|
||||
{ remissionProcesses }: actions.SetAllOpenExistingRemissions
|
||||
) {
|
||||
setAllOpenExistingRemissions(ctx: StateContext<RemissionStateModel>, { remissionProcesses }: actions.SetAllOpenExistingRemissions) {
|
||||
const state = ctx.getState();
|
||||
const currentExistingRemissions = state.existingRemissions;
|
||||
const existingRemissions: RemissionExistingOverview = {
|
||||
@@ -449,10 +390,7 @@ export class RemissionState {
|
||||
}
|
||||
|
||||
@Action(actions.SetAllExistingRemissions)
|
||||
setAllExistingRemissions(
|
||||
ctx: StateContext<RemissionStateModel>,
|
||||
{ remissionProcesses }: actions.SetAllExistingRemissions
|
||||
) {
|
||||
setAllExistingRemissions(ctx: StateContext<RemissionStateModel>, { remissionProcesses }: actions.SetAllExistingRemissions) {
|
||||
const state = ctx.getState();
|
||||
const currentExistingRemissions = state.existingRemissions;
|
||||
const existingRemissions: RemissionExistingOverview = {
|
||||
@@ -472,10 +410,7 @@ export class RemissionState {
|
||||
}
|
||||
|
||||
@Action(actions.SetRemissionFilter)
|
||||
setRemissionFilter(
|
||||
ctx: StateContext<RemissionStateModel>,
|
||||
{ filter }: actions.SetRemissionFilter
|
||||
) {
|
||||
setRemissionFilter(ctx: StateContext<RemissionStateModel>, { filter }: actions.SetRemissionFilter) {
|
||||
const state = ctx.getState();
|
||||
const remissionState = state.remission;
|
||||
|
||||
@@ -496,10 +431,7 @@ export class RemissionState {
|
||||
}
|
||||
|
||||
@Action(actions.RequestUpdateRemissionFilter)
|
||||
setIsLoadingFilters(
|
||||
ctx: StateContext<RemissionStateModel>,
|
||||
{ filter }: actions.RequestUpdateRemissionFilter
|
||||
) {
|
||||
setIsLoadingFilters(ctx: StateContext<RemissionStateModel>, { filter }: actions.RequestUpdateRemissionFilter) {
|
||||
const state = ctx.getState();
|
||||
const remissionState = state.remission;
|
||||
|
||||
@@ -511,10 +443,8 @@ export class RemissionState {
|
||||
...remissionState.remissionProcess,
|
||||
filter: {
|
||||
...remissionState.remissionProcess.filter,
|
||||
source:
|
||||
filter.source || remissionState.remissionProcess.filter.source,
|
||||
target:
|
||||
filter.target || remissionState.remissionProcess.filter.target,
|
||||
source: filter.source || remissionState.remissionProcess.filter.source,
|
||||
target: filter.target || remissionState.remissionProcess.filter.target,
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -527,10 +457,7 @@ export class RemissionState {
|
||||
}
|
||||
|
||||
@Action(actions.SetRemissionIsLoading)
|
||||
setIsLoading(
|
||||
ctx: StateContext<RemissionStateModel>,
|
||||
{ isLoading }: actions.SetRemissionIsLoading
|
||||
) {
|
||||
setIsLoading(ctx: StateContext<RemissionStateModel>, { isLoading }: actions.SetRemissionIsLoading) {
|
||||
const state = ctx.getState();
|
||||
|
||||
ctx.patchState({
|
||||
@@ -540,10 +467,7 @@ export class RemissionState {
|
||||
}
|
||||
|
||||
@Action(actions.SetRemissionActiveView)
|
||||
setActiveView(
|
||||
ctx: StateContext<RemissionStateModel>,
|
||||
{ activeView }: actions.SetRemissionActiveView
|
||||
) {
|
||||
setActiveView(ctx: StateContext<RemissionStateModel>, { activeView }: actions.SetRemissionActiveView) {
|
||||
const state = ctx.getState();
|
||||
const remissionState = state.remission;
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { SupplierDTO } from '@swagger/oms';
|
||||
import { State, Action, StateContext, Selector } from '@ngxs/store';
|
||||
import { CollectingShelfService } from '../../services/collecting-shelf.service';
|
||||
@@ -14,6 +15,7 @@ export class SupplierStateModel {
|
||||
suppliers: [],
|
||||
},
|
||||
})
|
||||
@Injectable()
|
||||
export class SupplierState {
|
||||
constructor(private shelfService: CollectingShelfService) {}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { VATDTO } from '@swagger/oms';
|
||||
import { State, Action, StateContext, Selector } from '@ngxs/store';
|
||||
import { CollectingShelfService } from '../../services/collecting-shelf.service';
|
||||
@@ -14,6 +15,7 @@ export class VatStateModel {
|
||||
vats: [],
|
||||
},
|
||||
})
|
||||
@Injectable()
|
||||
export class VatState {
|
||||
constructor(private shelfService: CollectingShelfService) {}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import { ItemDTO } from '@swagger/cat';
|
||||
styleUrls: ['barcode-search.component.scss'],
|
||||
})
|
||||
export class BarcodeSearchComponent implements OnInit, OnDestroy {
|
||||
@ViewChild('scanner', { static: false }) scanner: BarcodeScannerScanditComponent;
|
||||
@ViewChild('scanner') scanner: BarcodeScannerScanditComponent;
|
||||
@Select(ProcessSelectors.getProcesses) processes$: Observable<Process[]>;
|
||||
processes: Process[] = [];
|
||||
scanningVisible = false;
|
||||
|
||||
@@ -23,10 +23,10 @@ import { ErrorService } from 'apps/sales/src/app/core/error/component/error.serv
|
||||
styleUrls: ['customer-card-barcode-search.component.scss'],
|
||||
})
|
||||
export class CustomerCardBarcodeSearchComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||
@ViewChild('scanner', { static: false }) scanner: CustomerCardScannerScanditComponent;
|
||||
@ViewChild('manualentry', { static: false }) manualentry: CustomerCardManualEntryComponent;
|
||||
@ViewChild('searchCardEmptyModal', { static: false }) searchCardEmptyModal: CustomerCardSearchEmptyModalComponent;
|
||||
@ViewChild('searchCardErrorModal', { static: false }) searchCardErrorModal: CustomerCardSearchErrorModalComponent;
|
||||
@ViewChild('scanner') scanner: CustomerCardScannerScanditComponent;
|
||||
@ViewChild('manualentry') manualentry: CustomerCardManualEntryComponent;
|
||||
@ViewChild('searchCardEmptyModal') searchCardEmptyModal: CustomerCardSearchEmptyModalComponent;
|
||||
@ViewChild('searchCardErrorModal') searchCardErrorModal: CustomerCardSearchErrorModalComponent;
|
||||
@Select(ProcessSelectors.getProcesses) processes$: Observable<Process[]>;
|
||||
processes: Process[] = [];
|
||||
destroy$ = new Subject();
|
||||
|
||||
@@ -46,7 +46,7 @@ export interface ProcessAvailibilityMapper {
|
||||
})
|
||||
export class ChangeOrderTypeComponent implements OnInit, OnDestroy {
|
||||
@Select(BranchSelectors.getBranches) branches$: Observable<{ [key: number]: BranchDTO }>;
|
||||
@ViewChild('branchesdropdown', { static: false }) branchesdd: SearchDropdownComponent;
|
||||
@ViewChild('branchesdropdown') branchesdd: SearchDropdownComponent;
|
||||
|
||||
private _item: CartReviewItem;
|
||||
@Input() set item(val: CartReviewItem) {
|
||||
|
||||
@@ -32,8 +32,8 @@ import { AvailabilityDTO } from '@swagger/cat';
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class DeliveryCartRowComponent implements OnInit {
|
||||
@ViewChild('changeOrder', { static: false }) changeOrderDialog: ChangeOrderTypeComponent;
|
||||
@ViewChild('ref', { static: false }) deleteDropdown: DeleteDropdownComponent;
|
||||
@ViewChild('changeOrder') changeOrderDialog: ChangeOrderTypeComponent;
|
||||
@ViewChild('ref') deleteDropdown: DeleteDropdownComponent;
|
||||
@Input() item: CartReviewItem;
|
||||
@Output() details = new EventEmitter();
|
||||
@Output() editAdress = new EventEmitter();
|
||||
|
||||
@@ -12,7 +12,7 @@ import { Store } from '@ngxs/store';
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class DownloadCartRowComponent implements OnInit {
|
||||
@ViewChild('ref', { static: false }) deleteDropdown: DeleteDropdownComponent;
|
||||
@ViewChild('ref') deleteDropdown: DeleteDropdownComponent;
|
||||
@Input() item: CartReviewItem;
|
||||
@Output() details = new EventEmitter();
|
||||
@Output() editAdress = new EventEmitter();
|
||||
|
||||
@@ -32,8 +32,8 @@ import { AvailabilityDTO } from '@swagger/cat';
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class PickUpCartRowComponent implements OnInit, OnDestroy {
|
||||
@ViewChild('changeOrder', { static: false }) changeOrderDialog: ChangeOrderTypeComponent;
|
||||
@ViewChild('ref', { static: false }) deleteDropdown: DeleteDropdownComponent;
|
||||
@ViewChild('changeOrder') changeOrderDialog: ChangeOrderTypeComponent;
|
||||
@ViewChild('ref') deleteDropdown: DeleteDropdownComponent;
|
||||
@Input() item: CartReviewItem;
|
||||
@Output() details = new EventEmitter();
|
||||
@Output() editAdress = new EventEmitter();
|
||||
|
||||
@@ -29,8 +29,8 @@ import { DeleteDropdownComponent } from '@libs/ui';
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class TakeNowCartRowComponent implements OnInit {
|
||||
@ViewChild('changeOrder', { static: false }) changeOrderDialog: ChangeOrderTypeComponent;
|
||||
@ViewChild('ref', { static: false }) deleteDropdown: DeleteDropdownComponent;
|
||||
@ViewChild('changeOrder') changeOrderDialog: ChangeOrderTypeComponent;
|
||||
@ViewChild('ref') deleteDropdown: DeleteDropdownComponent;
|
||||
@Input() item: CartReviewItem;
|
||||
@Output() details = new EventEmitter();
|
||||
@Output() editAdress = new EventEmitter();
|
||||
|
||||
@@ -37,7 +37,7 @@ export interface OrderData {
|
||||
export class CartConfirmationComponent implements OnInit, OnDestroy {
|
||||
@Select(SharedSelectors.getConfirmedCart) cartData$: Observable<ProcessCartConfirmed>;
|
||||
@Select(SharedSelectors.getFinishedOrderCustomer) customer$: Observable<User>;
|
||||
@ViewChild('printModal', { static: false }) printModal: PrinterSelectionComponent;
|
||||
@ViewChild('printModal') printModal: PrinterSelectionComponent;
|
||||
|
||||
destroy$ = new Subject();
|
||||
customer: User;
|
||||
|
||||
@@ -73,9 +73,9 @@ export const cartToCartReviewArray = (cart: Cart[]) => {
|
||||
})
|
||||
export class CartReviewComponent implements OnInit, OnDestroy {
|
||||
@Select(SharedSelectors.getCart) cartData$: Observable<ProcessCart>;
|
||||
@ViewChild('payMethod', { static: false }) payMethodDialog: PayMethodComponent;
|
||||
@ViewChild('printModal', { static: false }) printModal: PrinterSelectionComponent;
|
||||
@ViewChild('continue', { static: false }) continueBtn: ButtonComponent;
|
||||
@ViewChild('payMethod') payMethodDialog: PayMethodComponent;
|
||||
@ViewChild('printModal') printModal: PrinterSelectionComponent;
|
||||
@ViewChild('continue') continueBtn: ButtonComponent;
|
||||
|
||||
deliveryCount$: Observable<number>;
|
||||
takeNowCount$: Observable<number>;
|
||||
|
||||
@@ -50,9 +50,9 @@ export class CreateCustomerCardComponent implements OnInit, OnDestroy {
|
||||
@Select(SharedSelectors.getCustomerEditData) customerEditData$: Observable<EditCustomerData>;
|
||||
@Select(CountrySelector.getCountriesIterable) countries$: Observable<Country[]>;
|
||||
@Select(CountrySelector.getDeutchlandIterable) deutchland$: Observable<Country[]>;
|
||||
@ViewChild('postBtn', { static: false }) postBtn: ButtonComponent;
|
||||
@ViewChild('landDD', { static: false }) landDD: SelectComponent;
|
||||
@ViewChild('suggestions', { static: false })
|
||||
@ViewChild('postBtn') postBtn: ButtonComponent;
|
||||
@ViewChild('landDD') landDD: SelectComponent;
|
||||
@ViewChild('suggestions')
|
||||
suggestions: AddressSugestionsComponent;
|
||||
destroy$ = new Subject();
|
||||
destroyForm$ = new Subject();
|
||||
|
||||
@@ -37,9 +37,9 @@ export class CustomerAddressFormComponent implements OnInit, OnDestroy {
|
||||
@Input() isBillingForm = true;
|
||||
@Select(SharedSelectors.getCustomerEditData) customerEditData$: Observable<EditCustomerData>;
|
||||
@Select(CountrySelector.getCountriesIterable) countries$: Observable<Country[]>;
|
||||
@ViewChild('suggestions', { static: false })
|
||||
@ViewChild('suggestions')
|
||||
suggestions: AddressSugestionsComponent;
|
||||
@ViewChild('postBtn', { static: false }) postBtn: ButtonComponent;
|
||||
@ViewChild('postBtn') postBtn: ButtonComponent;
|
||||
form: FormGroup;
|
||||
submitted = false;
|
||||
destroy$ = new Subject();
|
||||
|
||||
@@ -32,9 +32,9 @@ export class CustomerSearchCardComponent implements OnInit, AfterViewInit, OnDes
|
||||
searchError = '';
|
||||
|
||||
@Input() searchParams = '';
|
||||
@ViewChild('searchInput', { static: false })
|
||||
@ViewChild('searchInput')
|
||||
searchInput: SearchInputComponent;
|
||||
@ViewChild('searchEmptyModal', { static: false })
|
||||
@ViewChild('searchEmptyModal')
|
||||
searchEmptyModal: CustomerSearchEmptyModalComponent;
|
||||
|
||||
constructor(private store: Store, private router: Router, private customerService: CustomerService) {}
|
||||
|
||||
@@ -25,7 +25,7 @@ import { CustomerSelectors } from 'apps/sales/src/app/core/store/selectors/custo
|
||||
styleUrls: ['./customer-order-detail.component.scss'],
|
||||
})
|
||||
export class CustomerOrderDetailComponent implements OnInit, OnDestroy {
|
||||
@ViewChild('printModal', { static: false }) printModal: PrinterSelectionComponent;
|
||||
@ViewChild('printModal') printModal: PrinterSelectionComponent;
|
||||
@Select(BranchSelectors.getBranches) branches$: Observable<{
|
||||
[key: number]: BranchDTO;
|
||||
}>;
|
||||
|
||||
@@ -42,7 +42,7 @@ export interface CustomerFilters {
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class CustomerSearchResultComponent implements OnInit {
|
||||
@ViewChild(CdkVirtualScrollViewport, { static: false })
|
||||
@ViewChild(CdkVirtualScrollViewport)
|
||||
viewport: CdkVirtualScrollViewport;
|
||||
@Select(SharedSelectors.getSearchedCustomers) customers$: Observable<CustomerSearchResult>;
|
||||
@Select(SharedSelectors.getCart) cartData$: Observable<ProcessCart>;
|
||||
|
||||
@@ -5,24 +5,6 @@
|
||||
<div class="text">Bons von {{ card.kpi.target }} schon geschafft</div>
|
||||
</div>
|
||||
<div class="chart">
|
||||
<circle-progress
|
||||
[percent]="card.kpi.percantage"
|
||||
[maxPercent]="100"
|
||||
[radius]="45"
|
||||
[space]="-12"
|
||||
[outerStrokeWidth]="12"
|
||||
[innerStrokeWidth]="12"
|
||||
[outerStrokeColor]="'#26830C'"
|
||||
[innerStrokeColor]="'#E6EFF9'"
|
||||
[animation]="false"
|
||||
[animationDuration]="0"
|
||||
[imageHeight]="140"
|
||||
[imageWidth]="140"
|
||||
[showTitle]="false"
|
||||
[showSubtitle]="false"
|
||||
[showUnits]="false"
|
||||
[responsive]="false"
|
||||
[showZeroOuterStroke]="false"
|
||||
></circle-progress>
|
||||
<!-- TODO Add Pie Chart-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -9,9 +9,8 @@ import { RecommandationCardComponent } from './components/recommandation-card/re
|
||||
import { SharedModule } from '../../shared/shared.module';
|
||||
import { LoadingModule, IconModule } from '@libs/ui';
|
||||
import { KpiCardComponent } from './components/kpi-card/kpi-card.component';
|
||||
import { NgCircleProgressModule } from 'ng-circle-progress';
|
||||
@NgModule({
|
||||
imports: [CommonModule, SharedModule, LoadingModule, IconModule, NgCircleProgressModule],
|
||||
imports: [CommonModule, SharedModule, LoadingModule, IconModule],
|
||||
exports: [DashboardComponent],
|
||||
declarations: [
|
||||
DashboardComponent,
|
||||
|
||||
@@ -34,7 +34,7 @@ export class SelectFilterComponent implements OnChanges, AfterViewInit, OnDestro
|
||||
|
||||
@Input() module: 'Customer' | 'Branch' = 'Branch';
|
||||
|
||||
@ViewChild('optionsContainer', { static: false })
|
||||
@ViewChild('optionsContainer')
|
||||
optionsContainer: ElementRef;
|
||||
|
||||
canScroll = false;
|
||||
|
||||
@@ -80,7 +80,7 @@ export class GoodsInOrderDetailsComponent implements OnInit, OnDestroy, AfterVie
|
||||
isIPad = false;
|
||||
|
||||
// attibutes for horizontal navigational arrow of all items
|
||||
@ViewChild('allItemsEL', { static: false }) allItemsEL: ElementRef;
|
||||
@ViewChild('allItemsEL') allItemsEL: ElementRef;
|
||||
showNext = false;
|
||||
showBack = false;
|
||||
showFowardContainer = false;
|
||||
|
||||
@@ -23,7 +23,7 @@ import { GOODS_IN_SCROLL_INDEX } from 'apps/sales/src/app/core/utils/app.constan
|
||||
styleUrls: ['./goods-in-search.component.scss'],
|
||||
})
|
||||
export class GoodsInSearchComponent implements OnInit {
|
||||
@ViewChild('searchInput', { static: false })
|
||||
@ViewChild('searchInput')
|
||||
searchInput: SearchInputComponent;
|
||||
error: string;
|
||||
constructor(private store: Store, private goodsInService: GoodsInService, private router: Router) {}
|
||||
|
||||
@@ -12,7 +12,7 @@ import { CheckboxOption } from '@libs/ui';
|
||||
animations: [circleAnimation, removeAnimation, expandAnimation],
|
||||
})
|
||||
export class NewsletterSignupComponent implements OnInit {
|
||||
@ViewChild(SignaturePadComponent, { static: false }) sigPad: SignaturePadComponent;
|
||||
@ViewChild(SignaturePadComponent) sigPad: SignaturePadComponent;
|
||||
|
||||
stage = 'one';
|
||||
options = [];
|
||||
|
||||
@@ -28,7 +28,7 @@ export class BranchesAvalabilityOverviewComponent implements OnInit, OnDestroy {
|
||||
destroy$ = new Subject();
|
||||
|
||||
@Input() item: ItemDTO;
|
||||
@ViewChild('searchInput', { static: false }) searchInput: SearchInputComponent;
|
||||
@ViewChild('searchInput') searchInput: SearchInputComponent;
|
||||
|
||||
error: string;
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ export class ProductCardComponent implements OnInit, OnDestroy, AfterViewChecked
|
||||
authors: string[];
|
||||
destroy$ = new Subject();
|
||||
|
||||
@ViewChild('titleLine', { static: false }) titleLine: ElementRef;
|
||||
@ViewChild('titleLine') titleLine: ElementRef;
|
||||
private clearAfterCheckedTimeout;
|
||||
|
||||
constructor(public elementRef: ElementRef, private router: Router, private store: Store, private renderer: Renderer2) {}
|
||||
|
||||
@@ -38,9 +38,9 @@ export class ProductCheckoutComponent implements OnInit, OnDestroy {
|
||||
[key: number]: BranchDTO;
|
||||
}>;
|
||||
|
||||
@ViewChild('deleteDropdown', { static: false })
|
||||
@ViewChild('deleteDropdown')
|
||||
deleteDropdown: DeleteDropdownComponent;
|
||||
@ViewChild('branchesdropdown', { static: false })
|
||||
@ViewChild('branchesdropdown')
|
||||
branchesdd: SearchDropdownComponent;
|
||||
|
||||
id = 'checkout-modal';
|
||||
|
||||
@@ -24,7 +24,7 @@ import { WindowRef } from 'apps/sales/src/app/core/services/window-ref.service';
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class ProductOtherFormatsComponent implements OnInit {
|
||||
@ViewChild('formats', { read: ElementRef, static: false }) public formats: ElementRef<any>;
|
||||
@ViewChild('formats', { read: ElementRef }) public formats: ElementRef<any>;
|
||||
showNext = false;
|
||||
showBack = false;
|
||||
showFowardContainer = false;
|
||||
|
||||
@@ -43,7 +43,7 @@ export class ProductReviewComponent implements OnInit {
|
||||
return this._fullStars + (this._halfStars === 1 ? 0.5 : 0);
|
||||
}
|
||||
}
|
||||
@ViewChild('addReview', { static: false }) addReview: AddProductReviewComponent;
|
||||
@ViewChild('addReview') addReview: AddProductReviewComponent;
|
||||
|
||||
// [HIMA-292] - feature disabled
|
||||
reviewFeatureDisabled = true;
|
||||
|
||||
@@ -43,18 +43,18 @@ import { allowedAvailabilityStatusCodes } from 'apps/sales/src/app/core/utils/pr
|
||||
animations: [shrinkTitleAnimation, shrinkSecondaryAnimation, shrinkMainCard],
|
||||
})
|
||||
export class ProductDetailsComponent implements OnInit, OnDestroy {
|
||||
@ViewChild('productDetailContainer', { read: ElementRef, static: false })
|
||||
@ViewChild('productDetailContainer', { read: ElementRef })
|
||||
private productDetailContainer: ElementRef<any>;
|
||||
@ViewChild('checkout', { static: false }) checkoutDialog: ProductCheckoutComponent;
|
||||
@ViewChild('photoGallery', { static: false }) photoGallery: PhotoGalleryComponent;
|
||||
@ViewChild('productReview', { static: false }) productReview: ProductReviewComponent;
|
||||
@ViewChild('branchesAvailabilityInfo', { static: false })
|
||||
@ViewChild('checkout') checkoutDialog: ProductCheckoutComponent;
|
||||
@ViewChild('photoGallery') photoGallery: PhotoGalleryComponent;
|
||||
@ViewChild('productReview') productReview: ProductReviewComponent;
|
||||
@ViewChild('branchesAvailabilityInfo')
|
||||
branchesAvailabilityInfo: BranchesAvalabilityOverviewComponent;
|
||||
@ViewChild('printModal', { static: false }) printModal: PrinterSelectionComponent;
|
||||
@ViewChild('addtocart', { static: false }) addToCartBtn: ButtonComponent;
|
||||
@ViewChild('recommendations', { static: false }) recommendations: RecommendationsComponent;
|
||||
@ViewChild('otherformats', { static: false }) elOtherformats: ProductOtherFormatsComponent;
|
||||
@ViewChild('panformatsel', { read: ElementRef, static: false }) public formats: ElementRef<any>;
|
||||
@ViewChild('printModal') printModal: PrinterSelectionComponent;
|
||||
@ViewChild('addtocart') addToCartBtn: ButtonComponent;
|
||||
@ViewChild('recommendations') recommendations: RecommendationsComponent;
|
||||
@ViewChild('otherformats') elOtherformats: ProductOtherFormatsComponent;
|
||||
@ViewChild('panformatsel', { read: ElementRef }) public formats: ElementRef<any>;
|
||||
expanded = true;
|
||||
id: number;
|
||||
item: ItemDTO;
|
||||
|
||||
@@ -53,7 +53,7 @@ export class ProductResultsComponent implements OnInit, OnDestroy, AfterViewInit
|
||||
products: Product[];
|
||||
skip = 0;
|
||||
processCount = 0;
|
||||
@ViewChild('scroller', { static: false }) scroller: CdkVirtualScrollViewport;
|
||||
@ViewChild('scroller') scroller: CdkVirtualScrollViewport;
|
||||
@ViewChildren('productCard') productCardList: QueryList<ProductCardComponent>;
|
||||
loading = true;
|
||||
filters: Filter[];
|
||||
|
||||
@@ -49,11 +49,11 @@ export class FilterItemComponent implements OnInit, OnDestroy {
|
||||
topPosition = 0;
|
||||
setContanerRightPosition = false;
|
||||
allowRecoveryScroll = false;
|
||||
@ViewChild('optionContainer', { static: false }) optionContainer: ElementRef<any>;
|
||||
@ViewChild('optionContainer') optionContainer: ElementRef<any>;
|
||||
|
||||
@Output() confirmed = new EventEmitter();
|
||||
|
||||
@ViewChild('menu', { static: false }) menu: ElementRef<any>;
|
||||
@ViewChild('menu') menu: ElementRef<any>;
|
||||
|
||||
get containerHeight() {
|
||||
if (this.menu) {
|
||||
|
||||
@@ -36,7 +36,7 @@ export class FilterComponent implements OnInit, OnDestroy {
|
||||
@Select(SharedSelectors.getSelectedFilterItems) filters$: Observable<Filter[]>;
|
||||
@Output() toggle = new EventEmitter();
|
||||
@Input() selectedFilterMode: Side;
|
||||
@ViewChild('filterContainer', { static: false }) filterContainer: ElementRef<any>;
|
||||
@ViewChild('filterContainer') filterContainer: ElementRef<any>;
|
||||
@ViewChildren(SelectedFilterItemComponent) selectedFilters: QueryList<SelectedFilterItemComponent>;
|
||||
filterIndexArray$: Observable<Filter[]>;
|
||||
showMore: boolean;
|
||||
|
||||
@@ -14,7 +14,7 @@ import { SetRemissionIsLoading } from 'apps/sales/src/app/core/store/actions/rem
|
||||
styleUrls: ['./add-product-to-remission-dialog.component.scss'],
|
||||
})
|
||||
export class AddProductToRemissionDialogComponent implements OnInit, OnDestroy {
|
||||
@ViewChild('addProductButton', { static: false })
|
||||
@ViewChild('addProductButton')
|
||||
addProductButton: ButtonComponent;
|
||||
|
||||
id = 'remission-add-product-to-remission-modal';
|
||||
|
||||
@@ -28,9 +28,9 @@ export class RemissionListCardStartedComponent implements OnInit {
|
||||
@Input() remissionProcess: RemissionProcess;
|
||||
@Output() updateShippingDocument = new EventEmitter<void>();
|
||||
|
||||
@ViewChild('addProductDialog', { static: false })
|
||||
@ViewChild('addProductDialog')
|
||||
addProductDialog: RemissionAddProductToShippingDocumentDialogComponent;
|
||||
@ViewChild('addProductPartiallyDialog', { static: false })
|
||||
@ViewChild('addProductPartiallyDialog')
|
||||
addProductPartiallyDialog: RemissionAddProductToShippingDocumentPartiallyDialogComponent;
|
||||
selectedFeatureDescription: string;
|
||||
toolTipOpened = [];
|
||||
|
||||
@@ -16,8 +16,8 @@ import { SetRemissionIsLoading } from 'apps/sales/src/app/core/store/actions/rem
|
||||
styleUrls: ['./remission-list.component.scss'],
|
||||
})
|
||||
export class RemissionListComponent implements OnInit, OnDestroy {
|
||||
@ViewChild('scroller', { static: false }) scroller: CdkVirtualScrollViewport;
|
||||
@ViewChild('remissionListContainer', { static: false })
|
||||
@ViewChild('scroller') scroller: CdkVirtualScrollViewport;
|
||||
@ViewChild('remissionListContainer')
|
||||
remissionListContainer: ElementRef;
|
||||
@Input() started = false;
|
||||
@Input() hits: number;
|
||||
|
||||
@@ -23,7 +23,7 @@ export class RemissionPrinterSelectionComponent implements OnInit, OnDestroy {
|
||||
printingRequested = false;
|
||||
submited = false;
|
||||
@Output() print: EventEmitter<string> = new EventEmitter();
|
||||
@ViewChild('printBtn', { static: false }) printBtn: ButtonComponent;
|
||||
@ViewChild('printBtn') printBtn: ButtonComponent;
|
||||
|
||||
constructor(private remissionService: RemissionService, private modalService: ModalService) {}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ export class RemissionShippingDocumentCardComponent {
|
||||
|
||||
@Output() updateShippingDocument = new EventEmitter<void>();
|
||||
|
||||
@ViewChild('removeProductDialog', { static: false })
|
||||
@ViewChild('removeProductDialog')
|
||||
removeProductDialog: RemissionRemoveProductFromShippingDocumentDialogComponent;
|
||||
|
||||
showRemoveProductDialog = false;
|
||||
|
||||
@@ -34,7 +34,7 @@ export class RemissionShippingDocumentComponent implements OnInit, OnDestroy {
|
||||
|
||||
@Output() updateShippingDocument = new EventEmitter<void>();
|
||||
|
||||
@ViewChild('remissionConfirmDeleteDialog', { static: false })
|
||||
@ViewChild('remissionConfirmDeleteDialog')
|
||||
remissionConfirmDeleteDialog: RemissionConfirmDeleteShippingDocumentDialogComponent;
|
||||
|
||||
destroy$ = new Subject();
|
||||
|
||||
@@ -22,7 +22,7 @@ export class RemissionListFilterComponent implements OnInit, OnDestroy {
|
||||
animate: 'in' | 'out' = 'in';
|
||||
inTransition = true;
|
||||
|
||||
@ViewChild('selectionContainer', { static: false })
|
||||
@ViewChild('selectionContainer')
|
||||
selectionContainer: ElementRef;
|
||||
|
||||
checkHeightTimerSub = interval(100)
|
||||
|
||||
@@ -20,9 +20,9 @@ import { RemissionScanProductInvalidBarcodeComponent } from '../../components/re
|
||||
export class RemissionAddProductToRemissionListComponent implements OnInit, AfterViewInit {
|
||||
errorMessage: string;
|
||||
|
||||
@ViewChild('input', { static: false }) input: ElementRef;
|
||||
@ViewChild('searchInput', { static: false }) searchInput: SearchInputComponent;
|
||||
@ViewChild('invalidBarcodeDialog', { static: false })
|
||||
@ViewChild('input') input: ElementRef;
|
||||
@ViewChild('searchInput') searchInput: SearchInputComponent;
|
||||
@ViewChild('invalidBarcodeDialog')
|
||||
invalidBarcodeDialog: RemissionScanProductInvalidBarcodeComponent;
|
||||
|
||||
constructor(private store: Store, private remissionService: RemissionService, private router: Router) {}
|
||||
|
||||
@@ -1,24 +1,7 @@
|
||||
import {
|
||||
Component,
|
||||
OnInit,
|
||||
OnDestroy,
|
||||
ViewChild,
|
||||
AfterContentChecked,
|
||||
ChangeDetectorRef,
|
||||
} from '@angular/core';
|
||||
import { Component, OnInit, OnDestroy, ViewChild, AfterContentChecked, ChangeDetectorRef } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Observable, Subject, BehaviorSubject, of, combineLatest } from 'rxjs';
|
||||
import {
|
||||
map,
|
||||
flatMap,
|
||||
takeUntil,
|
||||
filter,
|
||||
tap,
|
||||
catchError,
|
||||
take,
|
||||
withLatestFrom,
|
||||
switchMap,
|
||||
} from 'rxjs/operators';
|
||||
import { map, flatMap, takeUntil, filter, tap, catchError, take, withLatestFrom, switchMap } from 'rxjs/operators';
|
||||
import { Store } from '@ngxs/store';
|
||||
import { RemissionSelectors } from 'apps/sales/src/app/core/store/selectors/remission.selectors';
|
||||
import { isNullOrUndefined } from 'util';
|
||||
@@ -31,22 +14,13 @@ import {
|
||||
import { PrinterSelectionComponent } from 'apps/sales/src/app/components/printer-selection/printer-selection.component';
|
||||
// tslint:disable-next-line: max-line-length
|
||||
import { RemissionConfirmDeleteShippingDocumentDialogComponent } from '../../components/remission-confirm-delete-shipping-document-dialog/remission-confirm-delete-shipping-document-dialog.component';
|
||||
import {
|
||||
AddBreadcrumb,
|
||||
ResetBreadcrumbsTo,
|
||||
DeleteLastPreviousPath,
|
||||
} from 'apps/sales/src/app/core/store/actions/breadcrumb.actions';
|
||||
import { AddBreadcrumb, ResetBreadcrumbsTo, DeleteLastPreviousPath } from 'apps/sales/src/app/core/store/actions/breadcrumb.actions';
|
||||
import { SetBranchProcessCurrentPath } from 'apps/sales/src/app/core/store/actions/branch-process.actions';
|
||||
import { ErrorService } from 'apps/sales/src/app/core/error/component/error.service';
|
||||
import { Breadcrumb } from 'apps/sales/src/app/core/models/breadcrumb.model';
|
||||
import { AppService } from '@sales/core-services';
|
||||
import { RemissionContainerScannerScanditComponent } from 'shared/public_api';
|
||||
import {
|
||||
RemissionProcess,
|
||||
RemissionService,
|
||||
RemissionSupplier,
|
||||
ShippingDocument,
|
||||
} from '@isa/remission';
|
||||
import { RemissionProcess, RemissionService, RemissionSupplier, ShippingDocument } from '@isa/remission';
|
||||
|
||||
@Component({
|
||||
selector: 'app-remission-details',
|
||||
@@ -54,8 +28,7 @@ import {
|
||||
styleUrls: ['./remission-details.component.scss'],
|
||||
// changeDetection: ChangeDetectionStrategy.OnPush
|
||||
})
|
||||
export class RemissionDetailsComponent
|
||||
implements OnInit, OnDestroy, AfterContentChecked {
|
||||
export class RemissionDetailsComponent implements OnInit, OnDestroy, AfterContentChecked {
|
||||
destroy$ = new Subject();
|
||||
isLoading = new BehaviorSubject<boolean>(false);
|
||||
isPrinting = new BehaviorSubject<boolean>(false);
|
||||
@@ -63,11 +36,11 @@ export class RemissionDetailsComponent
|
||||
isIPad = false;
|
||||
showScanner = false;
|
||||
|
||||
@ViewChild('printModal', { static: false })
|
||||
@ViewChild('printModal')
|
||||
printModal: PrinterSelectionComponent;
|
||||
@ViewChild('remissionConfirmDeleteDialog', { static: false })
|
||||
@ViewChild('remissionConfirmDeleteDialog')
|
||||
remissionConfirmDeleteDialog: RemissionConfirmDeleteShippingDocumentDialogComponent;
|
||||
@ViewChild('scanner', { static: false })
|
||||
@ViewChild('scanner')
|
||||
scannerComponent: RemissionContainerScannerScanditComponent;
|
||||
|
||||
get shippingDocument$(): Observable<ShippingDocument> {
|
||||
@@ -75,9 +48,7 @@ export class RemissionDetailsComponent
|
||||
switchMap((id) =>
|
||||
this.getRemissionProcess().pipe(
|
||||
map((remission) => {
|
||||
return remission.shippingDocuments.find(
|
||||
(document) => document.id === id
|
||||
);
|
||||
return remission.shippingDocuments.find((document) => document.id === id);
|
||||
})
|
||||
)
|
||||
)
|
||||
@@ -85,9 +56,7 @@ export class RemissionDetailsComponent
|
||||
}
|
||||
|
||||
get shippingDocumentCompleted$(): Observable<boolean> {
|
||||
return this.shippingDocument$.pipe(
|
||||
map((document) => document.isCompleted || document.isDeleted)
|
||||
);
|
||||
return this.shippingDocument$.pipe(map((document) => document.isCompleted || document.isDeleted));
|
||||
}
|
||||
|
||||
constructor(
|
||||
@@ -115,15 +84,11 @@ export class RemissionDetailsComponent
|
||||
}
|
||||
|
||||
getShippingDocumentId(): Observable<number> {
|
||||
return this.activatedRoute.params.pipe(
|
||||
map((params) => Number(params.shippingDocumentId))
|
||||
);
|
||||
return this.activatedRoute.params.pipe(map((params) => Number(params.shippingDocumentId)));
|
||||
}
|
||||
|
||||
getRemissionProcess(): Observable<RemissionProcess> {
|
||||
return this.getShippingDocumentId().pipe(
|
||||
flatMap(this.getRemissionFromShippingDocumentId)
|
||||
);
|
||||
return this.getShippingDocumentId().pipe(flatMap(this.getRemissionFromShippingDocumentId));
|
||||
}
|
||||
|
||||
openRemission(remissionProcess: RemissionProcess) {
|
||||
@@ -131,9 +96,7 @@ export class RemissionDetailsComponent
|
||||
return this.navigateToScanContainerPage();
|
||||
}
|
||||
|
||||
this.setRemissionInStore(remissionProcess)
|
||||
.pipe(takeUntil(this.destroy$), take(1))
|
||||
.subscribe(this.navigateToRemissionStartedPage);
|
||||
this.setRemissionInStore(remissionProcess).pipe(takeUntil(this.destroy$), take(1)).subscribe(this.navigateToRemissionStartedPage);
|
||||
}
|
||||
|
||||
private navigateToScanContainerPage = () => {
|
||||
@@ -150,39 +113,25 @@ export class RemissionDetailsComponent
|
||||
map((remissionProcesses) =>
|
||||
remissionProcesses.find(
|
||||
(remissionProcess) =>
|
||||
remissionProcess.shippingDocuments[0] &&
|
||||
remissionProcess.shippingDocuments[0].shippingDocumentNumber ===
|
||||
receiptNumber
|
||||
remissionProcess.shippingDocuments[0] && remissionProcess.shippingDocuments[0].shippingDocumentNumber === receiptNumber
|
||||
)
|
||||
)
|
||||
)
|
||||
.subscribe(this.shippingDocumentScannedResultHandler);
|
||||
}
|
||||
|
||||
private shippingDocumentScannedResultHandler = (
|
||||
remissionProcess: RemissionProcess
|
||||
) => {
|
||||
private shippingDocumentScannedResultHandler = (remissionProcess: RemissionProcess) => {
|
||||
this.showScanner = false;
|
||||
this.cdr.detectChanges();
|
||||
|
||||
this.setRemissionInStore(remissionProcess)
|
||||
.pipe(takeUntil(this.destroy$), take(1))
|
||||
.subscribe(this.navigateToRemissionStartedPage);
|
||||
this.setRemissionInStore(remissionProcess).pipe(takeUntil(this.destroy$), take(1)).subscribe(this.navigateToRemissionStartedPage);
|
||||
};
|
||||
|
||||
private setRemissionInStore(remissionProcess: RemissionProcess) {
|
||||
return this.store
|
||||
.dispatch(new SetRemissionProcess(remissionProcess, true))
|
||||
.pipe(
|
||||
map((_) =>
|
||||
this.store.dispatch(
|
||||
new SetRemissionShippingDocument(
|
||||
remissionProcess.shippingDocuments[0]
|
||||
)
|
||||
)
|
||||
),
|
||||
map((_) => this.store.dispatch(new SetRemissionStarted(true)))
|
||||
);
|
||||
return this.store.dispatch(new SetRemissionProcess(remissionProcess, true)).pipe(
|
||||
map((_) => this.store.dispatch(new SetRemissionShippingDocument(remissionProcess.shippingDocuments[0]))),
|
||||
map((_) => this.store.dispatch(new SetRemissionStarted(true)))
|
||||
);
|
||||
}
|
||||
|
||||
private navigateToRemissionStartedPage = () => {
|
||||
@@ -249,14 +198,9 @@ export class RemissionDetailsComponent
|
||||
.subscribe(this.handleDeleteResult);
|
||||
}
|
||||
|
||||
private handleDeleteResult = (result: {
|
||||
deleted: boolean;
|
||||
completedRemissionsExist: boolean;
|
||||
}) => {
|
||||
private handleDeleteResult = (result: { deleted: boolean; completedRemissionsExist: boolean }) => {
|
||||
if (!result.deleted) {
|
||||
return this.handleDeleteError(
|
||||
'Fehler beim Löschen des Warenbegleitscheins'
|
||||
);
|
||||
return this.handleDeleteError('Fehler beim Löschen des Warenbegleitscheins');
|
||||
}
|
||||
|
||||
if (result.completedRemissionsExist) {
|
||||
@@ -339,12 +283,8 @@ export class RemissionDetailsComponent
|
||||
this.isPrinting.next(false);
|
||||
};
|
||||
|
||||
private getRemissionFromShippingDocumentId = (
|
||||
shippingDocumentId: number
|
||||
): Observable<RemissionProcess> => {
|
||||
const allRemissions$ = this.store.select(
|
||||
RemissionSelectors.getAllRemissions
|
||||
);
|
||||
private getRemissionFromShippingDocumentId = (shippingDocumentId: number): Observable<RemissionProcess> => {
|
||||
const allRemissions$ = this.store.select(RemissionSelectors.getAllRemissions);
|
||||
|
||||
return allRemissions$.pipe(
|
||||
takeUntil(this.destroy$),
|
||||
@@ -356,11 +296,7 @@ export class RemissionDetailsComponent
|
||||
}),
|
||||
filter((allRemissions) => !isNullOrUndefined(allRemissions)),
|
||||
map((allRemissions) =>
|
||||
allRemissions.find(
|
||||
(remission) =>
|
||||
remission.shippingDocuments[0] &&
|
||||
remission.shippingDocuments[0].id === shippingDocumentId
|
||||
)
|
||||
allRemissions.find((remission) => remission.shippingDocuments[0] && remission.shippingDocuments[0].id === shippingDocumentId)
|
||||
)
|
||||
);
|
||||
};
|
||||
@@ -380,9 +316,7 @@ export class RemissionDetailsComponent
|
||||
.subscribe(this.allRemissionsSubscriptionHandler);
|
||||
}
|
||||
|
||||
private allRemissionsSubscriptionHandler = (
|
||||
remissionProcesses: RemissionProcess[]
|
||||
) => {
|
||||
private allRemissionsSubscriptionHandler = (remissionProcesses: RemissionProcess[]) => {
|
||||
this.isLoading.next(false);
|
||||
this.store.dispatch(new SetAllExistingRemissions(remissionProcesses));
|
||||
};
|
||||
@@ -395,9 +329,7 @@ export class RemissionDetailsComponent
|
||||
return this.appService.isIPadEnv();
|
||||
}
|
||||
|
||||
private isShippingDocumentGenerated(
|
||||
shippingDocument: ShippingDocument
|
||||
): boolean {
|
||||
private isShippingDocumentGenerated(shippingDocument: ShippingDocument): boolean {
|
||||
// 9 indicates that document has been generated
|
||||
return shippingDocument.shippingDocumentNumber[6] === '9';
|
||||
}
|
||||
|
||||
@@ -45,13 +45,13 @@ export class RemissionFinishComponent implements OnInit, OnDestroy {
|
||||
currentRemissionProcess$: Observable<RemissionProcess>;
|
||||
@Select(RemissionSelectors.getRemissionProcessStatuses)
|
||||
remissionProcessStatuses$: Observable<RemissionProcessStatuses>;
|
||||
@ViewChild('invalidBarcodeDialog', { static: false })
|
||||
@ViewChild('invalidBarcodeDialog')
|
||||
invalidBarcodeDialog: RemissionScanProductInvalidBarcodeComponent;
|
||||
@ViewChild('invalidDocumentDialog', { static: false })
|
||||
@ViewChild('invalidDocumentDialog')
|
||||
invalidDocumentDialog: RemissionScanShippingDocumentClosedComponent;
|
||||
@ViewChild('printModal', { static: false })
|
||||
@ViewChild('printModal')
|
||||
printModal: PrinterSelectionComponent;
|
||||
@ViewChild('confirmScanModal', { static: false })
|
||||
@ViewChild('confirmScanModal')
|
||||
confirmScanModal: RemissionScanConfirmationDialogComponent;
|
||||
pageStatus: RemissionFinishingProcessStatus;
|
||||
suppliers: {
|
||||
|
||||
@@ -32,9 +32,9 @@ import { RemissionHelperService } from '../../../services';
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class RemissionProductListComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||
@ViewChild('toTopToBottomActions', { static: false })
|
||||
@ViewChild('toTopToBottomActions')
|
||||
toTopToBottomActions: RemissionToTopToBottomActionsComponent;
|
||||
@ViewChild('remissionList', { static: false })
|
||||
@ViewChild('remissionList')
|
||||
remissionList: RemissionListComponent;
|
||||
@ViewChildren('remissionListHitsRef') remissionHitsRef: QueryList<ElementRef>;
|
||||
|
||||
|
||||
@@ -1,23 +1,6 @@
|
||||
import {
|
||||
Component,
|
||||
OnInit,
|
||||
OnDestroy,
|
||||
ViewChild,
|
||||
ElementRef,
|
||||
ChangeDetectionStrategy,
|
||||
} from '@angular/core';
|
||||
import { Component, OnInit, OnDestroy, ViewChild, ElementRef, ChangeDetectionStrategy } from '@angular/core';
|
||||
import { Subject, Observable } from 'rxjs';
|
||||
import {
|
||||
takeUntil,
|
||||
filter,
|
||||
take,
|
||||
switchMap,
|
||||
catchError,
|
||||
first,
|
||||
map,
|
||||
withLatestFrom,
|
||||
tap,
|
||||
} from 'rxjs/operators';
|
||||
import { takeUntil, filter, take, switchMap, catchError, first, map, withLatestFrom, tap } from 'rxjs/operators';
|
||||
import { RemissionResourceType } from '../../models/remission-resource-type.model';
|
||||
|
||||
import { Select, Store } from '@ngxs/store';
|
||||
@@ -39,10 +22,7 @@ import {
|
||||
} from 'apps/sales/src/app/core/store/actions/remission.actions';
|
||||
import { RemissionHelperService } from '../../services/remission-helper.service';
|
||||
import { RemissionListComponent } from '../../components/remission-list/remission-list.component';
|
||||
import {
|
||||
AddBreadcrumb,
|
||||
ResetBreadcrumbsTo,
|
||||
} from 'apps/sales/src/app/core/store/actions/breadcrumb.actions';
|
||||
import { AddBreadcrumb, ResetBreadcrumbsTo } from 'apps/sales/src/app/core/store/actions/breadcrumb.actions';
|
||||
import { Router, ActivatedRoute, Params } from '@angular/router';
|
||||
import { SetBranchProcessCurrentPath } from 'apps/sales/src/app/core/store/actions/branch-process.actions';
|
||||
import { RemissionStartDialogComponent } from '../../components/remission-start-dialog/remission-start-dialog.component';
|
||||
@@ -95,17 +75,17 @@ export class RemissionListCreateComponent implements OnInit, OnDestroy {
|
||||
listLoaded$: Observable<boolean>;
|
||||
showCtAs$: Observable<boolean>;
|
||||
|
||||
@ViewChild('toTopToBottomActions', { static: false })
|
||||
@ViewChild('toTopToBottomActions')
|
||||
toTopToBottomActions: RemissionToTopToBottomActionsComponent;
|
||||
@ViewChild('remissionList', { static: false })
|
||||
@ViewChild('remissionList')
|
||||
remissionList: RemissionListComponent;
|
||||
@ViewChild('remissionListContainer', { static: false })
|
||||
@ViewChild('remissionListContainer')
|
||||
remissionListContainer: ElementRef;
|
||||
@ViewChild('remissionStartDialog', { static: false })
|
||||
@ViewChild('remissionStartDialog')
|
||||
remissionStartDialog: RemissionStartDialogComponent;
|
||||
@ViewChild('addProductToRemissionDialog', { static: false })
|
||||
@ViewChild('addProductToRemissionDialog')
|
||||
addProductToRemissionDialog: AddProductToRemissionDialogComponent;
|
||||
@ViewChild('invalidBarcodeDialog', { static: false })
|
||||
@ViewChild('invalidBarcodeDialog')
|
||||
invalidBarcodeDialog: RemissionScanProductInvalidBarcodeComponent;
|
||||
destroy$ = new Subject();
|
||||
|
||||
@@ -167,11 +147,7 @@ export class RemissionListCreateComponent implements OnInit, OnDestroy {
|
||||
return true;
|
||||
}
|
||||
|
||||
return (
|
||||
!isNullOrUndefined(filters) &&
|
||||
!!Object.values(filters).length &&
|
||||
!!(filters.abteilungen && filters.abteilungen.length)
|
||||
);
|
||||
return !isNullOrUndefined(filters) && !!Object.values(filters).length && !!(filters.abteilungen && filters.abteilungen.length);
|
||||
})
|
||||
);
|
||||
}
|
||||
@@ -226,9 +202,7 @@ export class RemissionListCreateComponent implements OnInit, OnDestroy {
|
||||
process$ = this.continueProcess();
|
||||
}
|
||||
|
||||
return process$.pipe(
|
||||
filter((process) => !isNullOrUndefined(process))
|
||||
);
|
||||
return process$.pipe(filter((process) => !isNullOrUndefined(process)));
|
||||
}),
|
||||
take(1)
|
||||
)
|
||||
@@ -259,21 +233,17 @@ export class RemissionListCreateComponent implements OnInit, OnDestroy {
|
||||
.subscribe(this.uncompletedRemissionsSubscriptionHandler);
|
||||
}
|
||||
|
||||
uncompletedRemissionsSubscriptionHandler = (
|
||||
remissionProcesses: RemissionProcess[]
|
||||
) => {
|
||||
uncompletedRemissionsSubscriptionHandler = (remissionProcesses: RemissionProcess[]) => {
|
||||
this.store.dispatch(new SetAllOpenExistingRemissions(remissionProcesses));
|
||||
};
|
||||
|
||||
continueProcess(): Observable<RemissionProcess> {
|
||||
return this.currentRemissionProcess$
|
||||
.pipe(filter((data) => !isNullOrUndefined(data), take(1)))
|
||||
.pipe(
|
||||
switchMap((process) => {
|
||||
return this.remissionService.continueProcess(process);
|
||||
}),
|
||||
catchError(this.continueProcessErrorHandler)
|
||||
);
|
||||
return this.currentRemissionProcess$.pipe(filter((data) => !isNullOrUndefined(data), take(1))).pipe(
|
||||
switchMap((process) => {
|
||||
return this.remissionService.continueProcess(process);
|
||||
}),
|
||||
catchError(this.continueProcessErrorHandler)
|
||||
);
|
||||
}
|
||||
|
||||
continueProcessErrorHandler = (error: any) => {
|
||||
@@ -288,19 +258,11 @@ export class RemissionListCreateComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
remissionSourcesFilter = (remissionSources: RemissionSourceType[]) => {
|
||||
return (
|
||||
remissionSources &&
|
||||
Array.isArray(remissionSources) &&
|
||||
remissionSources.length === 2
|
||||
);
|
||||
return remissionSources && Array.isArray(remissionSources) && remissionSources.length === 2;
|
||||
};
|
||||
|
||||
remissionSuppliersFilter = (remissionSuppliers: RemissionSupplier[]) => {
|
||||
return (
|
||||
remissionSuppliers &&
|
||||
Array.isArray(remissionSuppliers) &&
|
||||
remissionSuppliers.length === 2
|
||||
);
|
||||
return remissionSuppliers && Array.isArray(remissionSuppliers) && remissionSuppliers.length === 2;
|
||||
};
|
||||
|
||||
remissionSuppliersSubscriptionHandler = (process) => {
|
||||
@@ -326,14 +288,10 @@ export class RemissionListCreateComponent implements OnInit, OnDestroy {
|
||||
this.currentRemissionProcess$
|
||||
.pipe(
|
||||
switchMap((process) =>
|
||||
this.remissionService
|
||||
.startRemission({ remissionProcessId: process.id })
|
||||
.pipe(filter((data) => !isNullOrUndefined(data)))
|
||||
this.remissionService.startRemission({ remissionProcessId: process.id }).pipe(filter((data) => !isNullOrUndefined(data)))
|
||||
),
|
||||
first(),
|
||||
tap((process) =>
|
||||
console.log('[Remission Create] Start Remission II', process)
|
||||
)
|
||||
tap((process) => console.log('[Remission Create] Start Remission II', process))
|
||||
)
|
||||
.subscribe((process) => {
|
||||
this.store.dispatch(new SetRemissionStarted(true));
|
||||
@@ -404,10 +362,7 @@ export class RemissionListCreateComponent implements OnInit, OnDestroy {
|
||||
.pipe(
|
||||
take(1),
|
||||
map((process) => process.id),
|
||||
withLatestFrom(
|
||||
this.currentRemissionTarget$,
|
||||
this.currentRemissionSource$
|
||||
),
|
||||
withLatestFrom(this.currentRemissionTarget$, this.currentRemissionSource$),
|
||||
catchError((error) => {
|
||||
this.store.dispatch(new SetRemissionIsLoading(false));
|
||||
return [error];
|
||||
@@ -474,9 +429,7 @@ export class RemissionListCreateComponent implements OnInit, OnDestroy {
|
||||
this.remissionService
|
||||
.searchProduct({ ean: input })
|
||||
.pipe(take(1))
|
||||
.subscribe(this.searchProductResultHandler, () =>
|
||||
this.invalidBarcodeDialog.openDialog()
|
||||
);
|
||||
.subscribe(this.searchProductResultHandler, () => this.invalidBarcodeDialog.openDialog());
|
||||
}
|
||||
|
||||
searchProductResultHandler = (remissionProduct: RemissionProduct) => {
|
||||
@@ -518,31 +471,18 @@ export class RemissionListCreateComponent implements OnInit, OnDestroy {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (
|
||||
Object.keys(process.filter).length &&
|
||||
process.filter.source &&
|
||||
process.filter.target
|
||||
);
|
||||
return Object.keys(process.filter).length && process.filter.source && process.filter.target;
|
||||
}
|
||||
|
||||
private syncContinuedProcessWithStore(process: RemissionProcess) {
|
||||
this.store.dispatch(new SetRemissionProcess(process, true));
|
||||
this.store.dispatch(
|
||||
new SetRemissionSource(process.filter.source as RemissionResourceType)
|
||||
);
|
||||
this.store.dispatch(
|
||||
new SetRemissionTarget(
|
||||
process.filter.target,
|
||||
process.filter.source as RemissionResourceType
|
||||
)
|
||||
);
|
||||
this.store.dispatch(new SetRemissionSource(process.filter.source as RemissionResourceType));
|
||||
this.store.dispatch(new SetRemissionTarget(process.filter.target, process.filter.source as RemissionResourceType));
|
||||
this.store.dispatch(new ActivateRemissionReminder());
|
||||
}
|
||||
|
||||
private initRemissionListHits() {
|
||||
this.remissionListHits$ = this.remissionHelper.remissionListHits$.pipe(
|
||||
filter((hits) => !isNullOrUndefined(hits))
|
||||
);
|
||||
this.remissionListHits$ = this.remissionHelper.remissionListHits$.pipe(filter((hits) => !isNullOrUndefined(hits)));
|
||||
}
|
||||
|
||||
private initFiltersSync() {
|
||||
|
||||
@@ -68,11 +68,11 @@ export class RemissionListStartedComponent implements OnInit, OnDestroy {
|
||||
containerScroll$ = new BehaviorSubject<Event>(undefined);
|
||||
isCompleteButtomEnabled$: Observable<boolean>;
|
||||
|
||||
@ViewChild('remissionList', { static: false })
|
||||
@ViewChild('remissionList')
|
||||
remissionList: RemissionListComponent;
|
||||
@ViewChild('remissionListContainer', { static: false })
|
||||
@ViewChild('remissionListContainer')
|
||||
remissionListContainer: ElementRef;
|
||||
@ViewChild('shippingDocumentContainer', { static: false })
|
||||
@ViewChild('shippingDocumentContainer')
|
||||
shippingDocumentContainer: ElementRef;
|
||||
|
||||
@ViewChildren('capacitiesContainer')
|
||||
|
||||
@@ -24,7 +24,7 @@ export class RemissionShippingDocumentContainerComponent implements AfterViewIni
|
||||
@Select(RemissionSelectors.getRemissiontarget)
|
||||
currentRemissionTarget$: Observable<RemissionTargetType>;
|
||||
|
||||
@ViewChild('shippingDocumentContainer', { static: false })
|
||||
@ViewChild('shippingDocumentContainer')
|
||||
shippingDocumentContainer: ElementRef;
|
||||
|
||||
constructor(private store: Store, private renderer: Renderer2, @Inject(DOCUMENT) private document: Document) {}
|
||||
|
||||
@@ -29,7 +29,7 @@ export class ShippingDocumentCreationComponent implements OnInit {
|
||||
@Select(RemissionSelectors.allowScanningShippingDocument)
|
||||
enableScan$: Observable<boolean>;
|
||||
|
||||
@ViewChild('invalidBarcodeDialog', { static: false })
|
||||
@ViewChild('invalidBarcodeDialog')
|
||||
invalidBarcodeDialog: RemissionScanProductInvalidBarcodeComponent;
|
||||
|
||||
constructor(
|
||||
|
||||
@@ -13,8 +13,8 @@ export class ShelfSearchbarComponent implements OnInit, OnDestroy {
|
||||
searchForm: FormControl;
|
||||
searchQuery$: Observable<string>;
|
||||
|
||||
@ViewChild('submitButton', { static: false }) submitButton: ElementRef<HTMLButtonElement>;
|
||||
@ViewChild('searchbar', { static: false }) searchbar: ElementRef<HTMLInputElement>;
|
||||
@ViewChild('submitButton') submitButton: ElementRef<HTMLButtonElement>;
|
||||
@ViewChild('searchbar') searchbar: ElementRef<HTMLInputElement>;
|
||||
|
||||
@Input() isIPad = false;
|
||||
@Input() isFetchingData = false;
|
||||
|
||||
@@ -1,13 +1,4 @@
|
||||
import {
|
||||
Component,
|
||||
OnInit,
|
||||
ChangeDetectionStrategy,
|
||||
ViewChild,
|
||||
Renderer2,
|
||||
ElementRef,
|
||||
ChangeDetectorRef,
|
||||
OnDestroy,
|
||||
} from '@angular/core';
|
||||
import { Component, OnInit, ChangeDetectionStrategy, ViewChild, Renderer2, ElementRef, ChangeDetectorRef, OnDestroy } from '@angular/core';
|
||||
import { IsaOverlayRef } from 'apps/sales/src/app/core/overlay/isa-overlay-ref';
|
||||
import { slideIn } from 'apps/sales/src/app/core/overlay';
|
||||
import { Observable, interval, Subject } from 'rxjs';
|
||||
@@ -34,10 +25,10 @@ export class ShelfFilterComponent implements OnInit, OnDestroy {
|
||||
isIpad = false;
|
||||
destroy$ = new Subject<void>();
|
||||
|
||||
@ViewChild('selectionContainer', { static: false })
|
||||
@ViewChild('selectionContainer')
|
||||
selectionContainer: ElementRef;
|
||||
|
||||
@ViewChild(ShelfSearchInputComponent, { static: false })
|
||||
@ViewChild(ShelfSearchInputComponent)
|
||||
searchInput: ShelfSearchInputComponent;
|
||||
|
||||
checkHeightTimerSub = interval(100)
|
||||
@@ -112,9 +103,7 @@ export class ShelfFilterComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
applyFilters() {
|
||||
this.savePendingFilters().subscribe(() =>
|
||||
this.initiateSearchAndCloseOverlay()
|
||||
);
|
||||
this.savePendingFilters().subscribe(() => this.initiateSearchAndCloseOverlay());
|
||||
}
|
||||
|
||||
close() {
|
||||
@@ -131,33 +120,22 @@ export class ShelfFilterComponent implements OnInit, OnDestroy {
|
||||
updateHeight() {
|
||||
if (this.selectionContainer) {
|
||||
const element: HTMLElement = this.selectionContainer.nativeElement;
|
||||
const selectFilterElement: HTMLElement = element.querySelector(
|
||||
'app-select-filter'
|
||||
);
|
||||
const selectFilterElement: HTMLElement = element.querySelector('app-select-filter');
|
||||
|
||||
if (isNullOrUndefined(selectFilterElement)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const selectFilterOptionsContent: HTMLElement = selectFilterElement.querySelector(
|
||||
'.select-filter-options-content'
|
||||
);
|
||||
const selectFilterOptionsContent: HTMLElement = selectFilterElement.querySelector('.select-filter-options-content');
|
||||
|
||||
if (isNullOrUndefined(selectFilterOptionsContent)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const height =
|
||||
element.clientHeight -
|
||||
(selectFilterElement.clientHeight -
|
||||
selectFilterOptionsContent.clientHeight);
|
||||
const height = element.clientHeight - (selectFilterElement.clientHeight - selectFilterOptionsContent.clientHeight);
|
||||
|
||||
if (selectFilterOptionsContent.offsetHeight !== height) {
|
||||
this.renderer.setStyle(
|
||||
selectFilterOptionsContent,
|
||||
'max-height',
|
||||
`${height}px`
|
||||
);
|
||||
this.renderer.setStyle(selectFilterOptionsContent, 'max-height', `${height}px`);
|
||||
|
||||
this.cdr.detectChanges();
|
||||
}
|
||||
@@ -177,20 +155,13 @@ export class ShelfFilterComponent implements OnInit, OnDestroy {
|
||||
savePendingFilters(): Observable<void> {
|
||||
return this.pendingFilters$.pipe(
|
||||
take(1),
|
||||
map(
|
||||
(pendingFilters) =>
|
||||
pendingFilters && this.filterService.updateFilters(pendingFilters)
|
||||
)
|
||||
map((pendingFilters) => pendingFilters && this.filterService.updateFilters(pendingFilters))
|
||||
);
|
||||
}
|
||||
|
||||
private initiateSearchAndCloseOverlay() {
|
||||
if (this.searchInput) {
|
||||
const searchbarValue =
|
||||
(this.searchInput &&
|
||||
this.searchInput.searchbar &&
|
||||
this.searchInput.searchbar.searchForm.value) ||
|
||||
'';
|
||||
const searchbarValue = (this.searchInput && this.searchInput.searchbar && this.searchInput.searchbar.searchForm.value) || '';
|
||||
|
||||
this.searchInput.triggerSearch({
|
||||
type: 'search',
|
||||
@@ -200,19 +171,13 @@ export class ShelfFilterComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
private setInitialSearchbarValue(
|
||||
overlayData: OverlayContent<{ queryString: string }>
|
||||
) {
|
||||
private setInitialSearchbarValue(overlayData: OverlayContent<{ queryString: string }>) {
|
||||
if (this.hasOverlayData(overlayData) && this.searchbarIsAccessible()) {
|
||||
this.searchInput.searchbar.setInputValue(
|
||||
this.getQueryStringFromOverlayData(overlayData)
|
||||
);
|
||||
this.searchInput.searchbar.setInputValue(this.getQueryStringFromOverlayData(overlayData));
|
||||
}
|
||||
}
|
||||
|
||||
private hasOverlayData(
|
||||
overlayData: OverlayContent<{ queryString: string }>
|
||||
): boolean {
|
||||
private hasOverlayData(overlayData: OverlayContent<{ queryString: string }>): boolean {
|
||||
return !!overlayData;
|
||||
}
|
||||
|
||||
@@ -220,9 +185,7 @@ export class ShelfFilterComponent implements OnInit, OnDestroy {
|
||||
return !!this.searchInput && !!this.searchInput.searchbar;
|
||||
}
|
||||
|
||||
private getQueryStringFromOverlayData(
|
||||
overlayData: OverlayContent<{ queryString: string }>
|
||||
): string {
|
||||
private getQueryStringFromOverlayData(overlayData: OverlayContent<{ queryString: string }>): string {
|
||||
return overlayData.queryString;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { DateAdapter } from '@isa-ui/core/date';
|
||||
import { EventEmitter, Input, Output } from '@angular/core';
|
||||
import { EventEmitter, Input, Output, Directive } from '@angular/core';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
|
||||
interface SetPropertyOptions {
|
||||
emit: boolean;
|
||||
}
|
||||
|
||||
@Directive()
|
||||
export abstract class Datepicker<TDate> {
|
||||
@Input()
|
||||
get selected() {
|
||||
|
||||
@@ -19,12 +19,12 @@ import { RemissionStartedLeaveDialogComponent } from '../../modules/remission/co
|
||||
styleUrls: ['./content.component.scss'],
|
||||
})
|
||||
export class ContentPageComponent implements OnInit, OnDestroy {
|
||||
@ViewChild(ErrorComponent, { static: false }) element: ErrorComponent;
|
||||
@ViewChild(RemissionStartedLeaveDialogComponent, { static: false })
|
||||
@ViewChild(ErrorComponent) element: ErrorComponent;
|
||||
@ViewChild(RemissionStartedLeaveDialogComponent)
|
||||
remissionStartedLeaveDialog: RemissionStartedLeaveDialogComponent;
|
||||
@ViewChild(RemissionLeaveDialogComponent, { static: false })
|
||||
@ViewChild(RemissionLeaveDialogComponent)
|
||||
remissionLeavingDialog: RemissionLeaveDialogComponent;
|
||||
@ViewChild(RemissionReminderDialogComponent, { static: false })
|
||||
@ViewChild(RemissionReminderDialogComponent)
|
||||
remissionReminderDialog: RemissionReminderDialogComponent;
|
||||
module: ModuleSwitcher = ModuleSwitcher.Customer;
|
||||
destroy$ = new Subject();
|
||||
|
||||
@@ -4,5 +4,11 @@
|
||||
"outDir": "../../out-tsc/app",
|
||||
"types": []
|
||||
},
|
||||
"exclude": ["test.ts", "**/*.spec.ts"]
|
||||
"files": [
|
||||
"src/main.ts",
|
||||
"src/polyfills.ts"
|
||||
],
|
||||
"include": [
|
||||
"apps/sales/src/**/*.d.ts"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
]
|
||||
},
|
||||
"angularCompilerOptions": {
|
||||
"annotateForClosureCompiler": true,
|
||||
"skipTemplateCodegen": true,
|
||||
"strictMetadataEmit": true,
|
||||
"fullTemplateTypeCheck": true,
|
||||
|
||||
6
apps/swagger/availability/tsconfig.lib.prod.json
Normal file
6
apps/swagger/availability/tsconfig.lib.prod.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.lib.json",
|
||||
"angularCompilerOptions": {
|
||||
"enableIvy": false
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,6 @@
|
||||
]
|
||||
},
|
||||
"angularCompilerOptions": {
|
||||
"annotateForClosureCompiler": true,
|
||||
"skipTemplateCodegen": true,
|
||||
"strictMetadataEmit": true,
|
||||
"fullTemplateTypeCheck": true,
|
||||
|
||||
6
apps/swagger/cat/tsconfig.lib.prod.json
Normal file
6
apps/swagger/cat/tsconfig.lib.prod.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.lib.json",
|
||||
"angularCompilerOptions": {
|
||||
"enableIvy": false
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,6 @@
|
||||
]
|
||||
},
|
||||
"angularCompilerOptions": {
|
||||
"annotateForClosureCompiler": true,
|
||||
"skipTemplateCodegen": true,
|
||||
"strictMetadataEmit": true,
|
||||
"fullTemplateTypeCheck": true,
|
||||
|
||||
6
apps/swagger/checkout/tsconfig.lib.prod.json
Normal file
6
apps/swagger/checkout/tsconfig.lib.prod.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.lib.json",
|
||||
"angularCompilerOptions": {
|
||||
"enableIvy": false
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,6 @@
|
||||
]
|
||||
},
|
||||
"angularCompilerOptions": {
|
||||
"annotateForClosureCompiler": true,
|
||||
"skipTemplateCodegen": true,
|
||||
"strictMetadataEmit": true,
|
||||
"fullTemplateTypeCheck": true,
|
||||
|
||||
6
apps/swagger/crm/tsconfig.lib.prod.json
Normal file
6
apps/swagger/crm/tsconfig.lib.prod.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.lib.json",
|
||||
"angularCompilerOptions": {
|
||||
"enableIvy": false
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,6 @@
|
||||
]
|
||||
},
|
||||
"angularCompilerOptions": {
|
||||
"annotateForClosureCompiler": true,
|
||||
"skipTemplateCodegen": true,
|
||||
"strictMetadataEmit": true,
|
||||
"fullTemplateTypeCheck": true,
|
||||
|
||||
6
apps/swagger/eis/tsconfig.lib.prod.json
Normal file
6
apps/swagger/eis/tsconfig.lib.prod.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.lib.json",
|
||||
"angularCompilerOptions": {
|
||||
"enableIvy": false
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,6 @@
|
||||
]
|
||||
},
|
||||
"angularCompilerOptions": {
|
||||
"annotateForClosureCompiler": true,
|
||||
"skipTemplateCodegen": true,
|
||||
"strictMetadataEmit": true,
|
||||
"fullTemplateTypeCheck": true,
|
||||
|
||||
6
apps/swagger/isa/tsconfig.lib.prod.json
Normal file
6
apps/swagger/isa/tsconfig.lib.prod.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.lib.json",
|
||||
"angularCompilerOptions": {
|
||||
"enableIvy": false
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,6 @@
|
||||
]
|
||||
},
|
||||
"angularCompilerOptions": {
|
||||
"annotateForClosureCompiler": true,
|
||||
"skipTemplateCodegen": true,
|
||||
"strictMetadataEmit": true,
|
||||
"fullTemplateTypeCheck": true,
|
||||
|
||||
6
apps/swagger/oms/tsconfig.lib.prod.json
Normal file
6
apps/swagger/oms/tsconfig.lib.prod.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.lib.json",
|
||||
"angularCompilerOptions": {
|
||||
"enableIvy": false
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user