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

Force option for either Basic or Advanced Query Builder #632

Open
12 tasks done
edwinmp opened this issue Feb 14, 2022 · 3 comments
Open
12 tasks done

Force option for either Basic or Advanced Query Builder #632

edwinmp opened this issue Feb 14, 2022 · 3 comments
Assignees
Labels

Comments

@edwinmp
Copy link
Collaborator

edwinmp commented Feb 14, 2022

Currently, under the Query Builder sidebar item we have 2 options: Basic Query Builder and Advanced Query Builder. The Basic Query Builder is soon to be deprecated (not sure when), but before that happens, we have to drive up the usage of it's replacement. Simply asking people to use the Advanced QB hasn't yielded results, so we're going to force the choice.

  • Remove the multiple option dropdown for the Query Builder and simply have the Query Builder item.
  • On clicking Query Builder, show a modal that offers the option Basic or Advanced with the Advanced selected by default.
  • For each option selected in the modal above, show some info about each one (to be decided later - just show a description that makes sense for now)
  • Naturally, depending on the selected option, you get redirected to the matching QB

To not make things difficult for our users, we're going to need to give them the option to choose a default QB i.e. a remember my choice kind of thing.

  • Add a preference app & in its models.py file, add a Preference model that inherits from BaseEntity
  • Add the field preferences to the Preference model, a JSONField - give it the default value (from a variable) {"queryBuilder": "advanced"}
  • Add the field global to the Preference model - a boolean field - give it a default value False - this naturally separates global preferences from user preferences. Make sure that in the Django admin, we can filter Preferences by this global field
  • Create an API endpoint for retrieving a user's preferences. Return both the global & user preferences (if any - default {}) - return object in format { global: {}, user: {} }
  • On the same view for retrieving, add one for updating preferences - naturally takes in a JSON object of the update preferences
  • On the FE, fetch these preferences on user login and save them in the local storage
  • When user clicks on Query Builder, check user preferences for preferred query builder - if none, show them the choice modal
  • Add a checkbox in the choice modal for Remember my choice - when checked, update user preferences with the selected option i.e basic or advanced
@edwinmp edwinmp changed the title Force option for either default or Advanced Query Builder Force option for either Basic or Advanced Query Builder Feb 14, 2022
@pauline-n pauline-n self-assigned this Feb 20, 2022
@k8hughes
Copy link
Collaborator

@pauline-n can you update the ticket with some details about where you have got to and how long you think it will be before we can release

@pauline-n
Copy link
Collaborator

Hi @k8hughes yes please I can. So far;

Under the Query Builder in the sidebar item, when clicked you get a page with a modal showing two options to choose from, with Advanced Query Builder showing by default.
Below is a picture showing how that is appearing:
Screenshot 2022-04-11 at 13 03 34
In the backend, a 'preference' app has been created to enable one save their choice plus update their choice incase they try changing to another option.

I am currently under review and the two last items i.e;

  • When user clicks on Query Builder, check user preferences for preferred query builder - if none, show them the choice modal
  • Add a checkbox in the choice modal for Remember my choice - when checked, update user preferences with the selected option i.e basic or advanced

are what am left to ensure they work well. I think this should be ready before this week ends.

@stale
Copy link

stale bot commented Jun 11, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Jun 11, 2022
@edwinmp edwinmp added the pinned label Jun 14, 2022
@stale stale bot removed the wontfix This will not be worked on label Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants