Skip to content

Commit

Permalink
Merge pull request #588 from sparc-request/jl-display-request-owner
Browse files Browse the repository at this point in the history
Adding owner column to sub service requests table (1.8.0)
  • Loading branch information
amcates committed Jul 26, 2016
2 parents 592a48c + ab27ace commit f914016
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/helpers/dashboard/sub_service_requests_helper.rb
Expand Up @@ -199,6 +199,10 @@ def ssr_actions_display(ssr, user, permission_to_edit, admin_orgs)
ssr_admin_button(ssr, user, permission_to_edit, admin_access)
end

def display_owner(ssr)
ssr.owner.full_name if ssr.owner_id.present?
end

private

def ssr_view_button(ssr)
Expand Down
Expand Up @@ -38,6 +38,8 @@
= t(:dashboard)[:service_requests][:srid]
%th.col-md-4{ data: { field: 'organization', align: 'left', sortable: 'true' } }
= t(:dashboard)[:service_requests][:organization]
%th.col-md-4{ data: { field: 'owner', align: 'left', sortable: 'true' } }
= t(:dashboard)[:service_requests][:owner]
%th.col-md-1{ data: { field: 'status', align: 'left', sortable: 'true' } }
= t(:dashboard)[:service_requests][:status]
%th.col-md-2{ data: {field: 'notifications', align: 'left' } }
Expand Down
@@ -1,6 +1,7 @@
json.(@sub_service_requests) do |ssr|
json.srid ssr.display_id
json.organization ssr.org_tree_display
json.owner display_owner(ssr)
json.status AVAILABLE_STATUSES[ssr.status]
json.notifications ssr_notifications_display(ssr, @user)
json.actions ssr_actions_display(ssr, @user, @permission_to_edit, @admin_orgs)
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Expand Up @@ -578,6 +578,7 @@ en:
modify_request: "Modify Request"
srid: "SRID"
organization: "Organization"
owner: "Owner"
status: "Status"
notifications: "Notifications"
actions:
Expand Down
1 change: 0 additions & 1 deletion spec/factories/sub_service_request.rb
Expand Up @@ -20,7 +20,6 @@

FactoryGirl.define do
factory :sub_service_request do
owner_id { Random.rand(1000) }
service_requester_id { Random.rand(1000) }

trait :without_validations do
Expand Down

0 comments on commit f914016

Please sign in to comment.