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

Importer model fixes #15322

Merged
merged 13 commits into from
Aug 16, 2024
Merged

Importer model fixes #15322

merged 13 commits into from
Aug 16, 2024

Conversation

snipe
Copy link
Owner

@snipe snipe commented Aug 16, 2024

We had pulled the uniqueness constraint on models somewhere along the line, which made importing easier and less noisy, but also allowed duplicate names to be created via API and UI, which can cause confusion to the user. If yo have 4 "Macbook Pro 13", which is the "real" one?

This PR adds it back in, but allows for the same model name as long as the model_number is different.

This also adds a nicer message if the asset tag already exists in the spreadsheet but the update button has not been checked.

If the update button is not checked, it will quietly update with the newer values, as it's always done.

Copy link

what-the-diff bot commented Aug 16, 2024

PR Summary

  • Addition of a Streamlit Application for Generating Gate Passes
    A new application that generates gate passes based on hardware data from a Snipe-IT API was added to the README. This application has been developed by GitHub user cha7uraAE.

  • Code Refactoring and Error Messaging
    Improvements have been made to the existing code base. For example, a method signature was modified by removing an unnecessary parameter. Enhancements were also made to the existing conditions of how different variables are checked. Furthermore, error logs have been revised and new ones were added to make spotting and diagnosing potential issues easier.

  • Addition of New Fields and Rules
    New fields and validation rules have been added to the software. This includes the addition of the eol_date into the array of mapping fields. We also included the name and model_number fields in the two_column_unique_undeleted validation, which ensures that these two fields are unique and are undeleated.
    We revised the two-column unique undeleted validation rule to additionally verify the 'id' column in the database query.

  • Addition of Error Message Translation
    Translation support was added for the error message import_asset_tag_exists in the general.php file, allowing this output to be seen in multiple languages.

  • User Interface improvements
    We've added new columns in the errors table to improve the reporting of errors to the end user. These new additions make it easier to identify where a potential issue may lie.

  • Test Improvements
    The creation of a new function to test the uniqueness of the name and model_number fields in the AssetModel, allowing us to ensure that these two elements are never duplicated. Some of the existing test functions have been renamed for better clarity and understanding.

@snipe snipe merged commit e7ef3bf into develop Aug 16, 2024
8 of 9 checks passed
@snipe snipe deleted the importer_model_fixes branch August 16, 2024 23:37
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.

1 participant