Resolved review comments
This commit is contained in:
parent
ca350601bb
commit
bdec59af0e
@ -28,13 +28,14 @@ import { MatButton } from '@angular/material/button';
|
|||||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||||
import { BehaviorSubject, of, shareReplay, timer } from 'rxjs';
|
import { BehaviorSubject, of, shareReplay, timer } from 'rxjs';
|
||||||
import { SECOND, MINUTE } from '@shared/models/time/time.models';
|
import { SECOND, MINUTE } from '@shared/models/time/time.models';
|
||||||
import { AdditionalDebugActionConfig, EntityDebugSettings } from '@shared/models/entity.models';
|
import { EntityDebugSettings } from '@shared/models/entity.models';
|
||||||
import { map, switchMap, takeWhile } from 'rxjs/operators';
|
import { map, switchMap, takeWhile } from 'rxjs/operators';
|
||||||
import { getCurrentAuthState } from '@core/auth/auth.selectors';
|
import { getCurrentAuthState } from '@core/auth/auth.selectors';
|
||||||
import { AppState } from '@core/core.state';
|
import { AppState } from '@core/core.state';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { ControlValueAccessor, FormBuilder, NG_VALUE_ACCESSOR } from '@angular/forms';
|
import { ControlValueAccessor, FormBuilder, NG_VALUE_ACCESSOR } from '@angular/forms';
|
||||||
import { EntityDebugSettingsService } from '@home/components/entity/debug/entity-debug-settings.service';
|
import { EntityDebugSettingsService } from '@home/components/entity/debug/entity-debug-settings.service';
|
||||||
|
import { AdditionalDebugActionConfig } from '@home/components/entity/debug/entity-debug-settings.model';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'tb-entity-debug-settings-button',
|
selector: 'tb-entity-debug-settings-button',
|
||||||
|
|||||||
@ -32,8 +32,9 @@ import { SECOND } from '@shared/models/time/time.models';
|
|||||||
import { DurationLeftPipe } from '@shared/pipe/duration-left.pipe';
|
import { DurationLeftPipe } from '@shared/pipe/duration-left.pipe';
|
||||||
import { of, shareReplay, timer } from 'rxjs';
|
import { of, shareReplay, timer } from 'rxjs';
|
||||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||||
import { AdditionalDebugActionConfig, EntityDebugSettings } from '@shared/models/entity.models';
|
import { EntityDebugSettings } from '@shared/models/entity.models';
|
||||||
import { distinctUntilChanged, map, startWith, switchMap, takeWhile } from 'rxjs/operators';
|
import { distinctUntilChanged, map, startWith, switchMap, takeWhile } from 'rxjs/operators';
|
||||||
|
import { AdditionalDebugActionConfig } from '@home/components/entity/debug/entity-debug-settings.model';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'tb-entity-debug-settings-panel',
|
selector: 'tb-entity-debug-settings-panel',
|
||||||
|
|||||||
@ -0,0 +1,33 @@
|
|||||||
|
///
|
||||||
|
/// Copyright © 2016-2025 The Thingsboard Authors
|
||||||
|
///
|
||||||
|
/// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
/// you may not use this file except in compliance with the License.
|
||||||
|
/// You may obtain a copy of the License at
|
||||||
|
///
|
||||||
|
/// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
///
|
||||||
|
/// Unless required by applicable law or agreed to in writing, software
|
||||||
|
/// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
/// See the License for the specific language governing permissions and
|
||||||
|
/// limitations under the License.
|
||||||
|
///
|
||||||
|
|
||||||
|
import { EntityDebugSettings } from '@shared/models/entity.models';
|
||||||
|
|
||||||
|
export interface AdditionalDebugActionConfig<Action = (...args: unknown[]) => void> {
|
||||||
|
action: Action;
|
||||||
|
title: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface EntityDebugSettingPanelConfig {
|
||||||
|
debugSettings: EntityDebugSettings;
|
||||||
|
debugConfig: {
|
||||||
|
maxDebugModeDuration: number;
|
||||||
|
debugLimitsConfiguration: string;
|
||||||
|
entityLabel?: string;
|
||||||
|
additionalActionConfig?: AdditionalDebugActionConfig;
|
||||||
|
}
|
||||||
|
onSettingsAppliedFn: (settings: EntityDebugSettings) => void;
|
||||||
|
}
|
||||||
@ -16,10 +16,11 @@
|
|||||||
|
|
||||||
import { Injectable, Optional, Renderer2, ViewContainerRef } from '@angular/core';
|
import { Injectable, Optional, Renderer2, ViewContainerRef } from '@angular/core';
|
||||||
import { EntityDebugSettingsPanelComponent } from '@home/components/entity/debug/entity-debug-settings-panel.component';
|
import { EntityDebugSettingsPanelComponent } from '@home/components/entity/debug/entity-debug-settings-panel.component';
|
||||||
import { EntityDebugSettingPanelConfig, EntityDebugSettings } from '@shared/models/entity.models';
|
import { EntityDebugSettings } from '@shared/models/entity.models';
|
||||||
import { TbPopoverService } from '@shared/components/popover.service';
|
import { TbPopoverService } from '@shared/components/popover.service';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { DurationLeftPipe } from '@shared/pipe/duration-left.pipe';
|
import { DurationLeftPipe } from '@shared/pipe/duration-left.pipe';
|
||||||
|
import { EntityDebugSettingPanelConfig } from '@home/components/entity/debug/entity-debug-settings.model';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class EntityDebugSettingsService {
|
export class EntityDebugSettingsService {
|
||||||
|
|||||||
@ -15,7 +15,6 @@
|
|||||||
///
|
///
|
||||||
|
|
||||||
import {
|
import {
|
||||||
AdditionalDebugActionConfig,
|
|
||||||
HasEntityDebugSettings,
|
HasEntityDebugSettings,
|
||||||
HasTenantId,
|
HasTenantId,
|
||||||
HasVersion
|
HasVersion
|
||||||
@ -34,6 +33,7 @@ import {
|
|||||||
dotOperatorHighlightRule,
|
dotOperatorHighlightRule,
|
||||||
endGroupHighlightRule
|
endGroupHighlightRule
|
||||||
} from '@shared/models/ace/ace.models';
|
} from '@shared/models/ace/ace.models';
|
||||||
|
import { AdditionalDebugActionConfig } from '@home/components/entity/debug/entity-debug-settings.model';
|
||||||
|
|
||||||
export interface CalculatedField extends Omit<BaseData<CalculatedFieldId>, 'label'>, HasVersion, HasEntityDebugSettings, HasTenantId, ExportableEntity<CalculatedFieldId> {
|
export interface CalculatedField extends Omit<BaseData<CalculatedFieldId>, 'label'>, HasVersion, HasEntityDebugSettings, HasTenantId, ExportableEntity<CalculatedFieldId> {
|
||||||
configuration: CalculatedFieldConfiguration;
|
configuration: CalculatedFieldConfiguration;
|
||||||
|
|||||||
@ -203,25 +203,9 @@ export interface EntityDebugSettings {
|
|||||||
allEnabledUntil?: number;
|
allEnabledUntil?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface EntityDebugSettingPanelConfig {
|
|
||||||
debugSettings: EntityDebugSettings;
|
|
||||||
debugConfig: {
|
|
||||||
maxDebugModeDuration: number;
|
|
||||||
debugLimitsConfiguration: string;
|
|
||||||
entityLabel?: string;
|
|
||||||
additionalActionConfig?: AdditionalDebugActionConfig;
|
|
||||||
}
|
|
||||||
onSettingsAppliedFn: (settings: EntityDebugSettings) => void;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface EntityTestScriptResult {
|
export interface EntityTestScriptResult {
|
||||||
output: string;
|
output: string;
|
||||||
error: string;
|
error: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AdditionalDebugActionConfig<Action = (...args: unknown[]) => void> {
|
|
||||||
action: Action;
|
|
||||||
title: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export type VersionedEntity = EntityInfoData & HasVersion | RuleChainMetaData;
|
export type VersionedEntity = EntityInfoData & HasVersion | RuleChainMetaData;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user