Skip to content

Commit 03205a1

Browse files
put help text in line with the boolean toggle
1 parent 9481569 commit 03205a1

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

client/src/components/Form/FormElement.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ const nonMdHelp = computed(() =>
190190
? sanitize(helpText.value!)
191191
: ""
192192
);
193+
const showNonMdHelp = computed(() => !!nonMdHelp.value && (!props.workflowRun || props.type !== "boolean"));
193194
194195
const currentValue = computed({
195196
get() {
@@ -341,7 +342,13 @@ function onAlert(value: string | undefined) {
341342
<FormError v-if="props.workflowRun && hasAlert && !unPopulatedError" :alerts="alerts" has-alert-class />
342343

343344
<div v-if="showField" class="ui-form-field" :data-label="props.title">
344-
<FormBoolean v-if="props.type === 'boolean'" :id="props.id" v-model="currentValue" />
345+
<div
346+
v-if="props.type === 'boolean'"
347+
:class="{ 'd-flex align-items-start flex-gapx-1': props.workflowRun && nonMdHelp }">
348+
<FormBoolean :id="props.id" v-model="currentValue" class="mr-2" />
349+
<!-- eslint-disable-next-line vue/no-v-html -->
350+
<span v-if="props.workflowRun && nonMdHelp" class="text-muted" v-html="nonMdHelp" />
351+
</div>
345352
<FormHidden v-else-if="isHiddenType" :id="props.id" v-model="currentValue" :info="attrs['info']" />
346353
<FormNumber
347354
v-else-if="props.type === 'integer' || props.type === 'float'"
@@ -440,7 +447,7 @@ function onAlert(value: string | undefined) {
440447

441448
<div v-if="showPreview" class="ui-form-preview pt-1 pl-2 mt-1">{{ previewText }}</div>
442449
<!-- eslint-disable-next-line vue/no-v-html -->
443-
<span v-if="nonMdHelp" class="ui-form-info form-text text-muted" v-html="nonMdHelp" />
450+
<span v-if="showNonMdHelp" class="ui-form-info form-text text-muted" v-html="nonMdHelp" />
444451
<span v-else-if="Boolean(helpText) && helpFormat === 'markdown'" class="ui-form-info form-text text-muted">
445452
<FormElementHelpMarkdown :content="helpText ?? ''" />
446453
</span>

0 commit comments

Comments
 (0)