Commit 86119336 authored by RAHUL RATHORE's avatar RAHUL RATHORE
Browse files

fix: carrier & warehouse product forms fixes

parent 02f95fef
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
		<wizard-step
			[title]="'CARRIERS_VIEW.CREATE.BASIC_INFO' | translate"
			[isValid]="basicInfo.valid"
			[showPrev]="false"
		>
			<br />
			<ea-carrier-basic-info-form
@@ -26,10 +27,10 @@
				[password]="password"
			></ea-carrier-basic-info-form>
		</wizard-step>

		<wizard-step
			[title]="'CARRIERS_VIEW.CREATE.LOCATION' | translate"
			[isValid]="location.valid"
			[showNext]="false"
			(onComplete)="createCarrier()"
		>
			<br />
@@ -41,7 +42,6 @@
				(mapGeometryEmitter)="onGeometrySend($event)"
			>
			</ea-location-form>

			<google-map
				[mapCoordEvent]="mapCoordEmitter"
				[mapGeometryEvent]="mapGeometryEmitter"
+5 −3
Original line number Diff line number Diff line
@@ -11,9 +11,9 @@
		#wizzardFrom
		class="form-horizontal"
		[formGroup]="form"
		[doneText]="buttonDone"
		[nextText]="buttonNext"
		[previousText]="buttonPrevious"
		[doneText]="'BUTTON_DONE' | translate"
		[nextText]="'BUTTON_NEXT' | translate"
		[previousText]="'BUTTON_PREV' | translate"
		[nbSpinner]="loading"
	>
		<wizard-step
@@ -21,6 +21,7 @@
			(onNext)="onStep1Next()"
			[title]="'WAREHOUSE_VIEW.NEW_PRODUCT.HOW_TO_ADD' | translate"
			[isValid]="hasCoiced"
			[showPrev]="false"
		>
			<hr />
			<ea-warehouse-add-choice
@@ -60,6 +61,7 @@
			[isValid]="validAllProducts()"
			(onComplete)="addProducts()"
			(onPrev)="onStep3Prev()"
			[showNext]="false"
		>
			<hr />
			<ea-add-warehouse-products-table
+4 −29
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@ import { Component, ViewChild, OnInit, OnDestroy } from '@angular/core';
import { FormBuilder, FormGroup, FormControl } from '@angular/forms';
import { WarehouseAddChoiceComponent } from '../forms';
import { takeUntil, first } from 'rxjs/operators';
import { Subject } from 'rxjs';
import { firstValueFrom, Subject } from 'rxjs';
import { BasicInfoFormComponent } from '../../product/forms';
import { ProductsTableComponent } from '../../product/forms/products-table';
import { ProductsService } from '../../../@core/data/products.service';
@@ -33,9 +33,6 @@ export class WarehouseProductCreateComponent implements OnInit, OnDestroy {
	currentThemeCosmic: boolean = false;

	warehouseId: string;
	BUTTON_DONE: string = 'BUTTON_DONE';
	BUTTON_NEXT: string = 'BUTTON_NEXT';
	BUTTON_PREV: string = 'BUTTON_PREV';
	productsCategories: ProductsCategory[];
	selectedWarehouse: Warehouse;
	perPage: number;
@@ -103,17 +100,6 @@ export class WarehouseProductCreateComponent implements OnInit, OnDestroy {
			this.currentThemeCosmic = true;
		}
	}
	get buttonDone() {
		return this._translate(this.BUTTON_DONE);
	}

	get buttonNext() {
		return this._translate(this.BUTTON_NEXT);
	}

	get buttonPrevious() {
		return this._translate(this.BUTTON_PREV);
	}

	get hasCoiced() {
		return this.choiced;
@@ -259,10 +245,9 @@ export class WarehouseProductCreateComponent implements OnInit, OnDestroy {
	}

	async loadProductCategories() {
		this.productsCategories = await this._productsCategoryService
			.getCategories()
			.pipe(first())
			.toPromise();
		this.productsCategories = await firstValueFrom(
			this._productsCategoryService.getCategories()
		);
	}

	cancel() {
@@ -273,16 +258,6 @@ export class WarehouseProductCreateComponent implements OnInit, OnDestroy {
		return this._productsService.getCountOfProducts(existedProductsIds);
	}

	private _translate(key: string): string {
		let translationResult = '';

		this._translateService.get(key).subscribe((res) => {
			translationResult = res;
		});

		return translationResult;
	}

	ngOnDestroy() {
		this.ngDestroy$.next();
		this.ngDestroy$.complete();
+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@
								selectedShapeType = 'shape'; startDrawing()
							"
							nbButton
							class="mr-2"
							class="ml-2"
						>
							{{ 'WAREHOUSE_VIEW.MUTATION.SHAPE' | translate }}
						</button>
+2 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
	<wizard-step
		[title]="TRANSLATE_PREFIXES.STEP1.TITLE | translate"
		[isValid]="false"
		[showNext]="false"
		[showPrev]="false"
		class="step-1"
	>
		<nb-card>
@@ -69,6 +69,7 @@
		[title]="TRANSLATE_PREFIXES.STEP3.TITLE | translate"
		[isValid]="isOrderAllowed"
		(onComplete)="completeOrder()"
		[showNext]="false"
	>
		<ea-warehouse-order-modal
			#warehouseOrderModal