0.1.7-DEV-6

This commit is contained in:
Elvanos 2021-05-13 20:51:31 +02:00
parent 65bbbe5b47
commit e240365d6f
15 changed files with 414 additions and 21 deletions

View file

@ -456,6 +456,25 @@ export default class BaseClass extends Vue {
return fieldType
}
/**
* Retrieves value of requested field. If the field doesn't exist, returns false instead
* @param document - Document object that is expected to contain the field
* @param fieldID - ID of the field to check
*/
determineLegacyField (document: I_OpenedDocument| I_ShortenedDocument, fieldID: string) : string | number | [] | false | I_FieldRelationship {
const fieldData = document?.extraFields
// Fizzle if field doesnt exist
if (!fieldData) {
return false
}
const documentBlueprint = this.SGET_blueprint(document.type)
const legacyField = documentBlueprint.extraFields.find(f => f.id === fieldID)?.isLegacy as unknown as string
return (legacyField)
}
/**
* Retrieves array length of requested field. If the field doesn't exist or isn't array, returns false instead
* @param document - Document object that is expected to contain the field

View file

@ -26,7 +26,7 @@
v-for="field in localBlueprint.extraFields"
:key="`${field.id}`"
class="col-12 q-mb-md"
v-show="hasValueFieldFilter(field)"
v-show="hasValueFieldFilter(field) && !determineLegacyField(localDocument, field.id)"
>
<Field_Break
@ -34,6 +34,7 @@
v-if="field.type === 'break' && categoryFieldFilter(field.id)"
:inputDataBluePrint="field"
:inputDataValue="retrieveFieldValue(localDocument, field.id)"
:recursive="true"
/>
<Field_Text

View file

@ -1,7 +1,7 @@
<template>
<div>
<h5 class="text-weight-bolder q-mb-xs q-mt-lg">
<span :class="(isDarkMode) ? 'text-satin-sheen-gold-bright' : 'text-gunmetal-medium'">
<span :class="(isDarkMode || recursive) ? 'text-satin-sheen-gold-bright' : 'text-gunmetal-medium'">
{{inputDataBluePrint.name}}
</span>
</h5>
@ -10,7 +10,7 @@
</template>
<script lang="ts">
import { Component } from "vue-property-decorator"
import { Component, Prop } from "vue-property-decorator"
import FieldBase from "src/components/fields/_FieldBase"
@ -18,6 +18,9 @@ import FieldBase from "src/components/fields/_FieldBase"
components: { }
})
export default class Field_Text extends FieldBase {
/**
* Prevent document preview in already existing previews
*/
@Prop({ default: false }) readonly recursive!: true
}
</script>

View file

