Commit 401aee01 authored by RAHUL RATHORE's avatar RAHUL RATHORE
Browse files

fix: Qrcode & products missing syntax

parent 632d53e9
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -15,9 +15,10 @@
		class="form-horizontal"
	>
		<wizard-step
			[title]="''"
			[isValid]="basicInfo.valid"
			(onComplete)="createProduct()"
			[showNext]="false"
			[showPrev]="false"
		>
			<ea-product-basic-info-form
				#basicInfoForm
+5 −3
Original line number Diff line number Diff line
@@ -11,9 +11,9 @@
	<form-wizard
		class="form-horizontal"
		[formGroup]="form"
		[doneText]="buttonDone"
		[nextText]="buttonNext"
		[previousText]="buttonPrevious"
		[doneText]="'BUTTON_DONE' | translate"
		[nextText]="'BUTTON_NEXT' | translate"
		[previousText]="'BUTTON_PREV' | translate"
	>
		<wizard-step
			[title]="
@@ -21,6 +21,7 @@
					| translate
			"
			[isValid]="basicInfo.valid"
			[showPrev]="false"
		>
			<br />
			<ea-user-basic-info-form
@@ -37,6 +38,7 @@
			"
			(onComplete)="create()"
			[isValid]="location.valid"
			[showNext]="false"
		>
			<br />
			<ea-location-form
+2 −30
Original line number Diff line number Diff line
@@ -5,12 +5,11 @@ import { ToasterService } from 'angular2-toaster';
import { BasicInfoFormComponent } from '../forms/basic-info';
import { LocationFormComponent } from '../../forms/location';
import { UserAuthRouter } from '@modules/client.common.angular2/routers/user-auth-router.service';
import { TranslateService } from '@ngx-translate/core';

@Component({
	selector: 'ea-user-mutation',
	templateUrl: './user-mutation.component.html',
	styleUrls: ['/user-mutation.component.scss'],
	styleUrls: ['./user-mutation.component.scss'],
})
export class UserMutationComponent {
	@ViewChild('basicInfoForm')
@@ -23,10 +22,6 @@ export class UserMutationComponent {
	mapCoordEmitter = new EventEmitter<number[]>();
	mapGeometryEmitter = new EventEmitter<any>();

	public BUTTON_DONE: string = 'BUTTON_DONE';
	public BUTTON_NEXT: string = 'BUTTON_NEXT';
	public BUTTON_PREV: string = 'BUTTON_PREV';

	readonly form: FormGroup = this.formBuilder.group({
		basicInfo: BasicInfoFormComponent.buildForm(this.formBuilder),
		apartment: LocationFormComponent.buildApartmentForm(this.formBuilder),
@@ -43,22 +38,9 @@ export class UserMutationComponent {
		protected readonly userAuthRouter: UserAuthRouter,
		private readonly toasterService: ToasterService,
		private readonly activeModal: NgbActiveModal,
		private readonly formBuilder: FormBuilder,
		private readonly translateService: TranslateService
		private readonly formBuilder: FormBuilder
	) {}

	get buttonDone() {
		return this._translate(this.BUTTON_DONE);
	}

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

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

	onCoordinatesChanges(coords: number[]) {
		this.mapCoordEmitter.emit(coords);
	}
@@ -104,14 +86,4 @@ export class UserMutationComponent {
	cancel() {
		this.activeModal.dismiss('canceled');
	}

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

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

		return translationResult;
	}
}
+1 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@
								selectedShapeType = 'shape'; startDrawing()
							"
							nbButton
							class="mr-2"
						>
							{{ 'WAREHOUSE_VIEW.MUTATION.SHAPE' | translate }}
						</button>
+10 −13
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@ import { takeUntil, first } from 'rxjs/operators';
import { LocalDataSource } from 'ng2-smart-table';
import { ProductsService } from '../../@core/data/products.service';
import Product from '@modules/server.common/entities/Product';
import { Subject } from 'rxjs';
import { firstValueFrom, Subject } from 'rxjs';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { ProductCreateComponent } from '../../@shared/product/product-create';
import { ProductsTableComponent } from '../../@shared/product/forms/products-table';
@@ -73,11 +73,9 @@ export class ProductsComponent implements OnDestroy, AfterViewInit {

		try {
			this.loading = true;

			await this._productsService
				.removeByIds(idsForDelete)
				.pipe(first())
				.toPromise();
			await firstValueFrom(
				this._productsService.removeByIds(idsForDelete)
			);

			this.loading = false;

@@ -99,14 +97,12 @@ export class ProductsComponent implements OnDestroy, AfterViewInit {
	}

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

	private async _loadDataSmartTable(page: number = 1) {
		let products: Product[] = [];
		if (this.$products) {
			await this.$products.unsubscribe();
		}
@@ -120,9 +116,10 @@ export class ProductsComponent implements OnDestroy, AfterViewInit {
				this.productsTable.perPage = perPage;

				const dataCount = await this.getDataCount();
				products = p;
				let products: Product[] = p;

				this.productsTable.loadDataSmartTable(
					products,
					products || [],
					dataCount,
					page
				);
Loading