-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Adjust requested assets and models workflow a little bit. #11190
Adjust requested assets and models workflow a little bit. #11190
Conversation
So IIRC, we don't link to those model listings because the person logged in may not have the ability to view asset model details (i.e. a "regular" user), which would result in 403 errors on everything they click on. |
Yeah, just tested it and that's the case. You think it's a good idea to check for permissions to show the link? or I just rollback that change? |
Yeah, from a UX perspective, being presented with a link that you can't click on without an error is a bad experience. I'd say check for the gate before presenting the link. |
@@ -109,8 +109,14 @@ class="table table-striped snipe-table" | |||
|
|||
</td> | |||
|
|||
<td> | |||
@if (Gate::allows('superadmin')) |
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.
Should this be superadmin, or just the ability to view asset models?
@can('view', \App\Models\AssetModel::class)
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.
I think that's a lot better, yes.
@@ -109,8 +109,14 @@ class="table table-striped snipe-table" | |||
|
|||
</td> | |||
|
|||
<td> | |||
@can('view', \App\Models\AssetModel::class) | |||
<a href='{{ url("/models/{$requestableModel->id}") }}' > {{ $requestableModel->name }} </a></td> |
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.
Can we clean up the extra spaces and the extra </td>
here? We already close the <td>
outside of the loop.
<a href='{{ url("/models/{$requestableModel->id}") }}' > {{ $requestableModel->name }} </a></td>
vs
<a href="{{ url("/models/{$requestableModel->id}") }}">{{ $requestableModel->name }}</a>
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.
Sorry, I have it written differently and the tag remained 😬
Description
This changes doesn't change behavior a lot, but there was a Requestable Asset Models view that doesn't links to the proper model if you click to their name.
Also when checking this I hit a DB exception if in Requestable Assets view I try to order columns, so the fix is also in this PR, and finally, a tiny tiny fix on the Requested Assets views, where we were showing two blank columns instead of the one that contains the checkin/checkout actions.
Fixes freshdesk 27421
Type of change
How Has This Been Tested?
Test Configuration:
Checklist: