Skip to content

Commit

Permalink
Adapt request's view in beta for action set_bugowner
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardoj committed Jul 7, 2023
1 parent 927bb3f commit f920a5e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/api/app/controllers/webui/request_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ def set_actions

def set_supported_actions
# Change supported_actions below into actions here when all actions are supported
@supported_actions = @actions.where(type: [:add_role, :change_devel, :delete, :submit, :maintenance_incident, :maintenance_release])
@supported_actions = @actions.where(type: [:add_role, :change_devel, :delete, :submit, :maintenance_incident, :maintenance_release, :set_bugowner])

Check warning on line 485 in src/api/app/controllers/webui/request_controller.rb

View check run for this annotation

Codecov / codecov/patch

src/api/app/controllers/webui/request_controller.rb#L485

Added line #L485 was not covered by tests
end

def set_action_id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
= link_to(request_show_path(number: request_action.bs_request.number, request_action_id: request_action.id, notification_id: notification),
class: 'btn btn-sm btn-outline-secondary', title: 'Back to request action') do
%i.fas.fa-arrow-left
Back to request action "Add #{request_action.person_name} as #{request_action.role}"
Back to request action "#{request_action.type.titleize}"
- else
= link_to(my_notifications_path, class: 'btn btn-sm btn-outline-secondary', title: 'Back to notifications') do
%i.fas.fa-arrow-left
Expand Down
8 changes: 5 additions & 3 deletions src/api/app/views/webui/request/_action_text.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
%p.mt-0.mb-0.fw-normal
%span.me-2 ##{action_index + 1}
- case action.type
- when 'add_role'
- when 'add_role', 'set_bugowner'
#{action.type.titleize}
- when 'delete'
Delete #{project_or_package_text(action.target_project, action.target_package)}
Expand All @@ -36,8 +36,8 @@
- else
= action.name

-# delete and set_bugowner are actions on the target repo, so they don't need to mention where they are coming from
- unless %w[delete set_bugowner].include?(action.type)
-# delete is an action on the target repo, so it doesn't need to mention where they are coming from
- unless action.type == 'delete'
%p.mb-0.mt-0.small
- case action.type
- when 'add_role'
Expand All @@ -48,6 +48,8 @@
from #{action.source_project} to #{action.target_project}
- when 'maintenance_release'
from #{action.source_project} to #{action.target_project} / #{action.target_package}
- when 'set_bugowner'
Set #{action.person_name || action.group_name} as bugowner of #{project_or_package_text(action.target_project, action.target_package)}
- else
from #{project_or_package_text(action.source_project, action.source_package)}
- if details
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 @@ -46,7 +46,7 @@
- if active_action.target_releaseproject
%p.fst-italic Release in #{project_or_package_link(project: active_action.target_releaseproject)}

- if active_action.type == 'add_role'
- if %w[add_role set_bugowner].include?(active_action.type)
:ruby
parameters = { project: active_action.target_project, request_action_id: active_action.id, notification_id: @current_notification }
roles_link = if active_action.target_package
Expand Down

0 comments on commit f920a5e

Please sign in to comment.