Skip to content
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

Feature: Extend search capabilities to other assets attributes #15217

Merged

Conversation

FlorentDotMe
Copy link
Contributor

Description

This pull request aims to address long-standing request from several users who need to search for assets with attributes other than the asset tag as mentioned in past discussions: #3216, #5812.

Previous behavior:

  1. Lookup for the asset tag
  2. If the asset tag exists, redirect to the asset page
  3. Else redirect to the list of assets without search criteria and throw an error mentioning the asset doesn't exist

Proposed behavior:

  1. Lookup for the asset tag
  2. If the asset tag exists, redirect to the asset page
  3. Else redirect to the list of assets having attributes matching the search string

Compatibility with barcode scanners hasn't been tested, but compatibility should likely be preserved.

Some points may need further discussion:

  • Should the "does not exist" error message be kept?
  • Should the search bar pleaceholder attribute be updated?

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

From the Dashboard, use the "Lookup by Asset Tag" search field and proceed to the following steps:

  1. Search for an existing Asset Tag, you will be redirected to the asset page.
  2. Search for an existing Asset Model, you will get the list of all assets of this model.

Checklist:

Copy link

what-the-diff bot commented Aug 5, 2024

PR Summary

  • Enhancement in Asset Search Capability
    The getAssetByTag function in the AssetsController.php now includes a feature that allows it to search for a unique asset tag. This contributes towards making the asset search more efficient. If it doesn't find an exact match, it will smoothly redirect users back to the main view.

  • Attribute Addition in Interface Element
    We have introduced a new attribute (data-search-text) within the data-table element in the index.blade.php file. This is a step towards improving and enriching the user interface and enhancing data accessibility.

Copy link
Owner

@snipe snipe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small change

app/Http/Controllers/Assets/AssetsController.php Outdated Show resolved Hide resolved
@FlorentDotMe FlorentDotMe requested a review from snipe August 5, 2024 14:05
@snipe snipe merged commit b83d148 into snipe:develop Aug 5, 2024
9 checks passed
@snipe
Copy link
Owner

snipe commented Aug 5, 2024

Looks great, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants