Skip to content

Commit

Permalink
Pnp ga (#357)
Browse files Browse the repository at this point in the history
* update api version

* fix two bugbash bugs and update version

* rebase from master
  • Loading branch information
YingXue authored Sep 25, 2020
1 parent 1e22027 commit 37e91b0
Show file tree
Hide file tree
Showing 8 changed files with 3,548 additions and 1,666 deletions.
5,175 changes: 3,527 additions & 1,648 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "azure-iot-explorer",
"version": "0.11.4",
"version": "0.12.0",
"description": "This project welcomes contributions and suggestions. Most contributions require you to agree to a\r Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\r the rights to use your contribution. For details, visit https://cla.microsoft.com.",
"main": "public/electron.js",
"build": {
Expand Down Expand Up @@ -123,7 +123,7 @@
"@types/webpack-dev-server": "3.1.7",
"@types/webpack-merge": "4.1.5",
"awesome-typescript-loader": "5.2.1",
"concurrently": "4.1.0",
"concurrently": "5.3.0",
"copy-webpack-plugin": "6.1.0",
"css-loader": "1.0.0",
"electron": "7.2.4",
Expand All @@ -133,11 +133,11 @@
"enzyme-to-json": "3.3.5",
"file-loader": "2.0.0",
"html-webpack-plugin": "3.2.0",
"jest": "25.1.0",
"jest": "26.4.2",
"jest-plugin-context": "2.9.0",
"jest-trx-results-processor": "0.0.7",
"mini-css-extract-plugin": "0.8.0",
"node-sass": "4.13.1",
"node-sass": "4.14.1",
"nodemon": "2.0.4",
"optimize-css-assets-webpack-plugin": "5.0.3",
"sass-loader": "7.1.0",
Expand All @@ -152,8 +152,8 @@
"typescript": "3.4.5",
"webpack": "4.41.2",
"webpack-bundle-analyzer": "3.3.2",
"webpack-cli": "3.1.2",
"webpack-dev-server": "3.1.14",
"webpack-cli": "3.3.12",
"webpack-dev-server": "3.11.0",
"webpack-merge": "4.2.1",
"webpack-shell-plugin": "0.5.0"
},
Expand Down
3 changes: 3 additions & 0 deletions src/app/api/models/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface Message {
export enum MESSAGE_PROPERTIES {
IOTHUB_MESSAGE_SCHEMA = 'iothub-message-schema'
}

export enum MESSAGE_SYSTEM_PROPERTIES {
IOTHUB_CONNECTION_AUTH_GENERATION_ID = 'iothub-connection-auth-generation-id',
IOTHUB_CONNECTION_AUTH_METHOD = 'iothub-connection-auth-method',
Expand All @@ -21,3 +22,5 @@ export enum MESSAGE_SYSTEM_PROPERTIES {
IOTHUB_MESSAGE_SOURCE = 'iothub-message-source',
IOTHUB_ENQUEUED_TIME = 'iothub-enqueuedtime'
}

export const IOTHUB_MESSAGE_SOURCE_TELEMETRY = 'telemetry';
2 changes: 1 addition & 1 deletion src/app/constants/apiConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const PUBLIC_REPO_HOSTNAME = 'repo.azureiotrepository.com';
export const MONITOR = '/monitor';
export const STOP = '/stop';

export const DIGITAL_TWIN_API_VERSION_PREVIEW = '2020-05-31-preview';
export const DIGITAL_TWIN_API_VERSION_PREVIEW = '2020-09-30';
export const MODEL_REPO_API_VERSION = '2020-05-01-preview';
export const HUB_DATA_PLANE_API_VERSION = '2020-06-30-preview';

Expand Down
8 changes: 7 additions & 1 deletion src/app/devices/deviceEvents/components/deviceEvents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { Announced } from 'office-ui-fabric-react/lib/components/Announced';
import { Toggle } from 'office-ui-fabric-react/lib/components/Toggle';
import { Label } from 'office-ui-fabric-react/lib/components/Label';
import { ResourceKeys } from '../../../../localization/resourceKeys';
import { Message, MESSAGE_SYSTEM_PROPERTIES, MESSAGE_PROPERTIES } from '../../../api/models/messages';
import { Message, MESSAGE_SYSTEM_PROPERTIES, MESSAGE_PROPERTIES, IOTHUB_MESSAGE_SOURCE_TELEMETRY } from '../../../api/models/messages';
import { parseDateTimeString } from '../../../api/dataTransforms/transformHelper';
import { CLEAR, CHECKED_CHECKBOX, EMPTY_CHECKBOX, START, STOP, NAVIGATE_BACK, REFRESH, REMOVE, CODE } from '../../../constants/iconNames';
import { getDeviceIdFromQueryString, getComponentNameFromQueryString, getInterfaceIdFromQueryString } from '../../../shared/utils/queryStringHelper';
Expand Down Expand Up @@ -316,10 +316,16 @@ export const DeviceEvents: React.FC = () => {
}
};

// tslint:disable-next-line: cyclomatic-complexity
const filterMessage = (message: Message) => {
if (!message || !message.systemProperties) {
return false;
}
if (message.systemProperties[MESSAGE_SYSTEM_PROPERTIES.IOTHUB_MESSAGE_SOURCE] &&
message.systemProperties[MESSAGE_SYSTEM_PROPERTIES.IOTHUB_MESSAGE_SOURCE].toLowerCase() !== IOTHUB_MESSAGE_SOURCE_TELEMETRY) {
// filter out telemetry sent from other sources
return false;
}
if (componentName === DEFAULT_COMPONENT_FOR_DIGITAL_TWIN) {
// for default component, we only expect ${IOTHUB_INTERFACE_ID} to be in the system property not ${IOTHUB_COMPONENT_NAME}
return message.systemProperties[MESSAGE_SYSTEM_PROPERTIES.IOTHUB_INTERFACE_ID] === interfaceId &&
Expand Down
8 changes: 0 additions & 8 deletions src/app/devices/deviceIdentity/components/deviceIdentity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@ export interface DeviceIdentityDataProps {
synchronizationStatus: SynchronizationStatus;
}

export interface DeviceIdentityState {
identity: DeviceIdentity;
isDirty: boolean;
sasTokenExpiration: number;
sasTokenConnectionString: string;
sasTokenSelectedKey: string;
}

export const DeviceIdentityInformation: React.FC<DeviceIdentityDataProps & DeviceIdentityDispatchProps> = (props: DeviceIdentityDataProps & DeviceIdentityDispatchProps) => {
const { t } = useTranslation();
const { hostName } = useParams();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const generateReportedTwinSchemaAndInterfaceTuple = (model: ModelDefiniti
return nonWritableProperties.map(property => ({
propertyModelDefinition: property,
propertySchema: jsonSchemaAdaptor.parseInterfacePropertyToJsonSchema(property),
reportedTwin: digitalTwinForSpecificComponent && digitalTwinForSpecificComponent[property.name]
// digitalTwinForSpecificComponent is required to always have a $metadata key
reportedTwin: digitalTwinForSpecificComponent && digitalTwinForSpecificComponent.$metadata && digitalTwinForSpecificComponent[property.name]
}));
};
3 changes: 2 additions & 1 deletion src/app/devices/pnp/components/deviceSettings/dataHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ export const generateTwinSchemaAndInterfaceTuple = (model: ModelDefinition, digi
return {
isComponentContainedInDigitalTwin: !!digitalTwinForSpecificComponent,
metadata: digitalTwinForSpecificComponent && digitalTwinForSpecificComponent.$metadata && digitalTwinForSpecificComponent.$metadata[setting.name],
reportedTwin: digitalTwinForSpecificComponent && digitalTwinForSpecificComponent[setting.name],
// digitalTwinForSpecificComponent is required to always have a $metadata key
reportedTwin: digitalTwinForSpecificComponent && digitalTwinForSpecificComponent.$metadata && digitalTwinForSpecificComponent[setting.name],
settingModelDefinition: setting,
settingSchema: jsonSchemaAdaptor.parseInterfacePropertyToJsonSchema(setting)
};
Expand Down

0 comments on commit 37e91b0

Please sign in to comment.