Browse Source

UI: Minor fixes

pull/6934/head
Igor Kulikov 4 years ago
parent
commit
7f058132fd
  1. 2
      application/src/main/resources/thingsboard.yml
  2. 3
      ui-ngx/src/app/modules/home/components/widget/widget-container.component.html
  3. 4
      ui-ngx/src/app/modules/home/components/widget/widget-container.component.scss
  4. 2
      ui-ngx/src/app/modules/home/models/dashboard-component.models.ts
  5. 5
      ui-ngx/src/app/shared/components/markdown.component.ts

2
application/src/main/resources/thingsboard.yml

@ -148,7 +148,7 @@ ui:
# Help parameters # Help parameters
help: help:
# Base url for UI help assets # Base url for UI help assets
base-url: "${UI_HELP_BASE_URL:https://raw.githubusercontent.com/thingsboard/thingsboard-ui-help/release-3.3.4}" base-url: "${UI_HELP_BASE_URL:https://raw.githubusercontent.com/thingsboard/thingsboard-ui-help/release-3.4}"
database: database:
ts_max_intervals: "${DATABASE_TS_MAX_INTERVALS:700}" # Max number of DB queries generated by single API call to fetch telemetry records ts_max_intervals: "${DATABASE_TS_MAX_INTERVALS:700}" # Max number of DB queries generated by single API call to fetch telemetry records

3
ui-ngx/src/app/modules/home/components/widget/widget-container.component.html

@ -25,7 +25,8 @@
'tb-highlighted': isHighlighted(widget), 'tb-highlighted': isHighlighted(widget),
'tb-not-highlighted': isNotHighlighted(widget), 'tb-not-highlighted': isNotHighlighted(widget),
'mat-elevation-z4': widget.dropShadow, 'mat-elevation-z4': widget.dropShadow,
'tb-has-timewindow': widget.hasTimewindow 'tb-has-timewindow': widget.hasTimewindow,
'tb-edit': isEdit
}" }"
[ngStyle]="widget.style" [ngStyle]="widget.style"
(mousedown)="onMouseDown($event)" (mousedown)="onMouseDown($event)"

4
ui-ngx/src/app/modules/home/components/widget/widget-container.component.scss

@ -114,4 +114,8 @@ div.tb-widget {
&.tb-not-highlighted { &.tb-not-highlighted {
opacity: .5; opacity: .5;
} }
&.tb-edit {
cursor: pointer;
}
} }

2
ui-ngx/src/app/modules/home/models/dashboard-component.models.ts

@ -428,7 +428,7 @@ export class DashboardWidget implements GridsterItem, IDashboardWidget {
this.hasAggregation = this.widget.type === widgetType.timeseries; this.hasAggregation = this.widget.type === widgetType.timeseries;
this.style = {cursor: 'pointer', this.style = {
color: this.color, color: this.color,
backgroundColor: this.backgroundColor, backgroundColor: this.backgroundColor,
padding: this.padding, padding: this.padding,

5
ui-ngx/src/app/shared/components/markdown.component.ts

@ -126,11 +126,11 @@ export class TbMarkdownComponent implements OnChanges {
this.handlePlugins(this.tbMarkdownInstanceComponentRef.location.nativeElement); this.handlePlugins(this.tbMarkdownInstanceComponentRef.location.nativeElement);
this.markdownService.highlight(this.tbMarkdownInstanceComponentRef.location.nativeElement); this.markdownService.highlight(this.tbMarkdownInstanceComponentRef.location.nativeElement);
readyObservable = this.handleImages(this.tbMarkdownInstanceComponentRef.location.nativeElement); readyObservable = this.handleImages(this.tbMarkdownInstanceComponentRef.location.nativeElement);
this.cd.detectChanges();
this.error = null; this.error = null;
} catch (error) { } catch (error) {
readyObservable = this.handleError(compiled, error); readyObservable = this.handleError(compiled, error);
} }
this.cd.detectChanges();
readyObservable.subscribe(() => { readyObservable.subscribe(() => {
this.ready.emit(); this.ready.emit();
}); });
@ -146,9 +146,8 @@ export class TbMarkdownComponent implements OnChanges {
private handleError(template: string, error): Observable<void> { private handleError(template: string, error): Observable<void> {
this.error = (error ? error + '' : 'Failed to render markdown!').replace(/\n/g, '<br>'); this.error = (error ? error + '' : 'Failed to render markdown!').replace(/\n/g, '<br>');
this.destroyMarkdownInstanceResources(); this.markdownContainer.clear();
if (this.fallbackToPlainMarkdownValue) { if (this.fallbackToPlainMarkdownValue) {
this.markdownContainer.clear();
const element = this.fallbackElement.nativeElement; const element = this.fallbackElement.nativeElement;
element.innerHTML = template; element.innerHTML = template;
this.handlePlugins(element); this.handlePlugins(element);

Loading…
Cancel
Save