Skip to content

Commit

Permalink
Merge branch 'main' into fix-about-details
Browse files Browse the repository at this point in the history
  • Loading branch information
wborn authored Aug 21, 2023
2 parents 4d39435 + a08c347 commit aafc019
Show file tree
Hide file tree
Showing 18 changed files with 49 additions and 51 deletions.
3 changes: 1 addition & 2 deletions bundles/org.openhab.ui.basic/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@

var paths = {
FontLibs: [
'./node_modules/material-design-icons/iconfont/MaterialIcons-Regular.woff*',
'./node_modules/material-design-icons/iconfont/MaterialIcons-Regular.ttf',
'./node_modules/material-icons/iconfont/material-icons.woff*',
'./node_modules/framework7-icons/fonts/Framework7Icons-Regular.woff*',
'./node_modules/framework7-icons/fonts/Framework7Icons-Regular.ttf'
]
Expand Down
18 changes: 9 additions & 9 deletions bundles/org.openhab.ui.basic/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bundles/org.openhab.ui.basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"gulp-eslint": "^6.0.0",
"gulp-sass": "^5.0.0",
"gulp-uglify": "^3.0.2",
"material-design-icons": "^3.0.1",
"material-icons": "^1.13.9",
"framework7-icons": "^5.0.5",
"node-sass": "^8.0.0"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<spam class="f7-icons">%icon_name%</spam>
<span class="f7-icons">%icon_name%</span>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<spam class="material-icons md-oh">%icon_name%</spam>
<span class="material-icons">%icon_name%</span>
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
font-weight: 400;
src: local('Material Icons'),
local('MaterialIcons-Regular'),
url(fonts/MaterialIcons-Regular.woff2) format('woff2'),
url(fonts/MaterialIcons-Regular.woff) format('woff'),
url(fonts/MaterialIcons-Regular.ttf) format('truetype');
url(fonts/material-icons.woff2) format('woff2'),
url(fonts/material-icons.woff) format('woff');
}

.material-icons {
Expand All @@ -21,6 +20,8 @@
text-transform: none;
letter-spacing: normal;
word-wrap: normal;
white-space: nowrap;
direction: ltr;

/* Support for all WebKit browsers. */
-webkit-font-smoothing: antialiased;
Expand All @@ -33,14 +34,3 @@
/* Support for IE. */
font-feature-settings: 'liga';
}