@ -133,7 +133,7 @@
<div
v-for="field in bluePrintData.extraFields"
:key="`${field.id}`"
v-show="hasValueFieldFilter(field) || editMode"
v-show="(hasValueFieldFilter(field) || editMode) && checkForLegacyFieldValue(currentData, field)"
:class="`
col-12
col-md-${determineSize_MD(field)}
@ -141,6 +141,7 @@
col-xl-${determineSize_XL(field)}
q-mb-md
documentColumnWrapper
${(determineLegacyField(currentData, field.id)) ? 'isLegacy' : ''}
`">
<Field_Break
@ -790,6 +791,33 @@ export default class PageDocumentDisplay extends BaseClass {
)
}
checkForLegacyFieldValue (document: I_OpenedDocument| I_ShortenedDocument, field: {id: string}) {
const isLegacyField = this.determineLegacyField(document, field.id)
if (!isLegacyField) {
return true
}
const value = this.retrieveFieldValue(this.currentData, field.id)
let hasValue = true
if (!value ||
(Array.isArray(value) && value.length === 0) ||
// @ts-ignore
(value?.value && value.value.length === 0) ||
// @ts-ignore
(value.value === null)) {
hasValue = false
}
if (isLegacyField && hasValue) {
return true
}
return false
}
/**
* Checks if the field in question
*/
@ -1013,6 +1041,15 @@ export default class PageDocumentDisplay extends BaseClass {
<style lang="scss">
.documentColumnWrapper {
flex-grow: 1;
&.isLegacy {
border: 1px dashed $primary;
padding: 30px;
margin-left: 20px;
max-width: 98%;
margin-top: 20px;
background-color: rgba($secondary, 0.15);
}
}
.separatorWrapper {

View file

@ -8,19 +8,19 @@ export const charactersBlueprint: I_Blueprint = {
icon: "mdi-account",
category: "World",
extraFields: [
{
id: "breakLegacyFields",
name: "Legacy fields",
type: "break",
sizing: 12,
isLegacy: true
},
{
id: "pairedMagic",
name: "Known Magic/Spells",
type: "manyToManyRelationship",
icon: "fas fa-hat-wizard",
sizing: 6,
tooltip: `
This field is obsolete and no longer serves any purpose.
<br>
Pleae move your data to the corresponding new fields.
<br>
This field will automatically disappear once all data is gone from it.
`,
isLegacy: true,
relationshipSettings: {
connectedObjectType: "magic",
@ -32,6 +32,13 @@ export const charactersBlueprint: I_Blueprint = {
name: "Known Technologies/Sciences",
type: "manyToManyRelationship",
icon: "fas fa-wrench",
tooltip: `
This field is obsolete and no longer serves any purpose.
<br>
Pleae move your data to the corresponding new fields.
<br>
This field will automatically disappear once all data is gone from it.
`,
isLegacy: true,
sizing: 6,
relationshipSettings: {
@ -46,6 +53,13 @@ export const charactersBlueprint: I_Blueprint = {
icon: "mdi-sword",
sizing: 12,
isLegacy: true,
tooltip: `
This field is obsolete and no longer serves any purpose.
<br>
Pleae move your data to the corresponding new fields.
<br>
This field will automatically disappear once all data is gone from it.
`,
predefinedListExtras: {
affix: "Level",
extraSelectValueList: [

View file

@ -153,6 +153,43 @@ export const cultureBlueprint: I_Blueprint = {
type: "break",
sizing: 12
},
{
id: "succedingCultures",
name: "Succeeding Cultures/Art",
type: "manyToManyRelationship",
icon: "fas fa-archway",
sizing: 4,
relationshipSettings: {
connectedObjectType: "culture",
connectedField: "preceedingCultures"
}
},
{
id: "preceedingCultures",
name: "Preceding Cultures/Art",
type: "manyToManyRelationship",
icon: "fas fa-archway",
sizing: 4,
relationshipSettings: {
connectedObjectType: "culture",
connectedField: "succedingCultures"
}
},
{
id: "creationTime",
name: "Date of creation",
type: "text",
icon: "mdi-timer-sand-empty",
sizing: 2
},
{
id: "endTIme",
name: "Date of end",
type: "text",
icon: "mdi-timer-sand-full",
sizing: 2
},
{
id: "traits",
name: "Unique/Defining Features",

View file

@ -13,6 +13,13 @@ export const currenciesBlueprint: I_Blueprint = {
type: "manyToManyRelationship",
icon: "mdi-sword",
isLegacy: true,
tooltip: `
This field is obsolete and no longer serves any purpose.
<br>
Pleae move your data to the corresponding new fields.
<br>
This field will automatically disappear once all data is gone from it.
`,
sizing: 12,
relationshipSettings: {
connectedObjectType: "items",

View file

@ -153,6 +153,44 @@ export const guildsBlueprint: I_Blueprint = {
type: "break",
sizing: 12
},
{
id: "succedingOtherGroup",
name: "Succeeding Organizations/Other groups",
type: "manyToManyRelationship",
icon: "mdi-account-group",
sizing: 4,
relationshipSettings: {
connectedObjectType: "guilds",
connectedField: "preceedingOtherGroup"
}
},
{
id: "preceedingOtherGroup",
name: "Preceding Organizations/Other groups",
type: "manyToManyRelationship",
icon: "mdi-account-group",
sizing: 4,
relationshipSettings: {
connectedObjectType: "guilds",
connectedField: "succedingOtherGroup"
}
},
{
id: "creationTime",
name: "Date of creation",
type: "text",
icon: "mdi-timer-sand-empty",
sizing: 2
},
{
id: "endTIme",
name: "Date of end",
type: "text",
icon: "mdi-timer-sand-full",
sizing: 2
},
{
id: "headquarters",
name: "Headquarters",

View file

@ -15,6 +15,13 @@ export const itemsBlueprint: I_Blueprint = {
icon: "fas fa-hat-wizard",
isLegacy: true,
sizing: 6,
tooltip: `
This field is obsolete and no longer serves any purpose.
<br>
Pleae move your data to the corresponding new fields.
<br>
This field will automatically disappear once all data is gone from it.
`,
relationshipSettings: {
connectedObjectType: "magic",
connectedField: "pairedItems"
@ -27,6 +34,13 @@ export const itemsBlueprint: I_Blueprint = {
icon: "fas fa-coins",
sizing: 6,
isLegacy: true,
tooltip: `
This field is obsolete and no longer serves any purpose.
<br>
Pleae move your data to the corresponding new fields.
<br>
This field will automatically disappear once all data is gone from it.
`,
relationshipSettings: {
connectedObjectType: "currencies",
connectedField: "pairedItems"

View file

@ -153,6 +153,43 @@ export const locationsBlueprint: I_Blueprint = {
type: "break",
sizing: 12
},
{
id: "succedingLocations",
name: "Succeeding Locations/Geography",
type: "manyToManyRelationship",
icon: "mdi-map-marker-radius",
sizing: 4,
relationshipSettings: {
connectedObjectType: "locations",
connectedField: "preceedingLocations"
}
},
{
id: "preceedingLocations",
name: "Preceding Locations/Geography",
type: "manyToManyRelationship",
icon: "mdi-map-marker-radius",
sizing: 4,
relationshipSettings: {
connectedObjectType: "locations",
connectedField: "succedingLocations"
}
},
{
id: "creationTime",
name: "Date of creation",
type: "text",
icon: "mdi-timer-sand-empty",
sizing: 2
},
{
id: "endTIme",
name: "Date of end",
type: "text",
icon: "mdi-timer-sand-full",
sizing: 2
},
{
id: "traits",
name: "Unusual features/Traits",

View file

@ -14,11 +14,13 @@ export const magicBlueprint: I_Blueprint = {
icon: "mdi-account",
sizing: 4,
isLegacy: true,
tooltip:
`This field is meant to be used as a way to map out spell-users and their respected spells.
tooltip: `
This field is obsolete and no longer serves any purpose.
<br>
For diplomatic/ideological connections between magical groups/institutions and characters, use the field below in the "Diplomatic relationships & Influences" section.
`,
Pleae move your data to the corresponding new fields.
<br>
This field will automatically disappear once all data is gone from it.
`,
relationshipSettings: {
connectedObjectType: "characters",
connectedField: "pairedMagic"
@ -31,6 +33,13 @@ export const magicBlueprint: I_Blueprint = {
icon: "mdi-sword",
sizing: 4,
isLegacy: true,
tooltip: `
This field is obsolete and no longer serves any purpose.
<br>
Pleae move your data to the corresponding new fields.
<br>
This field will automatically disappear once all data is gone from it.
`,
relationshipSettings: {
connectedObjectType: "items",
connectedField: "pairedMagic"
@ -182,6 +191,44 @@ export const magicBlueprint: I_Blueprint = {
type: "break",
sizing: 12
},
{
id: "succedingMagicGroup",
name: "Succeeding Schools of Magic/Magical groups",
type: "manyToManyRelationship",
icon: "fas fa-hat-wizard",
sizing: 4,
relationshipSettings: {
connectedObjectType: "magic",
connectedField: "preceedingMagicGroup"
}
},
{
id: "preceedingMagicGroup",
name: "Preceding Schools of Magic/Magical groups",
type: "manyToManyRelationship",
icon: "fas fa-hat-wizard",
sizing: 4,
relationshipSettings: {
connectedObjectType: "magic",
connectedField: "succedingMagicGroup"
}
},
{
id: "creationTime",
name: "Date of creation",
type: "text",
icon: "mdi-timer-sand-empty",
sizing: 2
},
{
id: "endTIme",
name: "Date of end",
type: "text",
icon: "mdi-timer-sand-full",
sizing: 2
},
{
id: "headquarters",
name: "Headquarters",

View file

@ -153,6 +153,42 @@ export const politicalGroupsBlueprint: I_Blueprint = {
type: "break",
sizing: 12
},
{
id: "succedingPolGroup",
name: "Succeeding Ideologies/Political groups",
type: "manyToManyRelationship",
icon: "mdi-bank-outline",
sizing: 4,
relationshipSettings: {
connectedObjectType: "politicalGroups",
connectedField: "preceedingPolGroup"
}
},
{
id: "preceedingPolGroup",
name: "Preceding Ideologies/Political groups",
type: "manyToManyRelationship",
icon: "mdi-bank-outline",
sizing: 4,
relationshipSettings: {
connectedObjectType: "politicalGroups",
connectedField: "succedingPolGroup"
}
},
{
id: "creationTime",
name: "Date of creation",
type: "text",
icon: "mdi-timer-sand-empty",
sizing: 2
},
{
id: "endTIme",
name: "Date of end",
type: "text",
icon: "mdi-timer-sand-full",
sizing: 2
},
{
id: "headquarters",
name: "Headquarters",

View file

@ -165,37 +165,59 @@ export const racesBlueprint: I_Blueprint = {
connectedField: "relatedRaces"
}
},
{
id: "evolvedIntoRaces",
name: "Evolved into Species/Races/Flora/Fauna",
type: "manyToManyRelationship",
icon: "fas fa-dragon",
sizing: 4,
relationshipSettings: {
connectedObjectType: "races",
connectedField: "evolvedFromRaces"
}
},
{
id: "evolvedFromRaces",
name: "Evolved from Species/Races/Flora/Fauna",
type: "manyToManyRelationship",
icon: "fas fa-dragon",
sizing: 4,
relationshipSettings: {
connectedObjectType: "races",
connectedField: "evolvedIntoRaces"
}
},
{
id: "memberCount",
name: "Estimated population",
type: "text",
icon: "mdi-account-group",
sizing: 2
sizing: 3
},
{
id: "age",
name: "Average lifespan",
type: "text",
icon: "mdi-timer-sand-empty",
sizing: 2
sizing: 3
},
{
id: "ageAdult",
name: "Average adulthood",
type: "text",
icon: "mdi-timer-sand",
sizing: 2
sizing: 3
},
{
id: "ageOldest",
name: "Oldest known",
type: "text",
icon: "mdi-timer-sand-full",
sizing: 2
sizing: 3
},
{
id: "height",
name: "Average height",
name: "Average size",
type: "text",
icon: "mdi-human-male-height-variant",
sizing: 2

View file

@ -153,6 +153,42 @@ export const religionsBlueprint: I_Blueprint = {
type: "break",
sizing: 12
},
{
id: "succedingRelGroup",
name: "Succeeding Teachings/Religious groups",
type: "manyToManyRelationship",
icon: "fas fa-ankh",
sizing: 4,
relationshipSettings: {
connectedObjectType: "religions",
connectedField: "preceedingRelGroup"
}
},
{
id: "preceedingRelGroup",
name: "Preceding Teachings/Religious groups",
type: "manyToManyRelationship",
icon: "fas fa-ankh",
sizing: 4,
relationshipSettings: {
connectedObjectType: "religions",
connectedField: "succedingRelGroup"
}
},
{
id: "creationTime",
name: "Date of creation",
type: "text",
icon: "mdi-timer-sand-empty",
sizing: 2
},
{
id: "endTIme",
name: "Date of end",
type: "text",
icon: "mdi-timer-sand-full",
sizing: 2
},
{
id: "headquarters",

View file

@ -14,6 +14,13 @@ export const techBlueprint: I_Blueprint = {
icon: "mdi-account",
sizing: 6,
isLegacy: true,
tooltip: `
This field is obsolete and no longer serves any purpose.
<br>
Pleae move your data to the corresponding new fields.
<br>
This field will automatically disappear once all data is gone from it.
`,
relationshipSettings: {
connectedObjectType: "characters",
connectedField: "pairedTech"
@ -165,6 +172,44 @@ export const techBlueprint: I_Blueprint = {
type: "break",
sizing: 12
},
{
id: "succedingTechGroup",
name: "Succeeding Sciences/Technological groups",
type: "manyToManyRelationship",
icon: "fas fa-wrench",
sizing: 4,
relationshipSettings: {
connectedObjectType: "tech",
connectedField: "preceedingTechGroup"
}
},
{
id: "preceedingTechGroup",
name: "Preceding Sciences/Technological groups",
type: "manyToManyRelationship",
icon: "fas fa-wrench",
sizing: 4,
relationshipSettings: {
connectedObjectType: "tech",
connectedField: "succedingTechGroup"
}
},
{
id: "creationTime",
name: "Date of creation",
type: "text",
icon: "mdi-timer-sand-empty",
sizing: 2
},
{
id: "endTIme",
name: "Date of end",
type: "text",
icon: "mdi-timer-sand-full",
sizing: 2
},
{
id: "headquarters",
name: "Headquarters",