From 5fe2d20d2b90c6532c6b1277cd4576c92ac13bf5 Mon Sep 17 00:00:00 2001 From: Anthony Tarlao Date: Fri, 4 Aug 2023 18:14:08 +0200 Subject: [PATCH] Pro 4257 modal property (#2) * Export: add context menu and batch operation * Export: add exclusion * Improve readibility * Improve readibility * Custom modal AposExportPiecesModal * Simplify export modal * Add operation prop * Display module label and count in basic modal * Lint * Rename variable criteria to operation --- i18n/en.json | 3 +- .../import-export-doc-type/index.js | 6 +- ui/apos/components/AposExportPiecesModal.vue | 160 ++++++++++++++++++ 3 files changed, 165 insertions(+), 4 deletions(-) create mode 100644 ui/apos/components/AposExportPiecesModal.vue diff --git a/i18n/en.json b/i18n/en.json index e4608824..8bdd34c9 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -1,4 +1,5 @@ { "export": "Export", - "exporting": "Exporting" + "exporting": "Exporting", + "exportModalDescription": "You've selected {{ count }} {{ type }} for export" } diff --git a/modules/@apostrophecms/import-export-doc-type/index.js b/modules/@apostrophecms/import-export-doc-type/index.js index 1cd6a020..4dcc0c45 100644 --- a/modules/@apostrophecms/import-export-doc-type/index.js +++ b/modules/@apostrophecms/import-export-doc-type/index.js @@ -4,7 +4,7 @@ module.exports = { improve: '@apostrophecms/doc-type', init(self) { - const criteria = { + const operation = { action: 'export', context: 'update', label: 'aposImportExport:export', @@ -17,11 +17,11 @@ module.exports = { $ne: self.__meta.name } }); - criteria.if = { + operation.if = { $and: excludedTypes }; } - self.apos.doc.addContextOperation(self.__meta.name, criteria); + self.apos.doc.addContextOperation(operation); } }; diff --git a/ui/apos/components/AposExportPiecesModal.vue b/ui/apos/components/AposExportPiecesModal.vue new file mode 100644 index 00000000..2ad9d571 --- /dev/null +++ b/ui/apos/components/AposExportPiecesModal.vue @@ -0,0 +1,160 @@ + + + + +