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 data panel to display object related data fetched via Cloud Function #2584

Merged
merged 46 commits into from
Oct 6, 2024

Conversation

vardhan0604
Copy link
Contributor

@vardhan0604 vardhan0604 commented Jul 28, 2024

New Pull Request Checklist

Issue Description

fixes #2495

Approach

TODOs before merging

  • Add tests
  • Add changes to documentation (guides, repository pages, in-code descriptions)

Copy link

parse-github-assistant bot commented Jul 28, 2024

Thanks for opening this pull request!

  • ❌ Please link an issue that describes the reason for this pull request, otherwise your pull request will be closed. Make sure to write it as Closes: #123 in the PR description, so I can recognize it.

Copy link

uffizzi-cloud bot commented Jul 28, 2024

Uffizzi Ephemeral Environment deployment-54723

⌚ Updated Jul 28, 2024, 13:26 UTC

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

📄 View Application Logs etc.

What is Uffizzi? Learn more

@vardhan0604 vardhan0604 changed the title Add data aggregation panel #2495 Add data aggregation panel Jul 28, 2024
@mtrezza mtrezza changed the title Add data aggregation panel feat: Add data aggregation panel Jul 28, 2024
@mtrezza mtrezza changed the title feat: Add data aggregation panel feat: Add data aggregation panel to display object related information Jul 28, 2024
@mtrezza mtrezza changed the title feat: Add data aggregation panel to display object related information feat: Add data panel to display object related information fetched via Cloud Function Jul 28, 2024
@mtrezza mtrezza changed the title feat: Add data panel to display object related information fetched via Cloud Function feat: Add data panel to display object related data fetched via Cloud Function Jul 28, 2024
@vardhan0604
Copy link
Contributor Author

@mtrezza can you please review it?

@mtrezza
Copy link
Member

mtrezza commented Aug 11, 2024

I tried to review it, but couldn't get it to work. Could you please post the parse-dashboard-config.json file and a video of how you get the panel to show?

I tried with this:

{
  "apps": [
    {
      "serverURL": "http://localhost:1337/parse",
      "appId": "hello",
      "masterKey": "world",
      "appName": "",
      "iconName": "",
      "primaryBackgroundColor": "",
      "secondaryBackgroundColor": "",
      "infoPanel": [
        {
          "title": "User Details",
          "classes": ["_User"],
          "cloudCodeFunction": "getUserDetails"
        }
      ]
    }
  ],
  "iconsFolder": "icons"
}

@vardhan0604
Copy link
Contributor Author

Hey @mtrezza , this is my parse-dashboard-config.json

{
  "apps": [
    {
      "serverURL": "http://localhost:1337/parse",
      "appId": "1234",
      "masterKey": "12345",
      "appName": "MyApp",
      "infoPanel": [
        {
          "title": "User Details",
          "classes": ["_User"],
          "cloudCodeFunction": "user"
        },
        {
          "title": "Purchase Details",
          "classes": ["Purchase"],
          "cloudCodeFunction": "purchase"
        }
      ]
    }
  ]
}

Its working on my laptop , if any class has a cludfucntion defined for it in the config , we will get the show panel button otherwise there is not show panel button

this is the video of the feature working

screen-capture.3.webm

@404-html
Copy link
Member

I love this feature! I think we can also close #2002 when this gets merged.

Copy link
Member

@404-html 404-html left a comment

Choose a reason for hiding this comment

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

Overall - impressive! 👏👏👏👏

package.json Outdated Show resolved Hide resolved
src/components/AggregationPanel/AggregationPanel.js Outdated Show resolved Hide resolved
src/components/AggregationPanel/AggregationPanel.js Outdated Show resolved Hide resolved
src/components/BrowserCell/BrowserCell.react.js Outdated Show resolved Hide resolved
src/dashboard/Data/Browser/Browser.react.js Outdated Show resolved Hide resolved
src/dashboard/Data/Browser/BrowserTable.react.js Outdated Show resolved Hide resolved
src/dashboard/Data/Browser/BrowserTable.react.js Outdated Show resolved Hide resolved
src/dashboard/Data/Browser/BrowserTable.react.js Outdated Show resolved Hide resolved
@mtrezza mtrezza linked an issue Aug 15, 2024 that may be closed by this pull request
3 tasks
@vardhan0604
Copy link
Contributor Author

