+
person
{{ item.creatorDisplayName }}
diff --git a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-detail-dialog.component.scss b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-detail-dialog.component.scss
index 0037388209..652ef05dc1 100644
--- a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-detail-dialog.component.scss
+++ b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-detail-dialog.component.scss
@@ -178,7 +178,6 @@
display: flex;
align-items: center;
gap: 4px;
- cursor: pointer;
tb-icon {
font-size: 16px;
@@ -195,8 +194,12 @@
color: $tb-primary-color;
}
- &:hover span {
- text-decoration: underline;
+ &.clickable {
+ cursor: pointer;
+
+ &:hover span {
+ text-decoration: underline;
+ }
}
}
diff --git a/ui-ngx/src/app/modules/home/pages/dashboard/dashboards-table-config.resolver.ts b/ui-ngx/src/app/modules/home/pages/dashboard/dashboards-table-config.resolver.ts
index 9142199d4d..84476cbf11 100644
--- a/ui-ngx/src/app/modules/home/pages/dashboard/dashboards-table-config.resolver.ts
+++ b/ui-ngx/src/app/modules/home/pages/dashboard/dashboards-table-config.resolver.ts
@@ -402,12 +402,10 @@ export class DashboardsTableConfigResolver {
}
}
- addDashboardFromIotHub($event: Event) {
- if ($event) {
- $event.stopPropagation();
- }
+ addDashboardFromIotHub(_$event: Event) {
const dialogRef = this.dialog.open(TbIotHubAddItemDialogComponent, {
panelClass: ['tb-dialog', 'tb-fullscreen-dialog'],
+ disableClose: true,
autoFocus: false,
data: {
itemType: ItemType.DASHBOARD,
@@ -416,7 +414,6 @@ export class DashboardsTableConfigResolver {
});
dialogRef.afterClosed().subscribe((result: IotHubAddItemDialogResult) => {
if (result?.descriptor?.type === 'DASHBOARD' && result.descriptor.dashboardId?.id) {
- this.config.getTable().updateData();
this.router.navigateByUrl(`dashboards/${result.descriptor.dashboardId.id}`);
}
});
diff --git a/ui-ngx/src/app/modules/home/pages/rulechain/rulechains-table-config.resolver.ts b/ui-ngx/src/app/modules/home/pages/rulechain/rulechains-table-config.resolver.ts
index b94b312893..b2f9c5ab84 100644
--- a/ui-ngx/src/app/modules/home/pages/rulechain/rulechains-table-config.resolver.ts
+++ b/ui-ngx/src/app/modules/home/pages/rulechain/rulechains-table-config.resolver.ts
@@ -49,6 +49,13 @@ import { isUndefined } from '@core/utils';
import { PageLink } from '@shared/models/page/page-link';
import { Edge } from '@shared/models/edge.models';
import { mergeMap } from 'rxjs/operators';
+import { ItemType } from '@shared/models/iot-hub/iot-hub-item.models';
+import { IotHubApiService } from '@core/http/iot-hub-api.service';
+import {
+ TbIotHubAddItemDialogComponent,
+ IotHubAddItemDialogData,
+ IotHubAddItemDialogResult
+} from '@home/components/iot-hub/iot-hub-add-item-dialog.component';
import { PageData } from '@shared/models/page/page-data';
import { CustomTranslatePipe } from '@shared/pipe/custom-translate.pipe';
@@ -63,6 +70,7 @@ export class RuleChainsTableConfigResolver {
private importExport: ImportExportService,
private itembuffer: ItemBufferService,
private edgeService: EdgeService,
+ private iotHubApiService: IotHubApiService,
private translate: TranslateService,
private datePipe: DatePipe,
private router: Router,
@@ -168,6 +176,12 @@ export class RuleChainsTableConfigResolver {
icon: 'file_upload',
isEnabled: () => true,
onAction: ($event) => this.importRuleChain($event)
+ },
+ {
+ name: this.translate.instant('iot-hub.add-from-iot-hub'),
+ icon: 'store',
+ isEnabled: () => true,
+ onAction: (_$event) => this.addRuleChainFromIotHub()
}
);
}
@@ -288,6 +302,23 @@ export class RuleChainsTableConfigResolver {
return actions;
}
+ addRuleChainFromIotHub() {
+ const dialogRef = this.dialog.open(TbIotHubAddItemDialogComponent, {
+ panelClass: ['tb-dialog', 'tb-fullscreen-dialog'],
+ disableClose: true,
+ autoFocus: false,
+ data: {
+ itemType: ItemType.RULE_CHAIN,
+ iotHubApiService: this.iotHubApiService
+ } as IotHubAddItemDialogData
+ });
+ dialogRef.afterClosed().subscribe((result: IotHubAddItemDialogResult) => {
+ if (result?.descriptor?.type === 'RULE_CHAIN' && result.descriptor.ruleChainId?.id) {
+ this.router.navigateByUrl(`ruleChains/${result.descriptor.ruleChainId.id}`);
+ }
+ });
+ }
+
importRuleChain($event: Event) {
if ($event) {
$event.stopPropagation();