Skip to content

Commit

Permalink
Never put closing brackets on newlines (vue/html-closing-bracket-newl…
Browse files Browse the repository at this point in the history
…ine)

Signed-off-by: Yannick Schaus <[email protected]>
  • Loading branch information
ghys committed Mar 9, 2021
1 parent 6c32655 commit 482e990
Show file tree
Hide file tree
Showing 117 changed files with 338 additions and 674 deletions.
2 changes: 1 addition & 1 deletion bundles/org.openhab.ui/web/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ module.exports = {
'vue/attribute-hyphenation': 'off',
'vue/attributes-order': 'off',
'vue/component-definition-name-casing': 'off',
'vue/html-closing-bracket-newline': 'error',
'vue/html-closing-bracket-newline': ['error', { 'singleline': 'never', 'multiline': 'never' }],
'vue/html-closing-bracket-spacing': 'error',
'vue/html-indent': 'error',
'vue/html-quotes': 'error',
Expand Down
42 changes: 14 additions & 28 deletions bundles/org.openhab.ui/web/src/components/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,73 +26,61 @@
<f7-list-item v-for="page in pages" :animate="false" :key="page.uid"
:class="{ currentsection: currentUrl.indexOf('/page/' + page.uid) >= 0 }"
:link="'/page/' + page.uid"
:title="page.config.label" view=".view-main" panel-close
>
:title="page.config.label" view=".view-main" panel-close>
<f7-icon slot="media" :f7="pageIcon(page)" />
</f7-list-item>
</f7-list>
<f7-block-title v-if="$store.getters.isAdmin" v-t="'sidebar.administration'" />
<f7-list class="admin-links" v-if="$store.getters.isAdmin">
<f7-list-item link="/settings/" :title="$t('sidebar.settings')" view=".view-main" panel-close :animate="false"
:class="{ currentsection: currentUrl === '/settings/' || currentUrl.indexOf('/settings/addons/') >= 0 || currentUrl.indexOf('/settings/services/') >= 0 }"
>
:class="{ currentsection: currentUrl === '/settings/' || currentUrl.indexOf('/settings/addons/') >= 0 || currentUrl.indexOf('/settings/services/') >= 0 }">
<f7-icon slot="media" ios="f7:gear_alt_fill" aurora="f7:gear_alt_fill" md="material:settings" color="gray" />
</f7-list-item>
<li v-if="showSettingsSubmenu">
<ul class="menu-sublinks">
<f7-list-item v-if="$store.getters.apiEndpoint('things')" link="/settings/things/" title="Things" view=".view-main" panel-close :animate="false" no-chevron
:class="{ currentsection: currentUrl.indexOf('/settings/things') >= 0 }"
>
:class="{ currentsection: currentUrl.indexOf('/settings/things') >= 0 }">
<f7-icon slot="media" f7="lightbulb" color="gray" />
</f7-list-item>
<f7-list-item v-if="$store.getters.apiEndpoint('items')" link="/settings/model/" title="Model" view=".view-main" panel-close :animate="false" no-chevron
:class="{ currentsection: currentUrl.indexOf('/settings/model') >= 0 }"
>
:class="{ currentsection: currentUrl.indexOf('/settings/model') >= 0 }">
<f7-icon slot="media" f7="list_bullet_indent" color="gray" />
</f7-list-item>
<f7-list-item v-if="$store.getters.apiEndpoint('items')" link="/settings/items/" title="Items" view=".view-main" panel-close :animate="false" no-chevron
:class="{ currentsection: currentUrl.indexOf('/settings/items') >= 0 }"
>
:class="{ currentsection: currentUrl.indexOf('/settings/items') >= 0 }">
<f7-icon slot="media" f7="square_on_circle" color="gray" />
</f7-list-item>
<f7-list-item v-if="$store.getters.apiEndpoint('ui')" link="/settings/pages/" title="Pages" view=".view-main" panel-close :animate="false" no-chevron
:class="{ currentsection: currentUrl.indexOf('/settings/pages') >= 0 }"
>
:class="{ currentsection: currentUrl.indexOf('/settings/pages') >= 0 }">
<f7-icon slot="media" f7="tv" color="gray" />
</f7-list-item>
<f7-list-item v-if="$store.getters.apiEndpoint('rules')" link="/settings/rules/" title="Rules" view=".view-main" panel-close :animate="false" no-chevron
:class="{ currentsection: currentUrl.indexOf('/settings/rules') >= 0 }"
>
:class="{ currentsection: currentUrl.indexOf('/settings/rules') >= 0 }">
<f7-icon slot="media" f7="wand_stars" color="gray" />
</f7-list-item>
<f7-list-item v-if="$store.getters.apiEndpoint('rules')" link="/settings/scripts/" title="Scripts" view=".view-main" panel-close :animate="false" no-chevron
:class="{ currentsection: currentUrl.indexOf('/settings/scripts') >= 0 }"
>
:class="{ currentsection: currentUrl.indexOf('/settings/scripts') >= 0 }">
<f7-icon slot="media" f7="doc_plaintext" color="gray" />
</f7-list-item>
<f7-list-item v-if="$store.getters.apiEndpoint('rules')" link="/settings/schedule/" title="Schedule" view=".view-main" panel-close :animate="false" no-chevron
:class="{ currentsection: currentUrl.indexOf('/settings/schedule') >= 0 }"
>
:class="{ currentsection: currentUrl.indexOf('/settings/schedule') >= 0 }">
<f7-icon slot="media" f7="calendar" color="gray" />
</f7-list-item>
</ul>
</li>

<f7-list-item link="/developer/" :title="$t('sidebar.developerTools')" panel-close
:class="{ currentsection: currentUrl.indexOf('/developer/') >= 0 && currentUrl.indexOf('/developer/widgets') < 0 && currentUrl.indexOf('/developer/api-explorer') < 0 }"
>
:class="{ currentsection: currentUrl.indexOf('/developer/') >= 0 && currentUrl.indexOf('/developer/widgets') < 0 && currentUrl.indexOf('/developer/api-explorer') < 0 }">
<f7-icon slot="media" ios="f7:exclamationmark_shield_fill" aurora="f7:exclamationmark_shield_fill" md="material:extension" color="gray" />
</f7-list-item>
<li v-if="showDeveloperSubmenu">
<ul class="menu-sublinks">
<f7-list-item v-if="$store.getters.apiEndpoint('ui')" link="/developer/widgets/" title="Widgets" view=".view-main" panel-close :animate="false" no-chevron
:class="{ currentsection: currentUrl.indexOf('/developer/widgets') >= 0 }"
>
:class="{ currentsection: currentUrl.indexOf('/developer/widgets') >= 0 }">
<f7-icon slot="media" f7="rectangle_on_rectangle_angled" color="gray" />
</f7-list-item>
<f7-list-item link="/developer/api-explorer" title="API Explorer" view=".view-main" panel-close :animate="false" no-chevron
:class="{ currentsection: currentUrl.indexOf('/developer/api-explorer') >= 0 }"
>
:class="{ currentsection: currentUrl.indexOf('/developer/api-explorer') >= 0 }">
<f7-icon slot="media" f7="burn" color="gray" />
</f7-list-item>
</ul>
Expand All @@ -101,8 +89,7 @@

<f7-list class="admin-links">
<f7-list-item link="/about/" :title="$t('sidebar.helpAbout')" view=".view-main" panel-close
:class="{ currentsection: currentUrl.indexOf('/about') >= 0 }"
>
:class="{ currentsection: currentUrl.indexOf('/about') >= 0 }">
<f7-icon slot="media" ios="f7:question_circle_fill" aurora="f7:question_circle_fill" md="material:help" color="gray" />
</f7-list-item>
</f7-list>
Expand All @@ -119,8 +106,7 @@
</div>
<f7-list v-if="$store.getters.user" media-list>
<f7-list-item :title="$store.getters.user.name" :footer="serverDisplayUrl" io="f7:person_alt_circle_fill" link="/profile/" no-chevron panel-close view=".view-main"
:class="{ currentsection: currentUrl.indexOf('/profile') >= 0 }"
>
:class="{ currentsection: currentUrl.indexOf('/profile') >= 0 }">
<f7-icon slot="media" size="36" ios="f7:person_alt_circle_fill" aurora="f7:person_alt_circle_fill" md="f7:person_alt_circle_fill" color="gray" />
</f7-list-item>
</f7-list>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@
<div class="location-stats margin-top" :class="config.invertText ? 'invert-text' : ''" v-if="!config.disableBadges">
<span v-for="badgeType in ['alarms', 'lights', 'windows', 'doors', 'garagedoors', 'blinds', 'presence', 'lock', 'climate', 'screens', 'projectors', 'speakers']" :key="badgeType">
<status-badge v-if="!config.badges || !config.badges.length || config.badges.indexOf(badgeType) >= 0"
:store="context.store" :element="element" :type="badgeType" :invert-color="config.invertText"
/>
:store="context.store" :element="element" :type="badgeType" :invert-color="config.invertText" />
</span>
</div>
<div class="location-stats margin-top-half" v-if="!config.disableBadges">
<span v-for="badgeType in ['temperature', 'humidity', 'luminance']" :key="badgeType">
<measurement-badge v-if="!config.badges || !config.badges.length || config.badges.indexOf(badgeType) >= 0"
:store="context.store" :element="element" :type="badgeType" :invert-color="config.invertText"
/>
:store="context.store" :element="element" :type="badgeType" :invert-color="config.invertText" />
</span>
</div>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
card-close
color="white"
class="card-opened-fade-in card-close-button"
icon-f7="multiply_circle_fill"
/>
icon-f7="multiply_circle_fill" />
</div>
<div v-if="opened">
<slot />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<template>
<f7-list ref="parameter" class="config-parameter" :no-hairlines-md="configDescription.type !== 'BOOLEAN' && (!configDescription.options || !configDescription.options.length) && ['item'].indexOf(configDescription.context) < 0"
v-show="(configDescription.visible) ? configDescription.visible(value, configuration, configDescription, parameters) : true"
>
v-show="(configDescription.visible) ? configDescription.visible(value, configuration, configDescription, parameters) : true">
<component v-if="!readOnly && !configDescription.readOnly" :is="control" :config-description="configDescription" :value="value" :parameters="parameters" :configuration="configuration" :title="configDescription.title" @input="updateValue" />
<f7-list-item v-else :title="configDescription.label" :after="(value !== undefined && value !== null) ? value.toString() : 'N/A'" />
<f7-block-footer slot="after-list" class="param-description">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
:configuration="configurationWithDefaults"
:read-only="readOnly"
:status="parameterStatus(parameter)"
@update="(value) => updateParameter(parameter, value)"
/>
@update="(value) => updateParameter(parameter, value)" />
</f7-col>
</f7-row>
</f7-block>
Expand All @@ -42,8 +41,7 @@
:configuration="configurationWithDefaults"
:read-only="readOnly"
:status="parameterStatus(parameter)"
@update="(value) => updateParameter(parameter, value)"
/>
@update="(value) => updateParameter(parameter, value)" />
</f7-col>
</f7-row>
</f7-block>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@
:center="center"
:options="mapOptions"
@click="mapClicked"
class="oh-map-picker-lmap"
>
class="oh-map-picker-lmap">
<l-tile-layer
:url="url"
:attribution="attribution"
/>
:attribution="attribution" />
<l-marker v-if="marker" :lat-lng="marker" />
</l-map>
</f7-page>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
:clear-button="!configDescription.required"
@input="(evt) => updateValue(evt.target.value)"
:error-message-force="exprError"
type="text"
>
type="text">
<div class="padding-left" slot="content-end">
<f7-button slot="content-end" @click="openPopup">
<f7-icon f7="calendar" /> Build
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<template>
<ul>
<f7-list-item v-for="(day, $idx) in values" :value="day" :key="day"
:title="labels[$idx]" checkbox :checked="isSelected(day)" @change="(evt) => select(day, evt.target.checked)"
/>
:title="labels[$idx]" checkbox :checked="isSelected(day)" @change="(evt) => select(day, evt.target.checked)" />
</ul>
</template>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
:required="configDescription.required" validate
:clear-button="!configDescription.required"
@input="updateValue"
type="text"
>
type="text">
<div class="padding-left" slot="content-end">
<f7-button slot="content-end" @click="openMapPicker">
<f7-icon f7="placemark" /> Map
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
@input="updateValue"
:required="configDescription.required" validate validate-on-blur
:clear-button="false"
type="number"
/>
type="number" />
</ul>
</template>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<template>
<ul v-if="!inlineList">
<f7-list-item
:title="configDescription.label" smart-select :smart-select-params="smartSelectParams" ref="item"
>
:title="configDescription.label" smart-select :smart-select-params="smartSelectParams" ref="item">
<select :name="configDescription.name" @change="updateValue" :multiple="configDescription.multiple" :required="configDescription.required">
<option v-if="!configDescription.required && !configDescription.multiple" :value="undefined" :selected="value === null || value === undefined" />
<option v-for="option in configDescription.options" :value="option.value" :key="option.value" :selected="isSelected(option)">
Expand All @@ -14,8 +13,7 @@
<ul v-else>
<f7-block-header class="no-margin">
<div class="margin-horizontal item-label"
style="padding-top: var(--f7-list-item-padding-vertical); color: var(--f7-text-color)"
>
style="padding-top: var(--f7-list-item-padding-vertical); color: var(--f7-text-color)">
{{ configDescription.label }}
</div>
<f7-link
Expand All @@ -27,14 +25,12 @@
opacity: configDescription.required ? 0 : 1,
cursor: 'pointer',
pointerEvents: 'initial'
}" class="input-clear-button margin-right" @click="updateValue(undefined)"
/>
}" class="input-clear-button margin-right" @click="updateValue(undefined)" />
</f7-block-header>
<f7-list-item radio v-for="option in configDescription.options" no-hairline
:value="option.value" :checked="isSelected(option)" radio-icon="start"
@change="(!configDescription.required && isSelected(option)) ? updateValue(undefined) : updateValue(option.value)"
:key="option.value" :title="option.label" :name="configDescription.name"
/>
:key="option.value" :title="option.label" :name="configDescription.name" />
</ul>
</template>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<template>
<ul>
<f7-list-item
:title="configDescription.label" smart-select :smart-select-params="smartSelectParams" ref="item"
>
:title="configDescription.label" smart-select :smart-select-params="smartSelectParams" ref="item">
<select :name="configDescription.name" @change="updateValue" :multiple="configDescription.multiple" :required="configDescription.required">
<option v-if="!configDescription.required" :value="undefined" :selected="value === null || value === undefined" />
<optgroup v-if="configDescription.context.indexOf('page') >= 0" label="Pages">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
<ul>
<f7-list-item
:floating-label="$theme.md"
:title="configDescription.label"
>
:title="configDescription.label">
<vue-qrcode :value="value" slot="media" />
</f7-list-item>
</ul>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<template>
<ul>
<f7-list-item
:title="configDescription.label"
>
:title="configDescription.label">
<f7-button slot="after" v-if="$device.desktop" @click="openPopup(true)" icon-material="fullscreen" />
<f7-button slot="after" @click="openPopup(false)">
Edit script
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
:required="configDescription.required" validate
:clear-button="!configDescription.required && configDescription.context !== 'password'"
@input="updateValue"
:type="controlType"
>
:type="controlType">
<div v-if="configDescription.context === 'password'" class="padding-left" slot="content-end">
<f7-link class="margin" color="gray" slot="content-end" @click="showPassword = !showPassword">
<f7-icon size="20" :f7="(showPassword) ? 'eye_slash_fill' : 'eye_fill'" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
:value="value"
:required="configDescription.required" validate
:clear-button="!configDescription.required"
@input="updateValue"
/>
@input="updateValue" />
<div slot="content-end" class="display-flex justify-content-center">
<div ref="picker" />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
<config-sheet
:parameterGroups="props.parameterGroups || []"
:parameters="props.parameters || []"
:configuration="config"
/>
:configuration="config" />
</f7-col>
</f7-block>
</f7-page>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@
<f7-list media-list>
<ul>
<f7-list-item v-for="thing in pinnedObjects.things" :key="thing.UID" media-item
:title="thing.label" :footer="thing.UID"
>
:title="thing.label" :footer="thing.UID">
<f7-badge slot="after" :color="thingStatusBadgeColor(thing.statusInfo)" :tooltip="thing.statusInfo.description">
{{ thingStatusBadgeText(thing.statusInfo) }}
</f7-badge>
Expand All @@ -86,8 +85,7 @@
<f7-list media-list>
<ul>
<f7-list-item v-for="rule in pinnedObjects.rules" :key="rule.uid" media-item
:title="rule.name" :footer="rule.uid"
>
:title="rule.name" :footer="rule.uid">
<f7-badge slot="after" :color="ruleStatusBadgeColor(rule.status)" :tooltip="rule.status.description">
{{ ruleStatusBadgeText(rule.status) }}
</f7-badge>
Expand All @@ -111,8 +109,7 @@
<f7-list media-list>
<ul>
<f7-list-item v-for="page in pinnedObjects.pages" :key="page.uid" media-item
:title="page.config.label" :footer="page.uid"
>
:title="page.config.label" :footer="page.uid">
<div class="display-flex align-items-flex-end justify-content-flex-end" style="margin-top: 3px" slot="footer">
<!-- <f7-link class="margin-right" color="blue" icon-f7="rectangle_on_rectangle" icon-size="18" tooltip="Open in Popup" /> -->
<f7-link class="margin-right" color="blue" icon-f7="play" icon-size="18" tooltip="View" :href="'/page/' + page.uid" :animate="false" />
Expand Down
Loading

0 comments on commit 482e990

Please sign in to comment.