-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KG - SSR 'Edit' Button Bugs #426
Changes from 6 commits
11d3d04
ad9f6d6
d6d64ae
3ae0663
0ec07a4
10baeb9
f2220bc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -195,7 +195,7 @@ def ssr_actions_display(ssr, user, permission_to_edit, admin_orgs) | |
admin_access = (admin_orgs & ssr.org_tree).any? | ||
|
||
ssr_view_button(ssr)+ | ||
ssr_edit_button(ssr, user, permission_to_edit, admin_access)+ | ||
ssr_edit_button(ssr, user, permission_to_edit)+ | ||
ssr_admin_button(ssr, user, permission_to_edit, admin_access) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No longer determined by admin access |
||
end | ||
|
||
|
@@ -205,10 +205,10 @@ def ssr_view_button(ssr) | |
content_tag(:button, t(:dashboard)[:service_requests][:actions][:view], class: 'view-service-request btn btn-primary btn-sm', type: 'button', data: { sub_service_request_id: ssr.id }) | ||
end | ||
|
||
def ssr_edit_button(ssr, user, permission_to_edit, admin_access) | ||
def ssr_edit_button(ssr, user, permission_to_edit) | ||
# The SSR must not be locked, and the user must either be an authorized user or an authorized admin | ||
if ssr.can_be_edited? && permission = (permission_to_edit == 'true' || admin_access) | ||
content_tag(:button, t(:dashboard)[:service_requests][:actions][:edit], class: 'edit-service-request btn btn-warning btn-sm', type: 'button', data: { permission: permission.to_s, url: "/service_requests/#{ssr.service_request.id}/catalog?sub_service_request_id=#{ssr.id}&from_user_portal=true"}) | ||
if ssr.can_be_edited? && permission_to_edit | ||
content_tag(:button, t(:dashboard)[:service_requests][:actions][:edit], class: 'edit-service-request btn btn-warning btn-sm', type: 'button', data: { permission: permission_to_edit.to_s, url: "/service_requests/#{ssr.service_request.id}/catalog?sub_service_request_id=#{ssr.id}&from_user_portal=true"}) | ||
else | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No longer determined by admin access. Simply display it if they have the correct authorized user rights |
||
'' | ||
end | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
json.(@sub_service_requests) do |ssr| | ||
json.srid ssr.display_id | ||
json.organization ssr.org_tree_display | ||
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) | ||
json.srid ssr.display_id | ||
json.organization ssr.org_tree_display | ||
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) | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Them tabs were nastay |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Find roles where 'approve' or 'request' rights, then use !.nil? to for 'are there any?'. Returns boolean value now