Skip to content

feat(topic-rules): Add copy and paste functionality#302

Merged
dmytro-landiak merged 2 commits into
thingsboard:mainfrom
Strazz1337:feat/topic-rules-component
Apr 6, 2026
Merged

feat(topic-rules): Add copy and paste functionality#302
dmytro-landiak merged 2 commits into
thingsboard:mainfrom
Strazz1337:feat/topic-rules-component

Conversation

@Strazz1337
Copy link
Copy Markdown
Contributor

@Strazz1337 Strazz1337 commented Apr 2, 2026

Pull Request description

#301

Adds the ability to copy topic rules and paste topic rules. This change also extracts the chiplist logic to a separate component because it is now duplicated thrice.

Before

image

After

Screen.Recording.2026-04-02.at.12.38.03.mov

General checklist

  • You have reviewed the guidelines document.

I did not see another suitable branch other than main, due to the other branches being outdated.

  • Labels that classify your pull request have been added.
  • The milestone is specified and corresponds to fix version.
  • Description references specific issue.
  • Description contains human-readable scope of changes.
  • Description contains brief notes about what needs to be added to the documentation.
  • No merge conflicts, commented blocks of code, code formatting issues.
  • Changes are backward compatible or upgrade script is provided.

Front-End feature checklist

  • Screenshots with affected component(s) are added. The best option is to provide 2 screens: before and after changes;
  • If you change the widget or other API, ensure it is backward-compatible or upgrade script is present.

Back-End feature checklist

  • Added corresponding unit and/or integration test(s). Provide written explanation in the PR description if you have failed to add tests.
  • If new dependency was added: the dependency tree is checked for conflicts.

@dmytro-landiak dmytro-landiak requested a review from deaflynx April 3, 2026 05:30
Copy link
Copy Markdown
Contributor

@deaflynx deaflynx left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! Nice refactoring of the duplicated chip-list logic.

One concern: Adding COMMA as a separator key will break regex quantifier patterns like sensor/.{1,3} — the comma would split it into two invalid chips (sensor/.{1 and 3}). MQTT auth rules support regex, so this is a realistic user input. Consider removing COMMA from the separator keys. SEMICOLON is fine to keep — it has no special meaning in regex and is not used in MQTT topics.

Removal is to avoid regex patterns with a comma to break, such as 'sensor/.{1,3}'.
@Strazz1337 Strazz1337 requested a review from deaflynx April 3, 2026 14:00
@dmytro-landiak dmytro-landiak merged commit 9e359a5 into thingsboard:main Apr 6, 2026
2 checks passed
@dmytro-landiak dmytro-landiak added the UI Minor improvement to UI label Apr 6, 2026
@dmytro-landiak dmytro-landiak added this to the 2.3.0 milestone Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

UI Minor improvement to UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants