Browse Source
Merge pull request #19818 from abpframework/hotfix-extensible-table-conflict
Angular - Merging Conflict on Extensible Table Component
pull/19824/head
Gizem Mutu Kurt
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
16 additions and
4 deletions
-
npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.html
-
npm/ng-packs/packages/components/extensible/src/lib/components/extensible-table/extensible-table.component.ts
|
|
|
@ -17,7 +17,7 @@ |
|
|
|
*ngTemplateOutlet="actionsTemplate || gridActions; context: { $implicit: row, index: i }" |
|
|
|
></ng-container> |
|
|
|
<ng-template #gridActions> |
|
|
|
@if (hasAvailableActions(i, row)) { |
|
|
|
@if (hasAvailableActions(row)) { |
|
|
|
<abp-grid-actions [index]="i" [record]="row" text="AbpUi::Actions"></abp-grid-actions> |
|
|
|
} |
|
|
|
</ng-template> |
|
|
|
|
|
|
|
@ -206,8 +206,20 @@ export class ExtensibleTableComponent<R = any> implements OnChanges { |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
hasAvailableActions(index, row): boolean { |
|
|
|
const { permission, visible } = this.actionList.get(index).value; |
|
|
|
return this.permissionService.getGrantedPolicy(permission) && visible(row); |
|
|
|
hasAvailableActions(rowData): boolean { |
|
|
|
let isActionAvailable = true; |
|
|
|
this.actionList.toArray().map(action => { |
|
|
|
const { visible, permission } = action; |
|
|
|
if (rowData && action) { |
|
|
|
const visibilityCheck = visible({ |
|
|
|
record: rowData, |
|
|
|
getInjected: this.getInjected, |
|
|
|
}); |
|
|
|
const permissionCheck = this.permissionService.getGrantedPolicy(permission); |
|
|
|
|
|
|
|
isActionAvailable = visibilityCheck && permissionCheck; |
|
|
|
} |
|
|
|
}); |
|
|
|
return isActionAvailable; |
|
|
|
} |
|
|
|
} |
|
|
|
|