Commit 77eb33df961deeeec691c7b7fee58b7ad2c7a2d9

Authored by Igor Kulikov
1 parent b8d837ab

Improvements

Showing 26 changed files with 370 additions and 18 deletions
... ... @@ -38,6 +38,7 @@ import { FlexLayoutModule } from '@angular/flex-layout';
38 38 import { TranslateDefaultCompiler } from '@core/translate/translate-default-compiler';
39 39 import { AlertDialogComponent } from '@core/services/dialog/alert-dialog.component';
40 40 import { WINDOW_PROVIDERS } from '@core/services/window.service';
  41 +import {TodoDialogComponent} from "@core/services/dialog/todo-dialog.component";
41 42
42 43 export function HttpLoaderFactory(http: HttpClient) {
43 44 return new TranslateHttpLoader(http, './assets/locale/locale.constant-', '.json');
... ... @@ -46,11 +47,13 @@ export function HttpLoaderFactory(http: HttpClient) {
46 47 @NgModule({
47 48 entryComponents: [
48 49 ConfirmDialogComponent,
49   - AlertDialogComponent
  50 + AlertDialogComponent,
  51 + TodoDialogComponent
50 52 ],
51 53 declarations: [
52 54 ConfirmDialogComponent,
53   - AlertDialogComponent
  55 + AlertDialogComponent,
  56 + TodoDialogComponent
54 57 ],
55 58 imports: [
56 59 CommonModule,
... ...
... ... @@ -20,6 +20,7 @@ import { MatDialog, MatDialogConfig } from '@angular/material';
20 20 import { ConfirmDialogComponent } from '@core/services/dialog/confirm-dialog.component';
21 21 import { TranslateService } from '@ngx-translate/core';
22 22 import { AlertDialogComponent } from '@core/services/dialog/alert-dialog.component';
  23 +import {TodoDialogComponent} from "@core/services/dialog/todo-dialog.component";
23 24
24 25 @Injectable(
25 26 {
... ... @@ -67,4 +68,13 @@ export class DialogService {
67 68 return dialogRef.afterClosed();
68 69 }
69 70
  71 + todo(): Observable<any> {
  72 + const dialogConfig: MatDialogConfig = {
  73 + disableClose: true,
  74 + panelClass: ['tb-fullscreen-dialog']
  75 + };
  76 + const dialogRef = this.dialog.open(TodoDialogComponent, dialogConfig);
  77 + return dialogRef.afterClosed();
  78 + }
  79 +
70 80 }
... ...
  1 +<!--
  2 +
  3 + Copyright © 2016-2019 The Thingsboard Authors
  4 +
  5 + Licensed under the Apache License, Version 2.0 (the "License");
  6 + you may not use this file except in compliance with the License.
  7 + You may obtain a copy of the License at
  8 +
  9 + http://www.apache.org/licenses/LICENSE-2.0
  10 +
  11 + Unless required by applicable law or agreed to in writing, software
  12 + distributed under the License is distributed on an "AS IS" BASIS,
  13 + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14 + See the License for the specific language governing permissions and
  15 + limitations under the License.
  16 +
  17 +-->
  18 +<h2 mat-dialog-title>Coming soon!</h2>
  19 +<div mat-dialog-content>
  20 + <img [src]="comingSoon"/>
  21 +</div>
  22 +<div mat-dialog-actions fxLayout="row" fxLayoutAlign="end center">
  23 + <button mat-button color="primary" [mat-dialog-close]="true" cdkFocusInitial>Ok</button>
  24 +</div>
... ...
  1 +/**
  2 + * Copyright © 2016-2019 The Thingsboard Authors
  3 + *
  4 + * Licensed under the Apache License, Version 2.0 (the "License");
  5 + * you may not use this file except in compliance with the License.
  6 + * You may obtain a copy of the License at
  7 + *
  8 + * http://www.apache.org/licenses/LICENSE-2.0
  9 + *
  10 + * Unless required by applicable law or agreed to in writing, software
  11 + * distributed under the License is distributed on an "AS IS" BASIS,
  12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 + * See the License for the specific language governing permissions and
  14 + * limitations under the License.
  15 + */
  16 +:host {
  17 + .mat-dialog-content {
  18 + padding: 0 24px 24px;
  19 + img {
  20 + max-width: 500px;
  21 + }
  22 + }
  23 +}
... ...
  1 +///
  2 +/// Copyright © 2016-2019 The Thingsboard Authors
  3 +///
  4 +/// Licensed under the Apache License, Version 2.0 (the "License");
  5 +/// you may not use this file except in compliance with the License.
  6 +/// You may obtain a copy of the License at
  7 +///
  8 +/// http://www.apache.org/licenses/LICENSE-2.0
  9 +///
  10 +/// Unless required by applicable law or agreed to in writing, software
  11 +/// distributed under the License is distributed on an "AS IS" BASIS,
  12 +/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 +/// See the License for the specific language governing permissions and
  14 +/// limitations under the License.
  15 +///
  16 +
  17 +import {Component} from '@angular/core';
  18 +import {MatDialogRef} from '@angular/material';
  19 +
  20 +@Component({
  21 + selector: 'tb-todo-dialog',
  22 + templateUrl: './todo-dialog.component.html',
  23 + styleUrls: ['./todo-dialog.component.scss']
  24 +})
  25 +export class TodoDialogComponent {
  26 +
  27 + comingSoon = require('../../../../assets/coming-soon.jpg');
  28 +
  29 + constructor(public dialogRef: MatDialogRef<TodoDialogComponent>) {
  30 + }
  31 +}
... ...
... ... @@ -279,6 +279,7 @@ export class AssetsTableConfigResolver implements Resolve<EntityTableConfig<Asse
279 279 $event.stopPropagation();
280 280 }
281 281 // TODO:
  282 + this.dialogService.todo();
282 283 }
283 284
284 285 addAssetsToCustomer($event: Event) {
... ...
... ... @@ -21,15 +21,18 @@ import {HomeDialogsModule} from '../../dialogs/home-dialogs.module';
21 21 import {DashboardFormComponent} from '@modules/home/pages/dashboard/dashboard-form.component';
22 22 import {ManageDashboardCustomersDialogComponent} from '@modules/home/pages/dashboard/manage-dashboard-customers-dialog.component';
23 23 import {DashboardRoutingModule} from './dashboard-routing.module';
  24 +import {MakeDashboardPublicDialogComponent} from '@modules/home/pages/dashboard/make-dashboard-public-dialog.component';
24 25
25 26 @NgModule({
26 27 entryComponents: [
27 28 DashboardFormComponent,
28   - ManageDashboardCustomersDialogComponent
  29 + ManageDashboardCustomersDialogComponent,
  30 + MakeDashboardPublicDialogComponent
29 31 ],
30 32 declarations: [
31 33 DashboardFormComponent,
32   - ManageDashboardCustomersDialogComponent
  34 + ManageDashboardCustomersDialogComponent,
  35 + MakeDashboardPublicDialogComponent
33 36 ],
34 37 imports: [
35 38 CommonModule,
... ...
... ... @@ -58,6 +58,10 @@ import {
58 58 ManageDashboardCustomersDialogComponent,
59 59 ManageDashboardCustomersDialogData
60 60 } from './manage-dashboard-customers-dialog.component';
  61 +import {
  62 + MakeDashboardPublicDialogComponent,
  63 + MakeDashboardPublicDialogData
  64 +} from '@modules/home/pages/dashboard/make-dashboard-public-dialog.component';
61 65
62 66 @Injectable()
63 67 export class DashboardsTableConfigResolver implements Resolve<EntityTableConfig<DashboardInfo | Dashboard>> {
... ... @@ -299,6 +303,7 @@ export class DashboardsTableConfigResolver implements Resolve<EntityTableConfig<
299 303 }
300 304 // TODO:
301 305 // this.router.navigateByUrl(`customers/${customer.id.id}/users`);
  306 + this.dialogService.todo();
302 307 }
303 308
304 309 importDashboard($event: Event) {
... ... @@ -306,6 +311,7 @@ export class DashboardsTableConfigResolver implements Resolve<EntityTableConfig<
306 311 $event.stopPropagation();
307 312 }
308 313 // TODO:
  314 + this.dialogService.todo();
309 315 }
310 316
311 317 exportDashboard($event: Event, dashboard: DashboardInfo) {
... ... @@ -313,6 +319,7 @@ export class DashboardsTableConfigResolver implements Resolve<EntityTableConfig<
313 319 $event.stopPropagation();
314 320 }
315 321 // TODO:
  322 + this.dialogService.todo();
316 323 }
317 324
318 325 addDashboardsToCustomer($event: Event) {
... ... @@ -341,9 +348,17 @@ export class DashboardsTableConfigResolver implements Resolve<EntityTableConfig<
341 348 }
342 349 this.dashboardService.makeDashboardPublic(dashboard.id.id).subscribe(
343 350 (publicDashboard) => {
344   - // TODO:
345   -
346   - this.config.table.updateData();
  351 + this.dialog.open<MakeDashboardPublicDialogComponent, MakeDashboardPublicDialogData>
  352 + (MakeDashboardPublicDialogComponent, {
  353 + disableClose: true,
  354 + panelClass: ['tb-dialog', 'tb-fullscreen-dialog'],
  355 + data: {
  356 + dashboard: publicDashboard
  357 + }
  358 + }).afterClosed()
  359 + .subscribe(() => {
  360 + this.config.table.updateData();
  361 + });
347 362 }
348 363 );
349 364 }
... ...
  1 +<!--
  2 +
  3 + Copyright © 2016-2019 The Thingsboard Authors
  4 +
  5 + Licensed under the Apache License, Version 2.0 (the "License");
  6 + you may not use this file except in compliance with the License.
  7 + You may obtain a copy of the License at
  8 +
  9 + http://www.apache.org/licenses/LICENSE-2.0
  10 +
  11 + Unless required by applicable law or agreed to in writing, software
  12 + distributed under the License is distributed on an "AS IS" BASIS,
  13 + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14 + See the License for the specific language governing permissions and
  15 + limitations under the License.
  16 +
  17 +-->
  18 +<div style="min-width: 400px;">
  19 + <mat-toolbar fxLayout="row" color="primary">
  20 + <h2>{{ 'dashboard.public-dashboard-title' | translate }}</h2>
  21 + <span fxFlex></span>
  22 + <button mat-button mat-icon-button
  23 + (click)="close()"
  24 + type="button">
  25 + <mat-icon class="material-icons">close</mat-icon>
  26 + </button>
  27 + </mat-toolbar>
  28 + <mat-progress-bar color="warn" mode="indeterminate" *ngIf="isLoading$ | async">
  29 + </mat-progress-bar>
  30 + <div style="height: 4px;" *ngIf="!(isLoading$ | async)"></div>
  31 + <div mat-dialog-content tb-toast toastTarget="makeDashboardPublicDialogContent">
  32 + <span
  33 + innerHTML="{{ translate.get('dashboard.public-dashboard-text', {dashboardTitle: dashboard.title, publicLink: publicLink}) | async }}">
  34 + </span>
  35 + <div fxLayout="row" fxLayoutAlign="start center">
  36 + <pre class="tb-highlight" fxFlex><code>{{ publicLink }}</code></pre>
  37 + <button mat-button mat-icon-button
  38 + ngxClipboard
  39 + (cbOnSuccess)="onPublicLinkCopied($event)"
  40 + cbContent="{{publicLink}}"
  41 + matTooltipPosition="above"
  42 + matTooltip="{{ 'dashboard.copy-public-link' | translate }}">
  43 + <mat-icon svgIcon="mdi:clipboard-arrow-left"></mat-icon>
  44 + </button>
  45 + </div>
  46 + <div class="tb-notice" innerHTML="{{'dashboard.public-dashboard-notice' | translate}}"></div>
  47 + <tb-social-share-panel style="padding-top: 15px;"
  48 + shareTitle="{{ 'dashboard.socialshare-title' | translate:{dashboardTitle: dashboard.title} }}"
  49 + shareText="{{ 'dashboard.socialshare-text' | translate:{dashboardTitle: dashboard.title} }}"
  50 + shareLink="{{ publicLink }}"
  51 + shareHashTags="thingsboard, iot">
  52 + </tb-social-share-panel>
  53 + </div>
  54 + <div mat-dialog-actions fxLayout="row">
  55 + <span fxFlex></span>
  56 + <button mat-button color="primary"
  57 + style="margin-right: 20px;"
  58 + type="button"
  59 + [disabled]="(isLoading$ | async)"
  60 + (click)="close()" cdkFocusInitial>
  61 + {{ 'action.ok' | translate }}
  62 + </button>
  63 + </div>
  64 +</div>
... ...
  1 +///
  2 +/// Copyright © 2016-2019 The Thingsboard Authors
  3 +///
  4 +/// Licensed under the Apache License, Version 2.0 (the "License");
  5 +/// you may not use this file except in compliance with the License.
  6 +/// You may obtain a copy of the License at
  7 +///
  8 +/// http://www.apache.org/licenses/LICENSE-2.0
  9 +///
  10 +/// Unless required by applicable law or agreed to in writing, software
  11 +/// distributed under the License is distributed on an "AS IS" BASIS,
  12 +/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 +/// See the License for the specific language governing permissions and
  14 +/// limitations under the License.
  15 +///
  16 +
  17 +import {Component, Inject, OnInit, SkipSelf} from '@angular/core';
  18 +import {ErrorStateMatcher, MAT_DIALOG_DATA, MatDialogRef} from '@angular/material';
  19 +import {PageComponent} from '@shared/components/page.component';
  20 +import {Store} from '@ngrx/store';
  21 +import {AppState} from '@core/core.state';
  22 +import {FormBuilder, FormControl, FormGroup, FormGroupDirective, NgForm} from '@angular/forms';
  23 +import {EntityType} from '@shared/models/entity-type.models';
  24 +import {DashboardService} from '@core/http/dashboard.service';
  25 +import {forkJoin, Observable} from 'rxjs';
  26 +import {DashboardInfo} from '@app/shared/models/dashboard.models';
  27 +import {ActionNotificationShow} from '@core/notification/notification.actions';
  28 +import {TranslateService} from '@ngx-translate/core';
  29 +
  30 +export interface MakeDashboardPublicDialogData {
  31 + dashboard: DashboardInfo;
  32 +}
  33 +
  34 +@Component({
  35 + selector: 'tb-make-dashboard-public-dialog',
  36 + templateUrl: './make-dashboard-public-dialog.component.html',
  37 + styleUrls: []
  38 +})
  39 +export class MakeDashboardPublicDialogComponent extends PageComponent implements OnInit {
  40 +
  41 + dashboard: DashboardInfo;
  42 +
  43 + publicLink: string;
  44 +
  45 + constructor(protected store: Store<AppState>,
  46 + @Inject(MAT_DIALOG_DATA) public data: MakeDashboardPublicDialogData,
  47 + public translate: TranslateService,
  48 + private dashboardService: DashboardService,
  49 + public dialogRef: MatDialogRef<MakeDashboardPublicDialogComponent>,
  50 + public fb: FormBuilder) {
  51 + super(store);
  52 +
  53 + this.dashboard = data.dashboard;
  54 + this.publicLink = dashboardService.getPublicDashboardLink(this.dashboard);
  55 + }
  56 +
  57 + ngOnInit(): void {
  58 + }
  59 +
  60 + close(): void {
  61 + this.dialogRef.close();
  62 + }
  63 +
  64 +
  65 + onPublicLinkCopied($event) {
  66 + this.store.dispatch(new ActionNotificationShow(
  67 + {
  68 + message: this.translate.instant('dashboard.public-link-copied-message'),
  69 + type: 'success',
  70 + target: 'makeDashboardPublicDialogContent',
  71 + duration: 750,
  72 + verticalPosition: 'bottom',
  73 + horizontalPosition: 'left'
  74 + }));
  75 + }
  76 +
  77 +}
... ...
... ... @@ -311,6 +311,7 @@ export class DevicesTableConfigResolver implements Resolve<EntityTableConfig<Dev
311 311 $event.stopPropagation();
312 312 }
313 313 // TODO:
  314 + this.dialogService.todo();
314 315 }
315 316
316 317 addDevicesToCustomer($event: Event) {
... ...
... ... @@ -93,18 +93,21 @@
93 93 </mat-panel-title>
94 94 </mat-expansion-panel-header>
95 95 <div translate class="tb-hint">entity-view.attributes-propagation-hint</div>
  96 + <label translate class="tb-title no-padding">entity-view.client-attributes</label>
96 97 <tb-entity-keys-list
97 98 [entityId]="selectedEntityId | async"
98 99 formControlName="cs"
99 100 keysText="entity-view.client-attributes-placeholder"
100 101 [dataKeyType]="dataKeyType.attribute">
101 102 </tb-entity-keys-list>
  103 + <label translate class="tb-title no-padding">entity-view.shared-attributes</label>
102 104 <tb-entity-keys-list
103 105 [entityId]="selectedEntityId | async"
104 106 formControlName="sh"
105 107 keysText="entity-view.shared-attributes-placeholder"
106 108 [dataKeyType]="dataKeyType.attribute">
107 109 </tb-entity-keys-list>
  110 + <label translate class="tb-title no-padding">entity-view.server-attributes</label>
108 111 <tb-entity-keys-list
109 112 [entityId]="selectedEntityId | async"
110 113 formControlName="ss"
... ... @@ -119,6 +122,7 @@
119 122 </mat-panel-title>
120 123 </mat-expansion-panel-header>
121 124 <div translate class="tb-hint">entity-view.timeseries-data-hint</div>
  125 + <label translate class="tb-title no-padding">entity-view.timeseries</label>
122 126 <tb-entity-keys-list
123 127 [entityId]="selectedEntityId | async"
124 128 formControlName="timeseries"
... ...
... ... @@ -119,6 +119,7 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig<
119 119 $event.stopPropagation();
120 120 }
121 121 // TODO:
  122 + this.dialogService.todo();
122 123 }
123 124
124 125 openRuleChain($event: Event, ruleChain: RuleChain) {
... ... @@ -127,6 +128,7 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig<
127 128 }
128 129 // TODO:
129 130 // this.router.navigateByUrl(`customers/${customer.id.id}/users`);
  131 + this.dialogService.todo();
130 132 }
131 133
132 134 exportRuleChain($event: Event, ruleChain: RuleChain) {
... ... @@ -134,6 +136,7 @@ export class RuleChainsTableConfigResolver implements Resolve<EntityTableConfig<
134 136 $event.stopPropagation();
135 137 }
136 138 // TODO:
  139 + this.dialogService.todo();
