3
0

Fix error for unconfigured sources in Geometry Block

This commit is contained in:
Emmy Leke
2023-01-20 11:26:31 +01:00
committed by EmmyMay
parent 179b91e7ec
commit e45fe7e7b5
4 changed files with 50 additions and 50 deletions
@@ -149,7 +149,7 @@ export default {
zoomMax,
}
Promise.all(this.options.feeds.map((feed, idx) => {
Promise.all(this.options.feeds.filter(f => f.isValid()).map((feed, idx) => {
return this.findModuleByID({ namespace: this.namespace, moduleID: feed.options.moduleID })
.then(module => {
// Interpolate prefilter variables
@@ -28,16 +28,21 @@
horizontal
:label-cols="3"
breakpoint="md"
:label="$t('geometry.recordFeed.colorLabel')"
:label="$t('geometry.recordFeed.geometryFieldLabel')"
>
<b-input-group>
<b-form-input
v-model="feed.options.color"
style="max-width: 50px;"
type="color"
debounce="300"
/>
</b-input-group>
<b-form-select
v-model="feed.geometryField"
:options="geometryFields | optionizeFields"
>
<template slot="first">
<option
disabled
value=""
>
{{ $t('geometry.recordFeed.geometryFieldPlaceholder') }}
</option>
</template>
</b-form-select>
</b-form-group>
<b-form-group
@@ -61,6 +66,35 @@
</b-form-select>
</b-form-group>
<b-form-group
horizontal
:label-cols="3"
breakpoint="md"
:label="$t('calendar.recordFeed.prefilterLabel')"
>
<b-form-textarea
v-model="feed.options.prefilter"
:value="true"
:placeholder="$t('calendar.recordFeed.prefilterPlaceholder')"
/>
</b-form-group>
<b-form-group
horizontal
:label-cols="3"
breakpoint="md"
:label="$t('geometry.recordFeed.colorLabel')"
>
<b-input-group>
<b-form-input
v-model="feed.options.color"
style="max-width: 50px;"
type="color"
debounce="300"
/>
</b-input-group>
</b-form-group>
<b-form-group
horizontal
:label-cols="3"
@@ -88,42 +122,6 @@
size="lg"
/>
</b-form-group>
<b-form-group
horizontal
:label-cols="3"
breakpoint="md"
:label="$t('geometry.recordFeed.geometryFieldLabel')"
>
<b-form-select
v-model="feed.geometryField"
:options="geometryFields | optionizeFields"
>
<template slot="first">
<option
disabled
value=""
>
{{ $t('geometry.recordFeed.geometryFieldPlaceholder') }}
</option>
</template>
</b-form-select>
</b-form-group>
<br>
<b-form-group
horizontal
:label-cols="3"
breakpoint="md"
:label="$t('calendar.recordFeed.prefilterLabel')"
>
<b-form-textarea
v-model="feed.options.prefilter"
:value="true"
:placeholder="$t('calendar.recordFeed.prefilterPlaceholder')"
/>
</b-form-group>
</template>
</template>
</div>
@@ -7,7 +7,6 @@ interface FeedOptions {
moduleID: string;
resource: string;
titleField: string;
geometryField: string;
displayMarker: boolean;
displayPolygon: boolean;
}
@@ -20,7 +19,6 @@ const defOptions = {
prefilter: '',
resource: 'compose:record',
titleField: '',
geometryField: '',
displayMarker: false,
displayPolygon: true,
}
@@ -53,4 +51,8 @@ export default class Feed {
}
}
}
isValid (): boolean {
return this.options.moduleID !== NoID && !!this.geometryField
}
}
+2 -2
View File
@@ -659,13 +659,13 @@ geometry:
lock: Lock
mapHelpText: Move and scroll the map to the position that will be used as a default. You can also lock the position or zoom to prevent users from moving too far.
recordFeed:
moduleLabel: Select module
moduleLabel: Module*
modulePlaceholder: (No module)
noMultiFields: Multi-value fields are currently not supported
optionLabel: Records
prefilterLabel: Prefilter sources
colorLabel: Marker color
geometryFieldLabel: Geometry field
geometryFieldLabel: Geometry field*
titleLabel: Title
titlePlaceholder: Title
geometryFieldPlaceholder: Geometry field