0.1.8 - export improvements

This commit is contained in:
Elvanos 2021-06-13 18:15:40 +02:00
parent 38e16bf9cc
commit 4b171773e2
25 changed files with 514 additions and 13 deletions

View file

@ -231,14 +231,25 @@
</q-item> </q-item>
<q-separator dark /> <q-separator dark />
<q-item <q-item
clickable
v-close-popup
@click="massExportDocuments(prop.node)"
v-if="prop.node.children && prop.node.children.length > 1"
>
<q-item-section>Export documents belonging under this</q-item-section>
<q-item-section avatar>
<q-icon name="mdi-database-export" />
</q-item-section>
</q-item>
<q-item
clickable clickable
v-close-popup v-close-popup
@click="massDeleteDocuments(prop.node)" @click="massDeleteDocuments(prop.node)"
v-if="prop.node.children && prop.node.children.length > 1" v-if="prop.node.children && prop.node.children.length > 1"
> >
<q-item-section class="text-secondary"><b>Delete documents belonging under this</b></q-item-section> <q-item-section class="text-secondary"><b>Delete documents belonging under this</b></q-item-section>
<q-item-section avatar class="text-secondary"> <q-item-section avatar class="text-secondary">
<q-icon name="mdi-text-box-remove-outline" /> <q-icon name="mdi-text-box-remove-outline" />
</q-item-section> </q-item-section>
</q-item> </q-item>
@ -302,6 +313,17 @@
<q-icon name="mdi-database-export-outline" /> <q-icon name="mdi-database-export-outline" />
</q-item-section> </q-item-section>
</q-item> </q-item>
<q-item
clickable
v-close-popup
@click="massExportDocuments(prop.node)"
v-if="prop.node.children && prop.node.children.length > 0"
>
<q-item-section>Export documents belonging under this</q-item-section>
<q-item-section avatar>
<q-icon name="mdi-database-export" />
</q-item-section>
</q-item>
<q-separator dark /> <q-separator dark />
<q-item clickable v-close-popup @click="deleteTabDocument(prop.node)"> <q-item clickable v-close-popup @click="deleteTabDocument(prop.node)">
<q-item-section class="text-secondary"><b>Delete this document</b></q-item-section> <q-item-section class="text-secondary"><b>Delete this document</b></q-item-section>
@ -379,6 +401,17 @@
</q-item-section> </q-item-section>
</q-item> </q-item>
<q-separator dark /> <q-separator dark />
<q-item
clickable
v-close-popup
@click="massExportDocuments(prop.node)"
v-if="prop.node.children && prop.node.children.length > 0"
>
<q-item-section>Export documents belonging under this</q-item-section>
<q-item-section avatar>
<q-icon name="mdi-database-export" />
</q-item-section>
</q-item>
<q-item <q-item
clickable clickable
v-close-popup v-close-popup
@ -1350,6 +1383,17 @@ export default class ObjectTree extends BaseClass {
this.SSET_setExportDialogState([node._id]) this.SSET_setExportDialogState([node._id])
} }
massExportDocuments (node: { children: { _id: string}[]}) {
/*eslint-disable */
// @ts-ignore
const exExportIDs: string[] = (this.flatten(node.children))
.filter((e: {extraFields?: string}) => e?.extraFields)
.map((e: {_id: string}) => e._id)
/* eslint-enable */
this.SSET_setExportDialogState(exExportIDs)
}
/****************************************************************/ /****************************************************************/
// Delete dialog // Delete dialog
/****************************************************************/ /****************************************************************/

View file

@ -22,7 +22,7 @@
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<q-select <q-select
class="exportTypeSelect" class="exportTypeSelect q-mb-md"
dark dark
popup-content-class="menuResizer" popup-content-class="menuResizer"
:options="exportFormats" :options="exportFormats"
@ -54,6 +54,29 @@
<q-list class="exportSettings"> <q-list class="exportSettings">
<q-item>
<q-item-section side>
<q-icon name="mdi-help-circle" size="18px">
<q-tooltip :delay="500">
Determines if the export should append a unique text string
<br>
at the end of the output files to prevent overriding
<br>
of the file content if multiple documents with the same name exist.
</q-tooltip>
</q-icon>
</q-item-section>
<q-item-section>
<q-checkbox
dark
:class="{'highlight': useCompatibilityMode}"
color="primary"
v-model="useCompatibilityMode"
label="Use unique-indentifier export-mode?"
/>
</q-item-section>
</q-item>
<q-item> <q-item>
<q-item-section side> <q-item-section side>
<q-icon name="mdi-help-circle" size="18px"> <q-icon name="mdi-help-circle" size="18px">
@ -79,6 +102,27 @@
</q-item-section> </q-item-section>
</q-item> </q-item>
<q-item>
<q-item-section side>
<q-icon name="mdi-help-circle" size="18px">
<q-tooltip :delay="500">
Determines if the spoiler fields
<br>
should be included in the export.
</q-tooltip>
</q-icon>
</q-item-section>
<q-item-section>
<q-checkbox
dark
:class="{'warning': includeSpoilers}"
color="primary"
v-model="includeSpoilers"
label="Include spoilers?"
/>
</q-item-section>
</q-item>
<q-item> <q-item>
<q-item-section side> <q-item-section side>
<q-icon name="mdi-help-circle" size="18px"> <q-icon name="mdi-help-circle" size="18px">
@ -527,6 +571,8 @@ export default class ExportProject extends DialogBase {
selectedExportFormat = "Adobe Reader - PDF" selectedExportFormat = "Adobe Reader - PDF"
useCompatibilityMode = true
exportWholeProject = false exportWholeProject = false
writerMode = false writerMode = false
@ -541,6 +587,8 @@ export default class ExportProject extends DialogBase {
includeIsDead = true includeIsDead = true
includeSpoilers = false
useFallbackFont = false useFallbackFont = false
useSafetyMode = true useSafetyMode = true
@ -816,6 +864,7 @@ export default class ExportProject extends DialogBase {
.filter(field => field.id !== "documentBackgroundColor") .filter(field => field.id !== "documentBackgroundColor")
.filter(field => field.id !== "breakDocumentSettings") .filter(field => field.id !== "breakDocumentSettings")
.filter(field => !field.isLegacy) .filter(field => !field.isLegacy)
.filter(field => !field.isSpoiler || this.includeSpoilers)
.filter(field => { .filter(field => {
if (input.extraFields.find(e => e.id === "categorySwitch")?.value) { if (input.extraFields.find(e => e.id === "categorySwitch")?.value) {
if (catIgnoreList.includes(field.id)) { if (catIgnoreList.includes(field.id)) {
@ -1131,7 +1180,10 @@ export default class ExportProject extends DialogBase {
const { documentDirectory, exportFileName } = this.fixExportPaths(exportPath, input) const { documentDirectory, exportFileName } = this.fixExportPaths(exportPath, input)
// Write the file // Write the file
fs.writeFileSync(`${documentDirectory}/${exportFileName}.md`, mdContent) const finalExportPath = (this.useCompatibilityMode)
? `${documentDirectory}/${exportFileName}-${input.id}.md`
: `${documentDirectory}/${exportFileName}.md`
fs.writeFileSync(finalExportPath, mdContent)
} }
exportFile_PDF (input: I_ExportObject, exportPath: string, normalFontContents : any, boldFontContents: any) { exportFile_PDF (input: I_ExportObject, exportPath: string, normalFontContents : any, boldFontContents: any) {
@ -1155,7 +1207,12 @@ export default class ExportProject extends DialogBase {
doc.registerFont("Roboto-Bold", boldFontContents) doc.registerFont("Roboto-Bold", boldFontContents)
// Start stream // Start stream
doc.pipe(fs.createWriteStream(`${documentDirectory}/${exportFileName}.pdf`))
// Write the file
const finalExportPath = (this.useCompatibilityMode)
? `${documentDirectory}/${exportFileName}-${input.id}.pdf`
: `${documentDirectory}/${exportFileName}.pdf`
doc.pipe(fs.createWriteStream(finalExportPath))
// Name/Title // Name/Title
let title = input.name let title = input.name
@ -1593,7 +1650,7 @@ export default class ExportProject extends DialogBase {
} }
.exportSettings { .exportSettings {
max-height: calc(100vh - 405px); max-height: calc(100vh - 420px);
overflow-x: auto; overflow-x: auto;
padding-right: 20px; padding-right: 20px;

View file

@ -23,10 +23,16 @@
- **Added document preview in split-view mode** - **Added document preview in split-view mode**
- **Added mass document deletion tool** - **Added mass document deletion tool**
- **Added support for showing of last opened document list** - **Added support for showing of last opened document list**
- **Added first iteration of the Project settings**
- Added project renaming support from inside the app
- Added export functionality to relationships inside document previews - Added export functionality to relationships inside document previews
- Added option: Aggressive relationships selection - Added option: Aggressive relationships selection
- Fantasia (the mascot) learned how to cook! - Fantasia (the mascot) learned how to cook!
- Added unique-identified option for exports
- Added new spoiler/secrets/DM notes field to all document types
- Added spoiler-free export option for exports
- Added support for custom subtitles in list fields - Added support for custom subtitles in list fields
- Added support for mass-exports to the hierarchy tree
- Added context, right-click menu to the hierarchy tree to tags - Added context, right-click menu to the hierarchy tree to tags
- Preview in split-view mode - Preview in split-view mode
- Collapse/Expand all - Collapse/Expand all

View file

@ -5,6 +5,7 @@ export interface I_ExtraFields {
sizing: number sizing: number
tooltip?: string tooltip?: string
isLegacy?: boolean isLegacy?: boolean
isSpoiler?: boolean
type: type:
"text" | "text" |
"number" | "number" |

View file

@ -170,6 +170,26 @@ export const chaptersBlueprint: I_Blueprint = {
type: "wysiwyg", type: "wysiwyg",
icon: "mdi-book-open-page-variant-outline", icon: "mdi-book-open-page-variant-outline",
sizing: 12 sizing: 12
},
{
id: "breakDetails",
name: "Secrets/Spoilers/DM notes",
type: "break",
sizing: 12,
isSpoiler: true
},
{
id: "spoilerNotes",
name: "Secrets/Spoilers/DM notes",
type: "wysiwyg",
icon: "fas fa-mask",
sizing: 12,
isSpoiler: true,
tooltip:
`This field will not export by default when using the Export document functionality.
<br>
Instead it needs to be manually included if the user wishes to export it.
`
} }
] ]
} }

View file

@ -1642,6 +1642,26 @@ export const charactersBlueprint: I_Blueprint = {
connectedObjectType: "resources", connectedObjectType: "resources",
connectedField: "pairedCharacter" connectedField: "pairedCharacter"
} }
},
{
id: "breakDetails",
name: "Secrets/Spoilers/DM notes",
type: "break",
sizing: 12,
isSpoiler: true
},
{
id: "spoilerNotes",
name: "Secrets/Spoilers/DM notes",
type: "wysiwyg",
icon: "fas fa-mask",
sizing: 12,
isSpoiler: true,
tooltip:
`This field will not export by default when using the Export document functionality.
<br>
Instead it needs to be manually included if the user wishes to export it.
`
} }
] ]
} }

View file

@ -630,7 +630,26 @@ export const conditionsBlueprint: I_Blueprint = {
connectedObjectType: "resources", connectedObjectType: "resources",
connectedField: "pairedConditionsOther" connectedField: "pairedConditionsOther"
} }
},
{
id: "breakDetails",
name: "Secrets/Spoilers/DM notes",
type: "break",
sizing: 12,
isSpoiler: true
},
{
id: "spoilerNotes",
name: "Secrets/Spoilers/DM notes",
type: "wysiwyg",
icon: "fas fa-mask",
sizing: 12,
isSpoiler: true,
tooltip:
`This field will not export by default when using the Export document functionality.
<br>
Instead it needs to be manually included if the user wishes to export it.
`
} }
] ]
} }

View file

@ -416,6 +416,26 @@ export const cultureBlueprint: I_Blueprint = {
connectedObjectType: "tech", connectedObjectType: "tech",
connectedField: "pairedConnectedCultures" connectedField: "pairedConnectedCultures"
} }
},
{
id: "breakDetails",
name: "Secrets/Spoilers/DM notes",
type: "break",
sizing: 12,
isSpoiler: true
},
{
id: "spoilerNotes",
name: "Secrets/Spoilers/DM notes",
type: "wysiwyg",
icon: "fas fa-mask",
sizing: 12,
isSpoiler: true,
tooltip:
`This field will not export by default when using the Export document functionality.
<br>
Instead it needs to be manually included if the user wishes to export it.
`
} }
] ]
} }

View file

@ -271,6 +271,26 @@ export const currenciesBlueprint: I_Blueprint = {
connectedObjectType: "loreNotes", connectedObjectType: "loreNotes",
connectedField: "localCurrencies" connectedField: "localCurrencies"
} }
},
{
id: "breakDetails",
name: "Secrets/Spoilers/DM notes",
type: "break",
sizing: 12,
isSpoiler: true
},
{
id: "spoilerNotes",
name: "Secrets/Spoilers/DM notes",
type: "wysiwyg",
icon: "fas fa-mask",
sizing: 12,
isSpoiler: true,
tooltip:
`This field will not export by default when using the Export document functionality.
<br>
Instead it needs to be manually included if the user wishes to export it.
`
} }
] ]

View file

@ -423,6 +423,26 @@ export const eventsBlueprint: I_Blueprint = {
connectedObjectType: "conditions", connectedObjectType: "conditions",
connectedField: "pairedEventsOther" connectedField: "pairedEventsOther"
} }
},
{
id: "breakDetails",
name: "Secrets/Spoilers/DM notes",
type: "break",
sizing: 12,
isSpoiler: true
},
{
id: "spoilerNotes",
name: "Secrets/Spoilers/DM notes",
type: "wysiwyg",
icon: "fas fa-mask",
sizing: 12,
isSpoiler: true,
tooltip:
`This field will not export by default when using the Export document functionality.
<br>
Instead it needs to be manually included if the user wishes to export it.
`
} }
] ]

View file

@ -678,6 +678,26 @@ export const guildsBlueprint: I_Blueprint = {
connectedObjectType: "conditions", connectedObjectType: "conditions",
connectedField: "pairedOtherGroups" connectedField: "pairedOtherGroups"
} }
},
{
id: "breakDetails",
name: "Secrets/Spoilers/DM notes",
type: "break",
sizing: 12,
isSpoiler: true
},
{
id: "spoilerNotes",
name: "Secrets/Spoilers/DM notes",
type: "wysiwyg",
icon: "fas fa-mask",
sizing: 12,
isSpoiler: true,
tooltip:
`This field will not export by default when using the Export document functionality.
<br>
Instead it needs to be manually included if the user wishes to export it.
`
} }
] ]
} }

View file

@ -537,6 +537,26 @@ export const itemsBlueprint: I_Blueprint = {
connectedObjectType: "tech", connectedObjectType: "tech",
connectedField: "pairedConnectedItems" connectedField: "pairedConnectedItems"
} }
},
{
id: "breakDetails",
name: "Secrets/Spoilers/DM notes",
type: "break",
sizing: 12,
isSpoiler: true
},
{
id: "spoilerNotes",
name: "Secrets/Spoilers/DM notes",
type: "wysiwyg",
icon: "fas fa-mask",
sizing: 12,
isSpoiler: true,
tooltip:
`This field will not export by default when using the Export document functionality.
<br>
Instead it needs to be manually included if the user wishes to export it.
`
} }
] ]
} }

View file

@ -334,6 +334,26 @@ export const languagesBlueprint: I_Blueprint = {
connectedObjectType: "tech", connectedObjectType: "tech",
connectedField: "localLanguages" connectedField: "localLanguages"
} }
},
{
id: "breakDetails",
name: "Secrets/Spoilers/DM notes",
type: "break",
sizing: 12,
isSpoiler: true
},
{
id: "spoilerNotes",
name: "Secrets/Spoilers/DM notes",
type: "wysiwyg",
icon: "fas fa-mask",
sizing: 12,
isSpoiler: true,
tooltip:
`This field will not export by default when using the Export document functionality.
<br>
Instead it needs to be manually included if the user wishes to export it.
`
} }
] ]
} }

View file

@ -615,6 +615,26 @@ export const locationsBlueprint: I_Blueprint = {
connectedObjectType: "tech", connectedObjectType: "tech",
connectedField: "connectedLocations" connectedField: "connectedLocations"
} }
},
{
id: "breakDetails",
name: "Secrets/Spoilers/DM notes",
type: "break",
sizing: 12,
isSpoiler: true
},
{
id: "spoilerNotes",
name: "Secrets/Spoilers/DM notes",
type: "wysiwyg",
icon: "fas fa-mask",
sizing: 12,
isSpoiler: true,
tooltip:
`This field will not export by default when using the Export document functionality.
<br>
Instead it needs to be manually included if the user wishes to export it.
`
} }
] ]
} }

View file

@ -414,7 +414,26 @@ export const loreNotesBlueprint: I_Blueprint = {
connectedObjectType: "currencies", connectedObjectType: "currencies",
connectedField: "pairedConnectedNotes" connectedField: "pairedConnectedNotes"
} }
},
{
id: "breakDetails",
name: "Secrets/Spoilers/DM notes",
type: "break",
sizing: 12,
isSpoiler: true
},
{
id: "spoilerNotes",
name: "Secrets/Spoilers/DM notes",
type: "wysiwyg",
icon: "fas fa-mask",
sizing: 12,
isSpoiler: true,
tooltip:
`This field will not export by default when using the Export document functionality.
<br>
Instead it needs to be manually included if the user wishes to export it.
`
} }
] ]
} }

View file

@ -727,6 +727,26 @@ export const magicBlueprint: I_Blueprint = {
connectedObjectType: "professions", connectedObjectType: "professions",
connectedField: "pairedConnectedMagicGroups" connectedField: "pairedConnectedMagicGroups"
} }
},
{
id: "breakDetails",
name: "Secrets/Spoilers/DM notes",
type: "break",
sizing: 12,
isSpoiler: true
},
{
id: "spoilerNotes",
name: "Secrets/Spoilers/DM notes",
type: "wysiwyg",
icon: "fas fa-mask",
sizing: 12,
isSpoiler: true,
tooltip:
`This field will not export by default when using the Export document functionality.
<br>
Instead it needs to be manually included if the user wishes to export it.
`
} }
] ]
} }

View file

@ -379,6 +379,26 @@ export const mythsBlueprint: I_Blueprint = {
connectedObjectType: "resources", connectedObjectType: "resources",
connectedField: "pairedMyths" connectedField: "pairedMyths"
} }
},
{
id: "breakDetails",
name: "Secrets/Spoilers/DM notes",
type: "break",
sizing: 12,
isSpoiler: true
},
{
id: "spoilerNotes",
name: "Secrets/Spoilers/DM notes",
type: "wysiwyg",
icon: "fas fa-mask",
sizing: 12,
isSpoiler: true,
tooltip:
`This field will not export by default when using the Export document functionality.
<br>
Instead it needs to be manually included if the user wishes to export it.
`
} }
] ]

View file

@ -699,6 +699,26 @@ export const politicalGroupsBlueprint: I_Blueprint = {
connectedObjectType: "conditions", connectedObjectType: "conditions",
connectedField: "pairedRacesPoliticalGroups" connectedField: "pairedRacesPoliticalGroups"
} }
},
{
id: "breakDetails",
name: "Secrets/Spoilers/DM notes",
type: "break",
sizing: 12,
isSpoiler: true
},
{
id: "spoilerNotes",
name: "Secrets/Spoilers/DM notes",
type: "wysiwyg",
icon: "fas fa-mask",
sizing: 12,
isSpoiler: true,
tooltip:
`This field will not export by default when using the Export document functionality.
<br>
Instead it needs to be manually included if the user wishes to export it.
`
} }
] ]

View file

@ -469,6 +469,26 @@ export const professionsBlueprint: I_Blueprint = {
connectedObjectType: "items", connectedObjectType: "items",
connectedField: "pairedConnectedProfessions" connectedField: "pairedConnectedProfessions"
} }
},
{
id: "breakDetails",
name: "Secrets/Spoilers/DM notes",
type: "break",
sizing: 12,
isSpoiler: true
},
{
id: "spoilerNotes",
name: "Secrets/Spoilers/DM notes",
type: "wysiwyg",
icon: "fas fa-mask",
sizing: 12,
isSpoiler: true,
tooltip:
`This field will not export by default when using the Export document functionality.
<br>
Instead it needs to be manually included if the user wishes to export it.
`
} }
] ]
} }

