Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions packages/extension-sdk/src/connect/tile/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/

import type { MouseEvent } from 'react'
import type { IQuery } from '@looker/sdk'

/**
* Callback that is invoked when a change in the host happens
Expand Down Expand Up @@ -69,7 +70,7 @@ export interface TileHostData {
* cross filtering applied to the dashboard. Filters and cross filters
* will need to be applied and a new query generated in order to reflect
* the data shown in the QueryResponse. As such the queryId may not be
* that useful.
* that useful. See filteredQuery for query object with filters applied.
*/
queryId?: string
/**
Expand All @@ -82,7 +83,7 @@ export interface TileHostData {
* cross filtering applied to the dashboard. Filters and cross filters
* will need to be applied and a new query generated in order to reflect
* the data shown in the QueryResponse. As such the queryId may not be
* that useful.
* that useful. See filteredQuery for query object with filters applied.
*/
querySlug?: string
/**
Expand Down Expand Up @@ -112,6 +113,12 @@ export interface TileHostData {
* is being configured as an explore this will not be populated.
*/
isDashboardCrossFilteringEnabled?: boolean
/**
* A query object that matches the query ID associated with the
* underlying dashboard element with any dashboard filters and
* timezone changes made at the dashboard level applied.
*/
filteredQuery?: IQuery
/**
* The id of the tile extension element that triggered the last
* dashboard run. The id will be undefined if the dashboard run
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export const TileHostData: React.FC = () => {
lastRunEndTime,
lastRunSuccess,
lastRunSourceElementId,
filteredQuery,
} = tileHostData

const dashboardIdMessage = `Dashboard id is "${
Expand Down Expand Up @@ -101,6 +102,10 @@ export const TileHostData: React.FC = () => {
.map(([key, value]) => `${key}=${value}`)
.join(', ')

const filteredQueryMessage = filteredQuery
? `Filtered query: ${JSON.stringify(filteredQuery, null, 1)}`
: 'No filtered query available.'

return (
<Card>
<CardContent>
Expand All @@ -121,6 +126,7 @@ export const TileHostData: React.FC = () => {
? `Dashboard filters are ${filtersArray}`
: 'Dashboard has no filters'}
</Paragraph>
<Paragraph>{filteredQueryMessage}</Paragraph>
</>
)}
</SpaceVertical>
Expand Down