Skip to content

Commit

Permalink
fix: testing ground DataModule parameter (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
boweihan committed Dec 9, 2021
1 parent 0e4412c commit b4fde90
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, h } from '@stencil/core';
import { initialize } from '@iot-app-kit/core';
import { initialize, DataModule } from '@iot-app-kit/core';
import {
ASSET_DETAILS_QUERY,
DEMO_TURBINE_ASSET_1,
Expand All @@ -17,8 +17,10 @@ const VIEWPORT = { duration: '5m' };
styleUrl: 'testing-ground.css',
})
export class TestingGround {
private dataModule: DataModule;

componentWillLoad() {
initialize({ awsCredentials: getEnvCredentials(), awsRegion: 'us-west-2' });
this.dataModule = initialize({ awsCredentials: getEnvCredentials(), awsRegion: 'us-west-2' });
}

render() {
Expand All @@ -29,6 +31,7 @@ export class TestingGround {
<br />
<br />
<iot-kpi
appKit={this.dataModule}
query={{
source: 'site-wise',
assets: [
Expand All @@ -47,6 +50,7 @@ export class TestingGround {
/>
<div style={{ width: '400px', height: '500px' }}>
<iot-line-chart
appKit={this.dataModule}
query={{
source: 'site-wise',
assets: [
Expand All @@ -61,6 +65,7 @@ export class TestingGround {
</div>
<div style={{ width: '400px', height: '500px' }}>
<iot-line-chart
appKit={this.dataModule}
query={{
source: 'site-wise',
assets: [
Expand Down

0 comments on commit b4fde90

Please sign in to comment.