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 additional model fields to model modal screen #15941

Draft
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

Godmartinz
Copy link
Collaborator

Description

This adds missing fields to the quick create modal for creating an Asset Model.

Modal (left) vs Create blade (right)
image

Fixes #15876 , [sc-27627]

Type of change

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

@Godmartinz Godmartinz requested a review from snipe as a code owner December 9, 2024 20:32
Copy link

what-the-diff bot commented Dec 9, 2024

PR Summary

  • Imported AssetModel in ModalController.php
    This update allows for easier use of functionalities related to assets.

  • Modified the 'show' method in ModalController.php
    This now includes a new type called 'model'. This function provides a depreciation list and enables the creation of a new instance of an 'AssetModel'.

  • Added a 'created_by' field in the AssetModel
    This new field keeps track of the user who created the model.

  • Updated modal layout model.blade.php
    This layout has been enhanced with added form fields such as: depreciation, minimum quantity, end-of-life months and notes. Furthermore, a hidden input has been integrated for 'created_by' to store the current user ID.

  • Developed new partial views
    New views have been created for selecting depreciation options, inputting end-of-life months, entering minimum quantity, collecting additional notes, and for a checkbox indicating if the item is requestable.

  • Adjusted labels
    Minor changes to labels have been made in different partial views to improve their clarity without changing their functional roles.

@Godmartinz Godmartinz changed the title other fields appear in modal of model Added missing fields to Asset Model quick create modal Dec 9, 2024
@snipe snipe changed the title Added missing fields to Asset Model quick create modal Added additional model fields to model modal screen Dec 9, 2024
@Godmartinz
Copy link
Collaborator Author

looking at failing tests now

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.

This looks good but we don't have the opportunity to add default values for custom fields like we do on the standard "create asset model" page.

This might be a good first pass and we can add that in the future?

CleanShot 2024-12-09 at 15 47 15

Copy link
Collaborator

Choose a reason for hiding this comment

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

An improvement would be wrapping the input in a label so clicking the text checks/unchecks the box.

Here's an example of what I mean from the regular "Create Asset Model" page:
CleanShot 2024-12-09 at 15 46 39

@Godmartinz
Copy link
Collaborator Author

ah, I missed the default values. I can add that.

@Godmartinz Godmartinz marked this pull request as draft December 10, 2024 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants