diff --git a/ui-ngx/src/app/modules/home/components/widget/action/widget-action-dialog.component.ts b/ui-ngx/src/app/modules/home/components/widget/action/widget-action-dialog.component.ts index 66480c8218..b921c89c52 100644 --- a/ui-ngx/src/app/modules/home/components/widget/action/widget-action-dialog.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/action/widget-action-dialog.component.ts @@ -14,7 +14,7 @@ /// limitations under the License. /// -import { Component, Inject, OnDestroy, OnInit, SkipSelf, ViewChild } from '@angular/core'; +import { Component, DestroyRef, Inject, OnDestroy, OnInit, SkipSelf, ViewChild } from '@angular/core'; import { ErrorStateMatcher } from '@angular/material/core'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { Store } from '@ngrx/store'; @@ -28,7 +28,6 @@ import { ValidatorFn, Validators } from '@angular/forms'; -import { Subject } from 'rxjs'; import { Router } from '@angular/router'; import { DialogComponent } from '@app/shared/components/dialog.component'; import { @@ -48,12 +47,12 @@ import { widgetHeaderActionButtonTypeTranslationMap, widgetType } from '@shared/models/widget.models'; -import { takeUntil } from 'rxjs/operators'; import { CustomActionEditorCompleter } from '@home/components/widget/lib/settings/common/action/custom-action.models'; import { WidgetService } from '@core/http/widget.service'; import { isDefinedAndNotNull, isNotEmptyStr } from '@core/utils'; import { MatSelect } from '@angular/material/select'; import { TranslateService } from '@ngx-translate/core'; +import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; export interface WidgetActionDialogData { isAdd: boolean; @@ -72,8 +71,6 @@ export interface WidgetActionDialogData { export class WidgetActionDialogComponent extends DialogComponent implements OnInit, OnDestroy, ErrorStateMatcher { - private destroy$ = new Subject(); - widgetActionFormGroup: FormGroup; isAdd: boolean; @@ -103,7 +100,8 @@ export class WidgetActionDialogComponent extends DialogComponent, public fb: FormBuilder, - private translate: TranslateService) { + private translate: TranslateService, + private destroyRef: DestroyRef) { super(store, router, dialogRef); this.isAdd = data.isAdd; if (this.isAdd) { @@ -141,7 +139,7 @@ export class WidgetActionDialogComponent extends DialogComponent { this.widgetActionFormGroup.get('name').updateValueAndValidity(); this.updateShowWidgetActionForm(); @@ -153,12 +151,12 @@ export class WidgetActionDialogComponent extends DialogComponent { this.updateShowWidgetActionForm(); }); this.widgetActionFormGroup.get('buttonType').valueChanges.pipe( - takeUntil(this.destroy$) + takeUntilDestroyed(this.destroyRef) ).subscribe(() => this.widgetHeaderButtonValidators()); setTimeout(() => { if (this.action?.actionSourceId === 'cellClick') { @@ -172,8 +170,6 @@ export class WidgetActionDialogComponent extends DialogComponent -
- - @switch (action.buttonType) { - @case (widgetHeaderActionButtonType.icon) { - - } - @case (widgetHeaderActionButtonType.miniFab) { - - } - @case (widgetHeaderActionButtonType.basic) { - - } - @case (widgetHeaderActionButtonType.raised) { - - } - @case (widgetHeaderActionButtonType.stroked) { - - } - @case (widgetHeaderActionButtonType.flat) { - - } - } - +
+ @for (action of widget.customHeaderActions; track action.name; let last = $last) { + + }
+ + +@switch (action.buttonType) { + @case (widgetHeaderActionButtonType.icon) { + + } + @case (widgetHeaderActionButtonType.miniFab) { + + } + @case (widgetHeaderActionButtonType.basic) { + + } + @case (widgetHeaderActionButtonType.raised) { + + } + @case (widgetHeaderActionButtonType.stroked) { + + } + @case (widgetHeaderActionButtonType.flat) { + + } +} + diff --git a/ui-ngx/src/app/modules/home/components/widget/widget-container.component.scss b/ui-ngx/src/app/modules/home/components/widget/widget-container.component.scss index d763c11c9e..b246bc1662 100644 --- a/ui-ngx/src/app/modules/home/components/widget/widget-container.component.scss +++ b/ui-ngx/src/app/modules/home/components/widget/widget-container.component.scss @@ -86,8 +86,8 @@ div.tb-widget { flex-direction: row; place-content: center flex-start; align-items: center; - z-index: 19; - margin: 5px 0 5px; + z-index: 101; + margin: 5px 0 0; &-absolute { position: absolute;