Skip to content

Commit 8235fe1

Browse files
authored
fix(plugin-import-export): download button in collection edit view (#12805)
The custom save button showing on export enabled collections in the edit view. Instead it was meant to only appear in the export collection. This makes it so it only appears in the export drawer.
1 parent f2e0422 commit 8235fe1

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

packages/plugin-import-export/src/getExportCollection.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ export const getExportCollection = ({
2929
update: () => false,
3030
},
3131
admin: {
32+
components: {
33+
edit: {
34+
SaveButton: '@payloadcms/plugin-import-export/rsc#ExportSaveButton',
35+
},
36+
},
3237
group: false,
3338
useAsTitle: 'name',
3439
},

packages/plugin-import-export/src/index.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Config, JobsConfig } from 'payload'
1+
import type { Config } from 'payload'
22

33
import { deepMergeSimple } from 'payload'
44

@@ -48,12 +48,6 @@ export const importExportPlugin =
4848
if (!components.listMenuItems) {
4949
components.listMenuItems = []
5050
}
51-
if (!components.edit) {
52-
components.edit = {}
53-
}
54-
if (!components.edit.SaveButton) {
55-
components.edit.SaveButton = '@payloadcms/plugin-import-export/rsc#ExportSaveButton'
56-
}
5751
components.listMenuItems.push({
5852
clientProps: {
5953
exportCollectionSlug: exportCollection.slug,

0 commit comments

Comments
 (0)