mirror of
https://github.com/Elvanos/fantasia-archive.git
synced 2024-06-17 17:54:54 +12:00
0.1.8-DEV-2
This commit is contained in:
parent
1547f868be
commit
dd8ff65604
|
@ -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
|
||||
|
|
|
@ -586,6 +586,10 @@ body:not(.body--dark) {
|
|||
.text-primary {
|
||||
color: var(--q-color-primary) !important;
|
||||
}
|
||||
|
||||
.isDead {
|
||||
text-decoration-color: #000;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -27,6 +27,13 @@
|
|||
@trigger-dialog-close="deleteTagDialogClose"
|
||||
/>
|
||||
|
||||
<!-- Delete tag dialog -->
|
||||
<massDeleteDocumentsCheckDialog
|
||||
:dialog-trigger="massDocumentDelteDialogTrigger"
|
||||
:prepicked-ids="toDeleteIDs"
|
||||
@trigger-dialog-close="massDocumentDelteDialogClose"
|
||||
/>
|
||||
|
||||
<div
|
||||
class="treeSearchWrapper"
|
||||
:class="{'fullWidth': disableDocumentControlBar}"
|
||||
|
@ -197,7 +204,7 @@
|
|||
context-menu
|
||||
>
|
||||
|
||||
<q-list class="bg-gunmetal-light text-accent" v-if="!prop.node.isTag">
|
||||
<q-list class="bg-gunmetal-light text-accent" v-if="!prop.node.isTag" dense>
|
||||
|
||||
<template v-if="prop.node.isRoot || prop.node.children.length > 0 || prop.node.isModule">
|
||||
<q-item clickable v-close-popup @click="recursivelyExpandNodeDownwards(prop.node.key)">
|
||||
|
@ -222,6 +229,19 @@
|
|||
<q-icon name="mdi-plus" />
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
|
||||
<q-separator dark />
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="massDeleteDocuments(prop.node)"
|
||||
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 avatar class="text-secondary">
|
||||
<q-icon name="mdi-text-box-remove-outline" />
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
|
||||
<template v-if="!prop.node.isRoot && !prop.node.isModule">
|
||||
|
@ -289,11 +309,23 @@
|
|||
<q-icon name="mdi-text-box-remove-outline" />
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="massDeleteDocuments(prop.node)"
|
||||
v-if="prop.node.children && prop.node.children.length > 0"
|
||||
>
|
||||
<q-item-section class="text-secondary"><b>Delete documents belonging under this</b></q-item-section>
|
||||
<q-item-section avatar class="text-secondary">
|
||||
<q-icon name="mdi-text-box-remove-outline" />
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
|
||||
</q-list>
|
||||
|
||||
<q-list class="bg-gunmetal-light text-accent" v-if="prop.node.isTag">
|
||||
<q-list class="bg-gunmetal-light text-accent" v-if="prop.node.isTag" dense>
|
||||
|
||||
<q-item clickable v-close-popup @click="recursivelyExpandNodeDownwards(prop.node.key, true)">
|
||||
<q-item-section>Expand all under this node</q-item-section>
|
||||
|
@ -315,7 +347,7 @@
|
|||
<q-icon name="keyboard_arrow_right" />
|
||||
</q-item-section>
|
||||
<q-menu anchor="top end" self="top start">
|
||||
<q-list class="bg-gunmetal text-accent">
|
||||
<q-list class="bg-gunmetal text-accent" dense>
|
||||
|
||||
<q-item
|
||||
v-for="newObject in newObjectList"
|
||||
|
@ -346,6 +378,18 @@
|
|||
<q-icon name="mdi-tag-off-outline" />
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-separator dark />
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="massDeleteDocuments(prop.node)"
|
||||
v-if="prop.node.children && prop.node.children.length > 0"
|
||||
>
|
||||
<q-item-section class="text-secondary"><b>Delete documents belonging under this</b></q-item-section>
|
||||
<q-item-section avatar class="text-secondary">
|
||||
<q-icon name="mdi-text-box-remove-outline" />
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
|
@ -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()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -96,6 +96,12 @@
|
|||
@trigger-dialog-close="exportProjectDialogClose"
|
||||
/>
|
||||
|
||||
<!-- Delete tag dialog -->
|
||||
<massDeleteDocumentsCheckDialog
|
||||
:dialog-trigger="massDocumentDelteDialogTrigger"
|
||||
@trigger-dialog-close="massDocumentDelteDialogClose"
|
||||
/>
|
||||
|
||||
<q-btn-group
|
||||
flat
|
||||
class="AppControl__buttons"
|
||||
|
@ -331,6 +337,20 @@
|
|||
</q-item-section>
|
||||
</q-item>
|
||||
|
||||
<q-separator dark />
|
||||
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="massDocumentDelteDialogAssignUID"
|
||||
:disable="!projectExists || isFrontpage"
|
||||
>
|
||||
<q-item-section class="text-secondary"><b>Mass delete documents</b></q-item-section>
|
||||
<q-item-section avatar class="text-secondary">
|
||||
<q-icon name="mdi-text-box-remove-outline" />
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
|
||||
<q-separator dark />
|
||||
|
||||
<q-item
|
||||
|
@ -532,6 +552,7 @@ import existingDocumentDialog from "src/components/dialogs/ExistingDocument.vue"
|
|||
import tipsTricksTriviaDialog from "src/components/dialogs/TipsTricksTrivia.vue"
|
||||
import licenseDialog from "src/components/dialogs/License.vue"
|
||||
import exportProjectDialog from "src/components/dialogs/ExportProject.vue"
|
||||
import massDeleteDocumentsCheckDialog from "src/components/dialogs/MassDeleteDocumentsCheck.vue"
|
||||
|
||||
import { Loading, QSpinnerGears } from "quasar"
|
||||
import { retrieveCurrentProjectName, saveProject } from "src/scripts/projectManagement/projectManagent"
|
||||
|
@ -555,7 +576,8 @@ import appLogo from "src/assets/appLogo.png"
|
|||
tipsTricksTriviaDialog,
|
||||
licenseDialog,
|
||||
repairProjectDialog,
|
||||
exportProjectDialog
|
||||
exportProjectDialog,
|
||||
massDeleteDocumentsCheckDialog
|
||||
}
|
||||
})
|
||||
export default class AppControl extends BaseClass {
|
||||
|
@ -877,6 +899,19 @@ export default class AppControl extends BaseClass {
|
|||
repairProjectAssignUID () {
|
||||
this.repairProjectDialogTrigger = this.generateUID()
|
||||
}
|
||||
|
||||
/****************************************************************/
|
||||
// Mass delete documents dialog
|
||||
/****************************************************************/
|
||||
|
||||
massDocumentDelteDialogTrigger: string | false = false
|
||||
massDocumentDelteDialogClose () {
|
||||
this.massDocumentDelteDialogTrigger = false
|
||||
}
|
||||
|
||||
massDocumentDelteDialogAssignUID () {
|
||||
this.massDocumentDelteDialogTrigger = this.generateUID()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
@before-hide="triggerDialogClose"
|
||||
no-route-dismiss
|
||||
>
|
||||
<q-card dark class="renameTagDialog">
|
||||
<q-card dark class="deleteTagDialog">
|
||||
<q-card-section class="column justify-center items-center">
|
||||
<h6 class="text-center q-my-sm">Delete <span class="text-bold text-primary">{{targetTag}}</span>?</h6>
|
||||
</q-card-section>
|
||||
|
@ -132,7 +132,7 @@ export default class DeleteTagPrompt extends DialogBase {
|
|||
|
||||
<style lang="scss">
|
||||
|
||||
.renameTagDialog {
|
||||
.deleteTagDialog {
|
||||
min-width: 700px;
|
||||
|
||||
.q-field__messages {
|
||||
|
|
421
src/components/dialogs/MassDeleteDocumentsCheck.vue
Normal file
421
src/components/dialogs/MassDeleteDocumentsCheck.vue
Normal file
|
@ -0,0 +1,421 @@
|
|||
<template>
|
||||
|
||||
<q-dialog
|
||||
v-model="dialogModel"
|
||||
@before-hide="triggerDialogClose"
|
||||
:persistent="deleteOngoing"
|
||||
>
|
||||
<q-card
|
||||
v-if="!deleteOngoing"
|
||||
class="deleteDialog"
|
||||
dark
|
||||
>
|
||||
<q-card-section class="row justify-center text-center">
|
||||
<h6 class="text-center q-my-sm">Mass delete documents</h6>
|
||||
</q-card-section>
|
||||
|
||||
<q-card-section class="row justify-center q-mx-xl">
|
||||
<div>
|
||||
The documents will be deleted <span class="text-bold text-secondary">FOREVER</span> with no way to retrieve them.
|
||||
<br>
|
||||
<span class="text-caption">(unless a previous save of the project exists from earlier time that cointains it)</span>
|
||||
</div>
|
||||
</q-card-section>
|
||||
|
||||
<q-card-section>
|
||||
<div class="row justify-center">
|
||||
|
||||
<q-select
|
||||
ref="ref_deleteDocument"
|
||||
class="deleteDocumentSelect"
|
||||
dark
|
||||
popup-content-class="menuResizer"
|
||||
menu-anchor="bottom middle"
|
||||
menu-self="top middle"
|
||||
:options="filteredExistingInput"
|
||||
use-input
|
||||
multiple
|
||||
use-chips
|
||||
filled
|
||||
label="Selected documents"
|
||||
input-debounce="500"
|
||||
v-model="deleteDocumentsModel"
|
||||
@filter="filterExistingSelect"
|
||||
>
|
||||
<template v-slot:append v-if="!hideAdvSearchCheatsheetButton">
|
||||
<q-btn round dense flat icon="mdi-help-rhombus" @click.stop.prevent="SSET_setAdvSearchWindowVisible"
|
||||
>
|
||||
<q-tooltip :delay="500">
|
||||
Open search cheatsheet
|
||||
</q-tooltip>
|
||||
</q-btn>
|
||||
</template>
|
||||
<template v-slot:option="{ itemProps, itemEvents, opt }">
|
||||
<q-item
|
||||
:class="{'hasTextShadow': textShadow, 'isMinor':opt.isMinor}"
|
||||
v-bind="itemProps"
|
||||
v-on="itemEvents"
|
||||
:key="opt.id"
|
||||
:style="`color: ${opt.color}; background-color: ${opt.bgColor}`"
|
||||
@mouseleave="setDocumentPreviewClose"
|
||||
>
|
||||
<documentPreview
|
||||
:document-id="opt._id"
|
||||
:external-close-trigger="documentPreviewClose"
|
||||
:special-z-index="999999999"
|
||||
:custom-anchor="'top end'"
|
||||
:custom-self="'center left'"
|
||||
:custom-delay="1200"
|
||||
/>
|
||||
<q-item-section avatar>
|
||||
<q-icon
|
||||
:style="`color: ${retrieveIconColor(opt)}`"
|
||||
:name="(opt.isCategory) ? 'fas fa-folder-open' : opt.icon"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>
|
||||
<span class="isDeadIndicator" v-if="opt.isDead">
|
||||
†
|
||||
</span>
|
||||
<span :class="{'isDead': (opt.isDead && !hideDeadCrossThrough)}" v-html="opt.label">
|
||||
</span>
|
||||
</q-item-label>
|
||||
<q-item-label caption class="text-cultured" v-html="opt.hierarchicalPath"></q-item-label>
|
||||
<q-item-label caption class="text-cultured" v-if="opt.tags">
|
||||
<q-chip
|
||||
v-for="(input,index) in opt.tags" :key="index"
|
||||
outline
|
||||
style="opacity: 0.8;"
|
||||
size="12px"
|
||||
class="text-cultured"
|
||||
v-html="`${input}`"
|
||||
>
|
||||
</q-chip>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
<template v-slot:selected-item="scope">
|
||||
<q-chip
|
||||
removable
|
||||
dense
|
||||
@remove="removeInput(scope)"
|
||||
:tabindex="scope.tabindex"
|
||||
:color="(scope.opt.isAutoGenerated) ? 'teal-3' : 'accent'"
|
||||
text-color="dark"
|
||||
class="text-bold"
|
||||
>
|
||||
|
||||
<div
|
||||
class="relationShipChipOverlay"
|
||||
@mouseleave="setDocumentPreviewClose"
|
||||
/>
|
||||
|
||||
<div class="relationShipChipContent">
|
||||
<template v-if="scope.opt.isDead">
|
||||
†
|
||||
</template>
|
||||
{{ stripTags(scope.opt.label) }}
|
||||
</div>
|
||||
<documentPreview
|
||||
:special-z-index="999999999"
|
||||
:custom-delay="1200"
|
||||
:document-id="scope.opt._id"
|
||||
:external-close-trigger="documentPreviewClose"
|
||||
/>
|
||||
|
||||
</q-chip>
|
||||
</template>
|
||||
</q-select>
|
||||
|
||||
</div>
|
||||
|
||||
</q-card-section>
|
||||
|
||||
<q-card-actions align="right" class="q-mb-lg q-mr-sm">
|
||||
<q-btn flat label="Cancel" color="accent" v-close-popup class="q-mr-lg" />
|
||||
<q-btn
|
||||
:outline="deleteDocumentsModel.length !== 0"
|
||||
:flat="deleteDocumentsModel.length === 0"
|
||||
label="Delete selected documents"
|
||||
color="secondary"
|
||||
:disable="deleteDocumentsModel.length === 0"
|
||||
@click="deleteDocuments"
|
||||
/>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
|
||||
<q-card v-if="deleteOngoing" dark class="deleteDialog">
|
||||
<q-card-section class="row justify-center">
|
||||
<h6 class="text-center q-my-sm">Deleting...</h6>
|
||||
</q-card-section>
|
||||
|
||||
<q-card-section class="row justify-center q-mx-xl">
|
||||
<div>
|
||||
Current document: {{currentDocName}}
|
||||
</div>
|
||||
</q-card-section>
|
||||
|
||||
<q-card-section class="row justify-center q-mx-xl q-mb-lg">
|
||||
<q-linear-progress stripe round dark size="20px" :value="progressCounter" color="primary" class="q-mt-sm">
|
||||
<div class="absolute-full flex flex-center">
|
||||
<q-badge text-color="accent" color="dark" :label="`${deletedDocuments}/${deleteDocumentsModel.length}`" />
|
||||
</div>
|
||||
</q-linear-progress>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
|
||||
import PouchDB from "pouchdb"
|
||||
|
||||
import { Component, Watch, Prop } from "vue-property-decorator"
|
||||
import DialogBase from "src/components/dialogs/_DialogBase"
|
||||
import { uid, extend } from "quasar"
|
||||
import documentPreview from "src/components/DocumentPreview.vue"
|
||||
|
||||
import { I_ShortenedDocument } from "src/interfaces/I_OpenedDocument"
|
||||
import { I_Blueprint } from "src/interfaces/I_Blueprint"
|
||||
import { advancedDocumentFilter } from "src/scripts/utilities/advancedDocumentFilter"
|
||||
|
||||
import RobotoRegular from "src/assets/fonts/Roboto-Regular.ttf"
|
||||
import RobotoBold from "src/assets/fonts/Roboto-Bold.ttf"
|
||||
import ArialFallback from "src/assets/fonts/ArialUnicodeMS.ttf"
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
documentPreview
|
||||
}
|
||||
})
|
||||
|
||||
export default class DeleteProject extends DialogBase {
|
||||
RobotoRegular = RobotoRegular
|
||||
RobotoBold = RobotoBold
|
||||
ArialFallback = ArialFallback
|
||||
|
||||
/**
|
||||
* React to dialog opening request
|
||||
*/
|
||||
@Watch("dialogTrigger")
|
||||
openDialog (val: string|false) {
|
||||
if (val) {
|
||||
if (this.SGET_getDialogsState) {
|
||||
return
|
||||
}
|
||||
this.SSET_setDialogState(true)
|
||||
this.dialogModel = true
|
||||
|
||||
this.resetLocalData()
|
||||
this.reloadOptions()
|
||||
this.populateDeleteObjectDialog()
|
||||
|
||||
if (this.prepickedIds.length > 0) {
|
||||
// @ts-ignore
|
||||
this.deleteDocumentsModel = this.SGET_allDocuments.docs.filter(doc => {
|
||||
return this.prepickedIds.includes(doc._id)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resetLocalData () {
|
||||
this.deleteDocumentsModel = []
|
||||
}
|
||||
|
||||
@Prop(({
|
||||
default () {
|
||||
return []
|
||||
}
|
||||
})) readonly prepickedIds!: string[]
|
||||
|
||||
setDocumentPreviewClose () {
|
||||
this.documentPreviewClose = uid()
|
||||
}
|
||||
|
||||
/**
|
||||
* Reloads local options
|
||||
*/
|
||||
reloadOptions () {
|
||||
this.textShadow = this.SGET_options.textShadow
|
||||
this.hideDeadCrossThrough = this.SGET_options.hideDeadCrossThrough
|
||||
this.hideAdvSearchCheatsheetButton = this.SGET_options.hideAdvSearchCheatsheetButton
|
||||
}
|
||||
|
||||
/**
|
||||
* Hides the advanced search cheatsheet help button in relationship type fields.
|
||||
*/
|
||||
hideAdvSearchCheatsheetButton = false
|
||||
|
||||
/**
|
||||
* Determines if the "dead" document type should have a cross-text decoration or not
|
||||
*/
|
||||
hideDeadCrossThrough = false
|
||||
|
||||
/**
|
||||
* Determines if text shadow will be shows for accesiblity reasons or not
|
||||
*/
|
||||
textShadow = false
|
||||
|
||||
documentPreviewClose = ""
|
||||
|
||||
/**
|
||||
* Currently being opened document
|
||||
*/
|
||||
deleteDocumentsModel = [] as I_ShortenedDocument[]
|
||||
|
||||
/**
|
||||
* Pre-filtered list based on the category inclussion or exlcussion
|
||||
*/
|
||||
existingObjectsFullList = [] as I_ShortenedDocument[]
|
||||
|
||||
/**
|
||||
* All currently loaded blueprints
|
||||
*/
|
||||
allDocumentBluePrints = [] as I_Blueprint[]
|
||||
|
||||
/**
|
||||
* Filtered list of items
|
||||
*/
|
||||
filteredExistingInput = null as unknown as I_ShortenedDocument[]
|
||||
|
||||
/**
|
||||
* Local list copty for filtering in order to not mess up the original list
|
||||
*/
|
||||
listCopy: I_ShortenedDocument[] = []
|
||||
|
||||
/**
|
||||
* Refocuses the first value in the selct upon filtering for intuitive keyboard control
|
||||
*/
|
||||
async refocusSelect () {
|
||||
await this.$nextTick()
|
||||
/*eslint-disable */
|
||||
// @ts-ignore
|
||||
this.$refs.ref_deleteDocument.setOptionIndex(-1)
|
||||
// @ts-ignore
|
||||
this.$refs.ref_deleteDocument.moveOptionSelection(1, true)
|
||||
/* eslint-enable */
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the pre-filtered list
|
||||
*/
|
||||
filterExistingSelect (val: string, update: (e: () => void) => void) {
|
||||
if (val === "") {
|
||||
update(() => {
|
||||
this.filteredExistingInput = this.existingObjectsFullList.filter((obj) => !obj.isMinor)
|
||||
if (this.$refs.ref_existingDocument && this.filteredExistingInput.length > 0) {
|
||||
this.refocusSelect().catch(e => console.log(e))
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
update(() => {
|
||||
const needle = val.toLowerCase()
|
||||
this.listCopy = extend(true, [], this.existingObjectsFullList)
|
||||
this.filteredExistingInput = advancedDocumentFilter(needle, this.listCopy, this.allDocumentBluePrints, this.existingObjectsFullList)
|
||||
|
||||
if (this.$refs.ref_existingDocument && this.filteredExistingInput.length > 0) {
|
||||
this.refocusSelect().catch(e => console.log(e))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Set up up all data in to the dialog on popup load
|
||||
*/
|
||||
populateDeleteObjectDialog () {
|
||||
this.allDocumentBluePrints = this.SGET_allBlueprints
|
||||
|
||||
this.existingObjectsFullList = this.SGET_allDocuments.docs
|
||||
}
|
||||
|
||||
async removeInput (scope: {
|
||||
index: number
|
||||
removeAtIndex: (index: number) => void
|
||||
}) {
|
||||
scope.removeAtIndex(scope.index)
|
||||
|
||||
await this.$nextTick()
|
||||
/*eslint-disable */
|
||||
// @ts-ignore
|
||||
this.$refs.ref_deleteDocument.hidePopup()
|
||||
/* eslint-enable */
|
||||
}
|
||||
|
||||
deleteOngoing = false
|
||||
|
||||
deletedDocuments = 0
|
||||
|
||||
currentDocName = ""
|
||||
|
||||
currentDocument = null as unknown as I_ShortenedDocument
|
||||
|
||||
get progressCounter () {
|
||||
return (this.deletedDocuments / this.deleteDocumentsModel.length)
|
||||
}
|
||||
|
||||
async deleteDocuments () {
|
||||
this.deleteOngoing = true
|
||||
this.deletedDocuments = 0
|
||||
|
||||
for (const document of this.deleteDocumentsModel) {
|
||||
this.currentDocName = document.label
|
||||
|
||||
window.FA_dbs[document.type] = new PouchDB(document.type)
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
||||
this.currentDocument = await window.FA_dbs[document.type].get(document._id)
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
||||
await window.FA_dbs[document.type].remove(this.currentDocument)
|
||||
|
||||
const dataPass = { doc: this.currentDocument, treeAction: true }
|
||||
|
||||
this.currentDocument = this.SGET_document(document._id)
|
||||
|
||||
// @ts-ignore
|
||||
this.SSET_removeOpenedDocument(dataPass)
|
||||
// @ts-ignore
|
||||
this.SSET_removeDocument({ doc: this.currentDocument })
|
||||
|
||||
this.deletedDocuments++
|
||||
}
|
||||
|
||||
// Cleanup
|
||||
this.deleteOngoing = false
|
||||
this.resetLocalData()
|
||||
this.populateDeleteObjectDialog()
|
||||
this.$q.notify({
|
||||
group: false,
|
||||
type: "positive",
|
||||
message: "Mass delete finished"
|
||||
})
|
||||
|
||||
this.triggerDialogClose()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.deleteDialog {
|
||||
width: 750px;
|
||||
max-width: calc(100vw - 100px) !important;
|
||||
margin-top: 100px;
|
||||
align-self: flex-start;
|
||||
max-height: calc(100vh - 160px) !important;
|
||||
|
||||
h6 {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.deleteDocumentSelect {
|
||||
width: calc(100% - 60px);
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -24,9 +24,8 @@
|
|||
</q-list>
|
||||
|
||||
<q-input
|
||||
v-if="editMode && extraInput.length === 0"
|
||||
v-if="editMode && (!inputDataBluePrint.predefinedSelectValues || inputDataBluePrint.predefinedSelectValues.length === 0)"
|
||||
v-model="localInput"
|
||||
class="q-mr-lg"
|
||||
:ref="`singleSelectField${this.inputDataBluePrint.id}`"
|
||||
dense
|
||||
autogrow
|
||||
|
@ -36,7 +35,7 @@
|
|||
>
|
||||
</q-input>
|
||||
<q-select
|
||||
v-if="editMode && extraInput.length > 0"
|
||||
v-if="editMode && inputDataBluePrint.predefinedSelectValues && inputDataBluePrint.predefinedSelectValues.length > 0"
|
||||
style="width: 100%;"
|
||||
dense
|
||||
dark
|
||||
|
|
|
@ -901,3 +901,8 @@ font[size="7"] {
|
|||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.q-list--dense > .q-item,
|
||||
.q-item--dense {
|
||||
min-height: 42px !important;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
class="pageSplitter"
|
||||
>
|
||||
<template
|
||||
v-if="!hideHierarchyTree"
|
||||
#before>
|
||||
<!-- Left drawer -->
|
||||
<q-drawer
|
||||
|
@ -45,7 +44,7 @@
|
|||
show-if-above
|
||||
>
|
||||
<objectTree
|
||||
|
||||
v-if="!hideHierarchyTree"
|
||||
/>
|
||||
</q-drawer>
|
||||
</template>
|
||||
|
@ -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
|
||||
/****************************************************************/
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue