openhab / openhab-webui

Web UIs of openHAB
Eclipse Public License 2.0
212 stars 232 forks source link

Sitemap editor: Add press release button support #2553

Closed mherwege closed 1 week ago

mherwege commented 2 weeks ago

Related to https://github.com/openhab/openhab-core/pull/4183 Requires https://github.com/openhab/openhab-core/pull/4204

This PR implements press/release button support.

To make this work, some refactoring had to be done to allow proper quoting of arguments in mappings and conditions. So far, quotes where stripped and the full mapping or condition strings where interpreted by splitting on special characters (=, : ...). This is limiting as it blocks these characters from being used in the arguments or makes working with blanks difficult. The sitemap syntax explicitely works with quoted strings for this, but that information was lost in the current implementation. Quotes are now preserved, and therefore they need to be removed in core at usage (https://github.com/openhab/openhab-core/pull/4204). Note that this introduced a backward compatibility constraint, as sitemaps saved in the UI, containing mappings or conditions with blanks, will require quotes to be manually added in the UI in order to be able to save changes to it. If not touched, the sitemaps should still work.

relativeci[bot] commented 2 weeks ago

#1943 Bundle Size — 10.59MiB (+0.02%).

725e626(current) vs 50f2a91 main#1941(baseline)

[!WARNING] Bundle contains 2 duplicate packages – View duplicate packages

Bundle metrics  Change 1 change
                 Current
#1943
     Baseline
#1941
No change  Initial JS 1.86MiB 1.86MiB
No change  Initial CSS 607.87KiB 607.87KiB
Change  Cache Invalidation 17.76% 17.77%
No change  Chunks 222 222
No change  Assets 245 245
No change  Modules 2873 2873
No change  Duplicate Modules 146 146
No change  Duplicate Code 1.84% 1.84%
No change  Packages 95 95
No change  Duplicate Packages 2 2

Bundle size by type  Change 1 change Regression 1 regression
|            |       Current
[#1943](https://app.relative-ci.com/projects/ZNG5hy4VeSJQVQcq1Kvu/jobs/1943-Tp6p3tNG37mJKxIE8Fbe?utm_source=github&utm_medium=pr-report "View bundle analysis report") |      Baseline
[#1941](https://app.relative-ci.com/projects/ZNG5hy4VeSJQVQcq1Kvu/jobs/1941-EB9ggx2F5PcnqlqsuwM8?utm_source=github&utm_medium=pr-report "View baseline bundle analysis report") | |:--|--:|--:| | Regression  [JS](https://app.relative-ci.com/projects/ZNG5hy4VeSJQVQcq1Kvu/jobs/1943-Tp6p3tNG37mJKxIE8Fbe/assets?ba=%7B%22filters%22%3A%22ft.CSS-0_ft.JS-1_ft.IMG-0_ft.MEDIA-0_ft.FONT-0_ft.HTML-0_ft.OTHER-0%22%7D "View JS assets") | `8.78MiB` (`+0.02%`) | `8.77MiB` | | No change  [CSS](https://app.relative-ci.com/projects/ZNG5hy4VeSJQVQcq1Kvu/jobs/1943-Tp6p3tNG37mJKxIE8Fbe/assets?ba=%7B%22filters%22%3A%22ft.CSS-1_ft.JS-0_ft.IMG-0_ft.MEDIA-0_ft.FONT-0_ft.HTML-0_ft.OTHER-0%22%7D "View CSS assets") | `890.63KiB` | `890.63KiB` | | No change  [Fonts](https://app.relative-ci.com/projects/ZNG5hy4VeSJQVQcq1Kvu/jobs/1943-Tp6p3tNG37mJKxIE8Fbe/assets?ba=%7B%22filters%22%3A%22ft.CSS-0_ft.JS-0_ft.IMG-0_ft.MEDIA-0_ft.FONT-1_ft.HTML-0_ft.OTHER-0%22%7D "View Fonts assets") | `526.1KiB` | `526.1KiB` | | No change  [Media](https://app.relative-ci.com/projects/ZNG5hy4VeSJQVQcq1Kvu/jobs/1943-Tp6p3tNG37mJKxIE8Fbe/assets?ba=%7B%22filters%22%3A%22ft.CSS-0_ft.JS-0_ft.IMG-0_ft.MEDIA-1_ft.FONT-0_ft.HTML-0_ft.OTHER-0%22%7D "View Media assets") | `295.6KiB` | `295.6KiB` | | No change  [IMG](https://app.relative-ci.com/projects/ZNG5hy4VeSJQVQcq1Kvu/jobs/1943-Tp6p3tNG37mJKxIE8Fbe/assets?ba=%7B%22filters%22%3A%22ft.CSS-0_ft.JS-0_ft.IMG-1_ft.MEDIA-0_ft.FONT-0_ft.HTML-0_ft.OTHER-0%22%7D "View IMG assets") | `140.74KiB` | `140.74KiB` | | No change  [HTML](https://app.relative-ci.com/projects/ZNG5hy4VeSJQVQcq1Kvu/jobs/1943-Tp6p3tNG37mJKxIE8Fbe/assets?ba=%7B%22filters%22%3A%22ft.CSS-0_ft.JS-0_ft.IMG-0_ft.MEDIA-0_ft.FONT-0_ft.HTML-1_ft.OTHER-0%22%7D "View HTML assets") | `1.24KiB` | `1.24KiB` | | No change  [Other](https://app.relative-ci.com/projects/ZNG5hy4VeSJQVQcq1Kvu/jobs/1943-Tp6p3tNG37mJKxIE8Fbe/assets?ba=%7B%22filters%22%3A%22ft.CSS-0_ft.JS-0_ft.IMG-0_ft.MEDIA-0_ft.FONT-0_ft.HTML-0_ft.OTHER-1%22%7D "View Other assets") | `871B` | `871B` |

Bundle analysis reportBranch mherwege:press_release_buttonProject dashboard

lolodomo commented 1 week ago

Ready for review, the core PRs are now merged.

lolodomo commented 1 week ago

@mherwege : please rebase your branch. Build is failing due to a change in core framework that needed a fix in Basic UI.

mherwege commented 1 week ago

@lolodomo done