0.1.6a-RC-1

This commit is contained in:
Elvanos 2021-05-01 16:31:33 +02:00
parent b91b6b845c
commit 8f8b7d2e7f
25 changed files with 305 additions and 44 deletions

View file

@ -11,7 +11,7 @@
:width="425"
:start-x="50"
:start-y="150"
:actions="['close']"
:actions="['pin', 'close']"
content-class="bg-gunmetal-light text-accent advSearchWindow"
>
<div class="q-pa-md fit">
@ -20,6 +20,37 @@
</q-markdown>
</div>
</q-window>
<q-window
v-model="corkboardWindowVisible"
dark
title="Note board"
gripper-border-color="primary"
gripper-background-color="primary"
:height="600"
:width="350"
:start-x="350"
:start-y="100"
:actions="['pin', 'close']"
content-class="bg-gunmetal-light text-accent advSearchWindow"
>
<form
class="corkboardInput"
autocorrect="off"
autocapitalize="off"
autocomplete="off"
spellcheck="false"
>
<q-input
v-model="corkboardContent"
filled
dark
@keyup="processCorkboardInput"
type="textarea"
/>
</form>
</q-window>
</div>
</template>
@ -34,6 +65,7 @@ import { colors } from "quasar"
import { tipsTricks } from "src/scripts/utilities/tipsTricks"
import { shell } from "electron"
import { summonAllPlusheForms } from "src/scripts/utilities/plusheMascot"
import { saveCorkboard, retrieveCorkboard } from "src/scripts/projectManagement/projectManagent"
@Component({
components: {
@ -68,6 +100,8 @@ export default class App extends BaseClass {
// Load the popup hint on start
this.loadHintPopup()
this.loadCorkboardCotent().catch(e => console.log(e))
}
destroyed () {
@ -289,6 +323,34 @@ export default class App extends BaseClass {
advSearchWindowVisible = false
@Watch("SGET_getNoteCorkboardhWindowVisible")
onCorkboardWindowOpen () {
this.corkboardWindowVisible = true
}
corkboardWindowVisible = false
corkboardContent = ""
/**
* Debounce timer to prevent buggy input sync
*/
corkboardTimer = null as any
processCorkboardInput () {
clearTimeout(this.corkboardTimer)
this.corkboardTimer = setTimeout(() => {
saveCorkboard(this.corkboardContent).catch(e => console.log(e))
}, 1000)
}
async loadCorkboardCotent () {
this.corkboardContent = await retrieveCorkboard()
if (this.corkboardContent.length > 0) {
this.corkboardWindowVisible = true
}
}
/****************************************************************/
// Local keybinds
/****************************************************************/
@ -299,6 +361,11 @@ export default class App extends BaseClass {
if (this.determineKeyBind("toggleAdvSearchCheatsheet")) {
this.advSearchWindowVisible = !this.advSearchWindowVisible
}
// Toggle Note Board - CTRL + ALT + SHIFT + P
if (this.determineKeyBind("toggleNoteCorkboard")) {
this.corkboardWindowVisible = !this.corkboardWindowVisible
}
}
}
</script>

View file

@ -40,14 +40,14 @@ export default class BaseClass extends Vue {
}
/**
* Async wait for XY miliseconds
* Async wait for XY miliseconds
*/
sleep (ms:number) {
return new Promise(resolve => setTimeout(resolve, ms))
}
/**
* Strip all tags from a string
* Strip all tags from a string
*/
stripTags (input: string) {
return (input) ? input.replace(/<[^>]+>/g, "") : input
@ -60,6 +60,9 @@ export default class BaseClass extends Vue {
@FloatingWindows.Getter("getAdvSearchWindowVisible") SGET_getAdvSearchWindowVisible!: string
@FloatingWindows.Mutation("setAdvSearchWindowVisible") SSET_setAdvSearchWindowVisible!: () => void
@FloatingWindows.Getter("getNoteCorkboardhWindowVisible") SGET_getNoteCorkboardhWindowVisible!: string
@FloatingWindows.Mutation("setNoteCorkboardWindowVisible") SSET_setNoteCorkboardWindowVisible!: () => void
/****************************************************************/
// KEYBINDS MANAGEMENT
/****************************************************************/

View file

@ -137,6 +137,21 @@
</q-tooltip>
</q-btn>
<q-btn
icon="mdi-clipboard-text-outline"
color="primary"
outline
@click="SSET_setNoteCorkboardWindowVisible"
>
<q-tooltip
:delay="500"
anchor="bottom middle"
self="top middle"
>
Show note board
</q-tooltip>
</q-btn>
<q-separator vertical inset color="accent" />
<q-btn
@ -512,7 +527,8 @@ export default class DocumentControl extends BaseClass {
copyTargetDocument () {
this.documentPass = extend(true, {}, this.findRequestedOrActiveDocument())
const newDocument = copyDocument(this.documentPass, this.generateUID())
const blueprint = this.SGET_blueprint(this.documentPass.type)
const newDocument = copyDocument(this.documentPass, this.generateUID(), blueprint)
const dataPass = {
doc: newDocument,

View file

@ -1038,7 +1038,8 @@ export default class ObjectTree extends BaseClass {
copyTargetDocument (currentDoc: I_OpenedDocument) {
this.documentPass = extend(true, {}, this.SGET_document(currentDoc._id))
const newDocument = copyDocument(this.documentPass, this.generateUID())
const blueprint = this.SGET_blueprint(this.documentPass.type)
const newDocument = copyDocument(this.documentPass, this.generateUID(), blueprint)
const dataPass = {
doc: newDocument,

View file

@ -179,6 +179,21 @@
</q-item-section>
</q-item>
<q-item
v-close-popup
clickable
active
active-class="bg-gunmetal-light text-cultured"
class="noHigh"
@click="SSET_setNoteCorkboardWindowVisible"
:disable="!projectExists"
>
<q-item-section>Show note board</q-item-section>
<q-item-section avatar>
<q-icon name="mdi-clipboard-text-outline" />
</q-item-section>
</q-item>
<q-separator dark />
<q-item
@ -279,11 +294,11 @@
active-class="bg-gunmetal-light text-cultured"
class="noHigh"
@click="navigateToProjectPage"
:disable="!projectExists || isProjectPage || SGET_allOpenedDocuments.docs.length > 0"
:disable="!projectExists || isProjectPage"
>
<q-item-section>Resume project</q-item-section>
<q-item-section>Show project overview</q-item-section>
<q-item-section avatar>
<q-icon name="mdi-folder-open-outline" />
<q-icon name="mdi-chart-bar" />
</q-item-section>
</q-item>
@ -563,6 +578,11 @@ export default class AppControl extends BaseClass {
if (this.determineKeyBind("openAppOptions") && !this.SGET_getDialogsState) {
this.programSettingsDialogAssignUID()
}
// App options
if (this.determineKeyBind("navigateToProjectOverview") && this.projectExists && !this.isProjectPage) {
this.navigateToProjectPage()
}
}
/****************************************************************/

View file

@ -413,7 +413,8 @@ export default class TopTabs extends BaseClass {
copyTargetDocument (currentDoc: I_OpenedDocument) {
this.documentPass = extend(true, {}, currentDoc)
const newDocument = copyDocument(this.documentPass, this.generateUID())
const blueprint = this.SGET_blueprint(this.documentPass.type)
const newDocument = copyDocument(this.documentPass, this.generateUID(), blueprint)
const dataPass = {
doc: newDocument,

View file

@ -545,7 +545,8 @@ export default class ExistingDocumentDialog extends DialogBase {
copyTargetDocument (currentDoc: I_OpenedDocument) {
this.documentPass = extend(true, {}, currentDoc)
const newDocument = copyDocument(this.documentPass, this.generateUID())
const blueprint = this.SGET_blueprint(this.documentPass.type)
const newDocument = copyDocument(this.documentPass, this.generateUID(), blueprint)
const dataPass = {
doc: newDocument,

View file

@ -185,10 +185,10 @@
<div class="col-12 col-md-6 col-lg-4 optionWrapper">
<div class="optionTitle">
Hide tips on project screen
Hide tips on project overview
<q-icon name="mdi-help-circle" size="16px" class="q-ml-md">
<q-tooltip :delay="500">
Hides the project screen tips & tricks info card.
Hides the project overview tips & tricks info card.
</q-tooltip>
</q-icon>
</div>

View file

@ -799,7 +799,8 @@ export default class Field_MultiRelationship extends FieldBase {
copyTargetDocument (currentDoc: I_OpenedDocument) {
this.documentPass = extend(true, {}, currentDoc)
const newDocument = copyDocument(this.documentPass, this.generateUID())
const blueprint = this.SGET_blueprint(this.documentPass.type)
const newDocument = copyDocument(this.documentPass, this.generateUID(), blueprint)
const dataPass = {
doc: newDocument,

View file

@ -733,7 +733,8 @@ export default class Field_SingleRelationship extends FieldBase {
copyTargetDocument (currentDoc: I_OpenedDocument) {
this.documentPass = extend(true, {}, currentDoc)
const newDocument = copyDocument(this.documentPass, this.generateUID())
const blueprint = this.SGET_blueprint(this.documentPass.type)
const newDocument = copyDocument(this.documentPass, this.generateUID(), blueprint)
const dataPass = {
doc: newDocument,

View file

@ -10,8 +10,26 @@
</q-icon>
</div>
<div v-if="!editMode && localInput">
<div
v-if="!editMode"
>
<q-chip
:color="(isDarkMode) ? 'accent' : 'gunmetal-light'"
:text-color="(isDarkMode) ? 'dark' :'satin-sheen-gold-light'"
:class="(isDarkMode) ? 'text-weight-bold':'text-weight-medium'">
<q-icon
:color="(isDarkMode) ? 'dark' :'satin-sheen-gold-light'"
name="mdi-check-bold"
class="q-mr-sm"
/>
Active
</q-chip>
</div>
</div>
<q-toggle
:disable="!editMode"
v-if="editMode"
v-model="localInput"
@input="processInput"
/>

View file

@ -1,13 +1,16 @@
<template>
<div>
<div class="flex justify-start items-center text-weight-bolder q-mb-sm q-mt-md fieldWysiwygTitle">
<q-icon v-if="inputIcon" :name="inputIcon" :size="inputIcon.includes('fas')? '15px': '20px'" class="q-mr-md"/>
<div class="flex justify-center items-center text-weight-bolder q-mb-sm q-mt-md fieldWysiwygTitle">
<span>
<q-icon v-if="inputIcon" :name="inputIcon" :size="inputIcon.includes('fas')? '15px': '20px'" class="q-mr-md"/>
{{inputDataBluePrint.name}}
<q-icon v-if="toolTip && !disableDocumentToolTips" name="mdi-help-circle" size="16px" class="q-ml-md">
<q-tooltip :delay="500">
<span v-html="toolTip"/>
</q-tooltip>
</q-icon>
</span>
</div>
<div

View file

@ -607,3 +607,36 @@ body .q-tooltip {
background-repeat: no-repeat;
background-size: 30px;
}
.corkboardInput {
height: 100%;
width: 100%;
form {
width: 100%;
}
.q-validation-component {
height: 100%;
}
.q-field__control {
height: 100%;
padding: 0;
}
.q-field__control::before,
.q-field--filled.q-field--dark .q-field__control,
.q-field--filled.q-field--dark .q-field__control::before {
background: transparent !important;
background-color: transparent !important;
}
textarea {
padding: 17px 12px;
height: 100% !important;
resize: none !important;
font-size: 15px;
line-height: 20px;
}
}

View file

@ -8,7 +8,6 @@
### Known issues
- Overusing Tags (20+ with 400+ documents in them for most) currently causes slowdowns/crashes on some PCs when using the Hierarchy tree. If you suffer from this issue, reduce the number of tags and/or objects paired underneath them.
- When using the `Legacy project repair` tool, a very small amount of users report being stuck on the progress. If you suffer from the issue, restart the app and then restart the fixing process - this seems to be a workaround for now.
- Importing existing project can sometimes get stuck. Restarting the app fixes this.
### Bugfixes & Optimizations
@ -18,13 +17,22 @@
- Fixed a bug that was causing import/merge/repair tools to get stuck after exporting in the same popup
- Fixed an issue with flickering select menus
- Fixed functionality of the `Connected Locations` field in the `Teachings/Religious groups` document type
- Fixed a bug that waas causing the copy document functionality to also copy single-to-single and many-to-single relationships.
- These relationships can not be copied as they are logically unique across the whole web of all relationships the user build and can exist only once in the whole system
- Example: Bilbo has `Place of origin` set to Shire - if you make a copy of Shire, Bilbo will get automatically removed from the `Characters originated from location` in the copy of the Shire as he is already linked to the original Shire and logically couldn't have originated from two places at once.
### New features
- Added new options to predefeined select lists across the app
- Added new display for non-edit mode for switch fields
- Added keybind: Show project overview
### QoL adjustments
- Adjusted label-align of text editor fields to look more representstive of half-coherent UI
- Adjusted the behavior, icon and name of the `Resume project` functionality in the menu
- Renamed "Project screen" to "Project overview" app-wide
## 0.1.6
### Known issues

2
src/globals.d.ts vendored
View file

@ -1,6 +1,6 @@
declare module "*.md"{
const content: string
export default content
export default content
}
declare module "*.png"{

View file

@ -124,8 +124,10 @@ export default class DocumentLayout extends BaseClass {
}
establishAllDocumentDatabases () {
// @ts-ignore
window.FA_dbs = {}
if (!window.FA_dbs) {
// @ts-ignore
window.FA_dbs = {}
}
for (const blueprint of this.SGET_allBlueprints) {
window.FA_dbs[blueprint._id] = new PouchDB(blueprint._id)
}

View file

@ -872,7 +872,8 @@ export default class PageDocumentDisplay extends BaseClass {
copyTargetDocument () {
this.documentPass = extend(true, {}, this.findRequestedOrActiveDocument())
const newDocument = copyDocument(this.documentPass, this.generateUID())
const blueprint = this.SGET_blueprint(this.documentPass.type)
const newDocument = copyDocument(this.documentPass, this.generateUID(), blueprint)
const dataPass = {
doc: newDocument,

View file

@ -13,7 +13,7 @@
/>
<div class="col-12">
<h5 class="mainProjectSubTitle">Project screen for </h5>
<h5 class="mainProjectSubTitle">Project overview for </h5>
</div>
<div class="col-12">
<h2 class="mainProjectTitle"> {{projectName}}</h2>
@ -164,7 +164,7 @@ export default class ProjectScreen extends BaseClass {
disableDocumentControlBar = false
/**
* Determines if the project screen help hint should show or not
* Determines if the project overview help hint should show or not
*/
hideTooltipsProject = false

View file

@ -11,6 +11,17 @@ export const defaultKeybinds = [
tooltip: "Open keybind cheatsheet"
},
// Show project overview - NONE
{
altKey: false,
ctrlKey: false,
shiftKey: false,
which: false,
editable: true,
id: "navigateToProjectOverview",
tooltip: "Show project overview"
},
// Open app options - CTRL + ALT + J
{
altKey: true,
@ -231,6 +242,17 @@ export const defaultKeybinds = [
tooltip: "Toggle the Advanced search cheatsheet"
},
// Toggle Note Board - CTRL + ALT + SHIFT + P
{
altKey: true,
ctrlKey: true,
shiftKey: true,
which: 80,
editable: true,
id: "toggleNoteCorkboard",
tooltip: "Toggle Note board"
},
// Next focus - Tab
{
altKey: false,
@ -255,7 +277,7 @@ export const defaultKeybinds = [
note: "(functionality is the same as when using a web-browser)"
},
// Open document coresponding to the tre node - Enter
// Open document coresponding to the tree node - Enter
{
altKey: false,
ctrlKey: false,

View file

@ -1,6 +1,7 @@
import { I_Blueprint } from "src/interfaces/I_Blueprint"
import { I_OpenedDocument } from "src/interfaces/I_OpenedDocument"
export const copyDocument = (currentDoc: I_OpenedDocument, newDocumentID: string) : I_OpenedDocument => {
export const copyDocument = (currentDoc: I_OpenedDocument, newDocumentID: string, documentBlueprint: I_Blueprint) : I_OpenedDocument => {
currentDoc._id = newDocumentID
currentDoc.isNew = true
currentDoc.editMode = true
@ -38,5 +39,19 @@ export const copyDocument = (currentDoc: I_OpenedDocument, newDocumentID: string
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
currentDoc.extraFields[documentNameIndex].value = `Copy of - ${currentDoc.extraFields[documentNameIndex].value}`
currentDoc.extraFields.map(field => {
const fieldType = documentBlueprint.extraFields.find(blueprintField => field.id === blueprintField.id)?.type
if (fieldType === "singleToSingleRelationship") {
field.value = ""
}
if (fieldType === "manyToSingleRelationship") {
field.value = ""
}
return field
})
return currentDoc
}

View file

@ -15,9 +15,16 @@ import path from "path"
export const createNewProject = async (projectName: string, vueRouter: any, quasar: any, vueInstance: any) => {
await removeCurrentProject()
const ProjectDB = new PouchDB("project-data")
if (!window.FA_dbs) {
// @ts-ignore
window.FA_dbs = {}
}
window.FA_dbs["project-data"] = new PouchDB("project-data")
const newProject = { _id: projectName }
await ProjectDB.put(newProject)
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
window.FA_dbs["project-data"].put(newProject)
/*eslint-disable */
// @ts-ignore
@ -49,8 +56,6 @@ export const createNewProject = async (projectName: string, vueRouter: any, quas
vueInstance.SSET_resetDocuments()
vueInstance.SSET_resetAllDocuments()
/* eslint-enable */
await ProjectDB.close()
}
/**
@ -283,9 +288,49 @@ export const mergeExistingProject = (vueRouter: any, Loading: any, loadingSetup:
* Retrieves current project name
*/
export const retrieveCurrentProjectName = async () => {
const ProjectDB = new PouchDB("project-data")
const projectData = await ProjectDB.allDocs({ include_docs: true })
await ProjectDB.close()
if (!window.FA_dbs) {
// @ts-ignore
window.FA_dbs = {}
}
window.FA_dbs["project-data"] = new PouchDB("project-data")
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
const projectData = await window.FA_dbs["project-data"].allDocs({ include_docs: true })
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return projectData?.rows[0]?.id
}
/**
* Save corkboard update
*/
export const saveCorkboard = async (input: string) => {
if (!window.FA_dbs) {
// @ts-ignore
window.FA_dbs = {}
}
window.FA_dbs["project-data"] = new PouchDB("project-data")
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
const projectData = await window.FA_dbs["project-data"].allDocs({ include_docs: true })
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
projectData.rows[0].doc.corkboardText = input.trim()
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
window.FA_dbs["project-data"].put(projectData.rows[0].doc)
}
/**
* Retrieve corkboard
*/
export const retrieveCorkboard = async (): Promise<string> => {
if (!window.FA_dbs) {
// @ts-ignore
window.FA_dbs = {}
}
window.FA_dbs["project-data"] = new PouchDB("project-data")
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
const projectData = await window.FA_dbs["project-data"].allDocs({ include_docs: true })
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return (projectData.rows[0]?.doc.corkboardText) || ""
}

View file

@ -5,6 +5,9 @@ import { FloatingWindowsStateInteface } from "./state"
const getters: GetterTree<FloatingWindowsStateInteface, StateInterface> = {
getAdvSearchWindowVisible (context) {
return context.advSearchWindowVisible
},
getNoteCorkboardhWindowVisible (context) {
return context.noteCorkboardWindowVisible
}
}

View file

@ -6,6 +6,10 @@ const mutation: MutationTree<FloatingWindowsStateInteface> = {
setAdvSearchWindowVisible (state: FloatingWindowsStateInteface) {
state.advSearchWindowVisible = uid()
},
setNoteCorkboardWindowVisible (state: FloatingWindowsStateInteface) {
state.noteCorkboardWindowVisible = uid()
}
}

View file

@ -1,11 +1,12 @@
export interface FloatingWindowsStateInteface {
advSearchWindowVisible: string,
noteCorkboardWindowVisible: string,
}
function state (): FloatingWindowsStateInteface {
return {
advSearchWindowVisible: ""
advSearchWindowVisible: "",
noteCorkboardWindowVisible: ""
}
}

View file

@ -1,13 +1,7 @@
- Fix file name symbols for OSs in new project names
- Add a way to view the project graph without closing all the documents
- Add checkbox or something for viewmode switch fields
- Consider adding color support for text shadow of individual documents
- Consider adding coloring to icons of documents separately
## THE GM BATCH
- Floating notes corkboard
- Add on-the-fly generation of non-existent 2-way relationships
- Add hover/on-demand document preview to relationships
- Export for MD/PDF/ODT/DOCX
@ -16,7 +10,6 @@
## THE GM BATCH END
- Add debounce timer to input fields (bad sync updating with store)
- Add reverse list field option (dropdown first, value in bracket)
- Rework stats (via reverse list)
- Add option for project graph to filter out categories or show them separately
@ -48,7 +41,10 @@
- Add description tabs
- Add category for materials/resources OR adapt Items category
- Add category for diseases/curses/etc
- Add category for classes/jobs
- Add support for individual document order hiding inside the hierarchical tree for each document
- Consider adding color support for text shadow of individual documents
- Consider adding coloring to icons of documents separately
### Project settings
@ -71,7 +67,6 @@
- Settings search
- Vanity project-wide word count (lol...)
- Add on-the-fly generation of non-existent 2-way relationships
- Automatic thumbnail generation AND re-checking based on date