Skip to content

Commit 7e22819

Browse files
committed
MORE-Platform#428: update componentDialog and correct some incorrect property previews
1 parent 43fcae2 commit 7e22819

4 files changed

Lines changed: 46 additions & 18 deletions

File tree

src/components/dialog/ComponentDialog.vue

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ Licensed under the Elastic License 2.0. */
7676
7777
const title = ref(component.title);
7878
const purpose = ref(component.purpose);
79+
const participantTitle = ref(component.participantTitle);
7980
const participantInfo = ref(component.participantInfo);
8081
const properties: Ref<Property<any>[]> = ref(
8182
factory.properties
@@ -255,7 +256,7 @@ Licensed under the Elastic License 2.0. */
255256
const returnComponent = {
256257
templateId: component.templateId,
257258
title: title.value,
258-
purpose: purpose.value,
259+
participantTitle: participantTitle.value,
259260
participantInfo: participantInfo.value,
260261
observationGroupIds: selectedObservationGroups.value?.length
261262
? selectedObservationGroups.value.map((id: string) => parseInt(id))
@@ -475,7 +476,10 @@ Licensed under the Elastic License 2.0. */
475476
@remove-scheduler="removeScheduler"
476477
/>
477478

478-
<div class="col-span-8 col-start-0">
479+
<div
480+
v-if="componentType === 'observation'"
481+
class="col-span-8 col-start-0"
482+
>
479483
<h5 class="mb-2">{{ $t('study.props.purpose') }}</h5>
480484
<Textarea
481485
v-model="purpose"
@@ -485,6 +489,23 @@ Licensed under the Elastic License 2.0. */
485489
:disabled="!editable"
486490
></Textarea>
487491
</div>
492+
<div
493+
v-if="componentType === 'goalTemplate'"
494+
class="col-span-8 mt-6 mb-3 h-[1px] w-full bg-gray-300"
495+
/>
496+
<div v-if="componentType === 'goalTemplate'" class="col-span-8 col-start-0">
497+
<h5 class="mb-2">{{ $t('study.props.participantTitle') }}*</h5>
498+
<InputText
499+
v-model="participantTitle"
500+
type="text"
501+
required
502+
:placeholder="$t('study.placeholder.participantTitle', {
503+
type: $t(`global.labels.${componentType}`),
504+
})"
505+
class="w-full"
506+
:disabled="!editable"
507+
></InputText>
508+
</div>
488509
<div class="col-span-8 col-start-0">
489510
<h5 :class="getError('participantInfo') ? 'mb-1' : 'mb-2'">
490511
{{ $t('study.props.participantInfo') }}*

src/components/dialog/shared/StringTemplatePropertyInput.vue

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,14 @@
137137
{{ $t(property.name) }}
138138
</h6>
139139
</div>
140-
140+
<div
141+
v-if="
142+
property.description && property.description !== 'inputModel.enterValue'
143+
"
144+
class="text-xs text-gray-500"
145+
>
146+
{{ $t(property.description) }}
147+
</div>
141148
<div v-if="isEditing" class="mb-4">
142149
<div
143150
class="relative mb-2 flex items-center justify-between rounded border border-gray-300 bg-gray-50 p-4"
@@ -197,14 +204,6 @@
197204
/>
198205
</div>
199206
</div>
200-
<div
201-
v-if="
202-
property.description && property.description !== 'inputModel.enterValue'
203-
"
204-
class="text-xs text-gray-500"
205-
>
206-
{{ $t(property.description) }}
207-
</div>
208207
</div>
209208
</template>
210209

src/i18n/de.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,9 @@
134134
"leavePage": "Möchten Sie die Seite wirklich verlassen?",
135135
"dataHealth": "Datenqualität",
136136
"searchPlaceholder": "Suchen...",
137-
"warning": "Warnung"
137+
"warning": "Warnung",
138+
"goalTemplate": "Ziel",
139+
"observation": "Datenerhebung"
138140
},
139141
"placeholder": {
140142
"all": "Alle",
@@ -624,7 +626,7 @@
624626
"partOfTemplate": "Teil der Vorschau",
625627
"goal-preview": {
626628
"name": "Ziel Vorschau",
627-
"description": "Das Ziel wird auf der App folgendermaßen angezeigt:",
629+
"description": "Das Ziel wird auf der App folgendermaßen angezeigt",
628630
"partOfTemplate": "Teil der Vorschau"
629631
},
630632
"goal": {
@@ -1333,7 +1335,8 @@
13331335
"participantInfoInput": "Stellen Sie Informationen für Ihre Studienteilnehmer:innen bereit. Dies Beschreibung wird den Teilnehmern:innen auf der App angezeigt.",
13341336
"purposeInput": "Stellen Sie eine kurze Beschreibung Ihres Forschungszwecks für Ihre Studien-Mitarbeiter bereit.",
13351337
"selectLanguage": "Sprache auswählen",
1336-
"titleInput": "Bitte geben Sie einen kurzen Titel ein."
1338+
"titleInput": "Bitte geben Sie einen kurzen Titel ein.",
1339+
"participantTitle": "Dieser Titel scheint als {type}-Titel für die Teilnehmer:innen auf der App auf."
13371340
},
13381341
"plural": "Studien",
13391342
"props": {
@@ -1353,7 +1356,8 @@
13531356
"groups": "Gruppen",
13541357
"observationGroup": "Datenerhebungs-Gruppe {size}",
13551358
"studyId": "Studien-ID",
1356-
"title": "Titel"
1359+
"title": "Titel",
1360+
"participantTitle": "App Titel"
13571361
},
13581362
"roles": {
13591363
"admin": "Studien-Administrator",

src/i18n/en.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,9 @@
134134
"leavePage": "Do you really want to leave the page?",
135135
"dataHealth": "Data health",
136136
"searchPlaceholder": "Search...",
137-
"warning": "Warning"
137+
"warning": "Warning",
138+
"goalTemplate": "Goal",
139+
"observation": "Observation"
138140
},
139141
"placeholder": {
140142
"all": "All",
@@ -1333,7 +1335,8 @@
13331335
"participantInfoInput": "Please provide information for your studies participants. This description will be visible on the participant's app.",
13341336
"purposeInput": "Please provide a short description of your research purpose for your collaborators.",
13351337
"selectLanguage": "Select a language",
1336-
"titleInput": "Please provide a short title."
1338+
"titleInput": "Please provide a short title.",
1339+
"participantTitle": "This title is shown as {type}-title on the app."
13371340
},
13381341
"plural": "Studies",
13391342
"props": {
@@ -1352,7 +1355,8 @@
13521355
"studyGroup": "Study group {size}",
13531356
"observationGroup": "Observation group {size}",
13541357
"studyId": "Study ID",
1355-
"title": "Title"
1358+
"title": "Title",
1359+
"participantTitle": "App title"
13561360
},
13571361
"roles": {
13581362
"admin": "Study Administrator",

0 commit comments

Comments
 (0)