From fe035a2ff1f7b5704c214b5a46370d3592d2e2a4 Mon Sep 17 00:00:00 2001 From: ThaumRystra Date: Tue, 29 Oct 2024 16:02:46 +0200 Subject: [PATCH 1/6] Added missing schema version to json route meta --- app/imports/server/rest/apiPublications/creature.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/imports/server/rest/apiPublications/creature.js b/app/imports/server/rest/apiPublications/creature.js index f25abc82..9c283c5f 100644 --- a/app/imports/server/rest/apiPublications/creature.js +++ b/app/imports/server/rest/apiPublications/creature.js @@ -4,6 +4,7 @@ import { assertViewPermission } from '/imports/api/creature/creatures/creaturePe import computeCreature from '/imports/api/engine/computeCreature'; import VERSION from '/imports/constants/VERSION'; import { getCreature, getProperties, getVariables } from '/imports/api/engine/loadCreatures'; +import SCHEMA_VERSION from '/imports/constants/SCHEMA_VERSION'; JsonRoutes.add('get', 'api/creature/:id', function (req, res) { const creatureId = req.params.id; @@ -46,6 +47,9 @@ JsonRoutes.add('get', 'api/creature/:id', function (req, res) { // Send the results JsonRoutes.sendResult(res, { data: { + meta: { + schemaVersion: SCHEMA_VERSION, + }, creatures: [creature], creatureProperties: getProperties(creatureId), creatureVariables: getVariables(creatureId), From b90cc2e4676a9c720dfa0389136da51c8717d353 Mon Sep 17 00:00:00 2001 From: ThaumRystra Date: Tue, 29 Oct 2024 16:06:46 +0200 Subject: [PATCH 2/6] Removed damage effects from tree views The totals of those effects are already accounted for in the displayed number --- .../client/ui/components/tree/TreeNode.vue | 3 --- .../client/ui/components/tree/TreeNodeList.vue | 2 -- .../components/actions/ActionCard.vue | 1 - .../treeNodeViews/DamageTreeNode.vue | 18 ------------------ .../properties/treeNodeViews/TreeNodeView.vue | 2 -- .../treeNodeViews/treeNodeViewMixin.js | 1 - .../client/ui/tabletop/TabletopActionCard.vue | 1 - .../client/ui/tabletop/TabletopBuffCard.vue | 1 - 8 files changed, 29 deletions(-) diff --git a/app/imports/client/ui/components/tree/TreeNode.vue b/app/imports/client/ui/components/tree/TreeNode.vue index e42082ca..3fc4ad8d 100644 --- a/app/imports/client/ui/components/tree/TreeNode.vue +++ b/app/imports/client/ui/components/tree/TreeNode.vue @@ -39,7 +39,6 @@ @@ -58,7 +57,6 @@ :organize="organize" :selected-node="selectedNode" :start-expanded="startExpanded" - :show-external-details="showExternalDetails" @move-within-root="e => $emit('move-within-root', e)" @move-between-roots="e => $emit('move-between-roots', e)" @selected="e => $emit('selected', e)" @@ -117,7 +115,6 @@ export default { }, selected: Boolean, startExpanded: Boolean, - showExternalDetails: Boolean, }, data() { return { diff --git a/app/imports/client/ui/components/tree/TreeNodeList.vue b/app/imports/client/ui/components/tree/TreeNodeList.vue index 51e7ddbd..94d80e02 100644 --- a/app/imports/client/ui/components/tree/TreeNodeList.vue +++ b/app/imports/client/ui/components/tree/TreeNodeList.vue @@ -23,7 +23,6 @@ :organize="organize" :lazy="lazy" :start-expanded="startExpanded" - :show-external-details="showExternalDetails" @selected="e => $emit('selected', e)" @move-within-root="e => $emit('move-within-root', e)" @move-between-roots="e => $emit('move-between-roots', e)" @@ -68,7 +67,6 @@ export default { default: () => [], }, startExpanded: Boolean, - showExternalDetails: Boolean, }, data() { return { diff --git a/app/imports/client/ui/properties/components/actions/ActionCard.vue b/app/imports/client/ui/properties/components/actions/ActionCard.vue index ae7fa699..42c1a14f 100644 --- a/app/imports/client/ui/properties/components/actions/ActionCard.vue +++ b/app/imports/client/ui/properties/components/actions/ActionCard.vue @@ -89,7 +89,6 @@ to self - diff --git a/app/imports/client/ui/properties/treeNodeViews/TreeNodeView.vue b/app/imports/client/ui/properties/treeNodeViews/TreeNodeView.vue index 74de9534..c1c02c6f 100644 --- a/app/imports/client/ui/properties/treeNodeViews/TreeNodeView.vue +++ b/app/imports/client/ui/properties/treeNodeViews/TreeNodeView.vue @@ -3,7 +3,6 @@ :is="treeNodeView" :model="model" :selected="selected" - :show-external-details="showExternalDetails" :class="{ 'inactive': model.inactive, }" @@ -25,7 +24,6 @@ export default { required: true, }, selected: Boolean, - showExternalDetails: Boolean, }, computed: { treeNodeView(){ diff --git a/app/imports/client/ui/properties/treeNodeViews/treeNodeViewMixin.js b/app/imports/client/ui/properties/treeNodeViews/treeNodeViewMixin.js index 9714f908..1efe0638 100644 --- a/app/imports/client/ui/properties/treeNodeViews/treeNodeViewMixin.js +++ b/app/imports/client/ui/properties/treeNodeViews/treeNodeViewMixin.js @@ -12,7 +12,6 @@ export default { }, selected: Boolean, hideIcon: Boolean, - showExternalDetails: Boolean, }, computed: { title() { diff --git a/app/imports/client/ui/tabletop/TabletopActionCard.vue b/app/imports/client/ui/tabletop/TabletopActionCard.vue index 5d63b0bd..ae0e4523 100644 --- a/app/imports/client/ui/tabletop/TabletopActionCard.vue +++ b/app/imports/client/ui/tabletop/TabletopActionCard.vue @@ -87,7 +87,6 @@ Date: Tue, 29 Oct 2024 16:47:55 +0200 Subject: [PATCH 3/6] Improved how effects on calculated fields are displayed --- .../parseCalculationFields.js | 2 +- .../components/effects/InlineEffect.vue | 12 +++- .../proficiencies/InlineProficiency.vue | 10 +++- .../properties/forms/shared/ComputedField.vue | 9 ++- .../viewers/shared/PropertyField.vue | 58 +++++++++++-------- 5 files changed, 55 insertions(+), 36 deletions(-) diff --git a/app/imports/api/engine/computation/buildComputation/parseCalculationFields.js b/app/imports/api/engine/computation/buildComputation/parseCalculationFields.js index 43424732..7cfb333b 100644 --- a/app/imports/api/engine/computation/buildComputation/parseCalculationFields.js +++ b/app/imports/api/engine/computation/buildComputation/parseCalculationFields.js @@ -103,7 +103,7 @@ function subDocsExist(prop, key) { export function removeEmptyCalculations(prop) { prop._computationDetails.emptyCalculations.forEach(calcObj => { - if (!calcObj.effects?.length) { + if (!calcObj.effectIds?.length && !calcObj.proficiencyIds?.length) { unset(prop, calcObj._key); } }); diff --git a/app/imports/client/ui/properties/components/effects/InlineEffect.vue b/app/imports/client/ui/properties/components/effects/InlineEffect.vue index 29553946..fdfed3c9 100644 --- a/app/imports/client/ui/properties/components/effects/InlineEffect.vue +++ b/app/imports/client/ui/properties/components/effects/InlineEffect.vue @@ -33,16 +33,22 @@