Showing
16 changed files
with
71 additions
and
47 deletions
@@ -89,7 +89,17 @@ | @@ -89,7 +89,17 @@ | ||
89 | ], | 89 | ], |
90 | "customWebpackConfig": { | 90 | "customWebpackConfig": { |
91 | "path": "./extra-webpack.config.js" | 91 | "path": "./extra-webpack.config.js" |
92 | - } | 92 | + }, |
93 | + "allowedCommonJsDependencies": [ | ||
94 | + "hammerjs", | ||
95 | + "react", | ||
96 | + "react-dom", | ||
97 | + "reactcss", | ||
98 | + "react-ace", | ||
99 | + "schema-inspector", | ||
100 | + "@flowjs/flow.js", | ||
101 | + "mousetrap" | ||
102 | + ] | ||
93 | }, | 103 | }, |
94 | "configurations": { | 104 | "configurations": { |
95 | "production": { | 105 | "production": { |
@@ -1943,11 +1943,11 @@ | @@ -1943,11 +1943,11 @@ | ||
1943 | } | 1943 | } |
1944 | }, | 1944 | }, |
1945 | "@auth0/angular-jwt": { | 1945 | "@auth0/angular-jwt": { |
1946 | - "version": "4.0.0", | ||
1947 | - "resolved": "https://registry.npmjs.org/@auth0/angular-jwt/-/angular-jwt-4.0.0.tgz", | ||
1948 | - "integrity": "sha512-CHvk1zJ9jpQupl0f5y7EmTvYAwugyFvC4ztLsZKr7ZC7anNVaDd1+pDFJYS+ZEU9jLWzE74+AfVKfigImADJuw==", | 1946 | + "version": "5.0.1", |
1947 | + "resolved": "https://registry.npmjs.org/@auth0/angular-jwt/-/angular-jwt-5.0.1.tgz", | ||
1948 | + "integrity": "sha512-djllMh6rthPscEj5n5T9zF223q8t+sDqnUuAYTJjdKoHvMAzYwwi2yP67HbojqjODG4ZLFAcPtRuzGgp+r7nDQ==", | ||
1949 | "requires": { | 1949 | "requires": { |
1950 | - "url": "^0.11.0" | 1950 | + "tslib": "^2.0.0" |
1951 | } | 1951 | } |
1952 | }, | 1952 | }, |
1953 | "@babel/code-frame": { | 1953 | "@babel/code-frame": { |
@@ -5357,9 +5357,12 @@ | @@ -5357,9 +5357,12 @@ | ||
5357 | "dev": true | 5357 | "dev": true |
5358 | }, | 5358 | }, |
5359 | "async": { | 5359 | "async": { |
5360 | - "version": "1.5.2", | ||
5361 | - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", | ||
5362 | - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" | 5360 | + "version": "2.6.3", |
5361 | + "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", | ||
5362 | + "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", | ||
5363 | + "requires": { | ||
5364 | + "lodash": "^4.17.14" | ||
5365 | + } | ||
5363 | }, | 5366 | }, |
5364 | "async-each": { | 5367 | "async-each": { |
5365 | "version": "1.0.3", | 5368 | "version": "1.0.3", |
@@ -13144,7 +13147,8 @@ | @@ -13144,7 +13147,8 @@ | ||
13144 | "punycode": { | 13147 | "punycode": { |
13145 | "version": "1.3.2", | 13148 | "version": "1.3.2", |
13146 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", | 13149 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", |
13147 | - "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=" | 13150 | + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", |
13151 | + "dev": true | ||
13148 | }, | 13152 | }, |
13149 | "q": { | 13153 | "q": { |
13150 | "version": "1.5.1", | 13154 | "version": "1.5.1", |
@@ -13177,7 +13181,8 @@ | @@ -13177,7 +13181,8 @@ | ||
13177 | "querystring": { | 13181 | "querystring": { |
13178 | "version": "0.2.0", | 13182 | "version": "0.2.0", |
13179 | "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", | 13183 | "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", |
13180 | - "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=" | 13184 | + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", |
13185 | + "dev": true | ||
13181 | }, | 13186 | }, |
13182 | "querystring-es3": { | 13187 | "querystring-es3": { |
13183 | "version": "0.2.1", | 13188 | "version": "0.2.1", |
@@ -13992,11 +13997,11 @@ | @@ -13992,11 +13997,11 @@ | ||
13992 | } | 13997 | } |
13993 | }, | 13998 | }, |
13994 | "schema-inspector": { | 13999 | "schema-inspector": { |
13995 | - "version": "1.6.8", | ||
13996 | - "resolved": "https://registry.npmjs.org/schema-inspector/-/schema-inspector-1.6.8.tgz", | ||
13997 | - "integrity": "sha1-ueU5g8xV/y29e2Xj2+CF2dEoXyo=", | 14000 | + "version": "1.7.0", |
14001 | + "resolved": "https://registry.npmjs.org/schema-inspector/-/schema-inspector-1.7.0.tgz", | ||
14002 | + "integrity": "sha512-Cj4XP6O3QfDhOq7bIPpz3Ev+sjR++nqFsIggBVIk/8axqFc2p+XSwNBWih9Ut/p8k36f1uCyXB+TzumZUsxVBQ==", | ||
13998 | "requires": { | 14003 | "requires": { |
13999 | - "async": "^1.5.0" | 14004 | + "async": "~2.6.3" |
14000 | } | 14005 | } |
14001 | }, | 14006 | }, |
14002 | "schema-utils": { | 14007 | "schema-utils": { |
@@ -15851,6 +15856,7 @@ | @@ -15851,6 +15856,7 @@ | ||
15851 | "version": "0.11.0", | 15856 | "version": "0.11.0", |
15852 | "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", | 15857 | "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", |
15853 | "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", | 15858 | "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", |
15859 | + "dev": true, | ||
15854 | "requires": { | 15860 | "requires": { |
15855 | "punycode": "1.3.2", | 15861 | "punycode": "1.3.2", |
15856 | "querystring": "0.2.0" | 15862 | "querystring": "0.2.0" |
@@ -23,7 +23,7 @@ | @@ -23,7 +23,7 @@ | ||
23 | "@angular/platform-browser": "^10.0.9", | 23 | "@angular/platform-browser": "^10.0.9", |
24 | "@angular/platform-browser-dynamic": "^10.0.9", | 24 | "@angular/platform-browser-dynamic": "^10.0.9", |
25 | "@angular/router": "^10.0.9", | 25 | "@angular/router": "^10.0.9", |
26 | - "@auth0/angular-jwt": "^4.0.0", | 26 | + "@auth0/angular-jwt": "^5.0.1", |
27 | "@date-io/date-fns": "^2.6.1", | 27 | "@date-io/date-fns": "^2.6.1", |
28 | "@flowjs/flow.js": "^2.14.1", | 28 | "@flowjs/flow.js": "^2.14.1", |
29 | "@flowjs/ngx-flow": "^0.4.4", | 29 | "@flowjs/ngx-flow": "^0.4.4", |
@@ -81,7 +81,7 @@ | @@ -81,7 +81,7 @@ | ||
81 | "react-dropzone": "^11.0.3", | 81 | "react-dropzone": "^11.0.3", |
82 | "reactcss": "^1.2.3", | 82 | "reactcss": "^1.2.3", |
83 | "rxjs": "^6.6.2", | 83 | "rxjs": "^6.6.2", |
84 | - "schema-inspector": "1.6.8", | 84 | + "schema-inspector": "^1.7.0", |
85 | "screenfull": "^5.0.2", | 85 | "screenfull": "^5.0.2", |
86 | "split.js": "^1.6.2", | 86 | "split.js": "^1.6.2", |
87 | "systemjs": "0.21.5", | 87 | "systemjs": "0.21.5", |
@@ -28,8 +28,7 @@ import { AuthService } from '@core/auth/auth.service'; | @@ -28,8 +28,7 @@ import { AuthService } from '@core/auth/auth.service'; | ||
28 | import { Constants } from '@shared/models/constants'; | 28 | import { Constants } from '@shared/models/constants'; |
29 | import { InterceptorHttpParams } from './interceptor-http-params'; | 29 | import { InterceptorHttpParams } from './interceptor-http-params'; |
30 | import { catchError, delay, mergeMap, switchMap, tap } from 'rxjs/operators'; | 30 | import { catchError, delay, mergeMap, switchMap, tap } from 'rxjs/operators'; |
31 | -import { throwError } from 'rxjs/internal/observable/throwError'; | ||
32 | -import { of } from 'rxjs/internal/observable/of'; | 31 | +import { throwError, of } from 'rxjs'; |
33 | import { InterceptorConfig } from './interceptor-config'; | 32 | import { InterceptorConfig } from './interceptor-config'; |
34 | import { Store } from '@ngrx/store'; | 33 | import { Store } from '@ngrx/store'; |
35 | import { AppState } from '@core/core.state'; | 34 | import { AppState } from '@core/core.state'; |
@@ -20,8 +20,7 @@ import { | @@ -20,8 +20,7 @@ import { | ||
20 | TranslateMessageFormatCompiler | 20 | TranslateMessageFormatCompiler |
21 | } from 'ngx-translate-messageformat-compiler'; | 21 | } from 'ngx-translate-messageformat-compiler'; |
22 | import { Inject, Injectable, Optional } from '@angular/core'; | 22 | import { Inject, Injectable, Optional } from '@angular/core'; |
23 | - | ||
24 | -const parse = require('messageformat-parser').parse; | 23 | +import messageFormatParser from 'messageformat-parser'; |
25 | 24 | ||
26 | @Injectable({ providedIn: 'root' }) | 25 | @Injectable({ providedIn: 'root' }) |
27 | export class TranslateDefaultCompiler extends TranslateMessageFormatCompiler { | 26 | export class TranslateDefaultCompiler extends TranslateMessageFormatCompiler { |
@@ -61,7 +60,7 @@ export class TranslateDefaultCompiler extends TranslateMessageFormatCompiler { | @@ -61,7 +60,7 @@ export class TranslateDefaultCompiler extends TranslateMessageFormatCompiler { | ||
61 | private checkIsPlural(src: string): boolean { | 60 | private checkIsPlural(src: string): boolean { |
62 | let tokens: any[]; | 61 | let tokens: any[]; |
63 | try { | 62 | try { |
64 | - tokens = parse(src.replace(/\{\{/g, '{').replace(/\}\}/g, '}'), | 63 | + tokens = messageFormatParser.parse(src.replace(/\{\{/g, '{').replace(/\}\}/g, '}'), |
65 | {cardinal: [], ordinal: []}); | 64 | {cardinal: [], ordinal: []}); |
66 | } catch (e) { | 65 | } catch (e) { |
67 | console.warn(`Failed to parse source: ${src}`); | 66 | console.warn(`Failed to parse source: ${src}`); |
@@ -34,7 +34,6 @@ import { AppState } from '@core/core.state'; | @@ -34,7 +34,6 @@ import { AppState } from '@core/core.state'; | ||
34 | import { CustomActionDescriptor } from '@shared/models/widget.models'; | 34 | import { CustomActionDescriptor } from '@shared/models/widget.models'; |
35 | import * as ace from 'ace-builds'; | 35 | import * as ace from 'ace-builds'; |
36 | import { CancelAnimationFrame, RafService } from '@core/services/raf.service'; | 36 | import { CancelAnimationFrame, RafService } from '@core/services/raf.service'; |
37 | -import { css_beautify, html_beautify } from 'js-beautify'; | ||
38 | import { ResizeObserver } from '@juggle/resize-observer'; | 37 | import { ResizeObserver } from '@juggle/resize-observer'; |
39 | import { CustomPrettyActionEditorCompleter } from '@home/components/widget/action/custom-action.models'; | 38 | import { CustomPrettyActionEditorCompleter } from '@home/components/widget/action/custom-action.models'; |
40 | 39 | ||
@@ -93,7 +92,6 @@ export class CustomActionPrettyResourcesTabsComponent extends PageComponent impl | @@ -93,7 +92,6 @@ export class CustomActionPrettyResourcesTabsComponent extends PageComponent impl | ||
93 | 92 | ||
94 | ngOnChanges(changes: SimpleChanges): void { | 93 | ngOnChanges(changes: SimpleChanges): void { |
95 | for (const propName of Object.keys(changes)) { | 94 | for (const propName of Object.keys(changes)) { |
96 | - const change = changes[propName]; | ||
97 | if (propName === 'action') { | 95 | if (propName === 'action') { |
98 | if (this.aceEditors.length) { | 96 | if (this.aceEditors.length) { |
99 | this.setAceEditorValues(); | 97 | this.setAceEditorValues(); |
@@ -136,7 +134,7 @@ export class CustomActionPrettyResourcesTabsComponent extends PageComponent impl | @@ -136,7 +134,7 @@ export class CustomActionPrettyResourcesTabsComponent extends PageComponent impl | ||
136 | } | 134 | } |
137 | 135 | ||
138 | public beautifyCss(): void { | 136 | public beautifyCss(): void { |
139 | - const res = css_beautify(this.action.customCss, {indent_size: 4}); | 137 | + const res = js_beautify.css_beautify(this.action.customCss, {indent_size: 4}); |
140 | if (this.action.customCss !== res) { | 138 | if (this.action.customCss !== res) { |
141 | this.action.customCss = res; | 139 | this.action.customCss = res; |
142 | this.cssEditor.setValue(this.action.customCss ? this.action.customCss : '', -1); | 140 | this.cssEditor.setValue(this.action.customCss ? this.action.customCss : '', -1); |
@@ -145,7 +143,7 @@ export class CustomActionPrettyResourcesTabsComponent extends PageComponent impl | @@ -145,7 +143,7 @@ export class CustomActionPrettyResourcesTabsComponent extends PageComponent impl | ||
145 | } | 143 | } |
146 | 144 | ||
147 | public beautifyHtml(): void { | 145 | public beautifyHtml(): void { |
148 | - const res = html_beautify(this.action.customHtml, {indent_size: 4, wrap_line_length: 60}); | 146 | + const res = js_beautify.html_beautify(this.action.customHtml, {indent_size: 4, wrap_line_length: 60}); |
149 | if (this.action.customHtml !== res) { | 147 | if (this.action.customHtml !== res) { |
150 | this.action.customHtml = res; | 148 | this.action.customHtml = res; |
151 | this.htmlEditor.setValue(this.action.customHtml ? this.action.customHtml : '', -1); | 149 | this.htmlEditor.setValue(this.action.customHtml ? this.action.customHtml : '', -1); |
@@ -158,7 +156,7 @@ export class CustomActionPrettyResourcesTabsComponent extends PageComponent impl | @@ -158,7 +156,7 @@ export class CustomActionPrettyResourcesTabsComponent extends PageComponent impl | ||
158 | entries.forEach((entry) => { | 156 | entries.forEach((entry) => { |
159 | const editor = this.aceEditors.find(aceEditor => aceEditor.container === entry.target); | 157 | const editor = this.aceEditors.find(aceEditor => aceEditor.container === entry.target); |
160 | this.onAceEditorResize(editor); | 158 | this.onAceEditorResize(editor); |
161 | - }) | 159 | + }); |
162 | }); | 160 | }); |
163 | this.htmlEditor = this.createAceEditor(this.htmlInputElmRef, 'html'); | 161 | this.htmlEditor = this.createAceEditor(this.htmlInputElmRef, 'html'); |
164 | this.htmlEditor.on('input', () => { | 162 | this.htmlEditor.on('input', () => { |
@@ -30,6 +30,7 @@ import { MatSidenav } from '@angular/material/sidenav'; | @@ -30,6 +30,7 @@ import { MatSidenav } from '@angular/material/sidenav'; | ||
30 | import { AuthState } from '@core/auth/auth.models'; | 30 | import { AuthState } from '@core/auth/auth.models'; |
31 | import { WINDOW } from '@core/services/window.service'; | 31 | import { WINDOW } from '@core/services/window.service'; |
32 | import { instanceOfSearchableComponent, ISearchableComponent } from '@home/models/searchable-component.models'; | 32 | import { instanceOfSearchableComponent, ISearchableComponent } from '@home/models/searchable-component.models'; |
33 | +import logo from '../../../assets/logo_title_white.svg'; | ||
33 | 34 | ||
34 | const screenfull = _screenfull as _screenfull.Screenfull; | 35 | const screenfull = _screenfull as _screenfull.Screenfull; |
35 | 36 | ||
@@ -50,7 +51,7 @@ export class HomeComponent extends PageComponent implements AfterViewInit, OnIni | @@ -50,7 +51,7 @@ export class HomeComponent extends PageComponent implements AfterViewInit, OnIni | ||
50 | sidenavMode: 'over' | 'push' | 'side' = 'side'; | 51 | sidenavMode: 'over' | 'push' | 'side' = 'side'; |
51 | sidenavOpened = true; | 52 | sidenavOpened = true; |
52 | 53 | ||
53 | - logo = require('../../../assets/logo_title_white.svg').default; | 54 | + logo = logo; |
54 | 55 | ||
55 | @ViewChild('sidenav') | 56 | @ViewChild('sidenav') |
56 | sidenav: MatSidenav; | 57 | sidenav: MatSidenav; |
@@ -33,7 +33,6 @@ import { Hotkey } from 'angular2-hotkeys'; | @@ -33,7 +33,6 @@ import { Hotkey } from 'angular2-hotkeys'; | ||
33 | import { TranslateService } from '@ngx-translate/core'; | 33 | import { TranslateService } from '@ngx-translate/core'; |
34 | import { getCurrentIsLoading } from '@app/core/interceptors/load.selectors'; | 34 | import { getCurrentIsLoading } from '@app/core/interceptors/load.selectors'; |
35 | import * as ace from 'ace-builds'; | 35 | import * as ace from 'ace-builds'; |
36 | -import { css_beautify, html_beautify } from 'js-beautify'; | ||
37 | import { CancelAnimationFrame, RafService } from '@core/services/raf.service'; | 36 | import { CancelAnimationFrame, RafService } from '@core/services/raf.service'; |
38 | import { WINDOW } from '@core/services/window.service'; | 37 | import { WINDOW } from '@core/services/window.service'; |
39 | import { WindowMessage } from '@shared/models/window-message.model'; | 38 | import { WindowMessage } from '@shared/models/window-message.model'; |
@@ -275,7 +274,7 @@ export class WidgetEditorComponent extends PageComponent implements OnInit, OnDe | @@ -275,7 +274,7 @@ export class WidgetEditorComponent extends PageComponent implements OnInit, OnDe | ||
275 | entries.forEach((entry) => { | 274 | entries.forEach((entry) => { |
276 | const editor = this.aceEditors.find(aceEditor => aceEditor.container === entry.target); | 275 | const editor = this.aceEditors.find(aceEditor => aceEditor.container === entry.target); |
277 | this.onAceEditorResize(editor); | 276 | this.onAceEditorResize(editor); |
278 | - }) | 277 | + }); |
279 | }); | 278 | }); |
280 | this.htmlEditor = this.createAceEditor(this.htmlInputElmRef, 'html'); | 279 | this.htmlEditor = this.createAceEditor(this.htmlInputElmRef, 'html'); |
281 | this.htmlEditor.on('input', () => { | 280 | this.htmlEditor.on('input', () => { |
@@ -577,7 +576,7 @@ export class WidgetEditorComponent extends PageComponent implements OnInit, OnDe | @@ -577,7 +576,7 @@ export class WidgetEditorComponent extends PageComponent implements OnInit, OnDe | ||
577 | } | 576 | } |
578 | 577 | ||
579 | beautifyCss(): void { | 578 | beautifyCss(): void { |
580 | - const res = css_beautify(this.widget.templateCss, {indent_size: 4}); | 579 | + const res = js_beautify.css_beautify(this.widget.templateCss, {indent_size: 4}); |
581 | if (this.widget.templateCss !== res) { | 580 | if (this.widget.templateCss !== res) { |
582 | this.isDirty = true; | 581 | this.isDirty = true; |
583 | this.widget.templateCss = res; | 582 | this.widget.templateCss = res; |
@@ -586,7 +585,7 @@ export class WidgetEditorComponent extends PageComponent implements OnInit, OnDe | @@ -586,7 +585,7 @@ export class WidgetEditorComponent extends PageComponent implements OnInit, OnDe | ||
586 | } | 585 | } |
587 | 586 | ||
588 | beautifyHtml(): void { | 587 | beautifyHtml(): void { |
589 | - const res = html_beautify(this.widget.templateHtml, {indent_size: 4, wrap_line_length: 60}); | 588 | + const res = js_beautify.html_beautify(this.widget.templateHtml, {indent_size: 4, wrap_line_length: 60}); |
590 | if (this.widget.templateHtml !== res) { | 589 | if (this.widget.templateHtml !== res) { |
591 | this.isDirty = true; | 590 | this.isDirty = true; |
592 | this.widget.templateHtml = res; | 591 | this.widget.templateHtml = res; |
@@ -16,6 +16,7 @@ | @@ -16,6 +16,7 @@ | ||
16 | 16 | ||
17 | import { Component } from '@angular/core'; | 17 | import { Component } from '@angular/core'; |
18 | import { MatDialogRef } from '@angular/material/dialog'; | 18 | import { MatDialogRef } from '@angular/material/dialog'; |
19 | +import comingSoon from '../../../../assets/coming-soon.jpg'; | ||
19 | 20 | ||
20 | @Component({ | 21 | @Component({ |
21 | selector: 'tb-todo-dialog', | 22 | selector: 'tb-todo-dialog', |
@@ -24,7 +25,7 @@ import { MatDialogRef } from '@angular/material/dialog'; | @@ -24,7 +25,7 @@ import { MatDialogRef } from '@angular/material/dialog'; | ||
24 | }) | 25 | }) |
25 | export class TodoDialogComponent { | 26 | export class TodoDialogComponent { |
26 | 27 | ||
27 | - comingSoon = require('../../../../assets/coming-soon.jpg').default; | 28 | + comingSoon = comingSoon; |
28 | 29 | ||
29 | constructor(public dialogRef: MatDialogRef<TodoDialogComponent>) { | 30 | constructor(public dialogRef: MatDialogRef<TodoDialogComponent>) { |
30 | } | 31 | } |
@@ -19,8 +19,7 @@ import ThingsboardBaseComponent from './json-form-base-component'; | @@ -19,8 +19,7 @@ import ThingsboardBaseComponent from './json-form-base-component'; | ||
19 | import Button from '@material-ui/core/Button'; | 19 | import Button from '@material-ui/core/Button'; |
20 | import _ from 'lodash'; | 20 | import _ from 'lodash'; |
21 | import IconButton from '@material-ui/core/IconButton'; | 21 | import IconButton from '@material-ui/core/IconButton'; |
22 | -import ClearIcon from '@material-ui/icons/Clear'; | ||
23 | -import AddIcon from '@material-ui/icons/Add'; | 22 | +import { Clear, Add } from '@material-ui/icons'; |
24 | import Tooltip from '@material-ui/core/Tooltip'; | 23 | import Tooltip from '@material-ui/core/Tooltip'; |
25 | import { | 24 | import { |
26 | JsonFormData, | 25 | JsonFormData, |
@@ -138,7 +137,7 @@ class ThingsboardArray extends React.Component<JsonFormFieldProps, ThingsboardAr | @@ -138,7 +137,7 @@ class ThingsboardArray extends React.Component<JsonFormFieldProps, ThingsboardAr | ||
138 | let removeButton: JSX.Element = null; | 137 | let removeButton: JSX.Element = null; |
139 | if (!this.props.form.readonly) { | 138 | if (!this.props.form.readonly) { |
140 | const boundOnDelete = this.onDelete.bind(this, i); | 139 | const boundOnDelete = this.onDelete.bind(this, i); |
141 | - removeButton = <Tooltip title='Remove'><IconButton onClick={boundOnDelete}><ClearIcon/></IconButton></Tooltip>; | 140 | + removeButton = <Tooltip title='Remove'><IconButton onClick={boundOnDelete}><Clear/></IconButton></Tooltip>; |
142 | } | 141 | } |
143 | const forms = (this.props.form.items as JsonFormData[]).map((form, index) => { | 142 | const forms = (this.props.form.items as JsonFormData[]).map((form, index) => { |
144 | const copy = this.copyWithIndex(form, i); | 143 | const copy = this.copyWithIndex(form, i); |
@@ -156,7 +155,7 @@ class ThingsboardArray extends React.Component<JsonFormFieldProps, ThingsboardAr | @@ -156,7 +155,7 @@ class ThingsboardArray extends React.Component<JsonFormFieldProps, ThingsboardAr | ||
156 | if (!this.props.form.readonly) { | 155 | if (!this.props.form.readonly) { |
157 | addButton = <Button variant='contained' | 156 | addButton = <Button variant='contained' |
158 | color='primary' | 157 | color='primary' |
159 | - startIcon={<AddIcon/>} | 158 | + startIcon={<Add/>} |
160 | style={{marginBottom: '8px'}} | 159 | style={{marginBottom: '8px'}} |
161 | onClick={this.onAppend}>{this.props.form.add || 'New'}</Button>; | 160 | onClick={this.onAppend}>{this.props.form.add || 'New'}</Button>; |
162 | } | 161 | } |
@@ -21,7 +21,7 @@ import * as tinycolor_ from 'tinycolor2'; | @@ -21,7 +21,7 @@ import * as tinycolor_ from 'tinycolor2'; | ||
21 | import TextField from '@material-ui/core/TextField'; | 21 | import TextField from '@material-ui/core/TextField'; |
22 | import { JsonFormFieldProps, JsonFormFieldState } from '@shared/components/json-form/react/json-form.models'; | 22 | import { JsonFormFieldProps, JsonFormFieldState } from '@shared/components/json-form/react/json-form.models'; |
23 | import IconButton from '@material-ui/core/IconButton'; | 23 | import IconButton from '@material-ui/core/IconButton'; |
24 | -import ClearIcon from '@material-ui/icons/Clear'; | 24 | +import { Clear } from '@material-ui/icons'; |
25 | import Tooltip from '@material-ui/core/Tooltip'; | 25 | import Tooltip from '@material-ui/core/Tooltip'; |
26 | 26 | ||
27 | const tinycolor = tinycolor_; | 27 | const tinycolor = tinycolor_; |
@@ -177,7 +177,7 @@ class ThingsboardColor extends React.Component<JsonFormFieldProps, ThingsboardCo | @@ -177,7 +177,7 @@ class ThingsboardColor extends React.Component<JsonFormFieldProps, ThingsboardCo | ||
177 | onBlur={this.onBlur} | 177 | onBlur={this.onBlur} |
178 | style={ styles.swatchText }/> | 178 | style={ styles.swatchText }/> |
179 | </div> | 179 | </div> |
180 | - <Tooltip title='Clear' placement='top'><IconButton onClick={this.onClear}><ClearIcon/></IconButton></Tooltip> | 180 | + <Tooltip title='Clear' placement='top'><IconButton onClick={this.onClear}><Clear/></IconButton></Tooltip> |
181 | </div> | 181 | </div> |
182 | ); | 182 | ); |
183 | } | 183 | } |
@@ -16,7 +16,6 @@ | @@ -16,7 +16,6 @@ | ||
16 | import * as React from 'react'; | 16 | import * as React from 'react'; |
17 | import ThingsboardAceEditor from './json-form-ace-editor'; | 17 | import ThingsboardAceEditor from './json-form-ace-editor'; |
18 | import { JsonFormFieldProps, JsonFormFieldState } from '@shared/components/json-form/react/json-form.models'; | 18 | import { JsonFormFieldProps, JsonFormFieldState } from '@shared/components/json-form/react/json-form.models'; |
19 | -import { css_beautify } from 'js-beautify'; | ||
20 | 19 | ||
21 | class ThingsboardCss extends React.Component<JsonFormFieldProps, JsonFormFieldState> { | 20 | class ThingsboardCss extends React.Component<JsonFormFieldProps, JsonFormFieldState> { |
22 | 21 | ||
@@ -26,7 +25,7 @@ class ThingsboardCss extends React.Component<JsonFormFieldProps, JsonFormFieldSt | @@ -26,7 +25,7 @@ class ThingsboardCss extends React.Component<JsonFormFieldProps, JsonFormFieldSt | ||
26 | } | 25 | } |
27 | 26 | ||
28 | onTidyCss(css: string): string { | 27 | onTidyCss(css: string): string { |
29 | - return css_beautify(css, {indent_size: 4}); | 28 | + return js_beautify.css_beautify(css, {indent_size: 4}); |
30 | } | 29 | } |
31 | 30 | ||
32 | render() { | 31 | render() { |
@@ -15,7 +15,6 @@ | @@ -15,7 +15,6 @@ | ||
15 | */ | 15 | */ |
16 | import * as React from 'react'; | 16 | import * as React from 'react'; |
17 | import ThingsboardAceEditor from './json-form-ace-editor'; | 17 | import ThingsboardAceEditor from './json-form-ace-editor'; |
18 | -import { html_beautify } from 'js-beautify'; | ||
19 | import { JsonFormFieldProps, JsonFormFieldState } from '@shared/components/json-form/react/json-form.models'; | 18 | import { JsonFormFieldProps, JsonFormFieldState } from '@shared/components/json-form/react/json-form.models'; |
20 | 19 | ||
21 | class ThingsboardHtml extends React.Component<JsonFormFieldProps, JsonFormFieldState> { | 20 | class ThingsboardHtml extends React.Component<JsonFormFieldProps, JsonFormFieldState> { |
@@ -26,7 +25,7 @@ class ThingsboardHtml extends React.Component<JsonFormFieldProps, JsonFormFieldS | @@ -26,7 +25,7 @@ class ThingsboardHtml extends React.Component<JsonFormFieldProps, JsonFormFieldS | ||
26 | } | 25 | } |
27 | 26 | ||
28 | onTidyHtml(html: string): string { | 27 | onTidyHtml(html: string): string { |
29 | - return html_beautify(html, {indent_size: 4}); | 28 | + return js_beautify.html_beautify(html, {indent_size: 4}); |
30 | } | 29 | } |
31 | 30 | ||
32 | render() { | 31 | render() { |
@@ -20,7 +20,7 @@ import reactCSS from 'reactcss'; | @@ -20,7 +20,7 @@ import reactCSS from 'reactcss'; | ||
20 | import TextField from '@material-ui/core/TextField'; | 20 | import TextField from '@material-ui/core/TextField'; |
21 | import IconButton from '@material-ui/core/IconButton'; | 21 | import IconButton from '@material-ui/core/IconButton'; |
22 | import { JsonFormFieldProps, JsonFormFieldState } from '@shared/components/json-form/react/json-form.models'; | 22 | import { JsonFormFieldProps, JsonFormFieldState } from '@shared/components/json-form/react/json-form.models'; |
23 | -import ClearIcon from '@material-ui/icons/Clear'; | 23 | +import { Clear } from '@material-ui/icons'; |
24 | import Icon from '@material-ui/core/Icon'; | 24 | import Icon from '@material-ui/core/Icon'; |
25 | import Tooltip from '@material-ui/core/Tooltip'; | 25 | import Tooltip from '@material-ui/core/Tooltip'; |
26 | 26 | ||
@@ -63,7 +63,7 @@ class ThingsboardIcon extends React.Component<JsonFormFieldProps, ThingsboardIco | @@ -63,7 +63,7 @@ class ThingsboardIcon extends React.Component<JsonFormFieldProps, ThingsboardIco | ||
63 | }); | 63 | }); |
64 | } | 64 | } |
65 | 65 | ||
66 | - componentWillUnmount () { | 66 | + componentWillUnmount() { |
67 | const node = ReactDOM.findDOMNode(this); | 67 | const node = ReactDOM.findDOMNode(this); |
68 | const iconContainer = $(node).children('#icon-container'); | 68 | const iconContainer = $(node).children('#icon-container'); |
69 | iconContainer.off( 'click' ); | 69 | iconContainer.off( 'click' ); |
@@ -150,7 +150,7 @@ class ThingsboardIcon extends React.Component<JsonFormFieldProps, ThingsboardIco | @@ -150,7 +150,7 @@ class ThingsboardIcon extends React.Component<JsonFormFieldProps, ThingsboardIco | ||
150 | onBlur={this.onBlur} | 150 | onBlur={this.onBlur} |
151 | style={ styles.iconText } /> | 151 | style={ styles.iconText } /> |
152 | </div> | 152 | </div> |
153 | - <Tooltip title='Clear' placement='top'><IconButton onClick={this.onClear}><ClearIcon/></IconButton></Tooltip> | 153 | + <Tooltip title='Clear' placement='top'><IconButton onClick={this.onClear}><Clear/></IconButton></Tooltip> |
154 | </div> | 154 | </div> |
155 | ); | 155 | ); |
156 | } | 156 | } |
@@ -18,7 +18,7 @@ import Dropzone from 'react-dropzone'; | @@ -18,7 +18,7 @@ import Dropzone from 'react-dropzone'; | ||
18 | import ThingsboardBaseComponent from './json-form-base-component'; | 18 | import ThingsboardBaseComponent from './json-form-base-component'; |
19 | import { JsonFormFieldProps, JsonFormFieldState } from '@shared/components/json-form/react/json-form.models'; | 19 | import { JsonFormFieldProps, JsonFormFieldState } from '@shared/components/json-form/react/json-form.models'; |
20 | import IconButton from '@material-ui/core/IconButton'; | 20 | import IconButton from '@material-ui/core/IconButton'; |
21 | -import ClearIcon from '@material-ui/icons/Clear'; | 21 | +import { Clear } from '@material-ui/icons'; |
22 | import Tooltip from '@material-ui/core/Tooltip'; | 22 | import Tooltip from '@material-ui/core/Tooltip'; |
23 | 23 | ||
24 | interface ThingsboardImageState extends JsonFormFieldState { | 24 | interface ThingsboardImageState extends JsonFormFieldState { |
@@ -87,7 +87,7 @@ class ThingsboardImage extends React.Component<JsonFormFieldProps, ThingsboardIm | @@ -87,7 +87,7 @@ class ThingsboardImage extends React.Component<JsonFormFieldProps, ThingsboardIm | ||
87 | <div className='tb-image-preview-container'>{previewComponent}</div> | 87 | <div className='tb-image-preview-container'>{previewComponent}</div> |
88 | <div className='tb-image-clear-container'> | 88 | <div className='tb-image-clear-container'> |
89 | <Tooltip title='Clear' placement='top'> | 89 | <Tooltip title='Clear' placement='top'> |
90 | - <IconButton className='tb-image-clear-btn' onClick={this.onClear}><ClearIcon/></IconButton> | 90 | + <IconButton className='tb-image-clear-btn' onClick={this.onClear}><Clear/></IconButton> |
91 | </Tooltip> | 91 | </Tooltip> |
92 | </div> | 92 | </div> |
93 | <Dropzone onDrop={this.onDrop} | 93 | <Dropzone onDrop={this.onDrop} |