diff --git a/ui-ngx/src/app/core/core.module.ts b/ui-ngx/src/app/core/core.module.ts index d07c7e7383..c47572f4a3 100644 --- a/ui-ngx/src/app/core/core.module.ts +++ b/ui-ngx/src/app/core/core.module.ts @@ -38,6 +38,7 @@ import { FlexLayoutModule } from '@angular/flex-layout'; import { TranslateDefaultCompiler } from '@core/translate/translate-default-compiler'; import { AlertDialogComponent } from '@core/services/dialog/alert-dialog.component'; import { WINDOW_PROVIDERS } from '@core/services/window.service'; +import {TodoDialogComponent} from "@core/services/dialog/todo-dialog.component"; export function HttpLoaderFactory(http: HttpClient) { return new TranslateHttpLoader(http, './assets/locale/locale.constant-', '.json'); @@ -46,11 +47,13 @@ export function HttpLoaderFactory(http: HttpClient) { @NgModule({ entryComponents: [ ConfirmDialogComponent, - AlertDialogComponent + AlertDialogComponent, + TodoDialogComponent ], declarations: [ ConfirmDialogComponent, - AlertDialogComponent + AlertDialogComponent, + TodoDialogComponent ], imports: [ CommonModule, diff --git a/ui-ngx/src/app/core/services/dialog.service.ts b/ui-ngx/src/app/core/services/dialog.service.ts index 955e062dce..ada1baf26c 100644 --- a/ui-ngx/src/app/core/services/dialog.service.ts +++ b/ui-ngx/src/app/core/services/dialog.service.ts @@ -20,6 +20,7 @@ import { MatDialog, MatDialogConfig } from '@angular/material'; import { ConfirmDialogComponent } from '@core/services/dialog/confirm-dialog.component'; import { TranslateService } from '@ngx-translate/core'; import { AlertDialogComponent } from '@core/services/dialog/alert-dialog.component'; +import {TodoDialogComponent} from "@core/services/dialog/todo-dialog.component"; @Injectable( { @@ -67,4 +68,13 @@ export class DialogService { return dialogRef.afterClosed(); } + todo(): Observable { + const dialogConfig: MatDialogConfig = { + disableClose: true, + panelClass: ['tb-fullscreen-dialog'] + }; + const dialogRef = this.dialog.open(TodoDialogComponent, dialogConfig); + return dialogRef.afterClosed(); + } + } diff --git a/ui-ngx/src/app/core/services/dialog/todo-dialog.component.html b/ui-ngx/src/app/core/services/dialog/todo-dialog.component.html new file mode 100644 index 0000000000..67607c875c --- /dev/null +++ b/ui-ngx/src/app/core/services/dialog/todo-dialog.component.html @@ -0,0 +1,24 @@ + +

Coming soon!

+
+ +
+
+ +
diff --git a/ui-ngx/src/app/core/services/dialog/todo-dialog.component.scss b/ui-ngx/src/app/core/services/dialog/todo-dialog.component.scss new file mode 100644 index 0000000000..2dc404f108 --- /dev/null +++ b/ui-ngx/src/app/core/services/dialog/todo-dialog.component.scss @@ -0,0 +1,23 @@ +/** + * Copyright © 2016-2019 The Thingsboard Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +:host { + .mat-dialog-content { + padding: 0 24px 24px; + img { + max-width: 500px; + } + } +} diff --git a/ui-ngx/src/app/core/services/dialog/todo-dialog.component.ts b/ui-ngx/src/app/core/services/dialog/todo-dialog.component.ts new file mode 100644 index 0000000000..54e365eb84 --- /dev/null +++ b/ui-ngx/src/app/core/services/dialog/todo-dialog.component.ts @@ -0,0 +1,31 @@ +/// +/// Copyright © 2016-2019 The Thingsboard Authors +/// +/// Licensed under the Apache License, Version 2.0 (the "License"); +/// you may not use this file except in compliance with the License. +/// You may obtain a copy of the License at +/// +/// http://www.apache.org/licenses/LICENSE-2.0 +/// +/// Unless required by applicable law or agreed to in writing, software +/// distributed under the License is distributed on an "AS IS" BASIS, +/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +/// See the License for the specific language governing permissions and +/// limitations under the License. +/// + +import {Component} from '@angular/core'; +import {MatDialogRef} from '@angular/material'; + +@Component({ + selector: 'tb-todo-dialog', + templateUrl: './todo-dialog.component.html', + styleUrls: ['./todo-dialog.component.scss'] +}) +export class TodoDialogComponent { + + comingSoon = require('../../../../assets/coming-soon.jpg'); + + constructor(public dialogRef: MatDialogRef) { + } +} diff --git a/ui-ngx/src/app/modules/home/pages/asset/assets-table-config.resolver.ts b/ui-ngx/src/app/modules/home/pages/asset/assets-table-config.resolver.ts index d217bc57c2..016004a493 100644 --- a/ui-ngx/src/app/modules/home/pages/asset/assets-table-config.resolver.ts +++ b/ui-ngx/src/app/modules/home/pages/asset/assets-table-config.resolver.ts @@ -279,6 +279,7 @@ export class AssetsTableConfigResolver implements Resolve> { @@ -299,6 +303,7 @@ export class DashboardsTableConfigResolver implements Resolve { - // TODO: - - this.config.table.updateData(); + this.dialog.open + (MakeDashboardPublicDialogComponent, { + disableClose: true, + panelClass: ['tb-dialog', 'tb-fullscreen-dialog'], + data: { + dashboard: publicDashboard + } + }).afterClosed() + .subscribe(() => { + this.config.table.updateData(); + }); } ); } diff --git a/ui-ngx/src/app/modules/home/pages/dashboard/make-dashboard-public-dialog.component.html b/ui-ngx/src/app/modules/home/pages/dashboard/make-dashboard-public-dialog.component.html new file mode 100644 index 0000000000..7d53d8b1e7 --- /dev/null +++ b/ui-ngx/src/app/modules/home/pages/dashboard/make-dashboard-public-dialog.component.html @@ -0,0 +1,64 @@ + +
+ +

{{ 'dashboard.public-dashboard-title' | translate }}

+ + +
+ + +
+
+ + +
+
{{ publicLink }}
+ +
+
+ + +
+
+ + +
+
diff --git a/ui-ngx/src/app/modules/home/pages/dashboard/make-dashboard-public-dialog.component.ts b/ui-ngx/src/app/modules/home/pages/dashboard/make-dashboard-public-dialog.component.ts new file mode 100644 index 0000000000..26c782ed8c --- /dev/null +++ b/ui-ngx/src/app/modules/home/pages/dashboard/make-dashboard-public-dialog.component.ts @@ -0,0 +1,77 @@ +/// +/// Copyright © 2016-2019 The Thingsboard Authors +/// +/// Licensed under the Apache License, Version 2.0 (the "License"); +/// you may not use this file except in compliance with the License. +/// You may obtain a copy of the License at +/// +/// http://www.apache.org/licenses/LICENSE-2.0 +/// +/// Unless required by applicable law or agreed to in writing, software +/// distributed under the License is distributed on an "AS IS" BASIS, +/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +/// See the License for the specific language governing permissions and +/// limitations under the License. +/// + +import {Component, Inject, OnInit, SkipSelf} from '@angular/core'; +import {ErrorStateMatcher, MAT_DIALOG_DATA, MatDialogRef} from '@angular/material'; +import {PageComponent} from '@shared/components/page.component'; +import {Store} from '@ngrx/store'; +import {AppState} from '@core/core.state'; +import {FormBuilder, FormControl, FormGroup, FormGroupDirective, NgForm} from '@angular/forms'; +import {EntityType} from '@shared/models/entity-type.models'; +import {DashboardService} from '@core/http/dashboard.service'; +import {forkJoin, Observable} from 'rxjs'; +import {DashboardInfo} from '@app/shared/models/dashboard.models'; +import {ActionNotificationShow} from '@core/notification/notification.actions'; +import {TranslateService} from '@ngx-translate/core'; + +export interface MakeDashboardPublicDialogData { + dashboard: DashboardInfo; +} + +@Component({ + selector: 'tb-make-dashboard-public-dialog', + templateUrl: './make-dashboard-public-dialog.component.html', + styleUrls: [] +}) +export class MakeDashboardPublicDialogComponent extends PageComponent implements OnInit { + + dashboard: DashboardInfo; + + publicLink: string; + + constructor(protected store: Store, + @Inject(MAT_DIALOG_DATA) public data: MakeDashboardPublicDialogData, + public translate: TranslateService, + private dashboardService: DashboardService, + public dialogRef: MatDialogRef, + public fb: FormBuilder) { + super(store); + + this.dashboard = data.dashboard; + this.publicLink = dashboardService.getPublicDashboardLink(this.dashboard); + } + + ngOnInit(): void { + } + + close(): void { + this.dialogRef.close(); + } + + + onPublicLinkCopied($event) { + this.store.dispatch(new ActionNotificationShow( + { + message: this.translate.instant('dashboard.public-link-copied-message'), + type: 'success', + target: 'makeDashboardPublicDialogContent', + duration: 750, + verticalPosition: 'bottom', + horizontalPosition: 'left' + })); + } + +} diff --git a/ui-ngx/src/app/modules/home/pages/device/devices-table-config.resolver.ts b/ui-ngx/src/app/modules/home/pages/device/devices-table-config.resolver.ts index 4c22a3b440..95e6edc67b 100644 --- a/ui-ngx/src/app/modules/home/pages/device/devices-table-config.resolver.ts +++ b/ui-ngx/src/app/modules/home/pages/device/devices-table-config.resolver.ts @@ -311,6 +311,7 @@ export class DevicesTableConfigResolver implements Resolve
entity-view.attributes-propagation-hint
+ + +
entity-view.timeseries-data-hint
+
+ - + diff --git a/ui-ngx/src/app/shared/components/entity/entity-autocomplete.component.html b/ui-ngx/src/app/shared/components/entity/entity-autocomplete.component.html index 0884a92e53..cbc06bd824 100644 --- a/ui-ngx/src/app/shared/components/entity/entity-autocomplete.component.html +++ b/ui-ngx/src/app/shared/components/entity/entity-autocomplete.component.html @@ -28,7 +28,9 @@ (click)="clear()"> close - + diff --git a/ui-ngx/src/app/shared/components/entity/entity-keys-list.component.html b/ui-ngx/src/app/shared/components/entity/entity-keys-list.component.html index 264eb89d72..f0f30ba830 100644 --- a/ui-ngx/src/app/shared/components/entity/entity-keys-list.component.html +++ b/ui-ngx/src/app/shared/components/entity/entity-keys-list.component.html @@ -15,27 +15,32 @@ limitations under the License. --> - - + + {{key}} close - - diff --git a/ui-ngx/src/app/shared/components/entity/entity-keys-list.component.scss b/ui-ngx/src/app/shared/components/entity/entity-keys-list.component.scss new file mode 100644 index 0000000000..fbe3187168 --- /dev/null +++ b/ui-ngx/src/app/shared/components/entity/entity-keys-list.component.scss @@ -0,0 +1,27 @@ +/** + * Copyright © 2016-2019 The Thingsboard Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +:host { + +} + +:host ::ng-deep { + .mat-form-field-flex { + padding-top: 0; + .mat-form-field-infix { + border-top: 0; + } + } +} diff --git a/ui-ngx/src/app/shared/components/entity/entity-keys-list.component.ts b/ui-ngx/src/app/shared/components/entity/entity-keys-list.component.ts index 4ffec6d989..a9aca0725a 100644 --- a/ui-ngx/src/app/shared/components/entity/entity-keys-list.component.ts +++ b/ui-ngx/src/app/shared/components/entity/entity-keys-list.component.ts @@ -41,7 +41,7 @@ import * as equal from 'deep-equal'; @Component({ selector: 'tb-entity-keys-list', templateUrl: './entity-keys-list.component.html', - styleUrls: [], + styleUrls: ['./entity-keys-list.component.scss'], providers: [ { provide: NG_VALUE_ACCESSOR, diff --git a/ui-ngx/src/app/shared/components/entity/entity-list.component.html b/ui-ngx/src/app/shared/components/entity/entity-list.component.html index cb9ed2a5c9..435427716e 100644 --- a/ui-ngx/src/app/shared/components/entity/entity-list.component.html +++ b/ui-ngx/src/app/shared/components/entity/entity-list.component.html @@ -25,7 +25,7 @@ {{entity.name}} close - diff --git a/ui-ngx/src/app/shared/components/entity/entity-subtype-autocomplete.component.html b/ui-ngx/src/app/shared/components/entity/entity-subtype-autocomplete.component.html index e86e72a1b6..79268979ec 100644 --- a/ui-ngx/src/app/shared/components/entity/entity-subtype-autocomplete.component.html +++ b/ui-ngx/src/app/shared/components/entity/entity-subtype-autocomplete.component.html @@ -29,7 +29,10 @@ (click)="clear()"> close - + diff --git a/ui-ngx/src/app/shared/components/socialshare-panel.component.scss b/ui-ngx/src/app/shared/components/socialshare-panel.component.scss new file mode 100644 index 0000000000..28e2cace12 --- /dev/null +++ b/ui-ngx/src/app/shared/components/socialshare-panel.component.scss @@ -0,0 +1,18 @@ +/** + * Copyright © 2016-2019 The Thingsboard Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +:host { + display: block; +} diff --git a/ui-ngx/src/app/shared/components/socialshare-panel.component.ts b/ui-ngx/src/app/shared/components/socialshare-panel.component.ts index 55de4477cd..1cac8b9008 100644 --- a/ui-ngx/src/app/shared/components/socialshare-panel.component.ts +++ b/ui-ngx/src/app/shared/components/socialshare-panel.component.ts @@ -28,7 +28,7 @@ import {isLocalUrl} from '@core/utils'; @Component({ selector: 'tb-social-share-panel', templateUrl: './socialshare-panel.component.html', - styleUrls: [] + styleUrls: ['./socialshare-panel.component.scss'] }) export class SocialSharePanelComponent implements OnInit { diff --git a/ui-ngx/src/assets/coming-soon.jpg b/ui-ngx/src/assets/coming-soon.jpg new file mode 100644 index 0000000000..3fc8e85352 Binary files /dev/null and b/ui-ngx/src/assets/coming-soon.jpg differ diff --git a/ui-ngx/src/styles.scss b/ui-ngx/src/styles.scss index bb221f4b8d..1b5d25bafe 100644 --- a/ui-ngx/src/styles.scss +++ b/ui-ngx/src/styles.scss @@ -242,6 +242,13 @@ pre.tb-highlight { } } +.tb-notice { + padding: 15px; + font-size: 16px; + background-color: #f7f7f7; + border: 1px solid #ccc; +} + .ace_editor { font-size: 16px !important; } @@ -326,3 +333,19 @@ mat-label { line-height: 14px; color: rgb(221, 44, 0); } + +.tb-autocomplete { + .mat-option { + display: block; + line-height: 24px; + height: auto !important; + padding-top: 8px; + border-bottom: 1px solid #eee; + font-size: 14px; + .mat-option-text { + line-height: 24px; + height: auto !important; + white-space: normal !important; + } + } +}