.material-icons.md-oh {
font-size: 32px;
vertical-align: middle;
html:not(.ui-icons-enabled) & {
display: none;
}
html.ui-layout-condensed & {
font-size: 28px;
}
}
1 change: 1 addition & 0 deletions bundles/org.openhab.ui.basic/web-src/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@
font-size: 28px;
}
}
.material-icons,
.f7-icons {
font-size: 32px;
vertical-align: middle;
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.openhab.ui/doc/components/oh-cell.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ A regular or expandable cell
<PropOption value="right" label="right" />
</PropOptions>
</PropBlock>
<PropBlock type="TEXT" name="trendSampling" label="Trend Line Sampling">
<PropBlock type="INTEGER" name="trendSampling" label="Trend Line Sampling">
<PropDescription>
Amount of minutes between each point of the trendline (default: 60). Affected by persistence strategies different from "every minute"
</PropDescription>
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.openhab.ui/doc/components/oh-label-card.md
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ Display the state of an item in a card
<PropOption value="right" label="right" />
</PropOptions>
</PropBlock>
<PropBlock type="TEXT" name="trendSampling" label="Trend Line Sampling">
<PropBlock type="INTEGER" name="trendSampling" label="Trend Line Sampling">
<PropDescription>
Amount of minutes between each point of the trendline (default: 60). Affected by persistence strategies different from "every minute"
</PropDescription>
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.openhab.ui/doc/components/oh-label-cell.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ A cell with a big label to show a short item state value
<PropOption value="right" label="right" />
</PropOptions>
</PropBlock>
<PropBlock type="TEXT" name="trendSampling" label="Trend Line Sampling">
<PropBlock type="INTEGER" name="trendSampling" label="Trend Line Sampling">
<PropDescription>
Amount of minutes between each point of the trendline (default: 60). Affected by persistence strategies different from "every minute"
</PropDescription>
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.openhab.ui/doc/components/oh-trend.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Trend line to display the overall recent evolution of an item
<PropOption value="right" label="right" />
</PropOptions>
</PropBlock>
<PropBlock type="TEXT" name="trendSampling" label="Trend Line Sampling">
<PropBlock type="INTEGER" name="trendSampling" label="Trend Line Sampling">
<PropDescription>
Amount of minutes between each point of the trendline (default: 60). Affected by persistence strategies different from "every minute"
</PropDescription>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ export const getSemanticFormat = (type, format) =>

export const getTemperatureScale = (item) => {
const itemType = item.groupType || item.type
const state = (item.state !== 'NULL' && item.state !== 'UNDEF' && item.state) || ''
const unitSymbol = item.unitSymbol
const statePresentation = (item.stateDescription && item.stateDescription.pattern) || ''
const format = (itemType === 'Number:Temperature' && state) || statePresentation
const format = (itemType === 'Number:Temperature' && unitSymbol) || statePresentation
if (format.endsWith('°C')) return 'CELSIUS'
if (format.endsWith('°F')) return 'FAHRENHEIT'
const { measurementSystem } = (item.settings && item.settings.regional) || {}
Expand All @@ -53,11 +53,11 @@ export const getTemperatureScale = (item) => {

export const getUnitOfMeasure = (item) => {
const itemType = item.groupType || item.type
const state = (item.state !== 'NULL' && item.state !== 'UNDEF' && item.state) || ''
const unitSymbol = item.unitSymbol
const statePresentation = (item.stateDescription && item.stateDescription.pattern) || ''
const format =
((itemType === 'Dimmer' || itemType === 'Rollershutter') && '%') ||
(itemType.startsWith('Number:') && state) ||
(itemType.startsWith('Number:') && unitSymbol) ||
statePresentation
return Object.keys(UNITS_OF_MEASURE).find((id) => format.endsWith(UNITS_OF_MEASURE[id]))
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { pi, pt, po } from '../helpers.js'
import { pi, pt, po, pn } from '../helpers.js'

export default () => [
pi('trendItem', 'Trend Line Item', 'Item to show as a trend line in the background'),
Expand All @@ -11,5 +11,5 @@ export default () => [
{ value: 'left', label: 'left' },
{ value: 'right', label: 'right' }
]).a(),
pt('trendSampling', 'Trend Line Sampling', 'Amount of minutes between each point of the trendline (default: 60). Affected by persistence strategies different from "every minute"').a()
pn('trendSampling', 'Trend Line Sampling', 'Amount of minutes between each point of the trendline (default: 60). Affected by persistence strategies different from "every minute"').a()
]
14 changes: 11 additions & 3 deletions bundles/org.openhab.ui/web/src/components/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,8 @@ export default {
showDeveloperSidebar: false,
currentUrl: '',
communicationFailureToast: null
communicationFailureToast: null,
communicationFailureTimeoutId: null
}
},
computed: {
Expand Down Expand Up @@ -785,9 +786,16 @@ export default {
if (mutation.type === 'sseConnected') {
if (!window.OHApp && this.$f7) {
if (mutation.payload === false) {
if (this.communicationFailureToast === null) this.communicationFailureToast = this.displayFailureToast(this.$t('error.communicationFailure'), true, false)
this.communicationFailureToast.open()
if (this.communicationFailureToast === null) {
this.communicationFailureTimeoutId = setTimeout(() => {
if (this.communicationFailureToast !== null) return
this.communicationFailureToast = this.displayFailureToast(this.$t('error.communicationFailure'), true, false)
this.communicationFailureToast.open()
this.communicationFailureTimeoutId = null
}, 1000)
}
} else if (mutation.payload === true) {
if (this.communicationFailureTimeoutId !== null) clearTimeout(this.communicationFailureTimeoutId)
if (this.communicationFailureToast !== null) {
this.communicationFailureToast.close()
this.communicationFailureToast.destroy()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default {
},
created () {
this.smartSelectParams.closeOnSelect = !(this.multiple)
this.$oh.api.get('/rest/things?staticDataOnly=true').then((data) => {
this.$oh.api.get('/rest/things').then((data) => {
this.things = data.sort((a, b) => {
const labelA = a.label
const labelB = b.label
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default {
}
},
beforeMount () {
if (this.item.type === 'Group' ? this.item.groupType.indexOf('Number:') < 0 : this.item.type.indexOf('Number:') < 0) this.metadataNamespaces = this.metadataNamespaces.filter(n => n.name !== 'unit')
if (this.item.type === 'Group' ? (this.item.groupType && this.item.groupType.indexOf('Number:') < 0) : this.item.type.indexOf('Number:') < 0) this.metadataNamespaces = this.metadataNamespaces.filter(n => n.name !== 'unit')
},
computed: {
editableNamespaces () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
<f7-col class="elevation-2 elevation-hover-6 elevation-pressed-1 triggertype-big-button" width="50">
<f7-link class="display-flex flex-direction-column no-ripple" no-ripple @click="chooseScriptCategory">
<f7-icon size="35" f7="doc_plaintext" class="margin" />
Run<br>Script
Inline<br>Script
</f7-link>
</f7-col>
</f7-row>
<f7-row class="margin-bottom">
<f7-col class="elevation-2 elevation-hover-6 elevation-pressed-1 triggertype-big-button" width="50">
<f7-link class="display-flex flex-direction-column no-ripple" no-ripple @click="chooseRulesCategory">
<f7-icon size="35" f7="wand_stars" class="margin" />
Other<br>Rules
Scenes, Scripts<br>& Rules
</f7-link>
</f7-col>
<f7-col class="elevation-2 elevation-hover-6 elevation-pressed-1 triggertype-big-button" width="50">
Expand Down Expand Up @@ -111,8 +111,8 @@
</f7-block>
<f7-block class="no-margin no-padding" v-else-if="category === 'rules'">
<f7-list>
<f7-list-item radio :checked="rulesEventType === 'run'" name="rulesEventType" title="run these rule(s)" @click="updateRulesEventType('run')" />
<f7-list-item radio :checked="rulesEventType === 'enable'" name="rulesEventType" title="enable or disable these rule(s)" @click="updateRulesEventType('enable')" />
<f7-list-item radio :checked="rulesEventType === 'run'" name="rulesEventType" title="run" @click="updateRulesEventType('run')" />
<f7-list-item radio :checked="rulesEventType === 'enable'" name="rulesEventType" title="enable or disable" @click="updateRulesEventType('enable')" />
</f7-list>
<config-sheet v-if="currentModuleType" :key="currentModule.id"
:parameterGroups="[]"
Expand Down
8 changes: 4 additions & 4 deletions bundles/org.openhab.ui/web/src/js/store/modules/semantics.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ const actions = {
if (this.getters.apiEndpoint('tags')) {
api.get('/rest/tags')
.then((tags) => {
state.Locations = tags.filter(t => t.uid.startsWith('Location_')).map(t => t.name)
state.Equipment = tags.filter(t => t.uid.startsWith('Equipment_')).map(t => t.name)
state.Points = tags.filter(t => t.uid.startsWith('Point_')).map(t => t.name)
state.Properties = tags.filter(t => t.uid.startsWith('Property_')).map(t => t.name)
state.Locations = tags.filter(t => t.uid.startsWith('Location')).map(t => t.name)
state.Equipment = tags.filter(t => t.uid.startsWith('Equipment')).map(t => t.name)
state.Points = tags.filter(t => t.uid.startsWith('Point')).map(t => t.name)
state.Properties = tags.filter(t => t.uid.startsWith('Property')).map(t => t.name)
// Store i18n labels
Object.values(tags).forEach(t => {
if (t.label) {
Expand Down

0 comments on commit aafc019

Please sign in to comment.