-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add prefix to release tags in addition to suffix (#706)
- Loading branch information
1 parent
ca313d7
commit c366062
Showing
12 changed files
with
132 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 0 additions & 30 deletions
30
app/javascript/controllers/domain/release_suffix_help_controller.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import {Controller} from "@hotwired/stimulus"; | ||
|
||
export default class extends Controller { | ||
static values = { | ||
baseString: String, | ||
separator: { type: String, default: "-" }, | ||
commonPrefix: String, | ||
} | ||
|
||
static targets = [ | ||
"suffixInput", | ||
"prefixInput", | ||
"helpText", | ||
] | ||
|
||
initialize() { | ||
this.__set(); | ||
} | ||
|
||
set() { | ||
this.__set(); | ||
} | ||
|
||
__set() { | ||
const prefix = this.prefixInputTarget.value; | ||
const suffix = this.suffixInputTarget.value; | ||
const baseString = this.baseStringValue; | ||
const separator = this.separatorValue; | ||
const commonPrefix = this.commonPrefixValue; | ||
|
||
let result = `${commonPrefix}${baseString}`; | ||
if (prefix) { | ||
result = `${prefix}${separator}${result}`; | ||
} | ||
if (suffix) { | ||
result = `${result}${separator}${suffix}`; | ||
} | ||
|
||
this.helpTextTarget.textContent = result; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class AddConfigTagPrefixToTrain < ActiveRecord::Migration[7.2] | ||
def change | ||
add_column :trains, :tag_prefix, :string | ||
end | ||
end |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters