From 7b27ba437a7235fde9803494e9bbdaa6766f62dd Mon Sep 17 00:00:00 2001 From: Elvanos Date: Tue, 6 Jul 2021 02:39:40 +0200 Subject: [PATCH] 0.1.8 - RC-4 --- src/BaseClass.ts | 18 ++++++++++++------ src/documents/changeLog.md | 1 + .../databaseManager/blueprints/characters.ts | 12 ++++++------ .../databaseManager/blueprints/locations.ts | 6 +++--- 4 files changed, 22 insertions(+), 15 deletions(-) diff --git a/src/BaseClass.ts b/src/BaseClass.ts index f835d4f..c8e3747 100644 --- a/src/BaseClass.ts +++ b/src/BaseClass.ts @@ -653,11 +653,17 @@ export default class BaseClass extends Vue { checkForLegacyDocuments () { return this.SGET_allDocuments.docs.filter(doc => { - const localBlueprint = this.SGET_blueprint(doc.type) + const docSnapShot: I_ShortenedDocument = extend(true, {}, doc) + const localBlueprint = this.SGET_blueprint(docSnapShot.type) let hasLegacyValue = false - for (const field of doc.extraFields) { + + for (const field of docSnapShot.extraFields) { const pairedBlueprintField = localBlueprint.extraFields.find(e => e.id === field.id) - if (pairedBlueprintField && pairedBlueprintField.isLegacy) { + if (docSnapShot._id === "e1e24951-e2af-4513-8e4c-50fb93fd94d9") { + console.log(field.id) + } + + if (pairedBlueprintField && pairedBlueprintField.isLegacy && !hasLegacyValue) { const value = field.value if (!value || @@ -666,10 +672,10 @@ export default class BaseClass extends Vue { (value?.value?.length === 0) || // @ts-ignore (value.value === null)) { - return false } - hasLegacyValue = true - break + else { + hasLegacyValue = true + } } } diff --git a/src/documents/changeLog.md b/src/documents/changeLog.md index 6fc9430..02801cc 100644 --- a/src/documents/changeLog.md +++ b/src/documents/changeLog.md @@ -18,6 +18,7 @@ - Fixed a bug that was causing the predefined select list sometimes completely disappear along with the whole select in the single-select field when filtering (eg: Sex field) - Slightly improved performance when loading the project for the first time - Fixed a bug in PDF export that was causing export crashes in case of line breaks present in the list/relationship field notes +- Fixed a bug causing some of the legacy field detection to miss some types of legacy fields sometimes ### New features diff --git a/src/scripts/databaseManager/blueprints/characters.ts b/src/scripts/databaseManager/blueprints/characters.ts index 58c8361..7266bbf 100644 --- a/src/scripts/databaseManager/blueprints/characters.ts +++ b/src/scripts/databaseManager/blueprints/characters.ts @@ -10,7 +10,7 @@ export const charactersBlueprint: I_Blueprint = { extraFields: [ { id: "pairedCurrentLocation", - name: "Place of residence", + name: "Place of residence (legacy)", type: "singleToManyRelationship", icon: "mdi-map-marker-radius", sizing: 12, @@ -29,7 +29,7 @@ export const charactersBlueprint: I_Blueprint = { }, { id: "pairedOriginLocation", - name: "Place of origin", + name: "Place of origin (legacy)", type: "singleToManyRelationship", icon: "mdi-map-marker-radius", sizing: 12, @@ -48,7 +48,7 @@ export const charactersBlueprint: I_Blueprint = { }, { id: "pairedDemiseLocation", - name: "Place of demise", + name: "Place of demise (legacy)", type: "singleToManyRelationship", icon: "mdi-map-marker-radius", sizing: 12, @@ -67,7 +67,7 @@ export const charactersBlueprint: I_Blueprint = { }, { id: "pairedMagic", - name: "Known Magic/Spells", + name: "Known Magic/Spells (legacy)", type: "manyToManyRelationship", icon: "fas fa-hat-wizard", sizing: 12, @@ -86,7 +86,7 @@ export const charactersBlueprint: I_Blueprint = { }, { id: "pairedTech", - name: "Known Technologies/Sciences", + name: "Known Technologies/Sciences (legacy)", type: "manyToManyRelationship", icon: "fas fa-wrench", tooltip: ` @@ -105,7 +105,7 @@ export const charactersBlueprint: I_Blueprint = { }, { id: "skills", - name: "Skills", + name: "Skills (legacy)", type: "list", icon: "mdi-sword", sizing: 12, diff --git a/src/scripts/databaseManager/blueprints/locations.ts b/src/scripts/databaseManager/blueprints/locations.ts index 146a8fc..32ec5b0 100644 --- a/src/scripts/databaseManager/blueprints/locations.ts +++ b/src/scripts/databaseManager/blueprints/locations.ts @@ -9,7 +9,7 @@ export const locationsBlueprint: I_Blueprint = { extraFields: [ { id: "pairedOriginCharacters", - name: "Characters originated from the location", + name: "Characters originated from the location (legacy)", type: "manyToSingleRelationship", icon: "mdi-account", sizing: 12, @@ -28,7 +28,7 @@ export const locationsBlueprint: I_Blueprint = { }, { id: "pairedCurrentCharacters", - name: "Characters currently living in the location", + name: "Characters currently living in the location (legacy)", type: "manyToSingleRelationship", icon: "mdi-account", sizing: 12, @@ -47,7 +47,7 @@ export const locationsBlueprint: I_Blueprint = { }, { id: "pairedDemiseCharacters", - name: "Characters deceased at the location", + name: "Characters deceased at the location (legacy)", type: "manyToSingleRelationship", icon: "mdi-account", sizing: 12,