Remove UI widgetBundles filter if Edge if disabled

This commit is contained in:
Artem Babak 2021-06-03 17:59:12 +03:00
parent 50127b8cc7
commit 633131574a

View File

@ -121,14 +121,7 @@ export class WidgetsBundlesTableConfigResolver implements Resolve<EntityTableCon
this.config.entitySelectionEnabled = (widgetsBundle) => this.isWidgetsBundleEditable(widgetsBundle, authUser.authority);
this.config.detailsReadonly = (widgetsBundle) => !this.isWidgetsBundleEditable(widgetsBundle, authUser.authority);
const authState = getCurrentAuthState(this.store);
this.config.entitiesFetchFunction = pageLink => this.widgetsService.getWidgetBundles(pageLink).pipe(
map((widgetBundles) => {
if (!authState.edgesSupportEnabled) {
widgetBundles.data = widgetBundles.data.filter(widgetBundle => widgetBundle.alias !== 'edge_widgets');
}
return widgetBundles;
})
);
this.config.entitiesFetchFunction = pageLink => this.widgetsService.getWidgetBundles(pageLink);
return this.config;
}