-
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.
fix(UVE): unable to execute sub-action on pages (#29932)
### Proposed Changes * Let users execute `sub-actions` on pages ### Checklist - [x] Tests ### Why was this error happening? It seems like an incompatibility between Angular's `SlicePipe` and PrimeNg v17 A general guess, `SlicePipe` is not a Pure Pipe and has Angular's own logic implemented inside that doesn't work like a native slice, which makes it inconsistent with what one would expect it to work like by @zJaaal #### Test the `Slice` pipe with PrimeNg `v15` and `v17` - PrimeNG v15 - slice [demo](https://stackblitz.com/edit/xad6jf?file=src%2Fapp%2Fdemo%2Fsplit-button-basic-demo.ts,src%2Fapp%2Fdemo%2Fsplit-button-basic-demo.html) - PrimeNG v17 - slice [demo](https://stackblitz.com/edit/ixjqxa?file=src%2Fapp%2Fsplit-button-basic-demo.ts) ### Video https://github.com/user-attachments/assets/2ae68864-155c-4c53-903f-7f233d8021af
- Loading branch information
Showing
6 changed files
with
120 additions
and
64 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
26 changes: 14 additions & 12 deletions
26
core-web/libs/ui/src/lib/components/dot-workflow-actions/dot-workflow-actions.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,24 +1,26 @@ | ||
@for (action of groupedActions(); track $index) { | ||
@if (action.length > 1) { | ||
@for (action of $groupedActions(); track $index) { | ||
@let mainAction = action.mainAction; | ||
@let subActions = action.subActions; | ||
@if (subActions.length) { | ||
<p-splitButton | ||
(onClick)="action[0].command({ originalEvent: $event })" | ||
[disabled]="loading" | ||
(onClick)="mainAction?.command({ originalEvent: $event })" | ||
[disabled]="loading()" | ||
[styleClass]="sizeClass" | ||
[model]="action | slice: 1" | ||
[model]="subActions" | ||
[outlined]="!$first" | ||
[label]="action[0].label" /> | ||
[label]="mainAction.label" /> | ||
} @else { | ||
<p-button | ||
(onClick)="action[0].command({ originalEvent: $event })" | ||
[loading]="loading" | ||
(onClick)="mainAction?.command({ originalEvent: $event })" | ||
[loading]="loading()" | ||
[styleClass]="sizeClass + (!$first ? ' p-button-outlined' : '')" | ||
[label]="action[0].label" /> | ||
[label]="mainAction.label" /> | ||
} | ||
} @empty { | ||
<p-button | ||
[loading]="loading" | ||
[disabled]="!loading" | ||
[loading]="loading()" | ||
[disabled]="!loading()" | ||
[styleClass]="sizeClass" | ||
[label]="(loading ? 'Loading' : 'edit.ema.page.no.workflow.action') | dm" | ||
[label]="(loading() ? 'Loading' : 'edit.ema.page.no.workflow.action') | dm" | ||
data-testId="empty-button" /> | ||
} |
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