Skip to content

Commit

Permalink
add custom subassets view to this sample
Browse files Browse the repository at this point in the history
  • Loading branch information
ck-c8y committed May 3, 2024
1 parent 672e600 commit 8ab5efe
Show file tree
Hide file tree
Showing 7 changed files with 646 additions and 4,486 deletions.
39 changes: 33 additions & 6 deletions app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@ import { NgModule } from "@angular/core";
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { RouterModule as NgRouterModule } from "@angular/router";
import { UpgradeModule as NgUpgradeModule } from "@angular/upgrade/static";
import { CoreModule, HeaderService, RouterModule } from "@c8y/ngx-components";
import {
CoreModule,
DataGridModule,
HeaderService,
RouterModule,
ViewContext,
hookRoute,
} from "@c8y/ngx-components";
import {
DashboardUpgradeModule,
UpgradeModule,
Expand All @@ -28,17 +35,28 @@ import { DatapointLibraryModule } from "@c8y/ngx-components/datapoint-library";
import { WidgetsModule } from "@c8y/ngx-components/widgets";
import { CustomAssetNodeService } from "./src/custom-asset-node.service";
import { CustomHeaderService } from "./src/custom-header.service";
import { CustomSubassetsComponent } from "./src/custom-subassets.component";
import { DeviceGridModule } from "@c8y/ngx-components/device-grid";

@NgModule({
imports: [
// Upgrade module must be the first
UpgradeModule,
BrowserAnimationsModule,
RouterModule.forRoot(),
NgRouterModule.forRoot([...UPGRADE_ROUTES], {
enableTracing: false,
useHash: true,
}),
NgRouterModule.forRoot(
[
{
path: "subassets",
component: CustomSubassetsComponent,
},
...UPGRADE_ROUTES,
],
{
enableTracing: false,
useHash: true,
}
),
CoreModule.forRoot(),
ReportsModule,
NgUpgradeModule,
Expand All @@ -53,11 +71,20 @@ import { CustomHeaderService } from "./src/custom-header.service";
ChildDevicesModule,
CockpitConfigModule,
DatapointLibraryModule.forRoot(),
DeviceGridModule,
WidgetsModule,
],
declarations:[CustomSubassetsComponent],
providers: [
{ provide: AssetNodeService, useClass: CustomAssetNodeService },
// { provide: HeaderService, useClass: CustomHeaderService },
hookRoute({
context: ViewContext.Group,
path: "subassets",
component: CustomSubassetsComponent,
priority: 10000,
label: "Custom Subassets",
}),
// { provide: HeaderService, useClass: CustomHeaderService },
],
})
export class AppModule extends HybridAppModule {
Expand Down
2 changes: 1 addition & 1 deletion ng1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import '@c8y/ng1-modules/modbusWidget4/cumulocity.json';
import '@c8y/ng1-modules/scada/cumulocity.json';
import '@c8y/ng1-modules/htmlWidget/cumulocity.json';
import '@c8y/ng1-modules/applicationLinks/cumulocity.json';
import '@c8y/ng1-modules/helpAndSupport/cumulocity.json';
// import '@c8y/ng1-modules/helpAndSupport/cumulocity.json';
import '@c8y/ng1-modules/eventList/cumulocity.json';
import '@c8y/ng1-modules/export/cumulocity.json';
import '@c8y/ng1-modules/dataPointTable/cumulocity.json';
Expand Down
Loading

0 comments on commit 8ab5efe

Please sign in to comment.