0.1.6-RC-4

This commit is contained in:
Elvanos 2021-04-28 19:33:51 +02:00
parent c49a685d17
commit 856de930ba
6 changed files with 41 additions and 47 deletions

View file

@ -10,7 +10,7 @@
:height="510"
:width="425"
:start-x="50"
:start-y="150"
:start-y="150"
:actions="['close']"
content-class="bg-gunmetal-light text-accent advSearchWindow"
>
@ -205,11 +205,28 @@ export default class App extends BaseClass {
* Open wysiwyg links in default browser window
*/
openWysiwygLink (event: MouseEvent) {
event.preventDefault()
// @ts-ignore
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
if (event.target && event.target.tagName.toLowerCase() === "a" && event.target.closest(".fieldWysiwyg")) {
const isValidHttpUrl = (string:string) => {
let url
try {
url = new URL(string)
}
catch (_) {
return false
}
return url.protocol === "http:" || url.protocol === "https:"
}
// @ts-ignore
shell.openExternal(event.target.href).catch(e => console.log(e))
if (isValidHttpUrl(event.target.href)) {
// @ts-ignore
shell.openExternal(event.target.href).catch(e => console.log(e))
}
}
}

View file

@ -368,12 +368,16 @@ export default class DocumentControl extends BaseClass {
// Save document - CTRL + S
if (this.determineKeyBind("saveDocument") && !this.currentyEditable && this.SGET_allOpenedDocuments.docs.length > 0 && !this.SGET_getDialogsState && this.$route.path !== "/project") {
this.saveCurrentDocument(false).catch(e => console.log(e))
setTimeout(() => {
this.saveCurrentDocument(false).catch(e => console.log(e))
}, 500)
}
// Save document without exiting edit mode - CTRL + ALT + S
if (this.determineKeyBind("saveDocumentNoExit") && !this.currentyEditable && this.SGET_allOpenedDocuments.docs.length > 0 && !this.SGET_getDialogsState && this.$route.path !== "/project") {
this.saveCurrentDocument(true).catch(e => console.log(e))
setTimeout(() => {
this.saveCurrentDocument(true).catch(e => console.log(e))
}, 500)
}
// Add new under parent - CTRL + SHIFT + N

View file

@ -153,7 +153,7 @@
input-debounce="500"
v-model="localInput"
@filter="filterSelect"
@input="processInput()"
@input="processInput"
>
<template v-slot:append>
<q-btn round dense flat v-slot:append v-if="!hideAdvSearchCheatsheetButton" icon="mdi-help-rhombus" @click.stop.prevent="SSET_setAdvSearchWindowVisible"
@ -485,7 +485,6 @@ export default class Field_MultiRelationship extends FieldBase {
const notes = (!localCopy?.addedValues) ? [] : localCopy.addedValues
this.inputNotes = notes.filter(single => this.localInput.find(e => single.pairedId === e._id))
this.checkNotes()
this.reloadObjectListAndCheckIfValueExists()
@ -600,7 +599,17 @@ export default class Field_MultiRelationship extends FieldBase {
const pairedFieldObject = objectDoc.extraFields.find(f => f.id === pairedField)
const pairingType = this.inputDataBluePrint.type
if (pairedFieldObject !== undefined && typeof pairedFieldObject?.value !== "string" && pairedFieldObject?.value !== null && pairingType === "manyToSingleRelationship") {
if (
pairedFieldObject !== undefined &&
pairedFieldObject !== null &&
pairedFieldObject?.value !== undefined &&
pairedFieldObject?.value !== null &&
typeof pairedFieldObject?.value !== "string" &&
pairedFieldObject?.value?.value !== undefined &&
pairedFieldObject?.value?.value !== null &&
typeof pairedFieldObject?.value?.value !== "string" &&
pairingType === "manyToSingleRelationship"
) {
isDisabled = true
}
}
@ -639,6 +648,7 @@ export default class Field_MultiRelationship extends FieldBase {
this.allTypeDocuments = allDbObjects.docs
// Remove delete documents paired to this
if (toRemoveIndexList.length > 0) {
toRemoveIndexList.forEach((id) => {
const indexToRemove = this.localInput.findIndex(doc => doc._id === id)
@ -682,21 +692,6 @@ export default class Field_MultiRelationship extends FieldBase {
disabledIDList: string[] = []
processSelectInteraction (input: null| I_ShortenedDocument) {
// TODO ADD THIS
/* if (input) {
this.disabledIDList.push(input._id)
}
else {
const toRemoveIndex = this.disabledIDList.findIndex(id => id === this.inputDataValue.value._id)
if (toRemoveIndex) {
this.disabledIDList.splice(toRemoveIndex, 1)
}
} */
this.processInput()
}
/**
* Debounce timer to prevent buggy input sync
*/

View file

@ -629,7 +629,7 @@ export default class Field_SingleRelationship extends FieldBase {
else {
const toRemoveIndex = this.disabledIDList.findIndex(id => id === this.inputDataValue.value._id)
if (toRemoveIndex) {
if (toRemoveIndex > -1) {
this.disabledIDList.splice(toRemoveIndex, 1)
}
}

View file

@ -21,6 +21,7 @@
- Fixed more typos across the app
- Added debounce timers for all input fields across whole document to massively improve performance when updating temporary document data across the app
- Fixed a bug that was re-triggering edit mode on document save without any actual edits
- Fixed a bug that was causing improperly filled in URLs in the text editor field to glitch out the whole app and require a restart
### New features

View file

@ -6,18 +6,7 @@ export const charactersBlueprint: I_Blueprint = {
nameSingular: "Character",
icon: "mdi-account",
extraFields: [
/*
{
id: "singleTest",
name: "SINGLE TO SINGLE TEST",
type: "singleToSingleRelationship",
icon: "mdi-account",
sizing: 12,
relationshipSettings: {
connectedObjectType: "characters",
connectedField: "singleTest"
}
},
{
id: "singleToMultiTest",
name: "SINGLE TO MULTI TEST",
@ -41,18 +30,6 @@ export const charactersBlueprint: I_Blueprint = {
connectedField: "singleToMultiTest"
}
},
{
id: "multiTest",
name: "MULTI TO MULTI TEST",
type: "manyToManyRelationship",
icon: "mdi-account",
sizing: 12,
relationshipSettings: {
connectedObjectType: "characters",
connectedField: "multiTest"
}
}, */
{
id: "breakDocumentSettings",
name: "Document settings",