Need
When updating the configured filters and columns of an explorer app config, the filters and columns can easily get out of sync. We need to make it easier to keep these items in sync.
Approach
The columns are configured in the various dev/index/entityConfig.tx files such as https://github.com/clevercanary/data-browser/blob/1e80477e5e975a06b5784f162263d6de602ce538/explorer/site-config/anvil-cmg/dev/index/datasetsEntityConfig.ts
The filters are configured in the category configs sections.
For the anvil-cmg project, let's make a filter-category-keys.ts similar to the one here but configured for the anvil-cmg categories.
Let's then use the key in both the entityConfig files for the sortKey like:
{
componentConfig: {
component: Components.NTagCell,
viewBuilder: ViewBuilder.buildStudyDesigns,
} as ComponentConfig<typeof Components.NTagCell>,
header: "Study Design",
sort: {
sortKey: ANVIL_CATALOG_FILTER_CATEGORY_KEYS.STUDY_DESIGN,
},
width: { max: "1fr", min: "120px" },
},
and for the category configs like:
categoryConfigs: [
{
key: ANVIL_CATALOG_FILTER_CATEGORY_KEYS.CONSENT_CODE,
label: "Consent Code",
},
Need
When updating the configured filters and columns of an explorer app config, the filters and columns can easily get out of sync. We need to make it easier to keep these items in sync.
Approach
The columns are configured in the various dev/index/entityConfig.tx files such as https://github.com/clevercanary/data-browser/blob/1e80477e5e975a06b5784f162263d6de602ce538/explorer/site-config/anvil-cmg/dev/index/datasetsEntityConfig.ts
The filters are configured in the category configs sections.
For the anvil-cmg project, let's make a filter-category-keys.ts similar to the one here but configured for the anvil-cmg categories.
Let's then use the key in both the entityConfig files for the
sortKeylike:and for the category configs like: