From cf1e4bf5e9ab9b07ef9e7a688d29b9daca1fbdf0 Mon Sep 17 00:00:00 2001 From: Artem Babak Date: Thu, 31 Dec 2020 13:35:41 +0200 Subject: [PATCH] Edges widgets do not remove if edges_enable: false --- ui-ngx/src/app/core/http/widget.service.ts | 7 ------- .../pages/dashboard/dashboard-widget-select.component.ts | 9 +-------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/ui-ngx/src/app/core/http/widget.service.ts b/ui-ngx/src/app/core/http/widget.service.ts index 4bf35ca011..4440d8a4a9 100644 --- a/ui-ngx/src/app/core/http/widget.service.ts +++ b/ui-ngx/src/app/core/http/widget.service.ts @@ -30,9 +30,6 @@ import { filter, map, mergeMap, tap } from 'rxjs/operators'; import { WidgetTypeId } from '@shared/models/id/widget-type-id'; import { NULL_UUID } from '@shared/models/id/has-uuid'; import { ActivationEnd, Router } from '@angular/router'; -import { getCurrentAuthState } from "@core/auth/auth.selectors"; -import { Store } from "@ngrx/store"; -import { AppState } from "@core/core.state"; @Injectable({ providedIn: 'root' @@ -53,7 +50,6 @@ export class WidgetService { private utils: UtilsService, private resources: ResourcesService, private translate: TranslateService, - private store: Store, private router: Router ) { this.router.events.pipe(filter(event => event instanceof ActivationEnd)).subscribe( @@ -125,9 +121,6 @@ export class WidgetService { config?: RequestConfig): Observable> { return this.getBundleWidgetTypes(bundleAlias, isSystem, config).pipe( map((types) => { - if (!getCurrentAuthState(this.store).edgesSupportEnabled) { - types = types.filter(type => type.alias !== 'edges_overview') - } types = types.sort((a, b) => { let result = widgetType[b.descriptor.type].localeCompare(widgetType[a.descriptor.type]); if (result === 0) { diff --git a/ui-ngx/src/app/modules/home/pages/dashboard/dashboard-widget-select.component.ts b/ui-ngx/src/app/modules/home/pages/dashboard/dashboard-widget-select.component.ts index 438bd905df..0c90a9bdda 100644 --- a/ui-ngx/src/app/modules/home/pages/dashboard/dashboard-widget-select.component.ts +++ b/ui-ngx/src/app/modules/home/pages/dashboard/dashboard-widget-select.component.ts @@ -22,9 +22,6 @@ import { WidgetService } from '@core/http/widget.service'; import { Widget, widgetType } from '@shared/models/widget.models'; import { toWidgetInfo } from '@home/models/widget-component.models'; import { DashboardCallbacks } from '../../models/dashboard-component.models'; -import { getCurrentAuthState } from "@core/auth/auth.selectors"; -import { Store } from "@ngrx/store"; -import { AppState } from "@core/core.state"; @Component({ selector: 'tb-dashboard-widget-select', @@ -52,8 +49,7 @@ export class DashboardWidgetSelectComponent implements OnInit, OnChanges { onWidgetClicked: this.onWidgetClicked.bind(this) }; - constructor(private widgetsService: WidgetService, - private store: Store) { + constructor(private widgetsService: WidgetService) { } ngOnInit(): void { @@ -116,9 +112,6 @@ export class DashboardWidgetSelectComponent implements OnInit, OnChanges { this.staticWidgetTypes.push(widget); break; } - if (!getCurrentAuthState(this.store).edgesSupportEnabled) { - this.staticWidgetTypes = this.staticWidgetTypes.filter(type => type.typeAlias !== 'edges_instances_overview') - } top += widget.sizeY; }); }