Commit 8750b26f1deb17a5e0cce67141b9ab0bec64f4ba
Merge branch 'master' of github.com:thingsboard/thingsboard
Showing
4 changed files
with
27 additions
and
0 deletions
... | ... | @@ -40,6 +40,7 @@ import { DialogService } from '@core/services/dialog.service'; |
40 | 40 | import { CustomDialogService } from '@home/components/widget/dialog/custom-dialog.service'; |
41 | 41 | import { DatePipe } from '@angular/common'; |
42 | 42 | import { TranslateService } from '@ngx-translate/core'; |
43 | +import { DomSanitizer } from '@angular/platform-browser'; | |
43 | 44 | |
44 | 45 | export class DynamicWidgetComponent extends PageComponent implements IDynamicWidgetComponent, OnInit, OnDestroy { |
45 | 46 | |
... | ... | @@ -74,6 +75,7 @@ export class DynamicWidgetComponent extends PageComponent implements IDynamicWid |
74 | 75 | this.ctx.date = $injector.get(DatePipe); |
75 | 76 | this.ctx.translate = $injector.get(TranslateService); |
76 | 77 | this.ctx.http = $injector.get(HttpClient); |
78 | + this.ctx.sanitizer = $injector.get(DomSanitizer); | |
77 | 79 | |
78 | 80 | this.ctx.$scope = this; |
79 | 81 | if (this.ctx.defaultSubscription) { | ... | ... |
... | ... | @@ -75,6 +75,7 @@ import { DatePipe } from '@angular/common'; |
75 | 75 | import { TranslateService } from '@ngx-translate/core'; |
76 | 76 | import { PageLink } from '@shared/models/page/page-link'; |
77 | 77 | import { SortOrder } from '@shared/models/page/sort-order'; |
78 | +import { DomSanitizer } from '@angular/platform-browser'; | |
78 | 79 | |
79 | 80 | export interface IWidgetAction { |
80 | 81 | name: string; |
... | ... | @@ -155,6 +156,7 @@ export class WidgetContext { |
155 | 156 | date: DatePipe; |
156 | 157 | translate: TranslateService; |
157 | 158 | http: HttpClient; |
159 | + sanitizer: DomSanitizer; | |
158 | 160 | |
159 | 161 | private changeDetectorValue: ChangeDetectorRef; |
160 | 162 | ... | ... |
... | ... | @@ -1382,5 +1382,11 @@ export const serviceCompletions: TbEditorCompletions = { |
1382 | 1382 | 'See <a href="https://angular.io/api/common/http/HttpClient">HttpClient</a> for API reference.', |
1383 | 1383 | meta: 'service', |
1384 | 1384 | type: '<a href="https://angular.io/api/common/http/HttpClient">HttpClient</a>' |
1385 | + }, | |
1386 | + sanitizer: { | |
1387 | + description: 'DomSanitizer Service<br>' + | |
1388 | + 'See <a href="https://angular.io/api/platform-browser/DomSanitizer">DomSanitizer</a> for API reference.', | |
1389 | + meta: 'service', | |
1390 | + type: '<a href="https://angular.io/api/platform-browser/DomSanitizer">DomSanitizer</a>' | |
1385 | 1391 | } |
1386 | 1392 | } | ... | ... |
... | ... | @@ -579,6 +579,23 @@ export const widgetContextCompletions: TbEditorCompletions = { |
579 | 579 | } |
580 | 580 | ] |
581 | 581 | }, |
582 | + pushAndOpenState: { | |
583 | + description: 'Navigate to new dashboard state and adding intermediate states.', | |
584 | + meta: 'function', | |
585 | + args: [ | |
586 | + { | |
587 | + name: 'id', | |
588 | + description: 'An array state object of the target dashboard state.', | |
589 | + type: 'Array <a href="https://github.com/thingsboard/thingsboard/blob/13e6b10b7ab830e64d31b99614a9d95a1a25928a/ui-ngx/src/app/core/api/widget-api.models.ts#L140">StateObject</a>', | |
590 | + }, | |
591 | + { | |
592 | + name: 'openRightLayout', | |
593 | + description: 'An optional boolean argument to force open right dashboard layout if present in mobile view mode.', | |
594 | + type: 'boolean', | |
595 | + optional: true | |
596 | + } | |
597 | + ] | |
598 | + }, | |
582 | 599 | updateState: { |
583 | 600 | description: 'Updates current dashboard state.', |
584 | 601 | meta: 'function', | ... | ... |