Loading src/app/p_product/admin/productCatalogManagement/edit-product-specs/assign-service-specification/assign-service-specification.component.ts +1 −4 Original line number Diff line number Diff line Loading @@ -80,7 +80,7 @@ export class AssignServiceSpecificationComponent implements OnInit { this.dataSource.data = this.selectedSpecs; this.dataSource.sort = this.sort; }, error => console.error(error) error => this.toast.error('Failed to fetch Service Specifications', error) ); } Loading Loading @@ -160,7 +160,6 @@ export class AssignServiceSpecificationComponent implements OnInit { }); dialogRef.afterClosed().subscribe(result => { console.log(result); this.executeAssignment(result); }); } Loading Loading @@ -254,7 +253,6 @@ export class AssignServiceSpecificationComponent implements OnInit { } }, error => { console.error('Update failed', error); this.toast.error('Failed to update Product Specification'); } ); Loading Loading @@ -305,7 +303,6 @@ export class AssignServiceSpecificationComponent implements OnInit { }).subscribe( data => {}, error => { console.error(error); this.toast.warning('Service assigned, but failed to clean up auto-assigned characteristics.'); this.dialogRef.close('updated'); }, Loading src/app/p_product/admin/productCatalogManagement/edit-product-specs/delete-product-spec-characteristics/delete-product-spec-characteristics.component.ts +4 −2 Original line number Diff line number Diff line import { trigger } from "@angular/animations"; import { Component, Inject, OnInit } from "@angular/core"; import { MAT_DIALOG_DATA, MatDialogRef } from "@angular/material/dialog"; import { Toast, ToastrService } from "ngx-toastr"; import { ProductSpecification, ProductSpecificationCharacteristicRes, ProductSpecificationUpdate } from "src/app/openApis/productCatalogManagement/models"; import { ProductSpecificationService } from "src/app/openApis/productCatalogManagement/services"; import { fadeIn, simpleFade } from "src/app/shared/animations/animations"; Loading @@ -20,7 +21,8 @@ export class DeleteProductSpecCharacteristicsComponent implements OnInit { specToBeDeleted: ProductSpecificationCharacteristicRes }, private dialogRef: MatDialogRef<DeleteProductSpecCharacteristicsComponent>, private specService: ProductSpecificationService private specService: ProductSpecificationService, private toast: ToastrService ) { } ngOnInit() { Loading @@ -34,7 +36,7 @@ export class DeleteProductSpecCharacteristicsComponent implements OnInit { this.specService.patchProductSpecification({ id: this.data.productSpec.id, productSpecification: updateSpecObj }).subscribe( data => {}, error => console.error(error), error => this.toast.error("An error occurred while deleting the Product Specification Characteristic"), () => this.dialogRef.close('deleted') ) } Loading src/app/p_product/admin/productCatalogManagement/edit-product-specs/edit-product-spec-characteristics/edit-product-spec-characteristics.component.ts +1 −5 Original line number Diff line number Diff line Loading @@ -192,18 +192,14 @@ export class EditProductSpecCharacteristicsComponent implements OnInit { const updateCharacteristIndex = this.data.productSpec.productSpecCharacteristic.findIndex(char => char.uuid === this.data.specToBeUpdated.uuid) this.data.productSpec.productSpecCharacteristic[updateCharacteristIndex] = this.editFormCharacteristic.getRawValue() } console.log(this.newSpec); console.log(this.data.productSpec); const updateCharacteristicObj: ProductSpecificationUpdate = { productSpecCharacteristic: this.data.productSpec.productSpecCharacteristic } // console.log(updateCharacteristicObj); this.specService.patchProductSpecification({ id: this.data.productSpec.id, productSpecification: updateCharacteristicObj }).subscribe( data => { }, error => { console.error(error); this.toast.error("An error occurred upon updating Spec Characteristics") }, error => this.toast.error("An error occurred upon updating Spec Characteristics"), () => { this.dialogRef.close('updated') } ) } Loading src/app/p_product/admin/productCatalogManagement/edit-product-specs/edit-product-specs.component.ts +11 −5 Original line number Diff line number Diff line Loading @@ -110,7 +110,7 @@ export class EditProductSpecsComponent implements OnInit { retrieveProductSpec() { this.specService.retrieveProductSpecification({id: this.specID}).subscribe( data => this.spec = data, error => {console.error(error), this.toast.error("An error occurred while loading Product Specification")}, error => this.toast.error("An error occurred while loading Product Specification"), () => { if (this.spec) { this.finishedLoading = true Loading Loading @@ -193,7 +193,7 @@ export class EditProductSpecsComponent implements OnInit { if (this.newSpecification) { this.specService.createProductSpecification(updateObj).subscribe( data => { updatedSpec = data }, error => console.error(error), error => this.toast.error("An error occurred while creating the Product Specification"), () => { this.newSpecification = false this.toast.success("Product Specification was successfully created") Loading @@ -204,7 +204,7 @@ export class EditProductSpecsComponent implements OnInit { else { this.specService.patchProductSpecification({ id: this.specID, productSpecification: updateObj }).subscribe( data => { updatedSpec = data }, error => console.error(error), error => this.toast.error("An error occurred while updating the Product Specification"), () => { this.toast.success("Product Specification was successfully updated") this.refreshProductSpecification(updatedSpec) Loading Loading @@ -243,7 +243,7 @@ export class EditProductSpecsComponent implements OnInit { this.specService.patchProductSpecification({id: this.spec.id, productSpecification: updateCharacteristicObj}).subscribe( data => {}, error => console.error(error), error => this.toast.error("An error occurred while cloning the Product Specification Characteristic"), () => { this.toast.success("Product Specification Characteristics list was successfully updated"); this.retrieveProductSpec(); Loading Loading @@ -275,9 +275,12 @@ export class EditProductSpecsComponent implements OnInit { dialogRef.afterClosed().subscribe ( result => { if (result){ this.toast.success("Product Specification Characteristics list was successfully updated") this.toast.success("Product Specification Characteristics list was successfully updated"); this.retrieveProductSpec() } else { this.toast.error("An error occurred while updating Product Specification Characteristics list"); } } ) } Loading @@ -297,6 +300,9 @@ export class EditProductSpecsComponent implements OnInit { this.toast.success("Product Specification Characteristics list was successfully updated"); this.retrieveProductSpec(); } else { this.toast.error("An error occurred while updating Product Specification Characteristics list"); } } ) } Loading Loading
src/app/p_product/admin/productCatalogManagement/edit-product-specs/assign-service-specification/assign-service-specification.component.ts +1 −4 Original line number Diff line number Diff line Loading @@ -80,7 +80,7 @@ export class AssignServiceSpecificationComponent implements OnInit { this.dataSource.data = this.selectedSpecs; this.dataSource.sort = this.sort; }, error => console.error(error) error => this.toast.error('Failed to fetch Service Specifications', error) ); } Loading Loading @@ -160,7 +160,6 @@ export class AssignServiceSpecificationComponent implements OnInit { }); dialogRef.afterClosed().subscribe(result => { console.log(result); this.executeAssignment(result); }); } Loading Loading @@ -254,7 +253,6 @@ export class AssignServiceSpecificationComponent implements OnInit { } }, error => { console.error('Update failed', error); this.toast.error('Failed to update Product Specification'); } ); Loading Loading @@ -305,7 +303,6 @@ export class AssignServiceSpecificationComponent implements OnInit { }).subscribe( data => {}, error => { console.error(error); this.toast.warning('Service assigned, but failed to clean up auto-assigned characteristics.'); this.dialogRef.close('updated'); }, Loading
src/app/p_product/admin/productCatalogManagement/edit-product-specs/delete-product-spec-characteristics/delete-product-spec-characteristics.component.ts +4 −2 Original line number Diff line number Diff line import { trigger } from "@angular/animations"; import { Component, Inject, OnInit } from "@angular/core"; import { MAT_DIALOG_DATA, MatDialogRef } from "@angular/material/dialog"; import { Toast, ToastrService } from "ngx-toastr"; import { ProductSpecification, ProductSpecificationCharacteristicRes, ProductSpecificationUpdate } from "src/app/openApis/productCatalogManagement/models"; import { ProductSpecificationService } from "src/app/openApis/productCatalogManagement/services"; import { fadeIn, simpleFade } from "src/app/shared/animations/animations"; Loading @@ -20,7 +21,8 @@ export class DeleteProductSpecCharacteristicsComponent implements OnInit { specToBeDeleted: ProductSpecificationCharacteristicRes }, private dialogRef: MatDialogRef<DeleteProductSpecCharacteristicsComponent>, private specService: ProductSpecificationService private specService: ProductSpecificationService, private toast: ToastrService ) { } ngOnInit() { Loading @@ -34,7 +36,7 @@ export class DeleteProductSpecCharacteristicsComponent implements OnInit { this.specService.patchProductSpecification({ id: this.data.productSpec.id, productSpecification: updateSpecObj }).subscribe( data => {}, error => console.error(error), error => this.toast.error("An error occurred while deleting the Product Specification Characteristic"), () => this.dialogRef.close('deleted') ) } Loading
src/app/p_product/admin/productCatalogManagement/edit-product-specs/edit-product-spec-characteristics/edit-product-spec-characteristics.component.ts +1 −5 Original line number Diff line number Diff line Loading @@ -192,18 +192,14 @@ export class EditProductSpecCharacteristicsComponent implements OnInit { const updateCharacteristIndex = this.data.productSpec.productSpecCharacteristic.findIndex(char => char.uuid === this.data.specToBeUpdated.uuid) this.data.productSpec.productSpecCharacteristic[updateCharacteristIndex] = this.editFormCharacteristic.getRawValue() } console.log(this.newSpec); console.log(this.data.productSpec); const updateCharacteristicObj: ProductSpecificationUpdate = { productSpecCharacteristic: this.data.productSpec.productSpecCharacteristic } // console.log(updateCharacteristicObj); this.specService.patchProductSpecification({ id: this.data.productSpec.id, productSpecification: updateCharacteristicObj }).subscribe( data => { }, error => { console.error(error); this.toast.error("An error occurred upon updating Spec Characteristics") }, error => this.toast.error("An error occurred upon updating Spec Characteristics"), () => { this.dialogRef.close('updated') } ) } Loading
src/app/p_product/admin/productCatalogManagement/edit-product-specs/edit-product-specs.component.ts +11 −5 Original line number Diff line number Diff line Loading @@ -110,7 +110,7 @@ export class EditProductSpecsComponent implements OnInit { retrieveProductSpec() { this.specService.retrieveProductSpecification({id: this.specID}).subscribe( data => this.spec = data, error => {console.error(error), this.toast.error("An error occurred while loading Product Specification")}, error => this.toast.error("An error occurred while loading Product Specification"), () => { if (this.spec) { this.finishedLoading = true Loading Loading @@ -193,7 +193,7 @@ export class EditProductSpecsComponent implements OnInit { if (this.newSpecification) { this.specService.createProductSpecification(updateObj).subscribe( data => { updatedSpec = data }, error => console.error(error), error => this.toast.error("An error occurred while creating the Product Specification"), () => { this.newSpecification = false this.toast.success("Product Specification was successfully created") Loading @@ -204,7 +204,7 @@ export class EditProductSpecsComponent implements OnInit { else { this.specService.patchProductSpecification({ id: this.specID, productSpecification: updateObj }).subscribe( data => { updatedSpec = data }, error => console.error(error), error => this.toast.error("An error occurred while updating the Product Specification"), () => { this.toast.success("Product Specification was successfully updated") this.refreshProductSpecification(updatedSpec) Loading Loading @@ -243,7 +243,7 @@ export class EditProductSpecsComponent implements OnInit { this.specService.patchProductSpecification({id: this.spec.id, productSpecification: updateCharacteristicObj}).subscribe( data => {}, error => console.error(error), error => this.toast.error("An error occurred while cloning the Product Specification Characteristic"), () => { this.toast.success("Product Specification Characteristics list was successfully updated"); this.retrieveProductSpec(); Loading Loading @@ -275,9 +275,12 @@ export class EditProductSpecsComponent implements OnInit { dialogRef.afterClosed().subscribe ( result => { if (result){ this.toast.success("Product Specification Characteristics list was successfully updated") this.toast.success("Product Specification Characteristics list was successfully updated"); this.retrieveProductSpec() } else { this.toast.error("An error occurred while updating Product Specification Characteristics list"); } } ) } Loading @@ -297,6 +300,9 @@ export class EditProductSpecsComponent implements OnInit { this.toast.success("Product Specification Characteristics list was successfully updated"); this.retrieveProductSpec(); } else { this.toast.error("An error occurred while updating Product Specification Characteristics list"); } } ) } Loading