diff --git a/changelog.md b/changelog.md index e18137c..f32ee39 100644 --- a/changelog.md +++ b/changelog.md @@ -3,19 +3,22 @@ ## 0.1.3 TODO -move doc buttons to the top bar -add delete document dialog to dialog system +ADD TOOLTIPS TO SEACH!!!! ### Bugfixes - Fixed the "Name" field disappearing upon full deletion of text - Fixed a bug with single/multi select fields working unintuitively for adding new values (eg: Character personality traits field or Sex field) +- Added an auto-remover of no longer existing relationships filled in within single and mutli-fields ### New features - Added a safeguard dialog for new project creation in case an opened project exists - Added a safeguard dialog for project importing in case an opened project exists -- New control bar added for documents and project control +- Added automatic redirecting to the project screen upon importing an existing project or creating a new one (better transition effect will be added later) +- Added a "Advanced search guide" dialog with manual on how to use the advanced search +- Added "About Fantasia Archive" dialog showing current app version (more details will be added in the future) +- New control bar added for documents and project control along with more intelligent button redesign - A new logo added to the app (better visibility of the logo in small scales and icons) - Massive overhaul of the search engine used by the Quick opening existing document and single/multi relationship fields (now supports tags, categories, document types, inteligent filtering and inteligent sorting via importance of the found values) - Added color support to single/multi relationship fields @@ -28,8 +31,10 @@ add delete document dialog to dialog system - Lightly modified the app color-scheme to offer better readability of contrast - Changed icon for the button triggering quick-adding of new documents -- Changed the looks of tooltips to go well with the current app looks +- Changed the looks of tooltips, relationship fields and selects to go well with the current app looks - Adjusted tab-list width to allow for more content to show +- Added a tooptip showing how many of the object in the hierarchical tree are documents and how many are categoriesE +- Hierarchical tree search bar is now attached on the top of the tree and no longer scrolls along with the rest of the content of the tree in order to allow better useability. The search now also expands to full app width on focus via user's interaction. The search icon was moved to right and the field reset icon as moved to the left. - Modified selected and active indicators for already selected/active items in dropdown lists in order to not clash with the highlighting from the filter results - Slightly modified the scrollbar visuals to be less intrusive - Added a light golden tint to the background of the app to go easy on user's eyes before dark mode is added diff --git a/src/BaseClass.ts b/src/BaseClass.ts index 1a480ae..8cbc263 100644 --- a/src/BaseClass.ts +++ b/src/BaseClass.ts @@ -307,4 +307,8 @@ export default class BaseClass extends Vue { sleep (ms:number) { return new Promise(resolve => setTimeout(resolve, ms)) } + + stripTags (input: string) { + return (input) ? input.replace(/<[^>]+>/g, "") : input + } } diff --git a/src/components/DocumentControl.vue b/src/components/DocumentControl.vue index 9b4bf96..db2fb07 100644 --- a/src/components/DocumentControl.vue +++ b/src/components/DocumentControl.vue @@ -20,6 +20,18 @@ @trigger-dialog-close="deleteObjectDialogClose" /> + + + + + +
@@ -28,6 +40,38 @@
+ + + Open keybinds cheatsheet + + + + + + Open advanced search guide + + + + + - + Export current project @@ -48,7 +96,11 @@ outline @click="existingObjectAssignUID" > - + Quick-search an existing document @@ -59,7 +111,11 @@ outline @click="newObjectAssignUID" > - + Quick-add a new document @@ -67,14 +123,73 @@
+ + + + Edit current document + + + + + + Save current document + + + + + + + Add new document with the current one as parent + + + + + - + Delete current document @@ -95,6 +210,12 @@ import BaseClass from "src/BaseClass" import newDocumentDialog from "src/components/dialogs/NewDocument.vue" import existingDocumentDialog from "src/components/dialogs/ExistingDocument.vue" import deleteDocumentCheckDialog from "src/components/dialogs/DeleteDocumentCheck.vue" +import advancedSearchGuideDialog from "src/components/dialogs/AdvancedSearchGuide.vue" +import keybindCheatsheetDialog from "src/components/dialogs/KeybindCheatsheet.vue" + +import { I_OpenedDocument } from "src/interfaces/I_OpenedDocument" +import { extend } from "quasar" +import { saveDocument } from "src/scripts/databaseManager/documentManager" import { retrieveCurrentProjectName, exportProject } from "src/scripts/projectManagement/projectManagent" @@ -102,7 +223,9 @@ import { retrieveCurrentProjectName, exportProject } from "src/scripts/projectMa components: { newDocumentDialog, existingDocumentDialog, - deleteDocumentCheckDialog + deleteDocumentCheckDialog, + advancedSearchGuideDialog, + keybindCheatsheetDialog } }) export default class DocumentControl extends BaseClass { @@ -137,6 +260,42 @@ export default class DocumentControl extends BaseClass { if (this.determineKeyBind("deleteDocument")) { this.deleteObjectAssignUID() } + + // Edit document - CTRL + E + if (this.determineKeyBind("editDocument") && this.currentyEditable) { + this.toggleEditMode() + } + + // Save document + if (this.determineKeyBind("saveDocument") && !this.currentyEditable) { + this.saveCurrentDocument().catch(e => console.log(e)) + } + } + + /****************************************************************/ + // Advanced search guide dialog + /****************************************************************/ + + advancedSearchGuideDialogTrigger: string | false = false + advancedSearchGuideDialogClose () { + this.advancedSearchGuideDialogTrigger = false + } + + advancedSearchGuideAssignUID () { + this.advancedSearchGuideDialogTrigger = this.generateUID() + } + + /****************************************************************/ + // Keybings cheatsheet dialog + /****************************************************************/ + + keybindsDialogTrigger: string | false = false + keybindsDialogClose () { + this.keybindsDialogTrigger = false + } + + keybindsDialogAssignUID () { + this.keybindsDialogTrigger = this.generateUID() } /****************************************************************/ @@ -189,6 +348,98 @@ export default class DocumentControl extends BaseClass { const projectName = await retrieveCurrentProjectName() this.exportProject(projectName) } + + /****************************************************************/ + // Add new document under parent + /****************************************************************/ + addNewUnderParent () { + const currentDoc = this.findRequestedOrActiveDocument() + if (currentDoc) { + const routeObject = { + _id: currentDoc.type, + parent: currentDoc._id + } + // @ts-ignore + this.addNewObjectRoute(routeObject) + } + } + + /****************************************************************/ + // Toggle edit mode & Save document + /****************************************************************/ + toggleEditMode () { + const currentDoc = this.findRequestedOrActiveDocument() + if (currentDoc && !currentDoc.editMode) { + const dataCopy: I_OpenedDocument = extend(true, {}, currentDoc) + dataCopy.editMode = true + const dataPass = { doc: dataCopy, treeAction: false } + this.SSET_updateOpenedDocument(dataPass) + } + } + + async saveCurrentDocument () { + const currentDoc = this.findRequestedOrActiveDocument() + + const allDocuments = this.SGET_allOpenedDocuments + + const docCopy: I_OpenedDocument[] = extend(true, [], allDocuments.docs) + + if (currentDoc) { + // @ts-ignore + const savedDocument: { + documentCopy: I_OpenedDocument, + allOpenedDocuments: I_OpenedDocument[] + } = await saveDocument(currentDoc, docCopy) + + // Update the opened document + const dataPass = { doc: savedDocument.documentCopy, treeAction: true } + this.SSET_updateOpenedDocument(dataPass) + + // Update all others + for (const doc of savedDocument.allOpenedDocuments) { + // Update the opened document + const dataPass = { doc: doc, treeAction: true } + this.SSET_updateOpenedDocument(dataPass) + } + } + } + + @Watch("$route", { immediate: true, deep: true }) + onUrlChange () { + this.checkEditability() + this.checkNew() + } + + @Watch("SGET_allOpenedDocuments", { deep: true }) + onDocChange () { + this.checkEditability() + this.checkNew() + } + + checkEditability () { + const currentDocument = this.findRequestedOrActiveDocument() + + if (currentDocument && !currentDocument.editMode) { + this.currentyEditable = true + } + else { + this.currentyEditable = false + } + } + + checkNew () { + const currentDocument = this.findRequestedOrActiveDocument() + + if (currentDocument && currentDocument.isNew) { + this.currentlyNew = true + } + else { + this.currentlyNew = false + } + } + + currentyEditable = false + currentlyNew = false } @@ -211,7 +462,7 @@ export default class DocumentControl extends BaseClass { &__wrapper { width: calc(100vw - 375px); - padding: 10px 15px; + padding: 8.5px 15px; display: flex; justify-content: space-between; } diff --git a/src/components/ObjectTree.vue b/src/components/ObjectTree.vue index a62bdaa..9f69e81 100644 --- a/src/components/ObjectTree.vue +++ b/src/components/ObjectTree.vue @@ -1,14 +1,17 @@