diff --git a/src/components/DocumentControl.vue b/src/components/DocumentControl.vue index c92cc88..51c1328 100644 --- a/src/components/DocumentControl.vue +++ b/src/components/DocumentControl.vue @@ -42,6 +42,7 @@ diff --git a/src/components/ObjectTree.vue b/src/components/ObjectTree.vue index af53975..492b352 100644 --- a/src/components/ObjectTree.vue +++ b/src/components/ObjectTree.vue @@ -14,6 +14,7 @@ diff --git a/src/components/dialogs/ExportProject.vue b/src/components/dialogs/ExportProject.vue index 3b3d005..b29e4bd 100644 --- a/src/components/dialogs/ExportProject.vue +++ b/src/components/dialogs/ExportProject.vue @@ -61,6 +61,73 @@ + + + + + Determines if the export should output a corresponding +
+ folder structure to how FA structures the document types. +
+ If this is ticked on, only the file/s will be exported +
+ with no folders included. +
+
+
+ + + +
+ + + + + + Automatically exports all documents in your project. + + + + + + + + + + + + + Some projects can have overlapping names for multiple documents. +
+ Normally, this would results in the contents of the documents overwriting each other. +
+ If this is turned on, documents will also receive their unique IDs +
+ attached to their file names - preventing any overwriting. +
+
+
+ + + +
+ @@ -80,23 +147,6 @@ - - - - - Automatically exports all documents in your project. - - - - - - - - @@ -217,15 +267,28 @@ >
- Please note that: - - The more documents, the slower export. + + +
+ ALL of your documents will dumped RIGHT where you export. NO folder will be generated! +
+
+ + +
+ Please condider turning the safety export mode ON before exporting to avoid data loss! +
+
+ + +
+ FA currently needs to generate individual files for {{SGET_allDocuments.docs.length}} documents.
- FA currently needs to generate individual files for {{SGET_allDocuments.docs.length}} documents. + Estimated export time: {{(SGET_allDocuments.docs.length / 25 + 2).toFixed(1)}} - {{(SGET_allDocuments.docs.length / 15 + 2).toFixed(1)}} seconds.
- - + + @@ -434,6 +497,8 @@ export default class ExportProject extends DialogBase { return this.prepickedIds.includes(doc._id) }) } + + this.noFolderMode = this.prepickedNoFolderMode } } @@ -449,6 +514,7 @@ export default class ExportProject extends DialogBase { this.useFallbackFont = false this.exportDocumentsModel = [] this.exportOngoing = false + this.useSafetyMode = true this.exportList = [] } @@ -458,6 +524,8 @@ export default class ExportProject extends DialogBase { } })) readonly prepickedIds!: string[] + @Prop(({ default: false })) readonly prepickedNoFolderMode!: boolean + exportFormats = [ "Adobe Reader - PDF", "Markdown - MD" @@ -483,6 +551,10 @@ export default class ExportProject extends DialogBase { useFallbackFont = false + useSafetyMode = true + + noFolderMode = false + setDocumentPreviewClose () { this.documentPreviewClose = uid() } @@ -622,7 +694,7 @@ export default class ExportProject extends DialogBase { const projectName: string = await retrieveCurrentProjectName() - const exportPath = `${folderPath}/${projectName} - Export` + const exportPath = this.noFolderMode ? folderPath : `${folderPath}/${projectName} - Export` if (!fs.existsSync(exportPath)) { fs.mkdirSync(exportPath) @@ -711,6 +783,7 @@ export default class ExportProject extends DialogBase { const exportObject = { name: input.extraFields.find(e => e.id === "name")?.value, + id: input._id, documentType: matchingBlueprint.nameSingular, documentDirectory: matchingBlueprint.namePlural, isCategory: input.extraFields.find(e => e.id === "categorySwitch")?.value, @@ -945,7 +1018,7 @@ export default class ExportProject extends DialogBase { exportFileDirectory = exportFileDirectory.replace(char, "-") exportFileDirectory = exportFileDirectory.replace(char, "-") }) - const documentDirectory = `${exportPath}/${exportFileDirectory}` + const documentDirectory = (this.noFolderMode) ? exportPath : `${exportPath}/${exportFileDirectory}` // Create directory if (!fs.existsSync(documentDirectory)) { @@ -953,7 +1026,9 @@ export default class ExportProject extends DialogBase { } // Fix invalid characters in document file name - let exportFileName = input.name + let exportFileName = (this.useSafetyMode && this.exportWholeProject) + ? `${input.name} (${input.id})` + : input.name reservedCharacterList.forEach(char => { exportFileName = exportFileName.replace(char, "-") exportFileName = exportFileName.replace(char, "-") diff --git a/src/css/app.scss b/src/css/app.scss index 48e7096..e0bd011 100644 --- a/src/css/app.scss +++ b/src/css/app.scss @@ -373,6 +373,32 @@ a { border-color: #d4d0c9 !important; background: transparent !important; } + + .q-checkbox__svg, + .q-checkbox__svg path, + .q-checkbox__bg { + transition: 0.3s all ease-in; + } + + .q-checkbox.highlight { + .q-checkbox__svg, + .q-checkbox__svg path, + .q-checkbox__bg, + .q-checkbox__inner::before { + border-color: $primary !important; + color: $primary !important; + } + } + + .q-checkbox.warning { + .q-checkbox__svg, + .q-checkbox__svg path, + .q-checkbox__bg, + .q-checkbox__inner::before { + border-color: $secondary !important; + color: $secondary !important; + } + } } .tagSelect, diff --git a/src/interfaces/I_ExportObject.ts b/src/interfaces/I_ExportObject.ts index d610234..5d278bd 100644 --- a/src/interfaces/I_ExportObject.ts +++ b/src/interfaces/I_ExportObject.ts @@ -1,4 +1,5 @@ export interface I_ExportObject{ + id: string name: string documentType: string documentDirectory: string diff --git a/src/pages/DocumentDisplay.vue b/src/pages/DocumentDisplay.vue index 6c14add..31000c1 100644 --- a/src/pages/DocumentDisplay.vue +++ b/src/pages/DocumentDisplay.vue @@ -19,6 +19,7 @@