Looks great, the only bug I've found was that when clicking a column headline and the object list reorders, the same object line with a different object is selected, and the panel shows data for the previously selected object.

  1. Show panel & select obj A
  2. Click on a header column to reorder objects --> a different obj B will be auto-selected
  3. Panel does not update data but shows data of obj A

I think if we can get this last thing fixed, then let's merge this.

@mtrezza I have fixed what you ask , can you check and lemme know is this how you wanted it to be?

@vardhan0604
Copy link
Contributor Author

@mtrezza, could you let me know whether we should remove the selectedCell after reordering, or should we call the cloud function for a new objectId?

@mtrezza
Copy link
Member

mtrezza commented Oct 5, 2024

Whatever makes more sense in your opinion. I see the fact that the cell stays selected after reordering a bit skeptical, if not even misleading. So maybe I would remove the cell selection after reordering if you think that makes more sense.

@vardhan0604
Copy link
Contributor Author

Whatever makes more sense in your opinion. I see the fact that the cell stays selected after reordering a bit skeptical, if not even misleading. So maybe I would remove the cell selection after reordering if you think that makes more sense.

I felt the same, so I have removed the selection after reordering. I’ve pushed the changes. Could you please check them?

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.

Great job! Thanks for taking this hefty feature on and your patience during the revisions and feedback. And thanks @404-html for testing this out and your feedback. Happy to merge this.

@mtrezza mtrezza merged commit 914cc71 into parse-community:alpha Oct 6, 2024
9 checks passed
parseplatformorg pushed a commit that referenced this pull request Oct 6, 2024
# [6.0.0-alpha.14](6.0.0-alpha.13...6.0.0-alpha.14) (2024-10-06)

### Features

