Config parameter: Add unit to param description when entering UoM values (#2820)

Signed-off-by: Florian Hotze <dev@florianhotze.com>
pull/2821/head
Florian Hotze 2024-10-22 23:22:17 +02:00 committed by GitHub
parent 85c3c3113d
commit 8ebd07fa94
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 1 deletions

View File

@ -10,7 +10,7 @@
<span v-if="status.statusCode">Status Code: &nbsp;{{ status.statusCode }}&nbsp;&nbsp;</span>
<span v-if="status.message">{{ status.message }}</span>
</div>
<small v-html="`${configDescription.required ? '<strong>Required</strong>&nbsp;' : ''}${configDescription.description || ''}`" />
<small v-html="`${configDescription.required ? '<strong>Required</strong>&nbsp;' : ''}${description || ''}`" />
</f7-block-footer>
</f7-list>
</template>
@ -94,6 +94,13 @@ export default {
return ParameterQrcode
}
return ParameterText
},
description () {
// TODO: Remove this when proper UoM support is implemented for config parameters
// Adds the unit to the description if it is available, UoM support is currently implemented through number parameters
// where the user can enter the amount for the default unit
if (this.configDescription.unit) return `${this.configDescription.description} (${this.configDescription.unit})`
return this.configDescription.description
}
},
mounted () {