Skip to content

Commit

Permalink
Add 6 months and 2 years periods for sitemap charts
Browse files Browse the repository at this point in the history
Changes in Baisc UI and in Main UI (sitemap generator)

Depends on openhab/openhab-core#3863

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
  • Loading branch information
lolodomo committed Nov 4, 2023
1 parent f4bbba0 commit 1ed73bd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ public EList<Widget> renderWidget(Widget w, StringBuilder sb, String sitemap) th
List.of("Last 8 hours", "8h"), List.of("Last 12 hours", "12h"), List.of("Last day", "D"),
List.of("Last 2 days", "2D"), List.of("Last 3 days", "3D"), List.of("Last week", "W"),
List.of("Last 2 weeks", "2W"), List.of("Last month", "M"), List.of("Last 2 months", "2M"),
List.of("Last 4 months", "4M"), List.of("Last year", "Y"));
List.of("Last 4 months", "4M"), List.of("Last 6 months", "6M"), List.of("Last year", "Y"),
List.of("Last 2 years", "2Y"));
StringBuilder rowSB = new StringBuilder();
for (List<String> period : periods) {
buildRow(chart, period.get(0), period.get(1), chart.getPeriod(), rowSB);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ export default {
{ key: 'M', value: 'Month' },
{ key: '2M', value: '2 Months' },
{ key: '4M', value: '4 Months' },
{ key: 'Y', value: 'Year' }
{ key: '6M', value: '6 Months' },
{ key: 'Y', value: 'Year' },
{ key: '2Y', value: '2 Years' }
],
inputHintDefs: [
{ key: 'text', value: 'Text' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ export default {
}
})
widgetList.filter(widget => widget.component === 'Chart').forEach(widget => {
if (!(widget.config && widget.config.period && ['h', '4h', '8h', '12h', 'D', '2D', '3D', 'W', '2W', 'M', '2M', '4M', 'Y'].includes(widget.config.period))) {
if (!(widget.config && widget.config.period && ['h', '4h', '8h', '12h', 'D', '2D', '3D', 'W', '2W', 'M', '2M', '4M', '6M', 'Y', '2Y'].includes(widget.config.period))) {
let label = widget.config && widget.config.label ? widget.config.label : 'without label'
validationWarnings.push(widget.component + ' widget ' + label + ', invalid period configured: ' + widget.config.period)
}
Expand Down

0 comments on commit 1ed73bd

Please sign in to comment.