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

feat: Add filter views to save frequently used filters in data browser #2404

Merged
merged 17 commits into from
Jun 9, 2023

Conversation

dblythy
Copy link
Member

@dblythy dblythy commented Mar 11, 2023

New Pull Request Checklist

Issue Description

Adds ability to save filters

Closes: #2041

Approach

Saves predefined filters in localstorage with similar logic to ColumnPreferences, only under a new class ClassPreferences. This data might be used for future class specific features

TODOs before merging

  • Add tests

@parse-github-assistant
Copy link

I will reformat the title to use the proper commit message syntax.

@parse-github-assistant parse-github-assistant bot changed the title feat: create predefined filters feat: Create predefined filters Mar 11, 2023
@parse-github-assistant
Copy link

parse-github-assistant bot commented Mar 11, 2023

Thanks for opening this pull request!

  • 🎉 We are excited about your hands-on contribution!

@dblythy
Copy link
Member Author

dblythy commented Mar 11, 2023

Some of the changes are due to local version of the prettier - do we have a code linting / styler?

@mtrezza
Copy link
Member

mtrezza commented Mar 11, 2023

You mean whether we have a lint script to auto-correct ?

@dblythy
Copy link
Member Author

dblythy commented Mar 11, 2023

Yep 😊

@mtrezza
Copy link
Member

mtrezza commented Mar 11, 2023

It seems to be missing here, feel free to just throw it in with this PR, maybe same names as with Parse Server:

"lint": "flow && eslint --cache ./",
"lint-fix": "eslint --fix --cache ./",

@uffizzi-cloud
Copy link

uffizzi-cloud bot commented Mar 11, 2023

Uffizzi Ephemeral Environment deployment-18701

⌚ Updated Mar 11, 2023, 02:10 UTC

☁️ https://app.uffizzi.com/github.com/parse-community/parse-dashboard/pull/2404

📄 View Application Logs etc.

What is Uffizzi? Learn more

@dblythy
Copy link
Member Author

dblythy commented Mar 11, 2023

mov.mov

Demo of the PR, i'll try do some work around making sure the sidebar shows active on the filtered tab

@mtrezza
Copy link
Member

mtrezza commented Mar 11, 2023

This is interesting with Uffizzi, I think to preview this we'd have to deploy a config file and later remove it before merging the PR. That woudn't be ideal because we may forget to remove and release it.

@mtrezza mtrezza mentioned this pull request Mar 11, 2023
3 tasks
@dblythy
Copy link
Member Author

dblythy commented Mar 11, 2023

I think Ufuzzi will be fine for this because I've done all the filter saving in local storage (similar to how column preferences are managed)

src/lib/ClassPreferences.js Outdated Show resolved Hide resolved
src/lib/ClassPreferences.js Show resolved Hide resolved
Copy link
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

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

image

For the filter dialog, could you:

  • Move the "Save" button the very left? It's a button that is used the least (once to save, then not anymore).

image

For the save dialog, could you:

  • Remove buttons "Clear all", "Add filter", "Apply filter"
  • Rename "Confim" to "Save"
  • Add a "Cancel" or "Back" button on the left

src/components/BrowserFilter/BrowserFilter.react.js Outdated Show resolved Hide resolved
@mtrezza
Copy link
Member

mtrezza commented Mar 11, 2023

This PR seems to mix #2041 and #2403. #2403 (comment) may be important to consider here. We may need to find a way to differentiate between "saving a filter pattern" and "saving a filter view" in the UI.

Maybe a solution is to add a "more" button "..." to the very left that opens a dropdown where one can choose:

  • Download filter definition // to copy/paste into config file
  • Upload filter definition // same as loading a filter from config file, but allows to upload only the definition
  • Save filter view locally // to save locally, i.e. ephemeral storage as it does now

Instead of the Download filter definition and Upload filter definition a button to toggle between an editable raw JSON definition of the current filter setting could be an alternative. So one can toggle from the UI view to the JSON view and just copy the definition, or paste it, or just edit it. Not sure how difficult that would be to implement, but it would make the file up/download logic unnecessary.

@mtrezza
Copy link
Member

mtrezza commented Mar 11, 2023

I find this to be a good UI solution, much nicer than the arrow on the left

image

@mtrezza mtrezza changed the title feat: Create predefined filters feat: Add filter views Mar 11, 2023
@dblythy
Copy link
Member Author

dblythy commented Mar 12, 2023

Perhaps we can add a settings page that allows exporting of certain configurations to be defined later on Parse Dashboard? An example is the ColumnPreferences feature, it's quite difficult to extract that at the moment

dblythy and others added 4 commits March 12, 2023 11:39
Co-authored-by: Manuel <5673677+mtrezza@users.noreply.github.com>
Signed-off-by: Daniel <daniel-blyth@live.com.au>
@mtrezza
Copy link
Member

mtrezza commented Mar 12, 2023

I think that's an interesting idea. Could be a good workout until we find a concept for storing dashboard settings in the cloud.

@dblythy dblythy requested a review from a team March 29, 2023 02:15
Copy link
Member

@mtrezza mtrezza 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 text alignment issue - the longer the filter name, the further left the leading edge of the text:

image

Copy link
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

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

image

This PR also reveals a semantic issue - a filter condition is called "filter" as well. To fix this let's just simplify the buttons:

  • "Clear al" to "Clear"
  • "Add filter" to "Add"
  • "Save filters" to "Save"
  • "Apply filter" to "Apply"

It's a simple dialog and probably easy to infer what they mean.

Copy link
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

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

image

What should we call this filter?

@mtrezza
Copy link
Member

mtrezza commented May 27, 2023

Before we get more conflicts, @dblythy could you take a look and try to get this ready for merge?

Signed-off-by: Daniel <daniel-blyth@live.com.au>
@dblythy
Copy link
Member Author

dblythy commented Jun 9, 2023

Screenshot 2023-06-09 at 11 51 54 am

Screenshot 2023-06-09 at 12 37 13 pm

I've done some work making the highlight and selection of the filter cleaner:

Screenshot 2023-06-09 at 12 35 48 pm

@dblythy
Copy link
Member Author

dblythy commented Jun 9, 2023

Uffuzi hasn't updated to the latest commit, let's see if reopening helps...

@dblythy dblythy closed this Jun 9, 2023
@dblythy dblythy reopened this Jun 9, 2023
@dblythy dblythy requested a review from mtrezza June 9, 2023 03:06
@uffizzi-cloud
Copy link

uffizzi-cloud bot commented Jun 9, 2023

Uffizzi Ephemeral Environment deployment-28018

⌚ Updated Jun 09, 2023, 02:58 UTC

☁️ https://app.uffizzi.com/github.com/parse-community/parse-dashboard/pull/2404

📄 View Application Logs etc.

What is Uffizzi? Learn more

Copy link
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

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

Looks good, and works in preview env; what a fine feature!

@mtrezza mtrezza changed the title feat: Add filter views feat: Add filter views to save frequently used filters in data browser Jun 9, 2023
@mtrezza mtrezza merged commit a9ec3a9 into parse-community:alpha Jun 9, 2023
parseplatformorg pushed a commit that referenced this pull request Jun 9, 2023
# [5.2.0-alpha.12](5.2.0-alpha.11...5.2.0-alpha.12) (2023-06-09)

### Features

* Add filter views to save frequently used filters in data browser ([#2404](#2404)) ([a9ec3a9](a9ec3a9))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.2.0-alpha.12

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Jun 9, 2023
@dblythy dblythy deleted the filter-views branch June 9, 2023 12:56
parseplatformorg pushed a commit that referenced this pull request Jun 10, 2023
# [5.2.0-beta.2](5.2.0-beta.1...5.2.0-beta.2) (2023-06-10)

### Bug Fixes

* Back button in data browser disappears after page refresh ([#2421](#2421)) ([6c5f19f](6c5f19f))
* Cannot navigate to nested relation field in data browser ([#2420](#2420)) ([e7ace9e](e7ace9e))
* Dashboard crashes when adding a row with modal in a class that contains a pointer to another class that contains an array of pointers ([#2416](#2416)) ([286269f](286269f))
* Empty table in data browser when navigating back using the "back” button ([#2423](#2423)) ([6f3dab6](6f3dab6))
* File uploading status not updating in data browser ([#2422](#2422)) ([e761f97](e761f97))
* Hitting backspace key in data browser crashes dashboard ([#2456](#2456)) ([32aeea2](32aeea2))
* Incorrect date picker position in data browser filter dialog ([#2425](#2425)) ([b96b48f](b96b48f))
* Option missing for Parse Config parameter to require master key ([#2440](#2440)) ([6623369](6623369))
* Scroll position is preserved when re-opening the same class in data browser via navigation bar ([#2445](#2445)) ([667675c](667675c))
* Text input cursor jumps to first position when writing long text ([#2413](#2413)) ([422ffb2](422ffb2))

### Features

* Add export of saved data browser filters via `classPreference` settings ([#2455](#2455)) ([f56f946](f56f946))
* Add filter views to save frequently used filters in data browser ([#2404](#2404)) ([a9ec3a9](a9ec3a9))
* Add links to users and roles in ACL dialog and handle invalid entries ([#2436](#2436)) ([a20cb8e](a20cb8e))
* Add visual configurator for Parse Dashboard settings ([#2406](#2406)) ([228d839](228d839))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.2.0-beta.2

@parseplatformorg parseplatformorg added the state:released-beta Released as beta version label Jun 10, 2023
@mtrezza mtrezza mentioned this pull request Jun 11, 2023
3 tasks
parseplatformorg pushed a commit that referenced this pull request Sep 15, 2023
# [5.2.0](5.1.0...5.2.0) (2023-09-15)

### Bug Fixes

* Back button in data browser disappears after page refresh ([#2421](#2421)) ([6c5f19f](6c5f19f))
* Cannot navigate to nested relation field in data browser ([#2420](#2420)) ([e7ace9e](e7ace9e))
* Dashboard crashes when adding a row with modal in a class that contains a pointer to another class that contains an array of pointers ([#2416](#2416)) ([286269f](286269f))
* Empty table in data browser when navigating back using the "back” button ([#2423](#2423)) ([6f3dab6](6f3dab6))
* File uploading status not updating in data browser ([#2422](#2422)) ([e761f97](e761f97))
* Hitting backspace key in data browser crashes dashboard ([#2456](#2456)) ([32aeea2](32aeea2))
* Incorrect date picker position in data browser filter dialog ([#2425](#2425)) ([b96b48f](b96b48f))
* Option missing for Parse Config parameter to require master key ([#2440](#2440)) ([6623369](6623369))
* Scroll position is preserved when re-opening the same class in data browser via navigation bar ([#2445](#2445)) ([667675c](667675c))
* Text input cursor jumps to first position when writing long text ([#2413](#2413)) ([422ffb2](422ffb2))
* Uncaught error when editing Number field in Edit Row dialog ([#2401](#2401)) ([26bd6fa](26bd6fa))

### Features

* Add export of saved data browser filters via `classPreference` settings ([#2455](#2455)) ([f56f946](f56f946))
* Add filter views to save frequently used filters in data browser ([#2404](#2404)) ([a9ec3a9](a9ec3a9))
* Add links to users and roles in ACL dialog and handle invalid entries ([#2436](#2436)) ([a20cb8e](a20cb8e))
* Add visual configurator for Parse Dashboard settings ([#2406](#2406)) ([228d839](228d839))
* Data types and pointer classes are sorted alphabetically in dialog to add new column ([#2400](#2400)) ([d9d285b](d9d285b))
* Sort Cloud Code Jobs alphabetically ([#2402](#2402)) ([77fc372](77fc372))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.2.0

@parseplatformorg parseplatformorg added the state:released Released as stable version label Sep 15, 2023
beiguancyc pushed a commit to beiguancyc/parse-dashboard that referenced this pull request Sep 20, 2023
* release: (41 commits)
  chore(release): 5.2.0 [skip ci]
  release
  chore(release): 5.2.0-beta.2 [skip ci]
  empty commit
  chore(release): 5.2.0-alpha.14 [skip ci]
  fix: Hitting backspace key in data browser crashes dashboard (parse-community#2456)
  chore(release): 5.2.0-alpha.13 [skip ci]
  feat: Add export of saved data browser filters via `classPreference` settings (parse-community#2455)
  chore(release): 5.2.0-alpha.12 [skip ci]
  feat: Add filter views to save frequently used filters in data browser (parse-community#2404)
  chore(release): 5.2.0-alpha.11 [skip ci]
  fix: Scroll position is preserved when re-opening the same class in data browser via navigation bar (parse-community#2445)
  chore(release): 5.2.0-alpha.10 [skip ci]
  fix: Option missing for Parse Config parameter to require master key (parse-community#2440)
  chore(release): 5.2.0-alpha.9 [skip ci]
  fix: Dashboard crashes when adding a row with modal in a class that contains a pointer to another class that contains an array of pointers (parse-community#2416)
  chore(release): 5.2.0-alpha.8 [skip ci]
  fix: Cannot navigate to nested relation field in data browser (parse-community#2420)
  chore(release): 5.2.0-alpha.7 [skip ci]
  fix: File uploading status not updating in data browser (parse-community#2422)
  ...

# Conflicts:
#	package-lock.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released Released as stable version state:released-alpha Released as alpha version state:released-beta Released as beta version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom views with predefined filters
3 participants