Skip to content

Commit

Permalink
Rule edit: Add descriptions to triggers, actions & conditions sections (
Browse files Browse the repository at this point in the history
#3008)

Closes openhab/openhab-core#4503.

Signed-off-by: Florian Hotze <dev@florianhotze.com>
  • Loading branch information
florian-h05 authored Jan 13, 2025
1 parent 9a9d363 commit 54a3498
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions bundles/org.openhab.ui/web/src/pages/settings/rules/rule-edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,14 @@
</f7-button>
</div>
<div v-for="section in ['triggers', 'actions', 'conditions']" :key="section">
<f7-block-title medium style="margin-bottom: var(--f7-list-margin-vertical)" v-if="isEditable || rule[section].length > 0">
{{ SECTION_LABELS[section][0] }}
</f7-block-title>
<template v-if="isEditable || rule[section].length > 0">
<f7-block-title medium class="no-margin-bottom">
{{ SECTION_LABELS[section][0] }}
</f7-block-title>
<f7-block-footer class="no-margin-top margin-horizontal" style="margin-bottom: var(--f7-list-margin-vertical)">
{{ SECTION_LABELS[section][1] }}
</f7-block-footer>
</template>
<f7-list sortable swipeout media-list @sortable:sort="(ev) => reorderModule(ev, section)">
<f7-list-item media
:title="mod.label || suggestedModuleTitle(mod, null, section)"
Expand All @@ -118,7 +123,7 @@
</f7-list-item>
</f7-list>
<f7-list v-if="isEditable">
<f7-list-item link no-chevron media-item :color="($theme.dark) ? 'black' : 'white'" :subtitle="SECTION_LABELS[section][1]" @click="addModule(section)">
<f7-list-item link no-chevron media-item :color="($theme.dark) ? 'black' : 'white'" :subtitle="SECTION_LABELS[section][2]" @click="addModule(section)">
<f7-icon slot="media" color="green" aurora="f7:plus_circle_fill" ios="f7:plus_circle_fill" md="material:control_point" />
</f7-list-item>
<!-- <f7-list-button :color="(showModuleControls) ? 'gray' : 'blue'" :title="sectionLabels[section][1]"></f7-list-button> -->
Expand Down Expand Up @@ -202,9 +207,9 @@ export default {
data () {
return {
SECTION_LABELS: {
triggers: ['When', 'Add Trigger'],
actions: ['Then', 'Add Action'],
conditions: ['But only if', 'Add Condition']
triggers: ['When', 'Events that cause this rule to run', 'Add Trigger'],
actions: ['Then', 'Actions to take when this rule runs', 'Add Action'],
conditions: ['But only if', 'Conditions that must be matched for the actions of this rule to run', 'Add Condition']
},
ready: false,
Expand Down

0 comments on commit 54a3498

Please sign in to comment.