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 edit: Remove redundant module title prefix #2352

Merged
merged 1 commit into from Feb 14, 2024

Conversation

jimtng
Copy link
Contributor

@jimtng jimtng commented Feb 13, 2024

See openhab/openhab-core#4090

  • When/If removed
  • Added prefix "item", "thing", similar to "channel"
  • play sound "xxx.mp3"
  • thing changed -> thing status changed

Before:
image

After:
image

@jimtng jimtng requested a review from a team as a code owner February 13, 2024 16:29
Copy link

relativeci bot commented Feb 13, 2024

Job #1518: Bundle Size — 11.01MiB (~+0.01%).

60107f4(current) vs 76aebaf main#1509(baseline)

Warning

Bundle contains 19 duplicate packages – View duplicate packages

Bundle metrics  Change 1 change
                 Current
Job #1518
     Baseline
Job #1509
No change  Initial JS 1.84MiB 1.84MiB
No change  Initial CSS 607.73KiB 607.73KiB
Change  Cache Invalidation 16.97% 17.34%
No change  Chunks 220 220
No change  Assets 242 242
No change  Modules 3075 3075
No change  Duplicate Modules 159 159
No change  Duplicate Code 1.75% 1.75%
No change  Packages 150 150
No change  Duplicate Packages 18 18
Bundle size by type  Change 1 change Regression 1 regression
                 Current
Job #1518
     Baseline
Job #1509
Regression  JS 9.2MiB (~+0.01%) 9.2MiB
Not changed  CSS 888.91KiB 888.91KiB
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.24KiB 1.24KiB
Not changed  Other 871B 871B

View job #1518 reportView jimtng:lowercase-module-descript... branch activityView project dashboard

@rkoshak
Copy link

rkoshak commented Feb 13, 2024

I like this! I never noticed how jarring it was before with the different cases in the triggers and the scripts.

Have you checked the conditions too?

image

I think removing the "If" same as you've removed the "When" from the triggers is warranted.

@jimtng jimtng force-pushed the lowercase-module-description branch 2 times, most recently from ee05291 to dfbc40c Compare February 13, 2024 16:46
@jimtng
Copy link
Contributor Author

jimtng commented Feb 13, 2024

I've updated the screenshots

@jimtng jimtng force-pushed the lowercase-module-description branch from dfbc40c to 9287764 Compare February 13, 2024 16:56
Copy link
Member

@ghys ghys left a comment

Choose a reason for hiding this comment

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

Thanks, this was also bugging me. LGTM except for the lowercasing of the cronstrue expressions.

case 'timer.GenericCronTrigger':
if (!config.cronExpression) return moduleType.label
try {
return cronstrue.toString(config.cronExpression, {
use24HourTimeFormat: true
})
}).toLowerCase()
Copy link
Member

Choose a reason for hiding this comment

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

This won't work well with labels like "At 08:00, only on Monday and Thursday".
Just lowercase the first character.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry I force pushed - habit. But it's now only lowercasing the first letter.

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
@jimtng jimtng force-pushed the lowercase-module-description branch from 9287764 to 60107f4 Compare February 13, 2024 17:20
Copy link
Contributor

@florian-h05 florian-h05 left a comment

Choose a reason for hiding this comment

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

The last change LGTM - luckily GitHub allows to compare between force pushes.

@florian-h05 florian-h05 changed the title Remove redundant module title prefix Rule edit: Remove redundant module title prefix Feb 14, 2024
@florian-h05 florian-h05 added enhancement New feature or request main ui Main UI labels Feb 14, 2024
@florian-h05 florian-h05 added this to the 4.2 milestone Feb 14, 2024
@florian-h05 florian-h05 merged commit 762b4b2 into openhab:main Feb 14, 2024
6 checks passed
@jimtng jimtng deleted the lowercase-module-description branch February 15, 2024 01:30
florian-h05 pushed a commit that referenced this pull request Feb 16, 2024
Fix regression from #2352.

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
enhancement New feature or request main ui Main UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants