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

Add prefix to tags in addition to suffix #706

Merged
merged 3 commits into from
Jan 1, 2025
Merged

Add prefix to tags in addition to suffix #706

merged 3 commits into from
Jan 1, 2025

Conversation

gitstart-app[bot]
Copy link
Contributor

@gitstart-app gitstart-app bot commented Dec 24, 2024

What does this PR achieve?

  • Adds tag_prefix column to trains table
  • Converts the domain controllerrelease_suffix_help_controller.js to a generic controllerstring_affix_controller.js
    • It takes baseString, prefix, suffix and the specified separator.
  • Add tests to verify prefix tag implementation
  • Removes data-string-affix-prefix-current-value and data-string-affix-suffix-current-value attributes as they are not needed for the string-affix controller to function correctly.

Demo

https://www.loom.com/share/74aefe260f3a412597c99ae00b560ce0

@gitstart-tramline
Copy link

Hi @kitallis, the PR is ready for review.

Copy link
Member

@kitallis kitallis left a comment

Choose a reason for hiding this comment

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

Looks good. I've approved it with a request for a simple JS change. Once that's done I'll merge this PR.

Copy link
Member

Choose a reason for hiding this comment

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

suggestion: I think we can make this controller generic at this point, instead of a domain controller. Something like a StringAffixController (affiix representing both prefix and suffix). This will take the base string and prefix and suffix and the specified separator.

@@ -5,18 +5,22 @@
hide_child: @train.tag_releases?) do |component| %>
<% component.with_child do %>
<section data-controller="help-text">
<div data-controller="domain--release-suffix-help"
data-domain--release-suffix-help-version-value="<%= @train.version_current || @train.version_seeded_with || "1.0.0" %>"
data-domain--release-suffix-help-version-suffix-current-value="<%= @train.tag_suffix %>"

Choose a reason for hiding this comment

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

version-suffix-current-value was used to initialize the suffix value but the controller should be able to handle the initial values directly from the input fields
Screenshot 2024-12-30 at 11 30 08 AM

Since it's unnecessary, we removed it.

@gitstart-tramline
Copy link

Hi @kitallis,
We have made the requested changes, please review.

@nid90 nid90 merged commit c366062 into main Jan 1, 2025
4 checks passed
@nid90 nid90 deleted the TRAB-704 branch January 1, 2025 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants