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

Added trim to import values #13731

Merged
merged 2 commits into from
Oct 30, 2023
Merged

Added trim to import values #13731

merged 2 commits into from
Oct 30, 2023

Conversation

snipe
Copy link
Owner

@snipe snipe commented Oct 10, 2023

This just adds some trim() methods around the imported field values. We recently had a customer who ended up with duplicate statuses, since Ready to Deploy and Ready to Deploy are not the same string.

I'm not 100% sure I've gotten everything in this PR, but I'll keep testing.

@what-the-diff
Copy link

what-the-diff bot commented Oct 10, 2023

PR Summary

  • Improvement of Data Input in Accessory Importer
    The change trims the model_number value before assigning it, resulting in cleaner, reliable, and standardized input data.

  • Data Sanitization in Asset Importer
    Several fields (notes, image, requestable, warranty_months, byod) have been improved to provide accurate and error-free data by removing unwanted spaces before assignment.

  • Enhancing Component Importer Process
    The changes ensure that the values for name and serial are trimmed before executing a query, providing greater accuracy and efficiency.

  • Refining Consumable Importer
    Data input fields (name, model_number, item_no, min_amt) are now trimmed before assigning their values which promotes cleaner and standardized data.

  • Updates to Item Importer
    This change enhances the data quality of Statuslabel and Manufacturer models by trimming the name field before saving, resulting in standardized and consistent data.

  • Ensuring Better Data Input in License Importer
    An array of fields (asset_tag, expiration_date, license_email, license_name, maintained, purchase_order, order_number, manufacturer) will now be trimmed of excess spaces before assigning their values, leading to precise and standardized dataset.

  • Improved Location Data through Location Importer
    This upgrade trims several fields (name, address, address2, city, state, country, zip, currency, ldap_ou, manager, manager_username, parent_location) before assignment or method execution, ensuring cleaner, more accurate location details.

  • Efficiency Boost in User Importer
    All fields will now be trimmed before their values are assigned, cementing the uniformity and precision of user data.

Copy link
Collaborator

@spencerrlongg spencerrlongg left a comment

Choose a reason for hiding this comment

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

Can't figure out any side effects of this, nor can I figure out a decent way to 'move it up a level' to avoid putting it on every line, so 👍

Copy link
Collaborator

@marcusmoore marcusmoore left a comment

Choose a reason for hiding this comment

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

There's a syntax error that needs to be fixed but other than that, I agree with Spencer's comments.

app/Importer/ItemImporter.php Outdated Show resolved Hide resolved
@snipe snipe merged commit 8e20071 into develop Oct 30, 2023
6 checks passed
@snipe snipe deleted the improvements/trim_on_import branch October 30, 2023 14:17
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.

3 participants