Loading packages/admin-web-angular/package.json +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", Loading packages/admin-web-angular/src/app/@core/data/warehouses.service.ts +0 −1 Original line number Diff line number Diff line Loading @@ -272,7 +272,6 @@ export class WarehousesService { return res.data['getCountOfMerchants']; } protected _warehouseFactory(warehouse: IWarehouse) { return warehouse == null ? null : new Warehouse(warehouse); } Loading packages/admin-web-angular/src/app/@shared/render-component/render-components.module.ts +2 −0 Original line number Diff line number Diff line Loading @@ -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, Loading @@ -28,6 +29,7 @@ const COMPONENTS = [ ProductImageComponent, CustomerEmailComponent, CustomerPhoneComponent, IsAvailableCheckBox, ]; @NgModule({ Loading packages/admin-web-angular/src/app/@shared/render-component/store-product-is-available-checkbox/is-available-checkbox.component.ts 0 → 100644 +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 ); } } packages/admin-web-angular/src/app/@shared/warehouse-product/forms/add-warehouse-products-table/add-warehouse-products-table.component.ts +1 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,7 @@ export class AddWarehouseProductsComponent implements OnInit, OnDestroy { }; if (!resObj.takeProductDelivery && !resObj.takeProductTakeaway) { resObj.takeProductDelivery = true; resObj.takeProductTakeaway = true; } return resObj; Loading Loading
packages/admin-web-angular/package.json +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", Loading
packages/admin-web-angular/src/app/@core/data/warehouses.service.ts +0 −1 Original line number Diff line number Diff line Loading @@ -272,7 +272,6 @@ export class WarehousesService { return res.data['getCountOfMerchants']; } protected _warehouseFactory(warehouse: IWarehouse) { return warehouse == null ? null : new Warehouse(warehouse); } Loading
packages/admin-web-angular/src/app/@shared/render-component/render-components.module.ts +2 −0 Original line number Diff line number Diff line Loading @@ -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, Loading @@ -28,6 +29,7 @@ const COMPONENTS = [ ProductImageComponent, CustomerEmailComponent, CustomerPhoneComponent, IsAvailableCheckBox, ]; @NgModule({ Loading
packages/admin-web-angular/src/app/@shared/render-component/store-product-is-available-checkbox/is-available-checkbox.component.ts 0 → 100644 +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 ); } }
packages/admin-web-angular/src/app/@shared/warehouse-product/forms/add-warehouse-products-table/add-warehouse-products-table.component.ts +1 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,7 @@ export class AddWarehouseProductsComponent implements OnInit, OnDestroy { }; if (!resObj.takeProductDelivery && !resObj.takeProductTakeaway) { resObj.takeProductDelivery = true; resObj.takeProductTakeaway = true; } return resObj; Loading