looker-open-source/components

listens_to_filters not working in looker extension project

Closed this issue · 3 comments

am referred the filterdemo project based on that project am calling the dashboard api with input parameters as id, and dashboard_filters .. i can able to render the dashboard filters in the looker extension project but the listens_to_filters are not working..

simple example :- in my case i have 4 filters .. when the user change the country value based on that Geo market and Region should change but its not happened . am sharing the code snippets
looker API method to get the dashboard filters :- var filtersvalues = await extensionContext.coreSDK.ok(extensionContext.coreSDK.dashboard(id.toString(), 'dashboard_filters'));

render the dashboard filters:-


{sortedFilters.map(filter =>
filter.id ? (
<DashboardFilter
key={filter.id}
sdk={extensionContext?.coreSDK}
filter={filter}
onChange={getChangeHandler(filter.name)}
expression={filter?.name ? filterValues[filter?.name] : ''}
/>
) : null
)}

filters

Hi @SathishHP thank you for raising this issue and apologies for the delayed response. Unfortunately listens_to_filters functionality is not yet implemented in @looker/filter-components, but it is scheduled to be completed this quarter. I'll respond here when the feature is released.

would be great to see this fix! I've just encountered this issue too.

listens_to_filters is now supported in v0.10.22 with a new component FilterCollection. Using the above example, it would be updated to:

<FilterCollection>
    {
    sortedFilters.map((filter) =>
        filter.id ? (
        <DashboardFilter
            key={filter.id}
            sdk={extensionContext?.coreSDK}
            filter={filter}
            onChange={getChangeHandler(filter.name)}
            expression={filter?.name ? filterValues[filter?.name] : ""}
        />
        ) : null
    );
    }
</FilterCollection>