Merge pull request #12867 from snipe/fixes/clearer_tooltip_text_for_non_assets_undeployable

Small tooltip improvements for undeployable items in table view
This commit is contained in:
snipe 2023-04-18 13:00:11 -07:00 committed by GitHub
commit a84a9a8dec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 2 deletions

View file

@ -23,6 +23,7 @@ return [
'restore' => 'Restore Asset',
'pending' => 'Pending',
'undeployable' => 'Undeployable',
'undeployable_tooltip' => 'This asset has a status label that is undeployable and cannot be checked out at this time.',
'view' => 'View Asset',
'csv_error' => 'You have an error in your CSV file:',
'import_text' => '

View file

@ -446,5 +446,6 @@ return [
'no_autoassign_licenses_help' => 'Do not include user for bulk-assigning through the license UI or cli tools.',
'modal_confirm_generic' => 'Are you sure?',
'cannot_be_deleted' => 'This item cannot be deleted',
'undeployable_tooltip' => 'This item cannot be checked out. Check the quantity remaining.',
];

View file

@ -376,11 +376,19 @@
// The user is allowed to check items out, AND the item is deployable
if ((row.available_actions.checkout == true) && (row.user_can_checkout == true) && ((!row.asset_id) && (!row.assigned_to))) {
return '<a href="{{ config('app.url') }}/' + destination + '/' + row.id + '/checkout" class="btn btn-sm bg-maroon" data-tooltip="true" title="{{ trans('general.checkout_tooltip') }}">{{ trans('general.checkout') }}</a>';
// The user is allowed to check items out, but the item is not deployable
// The user is allowed to check items out, but the item is not able to be checked out
} else if (((row.user_can_checkout == false)) && (row.available_actions.checkout == true) && (!row.assigned_to)) {
return '<span data-tooltip="true" title="This item has a status label that is undeployable and cannot be checked out at this time."><a class="btn btn-sm bg-maroon disabled">{{ trans('general.checkout') }}</a></span>';
// We use slightly different language for assets versus other things, since they are the only
// item that has a status label
if (destination =='hardware') {
return '<span data-tooltip="true" title="{{ trans('admin/hardware/general.undeployable_tooltip') }}"><a class="btn btn-sm bg-maroon disabled">{{ trans('general.checkout') }}</a></span>';
} else {
return '<span data-tooltip="true" title="{{ trans('general.undeployable_tooltip') }}"><a class="btn btn-sm bg-maroon disabled">{{ trans('general.checkout') }}</a></span>';
}
// The user is allowed to check items in
} else if (row.available_actions.checkin == true) {