Edges widgets do not remove if edges_enable: false

This commit is contained in:
Artem Babak 2020-12-31 13:35:41 +02:00
parent b649185e9e
commit cf1e4bf5e9
2 changed files with 1 additions and 15 deletions

View File

@ -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<AppState>,
private router: Router
) {
this.router.events.pipe(filter(event => event instanceof ActivationEnd)).subscribe(
@ -125,9 +121,6 @@ export class WidgetService {
config?: RequestConfig): Observable<Array<Widget>> {
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) {

View File

@ -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<AppState>) {
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;
});
}