Unverified Commit 44754bd0 authored by Ruslan Konviser's avatar Ruslan Konviser Committed by GitHub
Browse files

Merge branch 'develop' into l10n_develop

parents 02c7b3da dd488923
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
{
	"name": "@ever-platform/admin-web-angular",
	"version": "0.3.1",
	"version": "0.3.7",
	"description": "Ever Admin",
	"license": "AGPL-3.0",
	"homepage": "https://ever.co",
+0 −1
Original line number Diff line number Diff line
@@ -272,7 +272,6 @@ export class WarehousesService {

		return res.data['getCountOfMerchants'];
	}

	protected _warehouseFactory(warehouse: IWarehouse) {
		return warehouse == null ? null : new Warehouse(warehouse);
	}
+2 −0
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ import { ProductImageComponent } from './product-image/product-image.component';
import { CustomerEmailComponent } from './customer-email/customer-email.component';
import { CustomerPhoneComponent } from './customer-phone/customer-phone.component';
import { CheckboxComponent } from './customer-orders-table/checkbox/checkbox.component';
import { IsAvailableCheckBox } from './store-product-is-available-checkbox/is-available-checkbox.component';

const COMPONENTS = [
	PriceCountInputComponent,
@@ -28,6 +29,7 @@ const COMPONENTS = [
	ProductImageComponent,
	CustomerEmailComponent,
	CustomerPhoneComponent,
	IsAvailableCheckBox,
];

@NgModule({
+50 −0
Original line number Diff line number Diff line
import { Component, Input, OnInit } from '@angular/core';
import { ViewCell } from 'ng2-smart-table';
import { WarehouseProductsRouter } from '@modules/client.common.angular2/routers/warehouse-products-router.service';
@Component({
	template: `
		<div class="checkbox-container">
			<nb-checkbox
				[(ngModel)]="isChecked"
				(checkedChange)="clickHandler($event)"
			></nb-checkbox>
		</div>
	`,
	styles: [
		`
			.checkbox-container {
				display: flex;
				justify-content: center;
				align-items: center;
			}
			​ nb-checkbox {
				width: 1rem;
				height: 1rem;
			}
		`,
	],
})
export class IsAvailableCheckBox implements ViewCell, OnInit {
	@Input() rowData: any;
	@Input() value: string;
	isChecked: boolean;
	wareHouseId: string;
	productId: string;
	constructor(private warehouseProductRouter: WarehouseProductsRouter) {}
	ngOnInit() {
		this.isChecked = this.rowData.isProductAvailable;
		this.wareHouseId = this.rowData.storeId;
		this.productId = this.rowData.product.id;
		console.warn(this.rowData);
	}

	async clickHandler() {
		this.isChecked = !this.isChecked;
		this.rowData.isProductAvailable = this.isChecked;
		await this.warehouseProductRouter.changeProductAvailability(
			this.wareHouseId,
			this.productId,
			this.rowData.isProductAvailable
		);
	}
}
+1 −0
Original line number Diff line number Diff line
@@ -82,6 +82,7 @@ export class AddWarehouseProductsComponent implements OnInit, OnDestroy {
			};
			if (!resObj.takeProductDelivery && !resObj.takeProductTakeaway) {
				resObj.takeProductDelivery = true;
				resObj.takeProductTakeaway = true;
			}

			return resObj;
Loading