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

Add element for subset of data to info panel #2610

Open
3 tasks done
mtrezza opened this issue Oct 12, 2024 · 4 comments · May be fixed by #2622
Open
3 tasks done

Add element for subset of data to info panel #2610

mtrezza opened this issue Oct 12, 2024 · 4 comments · May be fixed by #2622
Labels
bounty:$100 Bounty applies for fixing this issue (Parse Bounty Program) type:feature New feature or improvement of existing feature

Comments

@mtrezza
Copy link
Member

mtrezza commented Oct 12, 2024

New Feature / Enhancement Checklist

Current Limitation

The info panel added in #2495 displays data based on the row selected in the data browser. It's not possible to display only a subset of information. This has the disadvantage that the called Cloud Function needs to process and return all data, even if only a subset is needed.

Feature / Enhancement Description

Add a new info panel element that allows to load subsets of data on-demand. An element that is initially collapsed and can be expanded on click. When expanded, it loads the subset of data. That allows to remove unnecessary workload on the server if that subset of data is not needed, and only load the data if needed.

  • This should allow to nest subsets of data that can be loaded on demand. The Cloud Code function response of the subset can contain another subset element that allows to load another Cloud Code function on demand.
  • A loading indicator should be displayed then the user clicks to expand the subset while its data is loading.
  • Each subset requires a refresh button to reload the data.

Example Use Case

  1. A click on an object in _User shows the info panel with:
    • The number of purchases a user has made.
    • A collapsed element "Purchase History".
  2. The user expands the "Purchase History" subset to load the purchase history on demand.

Dashboard options:

"apps": [
  {
    "infoPanel": [
      {
        "title": "User Details",
        "classes": ["_User"],
        "cloudCodeFunction": "getUserDetails",
      }
    ]
  }
]

The response of the Cloud Function:

{
  "panel": {
    "segments": [
      {
        "title": "User Details",
        "items": [
          {
            "type": "keyValue",
            "key": "Number of purchases",
            "value": "3"
          },
          {
            // A nested, expandable sub-panel that loads data on-demand
            "type": "panel",
            "title": "Purchase History",
            "cloudCodeFunction": "getUserPurchaseHistory"
          }
        ]
      }
    ]
  }
}

When expanding the sub-panel "Purchase History" the Cloud Code function getUserPurchaseHistory returns:

{
  "panel": {
    "segments": [
      {
        "title": "Purchase History",
        "items": [
          {
            "type": "keyValue",
            "key": "Purchase #1 value",
            "value": "1 USD"
          },
          {
            "type": "keyValue",
            "key": "Purchase #2 value",
            "value": "2 USD"
          },
          {
            "type": "keyValue",
            "key": "Purchase #3 value",
            "value": "3 USD"
          }
        ]
      }
    ]
  }
}

Visually, nested data should be displayed indented to indicate the hierarchy of the data. This is especially important in case of deeper nesting, where subsets are nested within subsets.

Returning the subset also in form of a panel payload has several benefits:

  • modular use; same response can be used as main-panel or sub-panel
  • no introduction of new payload syntax
  • panel syntax allows to add metadata on the root level for future features, compared to a response of only segments or elements

Alternatives / Workarounds

Load all data which consumes resources unnecessarily if subsets of data are not needed.

Copy link

parse-github-assistant bot commented Oct 12, 2024

Thanks for opening this issue!

  • 🎉 We are excited about your ideas for improvement!

@mtrezza mtrezza changed the title Add multi-function data panel Add element for subset of data to info panel Oct 12, 2024
@mtrezza mtrezza added type:feature New feature or improvement of existing feature bounty:$100 Bounty applies for fixing this issue (Parse Bounty Program) labels Oct 12, 2024
@vardhan0604
Copy link
Contributor

Hi @mtrezza, if this issue is available, I’d love to work on it!

@mtrezza
Copy link
Member Author

mtrezza commented Oct 21, 2024

Great; please go ahead!

@vardhan0604
Copy link
Contributor

Sure Manuel!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bounty:$100 Bounty applies for fixing this issue (Parse Bounty Program) type:feature New feature or improvement of existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants