techlify-inventory-common 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +13 -0
- package/README.md +27 -0
- package/angular.json +207 -0
- package/e2e/protractor.conf.js +28 -0
- package/e2e/src/app.e2e-spec.ts +14 -0
- package/e2e/src/app.po.ts +11 -0
- package/e2e/tsconfig.e2e.json +13 -0
- package/ng-package.json +6 -0
- package/package.json +92 -0
- package/projects/inventory-common/README.md +24 -0
- package/projects/inventory-common/ng-package.json +7 -0
- package/projects/inventory-common/package.json +12 -0
- package/projects/inventory-common/src/lib/inventory-common/category/category-form/category-form.component.html +41 -0
- package/projects/inventory-common/src/lib/inventory-common/category/category-form/category-form.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/category/category-form/category-form.component.ts +75 -0
- package/projects/inventory-common/src/lib/inventory-common/category/category-form-button/category-form-button.component.html +32 -0
- package/projects/inventory-common/src/lib/inventory-common/category/category-form-button/category-form-button.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/category/category-form-button/category-form-button.component.ts +29 -0
- package/projects/inventory-common/src/lib/inventory-common/category/category-list-page/category-list-page.component.html +79 -0
- package/projects/inventory-common/src/lib/inventory-common/category/category-list-page/category-list-page.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/category/category-list-page/category-list-page.component.ts +61 -0
- package/projects/inventory-common/src/lib/inventory-common/category/category-routing.module.ts +16 -0
- package/projects/inventory-common/src/lib/inventory-common/category/category.module.ts +36 -0
- package/projects/inventory-common/src/lib/inventory-common/category/category.service.ts +11 -0
- package/projects/inventory-common/src/lib/inventory-common/inventory-common-routing.module.ts +65 -0
- package/projects/inventory-common/src/lib/inventory-common/inventory-common.module.ts +24 -0
- package/projects/inventory-common/src/lib/inventory-common/inventory-dashboard-page/inventory-dashboard-page.component.html +88 -0
- package/projects/inventory-common/src/lib/inventory-common/inventory-dashboard-page/inventory-dashboard-page.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/inventory-dashboard-page/inventory-dashboard-page.component.ts +36 -0
- package/projects/inventory-common/src/lib/inventory-common/inventory-value-report.service.ts +19 -0
- package/projects/inventory-common/src/lib/inventory-common/low-stock-report.service.ts +19 -0
- package/projects/inventory-common/src/lib/inventory-common/material.module.ts +95 -0
- package/projects/inventory-common/src/lib/inventory-common/measure/measure-delete/measure-delete-button/measure-delete-button.component.html +37 -0
- package/projects/inventory-common/src/lib/inventory-common/measure/measure-delete/measure-delete-button/measure-delete-button.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/measure/measure-delete/measure-delete-button/measure-delete-button.component.ts +44 -0
- package/projects/inventory-common/src/lib/inventory-common/measure/measure-delete/measure-delete.module.ts +11 -0
- package/projects/inventory-common/src/lib/inventory-common/measure/measure-form/measure-form/measure-form.component.html +66 -0
- package/projects/inventory-common/src/lib/inventory-common/measure/measure-form/measure-form/measure-form.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/measure/measure-form/measure-form/measure-form.component.ts +78 -0
- package/projects/inventory-common/src/lib/inventory-common/measure/measure-form/measure-form-button/measure-form-button.component.html +16 -0
- package/projects/inventory-common/src/lib/inventory-common/measure/measure-form/measure-form-button/measure-form-button.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/measure/measure-form/measure-form-button/measure-form-button.component.ts +29 -0
- package/projects/inventory-common/src/lib/inventory-common/measure/measure-form/measure-form.module.ts +13 -0
- package/projects/inventory-common/src/lib/inventory-common/measure/measure-routing.module.ts +16 -0
- package/projects/inventory-common/src/lib/inventory-common/measure/measure.module.ts +26 -0
- package/projects/inventory-common/src/lib/inventory-common/measure/measure.service.ts +11 -0
- package/projects/inventory-common/src/lib/inventory-common/measure/measures-list/measures-list.component.html +88 -0
- package/projects/inventory-common/src/lib/inventory-common/measure/measures-list/measures-list.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/measure/measures-list/measures-list.component.ts +67 -0
- package/projects/inventory-common/src/lib/inventory-common/product/low-stock-products-widget/low-stock-products-widget.component.html +52 -0
- package/projects/inventory-common/src/lib/inventory-common/product/low-stock-products-widget/low-stock-products-widget.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/product/low-stock-products-widget/low-stock-products-widget.component.ts +42 -0
- package/projects/inventory-common/src/lib/inventory-common/product/low-stock-products-widget/low-stock-products-widget.module.ts +20 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-basic-info/product-basic-info.component.html +114 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-basic-info/product-basic-info.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-basic-info/product-basic-info.component.ts +43 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-delete-button/product-delete-button.component.html +33 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-delete-button/product-delete-button.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-delete-button/product-delete-button.component.ts +53 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-form/product-form.component.html +209 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-form/product-form.component.spec.ts +24 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-form/product-form.component.ts +182 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-form-button/product-form-button.component.html +17 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-form-button/product-form-button.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-form-button/product-form-button.component.ts +39 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-form.service.ts +11 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-import-page/product-import-page.component.html +1 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-import-page/product-import-page.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-import-page/product-import-page.component.ts +66 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-list/product-list.component.html +254 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-list/product-list.component.spec.ts +24 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-list/product-list.component.ts +171 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-measure-form/product-measure-form.component.html +44 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-measure-form/product-measure-form.component.spec.ts +24 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-measure-form/product-measure-form.component.ts +93 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-measures-list/product-measures-list.component.html +90 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-measures-list/product-measures-list.component.spec.ts +24 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-measures-list/product-measures-list.component.ts +153 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-nav-bar/product-nav-bar.component.html +3 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-nav-bar/product-nav-bar.component.spec.ts +24 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-nav-bar/product-nav-bar.component.ts +7 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-quick-search/product-quick-search.component.html +110 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-quick-search/product-quick-search.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-quick-search/product-quick-search.component.ts +102 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-routing.module.ts +49 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-search/product-search.component.html +78 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-search/product-search.component.scss +12 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-search/product-search.component.ts +153 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-search/product-search.module.ts +22 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-summary-chart/product-summary-chart.component.html +11 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-summary-chart/product-summary-chart.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-summary-chart/product-summary-chart.component.ts +62 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-summary-chart/product-summary-chart.module.ts +15 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-summary-widget/product-summary-widget.component.html +9 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-summary-widget/product-summary-widget.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-summary-widget/product-summary-widget.component.ts +39 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-tax/product-tax-delete-button/product-tax-delete-button.component.html +32 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-tax/product-tax-delete-button/product-tax-delete-button.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-tax/product-tax-delete-button/product-tax-delete-button.component.ts +55 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-tax/product-tax-form-button/product-tax-form-button.component.html +49 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-tax/product-tax-form-button/product-tax-form-button.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-tax/product-tax-form-button/product-tax-form-button.component.ts +87 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-tax/product-tax-list/product-tax-list.component.html +48 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-tax/product-tax-list/product-tax-list.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-tax/product-tax-list/product-tax-list.component.ts +33 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-tax/product-tax.module.ts +23 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-tax/product-tax.service.ts +11 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-view-page/product-view-page.component.html +34 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product-view-page/product-view-page.component.ts +63 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product.module.ts +69 -0
- package/projects/inventory-common/src/lib/inventory-common/product/product.service.ts +54 -0
- package/projects/inventory-common/src/lib/inventory-common/product/widgets/product-category-badges/product-category-badges.component.html +8 -0
- package/projects/inventory-common/src/lib/inventory-common/product/widgets/product-category-badges/product-category-badges.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/product/widgets/product-category-badges/product-category-badges.component.ts +16 -0
- package/projects/inventory-common/src/lib/inventory-common/reports/inventory-value-report/inventory-value-report.component.html +140 -0
- package/projects/inventory-common/src/lib/inventory-common/reports/inventory-value-report/inventory-value-report.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/reports/inventory-value-report/inventory-value-report.component.ts +191 -0
- package/projects/inventory-common/src/lib/inventory-common/reports/low-stock-report/low-stock-report.component.html +158 -0
- package/projects/inventory-common/src/lib/inventory-common/reports/low-stock-report/low-stock-report.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/reports/low-stock-report/low-stock-report.component.ts +191 -0
- package/projects/inventory-common/src/lib/inventory-common/services/techlify-form-service.ts +14 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issuance-delete-button/stock-issuance-delete-button.component.html +32 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issuance-delete-button/stock-issuance-delete-button.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issuance-delete-button/stock-issuance-delete-button.component.ts +49 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issuance-delete-button/stock-issuance-delete-button.module.ts +11 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issuance.service.ts +11 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issuances-list/stock-issuances-list.component.html +165 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issuances-list/stock-issuances-list.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issuances-list/stock-issuances-list.component.ts +113 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issuances-list/stock-issuances-list.module.ts +26 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issuances-routing.module.ts +16 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issuances.module.ts +36 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issue-form/stock-issue-form/stock-issue-form.component.html +64 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issue-form/stock-issue-form/stock-issue-form.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issue-form/stock-issue-form/stock-issue-form.component.ts +115 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issue-form/stock-issue-form-button/stock-issue-form-button.component.html +20 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issue-form/stock-issue-form-button/stock-issue-form-button.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issue-form/stock-issue-form-button/stock-issue-form-button.component.ts +35 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-issuances/stock-issue-form/stock-issue-form.module.ts +29 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipt-delete-button/stock-receipt-delete-button.component.html +32 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipt-delete-button/stock-receipt-delete-button.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipt-delete-button/stock-receipt-delete-button.component.ts +49 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form/stock-receipt-form.component.html +74 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form/stock-receipt-form.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form/stock-receipt-form.component.ts +122 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form-button/stock-receipt-form-button.component.html +18 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form-button/stock-receipt-form-button.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form-button/stock-receipt-form-button.component.ts +33 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form.module.ts +29 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipt.service.ts +11 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipts-list-page/stock-receipts-list-page.component.html +139 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipts-list-page/stock-receipts-list-page.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipts-list-page/stock-receipts-list-page.component.ts +109 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipts-routing.module.ts +16 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-receipts/stock-receipts.module.ts +45 -0
- package/projects/inventory-common/src/lib/inventory-common/stock-summary.service.ts +18 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/payee-selector/payee-selector/payee-selector.component.html +22 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/payee-selector/payee-selector/payee-selector.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/payee-selector/payee-selector/payee-selector.component.ts +44 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/payee-selector/payee-selector.module.ts +19 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier-delete-button/supplier-delete-button.component.css +0 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier-delete-button/supplier-delete-button.component.html +3 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier-delete-button/supplier-delete-button.component.spec.ts +28 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier-delete-button/supplier-delete-button.component.ts +56 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier-form/supplier-form-button/supplier-form-button.component.css +0 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier-form/supplier-form-button/supplier-form-button.component.html +3 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier-form/supplier-form-button/supplier-form-button.component.spec.ts +28 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier-form/supplier-form-button/supplier-form-button.component.ts +40 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier-form/supplier-form.component.html +100 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier-form/supplier-form.component.ts +116 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier-form/supplier-form.service.ts +11 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier-information/supplier-information.component.html +67 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier-information/supplier-information.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier-information/supplier-information.component.ts +68 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier-routing.module.ts +32 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier-type.service.ts +17 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier-view/supplier-view.component.html +60 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier-view/supplier-view.component.ts +58 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier.component.html +3 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier.component.ts +16 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier.module.ts +46 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/supplier.service.ts +57 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/suppliers-list/suppliers-list.component.html +98 -0
- package/projects/inventory-common/src/lib/inventory-common/supplier/suppliers-list/suppliers-list.component.ts +126 -0
- package/projects/inventory-common/src/lib/inventory-common/techlify-filter/techlify-filter.component.html +442 -0
- package/projects/inventory-common/src/lib/inventory-common/techlify-filter/techlify-filter.component.scss +0 -0
- package/projects/inventory-common/src/lib/inventory-common/techlify-filter/techlify-filter.component.ts +109 -0
- package/projects/inventory-common/src/lib/inventory-common/techlify-filter/techlify-filter.module.ts +24 -0
- package/projects/inventory-common/src/public-api.ts +10 -0
- package/projects/inventory-common/tsconfig.lib.json +17 -0
- package/projects/inventory-common/tsconfig.lib.prod.json +13 -0
- package/projects/inventory-common/tsconfig.spec.json +17 -0
- package/public_api.ts +23 -0
- package/releases/techlify-ng-users-0.0.4.tgz +0 -0
- package/releases/techlify-ng-users-0.0.5.tgz +0 -0
- package/src/.htaccess +19 -0
- package/src/app/@modules/@shared/print-button/print-button/print-button.component.html +3 -0
- package/src/app/@modules/@shared/print-button/print-button/print-button.component.scss +0 -0
- package/src/app/@modules/@shared/print-button/print-button/print-button.component.ts +11 -0
- package/src/app/@modules/@shared/print-button/print-button.module.ts +11 -0
- package/src/app/@modules/@shared/print-button/print.service.ts +38 -0
- package/src/app/@modules/@shared/techlify-form-service.ts +14 -0
- package/src/app/@modules/@shared/user-menu/user-menu.component.html +26 -0
- package/src/app/@modules/@shared/user-menu/user-menu.component.spec.ts +23 -0
- package/src/app/@modules/@shared/user-menu/user-menu.component.ts +46 -0
- package/src/app/@modules/@shared/user-menu/user-menu.module.ts +20 -0
- package/src/app/@modules/administration/administration-routing.module.ts +44 -0
- package/src/app/@modules/administration/administration.component.html +3 -0
- package/src/app/@modules/administration/administration.component.ts +11 -0
- package/src/app/@modules/administration/administration.module.ts +18 -0
- package/src/app/@modules/administration/administration.service.ts +33 -0
- package/src/app/@modules/auth/auth-routing.module.ts +17 -0
- package/src/app/@modules/auth/auth.module.ts +12 -0
- package/src/app/@modules/auth/login/login.component.html +302 -0
- package/src/app/@modules/auth/login/login.component.scss +43 -0
- package/src/app/@modules/auth/login/login.component.ts +57 -0
- package/src/app/@modules/inventory-common/category/category-form/category-form.component.html +41 -0
- package/src/app/@modules/inventory-common/category/category-form/category-form.component.scss +0 -0
- package/src/app/@modules/inventory-common/category/category-form/category-form.component.ts +75 -0
- package/src/app/@modules/inventory-common/category/category-form-button/category-form-button.component.html +32 -0
- package/src/app/@modules/inventory-common/category/category-form-button/category-form-button.component.scss +0 -0
- package/src/app/@modules/inventory-common/category/category-form-button/category-form-button.component.ts +29 -0
- package/src/app/@modules/inventory-common/category/category-list-page/category-list-page.component.html +79 -0
- package/src/app/@modules/inventory-common/category/category-list-page/category-list-page.component.scss +0 -0
- package/src/app/@modules/inventory-common/category/category-list-page/category-list-page.component.ts +61 -0
- package/src/app/@modules/inventory-common/category/category-routing.module.ts +16 -0
- package/src/app/@modules/inventory-common/category/category.module.ts +36 -0
- package/src/app/@modules/inventory-common/category/category.service.ts +11 -0
- package/src/app/@modules/inventory-common/inventory-common-routing.module.ts +55 -0
- package/src/app/@modules/inventory-common/inventory-common.module.ts +20 -0
- package/src/app/@modules/inventory-common/inventory-dashboard-page/inventory-dashboard-page.component.html +88 -0
- package/src/app/@modules/inventory-common/inventory-dashboard-page/inventory-dashboard-page.component.scss +0 -0
- package/src/app/@modules/inventory-common/inventory-dashboard-page/inventory-dashboard-page.component.ts +35 -0
- package/src/app/@modules/inventory-common/measure/measure-delete/measure-delete-button/measure-delete-button.component.html +37 -0
- package/src/app/@modules/inventory-common/measure/measure-delete/measure-delete-button/measure-delete-button.component.scss +0 -0
- package/src/app/@modules/inventory-common/measure/measure-delete/measure-delete-button/measure-delete-button.component.ts +44 -0
- package/src/app/@modules/inventory-common/measure/measure-delete/measure-delete.module.ts +11 -0
- package/src/app/@modules/inventory-common/measure/measure-form/measure-form/measure-form.component.html +66 -0
- package/src/app/@modules/inventory-common/measure/measure-form/measure-form/measure-form.component.scss +0 -0
- package/src/app/@modules/inventory-common/measure/measure-form/measure-form/measure-form.component.ts +78 -0
- package/src/app/@modules/inventory-common/measure/measure-form/measure-form-button/measure-form-button.component.html +16 -0
- package/src/app/@modules/inventory-common/measure/measure-form/measure-form-button/measure-form-button.component.scss +0 -0
- package/src/app/@modules/inventory-common/measure/measure-form/measure-form-button/measure-form-button.component.ts +29 -0
- package/src/app/@modules/inventory-common/measure/measure-form/measure-form.module.ts +13 -0
- package/src/app/@modules/inventory-common/measure/measure-routing.module.ts +16 -0
- package/src/app/@modules/inventory-common/measure/measure.module.ts +26 -0
- package/src/app/@modules/inventory-common/measure/measure.service.ts +11 -0
- package/src/app/@modules/inventory-common/measure/measures-list/measures-list.component.html +88 -0
- package/src/app/@modules/inventory-common/measure/measures-list/measures-list.component.scss +0 -0
- package/src/app/@modules/inventory-common/measure/measures-list/measures-list.component.ts +67 -0
- package/src/app/@modules/inventory-common/product/low-stock-products-widget/low-stock-products-widget.component.html +52 -0
- package/src/app/@modules/inventory-common/product/low-stock-products-widget/low-stock-products-widget.component.scss +0 -0
- package/src/app/@modules/inventory-common/product/low-stock-products-widget/low-stock-products-widget.component.ts +42 -0
- package/src/app/@modules/inventory-common/product/low-stock-products-widget/low-stock-products-widget.module.ts +20 -0
- package/src/app/@modules/inventory-common/product/product-basic-info/product-basic-info.component.html +114 -0
- package/src/app/@modules/inventory-common/product/product-basic-info/product-basic-info.component.scss +0 -0
- package/src/app/@modules/inventory-common/product/product-basic-info/product-basic-info.component.ts +43 -0
- package/src/app/@modules/inventory-common/product/product-delete-button/product-delete-button.component.html +33 -0
- package/src/app/@modules/inventory-common/product/product-delete-button/product-delete-button.component.scss +0 -0
- package/src/app/@modules/inventory-common/product/product-delete-button/product-delete-button.component.ts +53 -0
- package/src/app/@modules/inventory-common/product/product-form/product-form.component.html +209 -0
- package/src/app/@modules/inventory-common/product/product-form/product-form.component.spec.ts +24 -0
- package/src/app/@modules/inventory-common/product/product-form/product-form.component.ts +182 -0
- package/src/app/@modules/inventory-common/product/product-form-button/product-form-button.component.html +17 -0
- package/src/app/@modules/inventory-common/product/product-form-button/product-form-button.component.scss +0 -0
- package/src/app/@modules/inventory-common/product/product-form-button/product-form-button.component.ts +39 -0
- package/src/app/@modules/inventory-common/product/product-form.service.ts +11 -0
- package/src/app/@modules/inventory-common/product/product-import-page/product-import-page.component.html +1 -0
- package/src/app/@modules/inventory-common/product/product-import-page/product-import-page.component.scss +0 -0
- package/src/app/@modules/inventory-common/product/product-import-page/product-import-page.component.ts +66 -0
- package/src/app/@modules/inventory-common/product/product-list/product-list.component.html +229 -0
- package/src/app/@modules/inventory-common/product/product-list/product-list.component.spec.ts +24 -0
- package/src/app/@modules/inventory-common/product/product-list/product-list.component.ts +176 -0
- package/src/app/@modules/inventory-common/product/product-measure-form/product-measure-form.component.html +44 -0
- package/src/app/@modules/inventory-common/product/product-measure-form/product-measure-form.component.spec.ts +24 -0
- package/src/app/@modules/inventory-common/product/product-measure-form/product-measure-form.component.ts +93 -0
- package/src/app/@modules/inventory-common/product/product-measures-list/product-measures-list.component.html +90 -0
- package/src/app/@modules/inventory-common/product/product-measures-list/product-measures-list.component.spec.ts +24 -0
- package/src/app/@modules/inventory-common/product/product-measures-list/product-measures-list.component.ts +153 -0
- package/src/app/@modules/inventory-common/product/product-nav-bar/product-nav-bar.component.html +3 -0
- package/src/app/@modules/inventory-common/product/product-nav-bar/product-nav-bar.component.spec.ts +24 -0
- package/src/app/@modules/inventory-common/product/product-nav-bar/product-nav-bar.component.ts +7 -0
- package/src/app/@modules/inventory-common/product/product-routing.module.ts +49 -0
- package/src/app/@modules/inventory-common/product/product-search/product-search.component.html +78 -0
- package/src/app/@modules/inventory-common/product/product-search/product-search.component.scss +12 -0
- package/src/app/@modules/inventory-common/product/product-search/product-search.component.ts +153 -0
- package/src/app/@modules/inventory-common/product/product-search/product-search.module.ts +22 -0
- package/src/app/@modules/inventory-common/product/product-summary-chart/product-summary-chart.component.html +17 -0
- package/src/app/@modules/inventory-common/product/product-summary-chart/product-summary-chart.component.scss +0 -0
- package/src/app/@modules/inventory-common/product/product-summary-chart/product-summary-chart.component.ts +45 -0
- package/src/app/@modules/inventory-common/product/product-summary-chart/product-summary-chart.module.ts +18 -0
- package/src/app/@modules/inventory-common/product/product-tax/product-tax-delete-button/product-tax-delete-button.component.html +32 -0
- package/src/app/@modules/inventory-common/product/product-tax/product-tax-delete-button/product-tax-delete-button.component.scss +0 -0
- package/src/app/@modules/inventory-common/product/product-tax/product-tax-delete-button/product-tax-delete-button.component.ts +55 -0
- package/src/app/@modules/inventory-common/product/product-tax/product-tax-form-button/product-tax-form-button.component.html +49 -0
- package/src/app/@modules/inventory-common/product/product-tax/product-tax-form-button/product-tax-form-button.component.scss +0 -0
- package/src/app/@modules/inventory-common/product/product-tax/product-tax-form-button/product-tax-form-button.component.ts +87 -0
- package/src/app/@modules/inventory-common/product/product-tax/product-tax-list/product-tax-list.component.html +48 -0
- package/src/app/@modules/inventory-common/product/product-tax/product-tax-list/product-tax-list.component.scss +0 -0
- package/src/app/@modules/inventory-common/product/product-tax/product-tax-list/product-tax-list.component.ts +33 -0
- package/src/app/@modules/inventory-common/product/product-tax/product-tax.module.ts +23 -0
- package/src/app/@modules/inventory-common/product/product-tax/product-tax.service.ts +11 -0
- package/src/app/@modules/inventory-common/product/product-view-page/product-view-page.component.html +34 -0
- package/src/app/@modules/inventory-common/product/product-view-page/product-view-page.component.ts +63 -0
- package/src/app/@modules/inventory-common/product/product.module.ts +67 -0
- package/src/app/@modules/inventory-common/product/product.service.ts +54 -0
- package/src/app/@modules/inventory-common/stock-issuances/stock-issuance-delete-button/stock-issuance-delete-button.component.html +32 -0
- package/src/app/@modules/inventory-common/stock-issuances/stock-issuance-delete-button/stock-issuance-delete-button.component.scss +0 -0
- package/src/app/@modules/inventory-common/stock-issuances/stock-issuance-delete-button/stock-issuance-delete-button.component.ts +49 -0
- package/src/app/@modules/inventory-common/stock-issuances/stock-issuance-delete-button/stock-issuance-delete-button.module.ts +11 -0
- package/src/app/@modules/inventory-common/stock-issuances/stock-issuance.service.ts +11 -0
- package/src/app/@modules/inventory-common/stock-issuances/stock-issuances-list/stock-issuances-list.component.html +165 -0
- package/src/app/@modules/inventory-common/stock-issuances/stock-issuances-list/stock-issuances-list.component.scss +0 -0
- package/src/app/@modules/inventory-common/stock-issuances/stock-issuances-list/stock-issuances-list.component.ts +113 -0
- package/src/app/@modules/inventory-common/stock-issuances/stock-issuances-list/stock-issuances-list.module.ts +26 -0
- package/src/app/@modules/inventory-common/stock-issuances/stock-issuances-routing.module.ts +16 -0
- package/src/app/@modules/inventory-common/stock-issuances/stock-issuances.module.ts +36 -0
- package/src/app/@modules/inventory-common/stock-issuances/stock-issue-form/stock-issue-form/stock-issue-form.component.html +64 -0
- package/src/app/@modules/inventory-common/stock-issuances/stock-issue-form/stock-issue-form/stock-issue-form.component.scss +0 -0
- package/src/app/@modules/inventory-common/stock-issuances/stock-issue-form/stock-issue-form/stock-issue-form.component.ts +115 -0
- package/src/app/@modules/inventory-common/stock-issuances/stock-issue-form/stock-issue-form-button/stock-issue-form-button.component.html +20 -0
- package/src/app/@modules/inventory-common/stock-issuances/stock-issue-form/stock-issue-form-button/stock-issue-form-button.component.scss +0 -0
- package/src/app/@modules/inventory-common/stock-issuances/stock-issue-form/stock-issue-form-button/stock-issue-form-button.component.ts +35 -0
- package/src/app/@modules/inventory-common/stock-issuances/stock-issue-form/stock-issue-form.module.ts +29 -0
- package/src/app/@modules/inventory-common/stock-receipts/stock-receipt-delete-button/stock-receipt-delete-button.component.html +32 -0
- package/src/app/@modules/inventory-common/stock-receipts/stock-receipt-delete-button/stock-receipt-delete-button.component.scss +0 -0
- package/src/app/@modules/inventory-common/stock-receipts/stock-receipt-delete-button/stock-receipt-delete-button.component.ts +49 -0
- package/src/app/@modules/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form/stock-receipt-form.component.html +74 -0
- package/src/app/@modules/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form/stock-receipt-form.component.scss +0 -0
- package/src/app/@modules/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form/stock-receipt-form.component.ts +122 -0
- package/src/app/@modules/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form-button/stock-receipt-form-button.component.html +18 -0
- package/src/app/@modules/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form-button/stock-receipt-form-button.component.scss +0 -0
- package/src/app/@modules/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form-button/stock-receipt-form-button.component.ts +33 -0
- package/src/app/@modules/inventory-common/stock-receipts/stock-receipt-form/stock-receipt-form.module.ts +29 -0
- package/src/app/@modules/inventory-common/stock-receipts/stock-receipt.service.ts +11 -0
- package/src/app/@modules/inventory-common/stock-receipts/stock-receipts-list-page/stock-receipts-list-page.component.html +139 -0
- package/src/app/@modules/inventory-common/stock-receipts/stock-receipts-list-page/stock-receipts-list-page.component.scss +0 -0
- package/src/app/@modules/inventory-common/stock-receipts/stock-receipts-list-page/stock-receipts-list-page.component.ts +109 -0
- package/src/app/@modules/inventory-common/stock-receipts/stock-receipts-routing.module.ts +16 -0
- package/src/app/@modules/inventory-common/stock-receipts/stock-receipts.module.ts +45 -0
- package/src/app/@modules/inventory-common/stock-summary.service.ts +18 -0
- package/src/app/@modules/inventory-common/supplier/payee-selector/payee-selector/payee-selector.component.html +22 -0
- package/src/app/@modules/inventory-common/supplier/payee-selector/payee-selector/payee-selector.component.scss +0 -0
- package/src/app/@modules/inventory-common/supplier/payee-selector/payee-selector/payee-selector.component.ts +44 -0
- package/src/app/@modules/inventory-common/supplier/payee-selector/payee-selector.module.ts +19 -0
- package/src/app/@modules/inventory-common/supplier/supplier-form/supplier-form.component.html +133 -0
- package/src/app/@modules/inventory-common/supplier/supplier-form/supplier-form.component.ts +116 -0
- package/src/app/@modules/inventory-common/supplier/supplier-form/supplier-form.service.ts +11 -0
- package/src/app/@modules/inventory-common/supplier/supplier-information/supplier-information.component.html +67 -0
- package/src/app/@modules/inventory-common/supplier/supplier-information/supplier-information.component.scss +0 -0
- package/src/app/@modules/inventory-common/supplier/supplier-information/supplier-information.component.ts +68 -0
- package/src/app/@modules/inventory-common/supplier/supplier-routing.module.ts +32 -0
- package/src/app/@modules/inventory-common/supplier/supplier-type.service.ts +17 -0
- package/src/app/@modules/inventory-common/supplier/supplier-view/supplier-view.component.html +60 -0
- package/src/app/@modules/inventory-common/supplier/supplier-view/supplier-view.component.ts +58 -0
- package/src/app/@modules/inventory-common/supplier/supplier.component.html +3 -0
- package/src/app/@modules/inventory-common/supplier/supplier.component.scss +0 -0
- package/src/app/@modules/inventory-common/supplier/supplier.component.ts +16 -0
- package/src/app/@modules/inventory-common/supplier/supplier.module.ts +42 -0
- package/src/app/@modules/inventory-common/supplier/supplier.service.ts +57 -0
- package/src/app/@modules/inventory-common/supplier/suppliers-list/suppliers-list.component.html +140 -0
- package/src/app/@modules/inventory-common/supplier/suppliers-list/suppliers-list.component.ts +240 -0
- package/src/app/@modules/sidebar-layout/expandable-menu/expandable-menu.component.html +10 -0
- package/src/app/@modules/sidebar-layout/expandable-menu/expandable-menu.component.scss +20 -0
- package/src/app/@modules/sidebar-layout/expandable-menu/expandable-menu.component.ts +24 -0
- package/src/app/@modules/sidebar-layout/menu-item.model.ts +12 -0
- package/src/app/@modules/sidebar-layout/sidebar-administration-menu/sidebar-administration-menu.component.html +26 -0
- package/src/app/@modules/sidebar-layout/sidebar-administration-menu/sidebar-administration-menu.component.ts +23 -0
- package/src/app/@modules/sidebar-layout/sidebar-layout/sidebar-layout.component.html +32 -0
- package/src/app/@modules/sidebar-layout/sidebar-layout/sidebar-layout.component.scss +48 -0
- package/src/app/@modules/sidebar-layout/sidebar-layout/sidebar-layout.component.ts +173 -0
- package/src/app/@modules/sidebar-layout/sidebar-layout-routing.module.ts +52 -0
- package/src/app/@modules/sidebar-layout/sidebar-layout.module.ts +52 -0
- package/src/app/@modules/sidebar-layout/top-menu/top-menu.component.html +85 -0
- package/src/app/@modules/sidebar-layout/top-menu/top-menu.component.scss +0 -0
- package/src/app/@modules/sidebar-layout/top-menu/top-menu.component.ts +46 -0
- package/src/app/@modules/sidebar-layout/top-menu/top-menu.service.ts +29 -0
- package/src/app/@modules/techlify-filter/techlify-filter.component.html +442 -0
- package/src/app/@modules/techlify-filter/techlify-filter.component.scss +0 -0
- package/src/app/@modules/techlify-filter/techlify-filter.component.ts +109 -0
- package/src/app/@modules/techlify-filter/techlify-filter.module.ts +24 -0
- package/src/app/@modules/user/user-layout/user-layout.component.html +15 -0
- package/src/app/@modules/user/user-layout/user-layout.component.scss +0 -0
- package/src/app/@modules/user/user-layout/user-layout.component.ts +12 -0
- package/src/app/@modules/user/user-routing.module.ts +23 -0
- package/src/app/@modules/user/user.module.ts +13 -0
- package/src/app/@modules/user-setting-button/user-setting-button/user-setting-button.component.html +15 -0
- package/src/app/@modules/user-setting-button/user-setting-button/user-setting-button.component.scss +0 -0
- package/src/app/@modules/user-setting-button/user-setting-button/user-setting-button.component.ts +12 -0
- package/src/app/@modules/user-setting-button/user-setting-button.module.ts +20 -0
- package/src/app/app-routing.module.ts +28 -0
- package/src/app/app.component.html +1 -0
- package/src/app/app.component.scss +43 -0
- package/src/app/app.component.spec.ts +18 -0
- package/src/app/app.component.ts +62 -0
- package/src/app/app.module.ts +73 -0
- package/src/app/material.module.ts +95 -0
- package/src/assets/.gitkeep +0 -0
- package/src/assets/images/techlify-logo-xs.png +0 -0
- package/src/assets/product/product-import-sample.csv +1 -0
- package/src/environments/common-environment.ts +36 -0
- package/src/environments/environment.prod.ts +10 -0
- package/src/environments/environment.staging.ts +19 -0
- package/src/environments/environment.ts +18 -0
- package/src/favicon.ico +0 -0
- package/src/index.html +34 -0
- package/src/main.ts +19 -0
- package/src/polyfills.ts +57 -0
- package/src/styles.scss +366 -0
- package/src/test.ts +12 -0
- package/src/theme/theme-variables.scss +132 -0
- package/src/theme/theme.scss +17 -0
- package/src/tsconfig.app.json +15 -0
- package/src/tsconfig.spec.json +14 -0
- package/tsconfig.app.json +17 -0
- package/tsconfig.json +69 -0
- package/tslint.json +130 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Component, EventEmitter, Input, OnInit, Output } from "@angular/core";
|
|
2
|
+
import { StockSummaryService } from "../../stock-summary.service";
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: "app-product-basic-info",
|
|
6
|
+
templateUrl: "./product-basic-info.component.html",
|
|
7
|
+
styleUrls: ["./product-basic-info.component.scss"],
|
|
8
|
+
})
|
|
9
|
+
export class ProductBasicInfoComponent implements OnInit {
|
|
10
|
+
@Input() product: any;
|
|
11
|
+
@Output() saved: EventEmitter<any> = new EventEmitter<any>();
|
|
12
|
+
@Output() deleted: EventEmitter<any> = new EventEmitter<any>();
|
|
13
|
+
stockSummary!: any;
|
|
14
|
+
|
|
15
|
+
constructor(private stockSummaryService: StockSummaryService) {}
|
|
16
|
+
|
|
17
|
+
ngOnInit() {
|
|
18
|
+
if (this.product) {
|
|
19
|
+
this.loadProductStocksSummary();
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
onProductSaved(product: any) {
|
|
24
|
+
this.product = product;
|
|
25
|
+
this.saved.emit(this.product);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Load product stocks summary.
|
|
30
|
+
*/
|
|
31
|
+
loadProductStocksSummary() {
|
|
32
|
+
const params: any = {
|
|
33
|
+
product_ids: this.product?.id,
|
|
34
|
+
include:
|
|
35
|
+
"stock_receipts_quantity_sum,stock_issuances_quantity_sum,stock_quantity_remaining",
|
|
36
|
+
};
|
|
37
|
+
this.stockSummaryService.summary(params).subscribe({
|
|
38
|
+
next: (response: any) => {
|
|
39
|
+
this.stockSummary = response;
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<mat-icon
|
|
2
|
+
class="cursor-pointer text-secondary"
|
|
3
|
+
(click)="showDeleteDialog(deleteProductDialog)"
|
|
4
|
+
>
|
|
5
|
+
delete
|
|
6
|
+
</mat-icon>
|
|
7
|
+
|
|
8
|
+
<ng-template #deleteProductDialog>
|
|
9
|
+
<h3 mat-dialog-title>Delete Product</h3>
|
|
10
|
+
<div mat-dialog-content>
|
|
11
|
+
Are you sure? You want to delete the
|
|
12
|
+
<strong>{{ product?.name }}</strong> ?
|
|
13
|
+
</div>
|
|
14
|
+
<div mat-dialog-actions class="d-flex justify-content-end gap-1 mb-2">
|
|
15
|
+
<button
|
|
16
|
+
[disabled]="isDeleting"
|
|
17
|
+
type="button"
|
|
18
|
+
mat-raised-button
|
|
19
|
+
color="warn"
|
|
20
|
+
(click)="deleteProduct()"
|
|
21
|
+
>
|
|
22
|
+
Delete
|
|
23
|
+
</button>
|
|
24
|
+
<button
|
|
25
|
+
[disabled]="isDeleting"
|
|
26
|
+
type="button"
|
|
27
|
+
mat-flat-button
|
|
28
|
+
mat-dialog-close
|
|
29
|
+
>
|
|
30
|
+
Cancel
|
|
31
|
+
</button>
|
|
32
|
+
</div>
|
|
33
|
+
</ng-template>
|
|
File without changes
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Component,
|
|
3
|
+
EventEmitter,
|
|
4
|
+
Input,
|
|
5
|
+
Output,
|
|
6
|
+
TemplateRef,
|
|
7
|
+
} from "@angular/core";
|
|
8
|
+
import { MatDialog } from "@angular/material/dialog";
|
|
9
|
+
import { ProductService } from "../product.service";
|
|
10
|
+
import { AlertService } from "ngx-techlify-core";
|
|
11
|
+
|
|
12
|
+
@Component({
|
|
13
|
+
selector: "app-product-delete-button",
|
|
14
|
+
templateUrl: "./product-delete-button.component.html",
|
|
15
|
+
styleUrls: ["./product-delete-button.component.scss"],
|
|
16
|
+
})
|
|
17
|
+
export class ProductDeleteButtonComponent {
|
|
18
|
+
@Input() product: any;
|
|
19
|
+
@Output() deleted = new EventEmitter();
|
|
20
|
+
|
|
21
|
+
isDeleting!: boolean;
|
|
22
|
+
|
|
23
|
+
constructor(
|
|
24
|
+
private matDialog: MatDialog,
|
|
25
|
+
private productService: ProductService,
|
|
26
|
+
private alertService: AlertService
|
|
27
|
+
) {}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Delete the product.
|
|
31
|
+
*/
|
|
32
|
+
deleteProduct() {
|
|
33
|
+
this.isDeleting = true;
|
|
34
|
+
this.productService.delete(this.product).subscribe({
|
|
35
|
+
next: () => {
|
|
36
|
+
this.deleted.emit();
|
|
37
|
+
this.isDeleting = false;
|
|
38
|
+
this.matDialog.closeAll();
|
|
39
|
+
this.alertService.addAlert("Product deleted successfully!", "success");
|
|
40
|
+
},
|
|
41
|
+
error: () => (this.isDeleting = false),
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Show delete product dialog.
|
|
47
|
+
*
|
|
48
|
+
* @param templateRef
|
|
49
|
+
*/
|
|
50
|
+
showDeleteDialog(templateRef: TemplateRef<any>) {
|
|
51
|
+
this.matDialog.open(templateRef, { width: "500px" });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
<form [formGroup]="productForm" (submit)="save()">
|
|
2
|
+
<h3 class="text-center">{{ product?.id ? "Update" : "Create" }} Product</h3>
|
|
3
|
+
<div fxLayout="column">
|
|
4
|
+
<div fxLayout="column" *ngIf="isFormSectionShown('basic information')">
|
|
5
|
+
<h3><strong>Basic Information</strong></h3>
|
|
6
|
+
<div fxLayout fxLayoutGap="0.5rem">
|
|
7
|
+
<mat-form-field fxFlex="50%" *ngIf="isFormFieldShown('name')">
|
|
8
|
+
<input matInput placeholder="Name" formControlName="name" required />
|
|
9
|
+
<mat-error *ngIf="isFieldValid('name')"
|
|
10
|
+
>{{ getErrorMessage("name") }}
|
|
11
|
+
</mat-error>
|
|
12
|
+
</mat-form-field>
|
|
13
|
+
<mat-form-field fxFlex="50%" *ngIf="isFormFieldShown('product type')">
|
|
14
|
+
<mat-label>Product Type</mat-label>
|
|
15
|
+
<app-searchable-selector
|
|
16
|
+
apiUrl="api/product-types"
|
|
17
|
+
formControlName="type_id"
|
|
18
|
+
>
|
|
19
|
+
</app-searchable-selector>
|
|
20
|
+
<mat-error *ngIf="isFieldValid('type_id')"
|
|
21
|
+
>{{ getErrorMessage("type_id") }}
|
|
22
|
+
</mat-error>
|
|
23
|
+
</mat-form-field>
|
|
24
|
+
</div>
|
|
25
|
+
<div fxLayout fxLayoutGap="0.5rem">
|
|
26
|
+
<mat-form-field fxFlex="50%" *ngIf="isFormFieldShown('sku')">
|
|
27
|
+
<input matInput placeholder="SKU" formControlName="sku" />
|
|
28
|
+
<mat-error *ngIf="isFieldValid('sku')"
|
|
29
|
+
>{{ getErrorMessage("sku") }}
|
|
30
|
+
</mat-error>
|
|
31
|
+
</mat-form-field>
|
|
32
|
+
|
|
33
|
+
<mat-form-field fxFlex="50%">
|
|
34
|
+
<mat-label>Category</mat-label>
|
|
35
|
+
<app-searchable-selector
|
|
36
|
+
apiUrl="api/product-categories"
|
|
37
|
+
formControlName="category_ids"
|
|
38
|
+
[multiple]="true"
|
|
39
|
+
>
|
|
40
|
+
</app-searchable-selector>
|
|
41
|
+
<mat-error *ngIf="isFieldValid('category_ids')">
|
|
42
|
+
{{ getErrorMessage("category_ids") }}
|
|
43
|
+
</mat-error>
|
|
44
|
+
</mat-form-field>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<div fxLayout fxLayoutGap="0.5rem">
|
|
48
|
+
<mat-form-field fxFlex="100%" *ngIf="isFormFieldShown('description')">
|
|
49
|
+
<textarea
|
|
50
|
+
matInput
|
|
51
|
+
placeholder="Description"
|
|
52
|
+
formControlName="description"
|
|
53
|
+
></textarea>
|
|
54
|
+
</mat-form-field>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<div fxLayout="column" *ngIf="isFormSectionShown('inventory information')">
|
|
59
|
+
<h3><strong>Inventory Information</strong></h3>
|
|
60
|
+
<div fxLayout fxLayoutGap="0.5rem">
|
|
61
|
+
<mat-form-field
|
|
62
|
+
fxFlex="50%"
|
|
63
|
+
*ngIf="isFormFieldShown('product measure')"
|
|
64
|
+
>
|
|
65
|
+
<mat-label>Measure</mat-label>
|
|
66
|
+
<app-searchable-selector
|
|
67
|
+
apiUrl="api/product-measures"
|
|
68
|
+
formControlName="measure_id"
|
|
69
|
+
>
|
|
70
|
+
</app-searchable-selector>
|
|
71
|
+
<mat-error *ngIf="isFieldValid('measure_id')"
|
|
72
|
+
>{{ getErrorMessage("measure_id") }}
|
|
73
|
+
</mat-error>
|
|
74
|
+
</mat-form-field>
|
|
75
|
+
<mat-form-field fxFlex="50%" *ngIf="isFormFieldShown('reorder point')">
|
|
76
|
+
<input
|
|
77
|
+
matInput
|
|
78
|
+
placeholder="Reorder Point"
|
|
79
|
+
formControlName="reorder_point"
|
|
80
|
+
type="number"
|
|
81
|
+
/>
|
|
82
|
+
<mat-error *ngIf="isFieldValid('reorder_point')"
|
|
83
|
+
>{{ getErrorMessage("reorder_point") }}
|
|
84
|
+
</mat-error>
|
|
85
|
+
</mat-form-field>
|
|
86
|
+
</div>
|
|
87
|
+
<div fxLayout fxLayoutGap="0.5rem">
|
|
88
|
+
<mat-form-field
|
|
89
|
+
fxFlex="50%"
|
|
90
|
+
*ngIf="isFormFieldShown('initial quantity')"
|
|
91
|
+
>
|
|
92
|
+
<input
|
|
93
|
+
matInput
|
|
94
|
+
placeholder="Initial Quantity"
|
|
95
|
+
formControlName="initial_quantity"
|
|
96
|
+
/>
|
|
97
|
+
<mat-error *ngIf="isFieldValid('initial_quantity')"
|
|
98
|
+
>{{ getErrorMessage("initial_quantity") }}
|
|
99
|
+
</mat-error>
|
|
100
|
+
</mat-form-field>
|
|
101
|
+
<mat-form-field
|
|
102
|
+
fxFlex="50%"
|
|
103
|
+
*ngIf="isFormFieldShown('initial quantity date')"
|
|
104
|
+
>
|
|
105
|
+
<input
|
|
106
|
+
matInput
|
|
107
|
+
[matDatepicker]="pickerInitialQuantityDate"
|
|
108
|
+
placeholder="Initial Quantity Date"
|
|
109
|
+
formControlName="initial_quantity_date"
|
|
110
|
+
/>
|
|
111
|
+
<mat-datepicker-toggle
|
|
112
|
+
matSuffix
|
|
113
|
+
[for]="pickerInitialQuantityDate"
|
|
114
|
+
></mat-datepicker-toggle>
|
|
115
|
+
<mat-datepicker #pickerInitialQuantityDate></mat-datepicker>
|
|
116
|
+
<mat-error *ngIf="isFieldValid('initial_quantity_date')"
|
|
117
|
+
>{{ getErrorMessage("initial_quantity_date") }}
|
|
118
|
+
</mat-error>
|
|
119
|
+
</mat-form-field>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
<div fxLayout="column" *ngIf="isFormSectionShown('sales information')">
|
|
123
|
+
<h3><strong>Sale Information</strong></h3>
|
|
124
|
+
<div fxLayout fxLayoutGap="0.5rem">
|
|
125
|
+
<mat-form-field fxFlex="50%" *ngIf="isFormFieldShown('sales price')">
|
|
126
|
+
<input
|
|
127
|
+
matInput
|
|
128
|
+
placeholder="Selling Price"
|
|
129
|
+
formControlName="sale_price"
|
|
130
|
+
required
|
|
131
|
+
type="number"
|
|
132
|
+
step="any"
|
|
133
|
+
/>
|
|
134
|
+
<mat-error *ngIf="isFieldValid('sale_price')"
|
|
135
|
+
>{{ getErrorMessage("sale_price") }}
|
|
136
|
+
</mat-error>
|
|
137
|
+
</mat-form-field>
|
|
138
|
+
<mat-form-field
|
|
139
|
+
fxFlex="50%"
|
|
140
|
+
*ngIf="isFormFieldShown('condition types')"
|
|
141
|
+
>
|
|
142
|
+
<mat-label>Condition</mat-label>
|
|
143
|
+
<app-searchable-selector
|
|
144
|
+
apiUrl="api/condition-types"
|
|
145
|
+
formControlName="condition_type_id"
|
|
146
|
+
></app-searchable-selector>
|
|
147
|
+
</mat-form-field>
|
|
148
|
+
</div>
|
|
149
|
+
<div fxLayout fxLayoutGap="0.5rem">
|
|
150
|
+
<mat-form-field fxFlex="50%" *ngIf="isFormFieldShown('minimum price')">
|
|
151
|
+
<input
|
|
152
|
+
matInput
|
|
153
|
+
placeholder="Minimum Price"
|
|
154
|
+
formControlName="minimum_price"
|
|
155
|
+
required
|
|
156
|
+
type="number"
|
|
157
|
+
step="any"
|
|
158
|
+
/>
|
|
159
|
+
<mat-error *ngIf="isFieldValid('minimum_price')"
|
|
160
|
+
>{{ getErrorMessage("minimum_price") }}
|
|
161
|
+
</mat-error>
|
|
162
|
+
</mat-form-field>
|
|
163
|
+
<mat-form-field fxFlex="50%" *ngIf="isFormFieldShown('maximum price')">
|
|
164
|
+
<input
|
|
165
|
+
matInput
|
|
166
|
+
placeholder="Maximum Price"
|
|
167
|
+
formControlName="maximum_price"
|
|
168
|
+
type="number"
|
|
169
|
+
step="any"
|
|
170
|
+
/>
|
|
171
|
+
</mat-form-field>
|
|
172
|
+
</div>
|
|
173
|
+
</div>
|
|
174
|
+
<!-- <div fxLayout="column" *ngIf="isFormSectionShown('accounts information')">-->
|
|
175
|
+
<!-- <h3><strong>Accounts Information</strong></h3>-->
|
|
176
|
+
<!-- <div fxLayout fxLayoutGap="0.5rem">-->
|
|
177
|
+
<!-- <mat-form-field fxFlex="50%" *ngIf="isFormFieldShown('income account')">-->
|
|
178
|
+
<!-- <mat-label>Income Account</mat-label>-->
|
|
179
|
+
<!-- <app-searchable-selector apiUrl="api/accounts" formControlName="income_account_id"> </app-searchable-selector>-->
|
|
180
|
+
<!-- </mat-form-field>-->
|
|
181
|
+
<!-- <mat-form-field fxFlex="50%" *ngIf="isFormFieldShown('expense account')">-->
|
|
182
|
+
<!-- <mat-label>Expense Account</mat-label>-->
|
|
183
|
+
<!-- <app-searchable-selector apiUrl="api/accounts" formControlName="expense_account_id">-->
|
|
184
|
+
<!-- </app-searchable-selector>-->
|
|
185
|
+
<!-- </mat-form-field>-->
|
|
186
|
+
<!-- </div>-->
|
|
187
|
+
<!-- </div>-->
|
|
188
|
+
<div fxFlex="100%" fxLayout fxLayoutAlign="end" fxLayoutGap="1rem">
|
|
189
|
+
<button
|
|
190
|
+
[disabled]="isWorking"
|
|
191
|
+
mat-button
|
|
192
|
+
class="mt-2"
|
|
193
|
+
type="button"
|
|
194
|
+
(click)="cancelled.emit(true)"
|
|
195
|
+
>
|
|
196
|
+
Cancel
|
|
197
|
+
</button>
|
|
198
|
+
<button
|
|
199
|
+
[disabled]="isWorking"
|
|
200
|
+
mat-raised-button
|
|
201
|
+
color="primary"
|
|
202
|
+
class="mt-2"
|
|
203
|
+
type="submit"
|
|
204
|
+
>
|
|
205
|
+
Save
|
|
206
|
+
</button>
|
|
207
|
+
</div>
|
|
208
|
+
</div>
|
|
209
|
+
</form>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from "@angular/core/testing";
|
|
2
|
+
|
|
3
|
+
import { ProductFormComponent } from "./product-form.component";
|
|
4
|
+
|
|
5
|
+
describe("ProductFormComponent", () => {
|
|
6
|
+
let component: ProductFormComponent;
|
|
7
|
+
let fixture: ComponentFixture<ProductFormComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ProductFormComponent],
|
|
12
|
+
}).compileComponents();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
fixture = TestBed.createComponent(ProductFormComponent);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
fixture.detectChanges();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("should create", () => {
|
|
22
|
+
expect(component).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { Component, EventEmitter, Input, OnInit, Output } from "@angular/core";
|
|
2
|
+
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
|
|
3
|
+
import moment from "moment";
|
|
4
|
+
import { AlertService, FormValidatorService } from "ngx-techlify-core";
|
|
5
|
+
import { ProductService } from "../product.service";
|
|
6
|
+
import { Observable } from "rxjs";
|
|
7
|
+
import { DatePipe } from "@angular/common";
|
|
8
|
+
import { ProductFormService } from "../product-form.service";
|
|
9
|
+
|
|
10
|
+
const initial_quantity: number = 0;
|
|
11
|
+
const reorder_point: number = 10;
|
|
12
|
+
|
|
13
|
+
const errorMessages: any = {
|
|
14
|
+
type_id: {
|
|
15
|
+
required: "Please Enter Type",
|
|
16
|
+
},
|
|
17
|
+
name: {
|
|
18
|
+
required: "Please Enter Name",
|
|
19
|
+
},
|
|
20
|
+
sale_price: {
|
|
21
|
+
required: "Please Enter Sales Price",
|
|
22
|
+
},
|
|
23
|
+
minimum_price: {
|
|
24
|
+
required: "Please Enter Minimum Price",
|
|
25
|
+
},
|
|
26
|
+
reorder_point: {
|
|
27
|
+
required: "Please Enter Reorder Point",
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
@Component({
|
|
32
|
+
selector: "app-product-form",
|
|
33
|
+
templateUrl: "./product-form.component.html",
|
|
34
|
+
})
|
|
35
|
+
export class ProductFormComponent implements OnInit {
|
|
36
|
+
public productForm: FormGroup;
|
|
37
|
+
public isWorking: boolean = false;
|
|
38
|
+
public isUpdate: boolean = false;
|
|
39
|
+
@Output() saved: EventEmitter<any> = new EventEmitter();
|
|
40
|
+
@Output() cancelled: EventEmitter<any> = new EventEmitter();
|
|
41
|
+
@Input() product: any;
|
|
42
|
+
@Input() displayedFormFields: any[] = [
|
|
43
|
+
"name",
|
|
44
|
+
"product type",
|
|
45
|
+
"sku",
|
|
46
|
+
"description",
|
|
47
|
+
"product measure",
|
|
48
|
+
"reorder point",
|
|
49
|
+
"initial quantity",
|
|
50
|
+
"initial quantity date",
|
|
51
|
+
"sales price",
|
|
52
|
+
"minimum price",
|
|
53
|
+
"maximum price",
|
|
54
|
+
"income account",
|
|
55
|
+
"expense account",
|
|
56
|
+
];
|
|
57
|
+
|
|
58
|
+
@Input() displayedFormSections: any[] = [
|
|
59
|
+
"basic information",
|
|
60
|
+
"inventory information",
|
|
61
|
+
"sales information",
|
|
62
|
+
"accounts information",
|
|
63
|
+
];
|
|
64
|
+
|
|
65
|
+
constructor(
|
|
66
|
+
private productService: ProductService,
|
|
67
|
+
private fb: FormBuilder,
|
|
68
|
+
private formValidatorService: FormValidatorService,
|
|
69
|
+
private alertService: AlertService,
|
|
70
|
+
private datePipe: DatePipe,
|
|
71
|
+
private productFormService: ProductFormService
|
|
72
|
+
) {
|
|
73
|
+
this.productForm = this.fb.group({
|
|
74
|
+
id: [""],
|
|
75
|
+
type_id: [1, Validators.compose([Validators.required])],
|
|
76
|
+
sku: [""],
|
|
77
|
+
name: ["", Validators.compose([Validators.required])],
|
|
78
|
+
initial_quantity: [initial_quantity],
|
|
79
|
+
initial_quantity_date: [moment().format()],
|
|
80
|
+
reorder_point: [reorder_point, Validators.compose([Validators.required])],
|
|
81
|
+
description: [""],
|
|
82
|
+
sale_price: [0, Validators.compose([Validators.required])],
|
|
83
|
+
income_account_id: [""],
|
|
84
|
+
expense_account_id: [""],
|
|
85
|
+
measure_id: [1],
|
|
86
|
+
minimum_price: ["", Validators.compose([Validators.required])],
|
|
87
|
+
maximum_price: [""],
|
|
88
|
+
condition_type_id: [1],
|
|
89
|
+
current_quantity: [],
|
|
90
|
+
category_ids: [""],
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
ngOnInit() {
|
|
95
|
+
if (this.product?.id) {
|
|
96
|
+
this.isUpdate = true;
|
|
97
|
+
let data = { ...this.product };
|
|
98
|
+
if (this.product?.categories?.length > 0) {
|
|
99
|
+
data.category_ids = (this.product.categories as []).map(
|
|
100
|
+
(category: any) => category?.id
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
if (data?.initial_quantity_date) {
|
|
104
|
+
data.initial_quantity_date = moment(
|
|
105
|
+
data.initial_quantity_date
|
|
106
|
+
).toISOString();
|
|
107
|
+
}
|
|
108
|
+
this.productForm.patchValue(data);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
async save() {
|
|
113
|
+
this.productForm.markAllAsTouched();
|
|
114
|
+
if (this.productForm.invalid) {
|
|
115
|
+
this.alertService.addAlert("Please Fill All Required Fields", "warn");
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
let product = this.productForm.value;
|
|
119
|
+
if (product.maximum_price <= 0 || !product.maximum_price) {
|
|
120
|
+
product.maximum_price = product.minimum_price;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
if (product?.initial_quantity_date) {
|
|
124
|
+
product.initial_quantity_date = moment(
|
|
125
|
+
product.initial_quantity_date
|
|
126
|
+
).format("YYYY-MM-DD");
|
|
127
|
+
}
|
|
128
|
+
this.isWorking = true;
|
|
129
|
+
product.with = "type,measure,incomeAccount,expenseAccount";
|
|
130
|
+
|
|
131
|
+
let request: Observable<any> = this.productService.store(product);
|
|
132
|
+
if (this.isUpdate) {
|
|
133
|
+
request = this.productService.update(product);
|
|
134
|
+
}
|
|
135
|
+
request.subscribe({
|
|
136
|
+
next: (response: any) => {
|
|
137
|
+
this.saved.emit(response?.item);
|
|
138
|
+
this.isWorking = false;
|
|
139
|
+
this.productFormService.listUpdated(true);
|
|
140
|
+
this.alertService.addAlert("Product saved successfully!", "success");
|
|
141
|
+
},
|
|
142
|
+
error: () => (this.isWorking = false),
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Method to evaluate form fields
|
|
148
|
+
*/
|
|
149
|
+
isFieldValid(field: string) {
|
|
150
|
+
return this.formValidatorService.isFieldValid(field, this.productForm);
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Method to find error in form fields
|
|
154
|
+
*/
|
|
155
|
+
getErrorMessage(field: string) {
|
|
156
|
+
return this.formValidatorService.getErrorMessage(
|
|
157
|
+
field,
|
|
158
|
+
this.productForm,
|
|
159
|
+
errorMessages
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Checks displayed Form Fields array for form field and returns boolean result
|
|
165
|
+
*/
|
|
166
|
+
isFormFieldShown(fieldName: string): boolean {
|
|
167
|
+
return (
|
|
168
|
+
this.displayedFormFields.length > 0 &&
|
|
169
|
+
this.displayedFormFields.includes(fieldName)
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Checks displayed Form Section array for form section and returns boolean result
|
|
175
|
+
*/
|
|
176
|
+
isFormSectionShown(sectionName: string): boolean {
|
|
177
|
+
return (
|
|
178
|
+
this.displayedFormSections.length > 0 &&
|
|
179
|
+
this.displayedFormSections.includes(sectionName)
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<mat-icon
|
|
2
|
+
color="primary"
|
|
3
|
+
class="cursor-pointer"
|
|
4
|
+
[class.text-secondary]="product"
|
|
5
|
+
(click)="showForm(addProductForm)"
|
|
6
|
+
>
|
|
7
|
+
{{ product ? "edit" : "add" }}
|
|
8
|
+
</mat-icon>
|
|
9
|
+
|
|
10
|
+
<ng-template #addProductForm>
|
|
11
|
+
<app-product-form
|
|
12
|
+
[product]="product"
|
|
13
|
+
mat-dialog-content
|
|
14
|
+
(saved)="onProductSaved($event)"
|
|
15
|
+
(cancelled)="matDialog.closeAll()"
|
|
16
|
+
></app-product-form>
|
|
17
|
+
</ng-template>
|
|
File without changes
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Component,
|
|
3
|
+
EventEmitter,
|
|
4
|
+
Input,
|
|
5
|
+
Output,
|
|
6
|
+
TemplateRef,
|
|
7
|
+
} from "@angular/core";
|
|
8
|
+
import { MatDialog } from "@angular/material/dialog";
|
|
9
|
+
import { ProductFormService } from "../product-form.service";
|
|
10
|
+
|
|
11
|
+
@Component({
|
|
12
|
+
selector: "app-product-form-button",
|
|
13
|
+
templateUrl: "./product-form-button.component.html",
|
|
14
|
+
styleUrls: ["./product-form-button.component.scss"],
|
|
15
|
+
})
|
|
16
|
+
export class ProductFormButtonComponent {
|
|
17
|
+
@Input() product: any;
|
|
18
|
+
@Output() saved = new EventEmitter();
|
|
19
|
+
|
|
20
|
+
constructor(
|
|
21
|
+
public matDialog: MatDialog,
|
|
22
|
+
private productFormService: ProductFormService
|
|
23
|
+
) {}
|
|
24
|
+
|
|
25
|
+
showForm(templateRef: TemplateRef<any>) {
|
|
26
|
+
this.matDialog.open(templateRef, { width: "600px" });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Handle on product saved event.
|
|
31
|
+
*
|
|
32
|
+
* @param product
|
|
33
|
+
*/
|
|
34
|
+
onProductSaved(product: any) {
|
|
35
|
+
this.saved.emit(product);
|
|
36
|
+
this.matDialog?.closeAll();
|
|
37
|
+
this.productFormService.listUpdated(true);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Injectable } from "@angular/core";
|
|
2
|
+
import TechlifyFormService from '../services/techlify-form-service';
|
|
3
|
+
|
|
4
|
+
@Injectable({
|
|
5
|
+
providedIn: "root",
|
|
6
|
+
})
|
|
7
|
+
export class ProductFormService extends TechlifyFormService {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<app-import-csv [config]="importConfig"></app-import-csv>
|