-
Notifications
You must be signed in to change notification settings - Fork 6
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
Refactor Save search modal #603
Conversation
- moved props, state, and api call from Dashboard to new Saved Search Modal. - still need to clean up code. - still need to round out create vuln functionality.
…to save-search-modal
- Stack is now spaced between. - Added Save end icon to button. - Changed button variant to contained for better visibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks and feels great, one small comment on the hard reload of the view.
- Removed use of local storage. - No need as search term, filters, and sort are in context and stored in state. - Saved Searches are in context and have their own state. - Created boolean based in state to determine if radio button is checked.
…r saved-search in models
- activeSearch is now stored in SavedSearchContext. - selectedSearch is now stored in SavedSearchContext. - activeSearchId is now stored in SavedSearchContext. - activeSearchId is determined in DrawerInterior and used to determine activeSearch and selectedSearch. - those are then passed to SaveSearchModal.
…tingSearch from SortBar
- Removed unused state from SavedSearchContext and SavedSearchContextProvider. - Added boolean check to allow user to resuse a name for a saved search if it is the same search. - Added disbale props to the update search dialogue.
- Saved Search list is now sorted ascending by name. - Removed unused imports from SaveSearchModal and Inventory. - Changed names of dialogs to be more descriptive. - update handler is now handleUpdate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall the code and UI look a lot cleaner to me. As for the removed functionality "create a vulnerability", we may want to discuss as a team whether we want to keep it commented or completely remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned in the review. Lets get some comments regarding commented out code i.e. the plan for the deprecation of the commented code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 LGTM!
Comments have been added referencing the deprecated code and plans to remove in future versions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with the added reference to the comments!
🗣 Description
💭 Motivation and context
Prior to this fix, save search was reliant on legacy dependency libraries. In an effort to make the application uniform and simplified, this modal has been refactored using Material UI components. Also, When a user is able to save a search, there should be some sort of check to prevent the entry of duplicate names and/or empty names. With this fix, form validation is now present to avoid invalid entries.
This resolves CRASM-629
🧪 Testing
📷 Screenshots
Save Search Modal Before
Save Search Modal Refactored
Inventory page
Saving a new search
Applying saved search
Updating a saved search
Form Validation against empty strings
Form validation against duplicate entries
✅ Pre-approval checklist
in code comments.
to reflect the changes in this PR.
✅ Pre-merge checklist
✅ Post-merge checklist