Skip to content

Commit

Permalink
Allow to edit object-typed parameters via a code editor and minor bug…
Browse files Browse the repository at this point in the history
… fixes
  • Loading branch information
m-mohr committed Aug 27, 2024
1 parent 1e3dba8 commit 2c36822
Show file tree
Hide file tree
Showing 6 changed files with 366 additions and 198 deletions.
4 changes: 2 additions & 2 deletions src/components/DiscoveryToolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,10 @@ export default {
}
},
methods: {
...Utils.mapMutations('editor', ['setDiscoverySearchTerm', 'setModelDnd']),
...Utils.mapMutations('editor', ['setDiscoverySearchTerm', 'setModelDnD']),
...Utils.mapActions(['loadProcess']),
onDrag(event, type, data) {
let fn = (loading) => this.setModelDnd({type, data, loading});
let fn = (loading) => this.setModelDnD({type, data, loading});
if (type === 'process') {
fn(true);
this.loadProcess(data).then(() => fn(false));
Expand Down
8 changes: 4 additions & 4 deletions src/components/ParameterDataType.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!-- Result Node -->
<template v-if="isResult">
<div class="fieldValue externalData fromNode">
<span>Output of <tt>#{{ state.from_node }}</tt></span>
<span>Output of <code>#{{ state.from_node }}</code></span>
</div>
<button type="button" v-if="nativeParameterType === 'array'" @click="convertToArray()"><i class="fas fa-list"></i> Convert to array</button>
</template>
Expand All @@ -14,7 +14,7 @@
<!-- Process Parameter -->
<template v-else-if="isPgParameter">
<div class="fieldValue externalData fromArgument">
<span>Value of process parameter <tt>{{ state.from_parameter }}</tt></span>
<span>Value of process parameter <code>{{ state.from_parameter }}</code></span>
</div>
<button type="button" v-if="nativeParameterType === 'array'" @click="convertToArray()"><i class="fas fa-list"></i> Convert to array</button>
</template>
Expand All @@ -26,7 +26,7 @@
<!-- Null -->
<div class="description" v-else-if="type === 'null'">
<i class="fas fa-info-circle"></i>
<p>This is set to <strong><tt>null</tt></strong>, which is usually used as placeholder for no-data values or a default value.</p>
<p>This is set to <strong><code>null</code></strong>, which is usually used as placeholder for no-data values or a default value.</p>
</div>
<!-- Select Boxes (collection id, job id, epsg code, in/output format, service type, billing plan, enums) -->
<SelectBox v-else-if="isSelection" v-model="state" :key="type" :type="type" :editable="editable" :schema="schema" :context="dependency" @onDetails="onSelectDetails"></SelectBox>
Expand Down Expand Up @@ -61,7 +61,7 @@
<!-- URL -->
<input class="fieldValue" v-else-if="type === 'url' || type === 'uri'" v-model="state" type="url" :name="name" :disabled="!editable" />
<!-- Objects / Arrays -->
<ObjectEditor v-else-if="nativeType === 'object' || nativeType === 'array'" :editable="editable" :parameter="parameter" :schema="schema" :isObject="nativeType === 'object'" v-model="state" :parent="parent" :context="context" />
<ObjectEditor v-else-if="nativeType === 'object' || nativeType === 'array'" :key="type" :editable="editable" :parameter="parameter" :schema="schema" :isObject="nativeType === 'object'" v-model="state" :parent="parent" :context="context" />
<!-- String and all other -->
<input class="fieldValue" v-else v-model="state" type="text" :name="name" :disabled="!editable" />
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/ParameterDataTypes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const SUPPORTED_TYPES = [
{type: 'object', default: {}, group: 'Basics', properties: {
from_node: { not: {} },
from_parameter: { not: {} }
}},
}, default: {}},
{type: 'string', subtype: 'date-time', format: 'date-time', title: 'Date and Time', group: 'Temporal', default: () => now()},
{type: 'string', subtype: 'date', format: 'date', title: 'Date only', group: 'Temporal', default: () => now().substring(0, 10)},
Expand Down
Loading

0 comments on commit 2c36822

Please sign in to comment.