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

Embed: Add ability to navigate a project's dashboards #4367

Merged
merged 8 commits into from
Mar 19, 2024

Conversation

ericpgreen2
Copy link
Contributor

Closes: https://github.com/rilldata/rill-private-issues/issues/211

The following examples show various requests to the GetIFrameURL API described in the docs.

To embed a single dashboard:

const response = await fetch(`https://admin.rilldata.com/v1/organizations/${rillOrg}/projects/${rillProject}/iframe`, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: `Bearer ${rillServiceToken}`,
  },
  body: JSON.stringify({
    // simply provide a resource
    resource: 'dashboardName'
  }),
});

To embed a dashboard and enable navigation between dashboards:

const response = await fetch(`https://admin.rilldata.com/v1/organizations/${rillOrg}/projects/${rillProject}/iframe`, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: `Bearer ${rillServiceToken}`,
  },
  body: JSON.stringify({
    // enable navigation and provide a resource
    navigation: true,
    resource: 'dashboardName'
  }),
});

To embed the dashboard list, which enables navigation to any of the project's dashboards:

const response = await fetch(`https://admin.rilldata.com/v1/organizations/${rillOrg}/projects/${rillProject}/iframe`, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: `Bearer ${rillServiceToken}`,
  },
  body: JSON.stringify({
    // enable navigation and do not provide a resource
    navigation: true
  }),
});

@ericpgreen2 ericpgreen2 added blocker A release blocker issue that should be resolved before a new release patch labels Mar 18, 2024
@ericpgreen2 ericpgreen2 self-assigned this Mar 18, 2024
@AdityaHegde AdityaHegde merged commit eb534fd into main Mar 19, 2024
6 checks passed
@AdityaHegde AdityaHegde deleted the embed-dashboard-list branch March 19, 2024 06:55
nishantmonu51 pushed a commit that referenced this pull request Mar 19, 2024
* Refactor `/-/embed` to handle different resource kinds

* Delete unused component

* Add `click-row` event to Table component

* Edit `GetIFrame` handler to allow `navigation` and/or `resource` params

* Refactor `DashboardsTable` to account for embedded context

* Refactor `LastRefreshedDate` to account for embedded context

* Add navigation to `/-/embed`

* Fix lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker A release blocker issue that should be resolved before a new release patch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants