-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(edit-content): use the new angular syntax (#29626)
### Parent Issue #29625 ### Task Using the command `nx g @angular/core:control-flow `to migrate to the new Angular syntax ### Proposed Objective Use the new Angular syntax to improve performance and code maintainability. ### Checklist - [x] Tests - [x] Translations - [x] Security Implications Contemplated (add notes if applicable)
- Loading branch information
Showing
25 changed files
with
212 additions
and
208 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
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
60 changes: 33 additions & 27 deletions
60
...dit-content/src/lib/components/dot-edit-content-form/dot-edit-content-form.component.html
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 |
---|---|---|
@@ -1,28 +1,34 @@ | ||
<form *ngIf="form" [formGroup]="form" class="p-fluid"> | ||
<ng-container *ngIf="areMultipleTabs; else singleForm"> | ||
<p-tabView [scrollable]="true" data-testId="edit-content-multiple-tabs"> | ||
<p-tabPanel *ngFor="let tab of tabs" [header]="tab.title"> | ||
<ng-container *ngTemplateOutlet="tabTemplate; context: { tab: tab }" /> | ||
</p-tabPanel> | ||
</p-tabView> | ||
</ng-container> | ||
|
||
<ng-template #singleForm> | ||
<ng-container *ngTemplateOutlet="tabTemplate; context: { tab: tabs[0] }" /> | ||
</ng-template> | ||
|
||
<ng-template #tabTemplate let-tab="tab"> | ||
<div class="form__layout"> | ||
<div *ngFor="let row of tab.layout" class="row" data-testId="row"> | ||
<div *ngFor="let column of row.columns" class="column" data-testId="column"> | ||
<dot-edit-content-field | ||
*ngFor="let field of column.fields" | ||
[contentType]="formData.contentType.variable" | ||
[contentlet]="formData.contentlet" | ||
[field]="field" | ||
data-testId="field" /> | ||
</div> | ||
@if (form) { | ||
<form [formGroup]="form" class="p-fluid"> | ||
@if (areMultipleTabs) { | ||
<p-tabView [scrollable]="true" data-testId="edit-content-multiple-tabs"> | ||
@for (tab of tabs; track tab) { | ||
<p-tabPanel [header]="tab.title"> | ||
<ng-container *ngTemplateOutlet="tabTemplate; context: { tab: tab }" /> | ||
</p-tabPanel> | ||
} | ||
</p-tabView> | ||
} @else { | ||
<ng-container *ngTemplateOutlet="tabTemplate; context: { tab: tabs[0] }" /> | ||
} | ||
<ng-template #tabTemplate let-tab="tab"> | ||
<div class="form__layout"> | ||
@for (row of tab.layout; track row) { | ||
<div class="row" data-testId="row"> | ||
@for (column of row.columns; track column) { | ||
<div class="column" data-testId="column"> | ||
@for (field of column.fields; track field) { | ||
<dot-edit-content-field | ||
[contentType]="formData.contentType.variable" | ||
[contentlet]="formData.contentlet" | ||
[field]="field" | ||
data-testId="field" /> | ||
} | ||
</div> | ||
} | ||
</div> | ||
} | ||
</div> | ||
</div> | ||
</ng-template> | ||
</form> | ||
</ng-template> | ||
</form> | ||
} |
1 change: 0 additions & 1 deletion
1
core-web/libs/edit-content/src/lib/edit-content.shell.component.html
This file was deleted.
Oops, something went wrong.
5 changes: 2 additions & 3 deletions
5
core-web/libs/edit-content/src/lib/edit-content.shell.component.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
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
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
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
3 changes: 1 addition & 2 deletions
3
...components/dot-category-field-list-skeleton/dot-category-field-list-skeleton.component.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
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
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
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
15 changes: 8 additions & 7 deletions
15
...lib/fields/dot-edit-content-checkbox-field/dot-edit-content-checkbox-field.component.html
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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
<p-checkbox | ||
*ngFor="let option of options; let i = index" | ||
[name]="field.variable" | ||
[formControl]="formControl" | ||
[value]="option.value" | ||
[label]="option.label" | ||
[inputId]="option.value + i"></p-checkbox> | ||
@for (option of options; track $index) { | ||
<p-checkbox | ||
[name]="field.variable" | ||
[formControl]="formControl" | ||
[value]="option.value" | ||
[label]="option.label" | ||
[inputId]="option.value + $index"></p-checkbox> | ||
} |
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
Oops, something went wrong.