137 140 }
138 141
139 142 setRootRuleChain($event: Event, ruleChain: RuleChain) {
... ...
... ... @@ -18,6 +18,12 @@
18 18 <div class="tb-details-buttons">
19 19 <button mat-raised-button color="primary"
20 20 [disabled]="(isLoading$ | async)"
  21 + (click)="onEntityAction($event, 'open')"
  22 + [fxShow]="!isEdit">
  23 + {{'widgets-bundle.open-widgets-bundle' | translate }}
  24 + </button>
  25 + <button mat-raised-button color="primary"
  26 + [disabled]="(isLoading$ | async)"
21 27 (click)="onEntityAction($event, 'export')"
22 28 [fxShow]="!isEdit">
23 29 {{'widgets-bundle.export' | translate }}
... ...
... ... @@ -35,6 +35,7 @@ import {Store} from '@ngrx/store';
35 35 import {AppState} from '@core/core.state';
36 36 import {getCurrentAuthUser} from '@app/core/auth/auth.selectors';
37 37 import {Authority} from '@shared/models/authority.enum';
  38 +import {DialogService} from '@core/services/dialog.service';
38 39
39 40 @Injectable()
40 41 export class WidgetsBundlesTableConfigResolver implements Resolve<EntityTableConfig<WidgetsBundle>> {
... ... @@ -42,6 +43,7 @@ export class WidgetsBundlesTableConfigResolver implements Resolve<EntityTableCon
42 43 private readonly config: EntityTableConfig<WidgetsBundle> = new EntityTableConfig<WidgetsBundle>();
43 44
44 45 constructor(private store: Store<AppState>,
  46 + private dialogService: DialogService,
45 47 private widgetsService: WidgetService,
46 48 private translate: TranslateService,
47 49 private datePipe: DatePipe,
... ... @@ -126,6 +128,7 @@ export class WidgetsBundlesTableConfigResolver implements Resolve<EntityTableCon
126 128 $event.stopPropagation();
127 129 }
128 130 // TODO:
  131 + this.dialogService.todo();
129 132 }
130 133
131 134 openWidgetsBundle($event: Event, widgetsBundle: WidgetsBundle) {
... ... @@ -134,6 +137,7 @@ export class WidgetsBundlesTableConfigResolver implements Resolve<EntityTableCon
134 137 }
135 138 // TODO:
136 139 // this.router.navigateByUrl(`customers/${customer.id.id}/users`);
  140 + this.dialogService.todo();
137 141 }
138 142
139 143 exportWidgetsBundle($event: Event, widgetsBundle: WidgetsBundle) {
... ... @@ -141,6 +145,7 @@ export class WidgetsBundlesTableConfigResolver implements Resolve<EntityTableCon
141 145 $event.stopPropagation();
142 146 }
143 147 // TODO:
  148 + this.dialogService.todo();
144 149 }
145 150
146 151 onWidgetsBundleAction(action: EntityAction<WidgetsBundle>): boolean {
... ...
... ... @@ -27,7 +27,10 @@
27 27 (click)="clear()">
28 28 <mat-icon class="material-icons">close</mat-icon>
29 29 </button>
30   - <mat-autocomplete #dashboardAutocomplete="matAutocomplete" [displayWith]="displayDashboardFn">
  30 + <mat-autocomplete
  31 + class="tb-autocomplete"
  32 + #dashboardAutocomplete="matAutocomplete"
  33 + [displayWith]="displayDashboardFn">
31 34 <mat-option *ngFor="let dashboard of filteredDashboards | async" [value]="dashboard">
32 35 <span [innerHTML]="dashboard.title | highlight:searchText"></span>
33 36 </mat-option>
... ...
... ... @@ -28,7 +28,9 @@
28 28 (click)="clear()">
29 29 <mat-icon class="material-icons">close</mat-icon>
30 30 </button>
31   - <mat-autocomplete #entityAutocomplete="matAutocomplete" [displayWith]="displayEntityFn">
  31 + <mat-autocomplete class="tb-autocomplete"
  32 + #entityAutocomplete="matAutocomplete"
  33 + [displayWith]="displayEntityFn">
32 34 <mat-option *ngFor="let entity of filteredEntities | async" [value]="entity">
33 35 <span [innerHTML]="entity.name | highlight:searchText"></span>
34 36 </mat-option>
... ...
... ... @@ -15,27 +15,32 @@
15 15 limitations under the License.
16 16
17 17 -->
18   -<mat-form-field [formGroup]="keysListFormGroup" class="mat-block">
19   - <mat-chip-list #chipList [disabled]="disabled">
  18 +<mat-form-field appearance="standard" [formGroup]="keysListFormGroup" class="mat-block">
  19 + <mat-chip-list #chipList>
20 20 <mat-chip
21 21 *ngFor="let key of modelValue"
22   - [disabled]="disabled"
23 22 [selectable]="!disabled"
24 23 [removable]="!disabled"
25 24 (removed)="remove(key)">
26 25 {{key}}
27 26 <mat-icon matChipRemove *ngIf="!disabled">close</mat-icon>
28 27 </mat-chip>
29   - <input matInput type="text" placeholder="{{ keysText | translate }}"
  28 + <input matInput type="text" placeholder="{{ !disabled ? (keysText | translate) : '' }}"
  29 + style="max-width: 200px;"
30 30 #keyInput
31 31 formControlName="key"
  32 + matAutocompleteOrigin
  33 + #origin="matAutocompleteOrigin"
  34 + [matAutocompleteConnectedTo]="origin"
32 35 (focusin)="onFocus()"
33 36 [matAutocomplete]="keyAutocomplete"
34 37 [matChipInputFor]="chipList"
35 38 [matChipInputSeparatorKeyCodes]="separatorKeysCodes"
36 39 (matChipInputTokenEnd)="add($event)">
37 40 </mat-chip-list>
38   - <mat-autocomplete #keyAutocomplete="matAutocomplete" (optionSelected)="selected($event)"
  41 + <mat-autocomplete #keyAutocomplete="matAutocomplete"
  42 + class="tb-autocomplete"
  43 + (optionSelected)="selected($event)"
39 44 [displayWith]="displayKeyFn">
40 45 <mat-option *ngFor="let key of filteredKeys | async" [value]="key">
41 46 <span [innerHTML]="key | highlight:searchText"></span>
... ...
  1 +/**
  2 + * Copyright © 2016-2019 The Thingsboard Authors
  3 + *
  4 + * Licensed under the Apache License, Version 2.0 (the "License");
  5 + * you may not use this file except in compliance with the License.
  6 + * You may obtain a copy of the License at
  7 + *
  8 + * http://www.apache.org/licenses/LICENSE-2.0
  9 + *
  10 + * Unless required by applicable law or agreed to in writing, software
  11 + * distributed under the License is distributed on an "AS IS" BASIS,
  12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 + * See the License for the specific language governing permissions and
  14 + * limitations under the License.
  15 + */
  16 +:host {
  17 +
  18 +}
  19 +
  20 +:host ::ng-deep {
  21 + .mat-form-field-flex {
  22 + padding-top: 0;
  23 + .mat-form-field-infix {
  24 + border-top: 0;
  25 + }
  26 + }
  27 +}
... ...
... ... @@ -41,7 +41,7 @@ import * as equal from 'deep-equal';
41 41 @Component({
42 42 selector: 'tb-entity-keys-list',
43 43 templateUrl: './entity-keys-list.component.html',
44   - styleUrls: [],
  44 + styleUrls: ['./entity-keys-list.component.scss'],
45 45 providers: [
46 46 {
47 47 provide: NG_VALUE_ACCESSOR,
... ...
... ... @@ -25,7 +25,7 @@
25 25 {{entity.name}}
26 26 <mat-icon matChipRemove *ngIf="!disabled">close</mat-icon>
27 27 </mat-chip>
28   - <input matInput type="text" placeholder="{{ 'entity.entity-list' | translate }}"
  28 + <input matInput type="text" placeholder="{{ !disabled ? ('entity.entity-list' | translate) : '' }}"
29 29 style="max-width: 200px;"
30 30 #entityInput
31 31 formControlName="entity"
... ... @@ -36,6 +36,7 @@
36 36 [matChipInputFor]="chipList">
37 37 </mat-chip-list>
38 38 <mat-autocomplete #entityAutocomplete="matAutocomplete"
  39 + class="tb-autocomplete"
39 40 [displayWith]="displayEntityFn">
40 41 <mat-option *ngFor="let entity of filteredEntities | async" [value]="entity">
41 42 <span [innerHTML]="entity.name | highlight:searchText"></span>
... ...
... ... @@ -29,7 +29,10 @@
29 29 (click)="clear()">
30 30 <mat-icon class="material-icons">close</mat-icon>
31 31 </button>
32   - <mat-autocomplete #subTypeAutocomplete="matAutocomplete" [displayWith]="displaySubTypeFn">
  32 + <mat-autocomplete
  33 + class="tb-autocomplete"
  34 + #subTypeAutocomplete="matAutocomplete"
  35 + [displayWith]="displaySubTypeFn">
33 36 <mat-option *ngFor="let subType of filteredSubTypes | async" [value]="subType">
34 37 <span [innerHTML]="subType | highlight:searchText"></span>
35 38 </mat-option>
... ...
  1 +/**
  2 + * Copyright © 2016-2019 The Thingsboard Authors
  3 + *
  4 + * Licensed under the Apache License, Version 2.0 (the "License");
  5 + * you may not use this file except in compliance with the License.
  6 + * You may obtain a copy of the License at
  7 + *
  8 + * http://www.apache.org/licenses/LICENSE-2.0
  9 + *
  10 + * Unless required by applicable law or agreed to in writing, software
  11 + * distributed under the License is distributed on an "AS IS" BASIS,
  12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 + * See the License for the specific language governing permissions and
  14 + * limitations under the License.
  15 + */
  16 +:host {
  17 + display: block;
  18 +}
... ...
... ... @@ -28,7 +28,7 @@ import {isLocalUrl} from '@core/utils';
28 28 @Component({
29 29 selector: 'tb-social-share-panel',
30 30 templateUrl: './socialshare-panel.component.html',
31   - styleUrls: []
  31 + styleUrls: ['./socialshare-panel.component.scss']
32 32 })
33 33 export class SocialSharePanelComponent implements OnInit {
34 34
... ...
... ... @@ -242,6 +242,13 @@ pre.tb-highlight {
242 242 }
243 243 }
244 244
  245 +.tb-notice {
  246 + padding: 15px;
  247 + font-size: 16px;
  248 + background-color: #f7f7f7;
  249 + border: 1px solid #ccc;
  250 +}
  251 +
245 252 .ace_editor {
246 253 font-size: 16px !important;
247 254 }
... ... @@ -326,3 +333,19 @@ mat-label {
326 333 line-height: 14px;
327 334 color: rgb(221, 44, 0);
328 335 }
  336 +
  337 +.tb-autocomplete {
  338 + .mat-option {
  339 + display: block;
  340 + line-height: 24px;
  341 + height: auto !important;
  342 + padding-top: 8px;
  343 + border-bottom: 1px solid #eee;
  344 + font-size: 14px;
  345 + .mat-option-text {
  346 + line-height: 24px;
  347 + height: auto !important;
  348 + white-space: normal !important;
  349 + }
  350 + }
  351 +}
... ...