Loading packages/admin-web-angular/src/app/@shared/warehouse/+warehouse-order-modal/make-order-comment.component.ts 0 → 100644 +34 −0 Original line number Diff line number Diff line import { Component, EventEmitter, Input, Output } from '@angular/core'; import { ViewCell } from 'ng2-smart-table'; @Component({ styles: [ ` .order-comment-wrapper textarea { width: 100%; } `, ], template: ` <div class="order-comment-wrapper"> <textarea (blur)="setComment($event)"></textarea> </div> `, }) export class MakeOrderCommentComponent implements ViewCell { @Input() value; @Input() rowData: any; @Output() comment = new EventEmitter<string>(); get productId(): string { return this.value.productId; } setComment(e) { this.comment.emit(e.target.value); } } packages/admin-web-angular/src/app/@shared/warehouse/+warehouse-order-modal/warehouse-order-modal.component.ts +30 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ import { ProductLocalesService } from '@modules/client.common.angular2/locale/pr import { ILocaleMember } from '@modules/server.common/interfaces/ILocale'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { takeUntil } from 'rxjs/operators'; import { MakeOrderCommentComponent } from './make-order-comment.component'; @Component({ selector: 'ea-warehouse-order-modal', Loading Loading @@ -78,6 +79,7 @@ export class WarehouseOrderModalComponent implements OnInit, OnDestroy { PRICE: `${basePrefix}.${smartTableTitlesPrefix}.PRICE`, AVAILABLE: `${basePrefix}.${smartTableTitlesPrefix}.AVAILABLE`, AMOUNT: `${basePrefix}.${smartTableTitlesPrefix}.AMOUNT`, COMMENT: `${basePrefix}.${smartTableTitlesPrefix}.COMMENT`, }, }, }; Loading Loading @@ -141,6 +143,7 @@ export class WarehouseOrderModalComponent implements OnInit, OnDestroy { return { productId: wp.productId, count: 0, comment: '', }; } ); Loading @@ -149,7 +152,7 @@ export class WarehouseOrderModalComponent implements OnInit, OnDestroy { (wp: WarehouseProduct) => { return { img: ` <img src="${this._getTranslate(wp.product['images'])}" height="68px"/> <img src="${this._getTranslate(wp.product['images'])}" height="50px"/> `, product: ` <span class="float-left">${this._getTranslate(wp.product['title'])}</span> Loading @@ -159,6 +162,7 @@ export class WarehouseOrderModalComponent implements OnInit, OnDestroy { <div class="badge badge-pill badge-secondary">${wp.count}</div> `, amount: { productId: wp.productId, available: wp.count }, comment: { productId: wp.productId }, }; } ); Loading Loading @@ -214,6 +218,10 @@ export class WarehouseOrderModalComponent implements OnInit, OnDestroy { this.TRANSLATE_PREFIXES.SMART_TABLE.TITLES.AMOUNT ); const comment = this._translate( this.TRANSLATE_PREFIXES.SMART_TABLE.TITLES.COMMENT ); this.settingsSmartTable = { actions: false, pager: { perPage: 5 }, Loading Loading @@ -270,6 +278,27 @@ export class WarehouseOrderModalComponent implements OnInit, OnDestroy { }); }, }, comment: { title: comment, filter: false, type: 'custom', renderComponent: MakeOrderCommentComponent, onComponentInitFunction: ( childInstance: MakeOrderCommentComponent ) => { childInstance.comment .pipe(takeUntil(this._ngDestroy$)) .subscribe((comment) => { const wProduct = this._orderProducts.find( ({ productId }) => productId === childInstance.productId ); wProduct.comment = comment; }); }, }, }, }; } Loading packages/admin-web-angular/src/app/@shared/warehouse/+warehouse-order-modal/warehouse-order-modal.module.ts +11 −2 Original line number Diff line number Diff line Loading @@ -6,8 +6,13 @@ import { WarehouseOrderModalComponent } from './warehouse-order-modal.component' import { WarehouseOrderInputComponent } from './warehouse-order-input.component'; import { TranslateModule } from '@ngx-translate/core'; import { NbSpinnerModule, NbButtonModule } from '@nebular/theme'; import { MakeOrderCommentComponent } from './make-order-comment.component'; const COMPONENTS = [WarehouseOrderModalComponent, WarehouseOrderInputComponent]; const COMPONENTS = [ WarehouseOrderModalComponent, WarehouseOrderInputComponent, MakeOrderCommentComponent, ]; @NgModule({ imports: [ Loading @@ -19,7 +24,11 @@ const COMPONENTS = [WarehouseOrderModalComponent, WarehouseOrderInputComponent]; TranslateModule.forChild(), NbButtonModule, ], declarations: [WarehouseOrderModalComponent, WarehouseOrderInputComponent], declarations: [ WarehouseOrderModalComponent, WarehouseOrderInputComponent, MakeOrderCommentComponent, ], entryComponents: COMPONENTS, exports: COMPONENTS, }) Loading packages/admin-web-angular/src/app/pages/+warehouses/+warehouse/warehouse.component.ts +1 −1 Original line number Diff line number Diff line Loading @@ -95,7 +95,7 @@ export class WarehouseComponent implements OnDestroy, AfterViewInit, OnChanges { const modalRef: NgbModalRef = this.modalService.open( WarehouseOrderComponent, { size: 'lg', size: 'xl', container: 'nb-layout', windowClass: 'ng-custom', backdrop: 'static', Loading packages/admin-web-angular/src/assets/i18n/bg-BG.json +2 −1 Original line number Diff line number Diff line Loading @@ -981,7 +981,8 @@ "PRODUCT": "Продукт", "PRICE": "Цена", "AVAILABLE": "Налично", "AMOUNT": "Количество" "AMOUNT": "Количество", "COMMENT": "Коментар" } } } Loading Loading
packages/admin-web-angular/src/app/@shared/warehouse/+warehouse-order-modal/make-order-comment.component.ts 0 → 100644 +34 −0 Original line number Diff line number Diff line import { Component, EventEmitter, Input, Output } from '@angular/core'; import { ViewCell } from 'ng2-smart-table'; @Component({ styles: [ ` .order-comment-wrapper textarea { width: 100%; } `, ], template: ` <div class="order-comment-wrapper"> <textarea (blur)="setComment($event)"></textarea> </div> `, }) export class MakeOrderCommentComponent implements ViewCell { @Input() value; @Input() rowData: any; @Output() comment = new EventEmitter<string>(); get productId(): string { return this.value.productId; } setComment(e) { this.comment.emit(e.target.value); } }
packages/admin-web-angular/src/app/@shared/warehouse/+warehouse-order-modal/warehouse-order-modal.component.ts +30 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ import { ProductLocalesService } from '@modules/client.common.angular2/locale/pr import { ILocaleMember } from '@modules/server.common/interfaces/ILocale'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { takeUntil } from 'rxjs/operators'; import { MakeOrderCommentComponent } from './make-order-comment.component'; @Component({ selector: 'ea-warehouse-order-modal', Loading Loading @@ -78,6 +79,7 @@ export class WarehouseOrderModalComponent implements OnInit, OnDestroy { PRICE: `${basePrefix}.${smartTableTitlesPrefix}.PRICE`, AVAILABLE: `${basePrefix}.${smartTableTitlesPrefix}.AVAILABLE`, AMOUNT: `${basePrefix}.${smartTableTitlesPrefix}.AMOUNT`, COMMENT: `${basePrefix}.${smartTableTitlesPrefix}.COMMENT`, }, }, }; Loading Loading @@ -141,6 +143,7 @@ export class WarehouseOrderModalComponent implements OnInit, OnDestroy { return { productId: wp.productId, count: 0, comment: '', }; } ); Loading @@ -149,7 +152,7 @@ export class WarehouseOrderModalComponent implements OnInit, OnDestroy { (wp: WarehouseProduct) => { return { img: ` <img src="${this._getTranslate(wp.product['images'])}" height="68px"/> <img src="${this._getTranslate(wp.product['images'])}" height="50px"/> `, product: ` <span class="float-left">${this._getTranslate(wp.product['title'])}</span> Loading @@ -159,6 +162,7 @@ export class WarehouseOrderModalComponent implements OnInit, OnDestroy { <div class="badge badge-pill badge-secondary">${wp.count}</div> `, amount: { productId: wp.productId, available: wp.count }, comment: { productId: wp.productId }, }; } ); Loading Loading @@ -214,6 +218,10 @@ export class WarehouseOrderModalComponent implements OnInit, OnDestroy { this.TRANSLATE_PREFIXES.SMART_TABLE.TITLES.AMOUNT ); const comment = this._translate( this.TRANSLATE_PREFIXES.SMART_TABLE.TITLES.COMMENT ); this.settingsSmartTable = { actions: false, pager: { perPage: 5 }, Loading Loading @@ -270,6 +278,27 @@ export class WarehouseOrderModalComponent implements OnInit, OnDestroy { }); }, }, comment: { title: comment, filter: false, type: 'custom', renderComponent: MakeOrderCommentComponent, onComponentInitFunction: ( childInstance: MakeOrderCommentComponent ) => { childInstance.comment .pipe(takeUntil(this._ngDestroy$)) .subscribe((comment) => { const wProduct = this._orderProducts.find( ({ productId }) => productId === childInstance.productId ); wProduct.comment = comment; }); }, }, }, }; } Loading
packages/admin-web-angular/src/app/@shared/warehouse/+warehouse-order-modal/warehouse-order-modal.module.ts +11 −2 Original line number Diff line number Diff line Loading @@ -6,8 +6,13 @@ import { WarehouseOrderModalComponent } from './warehouse-order-modal.component' import { WarehouseOrderInputComponent } from './warehouse-order-input.component'; import { TranslateModule } from '@ngx-translate/core'; import { NbSpinnerModule, NbButtonModule } from '@nebular/theme'; import { MakeOrderCommentComponent } from './make-order-comment.component'; const COMPONENTS = [WarehouseOrderModalComponent, WarehouseOrderInputComponent]; const COMPONENTS = [ WarehouseOrderModalComponent, WarehouseOrderInputComponent, MakeOrderCommentComponent, ]; @NgModule({ imports: [ Loading @@ -19,7 +24,11 @@ const COMPONENTS = [WarehouseOrderModalComponent, WarehouseOrderInputComponent]; TranslateModule.forChild(), NbButtonModule, ], declarations: [WarehouseOrderModalComponent, WarehouseOrderInputComponent], declarations: [ WarehouseOrderModalComponent, WarehouseOrderInputComponent, MakeOrderCommentComponent, ], entryComponents: COMPONENTS, exports: COMPONENTS, }) Loading
packages/admin-web-angular/src/app/pages/+warehouses/+warehouse/warehouse.component.ts +1 −1 Original line number Diff line number Diff line Loading @@ -95,7 +95,7 @@ export class WarehouseComponent implements OnDestroy, AfterViewInit, OnChanges { const modalRef: NgbModalRef = this.modalService.open( WarehouseOrderComponent, { size: 'lg', size: 'xl', container: 'nb-layout', windowClass: 'ng-custom', backdrop: 'static', Loading
packages/admin-web-angular/src/assets/i18n/bg-BG.json +2 −1 Original line number Diff line number Diff line Loading @@ -981,7 +981,8 @@ "PRODUCT": "Продукт", "PRICE": "Цена", "AVAILABLE": "Налично", "AMOUNT": "Количество" "AMOUNT": "Количество", "COMMENT": "Коментар" } } } Loading