Skip to content

Commit

Permalink
[48619] Fixed validation message display for new API token
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Pfohl committed Jun 26, 2024
1 parent ab14783 commit b374622
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/token/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def name
private

def token_name_exist
errors.add(:token_name, I18n.t("activerecord.errors.messages.blank")) if data.blank? || data[:name].blank?
errors.add(:token_name, I18n.t("my.access_token.errors.token_name_blank")) if data.blank? || data[:name].blank?
end

def single_value?
Expand Down
6 changes: 6 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,8 @@ Project attributes and sections are defined in the <a href=%{admin_settings_url}

my:
access_token:
errors:
token_name_blank: "Please provide an API token name"
new_access_token_dialog_title: "Create new API token"
new_access_token_dialog_show_button_text: "API Token"
new_access_token_dialog_text_field_placeholder_text: "My API token"
Expand Down Expand Up @@ -1182,6 +1184,10 @@ Project attributes and sections are defined in the <a href=%{admin_settings_url}
undeletable_work_packages_attached: "The version cannot be deleted as it has work packages attached to it."
status:
readonly_default_exlusive: "can not be activated for statuses that are marked default."
token/api:
attributes:
token_name:
format: "%{message}"
template:
body: "Please check the following fields:"
header:
Expand Down

0 comments on commit b374622

Please sign in to comment.