diff --git a/src/components/DocumentControl.vue b/src/components/DocumentControl.vue index f044f17..f345ed7 100644 --- a/src/components/DocumentControl.vue +++ b/src/components/DocumentControl.vue @@ -435,13 +435,13 @@ export default class DocumentControl extends BaseClass { } // Quick open existing document - if (this.determineKeyBind("openDocInSide") && !this.currentlyNew && this.SGET_allOpenedDocuments.docs.length > 0 && !this.SGET_getDialogsState && this.$route.path !== "/project") { - this.openThisDocumentInSidebar() + if (this.determineKeyBind("quickExistingDocument") && !this.SGET_getDialogsState) { + this.existingObjectAssignUID() } - // Delete dialog - CTRL + D - if (this.determineKeyBind("deleteDocument") && !this.currentlyNew && this.SGET_allOpenedDocuments.docs.length > 0 && !this.SGET_getDialogsState && this.$route.path !== "/project") { - this.deleteObjectAssignUID() + // Quick open existing document + if (this.determineKeyBind("openDocInSide") && !this.currentlyNew && this.SGET_allOpenedDocuments.docs.length > 0 && !this.SGET_getDialogsState && this.$route.path !== "/project") { + this.openThisDocumentInSidebar() } // Delete dialog - CTRL + D diff --git a/src/components/DocumentPreview.vue b/src/components/DocumentPreview.vue index a355f69..f55b402 100644 --- a/src/components/DocumentPreview.vue +++ b/src/components/DocumentPreview.vue @@ -586,6 +586,10 @@ body:not(.body--dark) { .text-primary { color: var(--q-color-primary) !important; } + + .isDead { + text-decoration-color: #000; + } } } diff --git a/src/components/ObjectTree.vue b/src/components/ObjectTree.vue index 485b9bd..023e638 100644 --- a/src/components/ObjectTree.vue +++ b/src/components/ObjectTree.vue @@ -27,6 +27,13 @@ @trigger-dialog-close="deleteTagDialogClose" /> + + +
- + - + Expand all under this node @@ -315,7 +347,7 @@ - + + + + Delete documents belonging under this + + + + @@ -399,6 +443,7 @@ import { I_ExtraDocumentFields, I_OpenedDocument, I_ShortenedDocument } from "sr import deleteDocumentCheckDialog from "src/components/dialogs/DeleteDocumentCheck.vue" import renameTagDialog from "src/components/dialogs/RenameTag.vue" import deleteTagDialog from "src/components/dialogs/DeleteTag.vue" +import massDeleteDocumentsCheckDialog from "src/components/dialogs/MassDeleteDocumentsCheck.vue" import { extend, colors, uid } from "quasar" import { tagListBuildFromBlueprints } from "src/scripts/utilities/tagListBuilder" @@ -412,6 +457,7 @@ import { copyDocument } from "src/scripts/documentActions/copyDocument" deleteDocumentCheckDialog, renameTagDialog, deleteTagDialog, + massDeleteDocumentsCheckDialog, documentPreview: () => import("src/components/DocumentPreview.vue") } }) @@ -1367,6 +1413,47 @@ export default class ObjectTree extends BaseClass { documentPreviewClose = "" allTags: string[] = [] + + /****************************************************************/ + // Mass delete documents dialog + /****************************************************************/ + + massDocumentDelteDialogTrigger: string | false = false + massDocumentDelteDialogClose () { + this.massDocumentDelteDialogTrigger = false + } + + massDocumentDelteDialogAssignUID () { + this.massDocumentDelteDialogTrigger = this.generateUID() + } + + flatten (data: { children: { _id: string}[]}) { + /*eslint-disable */ + // @ts-ignore + return data.reduce((r, { children, ...rest }) => { + r.push(rest) + if (children) { + // @ts-ignore + r.push(...this.flatten(children)) + } + return r + }, []) + /* eslint-enable */ + } + + toDeleteIDs: string[] = [] + + massDeleteDocuments (node: { children: { _id: string}[]}) { + /*eslint-disable */ + // @ts-ignore + const toDeleteDocumentIDs: string[] = (this.flatten(node.children)) + .filter((e: {extraFields?: string}) => e?.extraFields) + .map((e: {_id: string}) => e._id) + /* eslint-enable */ + + this.toDeleteIDs = toDeleteDocumentIDs + this.massDocumentDelteDialogAssignUID() + } } diff --git a/src/components/appHeader/AppControl.vue b/src/components/appHeader/AppControl.vue index bba3a29..13648af 100644 --- a/src/components/appHeader/AppControl.vue +++ b/src/components/appHeader/AppControl.vue @@ -96,6 +96,12 @@ @trigger-dialog-close="exportProjectDialogClose" /> + + + + + + + Mass delete documents + + + + + diff --git a/src/components/dialogs/DeleteTag.vue b/src/components/dialogs/DeleteTag.vue index c1bac48..b2b1bd9 100644 --- a/src/components/dialogs/DeleteTag.vue +++ b/src/components/dialogs/DeleteTag.vue @@ -4,7 +4,7 @@ @before-hide="triggerDialogClose" no-route-dismiss > - +
Delete {{targetTag}}?
@@ -132,7 +132,7 @@ export default class DeleteTagPrompt extends DialogBase { diff --git a/src/components/fields/Field_SingleSelect.vue b/src/components/fields/Field_SingleSelect.vue index 3a34e69..b44cf1a 100644 --- a/src/components/fields/Field_SingleSelect.vue +++ b/src/components/fields/Field_SingleSelect.vue @@ -24,9 +24,8 @@
.q-item, +.q-item--dense { + min-height: 42px !important; +} diff --git a/src/documents/changeLog.md b/src/documents/changeLog.md index 777b0fe..c9952ea 100644 --- a/src/documents/changeLog.md +++ b/src/documents/changeLog.md @@ -15,6 +15,7 @@ - Fixed a few bug with the export project window not properly displaying on top of other windows/popups - Fixed a typo in "Save all opened documents with active changes" keybind +- Fixed a bug that was causing the predefined select list sometimes completely disappear along with whole select in the single-select field when filtering (eg: Sex field) ### New features @@ -33,7 +34,9 @@ - Added search to keybinds cheatsheet - Added hierarchical tree auto-expand to top-tag pseudo-category on startup in order to unify the behavior with how rest of FA modules work right now - Set non-aggressive relationships selection as default to make setting up new project a little easier for users -- Reworded the legacy field warning message. +- Reworded the legacy field warning message +- Compacted the right-click menus across the app to make them a little easier to use +- Optimized document display view to only show titles for sections that actually have content in case the document is tagged as finished or if options are set to only display filled field values ## 0.1.7 diff --git a/src/layouts/DocumentLayout.vue b/src/layouts/DocumentLayout.vue index 2387dfb..9a6eeaf 100644 --- a/src/layouts/DocumentLayout.vue +++ b/src/layouts/DocumentLayout.vue @@ -33,7 +33,6 @@ class="pageSplitter" > @@ -240,34 +239,35 @@ export default class DocumentLayout extends BaseClass { // @ts-ignore this.pre017check = options.pre017check - if (this.SGET_getDocumentPreviewVisible === "") { - if (options.treeWidth && !this.hideHierarchyTree) { - this.splitterModel = options.treeWidth - } - else { - this.splitterModel = 0 - } - } + this.resizeTreeWrapper() } legacyFieldsCheck: boolean|undefined = true get limiterWidth () { - return (!this.hideHierarchyTree) ? 374 : 0 + return (!this.hideHierarchyTree && this.SGET_getDocumentPreviewVisible === "") ? 374 : 0 } hideHierarchyTree = false - @Watch("SGET_getDocumentPreviewVisible") - reactToPreviewVisibilityChange () { - if (this.SGET_getDocumentPreviewVisible !== "" && !this.hideHierarchyTree) { + @Watch("limiterWidth") + resizeTreeWrapper () { + if (this.SGET_getDocumentPreviewVisible !== "") { this.splitterModel = 600 } + else if (this.hideHierarchyTree) { + this.splitterModel = 0 + } else if (this.SGET_options.treeWidth && !this.hideHierarchyTree) { this.splitterModel = this.SGET_options.treeWidth } } + @Watch("SGET_getDocumentPreviewVisible") + reactToPreviewVisibilityChange () { + this.resizeTreeWrapper() + } + /****************************************************************/ // OPTTION UPDATER /****************************************************************/ diff --git a/src/pages/DocumentDisplay.vue b/src/pages/DocumentDisplay.vue index 26bca67..89179cb 100644 --- a/src/pages/DocumentDisplay.vue +++ b/src/pages/DocumentDisplay.vue @@ -195,6 +195,7 @@ (retrieveFieldType(currentData, field.id) !== 'break' || !hideDocumentTitles) && ( (hasValueFieldFilter(field) || editMode) + && (checkBreakSectionValues(field) || editMode) && checkForLegacyFieldValue(currentData, field) ) " @@ -873,6 +874,36 @@ export default class PageDocumentDisplay extends BaseClass { ) } + checkBreakSectionValues (field: any) { + // If this isnt break, let it through + if (field.type !== "break") { + return true + } + + console.log("") + console.log(field) + + // If this is a break, keep checking following field either until a filled value if found (in which case, elt it through) or until anothe break OR end of the list is found - in which case, deny it + const fullFieldLength = this.bluePrintData.extraFields.length + let matchedIndex = this.bluePrintData.extraFields.findIndex(f => f.id === field.id) + let matchedField = this.bluePrintData.extraFields[matchedIndex + 1] + while (matchedField.type !== "break" || matchedIndex + 1 === fullFieldLength) { + matchedField = this.bluePrintData.extraFields[matchedIndex + 1] + console.log(matchedField) + if (!matchedField || matchedField.type === "break") { + return false + } + const hasValue = this.hasValueFieldFilter(matchedField) + console.log(hasValue) + if (hasValue) { + return true + } + matchedIndex++ + } + + return false + } + checkForLegacyFieldValue (document: I_OpenedDocument| I_ShortenedDocument, field: {id: string}) { const isLegacyField = this.determineLegacyField(document, field.id) diff --git a/suggestionList.md b/suggestionList.md index 622edb9..cbca232 100644 --- a/suggestionList.md +++ b/suggestionList.md @@ -1,11 +1,8 @@ ## PROJECT SETTINGS BATCH 1 START - 0.1.8 -- Rewrite document display algortithmn and add option to show description (text editor fields) on top of the section (under break) - Breaks/titles in lists -- Fix "isDead" class styling in light mode in sie preview and main document body - - Project setting dialog/options - Project rename - List of last saved documents on project overview