Skip to content

Commit

Permalink
merge device events pages and make system property toggle in realtime
Browse files Browse the repository at this point in the history
  • Loading branch information
YingXue committed Jul 20, 2020
1 parent f856340 commit b871597
Show file tree
Hide file tree
Showing 25 changed files with 1,353 additions and 1,376 deletions.
17 changes: 0 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
"react-collapsible": "2.3.2",
"react-dom": "16.13.1",
"react-i18next": "11.5.0",
"react-infinite-scroller": "1.2.2",
"react-jsonschema-form": "1.7.0",
"react-router-dom": "5.2.0",
"react-smooth-dnd": "0.11.0",
Expand Down Expand Up @@ -117,7 +116,6 @@
"@types/jest-plugin-context": "2.9.0",
"@types/react": "16.9.35",
"@types/react-dom": "16.9.8",
"@types/react-infinite-scroller": "1.0.8",
"@types/react-jsonschema-form": "1.0.10",
"@types/react-router-dom": "5.1.5",
"@types/react-toastify": "4.0.1",
Expand Down
1 change: 0 additions & 1 deletion src/app/api/parameters/deviceParameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export interface MonitorEventsParameters {
customEventHubConnectionString?: string;
hubConnectionString?: string;

fetchSystemProperties?: boolean;
startTime?: Date;
}

Expand Down
1 change: 0 additions & 1 deletion src/app/api/services/devicesService.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,6 @@ describe('deviceTwinService', () => {
consumerGroup: '$Default',
customEventHubConnectionString: undefined,
deviceId,
fetchSystemProperties: undefined,
hubConnectionString: undefined,
startTime: undefined
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { ConnectionStringEditView } from './connectionStringEditView';
import { CONNECTION_STRING_LIST_MAX_LENGTH } from '../../constants/browserStorage';
import * as AsyncSagaReducer from '../../shared/hooks/useAsyncSagaReducer';
import { connectionStringsStateInitial } from '../state';
import * as actions from '../actions';
import { upsertConnectionStringAction } from '../actions';

jest.mock('react-router-dom', () => ({
Expand Down
3 changes: 3 additions & 0 deletions src/app/constants/actionTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const FETCH_MODEL_DEFINITION = 'FETCH_MODEL_DEFINITION';
// devices
export const ADD_DEVICE = 'ADD_DEVICE';
export const CLEAR_DEVICES = 'CLEAR_DEVICES';
export const CLEAR_MONITORING_EVENTS = 'CLEAR_MONITORING_EVENTS';
export const CLOUD_TO_DEVICE_MESSAGE = 'CLOUD_TO_DEVICE_MESSAGE';
export const DELETE_DEVICES = 'DELETE_DEVICES';
export const EXECUTE_METHOD = 'EXECUTE_METHOD';
Expand All @@ -24,6 +25,8 @@ export const INVOKE_DEVICE_METHOD = 'INVOKE_DEVICE_METHOD';
export const INVOKE_DIGITAL_TWIN_INTERFACE_COMMAND = 'INVOKE_DIGITAL_TWIN_INTERFACE_COMMAND';
export const PATCH_DIGITAL_TWIN = 'PATCH_DIGITAL_TWIN';
export const SET_COMPONENT_NAME = 'SET_COMPONENT_NAME';
export const START_EVENTS_MONITORING = 'START_EVENTS_MONITORING';
export const STOP_EVENTS_MONITORING = 'STOP_EVENTS_MONITORING';
export const UPDATE_TWIN = 'UPDATE_TWIN';
export const UPDATE_DEVICE_IDENTITY = 'UPDATE_DEVICE_IDENTITY';

Expand Down
43 changes: 43 additions & 0 deletions src/app/css/_deviceEvents.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
border-top: 1px solid themed('contrastBorder');
}
padding: 0 25px;
width: 100%;
pre {
white-space: pre-wrap;
}
}
}

Expand Down Expand Up @@ -66,5 +70,44 @@
.scrollable-telemetry {
height: calc(100vh - 400px);
overflow-y: auto;
overflow-x: hidden;
}

.scrollable-pnp-telemetry {
height: calc(100vh - 490px);
overflow-y: auto;
overflow-x: hidden;
.column-value-text {
.value-validation-error {
@include themify($themes) {
color: themed('errorText');
}
padding-top: 10px;
font-size: 14px;
}
}
}

.pnp-modeled-list {
@include themify($themes) {
background-color: themed('backgroundColor');
}
.list-header {
font-weight: bold;
border-bottom: 1px solid;
@include themify($themes) {
border-bottom-color: themed('borderColor');
}
padding-bottom: 5px;
}
}

.item-summary {
overflow: auto;
width: 100%;
border-bottom: 1px solid;
@include themify($themes) {
border-bottom-color: themed('borderColor');
}
}
}
5 changes: 0 additions & 5 deletions src/app/css/_devicePnpDetailList.scss
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,3 @@
height: calc(100vh - 245px);
overflow-y: auto;
}

.scrollable-pnp-telemetry {
height: calc(100vh - 400px);
overflow-y: auto;
}
2 changes: 0 additions & 2 deletions src/app/devices/cloudToDeviceMessage/saga.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,11 @@ describe('cloudToDeviceMessageSaga', () => {
return randomNumber;
});

const connectionString = 'connection_string';
const deviceId = 'device_id';
const message = 'message';

const cloudToDeviceMessageParameters: CloudToDeviceMessageParameters = {
body: message,
connectionString,
deviceId
};

Expand Down
14 changes: 14 additions & 0 deletions src/app/devices/deviceEvents/actions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/***********************************************************
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License
**********************************************************/
import actionCreatorFactory from 'typescript-fsa';
import { DEVICECONTENT } from '../../constants/actionPrefixes';
import { CLEAR_MONITORING_EVENTS, START_EVENTS_MONITORING, STOP_EVENTS_MONITORING } from '../../constants/actionTypes';
import { Message } from '../../api/models/messages';
import { MonitorEventsParameters } from '../../api/parameters/deviceParameters';

const deviceContentCreator = actionCreatorFactory(DEVICECONTENT);
export const startEventsMonitoringAction = deviceContentCreator.async<MonitorEventsParameters, Message[]>(START_EVENTS_MONITORING);
export const stopEventsMonitoringAction = deviceContentCreator.async<void, void>(STOP_EVENTS_MONITORING);
export const clearMonitoringEventsAction = deviceContentCreator(CLEAR_MONITORING_EVENTS);
Loading

0 comments on commit b871597

Please sign in to comment.