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,66 @@
|
|
|
1
|
+
import { Component, OnInit } from "@angular/core";
|
|
2
|
+
import { ImportCsvConfig } from "ngx-techlify-core";
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: "app-product-import-page",
|
|
6
|
+
templateUrl: "./product-import-page.component.html",
|
|
7
|
+
styleUrls: ["./product-import-page.component.scss"],
|
|
8
|
+
})
|
|
9
|
+
export class ProductImportPageComponent implements OnInit {
|
|
10
|
+
importConfig: ImportCsvConfig = {
|
|
11
|
+
apiUrl: "api/products-import",
|
|
12
|
+
title: "Products",
|
|
13
|
+
importType: "product",
|
|
14
|
+
properties: [
|
|
15
|
+
{
|
|
16
|
+
label: "Name",
|
|
17
|
+
value: "name",
|
|
18
|
+
type: "text",
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
label: "SKU",
|
|
22
|
+
value: "sku",
|
|
23
|
+
type: "text",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
label: "Initial Quantity",
|
|
27
|
+
value: "initial_quantity",
|
|
28
|
+
type: "number",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: "Initial Quantity Date",
|
|
32
|
+
value: "initial_quantity_date",
|
|
33
|
+
type: "date",
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
label: "Reorder Point",
|
|
37
|
+
value: "reorder_point",
|
|
38
|
+
type: "number",
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
label: "Measure",
|
|
42
|
+
value: "measure",
|
|
43
|
+
type: "text",
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
label: "Categories",
|
|
47
|
+
value: "categories",
|
|
48
|
+
type: "text",
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
sampleFile: {
|
|
52
|
+
name: "Products Import",
|
|
53
|
+
path: "assets/product/product-import-sample.csv",
|
|
54
|
+
},
|
|
55
|
+
importHistory: {
|
|
56
|
+
isEnabled: true,
|
|
57
|
+
type: "product",
|
|
58
|
+
apiUrl: "api/import-histories",
|
|
59
|
+
},
|
|
60
|
+
viewRouterLink: "/inventory/products/",
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
constructor() {}
|
|
64
|
+
|
|
65
|
+
ngOnInit(): void {}
|
|
66
|
+
}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
<mat-card class="mb-3">
|
|
2
|
+
<mat-card-content>
|
|
3
|
+
<form
|
|
4
|
+
[formGroup]="filterForm"
|
|
5
|
+
class="d-flex justify-content-between align-items-center gap-2"
|
|
6
|
+
>
|
|
7
|
+
<div class="d-flex justify-content-center align-items-center gap-2">
|
|
8
|
+
<h3 class="mb-0">Products</h3>
|
|
9
|
+
<app-product-form-button class="mt-2"></app-product-form-button>
|
|
10
|
+
<span matTooltip="Import" routerLink="import" class="cursor-pointer mt-1 material-symbols-outlined">
|
|
11
|
+
file_save
|
|
12
|
+
</span>
|
|
13
|
+
<app-column-selector
|
|
14
|
+
mode="icon"
|
|
15
|
+
class="mt-2 d-print-none"
|
|
16
|
+
[columnConfigs]="columnConfig"
|
|
17
|
+
[(selectedColumns)]="selectedColumns"
|
|
18
|
+
></app-column-selector>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<div class="d-flex justify-content-start align-items-center gap-2">
|
|
22
|
+
<mat-form-field style="width: 120px">
|
|
23
|
+
<input matInput placeholder="Product" formControlName="search" />
|
|
24
|
+
</mat-form-field>
|
|
25
|
+
|
|
26
|
+
<mat-form-field style="width: 120px">
|
|
27
|
+
<mat-label>Category</mat-label>
|
|
28
|
+
<app-searchable-selector
|
|
29
|
+
apiUrl="api/product-categories"
|
|
30
|
+
formControlName="category_ids"
|
|
31
|
+
[multiple]="true"
|
|
32
|
+
>
|
|
33
|
+
</app-searchable-selector>
|
|
34
|
+
</mat-form-field>
|
|
35
|
+
|
|
36
|
+
<mat-form-field style="width: 120px">
|
|
37
|
+
<mat-label>Type</mat-label>
|
|
38
|
+
<app-searchable-selector
|
|
39
|
+
apiUrl="api/product-types"
|
|
40
|
+
formControlName="type_ids"
|
|
41
|
+
titleField="title"
|
|
42
|
+
[multiple]="true"
|
|
43
|
+
>
|
|
44
|
+
</app-searchable-selector>
|
|
45
|
+
</mat-form-field>
|
|
46
|
+
<!-- <mat-form-field style="width: 150px">-->
|
|
47
|
+
<!-- <mat-label>Income Account</mat-label>-->
|
|
48
|
+
<!-- <app-searchable-selector-->
|
|
49
|
+
<!-- apiUrl="api/accounts"-->
|
|
50
|
+
<!-- formControlName="income_account_ids"-->
|
|
51
|
+
<!-- titleField="title"-->
|
|
52
|
+
<!-- [multiple]="true"-->
|
|
53
|
+
<!-- >-->
|
|
54
|
+
<!-- </app-searchable-selector>-->
|
|
55
|
+
<!-- </mat-form-field>-->
|
|
56
|
+
<!-- <mat-form-field style="width: 150px">-->
|
|
57
|
+
<!-- <mat-label>Expense Account</mat-label>-->
|
|
58
|
+
<!-- <app-searchable-selector-->
|
|
59
|
+
<!-- apiUrl="api/accounts"-->
|
|
60
|
+
<!-- formControlName="expense_account_ids"-->
|
|
61
|
+
<!-- titleField="title"-->
|
|
62
|
+
<!-- [multiple]="true"-->
|
|
63
|
+
<!-- >-->
|
|
64
|
+
<!-- </app-searchable-selector>-->
|
|
65
|
+
<!-- </mat-form-field>-->
|
|
66
|
+
</div>
|
|
67
|
+
</form>
|
|
68
|
+
</mat-card-content>
|
|
69
|
+
</mat-card>
|
|
70
|
+
|
|
71
|
+
<mat-card>
|
|
72
|
+
<mat-card-content class="p-0">
|
|
73
|
+
<table
|
|
74
|
+
mat-table
|
|
75
|
+
[dataSource]="dataSource"
|
|
76
|
+
class="w-100"
|
|
77
|
+
infiniteScroll
|
|
78
|
+
[infiniteScrollDistance]="2"
|
|
79
|
+
[infiniteScrollThrottle]="50"
|
|
80
|
+
(scrolled)="onScroll()"
|
|
81
|
+
[fromRoot]="true"
|
|
82
|
+
matSort
|
|
83
|
+
(matSortChange)="sortColumn($event)"
|
|
84
|
+
matSortDisableClear="true"
|
|
85
|
+
aria-describedby="Products List"
|
|
86
|
+
>
|
|
87
|
+
<!-- # Column -->
|
|
88
|
+
<ng-container matColumnDef="#">
|
|
89
|
+
<th mat-header-cell *matHeaderCellDef>#</th>
|
|
90
|
+
<td mat-cell *matCellDef="let element; let i = index">{{ i + 1 }}</td>
|
|
91
|
+
</ng-container>
|
|
92
|
+
|
|
93
|
+
<!-- Name Column -->
|
|
94
|
+
<ng-container matColumnDef="name">
|
|
95
|
+
<th mat-header-cell mat-sort-header *matHeaderCellDef>Name</th>
|
|
96
|
+
<td mat-cell *matCellDef="let element">
|
|
97
|
+
<div class="d-flex flex-column gap-1">
|
|
98
|
+
<a class="text-decoration-none text-dark" [routerLink]="[element?.id, 'view']">{{ element.name }}</a>
|
|
99
|
+
<small class="text-secondary" *ngIf="element.type">{{ element.type?.title }}</small>
|
|
100
|
+
</div>
|
|
101
|
+
</td>
|
|
102
|
+
</ng-container>
|
|
103
|
+
|
|
104
|
+
<!-- Categories Column -->
|
|
105
|
+
<ng-container matColumnDef="categories">
|
|
106
|
+
<th mat-header-cell *matHeaderCellDef>Categories</th>
|
|
107
|
+
<td mat-cell *matCellDef="let element" style="max-width: 200px">
|
|
108
|
+
<div
|
|
109
|
+
*ngIf="element?.categories?.length > 0"
|
|
110
|
+
class="d-flex justify-content-start align-items-center gap-1 flex-wrap"
|
|
111
|
+
>
|
|
112
|
+
<span
|
|
113
|
+
class="badge bg-secondary"
|
|
114
|
+
*ngFor="let category of element?.categories"
|
|
115
|
+
>
|
|
116
|
+
{{ category?.title }}
|
|
117
|
+
</span>
|
|
118
|
+
</div>
|
|
119
|
+
</td>
|
|
120
|
+
</ng-container>
|
|
121
|
+
|
|
122
|
+
<!-- SKU Column -->
|
|
123
|
+
<ng-container matColumnDef="sku">
|
|
124
|
+
<th mat-header-cell mat-sort-header *matHeaderCellDef>SKU</th>
|
|
125
|
+
<td mat-cell *matCellDef="let element">{{ element.sku }}</td>
|
|
126
|
+
</ng-container>
|
|
127
|
+
|
|
128
|
+
<!-- Initial Quantity Column -->
|
|
129
|
+
<ng-container matColumnDef="initial_quantity">
|
|
130
|
+
<th mat-header-cell mat-sort-header *matHeaderCellDef>
|
|
131
|
+
Initial Quantity
|
|
132
|
+
</th>
|
|
133
|
+
<td mat-cell *matCellDef="let element">
|
|
134
|
+
<p class="mb-0">{{ element.initial_quantity }}</p>
|
|
135
|
+
<small class="text-secondary" *ngIf="element?.initial_quantity_date">
|
|
136
|
+
on {{ element?.initial_quantity_date | date }}
|
|
137
|
+
</small>
|
|
138
|
+
</td>
|
|
139
|
+
</ng-container>
|
|
140
|
+
|
|
141
|
+
<!-- Stock Receipts Column -->
|
|
142
|
+
<ng-container matColumnDef="stock_receipts">
|
|
143
|
+
<th mat-header-cell mat-sort-header="stock_receipts_sum_quantity" *matHeaderCellDef>
|
|
144
|
+
Stock Receipts
|
|
145
|
+
</th>
|
|
146
|
+
<td mat-cell *matCellDef="let element">
|
|
147
|
+
<p class="mb-0">{{ element?.stock_receipts_sum_quantity }}</p>
|
|
148
|
+
<small class="text-secondary" *ngIf="element?.last_stock_receipt">
|
|
149
|
+
last added on {{ element?.last_stock_receipt?.date | date }}
|
|
150
|
+
</small>
|
|
151
|
+
</td>
|
|
152
|
+
</ng-container>
|
|
153
|
+
|
|
154
|
+
<!-- Stock Issuances Column -->
|
|
155
|
+
<ng-container matColumnDef="stock_issuances">
|
|
156
|
+
<th mat-header-cell mat-sort-header="stock_issuances_sum_quantity" *matHeaderCellDef>
|
|
157
|
+
Stock Issuances
|
|
158
|
+
</th>
|
|
159
|
+
<td mat-cell *matCellDef="let element">
|
|
160
|
+
<p class="mb-0">{{ element?.stock_issuances_sum_quantity }}</p>
|
|
161
|
+
<small class="text-secondary" *ngIf="element?.last_stock_issuance">
|
|
162
|
+
last issued on {{ element?.last_stock_issuance?.date | date }}
|
|
163
|
+
</small>
|
|
164
|
+
</td>
|
|
165
|
+
</ng-container>
|
|
166
|
+
|
|
167
|
+
<!-- On Hand Column -->
|
|
168
|
+
<ng-container matColumnDef="on_hand">
|
|
169
|
+
<th mat-header-cell mat-sort-header="stock_balance" *matHeaderCellDef>On Hand</th>
|
|
170
|
+
<td mat-cell *matCellDef="let element">
|
|
171
|
+
{{ element?.stock_balance }}
|
|
172
|
+
</td>
|
|
173
|
+
</ng-container>
|
|
174
|
+
|
|
175
|
+
<!-- Reorder Point Column -->
|
|
176
|
+
<ng-container matColumnDef="reorder_point">
|
|
177
|
+
<th mat-header-cell mat-sort-header *matHeaderCellDef>Reorder Point</th>
|
|
178
|
+
<td mat-cell *matCellDef="let element">
|
|
179
|
+
{{ element.reorder_point }}
|
|
180
|
+
</td>
|
|
181
|
+
</ng-container>
|
|
182
|
+
|
|
183
|
+
<!-- Selling Price Column -->
|
|
184
|
+
<ng-container matColumnDef="sale_price">
|
|
185
|
+
<th mat-header-cell mat-sort-header *matHeaderCellDef>Selling Price</th>
|
|
186
|
+
<td mat-cell *matCellDef="let element">
|
|
187
|
+
{{ element.sale_price | currency }}
|
|
188
|
+
</td>
|
|
189
|
+
</ng-container>
|
|
190
|
+
|
|
191
|
+
<!-- Income Account Column -->
|
|
192
|
+
<ng-container matColumnDef="income_account">
|
|
193
|
+
<th mat-header-cell *matHeaderCellDef>Income Account</th>
|
|
194
|
+
<td mat-cell *matCellDef="let element">
|
|
195
|
+
{{ element?.income_account?.title }}
|
|
196
|
+
</td>
|
|
197
|
+
</ng-container>
|
|
198
|
+
|
|
199
|
+
<!-- Expense Account Column -->
|
|
200
|
+
<ng-container matColumnDef="expense_account">
|
|
201
|
+
<th mat-header-cell *matHeaderCellDef>Expense Account</th>
|
|
202
|
+
<td mat-cell *matCellDef="let element">
|
|
203
|
+
{{ element?.expense_account?.title }}
|
|
204
|
+
</td>
|
|
205
|
+
</ng-container>
|
|
206
|
+
|
|
207
|
+
<!-- Creator Column -->
|
|
208
|
+
<ng-container matColumnDef="creator">
|
|
209
|
+
<th mat-header-cell *matHeaderCellDef>Creator</th>
|
|
210
|
+
<td mat-cell *matCellDef="let element">
|
|
211
|
+
<p class="mb-0">{{ element?.creator?.name }}</p>
|
|
212
|
+
<small class="text-secondary">{{ element?.created_at | date }}</small>
|
|
213
|
+
</td>
|
|
214
|
+
</ng-container>
|
|
215
|
+
|
|
216
|
+
<!-- Actions Column -->
|
|
217
|
+
<ng-container matColumnDef="Actions">
|
|
218
|
+
<th mat-header-cell *matHeaderCellDef>Actions</th>
|
|
219
|
+
<td mat-cell *matCellDef="let element">
|
|
220
|
+
<div class="text-secondary d-flex gap-1">
|
|
221
|
+
<app-product-form-button
|
|
222
|
+
[product]="element"
|
|
223
|
+
></app-product-form-button>
|
|
224
|
+
<mat-icon
|
|
225
|
+
class="cursor-pointer"
|
|
226
|
+
matTooltip="View"
|
|
227
|
+
[routerLink]="[element.id, 'view']"
|
|
228
|
+
routerLinkActive="route-link-active"
|
|
229
|
+
>
|
|
230
|
+
remove_red_eye
|
|
231
|
+
</mat-icon>
|
|
232
|
+
|
|
233
|
+
<app-stock-receipt-form-button
|
|
234
|
+
[product]="element"
|
|
235
|
+
(saved)="reload()"
|
|
236
|
+
></app-stock-receipt-form-button>
|
|
237
|
+
|
|
238
|
+
<app-stock-issue-form-button
|
|
239
|
+
[product]="element"
|
|
240
|
+
(saved)="reload()"
|
|
241
|
+
></app-stock-issue-form-button>
|
|
242
|
+
</div>
|
|
243
|
+
</td>
|
|
244
|
+
</ng-container>
|
|
245
|
+
<tr
|
|
246
|
+
mat-header-row
|
|
247
|
+
*matHeaderRowDef="displayedColumns; sticky: true"
|
|
248
|
+
></tr>
|
|
249
|
+
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
|
|
250
|
+
</table>
|
|
251
|
+
|
|
252
|
+
<mat-progress-bar mode="indeterminate" *ngIf="isLoading"></mat-progress-bar>
|
|
253
|
+
</mat-card-content>
|
|
254
|
+
</mat-card>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from "@angular/core/testing";
|
|
2
|
+
|
|
3
|
+
import { ProductListComponent } from "./product-list.component";
|
|
4
|
+
|
|
5
|
+
describe("ProductListComponent", () => {
|
|
6
|
+
let component: ProductListComponent;
|
|
7
|
+
let fixture: ComponentFixture<ProductListComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ProductListComponent],
|
|
12
|
+
}).compileComponents();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
fixture = TestBed.createComponent(ProductListComponent);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
fixture.detectChanges();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("should create", () => {
|
|
22
|
+
expect(component).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { Component, OnInit } from "@angular/core";
|
|
2
|
+
import { FormBuilder, FormControl, FormGroup } from "@angular/forms";
|
|
3
|
+
import { MatDialog } from "@angular/material/dialog";
|
|
4
|
+
import { MatTableDataSource } from "@angular/material/table";
|
|
5
|
+
import { ActivatedRoute } from "@angular/router";
|
|
6
|
+
import {ColumnConfig, RequestHelperService} from "ngx-techlify-core";
|
|
7
|
+
import { ProductService } from "../product.service";
|
|
8
|
+
import { UntilDestroy } from "@ngneat/until-destroy";
|
|
9
|
+
import { debounceTime } from "rxjs/operators";
|
|
10
|
+
import { ProductFormComponent } from "../product-form/product-form.component";
|
|
11
|
+
import { ProductFormService } from "../product-form.service";
|
|
12
|
+
@UntilDestroy()
|
|
13
|
+
@Component({
|
|
14
|
+
selector: "app-product-list",
|
|
15
|
+
templateUrl: "./product-list.component.html",
|
|
16
|
+
})
|
|
17
|
+
export class ProductListComponent implements OnInit {
|
|
18
|
+
public filterForm: FormGroup;
|
|
19
|
+
public lastPage!: number;
|
|
20
|
+
public page: number = 1;
|
|
21
|
+
public perPage: number = 25;
|
|
22
|
+
public totalItems = 0;
|
|
23
|
+
public currentPage = 1;
|
|
24
|
+
public num_items = 25;
|
|
25
|
+
public routeFilters: any;
|
|
26
|
+
public products: any[] = [];
|
|
27
|
+
public dataSource = new MatTableDataSource();
|
|
28
|
+
isLoading: boolean = false;
|
|
29
|
+
|
|
30
|
+
columnConfig: ColumnConfig[] = [
|
|
31
|
+
{ label: '#', def: '#', isSelected: true, isEditable: true },
|
|
32
|
+
{ label: 'Name', def: 'name', isSelected: true, isEditable: true },
|
|
33
|
+
{ label: 'SKU', def: 'sku', isSelected: true, isEditable: true },
|
|
34
|
+
{ label: 'Categories', def: 'categories', isSelected: true, isEditable: true },
|
|
35
|
+
{ label: 'Initial Quantity', def: 'initial_quantity', isSelected: true, isEditable: true },
|
|
36
|
+
{ label: 'Reorder Point', def: 'reorder_point', isSelected: true, isEditable: true },
|
|
37
|
+
{ label: 'Stock Receipts', def: 'stock_receipts', isSelected: true, isEditable: true },
|
|
38
|
+
{ label: 'Stock Issuances', def: 'stock_issuances', isSelected: true, isEditable: true },
|
|
39
|
+
{ label: 'On Hand', def: 'on_hand', isSelected: true, isEditable: true },
|
|
40
|
+
{ label: 'Sale Price', def: 'sale_price', isSelected: true, isEditable: true },
|
|
41
|
+
{ label: 'Income Account', def: 'income_account', isSelected: false, isEditable: true },
|
|
42
|
+
{ label: 'Expense Account', def: 'expense_account', isSelected: false, isEditable: true },
|
|
43
|
+
{ label: 'Creator', def: 'creator', isSelected: false, isEditable: true },
|
|
44
|
+
{ label: 'Actions', def: 'Actions', isSelected: true, isEditable: true },
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
selectedColumns: ColumnConfig[] = this.columnConfig.filter(col => col.isSelected);
|
|
48
|
+
|
|
49
|
+
get displayedColumns(): string[] {
|
|
50
|
+
return this.selectedColumns.map(col => col.def);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
importId!: number;
|
|
54
|
+
|
|
55
|
+
constructor(
|
|
56
|
+
private fb: FormBuilder,
|
|
57
|
+
private dialog: MatDialog,
|
|
58
|
+
private activatedRoute: ActivatedRoute,
|
|
59
|
+
private productService: ProductService,
|
|
60
|
+
private requestHelperService: RequestHelperService,
|
|
61
|
+
private productFormService: ProductFormService
|
|
62
|
+
) {
|
|
63
|
+
this.filterForm = this.fb.group({
|
|
64
|
+
search: [""],
|
|
65
|
+
category_ids: [""],
|
|
66
|
+
type_ids: [""],
|
|
67
|
+
income_account_ids: [""],
|
|
68
|
+
expense_account_ids: [""],
|
|
69
|
+
sort_by: [""],
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
ngOnInit(): void {
|
|
74
|
+
if (this.activatedRoute.snapshot.params?.["import_id"]) {
|
|
75
|
+
this.importId = parseInt(
|
|
76
|
+
this.activatedRoute.snapshot.params?.["import_id"]
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
// update form with URL query params
|
|
80
|
+
this.requestHelperService.updateFormWithQueryParams(this.filterForm, {
|
|
81
|
+
type_ids: { multiple: true },
|
|
82
|
+
category_ids: { multiple: true },
|
|
83
|
+
income_account_ids: { multiple: true },
|
|
84
|
+
expense_account_ids: { multiple: true },
|
|
85
|
+
});
|
|
86
|
+
// Update URL query params on filter change
|
|
87
|
+
this.filterForm.valueChanges.pipe(debounceTime(800)).subscribe(() => {
|
|
88
|
+
this.requestHelperService.updateQueryParams(
|
|
89
|
+
this.requestHelperService.convertToFormData({
|
|
90
|
+
...this.filterForm.value,
|
|
91
|
+
})
|
|
92
|
+
);
|
|
93
|
+
});
|
|
94
|
+
// fetch task on params change
|
|
95
|
+
this.activatedRoute.queryParams
|
|
96
|
+
.pipe(debounceTime(800))
|
|
97
|
+
.subscribe(() => this.reload());
|
|
98
|
+
// listen form product add or update event and reload.
|
|
99
|
+
this.productFormService.isListUpdated().subscribe((val: boolean) => {
|
|
100
|
+
if (val && !this.isLoading) {
|
|
101
|
+
this.reload();
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
loadData() {
|
|
107
|
+
let params: any = {
|
|
108
|
+
...this.requestHelperService.convertToFormData(this.filterForm.value),
|
|
109
|
+
};
|
|
110
|
+
params.page = this.page;
|
|
111
|
+
params.perPage = this.perPage;
|
|
112
|
+
params.num_items = this.num_items + "|" + this.currentPage;
|
|
113
|
+
params.with = "categories,lastStockReceipt,lastStockIssuance,creator";
|
|
114
|
+
if (this.importId) {
|
|
115
|
+
params.import_id = this.importId;
|
|
116
|
+
}
|
|
117
|
+
this.isLoading = true;
|
|
118
|
+
|
|
119
|
+
this.productService.index(params).subscribe({
|
|
120
|
+
next: (res: any) => {
|
|
121
|
+
this.isLoading = false;
|
|
122
|
+
this.dataSource = new MatTableDataSource(
|
|
123
|
+
this.dataSource.data.concat(res?.data)
|
|
124
|
+
);
|
|
125
|
+
this.totalItems = res.total;
|
|
126
|
+
// stop reloading data once data loaded.
|
|
127
|
+
this.productFormService.listUpdated(false);
|
|
128
|
+
},
|
|
129
|
+
error: () => (this.isLoading = false),
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
reload() {
|
|
134
|
+
if (this.isLoading) return;
|
|
135
|
+
this.dataSource = new MatTableDataSource();
|
|
136
|
+
this.currentPage = 1;
|
|
137
|
+
this.loadData();
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
modifyProduct(model?: any) {
|
|
141
|
+
const dialogRef = this.dialog.open(ProductFormComponent, {
|
|
142
|
+
width: "600px",
|
|
143
|
+
data: {
|
|
144
|
+
details: model,
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
dialogRef.afterClosed().subscribe((result) => {
|
|
148
|
+
if (result) {
|
|
149
|
+
this.reload();
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
assignFilter(column: any, direction: string) {
|
|
155
|
+
if (column) {
|
|
156
|
+
return this.filterForm.get("sort_by")?.setValue(column + "|" + direction);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
sortColumn(event: any) {
|
|
161
|
+
var direction = event.direction.toString().toUpperCase();
|
|
162
|
+
this.assignFilter(event.active, direction);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
onScroll() {
|
|
166
|
+
if (this.totalItems > this.dataSource.data.length) {
|
|
167
|
+
this.currentPage += 1;
|
|
168
|
+
this.loadData();
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<div>
|
|
2
|
+
<form [formGroup]="productMeasureForm" (ngSubmit)="save()">
|
|
3
|
+
<h3 class="text-center">Create/Update Product Measure</h3>
|
|
4
|
+
<div fxLayout="column">
|
|
5
|
+
<div fxLayout="column">
|
|
6
|
+
<mat-form-field>
|
|
7
|
+
<input
|
|
8
|
+
matInput
|
|
9
|
+
placeholder="Title"
|
|
10
|
+
formControlName="title"
|
|
11
|
+
required
|
|
12
|
+
/>
|
|
13
|
+
<mat-error *ngIf="isFieldValid('title')"
|
|
14
|
+
>{{ getErrorMessage("title") }}
|
|
15
|
+
</mat-error>
|
|
16
|
+
</mat-form-field>
|
|
17
|
+
<mat-form-field>
|
|
18
|
+
<input
|
|
19
|
+
matInput
|
|
20
|
+
placeholder="Description"
|
|
21
|
+
formControlName="description"
|
|
22
|
+
required
|
|
23
|
+
/>
|
|
24
|
+
<mat-error *ngIf="isFieldValid('description')"
|
|
25
|
+
>{{ getErrorMessage("description") }}
|
|
26
|
+
</mat-error>
|
|
27
|
+
</mat-form-field>
|
|
28
|
+
<div fxFlex="100%" fxLayout fxLayoutGap="1rem">
|
|
29
|
+
<button
|
|
30
|
+
mat-button
|
|
31
|
+
class="mt-2"
|
|
32
|
+
type="button"
|
|
33
|
+
(click)="dialogRef.close()"
|
|
34
|
+
>
|
|
35
|
+
Cancel
|
|
36
|
+
</button>
|
|
37
|
+
<button mat-raised-button color="primary" class="mt-2" type="submit">
|
|
38
|
+
Save
|
|
39
|
+
</button>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</form>
|
|
44
|
+
</div>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from "@angular/core/testing";
|
|
2
|
+
|
|
3
|
+
import { ProductMeasureFormComponent } from "./product-measure-form.component";
|
|
4
|
+
|
|
5
|
+
describe("ProductMeasureFormComponent", () => {
|
|
6
|
+
let component: ProductMeasureFormComponent;
|
|
7
|
+
let fixture: ComponentFixture<ProductMeasureFormComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ProductMeasureFormComponent],
|
|
12
|
+
}).compileComponents();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
fixture = TestBed.createComponent(ProductMeasureFormComponent);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
fixture.detectChanges();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("should create", () => {
|
|
22
|
+
expect(component).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Component, Inject, OnInit } from "@angular/core";
|
|
2
|
+
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
|
|
3
|
+
import { MatDialogRef, MAT_DIALOG_DATA } from "@angular/material/dialog";
|
|
4
|
+
import { NgxSpinnerService } from "ngx-spinner";
|
|
5
|
+
import {
|
|
6
|
+
AlertService,
|
|
7
|
+
ErrorHandlerService,
|
|
8
|
+
FormValidatorService,
|
|
9
|
+
} from "ngx-techlify-core";
|
|
10
|
+
import { ProductService } from "../product.service";
|
|
11
|
+
|
|
12
|
+
const errorMessages: any = {
|
|
13
|
+
title: {
|
|
14
|
+
required: "Please Enter Title",
|
|
15
|
+
},
|
|
16
|
+
description: {
|
|
17
|
+
required: "Please Enter Description",
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
@Component({
|
|
22
|
+
selector: "app-product-measure-form",
|
|
23
|
+
templateUrl: "./product-measure-form.component.html",
|
|
24
|
+
})
|
|
25
|
+
export class ProductMeasureFormComponent implements OnInit {
|
|
26
|
+
public productMeasureForm: FormGroup;
|
|
27
|
+
public isWorking: boolean = false;
|
|
28
|
+
public isUpdate: boolean = false;
|
|
29
|
+
constructor(
|
|
30
|
+
private productService: ProductService,
|
|
31
|
+
private fb: FormBuilder,
|
|
32
|
+
public dialogRef: MatDialogRef<ProductMeasureFormComponent>,
|
|
33
|
+
@Inject(MAT_DIALOG_DATA) public data: any,
|
|
34
|
+
private spinnerService: NgxSpinnerService,
|
|
35
|
+
private formValidatorService: FormValidatorService,
|
|
36
|
+
private errorService: ErrorHandlerService,
|
|
37
|
+
private alertService: AlertService
|
|
38
|
+
) {
|
|
39
|
+
this.productMeasureForm = this.fb.group({
|
|
40
|
+
id: [""],
|
|
41
|
+
title: ["", Validators.compose([Validators.required])],
|
|
42
|
+
description: ["", Validators.compose([Validators.required])],
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
ngOnInit(): void {
|
|
47
|
+
if (this.data.details) {
|
|
48
|
+
this.isUpdate = true;
|
|
49
|
+
this.productMeasureForm.patchValue(this.data.details);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
async save() {
|
|
54
|
+
if (!this.productMeasureForm.valid) {
|
|
55
|
+
this.alertService.addAlert("Please Fill All Required Fields", "warn");
|
|
56
|
+
this.productMeasureForm.markAllAsTouched();
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
let productMeasure = this.productMeasureForm.value;
|
|
60
|
+
try {
|
|
61
|
+
this.spinnerService.show();
|
|
62
|
+
this.isWorking = true;
|
|
63
|
+
let result = this.isUpdate
|
|
64
|
+
? await this.productService.updateProductMeasure(productMeasure)
|
|
65
|
+
: await this.productService.createProductMeasure(productMeasure);
|
|
66
|
+
this.dialogRef.close(result);
|
|
67
|
+
} catch (error) {
|
|
68
|
+
this.errorService.handleError(error);
|
|
69
|
+
} finally {
|
|
70
|
+
this.isWorking = false;
|
|
71
|
+
this.spinnerService.hide();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Method to evaluate form fields
|
|
76
|
+
*/
|
|
77
|
+
isFieldValid(field: string) {
|
|
78
|
+
return this.formValidatorService.isFieldValid(
|
|
79
|
+
field,
|
|
80
|
+
this.productMeasureForm
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Method to find error in form fields
|
|
85
|
+
*/
|
|
86
|
+
getErrorMessage(field: string) {
|
|
87
|
+
return this.formValidatorService.getErrorMessage(
|
|
88
|
+
field,
|
|
89
|
+
this.productMeasureForm,
|
|
90
|
+
errorMessages
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
}
|