Commit 38847216cdcf8aa6903ad46244e79ed7c7e68b48

Authored by Igor Kulikov
2 parents 868234f1 e5e103be

Merge branch 'master' into develop/3.2

... ... @@ -25,5 +25,5 @@
25 25 'info-toast': notification.type === 'info'
26 26 }">
27 27 <div class="toast-text" [innerHTML]="notification.message"></div>
28   - <button #actionButton mat-button (click)="action()">{{ 'action.close' | translate }}</button>
  28 + <button #actionButton type="button" mat-button (click)="action()">{{ 'action.close' | translate }}</button>
29 29 </div>
... ...
... ... @@ -16,6 +16,33 @@
16 16 :host {
17 17 display: inline-block;
18 18 pointer-events: all;
  19 + &.toast-panel {
  20 + position: absolute;
  21 + top: 0;
  22 + bottom: 0;
  23 + left: 0;
  24 + right: 0;
  25 + z-index: 1000;
  26 + display: flex;
  27 + &.left {
  28 + justify-content: flex-start;
  29 + }
  30 + &.right {
  31 + justify-content: flex-end;
  32 + }
  33 + &.top {
  34 + align-items: flex-start;
  35 + }
  36 + &.bottom {
  37 + align-items: flex-end;
  38 + }
  39 + &.h-center {
  40 + justify-content: center;
  41 + }
  42 + &.v-center {
  43 + align-items: center;
  44 + }
  45 + }
19 46 .tb-toast {
20 47 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);
21 48 color: #fff;
... ...
... ... @@ -16,9 +16,9 @@
16 16
17 17 import {
18 18 AfterViewInit, ChangeDetectorRef,
19   - Component, ComponentRef,
  19 + Component, ComponentFactoryResolver, ComponentRef,
20 20 Directive,
21   - ElementRef,
  21 + ElementRef, HostBinding,
22 22 Inject,
23 23 Input,
24 24 NgZone,
... ... @@ -34,8 +34,7 @@ import { BreakpointObserver } from '@angular/cdk/layout';
34 34 import { MediaBreakpoints } from '@shared/models/constants';
35 35 import { MatButton } from '@angular/material/button';
36 36 import Timeout = NodeJS.Timeout;
37   -import { ConnectedPosition, Overlay, OverlayConfig, OverlayRef } from '@angular/cdk/overlay';
38   -import { ComponentPortal, PortalInjector } from '@angular/cdk/portal';
  37 +import { PortalInjector } from '@angular/cdk/portal';
39 38
40 39 @Directive({
41 40 selector: '[tb-toast]'
... ... @@ -49,7 +48,6 @@ export class ToastDirective implements AfterViewInit, OnDestroy {
49 48 private hideNotificationSubscription: Subscription = null;
50 49
51 50 private snackBarRef: MatSnackBarRef<any> = null;
52   - private overlayRef: OverlayRef;
53 51 private toastComponentRef: ComponentRef<TbSnackBarComponent>;
54 52 private currentMessage: NotificationMessage = null;
55 53
... ... @@ -58,7 +56,7 @@ export class ToastDirective implements AfterViewInit, OnDestroy {
58 56 constructor(private elementRef: ElementRef,
59 57 private viewContainerRef: ViewContainerRef,
60 58 private notificationService: NotificationService,
61   - private overlay: Overlay,
  59 + private componentFactoryResolver: ComponentFactoryResolver,
62 60 private snackBar: MatSnackBar,
63 61 private ngZone: NgZone,
64 62 private breakpointObserver: BreakpointObserver,
... ... @@ -104,9 +102,11 @@ export class ToastDirective implements AfterViewInit, OnDestroy {
104 102 if (this.snackBarRef) {
105 103 this.snackBarRef.dismiss();
106 104 }
107   -
108   - const position = this.overlay.position();
109   - let panelClass = ['tb-toast-panel'];
  105 + if (this.toastComponentRef) {
  106 + this.viewContainerRef.detach(0);
  107 + this.toastComponentRef.destroy();
  108 + }
  109 + let panelClass = ['tb-toast-panel', 'toast-panel'];
110 110 if (notificationMessage.panelClass) {
111 111 if (typeof notificationMessage.panelClass === 'string') {
112 112 panelClass.push(notificationMessage.panelClass);
... ... @@ -114,46 +114,35 @@ export class ToastDirective implements AfterViewInit, OnDestroy {
114 114 panelClass = panelClass.concat(notificationMessage.panelClass);
115 115 }
116 116 }
117   - const overlayConfig = new OverlayConfig({
118   - panelClass,
119   - backdropClass: 'cdk-overlay-transparent-backdrop',
120   - hasBackdrop: false,
121   - disposeOnNavigation: true
122   - });
123   - let originX;
124   - let originY;
125 117 const horizontalPosition = notificationMessage.horizontalPosition || 'left';
126 118 const verticalPosition = notificationMessage.verticalPosition || 'top';
127 119 if (horizontalPosition === 'start' || horizontalPosition === 'left') {
128   - originX = 'start';
  120 + panelClass.push('left');
129 121 } else if (horizontalPosition === 'end' || horizontalPosition === 'right') {
130   - originX = 'end';
  122 + panelClass.push('right');
131 123 } else {
132   - originX = 'center';
  124 + panelClass.push('h-center');
133 125 }
134 126 if (verticalPosition === 'top') {
135   - originY = 'top';
  127 + panelClass.push('top');
136 128 } else {
137   - originY = 'bottom';
  129 + panelClass.push('bottom');
138 130 }
139   - const connectedPosition: ConnectedPosition = {
140   - originX,
141   - originY,
142   - overlayX: originX,
143   - overlayY: originY
144   - };
145   - overlayConfig.positionStrategy = position.flexibleConnectedTo(this.elementRef)
146   - .withPositions([connectedPosition]);
147   - this.overlayRef = this.overlay.create(overlayConfig);
  131 +
  132 + const componentFactory = this.componentFactoryResolver.resolveComponentFactory(TbSnackBarComponent);
148 133 const data: ToastPanelData = {
149   - notification: notificationMessage
  134 + notification: notificationMessage,
  135 + panelClass,
  136 + destroyToastComponent: () => {
  137 + this.viewContainerRef.detach(0);
  138 + this.toastComponentRef.destroy();
  139 + }
150 140 };
151 141 const injectionTokens = new WeakMap<any, any>([
152   - [MAT_SNACK_BAR_DATA, data],
153   - [OverlayRef, this.overlayRef]
  142 + [MAT_SNACK_BAR_DATA, data]
154 143 ]);
155 144 const injector = new PortalInjector(this.viewContainerRef.injector, injectionTokens);
156   - this.toastComponentRef = this.overlayRef.attach(new ComponentPortal(TbSnackBarComponent, this.viewContainerRef, injector));
  145 + this.toastComponentRef = this.viewContainerRef.createComponent(componentFactory, 0, injector);
157 146 this.cd.detectChanges();
158 147
159 148 if (notificationMessage.duration && notificationMessage.duration > 0) {
... ... @@ -173,7 +162,6 @@ export class ToastDirective implements AfterViewInit, OnDestroy {
173 162 clearTimeout(this.dismissTimeout);
174 163 this.dismissTimeout = null;
175 164 }
176   - this.overlayRef = null;
177 165 this.toastComponentRef = null;
178 166 this.currentMessage = null;
179 167 });
... ... @@ -181,43 +169,45 @@ export class ToastDirective implements AfterViewInit, OnDestroy {
181 169 }
182 170
183 171 private showSnackBar(notificationMessage: NotificationMessage, isGtSm: boolean) {
184   - const data: ToastPanelData = {
185   - notification: notificationMessage,
186   - parent: this.elementRef
187   - };
188   - const config: MatSnackBarConfig = {
189   - horizontalPosition: notificationMessage.horizontalPosition || 'left',
190   - verticalPosition: !isGtSm ? 'bottom' : (notificationMessage.verticalPosition || 'top'),
191   - viewContainerRef: this.viewContainerRef,
192   - duration: notificationMessage.duration,
193   - panelClass: notificationMessage.panelClass,
194   - data
195   - };
196 172 this.ngZone.run(() => {
197 173 if (this.snackBarRef) {
198 174 this.snackBarRef.dismiss();
199 175 }
  176 + const data: ToastPanelData = {
  177 + notification: notificationMessage,
  178 + parent: this.elementRef,
  179 + panelClass: [],
  180 + destroyToastComponent: () => {}
  181 + };
  182 + const config: MatSnackBarConfig = {
  183 + horizontalPosition: notificationMessage.horizontalPosition || 'left',
  184 + verticalPosition: !isGtSm ? 'bottom' : (notificationMessage.verticalPosition || 'top'),
  185 + viewContainerRef: this.viewContainerRef,
  186 + duration: notificationMessage.duration,
  187 + panelClass: notificationMessage.panelClass,
  188 + data
  189 + };
200 190 this.snackBarRef = this.snackBar.openFromComponent(TbSnackBarComponent, config);
201   - });
202   - if (notificationMessage.duration && notificationMessage.duration > 0 && notificationMessage.forceDismiss) {
203   - if (this.dismissTimeout !== null) {
204   - clearTimeout(this.dismissTimeout);
205   - this.dismissTimeout = null;
206   - }
207   - this.dismissTimeout = setTimeout(() => {
208   - if (this.snackBarRef) {
209   - this.snackBarRef.instance.actionButton._elementRef.nativeElement.click();
  191 + if (notificationMessage.duration && notificationMessage.duration > 0 && notificationMessage.forceDismiss) {
  192 + if (this.dismissTimeout !== null) {
  193 + clearTimeout(this.dismissTimeout);
  194 + this.dismissTimeout = null;
210 195 }
211   - this.dismissTimeout = null;
212   - }, notificationMessage.duration);
213   - }
214   - this.snackBarRef.afterDismissed().subscribe(() => {
215   - if (this.dismissTimeout !== null) {
216   - clearTimeout(this.dismissTimeout);
217   - this.dismissTimeout = null;
  196 + this.dismissTimeout = setTimeout(() => {
  197 + if (this.snackBarRef) {
  198 + this.snackBarRef.instance.actionButton._elementRef.nativeElement.click();
  199 + }
  200 + this.dismissTimeout = null;
  201 + }, notificationMessage.duration);
218 202 }
219   - this.snackBarRef = null;
220   - this.currentMessage = null;
  203 + this.snackBarRef.afterDismissed().subscribe(() => {
  204 + if (this.dismissTimeout !== null) {
  205 + clearTimeout(this.dismissTimeout);
  206 + this.dismissTimeout = null;
  207 + }
  208 + this.snackBarRef = null;
  209 + this.currentMessage = null;
  210 + });
221 211 });
222 212 }
223 213
... ... @@ -235,8 +225,9 @@ export class ToastDirective implements AfterViewInit, OnDestroy {
235 225 }
236 226
237 227 ngOnDestroy(): void {
238   - if (this.overlayRef) {
239   - this.overlayRef.dispose();
  228 + if (this.toastComponentRef) {
  229 + this.viewContainerRef.detach(0);
  230 + this.toastComponentRef.destroy();
240 231 }
241 232 if (this.notificationSubscription) {
242 233 this.notificationSubscription.unsubscribe();
... ... @@ -250,6 +241,8 @@ export class ToastDirective implements AfterViewInit, OnDestroy {
250 241 interface ToastPanelData {
251 242 notification: NotificationMessage;
252 243 parent?: ElementRef;
  244 + panelClass: string[];
  245 + destroyToastComponent: () => void;
253 246 }
254 247
255 248 import {
... ... @@ -288,6 +281,11 @@ export class TbSnackBarComponent implements AfterViewInit, OnDestroy {
288 281
289 282 @ViewChild('actionButton', {static: true}) actionButton: MatButton;
290 283
  284 + @HostBinding('class')
  285 + get panelClass(): string[] {
  286 + return this.data.panelClass;
  287 + }
  288 +
291 289 private parentEl: HTMLElement;
292 290 private snackBarContainerEl: HTMLElement;
293 291 private parentScrollSubscription: Subscription = null;
... ... @@ -305,9 +303,7 @@ export class TbSnackBarComponent implements AfterViewInit, OnDestroy {
305 303 private data: ToastPanelData,
306 304 private elementRef: ElementRef,
307 305 @Optional()
308   - private snackBarRef: MatSnackBarRef<TbSnackBarComponent>,
309   - @Optional()
310   - private overlayRef: OverlayRef) {
  306 + private snackBarRef: MatSnackBarRef<TbSnackBarComponent>) {
311 307 this.animationState = !!this.snackBarRef ? 'default' : 'opened';
312 308 this.notification = data.notification;
313 309 }
... ... @@ -319,9 +315,8 @@ export class TbSnackBarComponent implements AfterViewInit, OnDestroy {
319 315 this.snackBarContainerEl.style.position = 'absolute';
320 316 this.updateContainerRect();
321 317 this.updatePosition(this.snackBarRef.containerInstance.snackBarConfig);
322   - const snackBarComponent = this;
323 318 this.parentScrollSubscription = onParentScrollOrWindowResize(this.parentEl).subscribe(() => {
324   - snackBarComponent.updateContainerRect();
  319 + this.updateContainerRect();
325 320 });
326 321 }
327 322 }
... ... @@ -373,7 +368,7 @@ export class TbSnackBarComponent implements AfterViewInit, OnDestroy {
373 368 const isFadeOut = (toState as ToastAnimationState) === 'closing';
374 369 const itFinished = this.animationState === 'closing';
375 370 if (isFadeOut && itFinished) {
376   - this.overlayRef.dispose();
  371 + this.data.destroyToastComponent();
377 372 }
378 373 }
379 374 }
... ...
... ... @@ -24,7 +24,7 @@ export const alarmDataHref = '<a href="https://github.com/thingsboard/thingsboar
24 24
25 25 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>';
26 26
27   -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>';
  27 +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>';
28 28
29 29 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>';
30 30
... ... @@ -32,7 +32,7 @@ export const pageDataHref = '<a href="https://github.com/thingsboard/thingsboard
32 32
33 33 export const deviceInfoHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/device.models.ts#L33">DeviceInfo</a>';
34 34
35   -export const assetInfoHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/asset.models.ts#L32">AssetInfo</a>'
  35 +export const assetInfoHref = '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/asset.models.ts#L32">AssetInfo</a>';
36 36
37 37 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>';
38 38
... ... @@ -84,15 +84,15 @@ export const stateParamsHref = '<a href="https://github.com/thingsboard/thingsbo
84 84
85 85 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>';
86 86
87   -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>'
  87 +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>';
88 88
89   -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>'
  89 +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>';
90 90
91   -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>'
  91 +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>';
92 92
93   -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>'
  93 +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>';
94 94
95   -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>'
  95 +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>';
96 96
97 97 export const pageLinkArg: FunctionArg = {
98 98 name: 'pageLink',
... ... @@ -135,21 +135,20 @@ export function observableArrayReturnType(objectType: string): FunctionArgType {
135 135 };
136 136 }
137 137
138   -export function observableBaseDataReturnType(objectType: string): FunctionArgType {
  138 +export function observableBaseDataReturnType(): FunctionArgType {
139 139 return {
140   - type: `Observable&lt;${baseDataHref}&lt;${objectType}&gt;&gt;`,
141   - description: `An <code>Observable</code> of page result as a <code>${baseDataHref}</code> holding array of <code>${objectType}</code> objects.`
  140 + type: `Observable&lt;${baseDataHref}&lt;${entityIdHref}&gt;&gt;`,
  141 + description: `An <code>Observable</code> of <code>${baseDataHref}</code> object.`
142 142 };
143 143 }
144 144
145   -export function observableArrayBaseDataReturnType(objectType: string): FunctionArgType {
  145 +export function observableArrayBaseDataReturnType(): FunctionArgType {
146 146 return {
147   - type: `Observable&lt;Array&lt;${baseDataHref}&lt;${objectType}&gt;&gt;&gt;`,
148   - description: `An <code>Observable</code> of page result as a <code>${baseDataHref}</code> holding array of <code>${objectType}</code> objects.`
  147 + type: `Observable&lt;Array&lt;${baseDataHref}&lt;${entityIdHref}&gt;&gt;&gt;`,
  148 + description: `An <code>Observable</code> of array of <code>${baseDataHref}</code> objects.`
149 149 };
150 150 }
151 151
152   -
153 152 export function observablePageDataReturnType(objectType: string): FunctionArgType {
154 153 return {
155 154 type: `Observable&lt;${pageDataHref}&lt;${objectType}&gt;&gt;`,
... ... @@ -157,8 +156,6 @@ export function observablePageDataReturnType(objectType: string): FunctionArgTyp
157 156 };
158 157 }
159 158
160   -
161   -
162 159 export const serviceCompletions: TbEditorCompletions = {
163 160 deviceService: {
164 161 description: 'Device Service API<br>' +
... ... @@ -362,7 +359,7 @@ export const serviceCompletions: TbEditorCompletions = {
362 359 type: '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/core/http/asset.service.ts#L29">AssetService</a>',
363 360 children: {
364 361 getTenantAssetInfos: {
365   - description: 'Get tenant asset',
  362 + description: 'Get tenant assets',
366 363 meta: 'function',
367 364 args: [
368 365 pageLinkArg,
... ... @@ -530,7 +527,7 @@ export const serviceCompletions: TbEditorCompletions = {
530 527 description: 'Get entity view info by id',
531 528 meta: 'function',
532 529 args: [
533   - {name: 'entityViewId', type: 'string', description: 'Id of the entities view'},
  530 + {name: 'entityViewId', type: 'string', description: 'Id of the entity view'},
534 531 requestConfigArg
535 532 ],
536 533 return: observableReturnType(entityViewInfoHref)
... ... @@ -575,7 +572,7 @@ export const serviceCompletions: TbEditorCompletions = {
575 572 meta: 'function',
576 573 args: [
577 574 {name: 'customerId', type: 'string', description: 'Id of the customer'},
578   - {name: 'entityViewId', type: 'string', description: 'Id of the entity viewId'},
  575 + {name: 'entityViewId', type: 'string', description: 'Id of the entity view'},
579 576 requestConfigArg
580 577 ],
581 578 return: observableReturnType(entityViewHref)
... ... @@ -596,7 +593,7 @@ export const serviceCompletions: TbEditorCompletions = {
596 593 {
597 594 name: 'query',
598 595 type: '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/shared/models/asset.models.ts#L37">AssetSearchQuery</a>',
599   - description: 'Asset search query object'
  596 + description: 'Entity view search query object'
600 597 },
601 598 requestConfigArg
602 599 ],
... ... @@ -655,7 +652,7 @@ export const serviceCompletions: TbEditorCompletions = {
655 652 type: '<a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/core/http/dashboard.service.ts#L32">DashboardService</a>',
656 653 children: {
657 654 getTenantDashboards: {
658   - description: 'Get tenant dashboard',
  655 + description: 'Get tenant dashboards',
659 656 meta: 'function',
660 657 args: [
661 658 pageLinkArg,
... ... @@ -664,16 +661,17 @@ export const serviceCompletions: TbEditorCompletions = {
664 661 return: observablePageDataReturnType(dashboardInfoHref)
665 662 },
666 663 getTenantDashboardsByTenantId: {
667   - description: 'Get tenant dashboards by id',
  664 + description: 'Get dashboards by tenant id',
668 665 meta: 'function',
669 666 args: [
670 667 {name: 'tenantId', type: 'string', description: 'Id of the tenant'},
671   - pageLinkArg
  668 + pageLinkArg,
  669 + requestConfigArg
672 670 ],
673 671 return: observablePageDataReturnType(dashboardInfoHref)
674 672 },
675 673 getCustomerDashboards: {
676   - description: 'Get customer dashboard by id',
  674 + description: 'Get dashboards by customer id',
677 675 meta: 'function',
678 676 args: [
679 677 {name: 'customerId', type: 'string', description: 'Id of the customer'},
... ... @@ -713,7 +711,7 @@ export const serviceCompletions: TbEditorCompletions = {
713 711 description: 'Delete dashboard by id',
714 712 meta: 'function',
715 713 args: [
716   - {name: 'dashboardId', type: 'string', description: 'Id of the entity view'},
  714 + {name: 'dashboardId', type: 'string', description: 'Id of the dashboard'},
717 715 requestConfigArg
718 716 ],
719 717 return: observableVoid()
... ... @@ -729,7 +727,7 @@ export const serviceCompletions: TbEditorCompletions = {
729 727 return: observableReturnType(dashboardHref)
730 728 },
731 729 unassignDashboardFromCustomer: {
732   - description: 'Unassign dashboard from any customer',
  730 + description: 'Unassign dashboard from specific customer',
733 731 meta: 'function',
734 732 args: [
735 733 {name: 'customerId', type: 'string', description: 'Id of the customer'},
... ... @@ -757,7 +755,7 @@ export const serviceCompletions: TbEditorCompletions = {
757 755 return: observableReturnType(dashboardHref)
758 756 },
759 757 updateDashboardCustomers: {
760   - description: 'Update dashboard by id',
  758 + description: 'Update customers assigned to dashboard by ids',
761 759 meta: 'function',
762 760 args: [
763 761 {name: 'dashboardId', type: 'string', description: 'Id of the dashboard'},
... ... @@ -767,7 +765,7 @@ export const serviceCompletions: TbEditorCompletions = {
767 765 return: observableReturnType(dashboardHref)
768 766 },
769 767 addDashboardCustomers: {
770   - description: 'Add dashboard customers by ids',
  768 + description: 'Assign (Add) customers to dashboard by ids',
771 769 meta: 'function',
772 770 args: [
773 771 {name: 'dashboardId', type: 'string', description: 'Id of the dashboard'},
... ... @@ -777,14 +775,14 @@ export const serviceCompletions: TbEditorCompletions = {
777 775 return: observableReturnType(dashboardHref)
778 776 },
779 777 removeDashboardCustomers: {
780   - description: 'Remove dashboard customers dy ids',
  778 + description: 'Unassign (Remove) customers from dashboard by ids',
781 779 meta: 'function',
782 780 args: [
783 781 {name: 'dashboardId', type: 'string', description: 'Id of the dashboard'},
784 782 {name: 'customerIds', type: `Array&lt;string&gt;`, description: 'Id of the customers'},
785 783 requestConfigArg
786 784 ],
787   - return: observableArrayReturnType(dashboardHref)
  785 + return: observableReturnType(dashboardHref)
788 786 },
789 787 getPublicDashboardLink: {
790 788 description: 'Get public dashboard link',
... ... @@ -798,7 +796,7 @@ export const serviceCompletions: TbEditorCompletions = {
798 796 }
799 797 },
800 798 getServerTimeDiff: {
801   - description: 'remove dashboard customers ',
  799 + description: 'Get time difference',
802 800 meta: 'function',
803 801 args: [
804 802 ],
... ... @@ -822,7 +820,7 @@ export const serviceCompletions: TbEditorCompletions = {
822 820 return: observablePageDataReturnType(userHref)
823 821 },
824 822 getTenantAdmins: {
825   - description: 'Get tenant admins by id',
  823 + description: 'Get tenant admins by id',
826 824 meta: 'function',
827 825 args: [
828 826 {name: 'tenantId', type: 'string', description: 'Id of the tenant'},
... ... @@ -832,10 +830,10 @@ export const serviceCompletions: TbEditorCompletions = {
832 830 return: observablePageDataReturnType(userHref)
833 831 },
834 832 getCustomerUsers: {
835   - description: 'Get customer users by id',
  833 + description: 'Get customer users by id',
836 834 meta: 'function',
837 835 args: [
838   - {name: 'customerId', type: 'string', description: 'id of the customer'},
  836 + {name: 'customerId', type: 'string', description: 'Id of the customer'},
839 837 pageLinkArg,
840 838 requestConfigArg
841 839 ],
... ... @@ -845,7 +843,7 @@ export const serviceCompletions: TbEditorCompletions = {
845 843 description: 'Get user by id',
846 844 meta: 'function',
847 845 args: [
848   - {name: 'userId', type: 'string', description: 'id of the user'},
  846 + {name: 'userId', type: 'string', description: 'Id of the user'},
849 847 requestConfigArg
850 848 ],
851 849 return: observableReturnType(userHref)
... ... @@ -855,6 +853,7 @@ export const serviceCompletions: TbEditorCompletions = {
855 853 meta: 'function',
856 854 args: [
857 855 {name: 'user', type: userHref, description: 'User object to save'},
  856 + {name: 'sendActivationMail', type: 'boolean', description: 'Send activation email', optional: true},
858 857 requestConfigArg
859 858 ],
860 859 return: observableReturnType(userHref)
... ... @@ -876,7 +875,7 @@ export const serviceCompletions: TbEditorCompletions = {
876 875 {name: 'userCredentialsEnabled', type: 'boolean', description: 'User credentials enabled'},
877 876 requestConfigArg
878 877 ],
879   - return: observableReturnType(userHref)
  878 + return: observableReturnTypeVariable('any')
880 879 },
881 880 getActivationLink: {
882 881 description: 'Get activation link by id',
... ... @@ -885,7 +884,7 @@ export const serviceCompletions: TbEditorCompletions = {
885 884 {name: 'userId', type: 'string', description: 'Id of the user'},
886 885 requestConfigArg
887 886 ],
888   - return:observableReturnTypeVariable('string')
  887 + return: observableReturnTypeVariable('string')
889 888 },
890 889 sendActivationEmail: {
891 890 description: 'Send activation email',
... ... @@ -928,8 +927,7 @@ export const serviceCompletions: TbEditorCompletions = {
928 927 description: 'Delete relations by entity id',
929 928 meta: 'function',
930 929 args: [
931   - {name: 'entityId', type: entityIdHref, description: 'Id to the entity'},
932   - {name: 'relationType', type: 'string', description: 'Relation type'},
  930 + {name: 'entityId', type: entityIdHref, description: 'Entity Id'},
933 931 requestConfigArg
934 932 ],
935 933 return: observableVoid()
... ... @@ -1005,7 +1003,7 @@ export const serviceCompletions: TbEditorCompletions = {
1005 1003 description: 'Find by query',
1006 1004 meta: 'function',
1007 1005 args: [
1008   - {name: 'query', type: entityRelationsQueryHref, description: 'Query'},
  1006 + {name: 'query', type: entityRelationsQueryHref, description: 'Entity relations query'},
1009 1007 requestConfigArg
1010 1008 ],
1011 1009 return: observableArrayReturnType(entityRelationHref)
... ... @@ -1014,7 +1012,7 @@ export const serviceCompletions: TbEditorCompletions = {
1014 1012 description: 'Find info by query',
1015 1013 meta: 'function',
1016 1014 args: [
1017   - {name: 'query', type: entityRelationsQueryHref, description: 'Query'},
  1015 + {name: 'query', type: entityRelationsQueryHref, description: 'Entity relations query'},
1018 1016 requestConfigArg
1019 1017 ],
1020 1018 return: observableArrayReturnType(entityRelationInfoHref)
... ... @@ -1032,8 +1030,8 @@ export const serviceCompletions: TbEditorCompletions = {
1032 1030 meta: 'function',
1033 1031 args: [
1034 1032 {name: 'entityId', type: entityIdHref, description: 'Id of the entity'},
1035   - {name: 'attributeScope', type: attributeScopeHref, description: 'Atribute scope'},
1036   - {name: 'keys', type:`Array&lt;string&gt;`, description: 'Array of the keys'},
  1033 + {name: 'attributeScope', type: attributeScopeHref, description: 'Attribute scope'},
  1034 + {name: 'keys', type: `Array&lt;string&gt;`, description: 'Array of the keys'},
1037 1035 requestConfigArg
1038 1036 ],
1039 1037 return: observableArrayReturnType(attributeDataHref)
... ... @@ -1043,8 +1041,8 @@ export const serviceCompletions: TbEditorCompletions = {
1043 1041 meta: 'function',
1044 1042 args: [
1045 1043 {name: 'entityId', type: entityIdHref, description: 'Id of the entity'},
1046   - {name: 'attributeScope', type: attributeScopeHref, description: 'Atribute scope'},
1047   - {name: 'attributes', type: `array&lt;${attributeDataHref}&gt;`, description: 'Array of the attributes'},
  1044 + {name: 'attributeScope', type: attributeScopeHref, description: 'Attribute scope'},
  1045 + {name: 'attributes', type: `array&lt;${attributeDataHref}&gt;`, description: 'Array of the attributes data'},
1048 1046 requestConfigArg
1049 1047 ],
1050 1048 return: observableReturnTypeVariable('any')
... ... @@ -1054,11 +1052,11 @@ export const serviceCompletions: TbEditorCompletions = {
1054 1052 meta: 'function',
1055 1053 args: [
1056 1054 {name: 'entityId', type: entityIdHref, description: 'Id of the entity'},
1057   - {name: 'timeseries', type: `Array&lt;${attributeDataHref}&gt;>`, description: 'Array of the timeseries'},
1058   - {name: 'deleteAllDataForKeys', type: 'boolean',optional: true, description: 'Delete all data for keys'},
  1055 + {name: 'timeseries', type: `Array&lt;${attributeDataHref}&gt;>`, description: 'Array of the timeseries data'},
  1056 + {name: 'deleteAllDataForKeys', type: 'boolean', optional: true, description: 'Delete all data for keys'},
1059 1057 requestConfigArg
1060 1058 ],
1061   - return:observableReturnTypeVariable('any')
  1059 + return: observableReturnTypeVariable('any')
1062 1060 },
1063 1061 saveEntityAttributes: {
1064 1062 description: 'Save entity attributes',
... ... @@ -1066,7 +1064,7 @@ export const serviceCompletions: TbEditorCompletions = {
1066 1064 args: [
1067 1065 {name: 'entityId', type: entityIdHref, description: 'Id of the entity'},
1068 1066 {name: 'attributeScope', type: attributeScopeHref, description: 'Attribute scope'},
1069   - {name: 'attributes', type: 'Array&lt;${attributeDataHref}&gt;>', description: 'Array of the attributes'},
  1067 + {name: 'attributes', type: 'Array&lt;${attributeDataHref}&gt;>', description: 'Array of the attributes data'},
1070 1068 requestConfigArg
1071 1069 ],
1072 1070 return: observableReturnTypeVariable('any')
... ... @@ -1077,10 +1075,10 @@ export const serviceCompletions: TbEditorCompletions = {
1077 1075 args: [
1078 1076 {name: 'entityId', type: entityIdHref, description: 'Id of the entity'},
1079 1077 {name: 'timeseriesScope', type: 'string', description: 'Timeseries scope'},
1080   - {name: 'timeseries', type: `Array&lt;attributeDataHref&gt;`, description: 'Array of the timeseries'},
  1078 + {name: 'timeseries', type: `Array&lt;attributeDataHref&gt;`, description: 'Array of the timeseries data'},
1081 1079 requestConfigArg
1082 1080 ],
1083   - return:observableReturnTypeVariable('any')
  1081 + return: observableReturnTypeVariable('any')
1084 1082 },
1085 1083 }
1086 1084 },
... ... @@ -1098,7 +1096,7 @@ export const serviceCompletions: TbEditorCompletions = {
1098 1096 {name: 'entityId', type: 'string', description: 'Id of the entity'},
1099 1097 requestConfigArg
1100 1098 ],
1101   - return:observableBaseDataReturnType(entityIdHref)
  1099 + return: observableBaseDataReturnType()
1102 1100 },
1103 1101 getEntities: {
1104 1102 description: 'Get entities by ids',
... ... @@ -1108,181 +1106,174 @@ export const serviceCompletions: TbEditorCompletions = {
1108 1106 {name: 'entityIds', type: `Array&lt;string&gt;`, description: 'Ids of the entities'},
1109 1107 requestConfigArg
1110 1108 ],
1111   - return:observableArrayBaseDataReturnType(entityIdHref)
  1109 + return: observableArrayBaseDataReturnType()
1112 1110 },
1113 1111 getEntitiesByNameFilter: {
1114 1112 description: 'Get entities by name filter',
1115 1113 meta: 'function',
1116 1114 args: [
1117 1115 {name: 'entityType', type: entityTypeHref, description: 'Entity type'},
1118   - {name: 'entityNameFilter', type: 'string', description: 'Name filter of the entity'},
  1116 + {name: 'entityNameFilter', type: 'string', description: 'Name filter for the entity'},
1119 1117 {name: 'pageSize', type: 'number', description: 'Size of the page'},
1120   - {name: 'subType', type: 'string',optional: true, description: 'Subtype'},
  1118 + {name: 'subType', type: 'string', optional: true, description: 'Subtype'},
1121 1119 requestConfigArg
1122 1120 ],
1123   - return:observableArrayBaseDataReturnType(entityIdHref)
  1121 + return: observableArrayBaseDataReturnType()
1124 1122 },
1125 1123 findEntityDataByQuery: {
1126 1124 description: 'Find entity data by query',
1127 1125 meta: 'function',
1128 1126 args: [
1129   - {name: 'query', type: entityDataQueryHref, description: 'Query'},
1130   -
  1127 + {name: 'query', type: entityDataQueryHref, description: 'Entity data query'},
1131 1128 requestConfigArg
1132 1129 ],
1133   - return:observablePageDataReturnType(entityDataHref)
  1130 + return: observablePageDataReturnType(entityDataHref)
1134 1131 },
1135 1132 findAlarmDataByQuery: {
1136 1133 description: 'Find alarm data by query',
1137 1134 meta: 'function',
1138 1135 args: [
1139   - {name: 'query', type: alarmDataQueryHref, description: 'Query'},
  1136 + {name: 'query', type: alarmDataQueryHref, description: 'Alarm data query'},
1140 1137 requestConfigArg
1141 1138 ],
1142   - return:observablePageDataReturnType(alarmDataHref)
  1139 + return: observablePageDataReturnType(alarmDataHref)
1143 1140 },
1144 1141 findEntityInfosByFilterAndName: {
1145 1142 description: 'Find entity infos by filter and name',
1146 1143 meta: 'function',
1147 1144 args: [
1148   - {name: 'filter', type: entityFilterHref, description: 'Filter of the entity'},
  1145 + {name: 'filter', type: entityFilterHref, description: 'Filter for the entities'},
1149 1146 {name: 'searchText', type: 'string', description: 'Search text'},
1150 1147 requestConfigArg
1151 1148 ],
1152   - return:observablePageDataReturnType(entityInfoHref)
  1149 + return: observablePageDataReturnType(entityInfoHref)
1153 1150 },
1154 1151 findSingleEntityInfoByEntityFilter: {
1155   - description: 'Find single entity infos by filter of the entity ',
  1152 + description: 'Find single entity infos by filter',
1156 1153 meta: 'function',
1157 1154 args: [
1158   - {name: 'filter', type: entityFilterHref, description: 'Filter of the entity'},
1159   - {name: 'searchText', type: 'string', description: 'search text'},
  1155 + {name: 'filter', type: entityFilterHref, description: 'Filter for the entity'},
1160 1156 requestConfigArg
1161 1157 ],
1162   - return:observableReturnType(entityInfoHref)
  1158 + return: observableReturnType(entityInfoHref)
1163 1159 },
1164 1160 getAliasFilterTypesByEntityTypes: {
1165   - description: 'Get alias filter types by entity type',
  1161 + description: 'Get alias filter types by entity types',
1166 1162 meta: 'function',
1167 1163 args: [
1168   - {name: 'entityTypes', type:`Array&lt;${entityTypeHref}|${aliasEntityTypeHref}&gt;`, description: 'Entity types'},
1169   - {name: 'searchText', type: 'string', description: 'Search text'}
  1164 + {name: 'entityTypes', type: `Array&lt;${entityTypeHref}|${aliasEntityTypeHref}&gt;`, description: 'Entity types'}
1170 1165 ],
1171   - return:{
1172   - type:`Array&lt;${aliasFilterTypeHref}$gt;`,
1173   - description:`Array of ${aliasFilterTypeHref} objects`
  1166 + return: {
  1167 + type: `Array&lt;${aliasFilterTypeHref}$gt;`,
  1168 + description: `Array of ${aliasFilterTypeHref} objects`
1174 1169 }
1175 1170 },
1176 1171 filterAliasByEntityTypes: {
1177   - description: 'Filter alias by entity type',
  1172 + description: 'Filter alias by entity types',
1178 1173 meta: 'function',
1179 1174 args: [
1180   - {name: 'entityAlias', type:entityAliasHref, description: 'Alias of the entity'},
1181   - {name: 'entityTypes', type:`Array&lt;${entityTypeHref}|${aliasEntityTypeHref}&gt;`, description: 'Entity types'}
  1175 + {name: 'entityAlias', type: entityAliasHref, description: 'Alias of the entity'},
  1176 + {name: 'entityTypes', type: `Array&lt;${entityTypeHref}|${aliasEntityTypeHref}&gt;`, description: 'Entity types'}
1182 1177 ],
1183   - return:{
1184   - type:'boolean',
1185   - description:`Returns <code>boolean</code> variable based on the filter`
  1178 + return: {
  1179 + type: 'boolean',
  1180 + description: `Returns <code>boolean</code> variable based on the filter`
1186 1181 }
1187 1182 },
1188 1183 prepareAllowedEntityTypesList: {
1189   - description: 'Prepare allowed types of the entity list',
  1184 + description: 'Prepare allowed entity types list',
1190 1185 meta: 'function',
1191 1186 args: [
1192   - {name: 'allowedEntityTypes', type:`Array&lt;${entityTypeHref}|${aliasEntityTypeHref}&gt;`, description: 'Entity types'},
1193   - {name: 'useAliasEntityTypes', type:'boolean', description: 'Use alias entity types'},
  1187 + {name: 'allowedEntityTypes', type: `Array&lt;${entityTypeHref}|${aliasEntityTypeHref}&gt;`, description: 'Entity types'},
  1188 + {name: 'useAliasEntityTypes', type: 'boolean', description: 'Use alias entity types'},
1194 1189 ],
1195   - return:{
1196   - type:`Array&lt;${entityTypeHref}|${aliasEntityTypeHref}&gt;`,
1197   - description:`Returns entity types array`
  1190 + return: {
  1191 + type: `Array&lt;${entityTypeHref}|${aliasEntityTypeHref}&gt;`,
  1192 + description: `Returns entity types array`
1198 1193 }
1199 1194 },
1200 1195 getEntityKeys: {
1201 1196 description: 'Get entity keys by id',
1202 1197 meta: 'function',
1203 1198 args: [
1204   - {name: 'entityId', type:entityIdHref, description: 'id of the entity'},
1205   - {name: 'query', type:'string', description: 'Query'},
1206   - {name: 'type', type:dataKeyTypeHref, description: 'Query'},
  1199 + {name: 'entityId', type: entityIdHref, description: 'Id of the entity'},
  1200 + {name: 'query', type: 'string', description: 'Key name starts with'},
  1201 + {name: 'type', type: dataKeyTypeHref, description: 'Datakey type'},
1207 1202 requestConfigArg
1208 1203 ],
1209   - return:{
1210   - type:`Observable&lt;Array&lt;string&gt;&gt;`,
1211   - description:`An <code>Observable</code> of <code>string</code> variable.`
  1204 + return: {
  1205 + type: `Observable&lt;Array&lt;string&gt;&gt;`,
  1206 + description: `An <code>Observable</code> of array of <code>string</code> variables.`
1212 1207 }
1213   - // observableArrayReturnType('string')
1214 1208 },
1215 1209 createDatasourcesFromSubscriptionsInfo: {
1216   - description: 'Create database from subscriptions info',
  1210 + description: 'Create datasources from subscriptions info',
1217 1211 meta: 'function',
1218 1212 args: [
1219   - {name: 'subscriptionsInfo', type:'array<subscriptionInfoHref>', description: 'Subscriptions info'}
  1213 + {name: 'subscriptionsInfo', type: 'array<subscriptionInfoHref>', description: 'Subscriptions info'}
1220 1214 ],
1221   - return:{
1222   - type:`Array&lt;${dataSourceHref}&gt;`,
1223   - description:`Array of <code>${dataSourceHref}</code> objects`
  1215 + return: {
  1216 + type: `Array&lt;${dataSourceHref}&gt;`,
  1217 + description: `Array of <code>${dataSourceHref}</code> objects`
1224 1218 }
1225 1219 },
1226 1220 createAlarmSourceFromSubscriptionInfo: {
1227 1221 description: 'Create alarm source from subscriptions info',
1228 1222 meta: 'function',
1229 1223 args: [
1230   - {name: 'subscriptionInfo', type:subscriptionInfoHref, description: 'Subscription info'}
  1224 + {name: 'subscriptionInfo', type: subscriptionInfoHref, description: 'Subscription info'}
1231 1225 ],
1232   - return:{
1233   - type:`${dataSourceHref}`,
1234   - description:`<code>${dataSourceHref}</code> object`
  1226 + return: {
  1227 + type: `${dataSourceHref}`,
  1228 + description: `<code>${dataSourceHref}</code> object`
1235 1229 }
1236 1230 },
1237 1231 resolveAlias: {
1238 1232 description: 'Resolve alias',
1239 1233 meta: 'function',
1240 1234 args: [
1241   - {name: 'entityAlias', type:entityAliasHref, description: 'Alias of the entity'},
1242   - {name: 'stateParams', type:stateParamsHref, description: 'State params'},
  1235 + {name: 'entityAlias', type: entityAliasHref, description: 'Entity alias'},
  1236 + {name: 'stateParams', type: stateParamsHref, description: 'State params'},
1243 1237 ],
1244   - return:observableReturnType(aliasInfoHref)
  1238 + return: observableReturnType(aliasInfoHref)
1245 1239 },
1246 1240 resolveAliasFilter: {
1247 1241 description: 'Resolve alias filter',
1248 1242 meta: 'function',
1249 1243 args: [
1250   - {name: 'filter', type:entityAliasFilterHref, description: 'Entity alias filter'},
1251   - {name: 'stateParams', type:stateParamsHref, description: 'State params'},
  1244 + {name: 'filter', type: entityAliasFilterHref, description: 'Entity alias filter'},
  1245 + {name: 'stateParams', type: stateParamsHref, description: 'State params'},
1252 1246 ],
1253   - return:observableReturnType(entityAliasFilterResultHref)
  1247 + return: observableReturnType(entityAliasFilterResultHref)
1254 1248 },
1255 1249 checkEntityAlias: {
1256 1250 description: 'Check entity alias',
1257 1251 meta: 'function',
1258 1252 args: [
1259   - {name: 'entityAlias', type:entityAliasHref, description: 'Alias of the entity'},
  1253 + {name: 'entityAlias', type: entityAliasHref, description: 'Entity alias'},
1260 1254 ],
1261   - return:observableReturnTypeVariable('boolean')
1262   - // observableReturnType('boolean')
  1255 + return: observableReturnTypeVariable('boolean')
1263 1256 },
1264 1257 saveEntityParameters: {
1265 1258 description: 'Save entity parameters',
1266 1259 meta: 'function',
1267 1260 args: [
1268   - {name: 'entityType', type:entityTypeHref, description: 'Entity type'},
1269   - {name: 'entityData', type:importEntityDataHref, description: 'Data of the entity'},
1270   - {name: 'update', type:'boolean', description: 'Update'},
  1261 + {name: 'entityType', type: entityTypeHref, description: 'Entity type'},
  1262 + {name: 'entityData', type: importEntityDataHref, description: 'Entity data'},
  1263 + {name: 'update', type: 'boolean', description: 'Update'},
1271 1264 requestConfigArg
1272 1265 ],
1273   - return:observableReturnType(importEntitiesResultInfoHref)
  1266 + return: observableReturnType(importEntitiesResultInfoHref)
1274 1267 },
1275 1268 saveEntityData: {
1276 1269 description: 'Save entity data',
1277 1270 meta: 'function',
1278 1271 args: [
1279   - {name: 'entityId', type:entityIdHref, description: 'Id of the entity'},
1280   - {name: 'entityData', type:importEntityDataHref, description: 'Data of the entity'},
  1272 + {name: 'entityId', type: entityIdHref, description: 'Id of the entity'},
  1273 + {name: 'entityData', type: importEntityDataHref, description: 'Entity data'},
1281 1274 requestConfigArg
1282 1275 ],
1283   - return:observableReturnTypeVariable('any')
1284   -
1285   - // observableReturnType('any')
  1276 + return: observableReturnTypeVariable('any')
1286 1277 },
1287 1278 }
1288 1279 },
... ... @@ -1296,54 +1287,54 @@ export const serviceCompletions: TbEditorCompletions = {
1296 1287 description: 'Confirm',
1297 1288 meta: 'function',
1298 1289 args: [
1299   - {name: 'title', type:'string', description: 'Title'},
1300   - {name: 'message', type:'string', description: 'Message'},
1301   - {name: 'cancel', type:'string',optional: true, description: 'Cancel'},
1302   - {name: 'ok', type:'string',optional: true, description: 'Ok'},
1303   - {name: 'fullscreen', type:'boolean',optional: true, description: 'Fullscreen'},
  1290 + {name: 'title', type: 'string', description: 'Title'},
  1291 + {name: 'message', type: 'string', description: 'Message'},
  1292 + {name: 'cancel', type: 'string', optional: true, description: 'Cancel'},
  1293 + {name: 'ok', type: 'string', optional: true, description: 'Ok'},
  1294 + {name: 'fullscreen', type: 'boolean', optional: true, description: 'Fullscreen'},
1304 1295 ],
1305   - return:observableReturnTypeVariable('boolean')
  1296 + return: observableReturnTypeVariable('boolean')
1306 1297 },
1307 1298 alert: {
1308 1299 description: 'Alert',
1309 1300 meta: 'function',
1310 1301 args: [
1311   - {name: 'title', type:'string', description: 'Title'},
1312   - {name: 'message', type:'string', description: 'Message'},
1313   - {name: 'ok', type:'string',optional: true, description: 'Ok'},
1314   - {name: 'fullscreen', type:'boolean',optional: true, description: 'Fullscreen'},
  1302 + {name: 'title', type: 'string', description: 'Title'},
  1303 + {name: 'message', type: 'string', description: 'Message'},
  1304 + {name: 'ok', type: 'string', optional: true, description: 'Ok'},
  1305 + {name: 'fullscreen', type: 'boolean', optional: true, description: 'Fullscreen'},
1315 1306 ],
1316   - return:observableReturnTypeVariable('boolean')
  1307 + return: observableReturnTypeVariable('boolean')
1317 1308 },
1318 1309 colorPicker: {
1319 1310 description: 'Color picker',
1320 1311 meta: 'function',
1321 1312 args: [
1322   - {name: 'color', type:'string', description: 'Сolor'},
  1313 + {name: 'color', type: 'string', description: 'Сolor'},
1323 1314 ],
1324   - return:observableReturnTypeVariable('string')
  1315 + return: observableReturnTypeVariable('string')
1325 1316 },
1326 1317 materialIconPicker: {
1327 1318 description: 'Material icon picker',
1328 1319 meta: 'function',
1329 1320 args: [
1330   - {name: 'icon', type:'string', description: 'Icon'},
  1321 + {name: 'icon', type: 'string', description: 'Icon'},
1331 1322 ],
1332   - return:observableReturnTypeVariable('string')
  1323 + return: observableReturnTypeVariable('string')
1333 1324 },
1334 1325 forbidden: {
1335 1326 description: 'Forbidden',
1336 1327 meta: 'function',
1337 1328 args: [
1338 1329 ],
1339   - return:observableReturnTypeVariable('boolean')
  1330 + return: observableReturnTypeVariable('boolean')
1340 1331 },
1341 1332 todo: {
1342 1333 description: 'To do',
1343 1334 meta: 'function',
1344 1335 args: [
1345 1336 ],
1346   - return:observableReturnTypeVariable('any')
  1337 + return: observableReturnTypeVariable('any')
1347 1338 },
1348 1339 }
1349 1340 },
... ... @@ -1352,16 +1343,16 @@ export const serviceCompletions: TbEditorCompletions = {
1352 1343 '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.',
1353 1344 meta: 'service',
1354 1345 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>',
1355   - children:{
  1346 + children: {
1356 1347 customDialog: {
1357 1348 description: 'Custom Dialog',
1358 1349 meta: 'function',
1359 1350 args: [
1360   - {name: 'template', type:'string', description: 'Template'},
1361   - {name: 'controller', type:customDialogComponentHref, description: 'Controller'},
1362   - {name: 'data', type:'any', description: 'Data'},
  1351 + {name: 'template', type: 'string', description: 'Template'},
  1352 + {name: 'controller', type: customDialogComponentHref, description: 'Controller'},
  1353 + {name: 'data', type: 'any', description: 'Data', optional: true},
1363 1354 ],
1364   - return:observableReturnTypeVariable('any')
  1355 + return: observableReturnTypeVariable('any')
1365 1356 },
1366 1357 }
1367 1358 },
... ... @@ -1389,4 +1380,4 @@ export const serviceCompletions: TbEditorCompletions = {
1389 1380 meta: 'service',
1390 1381 type: '<a href="https://angular.io/api/platform-browser/DomSanitizer">DomSanitizer</a>'
1391 1382 }
1392   -}
  1383 +};
... ...