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

Limit duplicate search creation #4687

Conversation

rtibbles
Copy link
Member

@rtibbles rtibbles commented Aug 29, 2024

Summary

Description of the change(s) you made

  • Removes unused/unneeded saved search edit functionality
  • Disables saving a search if the search is already saved
  • Updates backend to allow id to be written from frontend (it was previously readonly, which meant the savedsearch was always being given a new id on save)
  • Updates backend to return id in hex format for consistency with frontend
  • Disables saved search modal listing when there are no saved searches
  • Moves saved search modal action link to main import flow, as currently users are required to do any search before they can access their saved searches
  • Cleans up inconsistent text box behaviour, where the search term would not be properly filled or cleared after navigation
  • Navigates back to root import modal when search term is cleared

Manual verification steps performed

  1. Created a saved search

  2. Confirmed I could not save it again

  3. Refreshed page, confirmed it was still the case

  4. Wait for sync to resolve, reload page, see that there is no duplication

  5. Clear search, see that it navigates back to page

  6. Delete all saved searches, see that it is not possible to show the saved search modal

Screenshots (if applicable)

image

References

Fixes #4655
Fixes #4287
Fixes #3118

Comments


Contributor's Checklist

PR process:

  • If this is an important user-facing change, PR or related issue the CHANGELOG label been added to this PR. Note: items with this label will be added to the CHANGELOG at a later time
  • If this includes an internal dependency change, a link to the diff is provided
  • The docs label has been added if this introduces a change that needs to be updated in the user docs?
  • If any Python requirements have changed, the updated requirements.txt files also included in this PR
  • Opportunities for using Google Analytics here are noted
  • Migrations are safe for a large db

Studio-specifc:

  • All user-facing strings are translated properly
  • The notranslate class been added to elements that shouldn't be translated by Google Chrome's automatic translation feature (e.g. icons, user-generated text)
  • All UI components are LTR and RTL compliant
  • Views are organized into pages, components, and layouts directories as described in the docs
  • Users' storage used is recalculated properly on any changes to main tree files
  • If there new ways this uses user data that needs to be factored into our Privacy Policy, it has been noted.

Testing:

  • Code is clean and well-commented
  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical user journeys are covered by Gherkin stories
  • Any new interactions have been added to the QA Sheet
  • Critical and brittle code paths are covered by unit tests

Reviewer's Checklist

This section is for reviewers to fill out.

  • Automated test coverage is satisfactory
  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

@rtibbles rtibbles added this to the Studio: Bulk Editing Release milestone Aug 29, 2024
@akolson
Copy link
Member

akolson commented Aug 30, 2024

@rtibbles I'm not sure if this is intended behavior but using the saved search entry seems to duplicate the entry. Everything else looks fine!

Screen.Recording.2024-08-30.at.15.26.52.mov

@akolson akolson self-requested a review August 30, 2024 12:32
Copy link
Member

@akolson akolson left a comment

Choose a reason for hiding this comment

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

Code changes and manual QA seem to checkout. Open question for me is raised here otherwise we should be good to merge

@rtibbles
Copy link
Member Author

Ah, no - that is not intended, and actually probably more likely the original origin of the bug reported, rather than "save search" being clicked more than once. Will update.

@rtibbles
Copy link
Member Author

@akolson I have replicated the issue you reported (which I think was the root issue). I have also resolved a couple of other issues with the search functionality in the process, as they were simple to fix and impeded my testing.

Copy link
Member

@akolson akolson left a comment

Choose a reason for hiding this comment

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

LGTM. Issue with duplication has been fixed and code changes make sense to me. Thanks @rtibbles

@rtibbles rtibbles merged commit 127361b into learningequality:unstable Aug 30, 2024
13 checks passed
@rtibbles rtibbles deleted the searching_for_saves_in_all_the_wrong_places branch August 30, 2024 19:28
Copy link

sentry-io bot commented Sep 2, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ AttributeError: 'UUID' object has no attribute 'replace' /api/search/saved-search View Issue

Did you find this useful? React with a 👍 or 👎

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants