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/warehouse-products-table/warehouse-products-table.component.ts +12 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ import { ProductLocalesService } from '@modules/client.common.angular2/locale/pr import { ProductsCategoryService } from '@app/@core/data/productsCategory.service'; import Product from '@modules/server.common/entities/Product'; import { StoreProductImageComponent } from '@app/@shared/render-component/store-products-table/store-product-image/store-product-image.component'; import { CheckboxComponent } from '@app/@shared/render-component/customer-orders-table/checkbox/checkbox.component'; import { IsAvailableCheckBox } from '@app/@shared/render-component/store-product-is-available-checkbox/is-available-checkbox.component'; export interface WarehouseProductViewModel { id: string; Loading @@ -32,6 +34,7 @@ export interface WarehouseProductViewModel { storeId: string; product: Product; allCategories: any[]; isProductAvailable: boolean; } @Component({ Loading Loading @@ -118,6 +121,7 @@ export class WarehouseProductsComponent implements OnInit, OnDestroy { storeId, product: product.product, allCategories: this.categoriesInfo, isProductAvailable: product.isProductAvailable, }; }); Loading Loading @@ -149,6 +153,7 @@ export class WarehouseProductsComponent implements OnInit, OnDestroy { getTranslate('CATEGORY'), getTranslate('PRICE'), getTranslate('QUANTITY'), getTranslate('AVAILABILITY'), getTranslate('TYPE') ) .pipe(takeUntil(this.ngDestroy$)) Loading @@ -162,7 +167,8 @@ export class WarehouseProductsComponent implements OnInit, OnDestroy { category, price, quantity, type, availability, type ]) => { this.settingsSmartTable = { mode: 'external', Loading Loading @@ -218,6 +224,11 @@ export class WarehouseProductsComponent implements OnInit, OnDestroy { class: 'text-center', type: 'custom', renderComponent: StoreProductAmountComponent, }, isAvailable: { title: availability, type: 'custom', renderComponent: IsAvailableCheckBox }, type: { title: type, 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/warehouse-products-table/warehouse-products-table.component.ts +12 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ import { ProductLocalesService } from '@modules/client.common.angular2/locale/pr import { ProductsCategoryService } from '@app/@core/data/productsCategory.service'; import Product from '@modules/server.common/entities/Product'; import { StoreProductImageComponent } from '@app/@shared/render-component/store-products-table/store-product-image/store-product-image.component'; import { CheckboxComponent } from '@app/@shared/render-component/customer-orders-table/checkbox/checkbox.component'; import { IsAvailableCheckBox } from '@app/@shared/render-component/store-product-is-available-checkbox/is-available-checkbox.component'; export interface WarehouseProductViewModel { id: string; Loading @@ -32,6 +34,7 @@ export interface WarehouseProductViewModel { storeId: string; product: Product; allCategories: any[]; isProductAvailable: boolean; } @Component({ Loading Loading @@ -118,6 +121,7 @@ export class WarehouseProductsComponent implements OnInit, OnDestroy { storeId, product: product.product, allCategories: this.categoriesInfo, isProductAvailable: product.isProductAvailable, }; }); Loading Loading @@ -149,6 +153,7 @@ export class WarehouseProductsComponent implements OnInit, OnDestroy { getTranslate('CATEGORY'), getTranslate('PRICE'), getTranslate('QUANTITY'), getTranslate('AVAILABILITY'), getTranslate('TYPE') ) .pipe(takeUntil(this.ngDestroy$)) Loading @@ -162,7 +167,8 @@ export class WarehouseProductsComponent implements OnInit, OnDestroy { category, price, quantity, type, availability, type ]) => { this.settingsSmartTable = { mode: 'external', Loading Loading @@ -218,6 +224,11 @@ export class WarehouseProductsComponent implements OnInit, OnDestroy { class: 'text-center', type: 'custom', renderComponent: StoreProductAmountComponent, }, isAvailable: { title: availability, type: 'custom', renderComponent: IsAvailableCheckBox }, type: { title: type, Loading