From cf7fc0633d2cad7903e9597ecf4789dbe053efb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lara=20Mi=C3=B1ones=20Rodr=C3=ADguez?= Date: Tue, 2 Dec 2025 23:00:02 +0100 Subject: [PATCH 1/5] ADD horizontal steps on catalogs and products --- .../create-catalog.component.html | 58 +++-- .../create-catalog.component.ts | 47 +++++ .../update-catalog.component.html | 58 +++-- .../update-catalog.component.ts | 39 ++++ .../create-product-spec.component.html | 198 ++++-------------- .../create-product-spec.component.ts | 88 +++++++- .../update-product-spec.component.html | 196 ++++------------- .../update-product-spec.component.ts | 79 ++++++- src/app/services/price-service.service.ts | 2 +- .../cart-drawer/cart-drawer.component.ts | 82 +++++--- 10 files changed, 438 insertions(+), 409 deletions(-) diff --git a/src/app/pages/seller-offerings/offerings/seller-catalogs/create-catalog/create-catalog.component.html b/src/app/pages/seller-offerings/offerings/seller-catalogs/create-catalog/create-catalog.component.html index b39f2ca2..68008b52 100644 --- a/src/app/pages/seller-offerings/offerings/seller-catalogs/create-catalog/create-catalog.component.html +++ b/src/app/pages/seller-offerings/offerings/seller-catalogs/create-catalog/create-catalog.component.html @@ -26,36 +26,29 @@
-

{{ 'CREATE_CATALOG._new' | translate }}

-
-
-
- - -
- -
+

{{ 'CREATE_CATALOG._new' | translate }}

+
    + @for (step of steps; track i; let i = $index) { +
  1. + + {{ i + 1 }} + + +
  2. + } +
+ +

{{ this.steps[currentStep] }}

