Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion resources/js/components/assets/Browser/Browser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
:text="__('Edit Blueprint')"
:href="container.blueprint_url"
/>
<DropdownSeparator v-if="actions.length" />
<DropdownSeparator v-if="(canCreateContainers || container.can_edit || container.can_edit_blueprint) && actions.length" />
<DropdownItem
v-for="action in actions"
:key="action.handle"
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/collections/Listing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<DropdownItem v-if="collection.editable" :text="__('Configure')" icon="cog" :href="collection.edit_url" />
<DropdownItem v-if="collection.blueprint_editable" :text="__('Edit Blueprints')" icon="blueprint-edit" :href="collection.blueprints_url" />
<DropdownItem v-if="collection.editable" :text="__('Scaffold Views')" icon="scaffold" :href="collection.scaffold_url" />
<DropdownSeparator v-if="shouldShowSkeleton || actions.length" />
<DropdownSeparator v-if="(collection.available_in_selected_site || collection.editable || collection.blueprint_editable) && (shouldShowSkeleton || actions.length)" />
<template v-if="shouldShowSkeleton">
<div v-for="index in 3" :key="index" class="contents">
<ui-skeleton class="m-1 size-5" />
Expand Down
4 changes: 4 additions & 0 deletions resources/js/components/entries/Listing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ export default {
this.items = items;
},

refresh() {
this.$refs.listing.refresh();
},

setSiteFilter(site) {
this.$refs.listing.setFilter('site', site ? { site } : null);
},
Expand Down
2 changes: 2 additions & 0 deletions resources/js/components/entries/calendar/Calendar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ function shouldFetchEntries(

return false;
}

defineExpose({ refresh: fetchEntries });
</script>

<template>
Expand Down
10 changes: 8 additions & 2 deletions resources/js/pages/collections/Show.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<DropdownItem v-if="canEdit" :text="__('Configure Collection')" icon="cog" :href="editUrl" />
<DropdownItem v-if="canEditBlueprints" :text="__('Edit Blueprints')" icon="blueprint-edit" :href="blueprintsUrl" />
<DropdownItem v-if="canEdit" :text="__('Scaffold Views')" icon="scaffold" :href="scaffoldUrl" />
<DropdownSeparator v-if="canEdit || canEditBlueprints || actions.length" />
<DropdownSeparator v-if="(canEdit || canEditBlueprints) && actions.length" />
<DropdownItem
v-for="action in actions"
:key="action.handle"
Expand Down Expand Up @@ -536,7 +536,13 @@ export default {
Statamic.$toast.success(response.message || __('Action completed'));
}

if (!response.redirect) router.reload();
if (!response.redirect) router.reload({ onSuccess: () => this.refreshCurrentView() });
},

refreshCurrentView() {
if (this.view === 'list') this.$refs.list?.refresh();
if (this.view === 'calendar') this.$refs.calendar?.refresh();
if (this.view === 'tree' && !this.treeIsDirty) this.$refs.tree?.refresh();
},

addToCommandPalette() {
Expand Down
4 changes: 4 additions & 0 deletions resources/js/pages/navigation/Show.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ export default {
},

methods: {
afterActionSuccessfullyCompleted() {
if (!this.isDirty) this.$refs.tree?.refresh();
},

addLink() {
if (!this.hasCollections) this.linkPage();
},
Expand Down
Loading