Currently we maintain the options and the valid combinations for view, groupBy and visualization in the report config service. Central piece of this service are the objects that contain the options for views, groupby and visualization.
However, they are very complex because they contain the labels, payload and information about valid combinations in one object.
I suggest that we split this up into two objects, one that contains a list of options with their label and payload and one object that contains the information which combination of these options are valid as a lookup table.
This simplifies the ReportDropdown component and is a first step to using the new Select components in the Report builder.
Her is some incomplete code mockup how this could look like:
const view = [ {label: 'Raw Data', key: 'rawData', data: {entity: 'raw', property: 'none'}}, {label: 'Process Instance', options: ['ProcessInstance:Frequency', 'ProcessInstance:Duration']} ]; const groupBy = [ {label: 'None', key: 'none', data: {entity: 'raw', property: 'none'}}, {label: 'StartDate', options: [{key: 'startDate_month', label: 'Month', data: {}}]} ]; const lookupTable = { rawData: { none: ['table'], startDate_month: [], startDate_day: [], startDate_week: [], variable: [] } }