Skip to content

Commit

Permalink
Use a shorter name for dropdown button
Browse files Browse the repository at this point in the history
  • Loading branch information
ncounter committed Mar 21, 2024
1 parent a73e5fe commit 7b8d85c
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/api/app/models/bs_request_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,10 @@ def name
uniq_key
end

def short_name
''
end

def commit_details
package = Package.find_by_project_and_name(source_project, source_package)

Expand Down
4 changes: 4 additions & 0 deletions src/api/app/models/bs_request_action_add_role.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ def name
uniq_key.gsub('add_role/', 'Add Role ')
end

def short_name
'Add Role'
end

#### Alias of methods
end

Expand Down
4 changes: 4 additions & 0 deletions src/api/app/models/bs_request_action_change_devel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ def name
uniq_key.gsub('changedevel/', 'Change Devel ')
end

def short_name
'Change Devel'
end

#### Alias of methods
end

Expand Down
4 changes: 4 additions & 0 deletions src/api/app/models/bs_request_action_delete.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ def name
end
end

def short_name
name
end

private

def remove_repository(opts)
Expand Down
4 changes: 4 additions & 0 deletions src/api/app/models/bs_request_action_maintenance_incident.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ def name
"Incident #{uniq_key}"
end

def short_name
"Incident #{source_package}"
end

private

def _merge_pkg_into_maintenance_incident(incident_project)
Expand Down
4 changes: 4 additions & 0 deletions src/api/app/models/bs_request_action_maintenance_release.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ def name
"Release #{uniq_key}"
end

def short_name
"Release #{source_package}"
end

private

def sanity_check!
Expand Down
4 changes: 4 additions & 0 deletions src/api/app/models/bs_request_action_release.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ def name
"Release #{uniq_key}"
end

def short_name
"Release #{source_package}"
end

private

def sanity_check!
Expand Down
4 changes: 4 additions & 0 deletions src/api/app/models/bs_request_action_set_bugowner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ def name
uniq_key.gsub('setbugowner/', 'Set Bugowner ')
end

def short_name
'Set Bugowner'
end

#### Alias of methods
end

Expand Down
4 changes: 4 additions & 0 deletions src/api/app/models/bs_request_action_submit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ def name
"Submit #{uniq_key}"
end

def short_name
"Submit #{source_package}"
end

def creator_is_target_maintainer
request_creator = User.find_by_login(bs_request.creator)
target_package_object = Package.find_by_project_and_name(target_project, target_package)
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/views/webui/request/_actions_details.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
.dropdown#request-actions
%button.btn.btn-outline-primary.btn-sm.dropdown-toggle.rounded-0{ 'aria-expanded' => 'false', 'data-bs-toggle' => 'dropdown',
:type => 'button', 'data-boundary' => 'viewport' }
= action.name
= active_action.short_name
%ul.dropdown-menu.dropdown-menu-start.scrollable-dropdown.pt-0
%li.card-header.px-1.sticky-top.bg-body-tertiary
%h6.dropdown-header
Expand Down

0 comments on commit 7b8d85c

Please sign in to comment.