Skip to content

Commit

Permalink
ui
Browse files Browse the repository at this point in the history
  • Loading branch information
ETLaurent committed Oct 18, 2024
1 parent cd59b1e commit 5c571ca
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
2 changes: 2 additions & 0 deletions i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
"importCleanFailed": "The cleaning of the imported file on the server failed.",
"importWithCurrentLocaleHeading": "Different locale detected",
"importWithCurrentLocaleDescription": "This file was exported from the \"{{ docsLocale }}\" locale. Are you sure you want to import it into the \"{{ currentLocale }}\" locale?",
"importDraftsOnly": "Import all documents as drafts",
"importDraftsOnlyTooltip": "Content types that do not have separate drafts will be imported normally.",
"importDuplicateContinue": "Continue Import",
"importDuplicateDetected": "Duplicates Detected.",
"importDuplicateMessage": "Check the items you'd like to overwrite during import.",
Expand Down
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ module.exports = {
ns: 'aposImportExport',
browser: true
},
preventUpdateAssets: false
preventUpdateAssets: false,
importDraftsOnlyDefault: false
},
init(self) {
self.formats = {
Expand Down
3 changes: 2 additions & 1 deletion lib/methods/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ module.exports = self => {
name: key,
label: value.label,
allowedExtension: value.allowedExtension
}))
})),
importDraftsOnlyDefault: self.options.importDraftsOnlyDefault
};
},
// Filter our docs that have their module with the import or export option set to false
Expand Down
21 changes: 20 additions & 1 deletion ui/apos/components/AposImportModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,20 @@
@upload-file="uploadImportFile"
@update="updateImportFile"
/>
<AposCheckbox
v-model="checked"
:choice="{
value: 'importDraftsOnly',
label: $t('aposImportExport:importDraftsOnly')
}"
:field="{
name: 'importDraftsOnly',
}"
/>
<AposIndicator
icon="information-outline-icon"
tooltip="aposImportExport:importDraftsOnlyTooltip"
/>
<AposLabel
label="aposImportExport:importWarning"
class="apos-import__warning"
Expand Down Expand Up @@ -82,14 +96,19 @@ export default {
emits: [ 'safe-close' ],
data () {
const checked = apos.modules['@apostrophecms/import-export'].importDraftsOnlyDefault === true
? [ 'importDraftsOnly' ]
: [];
return {
modal: {
active: false,
type: 'overlay',
showModal: false,
disableHeader: true
},
selectedFile: null
selectedFile: null,
checked
};
},
Expand Down

0 comments on commit 5c571ca

Please sign in to comment.