use of com.epam.ta.reportportal.core.widget.content.loader.materialized.handler.MaterializedWidgetStateHandler.VIEW_NAME in project service-api by reportportal.
the class HealthCheckTableReadyContentLoader method getParams.
private HealthCheckTableGetParams getParams(WidgetOptions widgetOptions, List<String> attributeValues) {
List<String> attributeKeys = WidgetOptionUtil.getListByKey(ATTRIBUTE_KEYS, widgetOptions);
int currentLevel = attributeValues.size();
BusinessRule.expect(attributeKeys, keys -> keys.size() > currentLevel).verify(ErrorType.UNABLE_LOAD_WIDGET_CONTENT, "Incorrect level definition");
String viewName = ofNullable(WidgetOptionUtil.getValueByKey(VIEW_NAME, widgetOptions)).orElseThrow(() -> new ReportPortalException(ErrorType.UNABLE_LOAD_WIDGET_CONTENT, "Widget view name not provided"));
String currentLevelKey = attributeKeys.get(currentLevel);
boolean includeCustomColumn = ofNullable(WidgetOptionUtil.getValueByKey(CUSTOM_COLUMN, widgetOptions)).isPresent();
return HealthCheckTableGetParams.of(viewName, currentLevelKey, resolveSort(widgetOptions), includeCustomColumn, getLevelEntries(attributeKeys, attributeValues));
}
Aggregations