Browse Source

Merge branch 'master' into develop/3.2

pull/3477/head
Igor Kulikov 6 years ago
parent
commit
38847216cd
  1. 2
      ui-ngx/src/app/shared/components/snack-bar-component.html
  2. 27
      ui-ngx/src/app/shared/components/snack-bar-component.scss
  3. 143
      ui-ngx/src/app/shared/components/toast.directive.ts
  4. 275
      ui-ngx/src/app/shared/models/ace/service-completion.models.ts

2
ui-ngx/src/app/shared/components/snack-bar-component.html

@ -25,5 +25,5 @@
'info-toast': notification.type === 'info' 'info-toast': notification.type === 'info'
}"> }">
<div class="toast-text" [innerHTML]="notification.message"></div> <div class="toast-text" [innerHTML]="notification.message"></div>
<button #actionButton mat-button (click)="action()">{{ 'action.close' | translate }}</button> <button #actionButton type="button" mat-button (click)="action()">{{ 'action.close' | translate }}</button>
</div> </div>

27
ui-ngx/src/app/shared/components/snack-bar-component.scss

@ -16,6 +16,33 @@
:host { :host {
display: inline-block; display: inline-block;
pointer-events: all; pointer-events: all;
&.toast-panel {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 1000;
display: flex;
&.left {
justify-content: flex-start;
}
&.right {
justify-content: flex-end;
}
&.top {
align-items: flex-start;
}
&.bottom {
align-items: flex-end;
}
&.h-center {
justify-content: center;
}
&.v-center {
align-items: center;
}
}
.tb-toast { .tb-toast {
box-shadow: 0 3px 5px -1px rgba(0, 0, 0, 0.2), 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12); box-shadow: 0 3px 5px -1px rgba(0, 0, 0, 0.2), 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12);
color: #fff; color: #fff;

143
ui-ngx/src/app/shared/components/toast.directive.ts

@ -16,9 +16,9 @@
import { import {
AfterViewInit, ChangeDetectorRef, AfterViewInit, ChangeDetectorRef,
Component, ComponentRef, Component, ComponentFactoryResolver, ComponentRef,
Directive, Directive,
ElementRef, ElementRef, HostBinding,
Inject, Inject,
Input, Input,
NgZone, NgZone,
@ -34,8 +34,7 @@ import { BreakpointObserver } from '@angular/cdk/layout';
import { MediaBreakpoints } from '@shared/models/constants'; import { MediaBreakpoints } from '@shared/models/constants';
import { MatButton } from '@angular/material/button'; import { MatButton } from '@angular/material/button';
import Timeout = NodeJS.Timeout; import Timeout = NodeJS.Timeout;
import { ConnectedPosition, Overlay, OverlayConfig, OverlayRef } from '@angular/cdk/overlay'; import { PortalInjector } from '@angular/cdk/portal';
import { ComponentPortal, PortalInjector } from '@angular/cdk/portal';
@Directive({ @Directive({
selector: '[tb-toast]' selector: '[tb-toast]'
@ -49,7 +48,6 @@ export class ToastDirective implements AfterViewInit, OnDestroy {
private hideNotificationSubscription: Subscription = null; private hideNotificationSubscription: Subscription = null;
private snackBarRef: MatSnackBarRef<any> = null; private snackBarRef: MatSnackBarRef<any> = null;
private overlayRef: OverlayRef;
private toastComponentRef: ComponentRef<TbSnackBarComponent>; private toastComponentRef: ComponentRef<TbSnackBarComponent>;
private currentMessage: NotificationMessage = null; private currentMessage: NotificationMessage = null;
@ -58,7 +56,7 @@ export class ToastDirective implements AfterViewInit, OnDestroy {
constructor(private elementRef: ElementRef, constructor(private elementRef: ElementRef,
private viewContainerRef: ViewContainerRef, private viewContainerRef: ViewContainerRef,
private notificationService: NotificationService, private notificationService: NotificationService,
private overlay: Overlay, private componentFactoryResolver: ComponentFactoryResolver,
private snackBar: MatSnackBar, private snackBar: MatSnackBar,
private ngZone: NgZone, private ngZone: NgZone,
private breakpointObserver: BreakpointObserver, private breakpointObserver: BreakpointObserver,
@ -104,9 +102,11 @@ export class ToastDirective implements AfterViewInit, OnDestroy {
if (this.snackBarRef) { if (this.snackBarRef) {
this.snackBarRef.dismiss(); this.snackBarRef.dismiss();
} }
if (this.toastComponentRef) {
const position = this.overlay.position(); this.viewContainerRef.detach(0);
let panelClass = ['tb-toast-panel']; this.toastComponentRef.destroy();
}
let panelClass = ['tb-toast-panel', 'toast-panel'];
if (notificationMessage.panelClass) { if (notificationMessage.panelClass) {
if (typeof notificationMessage.panelClass === 'string') { if (typeof notificationMessage.panelClass === 'string') {
panelClass.push(notificationMessage.panelClass); panelClass.push(notificationMessage.panelClass);
@ -114,46 +114,35 @@ export class ToastDirective implements AfterViewInit, OnDestroy {
panelClass = panelClass.concat(notificationMessage.panelClass); panelClass = panelClass.concat(notificationMessage.panelClass);
} }
} }
const overlayConfig = new OverlayConfig({
panelClass,
backdropClass: 'cdk-overlay-transparent-backdrop',
hasBackdrop: false,
disposeOnNavigation: true
});
let originX;
let originY;
const horizontalPosition = notificationMessage.horizontalPosition || 'left'; const horizontalPosition = notificationMessage.horizontalPosition || 'left';
const verticalPosition = notificationMessage.verticalPosition || 'top'; const verticalPosition = notificationMessage.verticalPosition || 'top';
if (horizontalPosition === 'start' || horizontalPosition === 'left') { if (horizontalPosition === 'start' || horizontalPosition === 'left') {
originX = 'start'; panelClass.push('left');
} else if (horizontalPosition === 'end' || horizontalPosition === 'right') { } else if (horizontalPosition === 'end' || horizontalPosition === 'right') {
originX = 'end'; panelClass.push('right');
} else { } else {
originX = 'center'; panelClass.push('h-center');
} }
if (verticalPosition === 'top') { if (verticalPosition === 'top') {
originY = 'top'; panelClass.push('top');
} else { } else {
originY = 'bottom'; panelClass.push('bottom');
} }
const connectedPosition: ConnectedPosition = {
originX, const componentFactory = this.componentFactoryResolver.resolveComponentFactory(TbSnackBarComponent);
originY,
overlayX: originX,
overlayY: originY
};
overlayConfig.positionStrategy = position.flexibleConnectedTo(this.elementRef)
.withPositions([connectedPosition]);
this.overlayRef = this.overlay.create(overlayConfig);
const data: ToastPanelData = { const data: ToastPanelData = {
notification: notificationMessage notification: notificationMessage,
panelClass,
destroyToastComponent: () => {
this.viewContainerRef.detach(0);
this.toastComponentRef.destroy();
}
}; };
const injectionTokens = new WeakMap<any, any>([ const injectionTokens = new WeakMap<any, any>([
[MAT_SNACK_BAR_DATA, data], [MAT_SNACK_BAR_DATA, data]
[OverlayRef, this.overlayRef]
]); ]);
const injector = new PortalInjector(this.viewContainerRef.injector, injectionTokens); const injector = new PortalInjector(this.viewContainerRef.injector, injectionTokens);
this.toastComponentRef = this.overlayRef.attach(new ComponentPortal(TbSnackBarComponent, this.viewContainerRef, injector)); this.toastComponentRef = this.viewContainerRef.createComponent(componentFactory, 0, injector);
this.cd.detectChanges(); this.cd.detectChanges();
if (notificationMessage.duration && notificationMessage.duration > 0) { if (notificationMessage.duration && notificationMessage.duration > 0) {
@ -173,7 +162,6 @@ export class ToastDirective implements AfterViewInit, OnDestroy {
clearTimeout(this.dismissTimeout); clearTimeout(this.dismissTimeout);
this.dismissTimeout = null; this.dismissTimeout = null;
} }
this.overlayRef = null;
this.toastComponentRef = null; this.toastComponentRef = null;
this.currentMessage = null; this.currentMessage = null;
}); });
@ -181,43 +169,45 @@ export class ToastDirective implements AfterViewInit, OnDestroy {
} }
private showSnackBar(notificationMessage: NotificationMessage, isGtSm: boolean) { private showSnackBar(notificationMessage: NotificationMessage, isGtSm: boolean) {
const data: ToastPanelData = {
notification: notificationMessage,
parent: this.elementRef
};
const config: MatSnackBarConfig = {
horizontalPosition: notificationMessage.horizontalPosition || 'left',
verticalPosition: !isGtSm ? 'bottom' : (notificationMessage.verticalPosition || 'top'),
viewContainerRef: this.viewContainerRef,
duration: notificationMessage.duration,
panelClass: notificationMessage.panelClass,
data
};
this.ngZone.run(() => { this.ngZone.run(() => {
if (this.snackBarRef) { if (this.snackBarRef) {
this.snackBarRef.dismiss(); this.snackBarRef.dismiss();
} }
const data: ToastPanelData = {
notification: notificationMessage,
parent: this.elementRef,
panelClass: [],
destroyToastComponent: () => {}
};
const config: MatSnackBarConfig = {
horizontalPosition: notificationMessage.horizontalPosition || 'left',
verticalPosition: !isGtSm ? 'bottom' : (notificationMessage.verticalPosition || 'top'),
viewContainerRef: this.viewContainerRef,
duration: notificationMessage.duration,
panelClass: notificationMessage.panelClass,
data
};
this.snackBarRef = this.snackBar.openFromComponent(TbSnackBarComponent, config); this.snackBarRef = this.snackBar.openFromComponent(TbSnackBarComponent, config);
}); if (notificationMessage.duration && notificationMessage.duration > 0 && notificationMessage.forceDismiss) {
if (notificationMessage.duration && notificationMessage.duration > 0 && notificationMessage.forceDismiss) { if (this.dismissTimeout !== null) {
if (this.dismissTimeout !== null) { clearTimeout(this.dismissTimeout);
clearTimeout(this.dismissTimeout); this.dismissTimeout = null;
this.dismissTimeout = null;
}
this.dismissTimeout = setTimeout(() => {
if (this.snackBarRef) {
this.snackBarRef.instance.actionButton._elementRef.nativeElement.click();
} }
this.dismissTimeout = null; this.dismissTimeout = setTimeout(() => {
}, notificationMessage.duration); if (this.snackBarRef) {
} this.snackBarRef.instance.actionButton._elementRef.nativeElement.click();
this.snackBarRef.afterDismissed().subscribe(() => { }
if (this.dismissTimeout !== null) { this.dismissTimeout = null;
clearTimeout(this.dismissTimeout); }, notificationMessage.duration);
this.dismissTimeout = null;
} }
this.snackBarRef = null; this.snackBarRef.afterDismissed().subscribe(() => {
this.currentMessage = null; if (this.dismissTimeout !== null) {
clearTimeout(this.dismissTimeout);
this.dismissTimeout = null;
}
this.snackBarRef = null;
this.currentMessage = null;
});
}); });
} }
@ -235,8 +225,9 @@ export class ToastDirective implements AfterViewInit, OnDestroy {
} }
ngOnDestroy(): void { ngOnDestroy(): void {
if (this.overlayRef) { if (this.toastComponentRef) {
this.overlayRef.dispose(); this.viewContainerRef.detach(0);
this.toastComponentRef.destroy();
} }
if (this.notificationSubscription) { if (this.notificationSubscription) {
this.notificationSubscription.unsubscribe(); this.notificationSubscription.unsubscribe();
@ -250,6 +241,8 @@ export class ToastDirective implements AfterViewInit, OnDestroy {
interface ToastPanelData { interface ToastPanelData {
notification: NotificationMessage; notification: NotificationMessage;
parent?: ElementRef; parent?: ElementRef;
panelClass: string[];
destroyToastComponent: () => void;
} }
import { import {
@ -288,6 +281,11 @@ export class TbSnackBarComponent implements AfterViewInit, OnDestroy {
@ViewChild('actionButton', {static: true}) actionButton: MatButton; @ViewChild('actionButton', {static: true}) actionButton: MatButton;
@HostBinding('class')
get panelClass(): string[] {
return this.data.panelClass;
}
private parentEl: HTMLElement; private parentEl: HTMLElement;
private snackBarContainerEl: HTMLElement; private snackBarContainerEl: HTMLElement;
private parentScrollSubscription: Subscription = null; private parentScrollSubscription: Subscription = null;
@ -305,9 +303,7 @@ export class TbSnackBarComponent implements AfterViewInit, OnDestroy {
private data: ToastPanelData, private data: ToastPanelData,
private elementRef: ElementRef, private elementRef: ElementRef,
@Optional() @Optional()
private snackBarRef: MatSnackBarRef<TbSnackBarComponent>, private snackBarRef: MatSnackBarRef<TbSnackBarComponent>) {
@Optional()
private overlayRef: OverlayRef) {
this.animationState = !!this.snackBarRef ? 'default' : 'opened'; this.animationState = !!this.snackBarRef ? 'default' : 'opened';
this.notification = data.notification; this.notification = data.notification;
} }
@ -319,9 +315,8 @@ export class TbSnackBarComponent implements AfterViewInit, OnDestroy {
this.snackBarContainerEl.style.position = 'absolute'; this.snackBarContainerEl.style.position = 'absolute';
this.updateContainerRect(); this.updateContainerRect();
this.updatePosition(this.snackBarRef.containerInstance.snackBarConfig); this.updatePosition(this.snackBarRef.containerInstance.snackBarConfig);
const snackBarComponent = this;
this.parentScrollSubscription = onParentScrollOrWindowResize(this.parentEl).subscribe(() => { this.parentScrollSubscription = onParentScrollOrWindowResize(this.parentEl).subscribe(() => {
snackBarComponent.updateContainerRect(); this.updateContainerRect();
}); });
} }
} }
@ -373,7 +368,7 @@ export class TbSnackBarComponent implements AfterViewInit, OnDestroy {
const isFadeOut = (toState as ToastAnimationState) === 'closing'; const isFadeOut = (toState as ToastAnimationState) === 'closing';
const itFinished = this.animationState === 'closing'; const itFinished = this.animationState === 'closing';
if (isFadeOut && itFinished) { if (isFadeOut && itFinished) {
this.overlayRef.dispose(); this.data.destroyToastComponent();
} }
} }
} }

275
ui-ngx/src/app/shared/models/ace/service-completion.models.ts

@ -24,7 +24,7 @@ export const alarmDataHref = '<a href="https://github.com/thingsboard/thingsboar
export const alarmDataQueryHref = '<a href="https://github.com/thingsboard/thingsboard/blob/master/ui-ngx/src/app/shared/models/query/query.models.ts#L558">Alarm data query</a>'; export const alarmDataQueryHref = '<a href="https://github.com/thingsboard/thingsboard/blob/master/ui-ngx/src/app/shared/models/query/query.models.ts#L558">Alarm data query</a>';
export const attributeScopeHref ='<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/telemetry/telemetry.models.ts#L37">Attribute scope</a>'; export const attributeScopeHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/telemetry/telemetry.models.ts#L37">Attribute scope</a>';
export const entityTypeHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/entity-type.models.ts#L36">EntityType</a>'; export const entityTypeHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/entity-type.models.ts#L36">EntityType</a>';
@ -32,7 +32,7 @@ export const pageDataHref = '<a href="https://github.com/thingsboard/thingsboard
export const deviceInfoHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/device.models.ts#L33">DeviceInfo</a>'; export const deviceInfoHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/device.models.ts#L33">DeviceInfo</a>';
export const assetInfoHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/asset.models.ts#L32">AssetInfo</a>' export const assetInfoHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/asset.models.ts#L32">AssetInfo</a>';
export const entityViewInfoHref = '<a href = "https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/entity-view.models.ts#L47">EntityViewInfo</a>'; export const entityViewInfoHref = '<a href = "https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/entity-view.models.ts#L47">EntityViewInfo</a>';
@ -84,15 +84,15 @@ export const stateParamsHref = '<a href="https://github.com/thingsboard/thingsbo
export const aliasInfoHref = '<a href="https://github.com/thingsboard/thingsboard/blob/master/ui-ngx/src/app/core/api/widget-api.models.ts#L88">Alias info</a>'; export const aliasInfoHref = '<a href="https://github.com/thingsboard/thingsboard/blob/master/ui-ngx/src/app/core/api/widget-api.models.ts#L88">Alias info</a>';
export const entityAliasFilterHref = '<a href="https://github.com/thingsboard/thingsboard/blob/master/ui-ngx/src/app/shared/models/alias.models.ts#L134">Entity alias filter</a>' export const entityAliasFilterHref = '<a href="https://github.com/thingsboard/thingsboard/blob/master/ui-ngx/src/app/shared/models/alias.models.ts#L134">Entity alias filter</a>';
export const entityAliasFilterResultHref = '<a href="https://github.com/thingsboard/thingsboard/blob/master/ui-ngx/src/app/shared/models/alias.models.ts#L158">Entity alias filter result</a>' export const entityAliasFilterResultHref = '<a href="https://github.com/thingsboard/thingsboard/blob/master/ui-ngx/src/app/shared/models/alias.models.ts#L158">Entity alias filter result</a>';
export const importEntityDataHref = '<a href="https://github.com/thingsboard/thingsboard/blob/master/ui-ngx/src/app/shared/models/entity.models.ts#L28">Import entity data</a>' export const importEntityDataHref = '<a href="https://github.com/thingsboard/thingsboard/blob/master/ui-ngx/src/app/shared/models/entity.models.ts#L28">Import entity data</a>';
export const importEntitiesResultInfoHref = '<a href="https://github.com/thingsboard/thingsboard/blob/master/ui-ngx/src/app/shared/models/entity.models.ts#L42">Import entities result info</a>' export const importEntitiesResultInfoHref = '<a href="https://github.com/thingsboard/thingsboard/blob/master/ui-ngx/src/app/shared/models/entity.models.ts#L42">Import entities result info</a>';
export const customDialogComponentHref = '<a href="https://github.com/thingsboard/thingsboard/blob/master/ui-ngx/src/app/modules/home/components/widget/dialog/custom-dialog.component.ts#L48">CustomDialogComponent</a>' export const customDialogComponentHref = '<a href="https://github.com/thingsboard/thingsboard/blob/master/ui-ngx/src/app/modules/home/components/widget/dialog/custom-dialog.component.ts#L48">CustomDialogComponent</a>';
export const pageLinkArg: FunctionArg = { export const pageLinkArg: FunctionArg = {
name: 'pageLink', name: 'pageLink',
@ -135,21 +135,20 @@ export function observableArrayReturnType(objectType: string): FunctionArgType {
}; };
} }
export function observableBaseDataReturnType(objectType: string): FunctionArgType { export function observableBaseDataReturnType(): FunctionArgType {
return { return {
type: `Observable&lt;${baseDataHref}&lt;${objectType}&gt;&gt;`, type: `Observable&lt;${baseDataHref}&lt;${entityIdHref}&gt;&gt;`,
description: `An <code>Observable</code> of page result as a <code>${baseDataHref}</code> holding array of <code>${objectType}</code> objects.` description: `An <code>Observable</code> of <code>${baseDataHref}</code> object.`
}; };
} }
export function observableArrayBaseDataReturnType(objectType: string): FunctionArgType { export function observableArrayBaseDataReturnType(): FunctionArgType {
return { return {
type: `Observable&lt;Array&lt;${baseDataHref}&lt;${objectType}&gt;&gt;&gt;`, type: `Observable&lt;Array&lt;${baseDataHref}&lt;${entityIdHref}&gt;&gt;&gt;`,
description: `An <code>Observable</code> of page result as a <code>${baseDataHref}</code> holding array of <code>${objectType}</code> objects.` description: `An <code>Observable</code> of array of <code>${baseDataHref}</code> objects.`
}; };
} }
export function observablePageDataReturnType(objectType: string): FunctionArgType { export function observablePageDataReturnType(objectType: string): FunctionArgType {
return { return {
type: `Observable&lt;${pageDataHref}&lt;${objectType}&gt;&gt;`, type: `Observable&lt;${pageDataHref}&lt;${objectType}&gt;&gt;`,
@ -157,8 +156,6 @@ export function observablePageDataReturnType(objectType: string): FunctionArgTyp
}; };
} }
export const serviceCompletions: TbEditorCompletions = { export const serviceCompletions: TbEditorCompletions = {
deviceService: { deviceService: {
description: 'Device Service API<br>' + description: 'Device Service API<br>' +
@ -362,7 +359,7 @@ export const serviceCompletions: TbEditorCompletions = {
type: '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/core/http/asset.service.ts#L29">AssetService</a>', type: '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/core/http/asset.service.ts#L29">AssetService</a>',
children: { children: {
getTenantAssetInfos: { getTenantAssetInfos: {
description: 'Get tenant asset', description: 'Get tenant assets',
meta: 'function', meta: 'function',
args: [ args: [
pageLinkArg, pageLinkArg,
@ -530,7 +527,7 @@ export const serviceCompletions: TbEditorCompletions = {
description: 'Get entity view info by id', description: 'Get entity view info by id',
meta: 'function', meta: 'function',
args: [ args: [
{name: 'entityViewId', type: 'string', description: 'Id of the entities view'}, {name: 'entityViewId', type: 'string', description: 'Id of the entity view'},
requestConfigArg requestConfigArg
], ],
return: observableReturnType(entityViewInfoHref) return: observableReturnType(entityViewInfoHref)
@ -575,7 +572,7 @@ export const serviceCompletions: TbEditorCompletions = {
meta: 'function', meta: 'function',
args: [ args: [
{name: 'customerId', type: 'string', description: 'Id of the customer'}, {name: 'customerId', type: 'string', description: 'Id of the customer'},
{name: 'entityViewId', type: 'string', description: 'Id of the entity viewId'}, {name: 'entityViewId', type: 'string', description: 'Id of the entity view'},
requestConfigArg requestConfigArg
], ],
return: observableReturnType(entityViewHref) return: observableReturnType(entityViewHref)
@ -596,7 +593,7 @@ export const serviceCompletions: TbEditorCompletions = {
{ {
name: 'query', name: 'query',
type: '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/asset.models.ts#L37">AssetSearchQuery</a>', type: '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/asset.models.ts#L37">AssetSearchQuery</a>',
description: 'Asset search query object' description: 'Entity view search query object'
}, },
requestConfigArg requestConfigArg
], ],
@ -655,7 +652,7 @@ export const serviceCompletions: TbEditorCompletions = {
type: '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/core/http/dashboard.service.ts#L32">DashboardService</a>', type: '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/core/http/dashboard.service.ts#L32">DashboardService</a>',
children: { children: {
getTenantDashboards: { getTenantDashboards: {
description: 'Get tenant dashboard', description: 'Get tenant dashboards',
meta: 'function', meta: 'function',
args: [ args: [
pageLinkArg, pageLinkArg,
@ -664,16 +661,17 @@ export const serviceCompletions: TbEditorCompletions = {
return: observablePageDataReturnType(dashboardInfoHref) return: observablePageDataReturnType(dashboardInfoHref)
}, },
getTenantDashboardsByTenantId: { getTenantDashboardsByTenantId: {
description: 'Get tenant dashboards by id', description: 'Get dashboards by tenant id',
meta: 'function', meta: 'function',
args: [ args: [
{name: 'tenantId', type: 'string', description: 'Id of the tenant'}, {name: 'tenantId', type: 'string', description: 'Id of the tenant'},
pageLinkArg pageLinkArg,
requestConfigArg
], ],
return: observablePageDataReturnType(dashboardInfoHref) return: observablePageDataReturnType(dashboardInfoHref)
}, },
getCustomerDashboards: { getCustomerDashboards: {
description: 'Get customer dashboard by id', description: 'Get dashboards by customer id',
meta: 'function', meta: 'function',
args: [ args: [
{name: 'customerId', type: 'string', description: 'Id of the customer'}, {name: 'customerId', type: 'string', description: 'Id of the customer'},
@ -713,7 +711,7 @@ export const serviceCompletions: TbEditorCompletions = {
description: 'Delete dashboard by id', description: 'Delete dashboard by id',
meta: 'function', meta: 'function',
args: [ args: [
{name: 'dashboardId', type: 'string', description: 'Id of the entity view'}, {name: 'dashboardId', type: 'string', description: 'Id of the dashboard'},
requestConfigArg requestConfigArg
], ],
return: observableVoid() return: observableVoid()
@ -729,7 +727,7 @@ export const serviceCompletions: TbEditorCompletions = {
return: observableReturnType(dashboardHref) return: observableReturnType(dashboardHref)
}, },
unassignDashboardFromCustomer: { unassignDashboardFromCustomer: {
description: 'Unassign dashboard from any customer', description: 'Unassign dashboard from specific customer',
meta: 'function', meta: 'function',
args: [ args: [
{name: 'customerId', type: 'string', description: 'Id of the customer'}, {name: 'customerId', type: 'string', description: 'Id of the customer'},
@ -757,7 +755,7 @@ export const serviceCompletions: TbEditorCompletions = {
return: observableReturnType(dashboardHref) return: observableReturnType(dashboardHref)
}, },
updateDashboardCustomers: { updateDashboardCustomers: {
description: 'Update dashboard by id', description: 'Update customers assigned to dashboard by ids',
meta: 'function', meta: 'function',
args: [ args: [
{name: 'dashboardId', type: 'string', description: 'Id of the dashboard'}, {name: 'dashboardId', type: 'string', description: 'Id of the dashboard'},
@ -767,7 +765,7 @@ export const serviceCompletions: TbEditorCompletions = {
return: observableReturnType(dashboardHref) return: observableReturnType(dashboardHref)
}, },
addDashboardCustomers: { addDashboardCustomers: {
description: 'Add dashboard customers by ids', description: 'Assign (Add) customers to dashboard by ids',
meta: 'function', meta: 'function',
args: [ args: [
{name: 'dashboardId', type: 'string', description: 'Id of the dashboard'}, {name: 'dashboardId', type: 'string', description: 'Id of the dashboard'},
@ -777,14 +775,14 @@ export const serviceCompletions: TbEditorCompletions = {
return: observableReturnType(dashboardHref) return: observableReturnType(dashboardHref)
}, },
removeDashboardCustomers: { removeDashboardCustomers: {
description: 'Remove dashboard customers dy ids', description: 'Unassign (Remove) customers from dashboard by ids',
meta: 'function', meta: 'function',
args: [ args: [
{name: 'dashboardId', type: 'string', description: 'Id of the dashboard'}, {name: 'dashboardId', type: 'string', description: 'Id of the dashboard'},
{name: 'customerIds', type: `Array&lt;string&gt;`, description: 'Id of the customers'}, {name: 'customerIds', type: `Array&lt;string&gt;`, description: 'Id of the customers'},
requestConfigArg requestConfigArg
], ],
return: observableArrayReturnType(dashboardHref) return: observableReturnType(dashboardHref)
}, },
getPublicDashboardLink: { getPublicDashboardLink: {
description: 'Get public dashboard link', description: 'Get public dashboard link',
@ -798,7 +796,7 @@ export const serviceCompletions: TbEditorCompletions = {
} }
}, },
getServerTimeDiff: { getServerTimeDiff: {
description: 'remove dashboard customers ', description: 'Get time difference',
meta: 'function', meta: 'function',
args: [ args: [
], ],
@ -822,7 +820,7 @@ export const serviceCompletions: TbEditorCompletions = {
return: observablePageDataReturnType(userHref) return: observablePageDataReturnType(userHref)
}, },
getTenantAdmins: { getTenantAdmins: {
description: 'Get tenant admins by id', description: 'Get tenant admins by id',
meta: 'function', meta: 'function',
args: [ args: [
{name: 'tenantId', type: 'string', description: 'Id of the tenant'}, {name: 'tenantId', type: 'string', description: 'Id of the tenant'},
@ -832,10 +830,10 @@ export const serviceCompletions: TbEditorCompletions = {
return: observablePageDataReturnType(userHref) return: observablePageDataReturnType(userHref)
}, },
getCustomerUsers: { getCustomerUsers: {
description: 'Get customer users by id', description: 'Get customer users by id',
meta: 'function', meta: 'function',
args: [ args: [
{name: 'customerId', type: 'string', description: 'id of the customer'}, {name: 'customerId', type: 'string', description: 'Id of the customer'},
pageLinkArg, pageLinkArg,
requestConfigArg requestConfigArg
], ],
@ -845,7 +843,7 @@ export const serviceCompletions: TbEditorCompletions = {
description: 'Get user by id', description: 'Get user by id',
meta: 'function', meta: 'function',
args: [ args: [
{name: 'userId', type: 'string', description: 'id of the user'}, {name: 'userId', type: 'string', description: 'Id of the user'},
requestConfigArg requestConfigArg
], ],
return: observableReturnType(userHref) return: observableReturnType(userHref)
@ -855,6 +853,7 @@ export const serviceCompletions: TbEditorCompletions = {
meta: 'function', meta: 'function',
args: [ args: [
{name: 'user', type: userHref, description: 'User object to save'}, {name: 'user', type: userHref, description: 'User object to save'},
{name: 'sendActivationMail', type: 'boolean', description: 'Send activation email', optional: true},
requestConfigArg requestConfigArg
], ],
return: observableReturnType(userHref) return: observableReturnType(userHref)
@ -876,7 +875,7 @@ export const serviceCompletions: TbEditorCompletions = {
{name: 'userCredentialsEnabled', type: 'boolean', description: 'User credentials enabled'}, {name: 'userCredentialsEnabled', type: 'boolean', description: 'User credentials enabled'},
requestConfigArg requestConfigArg
], ],
return: observableReturnType(userHref) return: observableReturnTypeVariable('any')
}, },
getActivationLink: { getActivationLink: {
description: 'Get activation link by id', description: 'Get activation link by id',
@ -885,7 +884,7 @@ export const serviceCompletions: TbEditorCompletions = {
{name: 'userId', type: 'string', description: 'Id of the user'}, {name: 'userId', type: 'string', description: 'Id of the user'},
requestConfigArg requestConfigArg
], ],
return:observableReturnTypeVariable('string') return: observableReturnTypeVariable('string')
}, },
sendActivationEmail: { sendActivationEmail: {
description: 'Send activation email', description: 'Send activation email',
@ -928,8 +927,7 @@ export const serviceCompletions: TbEditorCompletions = {
description: 'Delete relations by entity id', description: 'Delete relations by entity id',
meta: 'function', meta: 'function',
args: [ args: [
{name: 'entityId', type: entityIdHref, description: 'Id to the entity'}, {name: 'entityId', type: entityIdHref, description: 'Entity Id'},
{name: 'relationType', type: 'string', description: 'Relation type'},
requestConfigArg requestConfigArg
], ],
return: observableVoid() return: observableVoid()
@ -1005,7 +1003,7 @@ export const serviceCompletions: TbEditorCompletions = {
description: 'Find by query', description: 'Find by query',
meta: 'function', meta: 'function',
args: [ args: [
{name: 'query', type: entityRelationsQueryHref, description: 'Query'}, {name: 'query', type: entityRelationsQueryHref, description: 'Entity relations query'},
requestConfigArg requestConfigArg
], ],
return: observableArrayReturnType(entityRelationHref) return: observableArrayReturnType(entityRelationHref)
@ -1014,7 +1012,7 @@ export const serviceCompletions: TbEditorCompletions = {
description: 'Find info by query', description: 'Find info by query',
meta: 'function', meta: 'function',
args: [ args: [
{name: 'query', type: entityRelationsQueryHref, description: 'Query'}, {name: 'query', type: entityRelationsQueryHref, description: 'Entity relations query'},
requestConfigArg requestConfigArg
], ],
return: observableArrayReturnType(entityRelationInfoHref) return: observableArrayReturnType(entityRelationInfoHref)
@ -1032,8 +1030,8 @@ export const serviceCompletions: TbEditorCompletions = {
meta: 'function', meta: 'function',
args: [ args: [
{name: 'entityId', type: entityIdHref, description: 'Id of the entity'}, {name: 'entityId', type: entityIdHref, description: 'Id of the entity'},
{name: 'attributeScope', type: attributeScopeHref, description: 'Atribute scope'}, {name: 'attributeScope', type: attributeScopeHref, description: 'Attribute scope'},
{name: 'keys', type:`Array&lt;string&gt;`, description: 'Array of the keys'}, {name: 'keys', type: `Array&lt;string&gt;`, description: 'Array of the keys'},
requestConfigArg requestConfigArg
], ],
return: observableArrayReturnType(attributeDataHref) return: observableArrayReturnType(attributeDataHref)
@ -1043,8 +1041,8 @@ export const serviceCompletions: TbEditorCompletions = {
meta: 'function', meta: 'function',
args: [ args: [
{name: 'entityId', type: entityIdHref, description: 'Id of the entity'}, {name: 'entityId', type: entityIdHref, description: 'Id of the entity'},
{name: 'attributeScope', type: attributeScopeHref, description: 'Atribute scope'}, {name: 'attributeScope', type: attributeScopeHref, description: 'Attribute scope'},
{name: 'attributes', type: `array&lt;${attributeDataHref}&gt;`, description: 'Array of the attributes'}, {name: 'attributes', type: `array&lt;${attributeDataHref}&gt;`, description: 'Array of the attributes data'},
requestConfigArg requestConfigArg
], ],
return: observableReturnTypeVariable('any') return: observableReturnTypeVariable('any')
@ -1054,11 +1052,11 @@ export const serviceCompletions: TbEditorCompletions = {
meta: 'function', meta: 'function',
args: [ args: [
{name: 'entityId', type: entityIdHref, description: 'Id of the entity'}, {name: 'entityId', type: entityIdHref, description: 'Id of the entity'},
{name: 'timeseries', type: `Array&lt;${attributeDataHref}&gt;>`, description: 'Array of the timeseries'}, {name: 'timeseries', type: `Array&lt;${attributeDataHref}&gt;>`, description: 'Array of the timeseries data'},
{name: 'deleteAllDataForKeys', type: 'boolean',optional: true, description: 'Delete all data for keys'}, {name: 'deleteAllDataForKeys', type: 'boolean', optional: true, description: 'Delete all data for keys'},
requestConfigArg requestConfigArg
], ],
return:observableReturnTypeVariable('any') return: observableReturnTypeVariable('any')
}, },
saveEntityAttributes: { saveEntityAttributes: {
description: 'Save entity attributes', description: 'Save entity attributes',
@ -1066,7 +1064,7 @@ export const serviceCompletions: TbEditorCompletions = {
args: [ args: [
{name: 'entityId', type: entityIdHref, description: 'Id of the entity'}, {name: 'entityId', type: entityIdHref, description: 'Id of the entity'},
{name: 'attributeScope', type: attributeScopeHref, description: 'Attribute scope'}, {name: 'attributeScope', type: attributeScopeHref, description: 'Attribute scope'},
{name: 'attributes', type: 'Array&lt;${attributeDataHref}&gt;>', description: 'Array of the attributes'}, {name: 'attributes', type: 'Array&lt;${attributeDataHref}&gt;>', description: 'Array of the attributes data'},
requestConfigArg requestConfigArg
], ],
return: observableReturnTypeVariable('any') return: observableReturnTypeVariable('any')
@ -1077,10 +1075,10 @@ export const serviceCompletions: TbEditorCompletions = {
args: [ args: [
{name: 'entityId', type: entityIdHref, description: 'Id of the entity'}, {name: 'entityId', type: entityIdHref, description: 'Id of the entity'},
{name: 'timeseriesScope', type: 'string', description: 'Timeseries scope'}, {name: 'timeseriesScope', type: 'string', description: 'Timeseries scope'},
{name: 'timeseries', type: `Array&lt;attributeDataHref&gt;`, description: 'Array of the timeseries'}, {name: 'timeseries', type: `Array&lt;attributeDataHref&gt;`, description: 'Array of the timeseries data'},
requestConfigArg requestConfigArg
], ],
return:observableReturnTypeVariable('any') return: observableReturnTypeVariable('any')
}, },
} }
}, },
@ -1098,7 +1096,7 @@ export const serviceCompletions: TbEditorCompletions = {
{name: 'entityId', type: 'string', description: 'Id of the entity'}, {name: 'entityId', type: 'string', description: 'Id of the entity'},
requestConfigArg requestConfigArg
], ],
return:observableBaseDataReturnType(entityIdHref) return: observableBaseDataReturnType()
}, },
getEntities: { getEntities: {
description: 'Get entities by ids', description: 'Get entities by ids',
@ -1108,181 +1106,174 @@ export const serviceCompletions: TbEditorCompletions = {
{name: 'entityIds', type: `Array&lt;string&gt;`, description: 'Ids of the entities'}, {name: 'entityIds', type: `Array&lt;string&gt;`, description: 'Ids of the entities'},
requestConfigArg requestConfigArg
], ],
return:observableArrayBaseDataReturnType(entityIdHref) return: observableArrayBaseDataReturnType()
}, },
getEntitiesByNameFilter: { getEntitiesByNameFilter: {
description: 'Get entities by name filter', description: 'Get entities by name filter',
meta: 'function', meta: 'function',
args: [ args: [
{name: 'entityType', type: entityTypeHref, description: 'Entity type'}, {name: 'entityType', type: entityTypeHref, description: 'Entity type'},
{name: 'entityNameFilter', type: 'string', description: 'Name filter of the entity'}, {name: 'entityNameFilter', type: 'string', description: 'Name filter for the entity'},
{name: 'pageSize', type: 'number', description: 'Size of the page'}, {name: 'pageSize', type: 'number', description: 'Size of the page'},
{name: 'subType', type: 'string',optional: true, description: 'Subtype'}, {name: 'subType', type: 'string', optional: true, description: 'Subtype'},
requestConfigArg requestConfigArg
], ],
return:observableArrayBaseDataReturnType(entityIdHref) return: observableArrayBaseDataReturnType()
}, },
findEntityDataByQuery: { findEntityDataByQuery: {
description: 'Find entity data by query', description: 'Find entity data by query',
meta: 'function', meta: 'function',
args: [ args: [
{name: 'query', type: entityDataQueryHref, description: 'Query'}, {name: 'query', type: entityDataQueryHref, description: 'Entity data query'},
requestConfigArg requestConfigArg
], ],
return:observablePageDataReturnType(entityDataHref) return: observablePageDataReturnType(entityDataHref)
}, },
findAlarmDataByQuery: { findAlarmDataByQuery: {
description: 'Find alarm data by query', description: 'Find alarm data by query',
meta: 'function', meta: 'function',
args: [ args: [
{name: 'query', type: alarmDataQueryHref, description: 'Query'}, {name: 'query', type: alarmDataQueryHref, description: 'Alarm data query'},
requestConfigArg requestConfigArg
], ],
return:observablePageDataReturnType(alarmDataHref) return: observablePageDataReturnType(alarmDataHref)
}, },
findEntityInfosByFilterAndName: { findEntityInfosByFilterAndName: {
description: 'Find entity infos by filter and name', description: 'Find entity infos by filter and name',
meta: 'function', meta: 'function',
args: [ args: [
{name: 'filter', type: entityFilterHref, description: 'Filter of the entity'}, {name: 'filter', type: entityFilterHref, description: 'Filter for the entities'},
{name: 'searchText', type: 'string', description: 'Search text'}, {name: 'searchText', type: 'string', description: 'Search text'},
requestConfigArg requestConfigArg
], ],
return:observablePageDataReturnType(entityInfoHref) return: observablePageDataReturnType(entityInfoHref)
}, },
findSingleEntityInfoByEntityFilter: { findSingleEntityInfoByEntityFilter: {
description: 'Find single entity infos by filter of the entity ', description: 'Find single entity infos by filter',
meta: 'function', meta: 'function',
args: [ args: [
{name: 'filter', type: entityFilterHref, description: 'Filter of the entity'}, {name: 'filter', type: entityFilterHref, description: 'Filter for the entity'},
{name: 'searchText', type: 'string', description: 'search text'},
requestConfigArg requestConfigArg
], ],
return:observableReturnType(entityInfoHref) return: observableReturnType(entityInfoHref)
}, },
getAliasFilterTypesByEntityTypes: { getAliasFilterTypesByEntityTypes: {
description: 'Get alias filter types by entity type', description: 'Get alias filter types by entity types',
meta: 'function', meta: 'function',
args: [ args: [
{name: 'entityTypes', type:`Array&lt;${entityTypeHref}|${aliasEntityTypeHref}&gt;`, description: 'Entity types'}, {name: 'entityTypes', type: `Array&lt;${entityTypeHref}|${aliasEntityTypeHref}&gt;`, description: 'Entity types'}
{name: 'searchText', type: 'string', description: 'Search text'}
], ],
return:{ return: {
type:`Array&lt;${aliasFilterTypeHref}$gt;`, type: `Array&lt;${aliasFilterTypeHref}$gt;`,
description:`Array of ${aliasFilterTypeHref} objects` description: `Array of ${aliasFilterTypeHref} objects`
} }
}, },
filterAliasByEntityTypes: { filterAliasByEntityTypes: {
description: 'Filter alias by entity type', description: 'Filter alias by entity types',
meta: 'function', meta: 'function',
args: [ args: [
{name: 'entityAlias', type:entityAliasHref, description: 'Alias of the entity'}, {name: 'entityAlias', type: entityAliasHref, description: 'Alias of the entity'},
{name: 'entityTypes', type:`Array&lt;${entityTypeHref}|${aliasEntityTypeHref}&gt;`, description: 'Entity types'} {name: 'entityTypes', type: `Array&lt;${entityTypeHref}|${aliasEntityTypeHref}&gt;`, description: 'Entity types'}
], ],
return:{ return: {
type:'boolean', type: 'boolean',
description:`Returns <code>boolean</code> variable based on the filter` description: `Returns <code>boolean</code> variable based on the filter`
} }
}, },
prepareAllowedEntityTypesList: { prepareAllowedEntityTypesList: {
description: 'Prepare allowed types of the entity list', description: 'Prepare allowed entity types list',
meta: 'function', meta: 'function',
args: [ args: [
{name: 'allowedEntityTypes', type:`Array&lt;${entityTypeHref}|${aliasEntityTypeHref}&gt;`, description: 'Entity types'}, {name: 'allowedEntityTypes', type: `Array&lt;${entityTypeHref}|${aliasEntityTypeHref}&gt;`, description: 'Entity types'},
{name: 'useAliasEntityTypes', type:'boolean', description: 'Use alias entity types'}, {name: 'useAliasEntityTypes', type: 'boolean', description: 'Use alias entity types'},
], ],
return:{ return: {
type:`Array&lt;${entityTypeHref}|${aliasEntityTypeHref}&gt;`, type: `Array&lt;${entityTypeHref}|${aliasEntityTypeHref}&gt;`,
description:`Returns entity types array` description: `Returns entity types array`
} }
}, },
getEntityKeys: { getEntityKeys: {
description: 'Get entity keys by id', description: 'Get entity keys by id',
meta: 'function', meta: 'function',
args: [ args: [
{name: 'entityId', type:entityIdHref, description: 'id of the entity'}, {name: 'entityId', type: entityIdHref, description: 'Id of the entity'},
{name: 'query', type:'string', description: 'Query'}, {name: 'query', type: 'string', description: 'Key name starts with'},
{name: 'type', type:dataKeyTypeHref, description: 'Query'}, {name: 'type', type: dataKeyTypeHref, description: 'Datakey type'},
requestConfigArg requestConfigArg
], ],
return:{ return: {
type:`Observable&lt;Array&lt;string&gt;&gt;`, type: `Observable&lt;Array&lt;string&gt;&gt;`,
description:`An <code>Observable</code> of <code>string</code> variable.` description: `An <code>Observable</code> of array of <code>string</code> variables.`
} }
// observableArrayReturnType('string')
}, },
createDatasourcesFromSubscriptionsInfo: { createDatasourcesFromSubscriptionsInfo: {
description: 'Create database from subscriptions info', description: 'Create datasources from subscriptions info',
meta: 'function', meta: 'function',
args: [ args: [
{name: 'subscriptionsInfo', type:'array<subscriptionInfoHref>', description: 'Subscriptions info'} {name: 'subscriptionsInfo', type: 'array<subscriptionInfoHref>', description: 'Subscriptions info'}
], ],
return:{ return: {
type:`Array&lt;${dataSourceHref}&gt;`, type: `Array&lt;${dataSourceHref}&gt;`,
description:`Array of <code>${dataSourceHref}</code> objects` description: `Array of <code>${dataSourceHref}</code> objects`
} }
}, },
createAlarmSourceFromSubscriptionInfo: { createAlarmSourceFromSubscriptionInfo: {
description: 'Create alarm source from subscriptions info', description: 'Create alarm source from subscriptions info',
meta: 'function', meta: 'function',
args: [ args: [
{name: 'subscriptionInfo', type:subscriptionInfoHref, description: 'Subscription info'} {name: 'subscriptionInfo', type: subscriptionInfoHref, description: 'Subscription info'}
], ],
return:{ return: {
type:`${dataSourceHref}`, type: `${dataSourceHref}`,
description:`<code>${dataSourceHref}</code> object` description: `<code>${dataSourceHref}</code> object`
} }
}, },
resolveAlias: { resolveAlias: {
description: 'Resolve alias', description: 'Resolve alias',
meta: 'function', meta: 'function',
args: [ args: [
{name: 'entityAlias', type:entityAliasHref, description: 'Alias of the entity'}, {name: 'entityAlias', type: entityAliasHref, description: 'Entity alias'},
{name: 'stateParams', type:stateParamsHref, description: 'State params'}, {name: 'stateParams', type: stateParamsHref, description: 'State params'},
], ],
return:observableReturnType(aliasInfoHref) return: observableReturnType(aliasInfoHref)
}, },
resolveAliasFilter: { resolveAliasFilter: {
description: 'Resolve alias filter', description: 'Resolve alias filter',
meta: 'function', meta: 'function',
args: [ args: [
{name: 'filter', type:entityAliasFilterHref, description: 'Entity alias filter'}, {name: 'filter', type: entityAliasFilterHref, description: 'Entity alias filter'},
{name: 'stateParams', type:stateParamsHref, description: 'State params'}, {name: 'stateParams', type: stateParamsHref, description: 'State params'},
], ],
return:observableReturnType(entityAliasFilterResultHref) return: observableReturnType(entityAliasFilterResultHref)
}, },
checkEntityAlias: { checkEntityAlias: {
description: 'Check entity alias', description: 'Check entity alias',
meta: 'function', meta: 'function',
args: [ args: [
{name: 'entityAlias', type:entityAliasHref, description: 'Alias of the entity'}, {name: 'entityAlias', type: entityAliasHref, description: 'Entity alias'},
], ],
return:observableReturnTypeVariable('boolean') return: observableReturnTypeVariable('boolean')
// observableReturnType('boolean')
}, },
saveEntityParameters: { saveEntityParameters: {
description: 'Save entity parameters', description: 'Save entity parameters',
meta: 'function', meta: 'function',
args: [ args: [
{name: 'entityType', type:entityTypeHref, description: 'Entity type'}, {name: 'entityType', type: entityTypeHref, description: 'Entity type'},
{name: 'entityData', type:importEntityDataHref, description: 'Data of the entity'}, {name: 'entityData', type: importEntityDataHref, description: 'Entity data'},
{name: 'update', type:'boolean', description: 'Update'}, {name: 'update', type: 'boolean', description: 'Update'},
requestConfigArg requestConfigArg
], ],
return:observableReturnType(importEntitiesResultInfoHref) return: observableReturnType(importEntitiesResultInfoHref)
}, },
saveEntityData: { saveEntityData: {
description: 'Save entity data', description: 'Save entity data',
meta: 'function', meta: 'function',
args: [ args: [
{name: 'entityId', type:entityIdHref, description: 'Id of the entity'}, {name: 'entityId', type: entityIdHref, description: 'Id of the entity'},
{name: 'entityData', type:importEntityDataHref, description: 'Data of the entity'}, {name: 'entityData', type: importEntityDataHref, description: 'Entity data'},
requestConfigArg requestConfigArg
], ],
return:observableReturnTypeVariable('any') return: observableReturnTypeVariable('any')
// observableReturnType('any')
}, },
} }
}, },
@ -1296,54 +1287,54 @@ export const serviceCompletions: TbEditorCompletions = {
description: 'Confirm', description: 'Confirm',
meta: 'function', meta: 'function',
args: [ args: [
{name: 'title', type:'string', description: 'Title'}, {name: 'title', type: 'string', description: 'Title'},
{name: 'message', type:'string', description: 'Message'}, {name: 'message', type: 'string', description: 'Message'},
{name: 'cancel', type:'string',optional: true, description: 'Cancel'}, {name: 'cancel', type: 'string', optional: true, description: 'Cancel'},
{name: 'ok', type:'string',optional: true, description: 'Ok'}, {name: 'ok', type: 'string', optional: true, description: 'Ok'},
{name: 'fullscreen', type:'boolean',optional: true, description: 'Fullscreen'}, {name: 'fullscreen', type: 'boolean', optional: true, description: 'Fullscreen'},
], ],
return:observableReturnTypeVariable('boolean') return: observableReturnTypeVariable('boolean')
}, },
alert: { alert: {
description: 'Alert', description: 'Alert',
meta: 'function', meta: 'function',
args: [ args: [
{name: 'title', type:'string', description: 'Title'}, {name: 'title', type: 'string', description: 'Title'},
{name: 'message', type:'string', description: 'Message'}, {name: 'message', type: 'string', description: 'Message'},
{name: 'ok', type:'string',optional: true, description: 'Ok'}, {name: 'ok', type: 'string', optional: true, description: 'Ok'},
{name: 'fullscreen', type:'boolean',optional: true, description: 'Fullscreen'}, {name: 'fullscreen', type: 'boolean', optional: true, description: 'Fullscreen'},
], ],
return:observableReturnTypeVariable('boolean') return: observableReturnTypeVariable('boolean')
}, },
colorPicker: { colorPicker: {
description: 'Color picker', description: 'Color picker',
meta: 'function', meta: 'function',
args: [ args: [
{name: 'color', type:'string', description: 'Сolor'}, {name: 'color', type: 'string', description: 'Сolor'},
], ],
return:observableReturnTypeVariable('string') return: observableReturnTypeVariable('string')
}, },
materialIconPicker: { materialIconPicker: {
description: 'Material icon picker', description: 'Material icon picker',
meta: 'function', meta: 'function',
args: [ args: [
{name: 'icon', type:'string', description: 'Icon'}, {name: 'icon', type: 'string', description: 'Icon'},
], ],
return:observableReturnTypeVariable('string') return: observableReturnTypeVariable('string')
}, },
forbidden: { forbidden: {
description: 'Forbidden', description: 'Forbidden',
meta: 'function', meta: 'function',
args: [ args: [
], ],
return:observableReturnTypeVariable('boolean') return: observableReturnTypeVariable('boolean')
}, },
todo: { todo: {
description: 'To do', description: 'To do',
meta: 'function', meta: 'function',
args: [ args: [
], ],
return:observableReturnTypeVariable('any') return: observableReturnTypeVariable('any')
}, },
} }
}, },
@ -1352,16 +1343,16 @@ export const serviceCompletions: TbEditorCompletions = {
'See <a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/modules/home/components/widget/dialog/custom-dialog.service.ts#L33">CustomDialogService</a> for API reference.', 'See <a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/modules/home/components/widget/dialog/custom-dialog.service.ts#L33">CustomDialogService</a> for API reference.',
meta: 'service', meta: 'service',
type: '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/modules/home/components/widget/dialog/custom-dialog.service.ts#L33">CustomDialogService</a>', type: '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/modules/home/components/widget/dialog/custom-dialog.service.ts#L33">CustomDialogService</a>',
children:{ children: {
customDialog: { customDialog: {
description: 'Custom Dialog', description: 'Custom Dialog',
meta: 'function', meta: 'function',
args: [ args: [
{name: 'template', type:'string', description: 'Template'}, {name: 'template', type: 'string', description: 'Template'},
{name: 'controller', type:customDialogComponentHref, description: 'Controller'}, {name: 'controller', type: customDialogComponentHref, description: 'Controller'},
{name: 'data', type:'any', description: 'Data'}, {name: 'data', type: 'any', description: 'Data', optional: true},
], ],
return:observableReturnTypeVariable('any') return: observableReturnTypeVariable('any')
}, },
} }
}, },
@ -1389,4 +1380,4 @@ export const serviceCompletions: TbEditorCompletions = {
meta: 'service', meta: 'service',
type: '<a href="https://angular.io/api/platform-browser/DomSanitizer">DomSanitizer</a>' type: '<a href="https://angular.io/api/platform-browser/DomSanitizer">DomSanitizer</a>'
} }
} };

Loading…
Cancel
Save