refactor(stepper): disable header navigation and fixed translation
MODIFY
src/app/components/marketplace-signup-stepper/marketplace-signup-stepper.component.html
src/app/components/marketplace-signup-stepper/marketplace-signup-stepper.component.html
</mat-card-header>
<mat-card-content class="mat-card-header-text">
<app-my-apps-use-api></app-my-apps-use-api>
- <ng-container *ngIf="newContractDetails.policies">
+ <ng-container *ngIf="newContractDetails.policies.length > 0">
<h4>{{ 'WIZARD.POLICIES' | translate }}</h4>
<!--In this version we will not have more than 2 policies-->
<div class="policies">
</mat-card-header>
<mat-card-content class="mat-card-header-text">
<app-my-apps-use-api [contract]="contract"></app-my-apps-use-api>
- <ng-container *ngIf="newContractDetails.policies">
- <h4>Policies</h4>
+ <ng-container *ngIf="newContractDetails.policies.length > 0">
+ <h4>{{ 'WIZARD.POLICIES' | translate }}</h4>
<!--In this version we will not have more than 2 policies-->
<div class="policies">
<app-policy-card

MODIFY
src/app/components/marketplace-signup-stepper/marketplace-signup-stepper.component.ts
src/app/components/marketplace-signup-stepper/marketplace-signup-stepper.component.ts
@@ -117,7 +117,7 @@ export class MarketplaceSignupStepperComponent implements OnInit {
) {
this.printUserError('WIZARD.CONTRACT_EXISTS');
} else {
- this.goToNextStep(stepper, 0);
+ this.goToNextStep(stepper);
}
},
@@ -184,8 +184,7 @@ export class MarketplaceSignupStepperComponent implements OnInit {
if ('AwaitingApproval' === this.contract.client.status) {
void this.router.navigate(['approval']);
} else {
- this.goToNextStep(stepper, 2);
- this.disablePreviousSteps(stepper);
+ this.goToNextStep(stepper);
}
},
error: (error: HttpErrorResponse) =>
@@ -215,20 +214,12 @@ export class MarketplaceSignupStepperComponent implements OnInit {
this.snackbar.showErrorSnackBar(this.translator.instant(key) as string);
}
- private disablePreviousSteps(stepper: MatStepper) {
- // disallow to go back to previous states after confirmation
- for (let i = 0; i <= 2; i++) {
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
- stepper.steps.get(i)!.editable = false;
- }
- }
-
- private goToNextStep(stepper: MatStepper, currentStep: number) {
+ private goToNextStep(stepper: MatStepper) {
// Set completed step directly to allow going to the next step
// See: https://github.com/angular/components/pull/15403
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
- stepper.steps.get(currentStep)!.completed = true;
+ stepper.steps.get(stepper.selectedIndex)!.completed = true;
stepper.next();
}
}

MODIFY
src/styles.scss
src/styles.scss
@@ -281,3 +281,8 @@ a {
.bold {
font-weight: bold;
}
+
+// disables header navigation
+.mat-horizontal-stepper-header {
+ pointer-events: none;
+}

refactor(stepper): disable header navigation and fixed translation