View file

@ -628,6 +628,26 @@ export const racesBlueprint: I_Blueprint = {
connectedObjectType: "tech", connectedObjectType: "tech",
connectedField: "connectedRaces" connectedField: "connectedRaces"
} }
},
{
id: "breakDetails",
name: "Secrets/Spoilers/DM notes",
type: "break",
sizing: 12,
isSpoiler: true
},
{
id: "spoilerNotes",
name: "Secrets/Spoilers/DM notes",
type: "wysiwyg",
icon: "fas fa-mask",
sizing: 12,
isSpoiler: true,
tooltip:
`This field will not export by default when using the Export document functionality.
<br>
Instead it needs to be manually included if the user wishes to export it.
`
} }
] ]
} }

View file

@ -690,6 +690,26 @@ export const religionsBlueprint: I_Blueprint = {
connectedObjectType: "conditions", connectedObjectType: "conditions",
connectedField: "pairedReligiousGroups" connectedField: "pairedReligiousGroups"
} }
},
{
id: "breakDetails",
name: "Secrets/Spoilers/DM notes",
type: "break",
sizing: 12,
isSpoiler: true
},
{
id: "spoilerNotes",
name: "Secrets/Spoilers/DM notes",
type: "wysiwyg",
icon: "fas fa-mask",
sizing: 12,
isSpoiler: true,
tooltip:
`This field will not export by default when using the Export document functionality.
<br>
Instead it needs to be manually included if the user wishes to export it.
`
} }
] ]
} }

View file

@ -597,6 +597,26 @@ export const resourcesBlueprint: I_Blueprint = {
connectedObjectType: "tech", connectedObjectType: "tech",
connectedField: "pairedConnectedResources" connectedField: "pairedConnectedResources"
} }
},
{
id: "breakDetails",
name: "Secrets/Spoilers/DM notes",
type: "break",
sizing: 12,
isSpoiler: true
},
{
id: "spoilerNotes",
name: "Secrets/Spoilers/DM notes",
type: "wysiwyg",
icon: "fas fa-mask",
sizing: 12,
isSpoiler: true,
tooltip:
`This field will not export by default when using the Export document functionality.
<br>
Instead it needs to be manually included if the user wishes to export it.
`
} }
] ]
} }

View file

@ -723,7 +723,26 @@ export const techBlueprint: I_Blueprint = {
connectedObjectType: "professions", connectedObjectType: "professions",
connectedField: "pairedConnectedTechGroups" connectedField: "pairedConnectedTechGroups"
} }
},
{
id: "breakDetails",
name: "Secrets/Spoilers/DM notes",
type: "break",
sizing: 12,
isSpoiler: true
},
{
id: "spoilerNotes",
name: "Secrets/Spoilers/DM notes",
type: "wysiwyg",
icon: "fas fa-mask",
sizing: 12,
isSpoiler: true,
tooltip:
`This field will not export by default when using the Export document functionality.
<br>
Instead it needs to be manually included if the user wishes to export it.
`
} }
] ]
} }

View file

@ -562,7 +562,26 @@ export const skillsBlueprint: I_Blueprint = {
connectedObjectType: "tech", connectedObjectType: "tech",
connectedField: "pairedSkills" connectedField: "pairedSkills"
} }
},
{
id: "breakDetails",
name: "Secrets/Spoilers/DM notes",
type: "break",
sizing: 12,
isSpoiler: true
},
{
id: "spoilerNotes",
name: "Secrets/Spoilers/DM notes",
type: "wysiwyg",
icon: "fas fa-mask",
sizing: 12,
isSpoiler: true,
tooltip:
`This field will not export by default when using the Export document functionality.
<br>
Instead it needs to be manually included if the user wishes to export it.
`
} }
] ]
} }

View file

@ -1,9 +1,6 @@
## PROJECT SETTINGS BATCH 1 START - 0.1.8 ## PROJECT SETTINGS BATCH 1 START - 0.1.8
- Project setting dialog/options
- Project rename
- Selective export per field basis - Selective export per field basis
- Templates for exports - Templates for exports