Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rule/Script edit: Fix not editable not properly handled & Always show tags #2276

Merged

Conversation

florian-h05
Copy link
Contributor

@florian-h05 florian-h05 commented Jan 17, 2024

Fixes an issue where the configuration of a script action of a file-based rule (e.g. those created using JSRule or Rule Builder of openhab-js) was shown as editable, even though the rule is not editable because it is provisioned from file.

image

Always show the tag input, even if there are no rule tags. This is more consistent and avoids confusion, as you can now clearly see that a rule has no tags.

… tags

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
@florian-h05 florian-h05 requested a review from a team as a code owner January 17, 2024 21:15
@florian-h05 florian-h05 added bug Something isn't working main ui Main UI labels Jan 17, 2024
Copy link

relativeci bot commented Jan 17, 2024

Job #1377: Bundle Size — 15.84MiB (+0.09%).

8ac3ad4(current) vs 4864f43 main#1376(baseline)

Warning

Bundle contains 16 duplicate packages – View duplicate packages

Bundle metrics  Change 3 changes Regression 1 regression
                 Current
Job #1377
     Baseline
Job #1376
Regression  Initial JS 1.9MiB(+0.69%) 1.89MiB
No change  Initial CSS 609.81KiB 609.81KiB
Change  Cache Invalidation 93.87% 93.98%
No change  Chunks 217 217
No change  Assets 683 683
Change  Modules 3036(+0.8%) 3012
No change  Duplicate Modules 170 170
No change  Duplicate Code 1.6% 1.6%
No change  Packages 152 152
No change  Duplicate Packages 16 16
Bundle size by type  Change 2 changes Regression 2 regressions
                 Current
Job #1377
     Baseline
Job #1376
Regression  JS 9.31MiB (+0.12%) 9.3MiB
Regression  Other 4.75MiB (+0.06%) 4.75MiB
Not changed  CSS 861.35KiB 861.35KiB
Not changed  Fonts 526.1KiB 526.1KiB
Not changed  Media 295.6KiB 295.6KiB
Not changed  IMG 140.74KiB 140.74KiB
Not changed  HTML 1.23KiB 1.23KiB

View job #1377 reportView florian-h05:rule-script-not-edit... branch activityView project dashboard

@stefan-hoehn
Copy link
Contributor

Just to explain a bit more what the issue was:

Created a rule with JSRule, which is then still displayed as a file-based rule in the UI.

When opening that rule, only the code of the rule is displayed, but things like as UID, Label, Description, Tags, Script Language can still be edited

For file based rules all this should not editable, but the UI has allowed editing of all fields except the UID.
Also, the tag input was completely hidden if there were no tags instead of just being empty.

Even though it was editable, saving it did not have a effect (as it should be).
In a nutshell, like any other file based rule, the information should be shown but not be editable via the UI, which was fixed here.

Copy link
Contributor

@stefan-hoehn stefan-hoehn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes are straight forward and easy to understand.
LGTM. Thanks @florian-h05 you fixed this.

@florian-h05 florian-h05 merged commit a13d34a into openhab:main Jan 28, 2024
6 checks passed
@florian-h05 florian-h05 deleted the rule-script-not-editable-improvements branch January 28, 2024 12:42
@florian-h05 florian-h05 added this to the 4.2 milestone Jan 28, 2024
florian-h05 pushed a commit that referenced this pull request Feb 7, 2024
…2318)

Regression from #2276 which caused a new rule unable to be created
because the rule name/description couldn't be entered (fields are
disabled)

---------

Also-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working main ui Main UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants