Bastien Dewerse
05/14/2024, 8:11 AMBastien Dewerse
05/14/2024, 8:13 AM<Dashboard
backend={backend}
config={GoodDataDashboardConfig}
dashboard={dashboardId}
workspace={workspaceId}
TitleComponent={() => null}
filterContextRef={filterContextRef}
/>
Moises Morales
05/14/2024, 9:46 AMBastien Dewerse
05/14/2024, 9:57 AMBastien Dewerse
05/14/2024, 9:59 AMBastien Dewerse
05/14/2024, 10:02 AMMoises Morales
05/20/2024, 7:32 AMBoris
05/20/2024, 8:26 AMBastien Dewerse
05/22/2024, 10:56 AM<Dashboard
backend={backend}
config={GoodDataDashboardConfig}
dashboard={dashboardId}
workspace={workspaceId}
TitleComponent={() => null}
filterContextRef={{
identifier: filterContextId,
}}
/>
The filterContext is generated higher in the flow through a backend:
const { entities } = await GoodDataSdk();
const data = new FilterContext(type, filterId, values);
return entities.createEntityFilterContexts({
workspaceId,
jsonApiFilterContextPostOptionalIdDocument: {
data,
},
});
And our helper class for the filterContext data looks like this:
export class FilterContext implements JsonApiFilterContextPostOptionalId {
id: string;
type: "filterContext";
attributes: JsonApiFilterContextOutAttributes;
constructor(filterType: "stores", filterId: string, uris: string[]) {
this.id = filterId;
this.type = "filterContext";
switch (filterType) {
case "stores":
this.attributes = {
content: {
filters: [
{
attributeFilter: {
attributeElements: {
uris,
},
displayForm: {
identifier: {
id: "stores.name",
type: "label",
},
},
localIdentifier: `${filterType}-filter`,
},
},
],
version: "2",
},
};
break;
}
}
}
Boris
05/22/2024, 11:21 AMBastien Dewerse
05/22/2024, 12:19 PMBoris
05/22/2024, 12:35 PMBastien Dewerse
05/22/2024, 12:38 PMBoris
05/23/2024, 9:27 AMJan Kos
06/04/2024, 2:00 PMBastien Dewerse
06/05/2024, 7:18 AM