* Add data panel to display object related data fetched via Cloud Function ([#2584](#2584)) ([914cc71](914cc71))
@mtrezza
Copy link
Member

mtrezza commented Oct 6, 2024

And just as I've merged this, I noticed that we totally forgot the documentation... adding via #2601.

@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 6.0.0-alpha.14

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Oct 6, 2024
parseplatformorg pushed a commit that referenced this pull request Oct 7, 2024
# [6.0.0-beta.2](6.0.0-beta.1...6.0.0-beta.2) (2024-10-07)

### Bug Fixes

* Crash after setting filter using context menu and opening filters panel ([#2579](#2579)) ([5a690eb](5a690eb))
* Dashboard not building for Docker platform arm64/v8 ([#2534](#2534)) ([8c4a862](8c4a862))
* Descriptive statistics for number cells in data browser not showing ([#2581](#2581)) ([e146b6f](e146b6f))
* Filter string is erased when changing filter condition ([#2586](#2586)) ([6fa2c8c](6fa2c8c))
* Internal classes `_User`, `_Role`, `_Installation` referenced with pointer don't appear in data browser filter dialog ([#2599](#2599)) ([8239cc8](8239cc8))

### Features

* Add Cloud Config change history to roll back to previous values ([#2554](#2554)) ([a784129](a784129))
* Add data panel to display object related data fetched via Cloud Function ([#2584](#2584)) ([914cc71](914cc71))
* Add optional restriction of script execution to certain object fields and values ([#2488](#2488)) ([8feac9b](8feac9b))
* Add relational filter conditions in data browser ([#2576](#2576)) ([aa5c68d](aa5c68d))
* Add support for Node 22 ([#2603](#2603)) ([3689106](3689106))
@parseplatformorg
Copy link
Contributor

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

@parseplatformorg parseplatformorg added the state:released-beta Released as beta version label Oct 7, 2024
parseplatformorg pushed a commit that referenced this pull request Oct 7, 2024
# [6.0.0](5.4.0...6.0.0) (2024-10-07)

### Bug Fixes

* App metrics for user and installation counts show dash ([#2528](#2528)) ([850d7b3](850d7b3))
* Class Level Permissions dialog throws error `TypeError: ce.current is null` for newly created class ([#2549](#2549)) ([27ed692](27ed692))
* Config page fails to load ([#2531](#2531)) ([d721b7c](d721b7c))
* Crash after setting filter using context menu and opening filters panel ([#2579](#2579)) ([5a690eb](5a690eb))
* Dashboard crashes if Parse Server Cloud Function script returns object ([#2516](#2516)) ([5de08f8](5de08f8))
* Dashboard not building for Docker platform arm64/v8 ([#2534](#2534)) ([8c4a862](8c4a862))
* Dashboard scrolls when selecting row in data browser ([#2559](#2559)) ([2aa54a5](2aa54a5))
* Data browser redirects to wrong class when changing app ([#2526](#2526)) ([7713f54](7713f54))
* Deleting all code in the JS Console editor fills in the default code ([#2558](#2558)) ([4b830ba](4b830ba))
* Descriptive statistics for number cells in data browser not showing ([#2581](#2581)) ([e146b6f](e146b6f))
* Filter string is erased when changing filter condition ([#2586](#2586)) ([6fa2c8c](6fa2c8c))
* Internal classes `_User`, `_Role`, `_Installation` referenced with pointer don't appear in data browser filter dialog ([#2599](#2599)) ([8239cc8](8239cc8))
* Open pointer in new tab in data browser not working when mount path is not root ([#2527](#2527)) ([2f4081f](2f4081f))

### Features

* Add Cloud Config change history to roll back to previous values ([#2554](#2554)) ([a784129](a784129))
* Add data panel to display object related data fetched via Cloud Function ([#2584](#2584)) ([914cc71](914cc71))
* Add descriptive statistics for number cells in data browser ([#2529](#2529)) ([ead9ec4](ead9ec4))
* Add filter `starts with` in data browser for fields of type Pointer ([#2553](#2553)) ([0b94ab6](0b94ab6))
* Add Node 20 support; remove Node 14, 16 support ([#2532](#2532)) ([578a339](578a339))
* Add Node 20 support; remove Node 14, 16 support ([#2535](#2535)) ([5c90f2d](5c90f2d))
* Add optional restriction of script execution to certain object fields and values ([#2488](#2488)) ([8feac9b](8feac9b))
* Add relational filter conditions in data browser ([#2576](#2576)) ([aa5c68d](aa5c68d))
* Add support for Node 22 ([#2603](#2603)) ([3689106](3689106))
* Execute script for selected rows ([#2508](#2508)) ([5d9901e](5d9901e))
* Select rows in data browser by clicking and dragging mouse cursor over checkboxes ([#2548](#2548)) ([792ba9e](792ba9e))

### BREAKING CHANGES

* Removes support for Node 14 and 16 ([5c90f2d](5c90f2d))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 6.0.0

@vardhan0604
Copy link
Contributor Author

Thank you so much @mtrezza @404-html ! It was a great experience working on this feature, and I really enjoyed the process. I learned a lot along the way and appreciate all the feedback and support. Looking forward to contributing more in the future!

@parseplatformorg parseplatformorg added the state:released Released as stable version label Oct 7, 2024
beiguancyc pushed a commit to beiguancyc/parse-dashboard that referenced this pull request Oct 8, 2024
* source: (70 commits)
  chore(release): 6.0.0 [skip ci]
  empty
  chore(release): 6.0.0-beta.2 [skip ci]
  empty
  chore(release): 6.0.0-alpha.16 [skip ci]
  fix: Dashboard not building for Docker platform arm64/v8 (parse-community#2534)
  refactor: Security upgrade node from 20.14.0-alpine3.20 to 20.17.0-alpine3.20 (parse-community#2593)
  chore(release): 6.0.0-alpha.15 [skip ci]
  feat: Add support for Node 22 (parse-community#2603)
  docs: Add info panel docs to README (parse-community#2601)
  chore(release): 6.0.0-alpha.14 [skip ci]
  feat: Add data panel to display object related data fetched via Cloud Function (parse-community#2584)
  chore(release): 6.0.0-alpha.13 [skip ci]
  fix: Internal classes `_User`, `_Role`, `_Installation` referenced with pointer don't appear in data browser filter dialog (parse-community#2599)
  refactor: Bump qs from 6.5.2 to 6.13.0 (parse-community#2595)
  refactor: Fix for 4 vulnerabilities (parse-community#2594)
  refactor: Bump webpack from 5.75.0 to 5.94.0 (parse-community#2588)
  chore(release): 6.0.0-alpha.12 [skip ci]
  fix: Filter string is erased when changing filter condition (parse-community#2586)
  refactor: Bump requirejs from 2.3.6 to 2.3.7 (parse-community#2582)
  ...

# Conflicts:
#	package-lock.json
@pastordee
Copy link

Hey @mtrezza , this is my parse-dashboard-config.json

{
  "apps": [
    {
      "serverURL": "http://localhost:1337/parse",
      "appId": "1234",
      "masterKey": "12345",
      "appName": "MyApp",
      "infoPanel": [
        {
          "title": "User Details",
          "classes": ["_User"],
          "cloudCodeFunction": "user"
        },
        {
          "title": "Purchase Details",
          "classes": ["Purchase"],
          "cloudCodeFunction": "purchase"
        }
      ]
    }
  ]
}

Its working on my laptop , if any class has a cludfucntion defined for it in the config , we will get the show panel button otherwise there is not show panel button

this is the video of the feature working

screen-capture.3.webm

Hi can we get an example of the cludfucntion code

@mtrezza
Copy link
Member

mtrezza commented Oct 9, 2024

It's pretty straightforward, you just create a Cloud Function that returns the JSON, according to the docs.

@chadpav
Copy link

chadpav commented Oct 14, 2024

I just updated to 6.0 and wanted to check out this new panel feature. I have added it to my config but I never see the Show/Hide button in the upper-right corner as he shows in the video. Any way to troubleshoot it? I was able to get the scripts feature working in a similar way.

...
infoPanel: [
        {
          title: 'User Details',
          classes: ['_User'],
          cloudCodeFunction: 'getUserDetails',
        },
      ],
...

@pastordee
Copy link

Me too got the script working but not the info panel

@mtrezza
Copy link
Member

mtrezza commented Oct 14, 2024

This issue is likely related to the response object. If you experience any issues with the panel, please open a new issue and post your dashboard config and the full, unredacted response of the Cloud Function that is sent to the dashboard.

@404-html
Copy link
Member

I believe this happens when passing config to dashboard constructor (var dashboard = new ParseDashboard({...}) instead of using parse-dashboard-config.json file.
@chadpav @pastordee can you please confirm this is the case?

@pastordee
Copy link

Yes

@chadpav
Copy link

chadpav commented Oct 14, 2024

@404-html yes, I'm running the Dashboard as express middleware and passing config to the constructor. I'll open an issue so we can continue the conversation in the right place.

This feature (and scripts) are awesome, btw.

vardhan0604 pushed a commit to vardhan0604/parse-dashboard that referenced this pull request Oct 22, 2024
# [6.0.0-alpha.14](parse-community/parse-dashboard@6.0.0-alpha.13...6.0.0-alpha.14) (2024-10-06)

### Features

* Add data panel to display object related data fetched via Cloud Function ([parse-community#2584](parse-community#2584)) ([914cc71](parse-community@914cc71))
vardhan0604 pushed a commit to vardhan0604/parse-dashboard that referenced this pull request Oct 22, 2024
# [6.0.0-beta.2](parse-community/parse-dashboard@6.0.0-beta.1...6.0.0-beta.2) (2024-10-07)

### Bug Fixes

* Crash after setting filter using context menu and opening filters panel ([parse-community#2579](parse-community#2579)) ([5a690eb](parse-community@5a690eb))
* Dashboard not building for Docker platform arm64/v8 ([parse-community#2534](parse-community#2534)) ([8c4a862](parse-community@8c4a862))
* Descriptive statistics for number cells in data browser not showing ([parse-community#2581](parse-community#2581)) ([e146b6f](parse-community@e146b6f))
* Filter string is erased when changing filter condition ([parse-community#2586](parse-community#2586)) ([6fa2c8c](parse-community@6fa2c8c))
* Internal classes `_User`, `_Role`, `_Installation` referenced with pointer don't appear in data browser filter dialog ([parse-community#2599](parse-community#2599)) ([8239cc8](parse-community@8239cc8))

### Features

* Add Cloud Config change history to roll back to previous values ([parse-community#2554](parse-community#2554)) ([a784129](parse-community@a784129))
* Add data panel to display object related data fetched via Cloud Function ([parse-community#2584](parse-community#2584)) ([914cc71](parse-community@914cc71))
* Add optional restriction of script execution to certain object fields and values ([parse-community#2488](parse-community#2488)) ([8feac9b](parse-community@8feac9b))
* Add relational filter conditions in data browser ([parse-community#2576](parse-community#2576)) ([aa5c68d](parse-community@aa5c68d))
* Add support for Node 22 ([parse-community#2603](parse-community#2603)) ([3689106](parse-community@3689106))
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.

Add data aggregation panel Quick data preview on cell hover
6 participants