-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(wizard): dynamic initialization with prevented navigation (backpo…
…rt to 15.x) (#1658) Backport 5f68481 from #1473. <br> ## PR Checklist Please check if your PR fulfills the following requirements: - [x] Tests for the changes have been added (for bug fixes / features) - [ ] Docs have been added / updated (for bug fixes / features) - [ ] If applicable, have a visual design approval ## PR Type What kind of change does this PR introduce? <!-- Please check the one that applies to this PR using "x". --> - [x] Bugfix - [ ] Feature - [ ] Code style update (formatting, local variables) - [ ] Refactoring (no functional changes, no api changes) - [ ] Build related changes - [ ] CI related changes - [ ] Documentation content changes - [ ] Other... Please describe: ## What is the current behavior? Throws error if pages empty and navigation prevented. Issue Number: CDE-2156 ## What is the new behavior? No error is thrown ## Does this PR introduce a breaking change? - [ ] Yes - [x] No <!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. --> ## Other information --------- Co-authored-by: Ivan Donchev <idonchev@vmware.com>
- Loading branch information
1 parent
274b833
commit 61aec4e
Showing
4 changed files
with
57 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
projects/angular/src/wizard/test-components/dynamic-empty-wizard.mock.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved. | ||
* This software is released under MIT license. | ||
* The full license information can be found in LICENSE in the root directory of this project. | ||
*/ | ||
|
||
import { Component, ViewChild } from '@angular/core'; | ||
|
||
import { ClrWizard } from '../wizard'; | ||
|
||
@Component({ | ||
template: ` | ||
<clr-wizard #wizard [(clrWizardOpen)]="open" [clrWizardPreventNavigation]="preventNavigation"> | ||
<clr-wizard-title>My Wizard Title</clr-wizard-title> | ||
<clr-wizard-button [type]="'cancel'">Cancel</clr-wizard-button> | ||
<clr-wizard-button [type]="'previous'">Back</clr-wizard-button> | ||
<clr-wizard-button [type]="'next'">Next</clr-wizard-button> | ||
<clr-wizard-button [type]="'finish'">Fait Accompli</clr-wizard-button> | ||
<ng-container *ngFor="let page of pages"> | ||
<clr-wizard-page [id]="page"> | ||
<ng-template clrPageTitle>Page {{ page }}</ng-template> | ||
<p>Content for page {{ page }}</p> | ||
</clr-wizard-page> | ||
</ng-container> | ||
</clr-wizard> | ||
`, | ||
}) | ||
export class DynamicEmptyWizardTestComponent { | ||
@ViewChild('wizard', { static: true }) wizard: ClrWizard; | ||
open = true; | ||
pages = []; | ||
preventNavigation = true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters