Skip to content

Commit

Permalink
Ying/navfixes (#476)
Browse files Browse the repository at this point in the history
* add column for model for module identity; fix nav regression

* bump version

* fix broken tests
  • Loading branch information
YingXue authored Oct 27, 2021
1 parent 1e1515f commit 7b2cef8
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "azure-iot-explorer",
"version": "0.14.6",
"version": "0.14.7",
"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": "host/electron.js",
"build": {
Expand Down
1 change: 1 addition & 0 deletions src/app/api/models/moduleIdentity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ export interface ModuleIdentity {
lastActivityTime?: string;
managedBy?: string;
moduleId: string;
modelId?: string;
}
9 changes: 6 additions & 3 deletions src/app/api/services/moduleService.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,13 @@ describe('moduleService', () => {
const connectionInformation = mockDataPlaneConnectionHelper();
const dataPlaneRequest: DataplaneService.DataPlaneRequest = {
apiVersion: HUB_DATA_PLANE_API_VERSION,
body: JSON.stringify({
query: `SELECT * FROM devices.modules WHERE deviceId in ['${parameters.deviceId}']`,
}),
hostName: connectionInformation.connectionInfo.hostName,
httpMethod: HTTP_OPERATION_TYPES.Get,
path: `devices/${deviceId}/modules`,
sharedAccessSignature: connectionInformation.sasToken
httpMethod: HTTP_OPERATION_TYPES.Post,
path: 'devices/query',
sharedAccessSignature: connectionInformation.sasToken,
};

const result = await ModuleService.fetchModuleIdentities(parameters);
Expand Down
7 changes: 5 additions & 2 deletions src/app/api/services/moduleService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ export const fetchModuleIdentities = async (parameters: FetchModuleIdentitiesPar

const dataPlaneRequest: DataPlaneRequest = {
apiVersion: HUB_DATA_PLANE_API_VERSION,
body: JSON.stringify({
query: `SELECT * FROM devices.modules WHERE deviceId in ['${parameters.deviceId}']`,
}),
hostName: connectionInformation.connectionInfo.hostName,
httpMethod: HTTP_OPERATION_TYPES.Get,
path: `devices/${parameters.deviceId}/modules`,
httpMethod: HTTP_OPERATION_TYPES.Post,
path: 'devices/query',
sharedAccessSignature: connectionInformation.sasToken,
};

Expand Down
1 change: 0 additions & 1 deletion src/app/css/_deviceContent.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ $nav-width: 20%;
transition: all 0.5s;
}
.device-content-detail {
margin: 0;
.form-group {
.fieldChildren {
display: flex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,21 @@ exports[`ModuleIdentityList snapshot matches snapshot when fetch failed 1`] = `
Object {
"ariaLabel": "moduleIdentity.columns.lastActivityTime",
"fieldName": "lastActivityTime",
"isResizable": true,
"key": "lastActivityTime",
"maxWidth": 250,
"minWidth": 150,
"name": "moduleIdentity.columns.lastActivityTime",
"onRender": [Function],
},
Object {
"ariaLabel": "moduleIdentity.columns.modelId",
"fieldName": "modelId",
"key": "modelId",
"maxWidth": 250,
"minWidth": 150,
"name": "moduleIdentity.columns.modelId",
},
]
}
items={Array []}
Expand Down Expand Up @@ -165,12 +174,21 @@ exports[`ModuleIdentityList snapshot matches snapshot while loading 1`] = `
Object {
"ariaLabel": "moduleIdentity.columns.lastActivityTime",
"fieldName": "lastActivityTime",
"isResizable": true,
"key": "lastActivityTime",
"maxWidth": 250,
"minWidth": 150,
"name": "moduleIdentity.columns.lastActivityTime",
"onRender": [Function],
},
Object {
"ariaLabel": "moduleIdentity.columns.modelId",
"fieldName": "modelId",
"key": "modelId",
"maxWidth": 250,
"minWidth": 150,
"name": "moduleIdentity.columns.modelId",
},
]
}
items={Array []}
Expand Down Expand Up @@ -256,12 +274,21 @@ exports[`ModuleIdentityList snapshot matches snapshot with moduleIdentityList 1`
Object {
"ariaLabel": "moduleIdentity.columns.lastActivityTime",
"fieldName": "lastActivityTime",
"isResizable": true,
"key": "lastActivityTime",
"maxWidth": 250,
"minWidth": 150,
"name": "moduleIdentity.columns.lastActivityTime",
"onRender": [Function],
},
Object {
"ariaLabel": "moduleIdentity.columns.modelId",
"fieldName": "modelId",
"key": "modelId",
"maxWidth": 250,
"minWidth": 150,
"name": "moduleIdentity.columns.modelId",
},
]
}
items={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,20 @@ export const ModuleIdentityList: React.FC = () => {
{
ariaLabel: t(ResourceKeys.moduleIdentity.columns.lastActivityTime),
fieldName: 'lastActivityTime',
isResizable: true,
key: 'lastActivityTime',
maxWidth: 250,
minWidth: 150,
name: t(ResourceKeys.moduleIdentity.columns.lastActivityTime),
onRender: item => parseDateTimeString(item.lastActivityTime) || '--'
},
{
ariaLabel: t(ResourceKeys.moduleIdentity.columns.modelId),
fieldName: 'modelId',
key: 'modelId',
maxWidth: 250,
minWidth: 150,
name: t(ResourceKeys.moduleIdentity.columns.modelId)
}];

return columns;
Expand Down
3 changes: 2 additions & 1 deletion src/localization/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,8 @@
"moduleId": "Module Id",
"connectionState": "Connection state",
"connectionStateLastUpdated": "Connection state last updated time",
"lastActivityTime": "Last activity time"
"lastActivityTime": "Last activity time",
"modelId": "IoT Plug and Play module"
},
"noModules": "There are no module identities for this device.",
"errorFetching": "An error prevented this information from being loaded.",
Expand Down
1 change: 1 addition & 0 deletions src/localization/resourceKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,7 @@ export class ResourceKeys {
connectionState : "moduleIdentity.columns.connectionState",
connectionStateLastUpdated : "moduleIdentity.columns.connectionStateLastUpdated",
lastActivityTime : "moduleIdentity.columns.lastActivityTime",
modelId : "moduleIdentity.columns.modelId",
moduleId : "moduleIdentity.columns.moduleId",
},
command : {
Expand Down

0 comments on commit 7b2cef8

Please sign in to comment.