From eb7643641db023c589169b0a644ffd1b90118cc1 Mon Sep 17 00:00:00 2001 From: Vinzenz Rosenkranz Date: Wed, 21 Dec 2022 14:22:07 +0100 Subject: [PATCH 001/120] add background to nested attribute template Signed-off-by: Vinzenz Rosenkranz --- CHANGELOG.md | 2 + .../js/components/modals/attribute/Add.vue | 39 ++++++++++--------- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03c93f510..afbc0e9aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented in this file. ## 0.9.10 +### Added +- Background to column section in _Add Attribute_ modal to better distinguish it from the main section ### Changed - Attributes in entity detail's link list are now grouped by linked entity diff --git a/resources/js/components/modals/attribute/Add.vue b/resources/js/components/modals/attribute/Add.vue index 67236e2c8..be6268b97 100644 --- a/resources/js/components/modals/attribute/Add.vue +++ b/resources/js/components/modals/attribute/Add.vue @@ -19,24 +19,27 @@ @updated="updateAttribute" @validation="checkValidation" />
-
-
- {{ t('global.column', 2) }} - - {{ state.columns.length }} - -
-
- -
-
- +
+
+
+
+ {{ t('global.column', 2) }} + + {{ state.columns.length }} + +
+
+ +
+
+ +

From d0cef28ee79d0e8ca14f3df356b037c03cf830bf Mon Sep 17 00:00:00 2001 From: Vinzenz Rosenkranz Date: Wed, 21 Dec 2022 14:34:29 +0100 Subject: [PATCH 002/120] reset search term Signed-off-by: Vinzenz Rosenkranz --- CHANGELOG.md | 2 ++ resources/js/components/AttributeTemplate.vue | 7 +++++++ resources/js/components/search/Simple.vue | 9 +++++++++ 3 files changed, 18 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index afbc0e9aa..8d5160c24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file. ## 0.9.10 ### Added - Background to column section in _Add Attribute_ modal to better distinguish it from the main section +### Fixed +- Reset label search after column added to table datatype in _Add Attribute_ modal ### Changed - Attributes in entity detail's link list are now grouped by linked entity diff --git a/resources/js/components/AttributeTemplate.vue b/resources/js/components/AttributeTemplate.vue index 7fef34193..c403cb159 100644 --- a/resources/js/components/AttributeTemplate.vue +++ b/resources/js/components/AttributeTemplate.vue @@ -8,6 +8,7 @@
@@ -124,6 +125,7 @@ import { translateConcept, getConceptLabel, + getTs, } from '@/helpers/helpers.js'; export default { @@ -162,6 +164,10 @@ state.attribute.rootAttributeLabel = null; state.attribute.differRoot = false; state.attribute.textContent = ''; + state.searchResetValue = { + reset: true, + ts: getTs(), + }; }; const create = _ => { if(!state.attribute.differRoot) { @@ -223,6 +229,7 @@ differRoot: false, textContent: '', }, + searchResetValue: null, formId: external.value || 'create-attribute-form', attributeTypes: types, label: computed(_ => { diff --git a/resources/js/components/search/Simple.vue b/resources/js/components/search/Simple.vue index 55d43e591..aab4b9cc4 100644 --- a/resources/js/components/search/Simple.vue +++ b/resources/js/components/search/Simple.vue @@ -70,6 +70,7 @@ computed, reactive, toRefs, + watch, } from 'vue'; import { useI18n } from 'vue-i18n'; @@ -195,6 +196,14 @@ enableChain: computed(_ => chain.value && chain.value.length > 0), }); + watch(_ => defaultValue.value, (newValue, oldValue) => { + if(newValue.reset) { + state.entry = null; + } else { + state.entry = newValue; + } + }); + // RETURN return { t, From 7c1e7fd921f33e5db0a39357521634c551973edd Mon Sep 17 00:00:00 2001 From: Vinzenz Rosenkranz Date: Wed, 21 Dec 2022 14:34:50 +0100 Subject: [PATCH 003/120] update version Signed-off-by: Vinzenz Rosenkranz --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index de102daf9..b4fbfe8e7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "spacialist", - "version": "0.9.7", + "version": "0.10.0", "description": "A Virtual Research Environment for the Spatial Humanities", "repository": { "type": "git", From 5c010c3281fe14fb0795b14e7907c7cf4ee2e8f1 Mon Sep 17 00:00:00 2001 From: Vinzenz Rosenkranz Date: Wed, 21 Dec 2022 14:41:08 +0100 Subject: [PATCH 004/120] fix resetting search to null value Signed-off-by: Vinzenz Rosenkranz --- resources/js/components/search/Simple.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/js/components/search/Simple.vue b/resources/js/components/search/Simple.vue index aab4b9cc4..3b586d050 100644 --- a/resources/js/components/search/Simple.vue +++ b/resources/js/components/search/Simple.vue @@ -197,7 +197,7 @@ }); watch(_ => defaultValue.value, (newValue, oldValue) => { - if(newValue.reset) { + if(!newValue || newValue.reset) { state.entry = null; } else { state.entry = newValue; From bb7c9ebdb7e9cb061e402203992b3dd29a6d84c0 Mon Sep 17 00:00:00 2001 From: Vinzenz Rosenkranz Date: Wed, 21 Dec 2022 14:42:26 +0100 Subject: [PATCH 005/120] correctly reset all column values after table row added Signed-off-by: Vinzenz Rosenkranz --- CHANGELOG.md | 1 + resources/js/components/attribute/Tabular.vue | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d5160c24..c0f85f9ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file. - Background to column section in _Add Attribute_ modal to better distinguish it from the main section ### Fixed - Reset label search after column added to table datatype in _Add Attribute_ modal +- Reset column values after new row is added in _Entity Detail_ form ### Changed - Attributes in entity detail's link list are now grouped by linked entity diff --git a/resources/js/components/attribute/Tabular.vue b/resources/js/components/attribute/Tabular.vue index b9644e0ea..987555a78 100644 --- a/resources/js/components/attribute/Tabular.vue +++ b/resources/js/components/attribute/Tabular.vue @@ -453,6 +453,7 @@ const reference = newRowRefs.value[k]; if(!!reference.v.value) { rowValue[k] = reference.v.value; + state.newRowColumns[k] = null; if(!!reference.resetFieldState) { reference.resetFieldState(); } From 423c4aea6f41219c25c4804a084401e14ace23e9 Mon Sep 17 00:00:00 2001 From: Vinzenz Rosenkranz Date: Thu, 22 Dec 2022 11:13:53 +0100 Subject: [PATCH 006/120] fix tabular attribute preview Signed-off-by: Vinzenz Rosenkranz --- CHANGELOG.md | 1 + resources/js/components/AttributeList.vue | 20 +++++++++- resources/js/components/attribute/Tabular.vue | 11 +++++- .../js/components/modals/attribute/Add.vue | 37 +++++++++++++++++-- resources/js/helpers/helpers.js | 6 +++ 5 files changed, 69 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0f85f9ae..5791af356 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file. ### Fixed - Reset label search after column added to table datatype in _Add Attribute_ modal - Reset column values after new row is added in _Entity Detail_ form +- Preview for Tabular attribute ### Changed - Attributes in entity detail's link list are now grouped by linked entity diff --git a/resources/js/components/AttributeList.vue b/resources/js/components/AttributeList.vue index 1af3da4f9..48bd395c0 100644 --- a/resources/js/components/AttributeList.vue +++ b/resources/js/components/AttributeList.vue @@ -3,7 +3,7 @@ class="h-100 pe-1" v-model="state.attributeList" item-key="id" - :disabled="disableDrag" + :disabled="disableDrag || preview" :group="group" :move="handleMove" @change="handleUpdate"> @@ -135,6 +135,7 @@ :value="state.attributeValues[element.id].value" :attribute="element" :selections="selections" + :preview-columns="preview ? previewData[element.id] : null" @expanded="e => onAttributeExpand(e, index)" @change="e => updateDirtyState(e, element.id)" /> @@ -305,6 +306,16 @@ type: Boolean, default: false, }, + preview: { + required: false, + type: Boolean, + default: false, + }, + previewData: { + required: false, + type: Object, + default: {}, + }, }, components: { 'string-attribute': StringAttr, @@ -341,6 +352,8 @@ selections, values, nolabels, + preview, + previewData, } = toRefs(props); // FETCH @@ -372,6 +385,9 @@ state.hoverStates[i] = false; }; const handleMove = (e, orgE) => { + // Preview does not allow dragging + if(preview.value) return false; + const draggedAid = e.draggedContext.element.id; return !(showHidden.value && Object.keys(state.hiddenAttributeList).some(aid => aid == draggedAid)) && !disableDrag.value; }; @@ -570,6 +586,8 @@ metadataAddon, nolabels, selections, + preview, + previewData, // STATE attrRefs, state, diff --git a/resources/js/components/attribute/Tabular.vue b/resources/js/components/attribute/Tabular.vue index 987555a78..d4e0902fa 100644 --- a/resources/js/components/attribute/Tabular.vue +++ b/resources/js/components/attribute/Tabular.vue @@ -180,7 +180,7 @@ - +
@@ -292,6 +292,11 @@ attribute: { type: Object, }, + previewColumns: { + required: false, + type: Object, + default: null, + }, }, components: { 'string-attribute': StringAttr, @@ -316,6 +321,7 @@ value, selections, attribute, + previewColumns, } = toRefs(props); // FETCH @@ -506,7 +512,8 @@ initialValue: value.value, }); const state = reactive({ - columns: computed(_ => getAttribute(attribute.value.id).columns), + isPreview: computed(_ => previewColumns.value && Object.keys(previewColumns.value).length > 0), + columns: computed(_ => state.isPreview ? previewColumns.value : getAttribute(attribute.value.id).columns), selections: computed(_ => { const list = {}; if(!state.columns) return list; diff --git a/resources/js/components/modals/attribute/Add.vue b/resources/js/components/modals/attribute/Add.vue index be6268b97..36cbce596 100644 --- a/resources/js/components/modals/attribute/Add.vue +++ b/resources/js/components/modals/attribute/Add.vue @@ -48,9 +48,13 @@ + :selections="{}" + :preview="true" + :preview-data="state.previewData" />