+
- @if(showGeneral){ -

{{ 'CREATE_CATALOG._general' | translate }}

+ @if (currentStep === 0) {
{{ 'CREATE_
-
- } - - @if(showSummary){ -

{{ 'CREATE_CATALOG._finish' | translate }}

+ } @else if (currentStep === 1) {
@if(loading){
diff --git a/src/app/pages/seller-offerings/offerings/seller-catalogs/create-catalog/create-catalog.component.ts b/src/app/pages/seller-offerings/offerings/seller-catalogs/create-catalog/create-catalog.component.ts index f80dab4b..cdeb3ae0 100644 --- a/src/app/pages/seller-offerings/offerings/seller-catalogs/create-catalog/create-catalog.component.ts +++ b/src/app/pages/seller-offerings/offerings/seller-catalogs/create-catalog/create-catalog.component.ts @@ -23,6 +23,12 @@ export class CreateCatalogComponent implements OnInit { stepsElements:string[]=['general-info','summary']; stepsCircles:string[]=['general-circle','summary-circle']; + currentStep = 0; + highestStep = 0; + steps = [ + 'General Info', + 'Summary' + ]; //markdown variables: showPreview:boolean=false; @@ -289,4 +295,45 @@ export class CreateCatalogComponent implements OnInit { return false } } + + goToStep(index: number) { + // Solo validar en modo creación + if (index > this.currentStep) { + // Validar el paso actual + const currentStepValid = this.validateCurrentStep(); + if (!currentStepValid) { + return; // No permitir avanzar si el paso actual no es válido + } + } + + this.currentStep = index; + if(this.currentStep>this.highestStep){ + this.highestStep=this.currentStep + } + + if(this.currentStep==1){ + this.showFinish(); + } + } + + validateCurrentStep(): boolean { + switch (this.currentStep) { + case 0: // General Info + return this.generalForm?.valid || false; + case 1: // Product Specification + return true; + default: + return true; + } + } + + canNavigate(index: number) { + return (this.generalForm?.valid && (index <= this.currentStep)) || (this.generalForm?.valid && (index <= this.highestStep)); + } + + handleStepClick(index: number): void { + if (this.canNavigate(index)) { + this.goToStep(index); + } + } } diff --git a/src/app/pages/seller-offerings/offerings/seller-catalogs/update-catalog/update-catalog.component.html b/src/app/pages/seller-offerings/offerings/seller-catalogs/update-catalog/update-catalog.component.html index fa2b7615..c77c1b72 100644 --- a/src/app/pages/seller-offerings/offerings/seller-catalogs/update-catalog/update-catalog.component.html +++ b/src/app/pages/seller-offerings/offerings/seller-catalogs/update-catalog/update-catalog.component.html @@ -26,36 +26,29 @@
-

{{ 'UPDATE_CATALOG._update' | translate }}

-
-
-
- - -
- -
+

{{ 'UPDATE_CATALOG._update' | translate }}

+
    + @for (step of steps; track i; let i = $index) { +
  1. + + {{ i + 1 }} + + +
  2. + } +
+ +

{{ this.steps[currentStep] }}

+
- @if(showGeneral){ -

{{ 'UPDATE_CATALOG._general' | translate }}

+ @if (currentStep === 0) {
{{ 'UPDATE_
-
- } - - @if(showSummary){ -

{{ 'UPDATE_CATALOG._finish' | translate }}

+ } @else if (currentStep === 1) {
@if(loading){
diff --git a/src/app/pages/seller-offerings/offerings/seller-catalogs/update-catalog/update-catalog.component.ts b/src/app/pages/seller-offerings/offerings/seller-catalogs/update-catalog/update-catalog.component.ts index e85f50bf..ff086a4a 100644 --- a/src/app/pages/seller-offerings/offerings/seller-catalogs/update-catalog/update-catalog.component.ts +++ b/src/app/pages/seller-offerings/offerings/seller-catalogs/update-catalog/update-catalog.component.ts @@ -25,6 +25,12 @@ export class UpdateCatalogComponent implements OnInit { stepsElements:string[]=['general-info','summary']; stepsCircles:string[]=['general-circle','summary-circle']; + currentStep = 0; + highestStep = 0; + steps = [ + 'General Info', + 'Summary' + ]; //markdown variables: showPreview:boolean=false; @@ -297,5 +303,38 @@ export class UpdateCatalogComponent implements OnInit { return false } } + + goToStep(index: number) { + + this.currentStep = index; + if(this.currentStep>this.highestStep){ + this.highestStep=this.currentStep + } + + if(this.currentStep==1){ + this.showFinish(); + } + } + + validateCurrentStep(): boolean { + switch (this.currentStep) { + case 0: // General Info + return this.generalForm?.valid || false; + case 1: // Product Specification + return true; + default: + return true; + } + } + + canNavigate(index: number) { + return this.generalForm?.valid + } + + handleStepClick(index: number): void { + if (this.canNavigate(index)) { + this.goToStep(index); + } + } } diff --git a/src/app/pages/seller-offerings/offerings/seller-product-spec/create-product-spec/create-product-spec.component.html b/src/app/pages/seller-offerings/offerings/seller-product-spec/create-product-spec/create-product-spec.component.html index e97e1c51..90c62bde 100644 --- a/src/app/pages/seller-offerings/offerings/seller-product-spec/create-product-spec/create-product-spec.component.html +++ b/src/app/pages/seller-offerings/offerings/seller-product-spec/create-product-spec/create-product-spec.component.html @@ -27,116 +27,27 @@
-

{{ 'CREATE_PROD_SPEC._new' | translate }}

-
-
-
- - - @if(BUNDLE_ENABLED){ -
- - } -
- -
- -
- -
- -
- -
- -
- - -
+

{{ 'CREATE_PROD_SPEC._new' | translate }}

+
    + @for (step of steps; track i; let i = $index) { +
  1. + + {{ i + 1 }} + + +
  2. + } +
+
- @if(showGeneral){ -

{{ 'CREATE_PROD_SPEC._general' | translate }}

+ @if (currentStep === 0) {
@@ -163,28 +74,16 @@

{{ 'CREATE_ - @if(BUNDLE_ENABLED){ -
- -
- }@else{ -
- -
- } +
+ +
} - @if(showBundle){ -

{{ 'CREATE_PROD_SPEC._bundle' | translate }}

+ @if (currentStep === 1 && BUNDLE_ENABLED) {
-
} - @if(showResource){ -

{{ 'CREATE_PROD_SPEC._resource_specs' | translate }}

+ @if ((currentStep === 3 && !BUNDLE_ENABLED) || (currentStep === 4 && BUNDLE_ENABLED)) { @if(loadingResourceSpec){

{{ 'CREATE_

}
-
} - @if(showService){ -

{{ 'CREATE_PROD_SPEC._service_specs' | translate }}

+ @if ((currentStep === 4 && !BUNDLE_ENABLED) || (currentStep === 5 && BUNDLE_ENABLED)) { @if(loadingServiceSpec){

{{ 'CREATE_

}
-
} - @if(showAttach){ + @if ((currentStep === 5 && !BUNDLE_ENABLED) || (currentStep === 6 && BUNDLE_ENABLED)) {
-

{{ 'CREATE_PROD_SPEC._attachments' | translate }}

+

{{ 'CREATE_PROD_SPEC._add_prod_img' | translate }}

{{ 'CREATE_PROD_SPEC._fi

-
-

{{ 'CREATE_PROD_SPEC._add_prod_img' | translate }}

+
@if(showImgPreview){
@@ -1119,7 +1013,7 @@

{{ 'CREATE_PROD_SPEC._add_att

}
-
} - @if(showRelationships){ -

{{ 'CREATE_PROD_SPEC._relationships' | translate }}

+ @if ((currentStep === 6 && !BUNDLE_ENABLED) || (currentStep === 7 && BUNDLE_ENABLED)) {
@if (prodRelationships.length === 0){
@@ -1315,7 +1208,7 @@

{{ 'CREATE_ }

-
} - @if(showSummary){ -

{{ 'CREATE_PROD_SPEC._finish' | translate }}

+ @if ((currentStep === 7 && !BUNDLE_ENABLED) || (currentStep === 8 && BUNDLE_ENABLED)) {
@if(loading){
diff --git a/src/app/pages/seller-offerings/offerings/seller-product-spec/create-product-spec/create-product-spec.component.ts b/src/app/pages/seller-offerings/offerings/seller-product-spec/create-product-spec/create-product-spec.component.ts index efef7bac..cd45a3d3 100644 --- a/src/app/pages/seller-offerings/offerings/seller-product-spec/create-product-spec/create-product-spec.component.ts +++ b/src/app/pages/seller-offerings/offerings/seller-product-spec/create-product-spec/create-product-spec.component.ts @@ -66,6 +66,9 @@ export class CreateProductSpecComponent implements OnInit { stepsElements:string[]=['general-info','bundle','compliance','chars','resource','service','attach','relationships','summary']; stepsCircles:string[]=['general-circle','bundle-circle','compliance-circle','chars-circle','resource-circle','service-circle','attach-circle','relationships-circle','summary-circle']; + currentStep = 0; + highestStep = 0; + steps:any[] = []; showPreview:boolean=false; showEmoji:boolean=false; @@ -217,6 +220,31 @@ export class CreateProductSpecComponent implements OnInit { public files: NgxFileDropEntry[] = []; ngOnInit() { + if(this.BUNDLE_ENABLED){ + this.steps = [ + 'General Info', + 'Bundle', + 'Compliance profile', + 'Characteristics', + 'Resource specifications', + 'Service specifications', + 'Attachments', + 'Relationships', + 'Summary' + ] + } else { + this.steps = [ + 'General Info', + 'Compliance profile', + 'Characteristics', + 'Resource specifications', + 'Service specifications', + 'Attachments', + 'Relationships', + 'Summary' + ] + } + console.log(this.steps) this.initPartyInfo(); } @@ -525,7 +553,7 @@ export class CreateProductSpecComponent implements OnInit { } }); } - if(this.showAttach){ + if((this.currentStep === 5 && !this.BUNDLE_ENABLED) || (this.currentStep === 6 && this.BUNDLE_ENABLED)){ console.log(file) this.attachmentService.uploadFile(fileBody).subscribe({ next: data => { @@ -1387,4 +1415,62 @@ export class CreateProductSpecComponent implements OnInit { } } + goToStep(index: number) { + // Solo validar en modo creación + if (index > this.currentStep) { + // Validar el paso actual + const currentStepValid = this.validateCurrentStep(); + if (!currentStepValid) { + return; // No permitir avanzar si el paso actual no es válido + } + } + + this.currentStep = index; + if(this.currentStep>this.highestStep){ + this.highestStep=this.currentStep + } + this.refreshChars(); + //Resource + if((this.currentStep==4 && this.BUNDLE_ENABLED) || (this.currentStep==3 && !this.BUNDLE_ENABLED)){ + this.getResSpecs(false); + } + //Service + if((this.currentStep==5 && this.BUNDLE_ENABLED) || (this.currentStep==4 && !this.BUNDLE_ENABLED)){ + this.getServSpecs(false); + } + //Attachment + if((this.currentStep==6 && this.BUNDLE_ENABLED) || (this.currentStep==5 && !this.BUNDLE_ENABLED)){ + setTimeout(() => { + initFlowbite(); + }, 100); + } + //rels + if((this.currentStep==7 && this.BUNDLE_ENABLED) || (this.currentStep==6 && !this.BUNDLE_ENABLED)){ + this.getProdSpecsRel(false); + } + //finish + if((this.currentStep==8 && this.BUNDLE_ENABLED) || (this.currentStep==7 && !this.BUNDLE_ENABLED)){ + this.showFinish(); + } + } + + validateCurrentStep(): boolean { + switch (this.currentStep) { + case 0: // General Info + return this.generalForm?.valid || false; + default: + return true; + } + } + + canNavigate(index: number) { + return (this.generalForm?.valid && (index <= this.currentStep)) || (this.generalForm?.valid && (index <= this.highestStep)); + } + + handleStepClick(index: number): void { + if (this.canNavigate(index)) { + this.goToStep(index); + } + } + } \ No newline at end of file diff --git a/src/app/pages/seller-offerings/offerings/seller-product-spec/update-product-spec/update-product-spec.component.html b/src/app/pages/seller-offerings/offerings/seller-product-spec/update-product-spec/update-product-spec.component.html index 1719eb19..482d0f62 100644 --- a/src/app/pages/seller-offerings/offerings/seller-product-spec/update-product-spec/update-product-spec.component.html +++ b/src/app/pages/seller-offerings/offerings/seller-product-spec/update-product-spec/update-product-spec.component.html @@ -27,115 +27,27 @@
-

{{ 'UPDATE_PROD_SPEC._update_prod' | translate }}

-
-
-
- - - @if(BUNDLE_ENABLED){ -
- - } -
- -
- -
- -
- -
- -
- -
- -
+

{{ 'UPDATE_PROD_SPEC._update_prod' | translate }}

+
    + @for (step of steps; track i; let i = $index) { +
  1. + + {{ i + 1 }} + + +
  2. + } +
+
- @if(showGeneral){ -

{{ 'UPDATE_PROD_SPEC._general' | translate }}

+ @if (currentStep === 0) {
@@ -238,28 +150,16 @@

{{ 'UPDATE_ - @if(BUNDLE_ENABLED){ -
- -
- }@else{ -
- -
- } +
+ +
} - @if(showBundle){ -

{{ 'UPDATE_PROD_SPEC._bundle' | translate }}

+ @if ((currentStep === 1 && !BUNDLE_ENABLED) || (currentStep === 2 && BUNDLE_ENABLED)) {
-
} - @if(showResource){ -

{{ 'UPDATE_PROD_SPEC._resource_specs' | translate }}

+ @if ((currentStep === 3 && !BUNDLE_ENABLED) || (currentStep === 4 && BUNDLE_ENABLED)) { @if(loadingResourceSpec){

{{ 'UPDATE_

}
-
} - @if(showService){ -

{{ 'UPDATE_PROD_SPEC._service_specs' | translate }}

+ @if ((currentStep === 4 && !BUNDLE_ENABLED) || (currentStep === 5 && BUNDLE_ENABLED)) { @if(loadingServiceSpec){

{{ 'UPDATE_

}
-
} - @if(showAttach){ + @if ((currentStep === 5 && !BUNDLE_ENABLED) || (currentStep === 6 && BUNDLE_ENABLED)) {
-

{{ 'UPDATE_PROD_SPEC._attachments' | translate }}

+

{{ 'UPDATE_PROD_SPEC._add_prod_img' | translate }}

{{ 'UPDATE_PROD_SPEC._fi

- -

{{ 'UPDATE_PROD_SPEC._add_prod_img' | translate }}

+ @if(showImgPreview){
@@ -1229,7 +1125,7 @@

{{ 'UPDATE_PROD_SPEC._add_att

}
-
} - @if(showRelationships){ -

{{ 'UPDATE_PROD_SPEC._relationships' | translate }}

+ @if ((currentStep === 6 && !BUNDLE_ENABLED) || (currentStep === 7 && BUNDLE_ENABLED)) {
@if (prodRelationships.length === 0){
@@ -1405,7 +1300,7 @@

{{ 'UPDATE_ }

-
} - @if(showSummary){ -

{{ 'UPDATE_PROD_SPEC._finish' | translate }}

+ @if ((currentStep === 7 && !BUNDLE_ENABLED) || (currentStep === 8 && BUNDLE_ENABLED)) {
@if(loading){
diff --git a/src/app/pages/seller-offerings/offerings/seller-product-spec/update-product-spec/update-product-spec.component.ts b/src/app/pages/seller-offerings/offerings/seller-product-spec/update-product-spec/update-product-spec.component.ts index a4d3e922..017c97ce 100644 --- a/src/app/pages/seller-offerings/offerings/seller-product-spec/update-product-spec/update-product-spec.component.ts +++ b/src/app/pages/seller-offerings/offerings/seller-product-spec/update-product-spec/update-product-spec.component.ts @@ -60,6 +60,9 @@ export class UpdateProductSpecComponent implements OnInit { stepsElements:string[]=['general-info','bundle','compliance','chars','resource','service','attach','relationships','summary']; stepsCircles:string[]=['general-circle','bundle-circle','compliance-circle','chars-circle','resource-circle','service-circle','attach-circle','relationships-circle','summary-circle']; + currentStep = 0; + highestStep = 0; + steps:any[] = []; showPreview:boolean=false; showEmoji:boolean=false; @@ -215,6 +218,30 @@ export class UpdateProductSpecComponent implements OnInit { public files: NgxFileDropEntry[] = []; ngOnInit() { + if(this.BUNDLE_ENABLED){ + this.steps = [ + 'General Info', + 'Bundle', + 'Compliance profile', + 'Characteristics', + 'Resource specifications', + 'Service specifications', + 'Attachments', + 'Relationships', + 'Summary' + ] + } else { + this.steps = [ + 'General Info', + 'Compliance profile', + 'Characteristics', + 'Resource specifications', + 'Service specifications', + 'Attachments', + 'Relationships', + 'Summary' + ] + } this.initPartyInfo(); console.log(this.prod) this.populateProductInfo(); @@ -729,7 +756,7 @@ export class UpdateProductSpecComponent implements OnInit { } }); } - if(this.showAttach){ + if((this.currentStep === 5 && !this.BUNDLE_ENABLED) || (this.currentStep === 6 && this.BUNDLE_ENABLED)){ console.log(file) this.attachmentService.uploadFile(fileBody).subscribe({ next: data => { @@ -1620,4 +1647,54 @@ export class UpdateProductSpecComponent implements OnInit { } } + goToStep(index: number) { + + this.currentStep = index; + if(this.currentStep>this.highestStep){ + this.highestStep=this.currentStep + } + this.refreshChars(); + //Resource + if((this.currentStep==4 && this.BUNDLE_ENABLED) || (this.currentStep==3 && !this.BUNDLE_ENABLED)){ + this.getResSpecs(false); + } + //Service + if((this.currentStep==5 && this.BUNDLE_ENABLED) || (this.currentStep==4 && !this.BUNDLE_ENABLED)){ + this.getServSpecs(false); + } + //Attachment + if((this.currentStep==6 && this.BUNDLE_ENABLED) || (this.currentStep==5 && !this.BUNDLE_ENABLED)){ + setTimeout(() => { + initFlowbite(); + }, 100); + } + //rels + if((this.currentStep==7 && this.BUNDLE_ENABLED) || (this.currentStep==6 && !this.BUNDLE_ENABLED)){ + this.getProdSpecsRel(false); + } + //finish + if((this.currentStep==8 && this.BUNDLE_ENABLED) || (this.currentStep==7 && !this.BUNDLE_ENABLED)){ + this.showFinish(); + } + } + + validateCurrentStep(): boolean { + switch (this.currentStep) { + case 0: // General Info + return this.generalForm?.valid || false; + default: + return true; + } + } + + canNavigate(index: number) { + return this.generalForm?.valid + } + + handleStepClick(index: number): void { + if (this.canNavigate(index)) { + this.goToStep(index); + } + } + } diff --git a/src/app/services/price-service.service.ts b/src/app/services/price-service.service.ts index 47fdfcdf..f0cdb8e2 100644 --- a/src/app/services/price-service.service.ts +++ b/src/app/services/price-service.service.ts @@ -107,7 +107,7 @@ export class PriceServiceService { if (offering?.productOfferingPrice && offering?.productOfferingPrice.length > 0) { // Check if the first POP is a custom one const pop = await this.getProductPrice(offering.productOfferingPrice[0].id); - isCustom = pop.priceType.toLowerCase() === 'custom'; + isCustom = pop.priceType?.toLowerCase() === 'custom'; } return isCustom; diff --git a/src/app/shared/cart-drawer/cart-drawer.component.ts b/src/app/shared/cart-drawer/cart-drawer.component.ts index fdf16b04..59dd3d1a 100644 --- a/src/app/shared/cart-drawer/cart-drawer.component.ts +++ b/src/app/shared/cart-drawer/cart-drawer.component.ts @@ -26,6 +26,8 @@ export class CartDrawerComponent implements OnInit{ showBackDrop:boolean=true; check_custom:boolean=false; loading:boolean=false; + errorMessage:string=''; + showError:boolean=false; constructor( private localStorage: LocalStorageService, @@ -46,42 +48,16 @@ export class CartDrawerComponent implements OnInit{ ngOnInit(): void { this.loading=true; this.showBackDrop=true; - this.cartService.getShoppingCart().then(async data => { - console.log('---CARRITO API---') - console.log(data) - this.items=data; - await this.getProviderInfo(); - this.groupItemsByOwner(); - this.loading=false; - this.cdr.detectChanges(); - console.log('------------------') - }) + this.getCart(); + this.eventMessage.messages$.subscribe(ev => { if(ev.type === 'AddedCartItem') { console.log('Elemento añadido') this.loading=true; - this.cartService.getShoppingCart().then(async data => { - console.log('---CARRITO API---') - console.log(data) - this.items=data; - await this.getProviderInfo(); - this.groupItemsByOwner(); - this.loading=false; - this.cdr.detectChanges(); - console.log('------------------') - }) + this.getCart(); } else if(ev.type === 'RemovedCartItem') { this.loading=true; - this.cartService.getShoppingCart().then(async data => { - console.log('---CARRITO API---') - console.log(data) - this.items=data; - await this.getProviderInfo(); - this.groupItemsByOwner(); - this.loading=false; - this.cdr.detectChanges(); - console.log('------------------') - }) + this.getCart(); } }) console.log('Elementos en el carrito....') @@ -92,6 +68,31 @@ export class CartDrawerComponent implements OnInit{ return Object.keys; } + getCart(){ + try { + this.cartService.getShoppingCart().then(async data => { + console.log('---CARRITO API---') + console.log(data) + this.items=data; + await this.getProviderInfo(); + this.groupItemsByOwner(); + this.loading=false; + this.cdr.detectChanges(); + console.log('------------------') + }) + } catch (error) { + this.loading=false; + this.handleError(error, 'There was an error while retrieving the cart!'); + } + } + + private handleError(error: any, defaultMessage: string) { + console.error(defaultMessage, error); + this.errorMessage = error?.error?.error ? `Error: ${error.error.error}` : defaultMessage; + this.showError = true; + setTimeout(() => (this.showError = false), 3000); + } + hasKey(obj: any, key: string): boolean { return key in obj; } @@ -119,9 +120,22 @@ export class CartDrawerComponent implements OnInit{ async getProviderInfo(){ for(let i=0; i < this.items.length; i++){ - let offer = await this.api.getProductById(this.items[i].id); - let product = await this.api.getProductSpecification(offer.productSpecification.id) - this.items[i]['relatedParty']=product.relatedParty + try { + let offer = await this.api.getProductById(this.items[i].id); + let product = await this.api.getProductSpecification(offer.productSpecification.id) + this.items[i]['relatedParty']=product.relatedParty + } catch (error) { + console.log('--- not found?') + console.log(error) + if((error as any).status==404){ + await this.cartService.removeItemShoppingCart(this.items[i].id); + console.log('deleted'); + this.eventMessage.emitRemovedCartItem(this.items[i] as cartProduct); + } + this.loading=false; + this.handleError(error, "There was an error while retrieving cart's product information!"); + } + } } @@ -129,7 +143,7 @@ export class CartDrawerComponent implements OnInit{ const groupedByOwner: any[][] = Object.values( this.items.reduce((groups: any, item: any) => { const owner = item.relatedParty - ?.find((rp: any) => rp.role === 'Owner') + ?.find((rp: any) => rp.role === 'Seller') ?.id; if (owner) { From 9b9e1c5bfa9ea5395056a4c47326cf1ed6d5d1de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lara=20Mi=C3=B1ones=20Rodr=C3=ADguez?= Date: Wed, 3 Dec 2025 10:48:47 +0100 Subject: [PATCH 2/5] ADD horizontal steps on services and resources forms --- .../update-product-spec.component.html | 3 +- .../create-resource-spec.component.html | 70 ++++-------- .../create-resource-spec.component.ts | 47 ++++++++ .../update-resource-spec.component.html | 107 ++++-------------- .../update-resource-spec.component.ts | 44 +++++++ .../create-service-spec.component.html | 70 ++++-------- .../create-service-spec.component.ts | 47 ++++++++ .../update-service-spec.component.html | 70 ++++-------- .../update-service-spec.component.ts | 44 +++++++ src/app/services/app-init.service.ts | 2 +- 10 files changed, 280 insertions(+), 224 deletions(-) diff --git a/src/app/pages/seller-offerings/offerings/seller-product-spec/update-product-spec/update-product-spec.component.html b/src/app/pages/seller-offerings/offerings/seller-product-spec/update-product-spec/update-product-spec.component.html index 482d0f62..1545c29f 100644 --- a/src/app/pages/seller-offerings/offerings/seller-product-spec/update-product-spec/update-product-spec.component.html +++ b/src/app/pages/seller-offerings/offerings/seller-product-spec/update-product-spec/update-product-spec.component.html @@ -159,7 +159,7 @@

{{ 'UP

} - @if ((currentStep === 1 && !BUNDLE_ENABLED) || (currentStep === 2 && BUNDLE_ENABLED)) { + @if (currentStep === 1 && BUNDLE_ENABLED) {
} @if ((currentStep === 1 && !BUNDLE_ENABLED) || (currentStep === 2 && BUNDLE_ENABLED)) { -

{{ 'UPDATE_PROD_SPEC._comp_profile' | translate }}

{{ 'UPDATE_PROD_SPEC._self_attestation' | translate }}

diff --git a/src/app/pages/seller-offerings/offerings/seller-resource-spec/create-resource-spec/create-resource-spec.component.html b/src/app/pages/seller-offerings/offerings/seller-resource-spec/create-resource-spec/create-resource-spec.component.html index 1d784b92..a2c8e727 100644 --- a/src/app/pages/seller-offerings/offerings/seller-resource-spec/create-resource-spec/create-resource-spec.component.html +++ b/src/app/pages/seller-offerings/offerings/seller-resource-spec/create-resource-spec/create-resource-spec.component.html @@ -26,47 +26,27 @@
-

{{ 'CREATE_RES_SPEC._new' | translate }}

-
-
-
- - -
- -
- -
+

{{ 'CREATE_RES_SPEC._new' | translate }}

+
    + @for (step of steps; track i; let i = $index) { +
  1. + + {{ i + 1 }} + + +
  2. + } +
+
- @if(showGeneral){ -

{{ 'CREATE_RES_SPEC._general' | translate }}

+ @if (currentStep === 0) {
{{ 'CREATE_
-
} - @if(showChars){ -

{{ 'CREATE_RES_SPEC._chars' | translate }}

+ @if (currentStep === 1) { @if (prodChars.length === 0){
}
-
} - @if(showSummary){ -

{{ 'CREATE_PROD_SPEC._finish' | translate }}

+ @if (currentStep === 2) {
@if(loading){
diff --git a/src/app/pages/seller-offerings/offerings/seller-resource-spec/create-resource-spec/create-resource-spec.component.ts b/src/app/pages/seller-offerings/offerings/seller-resource-spec/create-resource-spec/create-resource-spec.component.ts index 1ac7c88c..b97f1e9c 100644 --- a/src/app/pages/seller-offerings/offerings/seller-resource-spec/create-resource-spec/create-resource-spec.component.ts +++ b/src/app/pages/seller-offerings/offerings/seller-resource-spec/create-resource-spec/create-resource-spec.component.ts @@ -27,6 +27,13 @@ export class CreateResourceSpecComponent implements OnInit { stepsElements:string[]=['general-info','chars','summary']; stepsCircles:string[]=['general-circle','chars-circle','summary-circle']; + currentStep = 0; + highestStep = 0; + steps = [ + 'General Info', + 'Characteristics', + 'Summary' + ]; //markdown variables: showPreview:boolean=false; @@ -470,4 +477,44 @@ export class CreateResourceSpecComponent implements OnInit { return false } } + + goToStep(index: number) { + // Solo validar en modo creación + if (index > this.currentStep) { + // Validar el paso actual + const currentStepValid = this.validateCurrentStep(); + if (!currentStepValid) { + return; // No permitir avanzar si el paso actual no es válido + } + } + + this.currentStep = index; + if(this.currentStep>this.highestStep){ + this.highestStep=this.currentStep + } + this.refreshChars(); + //finish + if(this.currentStep==2){ + this.showFinish(); + } + } + + validateCurrentStep(): boolean { + switch (this.currentStep) { + case 0: // General Info + return this.generalForm?.valid || false; + default: + return true; + } + } + + canNavigate(index: number) { + return (this.generalForm?.valid && (index <= this.currentStep)) || (this.generalForm?.valid && (index <= this.highestStep)); + } + + handleStepClick(index: number): void { + if (this.canNavigate(index)) { + this.goToStep(index); + } + } } diff --git a/src/app/pages/seller-offerings/offerings/seller-resource-spec/update-resource-spec/update-resource-spec.component.html b/src/app/pages/seller-offerings/offerings/seller-resource-spec/update-resource-spec/update-resource-spec.component.html index 4b46f733..a4b84551 100644 --- a/src/app/pages/seller-offerings/offerings/seller-resource-spec/update-resource-spec/update-resource-spec.component.html +++ b/src/app/pages/seller-offerings/offerings/seller-resource-spec/update-resource-spec/update-resource-spec.component.html @@ -26,47 +26,27 @@
-

{{ 'UPDATE_RES_SPEC._update_res' | translate }}

-
-
-
- - -
- -
- -
+

{{ 'UPDATE_RES_SPEC._update_res' | translate }}

+
    + @for (step of steps; track i; let i = $index) { +
  1. + + {{ i + 1 }} + + +
  2. + } +
+
- @if(showGeneral){ -

{{ 'UPDATE_RES_SPEC._general' | translate }}

+ @if (currentStep === 0) {
{{ 'UPDATE_
-
} - @if(showChars){ -

{{ 'UPDATE_RES_SPEC._chars' | translate }}

- + @if (currentStep === 1) { @if (prodChars.length === 0){
+

{{ 'CREATE_SERV_SPEC._new' | translate }}

+
    + @for (step of steps; track i; let i = $index) { +
  1. + + {{ i + 1 }} + + +
  2. + } +
+
- @if(showGeneral){ -

{{ 'CREATE_SERV_SPEC._general' | translate }}

+ @if (currentStep === 0) {
{{ 'CREATE_
-
} - @if(showChars){ -

{{ 'CREATE_SERV_SPEC._chars' | translate }}

+ @if (currentStep === 1) { @if (prodChars.length === 0){
}
-
} - @if(showSummary){ -

{{ 'CREATE_PROD_SPEC._finish' | translate }}

+ @if (currentStep === 2) {
@if(loading){
diff --git a/src/app/pages/seller-offerings/offerings/seller-service-spec/create-service-spec/create-service-spec.component.ts b/src/app/pages/seller-offerings/offerings/seller-service-spec/create-service-spec/create-service-spec.component.ts index cbcd405d..931eccf1 100644 --- a/src/app/pages/seller-offerings/offerings/seller-service-spec/create-service-spec/create-service-spec.component.ts +++ b/src/app/pages/seller-offerings/offerings/seller-service-spec/create-service-spec/create-service-spec.component.ts @@ -27,6 +27,13 @@ export class CreateServiceSpecComponent implements OnInit { stepsElements:string[]=['general-info','chars','summary']; stepsCircles:string[]=['general-circle','chars-circle','summary-circle']; + currentStep = 0; + highestStep = 0; + steps = [ + 'General Info', + 'Characteristics', + 'Summary' + ]; //markdown variables: showPreview:boolean=false; @@ -462,4 +469,44 @@ export class CreateServiceSpecComponent implements OnInit { } } + goToStep(index: number) { + // Solo validar en modo creación + if (index > this.currentStep) { + // Validar el paso actual + const currentStepValid = this.validateCurrentStep(); + if (!currentStepValid) { + return; // No permitir avanzar si el paso actual no es válido + } + } + + this.currentStep = index; + if(this.currentStep>this.highestStep){ + this.highestStep=this.currentStep + } + this.refreshChars(); + //finish + if(this.currentStep==2){ + this.showFinish(); + } + } + + validateCurrentStep(): boolean { + switch (this.currentStep) { + case 0: // General Info + return this.generalForm?.valid || false; + default: + return true; + } + } + + canNavigate(index: number) { + return (this.generalForm?.valid && (index <= this.currentStep)) || (this.generalForm?.valid && (index <= this.highestStep)); + } + + handleStepClick(index: number): void { + if (this.canNavigate(index)) { + this.goToStep(index); + } + } + } diff --git a/src/app/pages/seller-offerings/offerings/seller-service-spec/update-service-spec/update-service-spec.component.html b/src/app/pages/seller-offerings/offerings/seller-service-spec/update-service-spec/update-service-spec.component.html index ded8bef9..28c07cde 100644 --- a/src/app/pages/seller-offerings/offerings/seller-service-spec/update-service-spec/update-service-spec.component.html +++ b/src/app/pages/seller-offerings/offerings/seller-service-spec/update-service-spec/update-service-spec.component.html @@ -26,47 +26,27 @@
-

{{ 'UPDATE_SERV_SPEC._update_serv' | translate }}

-
-
-
- - -
- -
- -
+

{{ 'UPDATE_SERV_SPEC._update_serv' | translate }}

+
    + @for (step of steps; track i; let i = $index) { +
  1. + + {{ i + 1 }} + + +
  2. + } +
+
- @if(showGeneral){ -

{{ 'UPDATE_SERV_SPEC._general' | translate }}

+ @if (currentStep === 0) {
{{ 'UPDATE_
-
} - @if(showChars){ -

{{ 'UPDATE_SERV_SPEC._chars' | translate }}

+ @if (currentStep === 1) { @if (prodChars.length === 0){
}
-
} - @if(showSummary){ -

{{ 'CREATE_PROD_SPEC._finish' | translate }}

+ @if (currentStep === 2) {
@if(loading){
diff --git a/src/app/pages/seller-offerings/offerings/seller-service-spec/update-service-spec/update-service-spec.component.ts b/src/app/pages/seller-offerings/offerings/seller-service-spec/update-service-spec/update-service-spec.component.ts index bb0c96fc..d26876e3 100644 --- a/src/app/pages/seller-offerings/offerings/seller-service-spec/update-service-spec/update-service-spec.component.ts +++ b/src/app/pages/seller-offerings/offerings/seller-service-spec/update-service-spec/update-service-spec.component.ts @@ -29,6 +29,13 @@ export class UpdateServiceSpecComponent implements OnInit { stepsElements:string[]=['general-info','chars','summary']; stepsCircles:string[]=['general-circle','chars-circle','summary-circle']; + currentStep = 0; + highestStep = 0; + steps = [ + 'General Info', + 'Characteristics', + 'Summary' + ]; //markdown variables: showPreview:boolean=false; @@ -466,4 +473,41 @@ export class UpdateServiceSpecComponent implements OnInit { } } + goToStep(index: number) { + this.currentStep = index; + if(this.currentStep>this.highestStep){ + this.highestStep=this.currentStep + } + this.refreshChars(); + //chars + if(this.currentStep==1){ + setTimeout(() => { + initFlowbite(); + }, 100); + } + //finish + if(this.currentStep==2){ + this.showFinish(); + } + } + + validateCurrentStep(): boolean { + switch (this.currentStep) { + case 0: // General Info + return this.generalForm?.valid || false; + default: + return true; + } + } + + canNavigate(index: number) { + return this.generalForm?.valid + } + + handleStepClick(index: number): void { + if (this.canNavigate(index)) { + this.goToStep(index); + } + } + } diff --git a/src/app/services/app-init.service.ts b/src/app/services/app-init.service.ts index 89a8b8cf..e9f9e7bd 100644 --- a/src/app/services/app-init.service.ts +++ b/src/app/services/app-init.service.ts @@ -35,7 +35,7 @@ export class AppInitService { environment.analytics = config.analytics ?? 'https://analytics.dome-marketplace-sbx.org/', environment.feedbackCampaign = config.feedbackCampaign ?? false, environment.feedbackCampaignExpiration = config.feedbackCampaign ?? moment().add(1, 'week').unix() - environment.providerThemeName = 'DOME'; + environment.providerThemeName = config.theme ?? 'default'; environment.QUOTES_ENABLED = config.quotesEnabled ?? false resolve(config); }), From 2ca99d2ef9b33c6fff2fe61e3610b1e315d2c5d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lara=20Mi=C3=B1ones=20Rodr=C3=ADguez?= Date: Tue, 9 Dec 2025 13:09:14 +0100 Subject: [PATCH 3/5] ADD stepper and action button in every form --- .../create-catalog.component.html | 49 +++++++++++- .../create-catalog.component.ts | 13 ++- .../update-catalog.component.html | 47 ++++++++++- .../update-catalog.component.ts | 15 ++-- .../create-product-spec.component.html | 79 ++++++++++++++----- .../create-product-spec.component.ts | 21 +++++ .../update-product-spec.component.html | 77 +++++++++++++----- .../update-product-spec.component.ts | 52 +++++++++--- .../create-resource-spec.component.html | 53 +++++++++++-- .../update-resource-spec.component.html | 51 ++++++++++-- .../update-resource-spec.component.ts | 17 ++-- .../create-service-spec.component.html | 53 +++++++++++-- .../update-service-spec.component.html | 51 ++++++++++-- .../update-service-spec.component.ts | 17 ++-- 14 files changed, 490 insertions(+), 105 deletions(-) diff --git a/src/app/pages/seller-offerings/offerings/seller-catalogs/create-catalog/create-catalog.component.html b/src/app/pages/seller-offerings/offerings/seller-catalogs/create-catalog/create-catalog.component.html index 68008b52..1906d588 100644 --- a/src/app/pages/seller-offerings/offerings/seller-catalogs/create-catalog/create-catalog.component.html +++ b/src/app/pages/seller-offerings/offerings/seller-catalogs/create-catalog/create-catalog.component.html @@ -60,14 +60,14 @@

-
+ } @else if (currentStep === 1) {
@if(loading){ @@ -114,17 +114,58 @@

+

} + +
+ + + + @if(currentStep === 1){ + + } +

diff --git a/src/app/pages/seller-offerings/offerings/seller-catalogs/create-catalog/create-catalog.component.ts b/src/app/pages/seller-offerings/offerings/seller-catalogs/create-catalog/create-catalog.component.ts index cdeb3ae0..ce758c38 100644 --- a/src/app/pages/seller-offerings/offerings/seller-catalogs/create-catalog/create-catalog.component.ts +++ b/src/app/pages/seller-offerings/offerings/seller-catalogs/create-catalog/create-catalog.component.ts @@ -104,6 +104,14 @@ export class CreateCatalogComponent implements OnInit { showFinish(){ this.finishDone=true; + this.setCatalogData(); + this.showGeneral=false; + this.showSummary=true; + this.selectStep('summary','summary-circle'); + this.showPreview=false; + } + + setCatalogData(){ if(this.generalForm.value.name!=null){ this.catalogToCreate={ name: this.generalForm.value.name, @@ -120,14 +128,11 @@ export class CreateCatalogComponent implements OnInit { } console.log('CATALOG TO CREATE:') console.log(this.catalogToCreate) - this.showGeneral=false; - this.showSummary=true; - this.selectStep('summary','summary-circle'); } - this.showPreview=false; } createCatalog(){ + this.setCatalogData(); this.loading=true; this.api.postCatalog(this.catalogToCreate).subscribe({ next: data => { diff --git a/src/app/pages/seller-offerings/offerings/seller-catalogs/update-catalog/update-catalog.component.html b/src/app/pages/seller-offerings/offerings/seller-catalogs/update-catalog/update-catalog.component.html index c77c1b72..8553ec0a 100644 --- a/src/app/pages/seller-offerings/offerings/seller-catalogs/update-catalog/update-catalog.component.html +++ b/src/app/pages/seller-offerings/offerings/seller-catalogs/update-catalog/update-catalog.component.html @@ -137,14 +137,14 @@

-
+ } @else if (currentStep === 1) {
@if(loading){ @@ -190,7 +190,7 @@

+

}
+ +
+ + + + +

diff --git a/src/app/pages/seller-offerings/offerings/seller-catalogs/update-catalog/update-catalog.component.ts b/src/app/pages/seller-offerings/offerings/seller-catalogs/update-catalog/update-catalog.component.ts index ff086a4a..e955317e 100644 --- a/src/app/pages/seller-offerings/offerings/seller-catalogs/update-catalog/update-catalog.component.ts +++ b/src/app/pages/seller-offerings/offerings/seller-catalogs/update-catalog/update-catalog.component.ts @@ -118,6 +118,14 @@ export class UpdateCatalogComponent implements OnInit { } showFinish(){ + this.setCatalogData(); + this.showGeneral=false; + this.showSummary=true; + this.selectStep('summary','summary-circle'); + this.showPreview=false; + } + + setCatalogData(){ if(this.generalForm.value.name!=null){ this.catalogToUpdate={ description: this.generalForm.value.description != null ? this.generalForm.value.description : '', @@ -126,16 +134,11 @@ export class UpdateCatalogComponent implements OnInit { if(this.cat.name != this.generalForm.value.name){ this.catalogToUpdate.name=this.generalForm.value.name; } - console.log('CATALOG TO UPDATE:') - console.log(this.catalogToUpdate) - this.showGeneral=false; - this.showSummary=true; - this.selectStep('summary','summary-circle'); } - this.showPreview=false; } createCatalog(){ + this.showFinish(); this.loading=true; this.api.updateCatalog(this.catalogToUpdate,this.cat.id).subscribe({ next: data => { diff --git a/src/app/pages/seller-offerings/offerings/seller-product-spec/create-product-spec/create-product-spec.component.html b/src/app/pages/seller-offerings/offerings/seller-product-spec/create-product-spec/create-product-spec.component.html index 90c62bde..119fe6c6 100644 --- a/src/app/pages/seller-offerings/offerings/seller-product-spec/create-product-spec/create-product-spec.component.html +++ b/src/app/pages/seller-offerings/offerings/seller-product-spec/create-product-spec/create-product-spec.component.html @@ -74,14 +74,14 @@

{{ 'CR -
+ } @if (currentStep === 1 && BUNDLE_ENABLED) {
@@ -195,14 +195,14 @@

{{ 'CR

} } -
+ } @if ((currentStep === 1 && !BUNDLE_ENABLED) || (currentStep === 2 && BUNDLE_ENABLED)) {

@@ -334,7 +334,7 @@

- + -->

@@ -606,14 +606,14 @@

There's no char

} -
+ } @if ((currentStep === 3 && !BUNDLE_ENABLED) || (currentStep === 4 && BUNDLE_ENABLED)) { @@ -709,14 +709,14 @@

There's no char Loading...

} -
+ } @if ((currentStep === 4 && !BUNDLE_ENABLED) || (currentStep === 5 && BUNDLE_ENABLED)) { @if(loadingServiceSpec){ @@ -811,14 +811,14 @@

There's no char Loading...

} -
+ } @if ((currentStep === 5 && !BUNDLE_ENABLED) || (currentStep === 6 && BUNDLE_ENABLED)) {
@@ -1012,14 +1012,14 @@

{{ 'CREATE_PROD_SPEC._add_att

} -
+ } @if ((currentStep === 6 && !BUNDLE_ENABLED) || (currentStep === 7 && BUNDLE_ENABLED)) {
@@ -1207,14 +1207,14 @@

{{ 'CREATE_PROD_SPEC._add_att

}
-
+ } @if ((currentStep === 7 && !BUNDLE_ENABLED) || (currentStep === 8 && BUNDLE_ENABLED)) {
@@ -1533,18 +1533,59 @@

{{ 'CREATE_PROD_SPEC._add_att

} } -
+
} -
+
+ +
+ + + + @if ((currentStep === 7 && !BUNDLE_ENABLED) || (currentStep === 8 && BUNDLE_ENABLED)) { + + } +
diff --git a/src/app/pages/seller-offerings/offerings/seller-product-spec/create-product-spec/create-product-spec.component.ts b/src/app/pages/seller-offerings/offerings/seller-product-spec/create-product-spec/create-product-spec.component.ts index cd45a3d3..a29636a8 100644 --- a/src/app/pages/seller-offerings/offerings/seller-product-spec/create-product-spec/create-product-spec.component.ts +++ b/src/app/pages/seller-offerings/offerings/seller-product-spec/create-product-spec/create-product-spec.component.ts @@ -1463,6 +1463,27 @@ export class CreateProductSpecComponent implements OnInit { } } + isStepDisabled(): boolean { + switch (this.currentStep) { + case 0: // General Info + return !this.generalForm?.valid || false; + case 1: + if(this.BUNDLE_ENABLED){ + return this.prodSpecsBundle.length<2 && this.bundleChecked + } else { + return this.checkValidISOS() + } + case 2: + if(this.BUNDLE_ENABLED){ + return this.checkValidISOS() + } else { + return false + } + default: + return false; + } + } + canNavigate(index: number) { return (this.generalForm?.valid && (index <= this.currentStep)) || (this.generalForm?.valid && (index <= this.highestStep)); } diff --git a/src/app/pages/seller-offerings/offerings/seller-product-spec/update-product-spec/update-product-spec.component.html b/src/app/pages/seller-offerings/offerings/seller-product-spec/update-product-spec/update-product-spec.component.html index 1545c29f..254e1cfc 100644 --- a/src/app/pages/seller-offerings/offerings/seller-product-spec/update-product-spec/update-product-spec.component.html +++ b/src/app/pages/seller-offerings/offerings/seller-product-spec/update-product-spec/update-product-spec.component.html @@ -150,14 +150,14 @@

{{ 'UP -
+ } @if (currentStep === 1 && BUNDLE_ENABLED) {
@@ -258,14 +258,14 @@

{{ 'UP

} } -
+ } @if ((currentStep === 1 && !BUNDLE_ENABLED) || (currentStep === 2 && BUNDLE_ENABLED)) {

@@ -438,7 +438,7 @@

{{ 'UPDATE_PROD_SPEC._ho

- + -->

@@ -718,14 +718,14 @@

There's no char

} -
+ } @if ((currentStep === 3 && !BUNDLE_ENABLED) || (currentStep === 4 && BUNDLE_ENABLED)) { @@ -821,14 +821,14 @@

There's no char Loading...

} -
+ } @if ((currentStep === 4 && !BUNDLE_ENABLED) || (currentStep === 5 && BUNDLE_ENABLED)) { @if(loadingServiceSpec){ @@ -923,14 +923,14 @@

There's no char Loading...

} -
+ } @if ((currentStep === 5 && !BUNDLE_ENABLED) || (currentStep === 6 && BUNDLE_ENABLED)) {
@@ -1123,14 +1123,14 @@

{{ 'UPDATE_PROD_SPEC._add_att

} -
+ } @if ((currentStep === 6 && !BUNDLE_ENABLED) || (currentStep === 7 && BUNDLE_ENABLED)) {
@@ -1298,14 +1298,14 @@

{{ 'UPDATE_PROD_SPEC._add_att

}
-
+ } @if ((currentStep === 7 && !BUNDLE_ENABLED) || (currentStep === 8 && BUNDLE_ENABLED)) {
@@ -1604,18 +1604,57 @@

{{ 'UPDATE_PROD_SPEC._add_att

} } -
+
} -
+
+ +
+ + + + +
diff --git a/src/app/pages/seller-offerings/offerings/seller-product-spec/update-product-spec/update-product-spec.component.ts b/src/app/pages/seller-offerings/offerings/seller-product-spec/update-product-spec/update-product-spec.component.ts index 017c97ce..c6a91443 100644 --- a/src/app/pages/seller-offerings/offerings/seller-product-spec/update-product-spec/update-product-spec.component.ts +++ b/src/app/pages/seller-offerings/offerings/seller-product-spec/update-product-spec/update-product-spec.component.ts @@ -1451,6 +1451,23 @@ export class UpdateProductSpecComponent implements OnInit { } showFinish() { + this.setProductData(); + this.selectStep('summary','summary-circle'); + this.showBundle=false; + this.showGeneral=false; + this.showCompliance=false; + this.showChars=false; + this.showResource=false; + this.showService=false; + this.showAttach=false; + this.showRelationships=false; + this.showSummary=true; + this.showPreview=false; + this.refreshChars(); + initFlowbite(); + } + + setProductData(){ for(let i=0; i< this.prodChars.length; i++){ const index = this.finishChars.findIndex(item => item.name === this.prodChars[i].name); if (index == -1) { @@ -1510,19 +1527,6 @@ export class UpdateProductSpecComponent implements OnInit { serviceSpecification: this.selectedServiceSpecs } } - this.selectStep('summary','summary-circle'); - this.showBundle=false; - this.showGeneral=false; - this.showCompliance=false; - this.showChars=false; - this.showResource=false; - this.showService=false; - this.showAttach=false; - this.showRelationships=false; - this.showSummary=true; - this.showPreview=false; - this.refreshChars(); - initFlowbite(); } isProdValid(){ @@ -1542,6 +1546,7 @@ export class UpdateProductSpecComponent implements OnInit { } updateProduct(){ + this.setProductData(); this.loading=true; this.prodSpecService.updateProdSpec(this.productSpecToUpdate, this.prod.id).subscribe({ next: data => { @@ -1566,6 +1571,27 @@ export class UpdateProductSpecComponent implements OnInit { }); } + isStepDisabled(): boolean { + switch (this.currentStep) { + case 0: // General Info + return !this.generalForm?.valid || false; + case 1: + if(this.BUNDLE_ENABLED){ + return this.prodSpecsBundle.length<2 && this.bundleChecked + } else { + return this.checkValidISOS() + } + case 2: + if(this.BUNDLE_ENABLED){ + return this.checkValidISOS() + } else { + return false + } + default: + return false; + } + } + //Markdown actions: addBold() { const currentText = this.generalForm.value.description; diff --git a/src/app/pages/seller-offerings/offerings/seller-resource-spec/create-resource-spec/create-resource-spec.component.html b/src/app/pages/seller-offerings/offerings/seller-resource-spec/create-resource-spec/create-resource-spec.component.html index a2c8e727..e0829101 100644 --- a/src/app/pages/seller-offerings/offerings/seller-resource-spec/create-resource-spec/create-resource-spec.component.html +++ b/src/app/pages/seller-offerings/offerings/seller-resource-spec/create-resource-spec/create-resource-spec.component.html @@ -57,14 +57,14 @@

{{ 'CR -
+ } @if (currentStep === 1) { @if (prodChars.length === 0){ @@ -297,14 +297,14 @@

{{ 'CR

} -
+ } @if (currentStep === 2) { @@ -415,18 +415,59 @@

{{ 'CR

} } -
+
}

+ +
+ + + + @if (currentStep === 2) { + + } +
diff --git a/src/app/pages/seller-offerings/offerings/seller-resource-spec/update-resource-spec/update-resource-spec.component.html b/src/app/pages/seller-offerings/offerings/seller-resource-spec/update-resource-spec/update-resource-spec.component.html index a4b84551..bc0fbc8a 100644 --- a/src/app/pages/seller-offerings/offerings/seller-resource-spec/update-resource-spec/update-resource-spec.component.html +++ b/src/app/pages/seller-offerings/offerings/seller-resource-spec/update-resource-spec/update-resource-spec.component.html @@ -135,14 +135,14 @@

{{ 'UP -
+ } @if (currentStep === 1) { @if (prodChars.length === 0){ @@ -375,14 +375,14 @@

{{ 'UP

} -
+ } @if (currentStep === 2) { @@ -493,18 +493,57 @@

{{ 'UP

} } -
+
}

+ +
+ + + + +
diff --git a/src/app/pages/seller-offerings/offerings/seller-resource-spec/update-resource-spec/update-resource-spec.component.ts b/src/app/pages/seller-offerings/offerings/seller-resource-spec/update-resource-spec/update-resource-spec.component.ts index 23bd5ad2..a1bb2b75 100644 --- a/src/app/pages/seller-offerings/offerings/seller-resource-spec/update-resource-spec/update-resource-spec.component.ts +++ b/src/app/pages/seller-offerings/offerings/seller-resource-spec/update-resource-spec/update-resource-spec.component.ts @@ -278,6 +278,16 @@ export class UpdateResourceSpecComponent implements OnInit { } showFinish(){ + this.setResourceData(); + this.showChars=false; + this.showGeneral=false; + this.showSummary=true; + this.selectStep('summary','summary-circle'); + this.refreshChars(); + this.showPreview=false; + } + + setResourceData(){ if(this.generalForm.value.name!=null){ this.resourceToUpdate={ name: this.generalForm.value.name, @@ -285,16 +295,11 @@ export class UpdateResourceSpecComponent implements OnInit { lifecycleStatus: this.resStatus, resourceSpecCharacteristic: this.prodChars } - this.showChars=false; - this.showGeneral=false; - this.showSummary=true; - this.selectStep('summary','summary-circle'); - this.refreshChars(); } - this.showPreview=false; } updateResource(){ + this.setResourceData(); this.loading=true; this.resSpecService.updateResSpec(this.resourceToUpdate,this.res.id).subscribe({ next: data => { diff --git a/src/app/pages/seller-offerings/offerings/seller-service-spec/create-service-spec/create-service-spec.component.html b/src/app/pages/seller-offerings/offerings/seller-service-spec/create-service-spec/create-service-spec.component.html index c9f799b3..61e8d815 100644 --- a/src/app/pages/seller-offerings/offerings/seller-service-spec/create-service-spec/create-service-spec.component.html +++ b/src/app/pages/seller-offerings/offerings/seller-service-spec/create-service-spec/create-service-spec.component.html @@ -57,14 +57,14 @@

{{ 'CR -
+ } @if (currentStep === 1) { @if (prodChars.length === 0){ @@ -298,14 +298,14 @@

{{ 'CR

} -
+ } @if (currentStep === 2) { @@ -416,18 +416,59 @@

{{ 'CR

} } -
+
}

+ +
+ + + + @if (currentStep === 2) { + + } +
diff --git a/src/app/pages/seller-offerings/offerings/seller-service-spec/update-service-spec/update-service-spec.component.html b/src/app/pages/seller-offerings/offerings/seller-service-spec/update-service-spec/update-service-spec.component.html index 28c07cde..d1115190 100644 --- a/src/app/pages/seller-offerings/offerings/seller-service-spec/update-service-spec/update-service-spec.component.html +++ b/src/app/pages/seller-offerings/offerings/seller-service-spec/update-service-spec/update-service-spec.component.html @@ -135,14 +135,14 @@

{{ 'UP -
+ } @if (currentStep === 1) { @if (prodChars.length === 0){ @@ -375,14 +375,14 @@

{{ 'UP

} -
+ } @if (currentStep === 2) { @@ -493,18 +493,57 @@

{{ 'UP

} } -
+
}

+ +
+ + + + +
diff --git a/src/app/pages/seller-offerings/offerings/seller-service-spec/update-service-spec/update-service-spec.component.ts b/src/app/pages/seller-offerings/offerings/seller-service-spec/update-service-spec/update-service-spec.component.ts index d26876e3..38a6ce54 100644 --- a/src/app/pages/seller-offerings/offerings/seller-service-spec/update-service-spec/update-service-spec.component.ts +++ b/src/app/pages/seller-offerings/offerings/seller-service-spec/update-service-spec/update-service-spec.component.ts @@ -274,6 +274,16 @@ export class UpdateServiceSpecComponent implements OnInit { } showFinish(){ + this.setServiceData(); + this.showChars=false; + this.showGeneral=false; + this.showSummary=true; + this.selectStep('summary','summary-circle'); + this.refreshChars(); + this.showPreview=false; + } + + setServiceData(){ if(this.generalForm.value.name!=null){ this.serviceToUpdate={ name: this.generalForm.value.name, @@ -281,16 +291,11 @@ export class UpdateServiceSpecComponent implements OnInit { lifecycleStatus: this.servStatus, specCharacteristic: this.prodChars } - this.showChars=false; - this.showGeneral=false; - this.showSummary=true; - this.selectStep('summary','summary-circle'); - this.refreshChars(); } - this.showPreview=false; } updateService(){ + this.setServiceData(); this.loading=true; this.servSpecService.updateServSpec(this.serviceToUpdate,this.serv.id).subscribe({ next: data => { From c0bda06cbc0bff57fa0d6217239ab72101849d53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lara=20Mi=C3=B1ones=20Rodr=C3=ADguez?= Date: Wed, 10 Dec 2025 08:30:46 +0100 Subject: [PATCH 4/5] FIX catalog next buttons --- .../create-catalog/create-catalog.component.html | 2 +- .../update-catalog/update-catalog.component.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/pages/seller-offerings/offerings/seller-catalogs/create-catalog/create-catalog.component.html b/src/app/pages/seller-offerings/offerings/seller-catalogs/create-catalog/create-catalog.component.html index 1906d588..7ad9834b 100644 --- a/src/app/pages/seller-offerings/offerings/seller-catalogs/create-catalog/create-catalog.component.html +++ b/src/app/pages/seller-offerings/offerings/seller-catalogs/create-catalog/create-catalog.component.html @@ -142,7 +142,7 @@

- @if(currentStep === 1){ - -