Loading 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 packages/admin-web-angular/src/app/@shared/warehouse-product/forms/warehouse-products-table/warehouse-products-table.component.ts +25 −5 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ import { StoreProductPriceComponent } from '@app/@shared/render-component/store- import { StoreProductAmountComponent } from '@app/@shared/render-component/store-products-table/store-product-amount/store-product-amount.component'; import { ProductCategoriesComponent } from '@app/@shared/render-component/product-categories/product-categories'; import { ProductTitleRedirectComponent } from '@app/@shared/render-component/product-title-redirect/product-title-redirect.component'; import { Observable, forkJoin, Subject } from 'rxjs'; import { Observable, forkJoin, Subject, Subscription } from 'rxjs'; import { TranslateService } from '@ngx-translate/core'; import { takeUntil } from 'rxjs/operators'; import WarehouseProduct from '@modules/server.common/entities/WarehouseProduct'; Loading Loading @@ -55,6 +55,9 @@ export class WarehouseProductsComponent implements OnInit, OnDestroy { settingsSmartTable: object; sourceSmartTable = new LocalDataSource(); selectedProducts: WarehouseProductViewModel[] = []; columnTitlePrefix = 'WAREHOUSE_VIEW.PRODUCTS_TAB.'; subscription: Subscription; suffix: string; private ngDestroy$ = new Subject<void>(); private categoriesInfo: any = []; Loading @@ -78,6 +81,7 @@ export class WarehouseProductsComponent implements OnInit, OnDestroy { ngOnDestroy(): void { this.ngDestroy$.next(); this.ngDestroy$.complete(); this.subscription.unsubscribe(); } async loadDataSmartTable(products: WarehouseProduct[], storeId: string) { Loading Loading @@ -111,6 +115,9 @@ export class WarehouseProductsComponent implements OnInit, OnDestroy { }, price: product.price, qty: product.count, type: product.isTakeaway ? this._translate(`${this.columnTitlePrefix}TAKEAWAY`) : this._translate(`${this.columnTitlePrefix}DELIVERY`), storeId, product: product.product, allCategories: this.categoriesInfo, Loading @@ -134,9 +141,8 @@ export class WarehouseProductsComponent implements OnInit, OnDestroy { } private _loadSettingsSmartTable() { const columnTitlePrefix = 'WAREHOUSE_VIEW.PRODUCTS_TAB.'; const getTranslate = (name: string): Observable<any> => this._translateService.get(columnTitlePrefix + name); this._translateService.get(this.columnTitlePrefix + name); forkJoin( this._translateService.get('Id'), Loading @@ -147,7 +153,8 @@ export class WarehouseProductsComponent implements OnInit, OnDestroy { getTranslate('CATEGORY'), getTranslate('PRICE'), getTranslate('QUANTITY'), getTranslate('AVAILABILITY') getTranslate('AVAILABILITY'), getTranslate('TYPE') ) .pipe(takeUntil(this.ngDestroy$)) .subscribe( Loading @@ -161,6 +168,7 @@ export class WarehouseProductsComponent implements OnInit, OnDestroy { price, quantity, availability, type ]) => { this.settingsSmartTable = { mode: 'external', Loading Loading @@ -220,7 +228,10 @@ export class WarehouseProductsComponent implements OnInit, OnDestroy { isAvailable: { title: availability, type: 'custom', renderComponent: IsAvailableCheckBox, renderComponent: IsAvailableCheckBox }, type: { title: type, }, }, pager: { Loading @@ -237,4 +248,13 @@ export class WarehouseProductsComponent implements OnInit, OnDestroy { this._loadSettingsSmartTable(); }); } private _translate(key: string) { this.subscription = this._translateService .stream(key) .subscribe((res) => { this.suffix = res; }); return this.suffix; } } packages/admin-web-angular/src/app/@shared/warehouse/forms/basic-info/basic-info-form.component.ts +5 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ export type WarehouseBasicInfo = Pick< | 'carriersIds' | 'useOnlyRestrictedCarriersForDelivery' | 'preferRestrictedCarriersForDelivery' | 'ordersShortProcess' >; @Component({ Loading Loading @@ -84,6 +85,7 @@ export class BasicInfoFormComponent implements OnInit { hasRestrictedCarriers: [false, [Validators.required]], useOnlyRestrictedCarriersForDelivery: [false], preferRestrictedCarriersForDelivery: [false], ordersShortProcess: [false], carriersIds: [[]], }); } Loading @@ -103,6 +105,7 @@ export class BasicInfoFormComponent implements OnInit { carriersIds: string[]; useOnlyRestrictedCarriersForDelivery: boolean; preferRestrictedCarriersForDelivery: boolean; ordersShortProcess: boolean; }; if (!basicInfo.logo) { Loading Loading @@ -134,6 +137,7 @@ export class BasicInfoFormComponent implements OnInit { useOnlyRestrictedCarriersForDelivery: false, preferRestrictedCarriersForDelivery: false, }), ordersShortProcess: basicInfo.ordersShortProcess, }; } Loading @@ -144,6 +148,7 @@ export class BasicInfoFormComponent implements OnInit { { useOnlyRestrictedCarriersForDelivery: false, preferRestrictedCarriersForDelivery: false, ordersShortProcess: false, }, basicInfo ); Loading packages/admin-web-angular/src/app/@shared/warehouse/forms/payments-settings/payments-settings-form.component.html +9 −1 Original line number Diff line number Diff line <div class="col-sm-12"> <div class="row m-0"> <div class="form-group offset-md-2 col-md-8"> <div class="form-group offset-md-2 col-md-4"> <nb-checkbox [(ngModel)]="isPaymentEnabled"> {{ 'FAKE_DATA.SETUP_MERCHANTS.PAYMENTS.ALLOW_ONLINE_PAYMENT' Loading @@ -8,6 +8,14 @@ }} </nb-checkbox> </div> <div class="form-group offset-md-2 col-md-4"> <nb-checkbox [(ngModel)]="isCashPaymentEnabled"> {{ 'FAKE_DATA.SETUP_MERCHANTS.PAYMENTS.ALLOW_CASH_PAYMENT' | translate }} </nb-checkbox> </div> </div> <div [hidden]="!isPaymentEnabled" class="row m-0"> <div class="form-group offset-md-2 col-md-8"> Loading packages/admin-web-angular/src/app/@shared/warehouse/forms/payments-settings/payments-settings-form.component.ts +6 −0 Original line number Diff line number Diff line Loading @@ -19,17 +19,23 @@ export class PaymentsSettingsFormComponent { isEdit: boolean; isPaymentEnabled: boolean = false; isCashPaymentEnabled: boolean = true; get isPaymentValid() { return !this.isPaymentEnabled || this.paymentGateways.isValid; } get isCashPaymentValid() { return !this.isCashPaymentEnabled || this.paymentGateways.isValid; } get paymentsGateways(): IPaymentGatewayCreateObject[] { return this.paymentGateways.paymentsGateways; } setValue(merchant: Warehouse) { this.isPaymentEnabled = merchant.isPaymentEnabled; this.isCashPaymentEnabled = merchant.isCashPaymentEnabled; this.paymentGateways.setValue(merchant); } } Loading
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
packages/admin-web-angular/src/app/@shared/warehouse-product/forms/warehouse-products-table/warehouse-products-table.component.ts +25 −5 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ import { StoreProductPriceComponent } from '@app/@shared/render-component/store- import { StoreProductAmountComponent } from '@app/@shared/render-component/store-products-table/store-product-amount/store-product-amount.component'; import { ProductCategoriesComponent } from '@app/@shared/render-component/product-categories/product-categories'; import { ProductTitleRedirectComponent } from '@app/@shared/render-component/product-title-redirect/product-title-redirect.component'; import { Observable, forkJoin, Subject } from 'rxjs'; import { Observable, forkJoin, Subject, Subscription } from 'rxjs'; import { TranslateService } from '@ngx-translate/core'; import { takeUntil } from 'rxjs/operators'; import WarehouseProduct from '@modules/server.common/entities/WarehouseProduct'; Loading Loading @@ -55,6 +55,9 @@ export class WarehouseProductsComponent implements OnInit, OnDestroy { settingsSmartTable: object; sourceSmartTable = new LocalDataSource(); selectedProducts: WarehouseProductViewModel[] = []; columnTitlePrefix = 'WAREHOUSE_VIEW.PRODUCTS_TAB.'; subscription: Subscription; suffix: string; private ngDestroy$ = new Subject<void>(); private categoriesInfo: any = []; Loading @@ -78,6 +81,7 @@ export class WarehouseProductsComponent implements OnInit, OnDestroy { ngOnDestroy(): void { this.ngDestroy$.next(); this.ngDestroy$.complete(); this.subscription.unsubscribe(); } async loadDataSmartTable(products: WarehouseProduct[], storeId: string) { Loading Loading @@ -111,6 +115,9 @@ export class WarehouseProductsComponent implements OnInit, OnDestroy { }, price: product.price, qty: product.count, type: product.isTakeaway ? this._translate(`${this.columnTitlePrefix}TAKEAWAY`) : this._translate(`${this.columnTitlePrefix}DELIVERY`), storeId, product: product.product, allCategories: this.categoriesInfo, Loading @@ -134,9 +141,8 @@ export class WarehouseProductsComponent implements OnInit, OnDestroy { } private _loadSettingsSmartTable() { const columnTitlePrefix = 'WAREHOUSE_VIEW.PRODUCTS_TAB.'; const getTranslate = (name: string): Observable<any> => this._translateService.get(columnTitlePrefix + name); this._translateService.get(this.columnTitlePrefix + name); forkJoin( this._translateService.get('Id'), Loading @@ -147,7 +153,8 @@ export class WarehouseProductsComponent implements OnInit, OnDestroy { getTranslate('CATEGORY'), getTranslate('PRICE'), getTranslate('QUANTITY'), getTranslate('AVAILABILITY') getTranslate('AVAILABILITY'), getTranslate('TYPE') ) .pipe(takeUntil(this.ngDestroy$)) .subscribe( Loading @@ -161,6 +168,7 @@ export class WarehouseProductsComponent implements OnInit, OnDestroy { price, quantity, availability, type ]) => { this.settingsSmartTable = { mode: 'external', Loading Loading @@ -220,7 +228,10 @@ export class WarehouseProductsComponent implements OnInit, OnDestroy { isAvailable: { title: availability, type: 'custom', renderComponent: IsAvailableCheckBox, renderComponent: IsAvailableCheckBox }, type: { title: type, }, }, pager: { Loading @@ -237,4 +248,13 @@ export class WarehouseProductsComponent implements OnInit, OnDestroy { this._loadSettingsSmartTable(); }); } private _translate(key: string) { this.subscription = this._translateService .stream(key) .subscribe((res) => { this.suffix = res; }); return this.suffix; } }
packages/admin-web-angular/src/app/@shared/warehouse/forms/basic-info/basic-info-form.component.ts +5 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ export type WarehouseBasicInfo = Pick< | 'carriersIds' | 'useOnlyRestrictedCarriersForDelivery' | 'preferRestrictedCarriersForDelivery' | 'ordersShortProcess' >; @Component({ Loading Loading @@ -84,6 +85,7 @@ export class BasicInfoFormComponent implements OnInit { hasRestrictedCarriers: [false, [Validators.required]], useOnlyRestrictedCarriersForDelivery: [false], preferRestrictedCarriersForDelivery: [false], ordersShortProcess: [false], carriersIds: [[]], }); } Loading @@ -103,6 +105,7 @@ export class BasicInfoFormComponent implements OnInit { carriersIds: string[]; useOnlyRestrictedCarriersForDelivery: boolean; preferRestrictedCarriersForDelivery: boolean; ordersShortProcess: boolean; }; if (!basicInfo.logo) { Loading Loading @@ -134,6 +137,7 @@ export class BasicInfoFormComponent implements OnInit { useOnlyRestrictedCarriersForDelivery: false, preferRestrictedCarriersForDelivery: false, }), ordersShortProcess: basicInfo.ordersShortProcess, }; } Loading @@ -144,6 +148,7 @@ export class BasicInfoFormComponent implements OnInit { { useOnlyRestrictedCarriersForDelivery: false, preferRestrictedCarriersForDelivery: false, ordersShortProcess: false, }, basicInfo ); Loading
packages/admin-web-angular/src/app/@shared/warehouse/forms/payments-settings/payments-settings-form.component.html +9 −1 Original line number Diff line number Diff line <div class="col-sm-12"> <div class="row m-0"> <div class="form-group offset-md-2 col-md-8"> <div class="form-group offset-md-2 col-md-4"> <nb-checkbox [(ngModel)]="isPaymentEnabled"> {{ 'FAKE_DATA.SETUP_MERCHANTS.PAYMENTS.ALLOW_ONLINE_PAYMENT' Loading @@ -8,6 +8,14 @@ }} </nb-checkbox> </div> <div class="form-group offset-md-2 col-md-4"> <nb-checkbox [(ngModel)]="isCashPaymentEnabled"> {{ 'FAKE_DATA.SETUP_MERCHANTS.PAYMENTS.ALLOW_CASH_PAYMENT' | translate }} </nb-checkbox> </div> </div> <div [hidden]="!isPaymentEnabled" class="row m-0"> <div class="form-group offset-md-2 col-md-8"> Loading
packages/admin-web-angular/src/app/@shared/warehouse/forms/payments-settings/payments-settings-form.component.ts +6 −0 Original line number Diff line number Diff line Loading @@ -19,17 +19,23 @@ export class PaymentsSettingsFormComponent { isEdit: boolean; isPaymentEnabled: boolean = false; isCashPaymentEnabled: boolean = true; get isPaymentValid() { return !this.isPaymentEnabled || this.paymentGateways.isValid; } get isCashPaymentValid() { return !this.isCashPaymentEnabled || this.paymentGateways.isValid; } get paymentsGateways(): IPaymentGatewayCreateObject[] { return this.paymentGateways.paymentsGateways; } setValue(merchant: Warehouse) { this.isPaymentEnabled = merchant.isPaymentEnabled; this.isCashPaymentEnabled = merchant.isCashPaymentEnabled; this.paymentGateways.setValue(merchant); } }