Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Commit

Permalink
Fix select all with filters issue
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianmihaila committed Sep 26, 2022
1 parent 1358e47 commit 7dd2f7f
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
39 changes: 38 additions & 1 deletion resources/js/components/ActionButtonGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,49 @@ import DetachedAction from "../mixins/DetachedAction";
export default {
mixins: [DetachedAction],
props: ['shouldShowActions', 'resourceName', 'resourceId', 'actions', 'selectedResources'],
props: ['shouldShowActions', 'resourceName', 'resourceId', 'actions', 'endpoint', 'actionQueryString', 'selectedResources'],
watch: {
actions(newActions, oldActions) {
this.actionsList = newActions.filter((action) => action.hasOwnProperty('detachedAction'));
},
},
computed: {
currentSearch() {
return this.actionQueryString.currentSearch
},
encodedFilters() {
return this.actionQueryString.encodedFilters
},
currentTrashed() {
return this.actionQueryString.currentTrashed
},
viaResource() {
return this.actionQueryString.viaResource
},
viaResourceId() {
return this.actionQueryString.viaResourceId
},
viaRelationship() {
return this.actionQueryString.viaRelationship
},
actionsForSelect() {
return [
...this.visibleActions.map(a => ({
value: a.uriKey,
label: a.name,
})),
]
},
},
created() {
this.actionsList = this.actions;
}
Expand Down
3 changes: 3 additions & 0 deletions resources/js/nova-components/ResourceDetailView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
:resource-name="resourceName"
:resource-id="resource.id.value"
:actions="actions"
:endpoint="actionsEndpoint"
:action-query-string="actionQueryString"
:selected-resources="computedSelectedResources"
@actionExecuted="actionExecuted"
></ActionButtonGroup>
Expand Down Expand Up @@ -104,6 +106,7 @@ import Detail from "@/views/Detail";
export default {
extends: Detail,
computed: {
computedActions() {
return this.actions.length
Expand Down
2 changes: 2 additions & 0 deletions resources/js/nova-components/ResourceTableToolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
:should-show-actions="computedShouldShowActionSelector"
:resource-name="resourceName"
:actions="availableActions"
:endpoint="actionsEndpoint"
:action-query-string="actionQueryString"
:selected-resources="selectedResourcesForActionSelector"
@actionExecuted="getResources"
></ActionButtonGroup>
Expand Down

0 comments on commit 7dd2f7f

Please sign in to comment.