зеркало из
1
0
Форкнуть 0

Webpack, Electron update and vulnerability fixes (#499)

* Updated webpack and plugins for webpack 5
* Test and packaging updates
* Electron updates
This commit is contained in:
Ryan K 2022-04-06 16:45:06 -07:00 коммит произвёл GitHub
Родитель b3edf4cf95
Коммит 7cbebfec20
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
78 изменённых файлов: 23124 добавлений и 8343 удалений

6
.github/workflows/nodejs.yml поставляемый
Просмотреть файл

@ -13,12 +13,12 @@ jobs:
strategy: strategy:
matrix: matrix:
node-version: [10.x, 12.x] node-version: [14.x]
os: [ubuntu-latest, windows-2016, macOS-latest] os: [ubuntu-latest, windows-latest, macOS-latest]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Use Node.jsn ${{ matrix.node-version }} - name: Use Node ${{ matrix.node-version }}
uses: actions/setup-node@v1 uses: actions/setup-node@v1
with: with:
node-version: ${{ matrix.node-version }} node-version: ${{ matrix.node-version }}

30825
package-lock.json сгенерированный

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -5,7 +5,7 @@
"main": "host/electron.js", "main": "host/electron.js",
"build": { "build": {
"appId": "com.microsoft.azure.iot.pnp.ui", "appId": "com.microsoft.azure.iot.pnp.ui",
"productName": "Azure IoT Explorer (preview)", "productName": "Azure IoT Explorer Preview",
"files": [ "files": [
"dist/**/*", "dist/**/*",
"package.json", "package.json",
@ -76,6 +76,7 @@
"body-parser": "1.18.3", "body-parser": "1.18.3",
"brace": "0.11.1", "brace": "0.11.1",
"cors": "2.8.5", "cors": "2.8.5",
"crypto-browserify": "^3.12.0",
"date-fns": "2.14.0", "date-fns": "2.14.0",
"electron-window-state": "5.0.3", "electron-window-state": "5.0.3",
"express": "4.16.4", "express": "4.16.4",
@ -110,7 +111,7 @@
"@types/i18next": "8.4.4", "@types/i18next": "8.4.4",
"@types/jest": "24.0.15", "@types/jest": "24.0.15",
"@types/jest-plugin-context": "2.9.0", "@types/jest-plugin-context": "2.9.0",
"@types/node": "14.0.27", "@types/node": "16.11.26",
"@types/react": "16.9.35", "@types/react": "16.9.35",
"@types/react-dom": "16.9.8", "@types/react-dom": "16.9.8",
"@types/react-jsonschema-form": "1.0.10", "@types/react-jsonschema-form": "1.0.10",
@ -118,45 +119,42 @@
"@types/request": "2.48.1", "@types/request": "2.48.1",
"@types/semver": "6.0.2", "@types/semver": "6.0.2",
"@types/uuid": "3.4.5", "@types/uuid": "3.4.5",
"@types/webpack": "4.41.27",
"@types/webpack-dev-server": "3.11.3",
"@types/webpack-merge": "4.1.5",
"awesome-typescript-loader": "5.2.1",
"concurrently": "5.3.0", "concurrently": "5.3.0",
"copy-webpack-plugin": "6.1.0", "copy-webpack-plugin": "6.4.1",
"css-loader": "1.0.0", "css-loader": "6.7.1",
"electron": "11.5.0", "css-minimizer-webpack-plugin": "3.4.1",
"electron-builder": "22.8.0", "electron": "18.0.0",
"electron-builder": "22.14.13",
"enzyme": "3.11.0", "enzyme": "3.11.0",
"enzyme-adapter-react-16": "1.15.1", "enzyme-adapter-react-16": "1.15.1",
"enzyme-to-json": "3.3.5", "enzyme-to-json": "3.3.5",
"file-loader": "2.0.0", "file-loader": "2.0.0",
"html-webpack-plugin": "3.2.0", "html-webpack-plugin": "5.5.0",
"is-svg": "^4.3.1", "is-svg": "4.3.2",
"jest": "26.4.2", "jest": "26.4.2",
"jest-plugin-context": "2.9.0", "jest-plugin-context": "2.9.0",
"jest-trx-results-processor": "0.0.7", "jest-trx-results-processor": "0.0.7",
"lodash": "4.17.21", "lodash": "4.17.21",
"mini-css-extract-plugin": "0.8.0", "mini-css-extract-plugin": "2.6.0",
"node-polyfill-webpack-plugin": "1.1.4",
"nodemon": "2.0.4", "nodemon": "2.0.4",
"optimize-css-assets-webpack-plugin": "5.0.3",
"sass": "1.35.2", "sass": "1.35.2",
"sass-loader": "7.2.0", "sass-loader": "7.2.0",
"source-map-loader": "0.2.4", "source-map-loader": "0.2.4",
"ssri": "^8.0.1", "ssri": "8.0.1",
"style-loader": "0.23.1", "style-loader": "0.23.1",
"terser-webpack-plugin": "1.4.5",
"ts-jest": "26.2.0", "ts-jest": "26.2.0",
"ts-loader": "9.2.8",
"tslint": "5.11.0", "tslint": "5.11.0",
"tslint-loader": "3.5.4", "tslint-loader": "3.5.4",
"tslint-origin-ordered-imports-rule": "1.1.2", "tslint-origin-ordered-imports-rule": "1.1.2",
"tslint-react": "3.6.0", "tslint-react": "3.6.0",
"typescript": "3.8.3", "typescript": "4.6.3",
"webpack": "4.41.6", "webpack": "5.70.0",
"webpack-bundle-analyzer": "3.3.2", "webpack-bundle-analyzer": "3.3.2",
"webpack-cli": "3.3.12", "webpack-cli": "4.9.2",
"webpack-dev-server": "3.11.0", "webpack-dev-server": "4.7.4",
"webpack-merge": "4.2.1", "webpack-merge": "5.8.0",
"webpack-shell-plugin": "0.5.0" "webpack-shell-plugin": "0.5.0"
}, },
"jest": { "jest": {

Просмотреть файл

@ -1,8 +1,5 @@
steps: steps:
- task: NodeTool@0 - template: '.\common\install-node.yml'
inputs:
versionSpec: '12.x'
- script: 'npm install' - script: 'npm install'
displayName: Install dependencies displayName: Install dependencies
- script: 'npm run build' - script: 'npm run build'

Просмотреть файл

@ -0,0 +1,4 @@
steps:
- task: NodeTool@0
inputs:
versionSpec: '14.x'

Просмотреть файл

@ -5,14 +5,12 @@ parameters:
type: string type: string
default: 'ubuntu-18.04' default: 'ubuntu-18.04'
values: values:
- 'ubuntu-16.04'
- 'ubuntu-18.04' - 'ubuntu-18.04'
- 'ubuntu-latest' - 'ubuntu-latest'
- name: windowsImage - name: windowsImage
type: string type: string
default: 'vs2017-win2016' default: 'windows-2019'
values: values:
- 'vs2017-win2016'
- 'windows-2019' - 'windows-2019'
- 'windows-latest' - 'windows-latest'
- name: macImage - name: macImage
@ -52,9 +50,7 @@ stages:
vmImage: ${{ parameters.windowsImage }} vmImage: ${{ parameters.windowsImage }}
steps: steps:
- task: NodeTool@0 - template: '.\common\install-node.yml'
inputs:
versionSpec: '12.x'
- template: '.\build-windows.yml' - template: '.\build-windows.yml'
@ -76,9 +72,7 @@ stages:
vmImage: ${{ parameters.macImage }} vmImage: ${{ parameters.macImage }}
steps: steps:
- task: NodeTool@0 - template: '.\common\install-node.yml'
inputs:
versionSpec: '12.x'
- template: '.\build-mac.yml' - template: '.\build-mac.yml'
@ -99,9 +93,7 @@ stages:
vmImage: ${{ parameters.linuxImage }} vmImage: ${{ parameters.linuxImage }}
steps: steps:
- task: NodeTool@0 - template: '.\common\install-node.yml'
inputs:
versionSpec: '12.x'
- template: '.\build-linux.yml' - template: '.\build-linux.yml'

Просмотреть файл

@ -98,7 +98,6 @@ class Main {
width: mainWindowState.width, width: mainWindowState.width,
webPreferences: { // tslint:disable-line:object-literal-sort-keys webPreferences: { // tslint:disable-line:object-literal-sort-keys
contextIsolation: true, // protect against prototype pollution contextIsolation: true, // protect against prototype pollution
enableRemoteModule: false, // turn off remote
nodeIntegration: false, nodeIntegration: false,
preload: __dirname + '/contextBridge.js' // use a preload script preload: __dirname + '/contextBridge.js' // use a preload script
}, },

Просмотреть файл

@ -20,7 +20,6 @@ const headers = new Headers({
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}); });
// tslint:disable // tslint:disable
const emptyPromise = new Promise(() => {});
const twin: Twin = { const twin: Twin = {
deviceId, deviceId,
deviceEtag: '', deviceEtag: '',
@ -63,7 +62,7 @@ describe('deviceTwinService', () => {
context('fetchDeviceTwin', () => { context('fetchDeviceTwin', () => {
it ('returns if deviceId is not specified', () => { it ('returns if deviceId is not specified', () => {
expect(DevicesService.fetchDeviceTwin({deviceId: undefined})).toEqual(emptyPromise); expect(DevicesService.fetchDeviceTwin({deviceId: undefined})).resolves.toBe(undefined);
}); });
it('calls fetch with specified parameters and returns deviceTwin when response is 200', async () => { it('calls fetch with specified parameters and returns deviceTwin when response is 200', async () => {
@ -172,7 +171,7 @@ describe('deviceTwinService', () => {
responseTimeoutInSeconds : 10, responseTimeoutInSeconds : 10,
}; };
it ('returns if deviceId is not specified', () => { it ('returns if deviceId is not specified', () => {
expect(DevicesService.invokeDirectMethod(parameters)).toEqual(emptyPromise); expect(DevicesService.invokeDirectMethod(parameters)).resolves.toBe(undefined);
}); });
it('calls fetch with specified parameters and invokes invokeDirectMethod when response is 200', async () => { it('calls fetch with specified parameters and invokes invokeDirectMethod when response is 200', async () => {
@ -264,7 +263,7 @@ describe('deviceTwinService', () => {
deviceIdentity: undefined deviceIdentity: undefined
}; };
it ('returns if deviceIdentity is not specified', () => { it ('returns if deviceIdentity is not specified', () => {
expect(DevicesService.addDevice(parameters)).toEqual(emptyPromise); expect(DevicesService.addDevice(parameters)).resolves.toBe(undefined);
}); });
it('calls fetch with specified parameters and invokes addDevice when response is 200', async () => { it('calls fetch with specified parameters and invokes addDevice when response is 200', async () => {
@ -327,7 +326,7 @@ describe('deviceTwinService', () => {
deviceIdentity: undefined deviceIdentity: undefined
}; };
it ('returns if deviceIdentity is not specified', () => { it ('returns if deviceIdentity is not specified', () => {
expect(DevicesService.updateDevice(parameters)).toEqual(emptyPromise); expect(DevicesService.updateDevice(parameters)).resolves.toBe(undefined);
}); });
it('calls fetch with specified parameters and invokes updateDevice when response is 200', async () => { it('calls fetch with specified parameters and invokes updateDevice when response is 200', async () => {
@ -390,7 +389,7 @@ describe('deviceTwinService', () => {
deviceId: undefined deviceId: undefined
}; };
it ('returns if deviceId is not specified', () => { it ('returns if deviceId is not specified', () => {
expect(DevicesService.fetchDevice(parameters)).toEqual(emptyPromise); expect(DevicesService.fetchDevice(parameters)).resolves.toBe(undefined);
}); });
it('calls fetch with specified parameters and invokes fetchDevice when response is 200', async () => { it('calls fetch with specified parameters and invokes fetchDevice when response is 200', async () => {
@ -516,7 +515,7 @@ describe('deviceTwinService', () => {
deviceIds: undefined deviceIds: undefined
}; };
it ('returns if deviceId is not specified', () => { it ('returns if deviceId is not specified', () => {
expect(DevicesService.deleteDevices(parameters)).toEqual(emptyPromise); expect(DevicesService.deleteDevices(parameters)).resolves.toBe(undefined);
}); });
it('calls fetch with specified parameters and invokes deleteDevices when response is 200', async () => { it('calls fetch with specified parameters and invokes deleteDevices when response is 200', async () => {

Просмотреть файл

@ -320,7 +320,7 @@ describe('moduleService', () => {
responseTimeoutInSeconds : 10, responseTimeoutInSeconds : 10,
}; };
it ('returns if deviceId is not specified', () => { it ('returns if deviceId is not specified', () => {
expect(ModuleService.invokeModuleDirectMethod(parameters)).toEqual(new Promise(() => {})); expect(ModuleService.invokeModuleDirectMethod(parameters)).resolves.toBe(undefined);
}); });
it('calls fetch with specified parameters and invokes invokeDirectMethod when response is 200', async () => { it('calls fetch with specified parameters and invokes invokeDirectMethod when response is 200', async () => {

Просмотреть файл

@ -3,6 +3,7 @@
* Licensed under the MIT License * Licensed under the MIT License
**********************************************************/ **********************************************************/
import { createHmac } from 'crypto'; import { createHmac } from 'crypto';
import { Buffer } from 'buffer';
import { IoTHubConnectionSettings } from '../services/devicesService'; import { IoTHubConnectionSettings } from '../services/devicesService';
import { LIST_IOT_DEVICES, SAS_EXPIRES_MINUTES } from '../../constants/devices'; import { LIST_IOT_DEVICES, SAS_EXPIRES_MINUTES } from '../../constants/devices';
import { DeviceQuery, QueryClause, ParameterType, OperationType } from '../models/deviceQuery'; import { DeviceQuery, QueryClause, ParameterType, OperationType } from '../models/deviceQuery';
@ -39,11 +40,9 @@ export const generateSasToken = (parameters: GenerateSasTokenParameters) => {
let token = null; let token = null;
if (!!parameters.resourceUri && !!parameters.key) { if (!!parameters.resourceUri && !!parameters.key) {
const encodedUri = encodeURIComponent(parameters.resourceUri); const encodedUri = encodeURIComponent(parameters.resourceUri);
const expires = Math.ceil((Date.now() / MILLISECONDS_PER_SECOND) + (parameters.expiration || SAS_EXPIRES_MINUTES) * SECONDS_PER_MINUTE); const expires = Math.ceil((Date.now() / MILLISECONDS_PER_SECOND) + (parameters.expiration || SAS_EXPIRES_MINUTES) * SECONDS_PER_MINUTE);
const toSign = encodedUri + '\n' + expires; const toSign = encodedUri + '\n' + expires;
const hmac = createHmac('sha256', Buffer.from(parameters.key, 'base64'));
const hmac = createHmac('sha256', new Buffer(parameters.key, 'base64'));
hmac.update(toSign); hmac.update(toSign);
const base64UriEncoded = encodeURIComponent(hmac.digest('base64')); const base64UriEncoded = encodeURIComponent(hmac.digest('base64'));

Просмотреть файл

@ -46,13 +46,13 @@ exports[`connectionString matches snapshot 1`] = `
<div <div
className="properties" className="properties"
> >
<Component <ConnectionStringProperties
connectionString="HostName=test.azure-devices-int.net;SharedAccessKeyName=iothubowner;SharedAccessKey=key" connectionString="HostName=test.azure-devices-int.net;SharedAccessKeyName=iothubowner;SharedAccessKey=key"
hostName="test.azure-devices-int.net" hostName="test.azure-devices-int.net"
sharedAccessKey="key" sharedAccessKey="key"
sharedAccessKeyName="iothubowner" sharedAccessKeyName="iothubowner"
/> />
<Component <MaskedCopyableTextField
allowMask={true} allowMask={true}
ariaLabel="connectionStrings.properties.connectionString.ariaLabel" ariaLabel="connectionStrings.properties.connectionString.ariaLabel"
label="connectionStrings.properties.connectionString.label" label="connectionStrings.properties.connectionString.label"
@ -75,7 +75,7 @@ exports[`connectionString matches snapshot 1`] = `
connectionStrings.visitConnectionCommand.label connectionStrings.visitConnectionCommand.label
</CustomizedActionButton> </CustomizedActionButton>
</div> </div>
<Component <ConnectionStringDelete
connectionString="HostName=test.azure-devices-int.net;SharedAccessKeyName=iothubowner;SharedAccessKey=key" connectionString="HostName=test.azure-devices-int.net;SharedAccessKeyName=iothubowner;SharedAccessKey=key"
hidden={true} hidden={true}
onDeleteCancel={[Function]} onDeleteCancel={[Function]}

Просмотреть файл

@ -2,21 +2,21 @@
exports[`ConnectionSTringProperties matches snapshot 1`] = ` exports[`ConnectionSTringProperties matches snapshot 1`] = `
<Fragment> <Fragment>
<Component <MaskedCopyableTextField
allowMask={false} allowMask={false}
ariaLabel="connectionStrings.properties.hostName.ariaLabel" ariaLabel="connectionStrings.properties.hostName.ariaLabel"
label="connectionStrings.properties.hostName.label" label="connectionStrings.properties.hostName.label"
readOnly={true} readOnly={true}
value="hostName" value="hostName"
/> />
<Component <MaskedCopyableTextField
allowMask={false} allowMask={false}
ariaLabel="connectionStrings.properties.sharedAccessPolicyName.ariaLabel" ariaLabel="connectionStrings.properties.sharedAccessPolicyName.ariaLabel"
label="connectionStrings.properties.sharedAccessPolicyName.label" label="connectionStrings.properties.sharedAccessPolicyName.label"
readOnly={true} readOnly={true}
value="sharedAccessKeyName" value="sharedAccessKeyName"
/> />
<Component <MaskedCopyableTextField
allowMask={true} allowMask={true}
ariaLabel="connectionStrings.properties.sharedAccessPolicyKey.ariaLabel" ariaLabel="connectionStrings.properties.sharedAccessPolicyKey.ariaLabel"
label="connectionStrings.properties.sharedAccessPolicyKey.label" label="connectionStrings.properties.sharedAccessPolicyKey.label"

Просмотреть файл

@ -30,7 +30,7 @@ exports[`ConnectionStringsView matches snapshot when connection strings present
<div <div
className="connection-strings" className="connection-strings"
> >
<Component <ConnectionString
connectionStringWithExpiry={ connectionStringWithExpiry={
Object { Object {
"connectionString": "connectionString1", "connectionString": "connectionString1",
@ -77,7 +77,7 @@ exports[`ConnectionStringsView matches snapshot when no connection strings 1`] =
<div <div
className="connection-strings" className="connection-strings"
/> />
<Component /> <ConnectionStringsEmpty />
</div> </div>
</div> </div>
`; `;

Просмотреть файл

@ -3,6 +3,7 @@
* Licensed under the MIT License * Licensed under the MIT License
**********************************************************/ **********************************************************/
import { call, put } from 'redux-saga/effects'; import { call, put } from 'redux-saga/effects';
import { SagaIterator } from 'redux-saga';
import { NotificationType } from '../../api/models/notification'; import { NotificationType } from '../../api/models/notification';
import { raiseNotificationToast } from '../../notifications/components/notificationToast'; import { raiseNotificationToast } from '../../notifications/components/notificationToast';
import { CONNECTION_STRING_NAME_LIST } from '../../constants/browserStorage'; import { CONNECTION_STRING_NAME_LIST } from '../../constants/browserStorage';
@ -11,13 +12,13 @@ import { ResourceKeys } from '../../../localization/resourceKeys';
import { ConnectionStringWithExpiry } from '../state'; import { ConnectionStringWithExpiry } from '../state';
import { setConnectionStrings } from './setConnectionStringsSaga'; import { setConnectionStrings } from './setConnectionStringsSaga';
export function* getConnectionStringsSaga() { export function* getConnectionStringsSaga(): SagaIterator {
const connectionStrings = yield call(getConnectionStrings); const connectionStrings = yield call(getConnectionStrings);
yield put(getConnectionStringsAction.done({result: connectionStrings})); yield put(getConnectionStringsAction.done({result: connectionStrings}));
} }
// tslint:disable-next-line: cyclomatic-complexity // tslint:disable-next-line: cyclomatic-complexity
export function* getConnectionStrings() { export function* getConnectionStrings(): SagaIterator {
const connectionStrings = localStorage.getItem(CONNECTION_STRING_NAME_LIST); const connectionStrings = localStorage.getItem(CONNECTION_STRING_NAME_LIST);
if (connectionStrings) { if (connectionStrings) {
try { try {

Просмотреть файл

@ -3,6 +3,7 @@
* Licensed under the MIT License * Licensed under the MIT License
**********************************************************/ **********************************************************/
import { call, put } from 'redux-saga/effects'; import { call, put } from 'redux-saga/effects';
import { SagaIterator } from 'redux-saga';
import { Action } from 'typescript-fsa'; import { Action } from 'typescript-fsa';
import { CONNECTION_STRING_LIST_MAX_LENGTH } from '../../constants/browserStorage'; import { CONNECTION_STRING_LIST_MAX_LENGTH } from '../../constants/browserStorage';
import { upsertConnectionStringAction } from '../actions'; import { upsertConnectionStringAction } from '../actions';
@ -10,7 +11,7 @@ import { setConnectionStrings } from './setConnectionStringsSaga';
import { getConnectionStrings } from './getConnectionStringsSaga'; import { getConnectionStrings } from './getConnectionStringsSaga';
import { ConnectionStringWithExpiry } from '../state'; import { ConnectionStringWithExpiry } from '../state';
export function* upsertConnectionStringSaga(action: Action<ConnectionStringWithExpiry>) { export function* upsertConnectionStringSaga(action: Action<ConnectionStringWithExpiry>): SagaIterator {
const savedStrings: ConnectionStringWithExpiry[] = yield call(getConnectionStrings); const savedStrings: ConnectionStringWithExpiry[] = yield call(getConnectionStrings);
let updatedValues: ConnectionStringWithExpiry[]; let updatedValues: ConnectionStringWithExpiry[];

Просмотреть файл

@ -41,7 +41,7 @@ exports[`addDevice matches snapshot 1`] = `
<div <div
className="form" className="form"
> >
<Component <MaskedCopyableTextField
allowMask={false} allowMask={false}
ariaLabel="deviceIdentity.deviceID" ariaLabel="deviceIdentity.deviceID"
error="" error=""
@ -88,11 +88,11 @@ exports[`addDevice matches snapshot 1`] = `
<div <div
className="connectivity" className="connectivity"
> >
<Component <LabelWithTooltip
tooltipText="deviceIdentity.hubConnectivity.tooltip" tooltipText="deviceIdentity.hubConnectivity.tooltip"
> >
deviceIdentity.hubConnectivity.label deviceIdentity.hubConnectivity.label
</Component> </LabelWithTooltip>
<StyledToggleBase <StyledToggleBase
ariaLabel="deviceIdentity.hubConnectivity.label" ariaLabel="deviceIdentity.hubConnectivity.label"
checked={true} checked={true}

Просмотреть файл

@ -3,6 +3,7 @@
* Licensed under the MIT License * Licensed under the MIT License
**********************************************************/ **********************************************************/
import { call, put, takeEvery } from 'redux-saga/effects'; import { call, put, takeEvery } from 'redux-saga/effects';
import { SagaIterator } from 'redux-saga';
import { Action } from 'typescript-fsa'; import { Action } from 'typescript-fsa';
import { NotificationType } from '../../api/models/notification'; import { NotificationType } from '../../api/models/notification';
import { ResourceKeys } from '../../../localization/resourceKeys'; import { ResourceKeys } from '../../../localization/resourceKeys';
@ -11,7 +12,7 @@ import { addDevice } from '../../api/services/devicesService';
import { DeviceIdentity } from '../../api/models/deviceIdentity'; import { DeviceIdentity } from '../../api/models/deviceIdentity';
import { raiseNotificationToast } from '../../notifications/components/notificationToast'; import { raiseNotificationToast } from '../../notifications/components/notificationToast';
export function* addDeviceSagaWorker(action: Action<DeviceIdentity>) { export function* addDeviceSagaWorker(action: Action<DeviceIdentity>): SagaIterator {
try { try {
const parameters = { const parameters = {
deviceIdentity: action.payload deviceIdentity: action.payload

Просмотреть файл

@ -19,18 +19,18 @@ exports[`cloudToDeviceMessage matches snapshot 1`] = `
] ]
} }
/> />
<Component <HeaderView
headerText="cloudToDeviceMessage.headerText" headerText="cloudToDeviceMessage.headerText"
tooltip="cloudToDeviceMessage.tooltip" tooltip="cloudToDeviceMessage.tooltip"
/> />
<div <div
className="device-detail" className="device-detail"
> >
<Component <LabelWithTooltip
tooltipText="cloudToDeviceMessage.bodyTooltip" tooltipText="cloudToDeviceMessage.bodyTooltip"
> >
cloudToDeviceMessage.body cloudToDeviceMessage.body
</Component> </LabelWithTooltip>
<StyledTextFieldBase <StyledTextFieldBase
className="cloud-to-device-message-text-field" className="cloud-to-device-message-text-field"
multiline={true} multiline={true}
@ -49,7 +49,7 @@ exports[`cloudToDeviceMessage matches snapshot 1`] = `
} }
} }
/> />
<Component <CollapsibleSection
expanded={true} expanded={true}
label="cloudToDeviceMessage.properties.label" label="cloudToDeviceMessage.properties.label"
tooltipText="cloudToDeviceMessage.properties.tooltip" tooltipText="cloudToDeviceMessage.properties.tooltip"
@ -174,6 +174,7 @@ exports[`cloudToDeviceMessage matches snapshot 1`] = `
"_isModal": false, "_isModal": false,
"_items": Array [], "_items": Array [],
"_keyToIndexMap": Object {}, "_keyToIndexMap": Object {},
"_onItemsChanged": undefined,
"_onSelectionChanged": [Function], "_onSelectionChanged": [Function],
"_selectedItems": null, "_selectedItems": null,
"_unselectableCount": 0, "_unselectableCount": 0,
@ -226,6 +227,7 @@ exports[`cloudToDeviceMessage matches snapshot 1`] = `
"_isModal": false, "_isModal": false,
"_items": Array [], "_items": Array [],
"_keyToIndexMap": Object {}, "_keyToIndexMap": Object {},
"_onItemsChanged": undefined,
"_onSelectionChanged": [Function], "_onSelectionChanged": [Function],
"_selectedItems": null, "_selectedItems": null,
"_unselectableCount": 0, "_unselectableCount": 0,
@ -236,7 +238,7 @@ exports[`cloudToDeviceMessage matches snapshot 1`] = `
} }
/> />
</StyledMarqueeSelectionBase> </StyledMarqueeSelectionBase>
</Component> </CollapsibleSection>
</div> </div>
</Fragment> </Fragment>
`; `;

Просмотреть файл

@ -3,6 +3,7 @@
* Licensed under the MIT License * Licensed under the MIT License
**********************************************************/ **********************************************************/
import { call, put, takeEvery } from 'redux-saga/effects'; import { call, put, takeEvery } from 'redux-saga/effects';
import { SagaIterator } from 'redux-saga';
import { Action } from 'typescript-fsa'; import { Action } from 'typescript-fsa';
import { cloudToDeviceMessageAction, CloudToDeviceMessageActionParameters } from './actions'; import { cloudToDeviceMessageAction, CloudToDeviceMessageActionParameters } from './actions';
import { cloudToDeviceMessage } from '../../api/services/devicesService'; import { cloudToDeviceMessage } from '../../api/services/devicesService';
@ -11,7 +12,7 @@ import { NotificationType } from '../../api/models/notification';
import { ResourceKeys } from '../../../localization/resourceKeys'; import { ResourceKeys } from '../../../localization/resourceKeys';
import { CloudToDeviceMessageParameters } from '../../api/parameters/deviceParameters'; import { CloudToDeviceMessageParameters } from '../../api/parameters/deviceParameters';
export function* cloudToDeviceMessageSagaWorker(action: Action<CloudToDeviceMessageActionParameters>) { export function* cloudToDeviceMessageSagaWorker(action: Action<CloudToDeviceMessageActionParameters>): SagaIterator {
const toastId: number = Math.random(); const toastId: number = Math.random();
try { try {
@ -63,6 +64,6 @@ export function* cloudToDeviceMessageSagaWorker(action: Action<CloudToDeviceMess
} }
} }
export function* cloudToDeviceMessageSaga() { export function* cloudToDeviceMessageSaga(): SagaIterator {
yield takeEvery(cloudToDeviceMessageAction.started.type, cloudToDeviceMessageSagaWorker); yield takeEvery(cloudToDeviceMessageAction.started.type, cloudToDeviceMessageSagaWorker);
} }

Просмотреть файл

@ -5,7 +5,7 @@ exports[`deviceEvents deviceEvents in non-pnp context matches snapshot 1`] = `
className="device-events" className="device-events"
key="device-events" key="device-events"
> >
<Component <Commands
dispatch={[MockFunction]} dispatch={[MockFunction]}
fetchData={[Function]} fetchData={[Function]}
monitoringData={false} monitoringData={false}
@ -19,20 +19,20 @@ exports[`deviceEvents deviceEvents in non-pnp context matches snapshot 1`] = `
startDisabled={false} startDisabled={false}
synchronizationStatus={1} synchronizationStatus={1}
/> />
<Component <HeaderView
headerText="deviceEvents.headerText" headerText="deviceEvents.headerText"
tooltip="deviceEvents.tooltip" tooltip="deviceEvents.tooltip"
/> />
<div <div
className="horizontal-item" className="horizontal-item"
> >
<Component <ConsumerGroup
consumerGroup="$Default" consumerGroup="$Default"
monitoringData={false} monitoringData={false}
setConsumerGroup={[Function]} setConsumerGroup={[Function]}
/> />
</div> </div>
<Component <StartTime
monitoringData={false} monitoringData={false}
setHasError={[Function]} setHasError={[Function]}
setSpecifyStartTime={[Function]} setSpecifyStartTime={[Function]}
@ -42,7 +42,7 @@ exports[`deviceEvents deviceEvents in non-pnp context matches snapshot 1`] = `
<div <div
className="horizontal-item" className="horizontal-item"
> >
<Component <CustomEventHub
monitoringData={false} monitoringData={false}
setCustomEventHubConnectionString={[Function]} setCustomEventHubConnectionString={[Function]}
setHasError={[Function]} setHasError={[Function]}
@ -50,7 +50,7 @@ exports[`deviceEvents deviceEvents in non-pnp context matches snapshot 1`] = `
useBuiltInEventHub={false} useBuiltInEventHub={false}
/> />
</div> </div>
<Component <DeviceSimulationPanel
onToggleSimulationPanel={[Function]} onToggleSimulationPanel={[Function]}
showSimulationPanel={false} showSimulationPanel={false}
/> />
@ -90,7 +90,7 @@ exports[`deviceEvents deviceEvents in pnp context matches snapshot while interfa
className="device-events" className="device-events"
key="device-events" key="device-events"
> >
<Component <Commands
dispatch={[Function]} dispatch={[Function]}
fetchData={[Function]} fetchData={[Function]}
monitoringData={false} monitoringData={false}
@ -104,20 +104,20 @@ exports[`deviceEvents deviceEvents in pnp context matches snapshot while interfa
startDisabled={false} startDisabled={false}
synchronizationStatus={2} synchronizationStatus={2}
/> />
<Component <HeaderView
headerText="deviceEvents.headerText" headerText="deviceEvents.headerText"
tooltip="deviceEvents.tooltip" tooltip="deviceEvents.tooltip"
/> />
<div <div
className="horizontal-item" className="horizontal-item"
> >
<Component <ConsumerGroup
consumerGroup="$Default" consumerGroup="$Default"
monitoringData={false} monitoringData={false}
setConsumerGroup={[Function]} setConsumerGroup={[Function]}
/> />
</div> </div>
<Component <StartTime
monitoringData={false} monitoringData={false}
setHasError={[Function]} setHasError={[Function]}
setSpecifyStartTime={[Function]} setSpecifyStartTime={[Function]}
@ -127,7 +127,7 @@ exports[`deviceEvents deviceEvents in pnp context matches snapshot while interfa
<div <div
className="horizontal-item" className="horizontal-item"
> >
<Component <CustomEventHub
monitoringData={false} monitoringData={false}
setCustomEventHubConnectionString={[Function]} setCustomEventHubConnectionString={[Function]}
setHasError={[Function]} setHasError={[Function]}
@ -135,7 +135,7 @@ exports[`deviceEvents deviceEvents in pnp context matches snapshot while interfa
useBuiltInEventHub={false} useBuiltInEventHub={false}
/> />
</div> </div>
<Component <DeviceSimulationPanel
onToggleSimulationPanel={[Function]} onToggleSimulationPanel={[Function]}
showSimulationPanel={false} showSimulationPanel={false}
/> />
@ -154,7 +154,7 @@ exports[`deviceEvents deviceEvents in pnp context matches snapshot while interfa
className="device-events" className="device-events"
key="device-events" key="device-events"
> >
<Component <Commands
dispatch={[Function]} dispatch={[Function]}
fetchData={[Function]} fetchData={[Function]}
monitoringData={false} monitoringData={false}
@ -168,20 +168,20 @@ exports[`deviceEvents deviceEvents in pnp context matches snapshot while interfa
startDisabled={false} startDisabled={false}
synchronizationStatus={2} synchronizationStatus={2}
/> />
<Component <HeaderView
headerText="deviceEvents.headerText" headerText="deviceEvents.headerText"
tooltip="deviceEvents.tooltip" tooltip="deviceEvents.tooltip"
/> />
<div <div
className="horizontal-item" className="horizontal-item"
> >
<Component <ConsumerGroup
consumerGroup="$Default" consumerGroup="$Default"
monitoringData={false} monitoringData={false}
setConsumerGroup={[Function]} setConsumerGroup={[Function]}
/> />
</div> </div>
<Component <StartTime
monitoringData={false} monitoringData={false}
setHasError={[Function]} setHasError={[Function]}
setSpecifyStartTime={[Function]} setSpecifyStartTime={[Function]}
@ -191,7 +191,7 @@ exports[`deviceEvents deviceEvents in pnp context matches snapshot while interfa
<div <div
className="horizontal-item" className="horizontal-item"
> >
<Component <CustomEventHub
monitoringData={false} monitoringData={false}
setCustomEventHubConnectionString={[Function]} setCustomEventHubConnectionString={[Function]}
setHasError={[Function]} setHasError={[Function]}
@ -199,7 +199,7 @@ exports[`deviceEvents deviceEvents in pnp context matches snapshot while interfa
useBuiltInEventHub={false} useBuiltInEventHub={false}
/> />
</div> </div>
<Component <DeviceSimulationPanel
onToggleSimulationPanel={[Function]} onToggleSimulationPanel={[Function]}
showSimulationPanel={false} showSimulationPanel={false}
/> />

Просмотреть файл

@ -22,7 +22,7 @@ exports[`deviceSimulationPanel matches snapshot 1`] = `
<StyledLabelBase> <StyledLabelBase>
deviceEvents.simulation.cloudShell.textDescription deviceEvents.simulation.cloudShell.textDescription
</StyledLabelBase> </StyledLabelBase>
<Component <CollapsibleSection
expanded={true} expanded={true}
label="deviceEvents.simulation.prerequisite.label" label="deviceEvents.simulation.prerequisite.label"
tooltipText="deviceEvents.simulation.prerequisite.tooltiop" tooltipText="deviceEvents.simulation.prerequisite.tooltiop"
@ -30,8 +30,8 @@ exports[`deviceSimulationPanel matches snapshot 1`] = `
<span> <span>
deviceEvents.simulation.prerequisite.instruction deviceEvents.simulation.prerequisite.instruction
</span> </span>
</Component> </CollapsibleSection>
<Component <CollapsibleSection
expanded={true} expanded={true}
label="deviceEvents.simulation.basic.label" label="deviceEvents.simulation.basic.label"
tooltipText="deviceEvents.simulation.basic.tooltiop" tooltipText="deviceEvents.simulation.basic.tooltiop"
@ -39,15 +39,15 @@ exports[`deviceSimulationPanel matches snapshot 1`] = `
<span> <span>
deviceEvents.simulation.basic.instruction deviceEvents.simulation.basic.instruction
</span> </span>
<Component <MaskedCopyableTextField
allowMask={false} allowMask={false}
ariaLabel="deviceEvents.simulation.basic.copyLabel" ariaLabel="deviceEvents.simulation.basic.copyLabel"
label="deviceEvents.simulation.basic.copyLabel" label="deviceEvents.simulation.basic.copyLabel"
readOnly={true} readOnly={true}
value="az iot device simulate --device-id device1 --login \\"\\"" value="az iot device simulate --device-id device1 --login \\"\\""
/> />
</Component> </CollapsibleSection>
<Component <CollapsibleSection
expanded={false} expanded={false}
label="deviceEvents.simulation.advanced.label" label="deviceEvents.simulation.advanced.label"
tooltipText="deviceEvents.simulation.advanced.tooltiop" tooltipText="deviceEvents.simulation.advanced.tooltiop"
@ -55,11 +55,11 @@ exports[`deviceSimulationPanel matches snapshot 1`] = `
<span> <span>
deviceEvents.simulation.advanced.instruction deviceEvents.simulation.advanced.instruction
</span> </span>
<Component <LabelWithTooltip
tooltipText="deviceEvents.simulation.advanced.body.tooltip" tooltipText="deviceEvents.simulation.advanced.body.tooltip"
> >
deviceEvents.simulation.advanced.body.label deviceEvents.simulation.advanced.body.label
</Component> </LabelWithTooltip>
<StyledTextFieldBase <StyledTextFieldBase
multiline={true} multiline={true}
onChange={[Function]} onChange={[Function]}
@ -103,6 +103,7 @@ exports[`deviceSimulationPanel matches snapshot 1`] = `
"_isModal": false, "_isModal": false,
"_items": Array [], "_items": Array [],
"_keyToIndexMap": Object {}, "_keyToIndexMap": Object {},
"_onItemsChanged": undefined,
"_onSelectionChanged": [Function], "_onSelectionChanged": [Function],
"_selectedItems": null, "_selectedItems": null,
"_unselectableCount": 0, "_unselectableCount": 0,
@ -154,6 +155,7 @@ exports[`deviceSimulationPanel matches snapshot 1`] = `
"_isModal": false, "_isModal": false,
"_items": Array [], "_items": Array [],
"_keyToIndexMap": Object {}, "_keyToIndexMap": Object {},
"_onItemsChanged": undefined,
"_onSelectionChanged": [Function], "_onSelectionChanged": [Function],
"_selectedItems": null, "_selectedItems": null,
"_unselectableCount": 0, "_unselectableCount": 0,
@ -164,13 +166,13 @@ exports[`deviceSimulationPanel matches snapshot 1`] = `
} }
/> />
</StyledMarqueeSelectionBase> </StyledMarqueeSelectionBase>
<Component <MaskedCopyableTextField
allowMask={false} allowMask={false}
ariaLabel="deviceEvents.simulation.advanced.copyLabel" ariaLabel="deviceEvents.simulation.advanced.copyLabel"
label="deviceEvents.simulation.advanced.copyLabel" label="deviceEvents.simulation.advanced.copyLabel"
readOnly={true} readOnly={true}
value="az iot device simulate --device-id device1 --login \\"\\"" value="az iot device simulate --device-id device1 --login \\"\\""
/> />
</Component> </CollapsibleSection>
</StyledPanelBase> </StyledPanelBase>
`; `;

Просмотреть файл

@ -11,12 +11,12 @@ exports[`startTime matches snapshot 1`] = `
className="stack-first-column" className="stack-first-column"
disabled={true} disabled={true}
label={ label={
<Unknown <LabelWithTooltip
className="consumer-group-label" className="consumer-group-label"
tooltipText="deviceEvents.startTime.tooltip" tooltipText="deviceEvents.startTime.tooltip"
> >
deviceEvents.toggleSpecifyStartingTime.label deviceEvents.toggleSpecifyStartingTime.label
</Unknown> </LabelWithTooltip>
} }
offText="deviceEvents.toggleSpecifyStartingTime.off" offText="deviceEvents.toggleSpecifyStartingTime.off"
onChange={[Function]} onChange={[Function]}

Просмотреть файл

@ -2,7 +2,8 @@
* Copyright (c) Microsoft Corporation. All rights reserved. * Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License * Licensed under the MIT License
**********************************************************/ **********************************************************/
import { call, put, all, takeLatest, takeEvery } from 'redux-saga/effects'; import { call, put, all, takeEvery } from 'redux-saga/effects';
import { SagaIterator } from 'redux-saga';
import { Action } from 'typescript-fsa'; import { Action } from 'typescript-fsa';
import { monitorEvents } from '../../api/services/devicesService'; import { monitorEvents } from '../../api/services/devicesService';
import { NotificationType } from '../../api/models/notification'; import { NotificationType } from '../../api/models/notification';
@ -11,7 +12,7 @@ import { startEventsMonitoringAction } from './actions';
import { raiseNotificationToast } from '../../notifications/components/notificationToast'; import { raiseNotificationToast } from '../../notifications/components/notificationToast';
import { MonitorEventsParameters } from '../../api/parameters/deviceParameters'; import { MonitorEventsParameters } from '../../api/parameters/deviceParameters';
export function* startEventsMonitoringSagaWorker(action: Action<MonitorEventsParameters>) { export function* startEventsMonitoringSagaWorker(action: Action<MonitorEventsParameters>): SagaIterator {
try { try {
const messages = yield call(monitorEvents, action.payload); const messages = yield call(monitorEvents, action.payload);
yield put(startEventsMonitoringAction.done({params: action.payload, result: messages})); yield put(startEventsMonitoringAction.done({params: action.payload, result: messages}));

Просмотреть файл

@ -2,17 +2,17 @@
exports[`deviceIdentity snapshot matches snapshot 1`] = ` exports[`deviceIdentity snapshot matches snapshot 1`] = `
<Fragment> <Fragment>
<Component <DeviceIdentityCommandBar
disableSave={true} disableSave={true}
handleSave={[Function]} handleSave={[Function]}
/> />
<Component <HeaderView
headerText="deviceIdentity.headerText" headerText="deviceIdentity.headerText"
/> />
<div <div
className="device-detail" className="device-detail"
> >
<Component <MaskedCopyableTextField
allowMask={false} allowMask={false}
ariaLabel="deviceIdentity.deviceID" ariaLabel="deviceIdentity.deviceID"
label="deviceIdentity.deviceID" label="deviceIdentity.deviceID"
@ -35,17 +35,17 @@ exports[`deviceIdentity snapshot matches snapshot 1`] = `
exports[`deviceIdentity snapshot matches snapshot with CA auth type 1`] = ` exports[`deviceIdentity snapshot matches snapshot with CA auth type 1`] = `
<Fragment> <Fragment>
<Component <DeviceIdentityCommandBar
disableSave={true} disableSave={true}
handleSave={[Function]} handleSave={[Function]}
/> />
<Component <HeaderView
headerText="deviceIdentity.headerText" headerText="deviceIdentity.headerText"
/> />
<div <div
className="device-detail" className="device-detail"
> >
<Component <MaskedCopyableTextField
allowMask={false} allowMask={false}
ariaLabel="deviceIdentity.deviceID" ariaLabel="deviceIdentity.deviceID"
label="deviceIdentity.deviceID" label="deviceIdentity.deviceID"
@ -68,17 +68,17 @@ exports[`deviceIdentity snapshot matches snapshot with CA auth type 1`] = `
exports[`deviceIdentity snapshot matches snapshot with SelfSigned auth type 1`] = ` exports[`deviceIdentity snapshot matches snapshot with SelfSigned auth type 1`] = `
<Fragment> <Fragment>
<Component <DeviceIdentityCommandBar
disableSave={true} disableSave={true}
handleSave={[Function]} handleSave={[Function]}
/> />
<Component <HeaderView
headerText="deviceIdentity.headerText" headerText="deviceIdentity.headerText"
/> />
<div <div
className="device-detail" className="device-detail"
> >
<Component <MaskedCopyableTextField
allowMask={false} allowMask={false}
ariaLabel="deviceIdentity.deviceID" ariaLabel="deviceIdentity.deviceID"
label="deviceIdentity.deviceID" label="deviceIdentity.deviceID"
@ -101,17 +101,17 @@ exports[`deviceIdentity snapshot matches snapshot with SelfSigned auth type 1`]
exports[`deviceIdentity snapshot matches snapshot with SymmetricKey auth type 1`] = ` exports[`deviceIdentity snapshot matches snapshot with SymmetricKey auth type 1`] = `
<Fragment> <Fragment>
<Component <DeviceIdentityCommandBar
disableSave={true} disableSave={true}
handleSave={[Function]} handleSave={[Function]}
/> />
<Component <HeaderView
headerText="deviceIdentity.headerText" headerText="deviceIdentity.headerText"
/> />
<div <div
className="device-detail" className="device-detail"
> >
<Component <MaskedCopyableTextField
allowMask={false} allowMask={false}
ariaLabel="deviceIdentity.deviceID" ariaLabel="deviceIdentity.deviceID"
label="deviceIdentity.deviceID" label="deviceIdentity.deviceID"
@ -134,17 +134,17 @@ exports[`deviceIdentity snapshot matches snapshot with SymmetricKey auth type 1`
exports[`deviceIdentity snapshot matches snapshot with Synchronization Status of updating 1`] = ` exports[`deviceIdentity snapshot matches snapshot with Synchronization Status of updating 1`] = `
<Fragment> <Fragment>
<Component <DeviceIdentityCommandBar
disableSave={true} disableSave={true}
handleSave={[Function]} handleSave={[Function]}
/> />
<Component <HeaderView
headerText="deviceIdentity.headerText" headerText="deviceIdentity.headerText"
/> />
<div <div
className="device-detail" className="device-detail"
> >
<Component <MaskedCopyableTextField
allowMask={false} allowMask={false}
ariaLabel="deviceIdentity.deviceID" ariaLabel="deviceIdentity.deviceID"
label="deviceIdentity.deviceID" label="deviceIdentity.deviceID"
@ -167,17 +167,17 @@ exports[`deviceIdentity snapshot matches snapshot with Synchronization Status of
exports[`deviceIdentity snapshot matches snapshot with Synchronization Status of working 1`] = ` exports[`deviceIdentity snapshot matches snapshot with Synchronization Status of working 1`] = `
<Fragment> <Fragment>
<Component <DeviceIdentityCommandBar
disableSave={true} disableSave={true}
handleSave={[Function]} handleSave={[Function]}
/> />
<Component <HeaderView
headerText="deviceIdentity.headerText" headerText="deviceIdentity.headerText"
/> />
<div <div
className="device-detail" className="device-detail"
> >
<Component <MaskedCopyableTextField
allowMask={false} allowMask={false}
ariaLabel="deviceIdentity.deviceID" ariaLabel="deviceIdentity.deviceID"
label="deviceIdentity.deviceID" label="deviceIdentity.deviceID"
@ -200,17 +200,17 @@ exports[`deviceIdentity snapshot matches snapshot with Synchronization Status of
exports[`deviceIdentity snapshot matches snapshot with auth type of None 1`] = ` exports[`deviceIdentity snapshot matches snapshot with auth type of None 1`] = `
<Fragment> <Fragment>
<Component <DeviceIdentityCommandBar
disableSave={true} disableSave={true}
handleSave={[Function]} handleSave={[Function]}
/> />
<Component <HeaderView
headerText="deviceIdentity.headerText" headerText="deviceIdentity.headerText"
/> />
<div <div
className="device-detail" className="device-detail"
> >
<Component <MaskedCopyableTextField
allowMask={false} allowMask={false}
ariaLabel="deviceIdentity.deviceID" ariaLabel="deviceIdentity.deviceID"
label="deviceIdentity.deviceID" label="deviceIdentity.deviceID"
@ -233,17 +233,17 @@ exports[`deviceIdentity snapshot matches snapshot with auth type of None 1`] = `
exports[`deviceIdentity snapshot matches snapshot with identity wrapper 1`] = ` exports[`deviceIdentity snapshot matches snapshot with identity wrapper 1`] = `
<Fragment> <Fragment>
<Component <DeviceIdentityCommandBar
disableSave={true} disableSave={true}
handleSave={[Function]} handleSave={[Function]}
/> />
<Component <HeaderView
headerText="deviceIdentity.headerText" headerText="deviceIdentity.headerText"
/> />
<div <div
className="device-detail" className="device-detail"
> >
<Component <MaskedCopyableTextField
allowMask={false} allowMask={false}
ariaLabel="deviceIdentity.deviceID" ariaLabel="deviceIdentity.deviceID"
label="deviceIdentity.deviceID" label="deviceIdentity.deviceID"

Просмотреть файл

@ -7,7 +7,7 @@ exports[`DeviceModules matches snapshot 1`] = `
exact={true} exact={true}
path="" path=""
/> />
<Component <BreadcrumbRoute
breadcrumb={ breadcrumb={
Object { Object {
"name": "breadcrumb.addModuleIdentity", "name": "breadcrumb.addModuleIdentity",
@ -16,9 +16,9 @@ exports[`DeviceModules matches snapshot 1`] = `
exact={true} exact={true}
path="/add" path="/add"
> >
<Component /> <AddModuleIdentity />
</Component> </BreadcrumbRoute>
<Component <BreadcrumbRoute
breadcrumb={ breadcrumb={
Object { Object {
"name": "mod1", "name": "mod1",
@ -28,9 +28,9 @@ exports[`DeviceModules matches snapshot 1`] = `
exact={true} exact={true}
path="/moduleDetail" path="/moduleDetail"
> >
<Component /> <ModuleIdentityDetail />
</Component> </BreadcrumbRoute>
<Component <BreadcrumbRoute
breadcrumb={ breadcrumb={
Object { Object {
"name": "mod1", "name": "mod1",
@ -40,9 +40,9 @@ exports[`DeviceModules matches snapshot 1`] = `
exact={true} exact={true}
path="/moduleTwin" path="/moduleTwin"
> >
<Component /> <ModuleIdentityTwin />
</Component> </BreadcrumbRoute>
<Component <BreadcrumbRoute
breadcrumb={ breadcrumb={
Object { Object {
"name": "mod1", "name": "mod1",
@ -52,9 +52,9 @@ exports[`DeviceModules matches snapshot 1`] = `
exact={true} exact={true}
path="/moduleMethod" path="/moduleMethod"
> >
<Component /> <ModuleDirectMethod />
</Component> </BreadcrumbRoute>
<Component <BreadcrumbRoute
breadcrumb={ breadcrumb={
Object { Object {
"name": "mod1", "name": "mod1",
@ -63,9 +63,9 @@ exports[`DeviceModules matches snapshot 1`] = `
} }
path="/moduleEvents" path="/moduleEvents"
> >
<Component /> <DeviceEvents />
</Component> </BreadcrumbRoute>
<Component <BreadcrumbRoute
breadcrumb={ breadcrumb={
Object { Object {
"disableLink": true, "disableLink": true,
@ -75,7 +75,7 @@ exports[`DeviceModules matches snapshot 1`] = `
} }
path="/modulePnp" path="/modulePnp"
> >
<Component /> <Pnp />
</Component> </BreadcrumbRoute>
</Fragment> </Fragment>
`; `;

Просмотреть файл

@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`DeviceModules matches snapshot 1`] = ` exports[`DeviceModules matches snapshot 1`] = `
<Component <CollapsibleSection
expanded={false} expanded={false}
label="deviceIdentity.qrCode.label" label="deviceIdentity.qrCode.label"
tooltipText="deviceIdentity.qrCode.toolTip" tooltipText="deviceIdentity.qrCode.toolTip"
@ -46,5 +46,5 @@ exports[`DeviceModules matches snapshot 1`] = `
</div> </div>
</section> </section>
</div> </div>
</Component> </CollapsibleSection>
`; `;

Просмотреть файл

@ -3,6 +3,7 @@
* Licensed under the MIT License * Licensed under the MIT License
**********************************************************/ **********************************************************/
import { call, put, all, takeLatest, takeEvery } from 'redux-saga/effects'; import { call, put, all, takeLatest, takeEvery } from 'redux-saga/effects';
import { SagaIterator } from 'redux-saga';
import { Action } from 'typescript-fsa'; import { Action } from 'typescript-fsa';
import { fetchDevice, updateDevice } from '../../api/services/devicesService'; import { fetchDevice, updateDevice } from '../../api/services/devicesService';
import { NotificationType } from '../../api/models/notification'; import { NotificationType } from '../../api/models/notification';
@ -11,7 +12,7 @@ import { getDeviceIdentityAction, updateDeviceIdentityAction } from './actions';
import { DeviceIdentity } from '../../api/models/deviceIdentity'; import { DeviceIdentity } from '../../api/models/deviceIdentity';
import { raiseNotificationToast } from '../../notifications/components/notificationToast'; import { raiseNotificationToast } from '../../notifications/components/notificationToast';
export function* getDeviceIdentitySagaWorker(action: Action<string>) { export function* getDeviceIdentitySagaWorker(action: Action<string>): SagaIterator {
try { try {
const parameters = { const parameters = {
deviceId: action.payload, deviceId: action.payload,
@ -35,7 +36,7 @@ export function* getDeviceIdentitySagaWorker(action: Action<string>) {
} }
} }
export function* updateDeviceIdentitySagaWorker(action: Action<DeviceIdentity>) { export function* updateDeviceIdentitySagaWorker(action: Action<DeviceIdentity>): SagaIterator {
try { try {
const parameters = { const parameters = {
deviceIdentity: action.payload, deviceIdentity: action.payload,
@ -69,7 +70,7 @@ export function* updateDeviceIdentitySagaWorker(action: Action<DeviceIdentity>)
} }
} }
export function* DeviceIdentitySaga() { export function* DeviceIdentitySaga(): SagaIterator {
yield all([ yield all([
takeLatest(getDeviceIdentityAction.started.type, getDeviceIdentitySagaWorker), takeLatest(getDeviceIdentityAction.started.type, getDeviceIdentitySagaWorker),
takeEvery(updateDeviceIdentityAction.started.type, updateDeviceIdentitySagaWorker), takeEvery(updateDeviceIdentityAction.started.type, updateDeviceIdentitySagaWorker),

Просмотреть файл

@ -7,7 +7,7 @@ exports[`DeviceList matches snapshot 1`] = `
<div <div
className="view-command" className="view-command"
> >
<Component <DeviceListCommandBar
disableAdd={false} disableAdd={false}
disableDelete={true} disableDelete={true}
disableRefresh={false} disableRefresh={false}
@ -19,11 +19,11 @@ exports[`DeviceList matches snapshot 1`] = `
<div <div
className="view-content view-scroll-vertical" className="view-content view-scroll-vertical"
> >
<Component <DeviceListQuery
refresh={0} refresh={0}
setQueryAndExecute={[Function]} setQueryAndExecute={[Function]}
/> />
<Component <ListPaging
fetchPage={[Function]} fetchPage={[Function]}
/> />
<div <div
@ -41,6 +41,7 @@ exports[`DeviceList matches snapshot 1`] = `
"_isModal": false, "_isModal": false,
"_items": Array [], "_items": Array [],
"_keyToIndexMap": Object {}, "_keyToIndexMap": Object {},
"_onItemsChanged": undefined,
"_onSelectionChanged": [Function], "_onSelectionChanged": [Function],
"_selectedItems": null, "_selectedItems": null,
"_unselectableCount": 0, "_unselectableCount": 0,
@ -147,6 +148,7 @@ exports[`DeviceList matches snapshot 1`] = `
"_isModal": false, "_isModal": false,
"_items": Array [], "_items": Array [],
"_keyToIndexMap": Object {}, "_keyToIndexMap": Object {},
"_onItemsChanged": undefined,
"_onSelectionChanged": [Function], "_onSelectionChanged": [Function],
"_selectedItems": null, "_selectedItems": null,
"_unselectableCount": 0, "_unselectableCount": 0,

Просмотреть файл

@ -3,6 +3,7 @@
* Licensed under the MIT License * Licensed under the MIT License
**********************************************************/ **********************************************************/
import { call, put } from 'redux-saga/effects'; import { call, put } from 'redux-saga/effects';
import { SagaIterator } from 'redux-saga';
import { Action } from 'typescript-fsa'; import { Action } from 'typescript-fsa';
import { raiseNotificationToast } from '../../../notifications/components/notificationToast'; import { raiseNotificationToast } from '../../../notifications/components/notificationToast';
import { NotificationType } from '../../../api/models/notification'; import { NotificationType } from '../../../api/models/notification';
@ -10,7 +11,7 @@ import { ResourceKeys } from '../../../../localization/resourceKeys';
import { deleteDevicesAction } from '../actions'; import { deleteDevicesAction } from '../actions';
import { deleteDevices } from '../../../api/services/devicesService'; import { deleteDevices } from '../../../api/services/devicesService';
export function* deleteDevicesSaga(action: Action<string[]>) { export function* deleteDevicesSaga(action: Action<string[]>): SagaIterator {
try { try {
const parameters = { const parameters = {
deviceIds: action.payload, deviceIds: action.payload,

Просмотреть файл

@ -3,6 +3,7 @@
* Licensed under the MIT License * Licensed under the MIT License
**********************************************************/ **********************************************************/
import { Action } from 'typescript-fsa'; import { Action } from 'typescript-fsa';
import { SagaIterator } from 'redux-saga';
import { call, put } from 'redux-saga/effects'; import { call, put } from 'redux-saga/effects';
import { raiseNotificationToast } from '../../../notifications/components/notificationToast'; import { raiseNotificationToast } from '../../../notifications/components/notificationToast';
import { NotificationType } from '../../../api/models/notification'; import { NotificationType } from '../../../api/models/notification';
@ -14,7 +15,7 @@ import { ERROR_TYPES } from './../../../constants/apiConstants';
import { appConfig } from '../../../../appConfig/appConfig'; import { appConfig } from '../../../../appConfig/appConfig';
import { CUSTOM_CONTROLLER_PORT } from './../../../constants/browserStorage'; import { CUSTOM_CONTROLLER_PORT } from './../../../constants/browserStorage';
export function* listDevicesSaga(action: Action<DeviceQuery>) { export function* listDevicesSaga(action: Action<DeviceQuery>): SagaIterator {
try { try {
const parameters = { const parameters = {
query: action.payload query: action.payload

Просмотреть файл

@ -28,14 +28,14 @@ exports[`devices/components/deviceTwin snapshot matches snapshot 1`] = `
] ]
} }
/> />
<Component <HeaderView
headerText="deviceTwin.headerText" headerText="deviceTwin.headerText"
tooltip="deviceTwin.tooltip" tooltip="deviceTwin.tooltip"
/> />
<article <article
className="device-twin device-detail" className="device-twin device-detail"
> >
<Component <JSONEditor
className="json-editor" className="json-editor"
content="{ content="{
\\"deviceEtag\\": \\"\\", \\"deviceEtag\\": \\"\\",

Просмотреть файл

@ -3,6 +3,7 @@
* Licensed under the MIT License * Licensed under the MIT License
**********************************************************/ **********************************************************/
import { call, put } from 'redux-saga/effects'; import { call, put } from 'redux-saga/effects';
import { SagaIterator } from 'redux-saga';
import { Action } from 'typescript-fsa'; import { Action } from 'typescript-fsa';
import { fetchDeviceTwin } from '../../../api/services/devicesService'; import { fetchDeviceTwin } from '../../../api/services/devicesService';
import { NotificationType } from '../../../api/models/notification'; import { NotificationType } from '../../../api/models/notification';
@ -10,7 +11,7 @@ import { ResourceKeys } from '../../../../localization/resourceKeys';
import { getDeviceTwinAction } from '../actions'; import { getDeviceTwinAction } from '../actions';
import { raiseNotificationToast } from '../../../notifications/components/notificationToast'; import { raiseNotificationToast } from '../../../notifications/components/notificationToast';
export function* getDeviceTwinSaga(action: Action<string>) { export function* getDeviceTwinSaga(action: Action<string>): SagaIterator {
try { try {
const parameters = { const parameters = {
deviceId: action.payload, deviceId: action.payload,

Просмотреть файл

@ -3,6 +3,7 @@
* Licensed under the MIT License * Licensed under the MIT License
**********************************************************/ **********************************************************/
import { call, put } from 'redux-saga/effects'; import { call, put } from 'redux-saga/effects';
import { SagaIterator } from 'redux-saga';
import { Action } from 'typescript-fsa'; import { Action } from 'typescript-fsa';
import { updateDeviceTwin } from '../../../api/services/devicesService'; import { updateDeviceTwin } from '../../../api/services/devicesService';
import { NotificationType } from '../../../api/models/notification'; import { NotificationType } from '../../../api/models/notification';
@ -11,7 +12,7 @@ import { updateDeviceTwinAction } from '../actions';
import { raiseNotificationToast } from '../../../notifications/components/notificationToast'; import { raiseNotificationToast } from '../../../notifications/components/notificationToast';
import { Twin } from '../../../api/models/device'; import { Twin } from '../../../api/models/device';
export function* updateDeviceTwinSaga(action: Action<Twin>) { export function* updateDeviceTwinSaga(action: Action<Twin>): SagaIterator {
try { try {
const twin = yield call(updateDeviceTwin, action.payload); const twin = yield call(updateDeviceTwin, action.payload);

Просмотреть файл

@ -19,11 +19,11 @@ exports[`directMethod matches snapshot 1`] = `
] ]
} }
/> />
<Component <HeaderView
headerText="directMethod.headerText" headerText="directMethod.headerText"
tooltip="directMethod.tooltip" tooltip="directMethod.tooltip"
/> />
<Component <DirectMethodForm
connectionTimeOut={10} connectionTimeOut={10}
methodName="" methodName=""
responseTimeOut={10} responseTimeOut={10}

Просмотреть файл

@ -3,6 +3,7 @@
* Licensed under the MIT License * Licensed under the MIT License
**********************************************************/ **********************************************************/
import { call, put, takeEvery } from 'redux-saga/effects'; import { call, put, takeEvery } from 'redux-saga/effects';
import { SagaIterator } from 'redux-saga';
import { Action } from 'typescript-fsa'; import { Action } from 'typescript-fsa';
import { invokeDirectMethodAction, InvokeMethodActionParameters } from './actions'; import { invokeDirectMethodAction, InvokeMethodActionParameters } from './actions';
import { invokeDirectMethod } from '../../api/services/devicesService'; import { invokeDirectMethod } from '../../api/services/devicesService';
@ -11,7 +12,7 @@ import { NotificationType } from '../../api/models/notification';
import { ResourceKeys } from '../../../localization/resourceKeys'; import { ResourceKeys } from '../../../localization/resourceKeys';
import { InvokeMethodParameters } from '../../api/parameters/deviceParameters'; import { InvokeMethodParameters } from '../../api/parameters/deviceParameters';
export function* invokeDirectMethodSagaWorker(action: Action<InvokeMethodActionParameters>) { export function* invokeDirectMethodSagaWorker(action: Action<InvokeMethodActionParameters>): SagaIterator {
const toastId: number = Math.random(); const toastId: number = Math.random();
try { try {

Просмотреть файл

@ -28,13 +28,13 @@ exports[`devices/components/addModuleIdentity snapshot matches snapshot while lo
] ]
} }
/> />
<Component <HeaderView
headerText="moduleIdentity.headerText" headerText="moduleIdentity.headerText"
/> />
<div <div
className="device-detail" className="device-detail"
> >
<Component <MaskedCopyableTextField
allowMask={false} allowMask={false}
ariaLabel="moduleIdentity.moduleId" ariaLabel="moduleIdentity.moduleId"
error="" error=""

Просмотреть файл

@ -3,6 +3,7 @@
* Licensed under the MIT License * Licensed under the MIT License
**********************************************************/ **********************************************************/
import { call, put, takeEvery } from 'redux-saga/effects'; import { call, put, takeEvery } from 'redux-saga/effects';
import { SagaIterator } from 'redux-saga';
import { Action } from 'typescript-fsa'; import { Action } from 'typescript-fsa';
import { addModuleIdentity } from '../../../api/services/moduleService'; import { addModuleIdentity } from '../../../api/services/moduleService';
import { raiseNotificationToast } from '../../../notifications/components/notificationToast'; import { raiseNotificationToast } from '../../../notifications/components/notificationToast';
@ -11,7 +12,7 @@ import { ResourceKeys } from '../../../../localization/resourceKeys';
import { addModuleIdentityAction } from './actions'; import { addModuleIdentityAction } from './actions';
import { ModuleIdentity } from './../../../api/models/moduleIdentity'; import { ModuleIdentity } from './../../../api/models/moduleIdentity';
export function* addModuleIdentitySagaWorker(action: Action<ModuleIdentity>) { export function* addModuleIdentitySagaWorker(action: Action<ModuleIdentity>): SagaIterator {
try { try {
const parameters = { const parameters = {
moduleIdentity: action.payload, moduleIdentity: action.payload,

Просмотреть файл

@ -19,7 +19,7 @@ exports[`moduleDirectMethod matches snapshot 1`] = `
] ]
} }
/> />
<Component <DirectMethodForm
connectionTimeOut={10} connectionTimeOut={10}
methodName="" methodName=""
responseTimeOut={10} responseTimeOut={10}

Просмотреть файл

@ -3,6 +3,7 @@
* Licensed under the MIT License * Licensed under the MIT License
**********************************************************/ **********************************************************/
import { call, put, takeEvery } from 'redux-saga/effects'; import { call, put, takeEvery } from 'redux-saga/effects';
import { SagaIterator } from 'redux-saga';
import { Action } from 'typescript-fsa'; import { Action } from 'typescript-fsa';
import { invokeModuleDirectMethodAction, InvokeModuleMethodActionParameters } from './actions'; import { invokeModuleDirectMethodAction, InvokeModuleMethodActionParameters } from './actions';
import { invokeModuleDirectMethod } from '../../../api/services/moduleService'; import { invokeModuleDirectMethod } from '../../../api/services/moduleService';
@ -11,7 +12,7 @@ import { NotificationType } from '../../../api/models/notification';
import { ResourceKeys } from '../../../../localization/resourceKeys'; import { ResourceKeys } from '../../../../localization/resourceKeys';
import { InvokeModuleMethodParameters } from '../../../api/parameters/moduleParameters'; import { InvokeModuleMethodParameters } from '../../../api/parameters/moduleParameters';
export function* invokeModuleDirectMethodSagaWorker(action: Action<InvokeModuleMethodActionParameters>) { export function* invokeModuleDirectMethodSagaWorker(action: Action<InvokeModuleMethodActionParameters>): SagaIterator {
const toastId: number = Math.random(); const toastId: number = Math.random();
try { try {

Просмотреть файл

@ -28,7 +28,7 @@ exports[`ModuleIdentityList snapshot matches snapshot when fetch failed 1`] = `
] ]
} }
/> />
<Component <HeaderView
headerText="moduleIdentity.headerText" headerText="moduleIdentity.headerText"
link="moduleIdentity.link" link="moduleIdentity.link"
tooltip="moduleIdentity.tooltip" tooltip="moduleIdentity.tooltip"
@ -128,7 +128,7 @@ exports[`ModuleIdentityList snapshot matches snapshot while loading 1`] = `
] ]
} }
/> />
<Component <HeaderView
headerText="moduleIdentity.headerText" headerText="moduleIdentity.headerText"
link="moduleIdentity.link" link="moduleIdentity.link"
tooltip="moduleIdentity.tooltip" tooltip="moduleIdentity.tooltip"
@ -195,7 +195,7 @@ exports[`ModuleIdentityList snapshot matches snapshot while loading 1`] = `
selectionMode={0} selectionMode={0}
/> />
</div> </div>
<Component /> <MultiLineShimmer />
</div> </div>
</Fragment> </Fragment>
`; `;
@ -228,7 +228,7 @@ exports[`ModuleIdentityList snapshot matches snapshot with moduleIdentityList 1`
] ]
} }
/> />
<Component <HeaderView
headerText="moduleIdentity.headerText" headerText="moduleIdentity.headerText"
link="moduleIdentity.link" link="moduleIdentity.link"
tooltip="moduleIdentity.tooltip" tooltip="moduleIdentity.tooltip"
@ -303,7 +303,7 @@ exports[`ModuleIdentityList snapshot matches snapshot with moduleIdentityList 1`
selectionMode={0} selectionMode={0}
/> />
</div> </div>
<Component /> <MultiLineShimmer />
</div> </div>
</Fragment> </Fragment>
`; `;

Просмотреть файл

@ -3,6 +3,7 @@
* Licensed under the MIT License * Licensed under the MIT License
**********************************************************/ **********************************************************/
import { call, put, takeLatest } from 'redux-saga/effects'; import { call, put, takeLatest } from 'redux-saga/effects';
import { SagaIterator } from 'redux-saga';
import { Action } from 'typescript-fsa'; import { Action } from 'typescript-fsa';
import { fetchModuleIdentities } from '../../../api/services/moduleService'; import { fetchModuleIdentities } from '../../../api/services/moduleService';
import { raiseNotificationToast } from '../../../notifications/components/notificationToast'; import { raiseNotificationToast } from '../../../notifications/components/notificationToast';
@ -10,7 +11,7 @@ import { NotificationType } from '../../../api/models/notification';
import { ResourceKeys } from '../../../../localization/resourceKeys'; import { ResourceKeys } from '../../../../localization/resourceKeys';
import { getModuleIdentitiesAction } from './actions'; import { getModuleIdentitiesAction } from './actions';
export function* getModuleIdentitiesSagaWorker(action: Action<string>) { export function* getModuleIdentitiesSagaWorker(action: Action<string>): SagaIterator {
try { try {
const parameters = { const parameters = {
deviceId: action.payload deviceId: action.payload

Просмотреть файл

@ -32,7 +32,7 @@ exports[`moduleIdentityTwin snapshot matches snapshot after module twin is fetch
<div <div
className="module-identity-detail" className="module-identity-detail"
> >
<Component <JSONEditor
className="json-editor" className="json-editor"
content="{ content="{
\\"authenticationType\\": \\"sas\\", \\"authenticationType\\": \\"sas\\",
@ -90,7 +90,7 @@ exports[`moduleIdentityTwin snapshot matches snapshot while loading 1`] = `
<div <div
className="module-identity-detail" className="module-identity-detail"
> >
<Component /> <MultiLineShimmer />
</div> </div>
</Fragment> </Fragment>
`; `;

Просмотреть файл

@ -3,6 +3,7 @@
* Licensed under the MIT License * Licensed under the MIT License
**********************************************************/ **********************************************************/
import { call, put } from 'redux-saga/effects'; import { call, put } from 'redux-saga/effects';
import { SagaIterator } from 'redux-saga';
import { Action } from 'typescript-fsa'; import { Action } from 'typescript-fsa';
import { fetchModuleIdentityTwin } from '../../../../api/services/moduleService'; import { fetchModuleIdentityTwin } from '../../../../api/services/moduleService';
import { raiseNotificationToast } from '../../../../notifications/components/notificationToast'; import { raiseNotificationToast } from '../../../../notifications/components/notificationToast';
@ -10,7 +11,7 @@ import { NotificationType } from '../../../../api/models/notification';
import { ResourceKeys } from '../../../../../localization/resourceKeys'; import { ResourceKeys } from '../../../../../localization/resourceKeys';
import { GetModuleIdentityTwinActionParameters, getModuleIdentityTwinAction } from '../actions'; import { GetModuleIdentityTwinActionParameters, getModuleIdentityTwinAction } from '../actions';
export function* getModuleIdentityTwinSaga(action: Action<GetModuleIdentityTwinActionParameters>) { export function* getModuleIdentityTwinSaga(action: Action<GetModuleIdentityTwinActionParameters>): SagaIterator {
try { try {
const parameters = { const parameters = {
deviceId: action.payload.deviceId, deviceId: action.payload.deviceId,

Просмотреть файл

@ -3,6 +3,7 @@
* Licensed under the MIT License * Licensed under the MIT License
**********************************************************/ **********************************************************/
import { call, put } from 'redux-saga/effects'; import { call, put } from 'redux-saga/effects';
import { SagaIterator } from 'redux-saga';
import { Action } from 'typescript-fsa'; import { Action } from 'typescript-fsa';
import { updateModuleIdentityTwin } from '../../../../api/services/moduleService'; import { updateModuleIdentityTwin } from '../../../../api/services/moduleService';
import { raiseNotificationToast } from '../../../../notifications/components/notificationToast'; import { raiseNotificationToast } from '../../../../notifications/components/notificationToast';
@ -11,7 +12,7 @@ import { ResourceKeys } from '../../../../../localization/resourceKeys';
import { updateModuleIdentityTwinAction } from '../actions'; import { updateModuleIdentityTwinAction } from '../actions';
import { ModuleTwin } from '../../../../api/models/moduleTwin'; import { ModuleTwin } from '../../../../api/models/moduleTwin';
export function* updateModuleIdentityTwinSaga(action: Action<ModuleTwin>) { export function* updateModuleIdentityTwinSaga(action: Action<ModuleTwin>): SagaIterator {
try { try {
const moduleIdentityTwin = yield call(updateModuleIdentityTwin, action.payload); const moduleIdentityTwin = yield call(updateModuleIdentityTwin, action.payload);

Просмотреть файл

@ -32,7 +32,7 @@ exports[`ModuleIdentityDetail snapshot matches snapshot after certificateAuthori
<div <div
className="module-identity-detail" className="module-identity-detail"
> >
<Component <MaskedCopyableTextField
allowMask={false} allowMask={false}
ariaLabel="moduleIdentity.moduleId" ariaLabel="moduleIdentity.moduleId"
label="moduleIdentity.moduleId" label="moduleIdentity.moduleId"
@ -79,7 +79,7 @@ exports[`ModuleIdentityDetail snapshot matches snapshot after module identity is
<div <div
className="module-identity-detail" className="module-identity-detail"
> >
<Component <MaskedCopyableTextField
allowMask={false} allowMask={false}
ariaLabel="moduleIdentity.moduleId" ariaLabel="moduleIdentity.moduleId"
label="moduleIdentity.moduleId" label="moduleIdentity.moduleId"
@ -123,7 +123,7 @@ exports[`ModuleIdentityDetail snapshot matches snapshot after sas module identit
<div <div
className="module-identity-detail" className="module-identity-detail"
> >
<Component <MaskedCopyableTextField
allowMask={false} allowMask={false}
ariaLabel="moduleIdentity.moduleId" ariaLabel="moduleIdentity.moduleId"
label="moduleIdentity.moduleId" label="moduleIdentity.moduleId"
@ -131,7 +131,7 @@ exports[`ModuleIdentityDetail snapshot matches snapshot after sas module identit
readOnly={true} readOnly={true}
value="moduleId" value="moduleId"
/> />
<Component <MaskedCopyableTextField
allowMask={true} allowMask={true}
ariaLabel="moduleIdentity.authenticationType.symmetricKey.primaryKey" ariaLabel="moduleIdentity.authenticationType.symmetricKey.primaryKey"
label="moduleIdentity.authenticationType.symmetricKey.primaryKey" label="moduleIdentity.authenticationType.symmetricKey.primaryKey"
@ -139,7 +139,7 @@ exports[`ModuleIdentityDetail snapshot matches snapshot after sas module identit
readOnly={true} readOnly={true}
value="key1" value="key1"
/> />
<Component <MaskedCopyableTextField
allowMask={true} allowMask={true}
ariaLabel="moduleIdentity.authenticationType.symmetricKey.secondaryKey" ariaLabel="moduleIdentity.authenticationType.symmetricKey.secondaryKey"
label="moduleIdentity.authenticationType.symmetricKey.secondaryKey" label="moduleIdentity.authenticationType.symmetricKey.secondaryKey"
@ -147,21 +147,21 @@ exports[`ModuleIdentityDetail snapshot matches snapshot after sas module identit
readOnly={true} readOnly={true}
value="key2" value="key2"
/> />
<Component <MaskedCopyableTextField
allowMask={true} allowMask={true}
ariaLabel="moduleIdentity.authenticationType.symmetricKey.primaryConnectionString" ariaLabel="moduleIdentity.authenticationType.symmetricKey.primaryConnectionString"
label="moduleIdentity.authenticationType.symmetricKey.primaryConnectionString" label="moduleIdentity.authenticationType.symmetricKey.primaryConnectionString"
readOnly={true} readOnly={true}
value="HostName=hostName;DeviceId=newdevice;ModuleId=moduleId;SharedAccessKey=key1" value="HostName=hostName;DeviceId=newdevice;ModuleId=moduleId;SharedAccessKey=key1"
/> />
<Component <MaskedCopyableTextField
allowMask={true} allowMask={true}
ariaLabel="moduleIdentity.authenticationType.symmetricKey.secondaryConnectionString" ariaLabel="moduleIdentity.authenticationType.symmetricKey.secondaryConnectionString"
label="moduleIdentity.authenticationType.symmetricKey.secondaryConnectionString" label="moduleIdentity.authenticationType.symmetricKey.secondaryConnectionString"
readOnly={true} readOnly={true}
value="HostName=hostName;DeviceId=newdevice;ModuleId=moduleId;SharedAccessKey=key2" value="HostName=hostName;DeviceId=newdevice;ModuleId=moduleId;SharedAccessKey=key2"
/> />
<Component <SasTokenGenerationView
activeAzureResourceHostName="hostName" activeAzureResourceHostName="hostName"
moduleIdentity={ moduleIdentity={
Object { Object {
@ -214,7 +214,7 @@ exports[`ModuleIdentityDetail snapshot matches snapshot after self signed module
<div <div
className="module-identity-detail" className="module-identity-detail"
> >
<Component <MaskedCopyableTextField
allowMask={false} allowMask={false}
ariaLabel="moduleIdentity.moduleId" ariaLabel="moduleIdentity.moduleId"
label="moduleIdentity.moduleId" label="moduleIdentity.moduleId"
@ -225,7 +225,7 @@ exports[`ModuleIdentityDetail snapshot matches snapshot after self signed module
<StyledLabelBase> <StyledLabelBase>
moduleIdentity.authenticationType.selfSigned.text moduleIdentity.authenticationType.selfSigned.text
</StyledLabelBase> </StyledLabelBase>
<Component <MaskedCopyableTextField
allowMask={true} allowMask={true}
ariaLabel="moduleIdentity.authenticationType.selfSigned.primaryThumbprint" ariaLabel="moduleIdentity.authenticationType.selfSigned.primaryThumbprint"
label="moduleIdentity.authenticationType.selfSigned.primaryThumbprint" label="moduleIdentity.authenticationType.selfSigned.primaryThumbprint"
@ -233,7 +233,7 @@ exports[`ModuleIdentityDetail snapshot matches snapshot after self signed module
readOnly={true} readOnly={true}
value="thumbprint1" value="thumbprint1"
/> />
<Component <MaskedCopyableTextField
allowMask={true} allowMask={true}
ariaLabel="moduleIdentity.authenticationType.selfSigned.secondaryThumbprint" ariaLabel="moduleIdentity.authenticationType.selfSigned.secondaryThumbprint"
label="moduleIdentity.authenticationType.selfSigned.secondaryThumbprint" label="moduleIdentity.authenticationType.selfSigned.secondaryThumbprint"
@ -277,7 +277,7 @@ exports[`ModuleIdentityDetail snapshot matches snapshot showing delete confirmat
<div <div
className="module-identity-detail" className="module-identity-detail"
> >
<Component <MaskedCopyableTextField
allowMask={false} allowMask={false}
ariaLabel="moduleIdentity.moduleId" ariaLabel="moduleIdentity.moduleId"
label="moduleIdentity.moduleId" label="moduleIdentity.moduleId"
@ -354,7 +354,7 @@ exports[`ModuleIdentityDetail snapshot matches snapshot while loading 1`] = `
<div <div
className="module-identity-detail" className="module-identity-detail"
> >
<Component <MaskedCopyableTextField
allowMask={false} allowMask={false}
ariaLabel="moduleIdentity.moduleId" ariaLabel="moduleIdentity.moduleId"
label="moduleIdentity.moduleId" label="moduleIdentity.moduleId"
@ -362,7 +362,7 @@ exports[`ModuleIdentityDetail snapshot matches snapshot while loading 1`] = `
readOnly={true} readOnly={true}
value="moduleId" value="moduleId"
/> />
<Component /> <MultiLineShimmer />
</div> </div>
</Fragment> </Fragment>
`; `;

Просмотреть файл

@ -3,6 +3,7 @@
* Licensed under the MIT License * Licensed under the MIT License
**********************************************************/ **********************************************************/
import { call, put } from 'redux-saga/effects'; import { call, put } from 'redux-saga/effects';
import { SagaIterator } from 'redux-saga';
import { Action } from 'typescript-fsa'; import { Action } from 'typescript-fsa';
import { fetchModuleIdentity } from '../../../../api/services/moduleService'; import { fetchModuleIdentity } from '../../../../api/services/moduleService';
import { raiseNotificationToast } from '../../../../notifications/components/notificationToast'; import { raiseNotificationToast } from '../../../../notifications/components/notificationToast';
@ -10,7 +11,7 @@ import { NotificationType } from '../../../../api/models/notification';
import { ResourceKeys } from '../../../../../localization/resourceKeys'; import { ResourceKeys } from '../../../../../localization/resourceKeys';
import { GetModuleIdentityActionParameters, getModuleIdentityAction } from '../actions'; import { GetModuleIdentityActionParameters, getModuleIdentityAction } from '../actions';
export function* getModuleIdentitySaga(action: Action<GetModuleIdentityActionParameters>) { export function* getModuleIdentitySaga(action: Action<GetModuleIdentityActionParameters>): SagaIterator {
try { try {
const parameters = { const parameters = {
deviceId: action.payload.deviceId, deviceId: action.payload.deviceId,

Просмотреть файл

@ -12,35 +12,35 @@ exports[`DigitalTwinDetail matches snapshot 1`] = `
itemKey="interfaces" itemKey="interfaces"
key="interfaces" key="interfaces"
> >
<Component /> <DeviceInterfaces />
</PivotItem> </PivotItem>
<PivotItem <PivotItem
headerText="breadcrumb.properties" headerText="breadcrumb.properties"
itemKey="properties" itemKey="properties"
key="properties" key="properties"
> >
<Component /> <DeviceProperties />
</PivotItem> </PivotItem>
<PivotItem <PivotItem
headerText="breadcrumb.settings" headerText="breadcrumb.settings"
itemKey="settings" itemKey="settings"
key="settings" key="settings"
> >
<Component /> <DeviceSettings />
</PivotItem> </PivotItem>
<PivotItem <PivotItem
headerText="breadcrumb.commands" headerText="breadcrumb.commands"
itemKey="commands" itemKey="commands"
key="commands" key="commands"
> >
<Component /> <DeviceCommands />
</PivotItem> </PivotItem>
<PivotItem <PivotItem
headerText="breadcrumb.events" headerText="breadcrumb.events"
itemKey="events" itemKey="events"
key="events" key="events"
> >
<Component /> <DeviceEvents />
</PivotItem> </PivotItem>
</StyledPivot> </StyledPivot>
`; `;

Просмотреть файл

@ -19,7 +19,7 @@ exports[`DigitalTwinInterfacesList matches snapshot when empty model id is retri
] ]
} }
/> />
<Component <HeaderView
headerText="digitalTwin.headerText" headerText="digitalTwin.headerText"
link="settings.questions.questions.documentation.link" link="settings.questions.questions.documentation.link"
tooltip="settings.questions.questions.documentation.text" tooltip="settings.questions.questions.documentation.text"

Просмотреть файл

@ -24,7 +24,7 @@ exports[`pnp matches snapshot 1`] = `
exact={true} exact={true}
path="/#/devices/deviceDetail/ioTPlugAndPlay/?id=device1&componentName=foo&interfaceId=urn:iotInterfaces:com:interface1;1" path="/#/devices/deviceDetail/ioTPlugAndPlay/?id=device1&componentName=foo&interfaceId=urn:iotInterfaces:com:interface1;1"
/> />
<Component <BreadcrumbRoute
breadcrumb={ breadcrumb={
Object { Object {
"name": "foo", "name": "foo",
@ -32,7 +32,7 @@ exports[`pnp matches snapshot 1`] = `
} }
path="/#/devices/deviceDetail/ioTPlugAndPlay/?id=device1&componentName=foo&interfaceId=urn:iotInterfaces:com:interface1;1/ioTPlugAndPlayDetail" path="/#/devices/deviceDetail/ioTPlugAndPlay/?id=device1&componentName=foo&interfaceId=urn:iotInterfaces:com:interface1;1/ioTPlugAndPlayDetail"
> >
<Component /> <DigitalTwinDetail />
</Component> </BreadcrumbRoute>
</ContextProvider> </ContextProvider>
`; `;

Просмотреть файл

@ -70,7 +70,7 @@ exports[`components/devices/deviceCommands matches snapshot with a commandSchema
] ]
} }
/> />
<Component <DeviceCommandsPerInterface
commandSchemas={ commandSchemas={
Array [ Array [
Object { Object {

Просмотреть файл

@ -46,7 +46,7 @@ exports[`components/devices/deviceCommandsPerInterface matches snapshot 1`] = `
className="list-content" className="list-content"
role="list" role="list"
> >
<Component <DeviceCommandsPerInterfacePerCommand
collapsed={false} collapsed={false}
commandModelDefinition={ commandModelDefinition={
Object { Object {

Просмотреть файл

@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`deviceInterfaces shows Shimmer when status is working 1`] = `<Component />`; exports[`deviceInterfaces shows Shimmer when status is working 1`] = `<MultiLineShimmer />`;
exports[`deviceInterfaces shows interface information when status is fetched 1`] = ` exports[`deviceInterfaces shows interface information when status is fetched 1`] = `
<Fragment> <Fragment>
@ -39,31 +39,31 @@ exports[`deviceInterfaces shows interface information when status is fetched 1`]
<section <section
className="pnp-interface-info scrollable-lg" className="pnp-interface-info scrollable-lg"
> >
<Component <ModelDefinitionSourceView
source="PUBLIC" source="PUBLIC"
/> />
<Component <MaskedCopyableTextField
allowMask={false} allowMask={false}
ariaLabel="deviceInterfaces.columns.id" ariaLabel="deviceInterfaces.columns.id"
label="deviceInterfaces.columns.id" label="deviceInterfaces.columns.id"
readOnly={true} readOnly={true}
value={null} value={null}
/> />
<Component <MaskedCopyableTextField
allowMask={false} allowMask={false}
ariaLabel="deviceInterfaces.columns.displayName" ariaLabel="deviceInterfaces.columns.displayName"
label="deviceInterfaces.columns.displayName" label="deviceInterfaces.columns.displayName"
readOnly={true} readOnly={true}
value="--" value="--"
/> />
<Component <MaskedCopyableTextField
allowMask={false} allowMask={false}
ariaLabel="deviceInterfaces.columns.description" ariaLabel="deviceInterfaces.columns.description"
label="deviceInterfaces.columns.description" label="deviceInterfaces.columns.description"
readOnly={true} readOnly={true}
value="--" value="--"
/> />
<Component <JSONEditor
className="interface-definition-json-editor" className="interface-definition-json-editor"
content="{ content="{
\\"@id\\": \\"urn:azureiot:ModelDiscovery:DigitalTwin:1\\", \\"@id\\": \\"urn:azureiot:ModelDiscovery:DigitalTwin:1\\",

Просмотреть файл

@ -70,7 +70,7 @@ exports[`components/devices/deviceProperties matches snapshot with one twinWithS
] ]
} }
/> />
<Component <DevicePropertiesPerInterface
twinAndSchema={ twinAndSchema={
Array [ Array [
Object { Object {

Просмотреть файл

@ -31,7 +31,7 @@ exports[`deviceSettings matches snapshot with one twinWithSchema 1`] = `
] ]
} }
/> />
<Component <DeviceSettingsPerInterface
componentName="foo" componentName="foo"
deviceId={null} deviceId={null}
interfaceId="urn:contoso:com:EnvironmentalSensor;1" interfaceId="urn:contoso:com:EnvironmentalSensor;1"

Просмотреть файл

@ -25,11 +25,11 @@ exports[`components/devices/deviceSettingsPerInterface matches snapshot 1`] = `
<span <span
className="col-sm4 reported-value" className="col-sm4 reported-value"
> >
<Component <LabelWithTooltip
tooltipText="deviceSettings.columns.reportedValueTooltip" tooltipText="deviceSettings.columns.reportedValueTooltip"
> >
deviceSettings.columns.reportedValue deviceSettings.columns.reportedValue
</Component> </LabelWithTooltip>
</span> </span>
<div <div
className="col-sm1 collapse-button" className="col-sm1 collapse-button"
@ -50,7 +50,7 @@ exports[`components/devices/deviceSettingsPerInterface matches snapshot 1`] = `
className="list-content" className="list-content"
role="list" role="list"
> >
<Component <DeviceSettingsPerInterfacePerSetting
collapsed={false} collapsed={false}
componentName="environmentalSensor" componentName="environmentalSensor"
desiredValue={456} desiredValue={456}
@ -149,7 +149,7 @@ exports[`components/devices/deviceSettingsPerInterface matches snapshot 1`] = `
] ]
} }
/> />
<Component <DeviceSettingsPerInterfacePerSetting
collapsed={false} collapsed={false}
componentName="environmentalSensor" componentName="environmentalSensor"
desiredValue={456} desiredValue={456}

Просмотреть файл

@ -3,6 +3,7 @@
* Licensed under the MIT License * Licensed under the MIT License
**********************************************************/ **********************************************************/
import { call, CallEffect, put } from 'redux-saga/effects'; import { call, CallEffect, put } from 'redux-saga/effects';
import { SagaIterator } from 'redux-saga';
import { Action } from 'typescript-fsa'; import { Action } from 'typescript-fsa';
import { fetchModelDefinition } from '../../../api/services/publicDigitalTwinsModelRepoService'; import { fetchModelDefinition } from '../../../api/services/publicDigitalTwinsModelRepoService';
import { raiseNotificationToast } from '../../../notifications/components/notificationToast'; import { raiseNotificationToast } from '../../../notifications/components/notificationToast';
@ -17,7 +18,7 @@ import { ModelDefinitionNotValidJsonError } from '../../../api/models/modelDefin
import { GetModelDefinitionActionParameters, getModelDefinitionAction } from '../actions'; import { GetModelDefinitionActionParameters, getModelDefinitionAction } from '../actions';
import { ModelIdCasingNotMatchingException } from '../../../shared/utils/exceptions/modelIdCasingNotMatchingException'; import { ModelIdCasingNotMatchingException } from '../../../shared/utils/exceptions/modelIdCasingNotMatchingException';
export function* getModelDefinitionSaga(action: Action<GetModelDefinitionActionParameters>) { export function* getModelDefinitionSaga(action: Action<GetModelDefinitionActionParameters>): SagaIterator {
const { locations, interfaceId } = action.payload; const { locations, interfaceId } = action.payload;
let errorCount = 0; let errorCount = 0;
for (const location of locations) { // try to get model definition in order according to user's location settings for (const location of locations) { // try to get model definition in order according to user's location settings
@ -64,7 +65,7 @@ export function* getModelDefinitionSaga(action: Action<GetModelDefinitionActionP
} }
} }
export function* validateModelDefinitionHelper(modelDefinition: ModelDefinition, location: RepositoryLocationSettings) { export function* validateModelDefinitionHelper(modelDefinition: ModelDefinition, location: RepositoryLocationSettings): SagaIterator {
return true; // commenting out validating model until it aligns with local parser return true; // commenting out validating model until it aligns with local parser
} }
@ -91,7 +92,7 @@ export const checkModelIdCasing = (model: ModelDefinition, id: string) => {
} }
}; };
export function* getModelDefinitionFromPublicRepo(action: Action<GetModelDefinitionActionParameters>) { export function* getModelDefinitionFromPublicRepo(action: Action<GetModelDefinitionActionParameters>): SagaIterator {
const splitInterfaceId = getSplitInterfaceId(action.payload.interfaceId); const splitInterfaceId = getSplitInterfaceId(action.payload.interfaceId);
const parameters: FetchModelParameters = { const parameters: FetchModelParameters = {
id: splitInterfaceId[0], id: splitInterfaceId[0],
@ -102,7 +103,7 @@ export function* getModelDefinitionFromPublicRepo(action: Action<GetModelDefinit
return getFlattenedModel(model, splitInterfaceId); return getFlattenedModel(model, splitInterfaceId);
} }
export function* getModelDefinitionFromConfigurableRepo(action: Action<GetModelDefinitionActionParameters>) { export function* getModelDefinitionFromConfigurableRepo(action: Action<GetModelDefinitionActionParameters>): SagaIterator {
const configurableRepoUrls = action.payload.locations.filter(location => location.repositoryLocationType === REPOSITORY_LOCATION_TYPE.Configurable); const configurableRepoUrls = action.payload.locations.filter(location => location.repositoryLocationType === REPOSITORY_LOCATION_TYPE.Configurable);
const configurableRepoUrl = configurableRepoUrls && configurableRepoUrls[0] && configurableRepoUrls[0].value || ''; const configurableRepoUrl = configurableRepoUrls && configurableRepoUrls[0] && configurableRepoUrls[0].value || '';
const url = configurableRepoUrl.replace(/\/$/, ''); // remove trailing slash const url = configurableRepoUrl.replace(/\/$/, ''); // remove trailing slash
@ -117,7 +118,7 @@ export function* getModelDefinitionFromConfigurableRepo(action: Action<GetModelD
return getFlattenedModel(model, splitInterfaceId); return getFlattenedModel(model, splitInterfaceId);
} }
export function* getModelDefinitionFromLocalFile(action: Action<GetModelDefinitionActionParameters>) { export function* getModelDefinitionFromLocalFile(action: Action<GetModelDefinitionActionParameters>): SagaIterator {
const localFolderPaths = action.payload.locations.filter(location => location.repositoryLocationType === REPOSITORY_LOCATION_TYPE.Local); const localFolderPaths = action.payload.locations.filter(location => location.repositoryLocationType === REPOSITORY_LOCATION_TYPE.Local);
const localFolderPath = localFolderPaths && localFolderPaths[0] && localFolderPaths[0].value || ''; const localFolderPath = localFolderPaths && localFolderPaths[0] && localFolderPaths[0].value || '';
const path = localFolderPath.replace(/\/$/, ''); // remove trailing slash const path = localFolderPath.replace(/\/$/, ''); // remove trailing slash
@ -126,7 +127,7 @@ export function* getModelDefinitionFromLocalFile(action: Action<GetModelDefiniti
return getFlattenedModel(model, splitInterfaceId); return getFlattenedModel(model, splitInterfaceId);
} }
export function* getModelDefinition(action: Action<GetModelDefinitionActionParameters>, location: RepositoryLocationSettings) { export function* getModelDefinition(action: Action<GetModelDefinitionActionParameters>, location: RepositoryLocationSettings): SagaIterator {
switch (location.repositoryLocationType) { switch (location.repositoryLocationType) {
case REPOSITORY_LOCATION_TYPE.Local: case REPOSITORY_LOCATION_TYPE.Local:
return yield call(getModelDefinitionFromLocalFile, action); return yield call(getModelDefinitionFromLocalFile, action);

Просмотреть файл

@ -3,6 +3,7 @@
* Licensed under the MIT License * Licensed under the MIT License
**********************************************************/ **********************************************************/
import { call, put } from 'redux-saga/effects'; import { call, put } from 'redux-saga/effects';
import { SagaIterator } from 'redux-saga';
import { Action } from 'typescript-fsa'; import { Action } from 'typescript-fsa';
import { invokeCommandAction, InvokeCommandActionParameters } from '../actions'; import { invokeCommandAction, InvokeCommandActionParameters } from '../actions';
import { invokeDirectMethod } from '../../../api/services/devicesService'; import { invokeDirectMethod } from '../../../api/services/devicesService';
@ -13,7 +14,7 @@ import { ResourceKeys } from '../../../../localization/resourceKeys';
import { ParsedJsonSchema } from '../../../api/models/interfaceJsonParserOutput'; import { ParsedJsonSchema } from '../../../api/models/interfaceJsonParserOutput';
import { getSchemaValidationErrors } from '../../../shared/utils/jsonSchemaAdaptor'; import { getSchemaValidationErrors } from '../../../shared/utils/jsonSchemaAdaptor';
export function* invokeCommandSaga(action: Action<InvokeCommandActionParameters>) { export function* invokeCommandSaga(action: Action<InvokeCommandActionParameters>): SagaIterator {
const toastId: number = Math.random(); const toastId: number = Math.random();
try { try {

Просмотреть файл

@ -69,12 +69,12 @@ exports[`dataForm matches snapshot with unsupported type 1`] = `
<form <form
className="json-editor" className="json-editor"
> >
<Component <LabelWithTooltip
tooltipText="notifications.interfaceSchemaNotSupported" tooltipText="notifications.interfaceSchemaNotSupported"
> >
deviceContent.value deviceContent.value
</Component> </LabelWithTooltip>
<Component <JSONEditor
className="json-editor" className="json-editor"
content="123" content="123"
onChange={[Function]} onChange={[Function]}

Просмотреть файл

@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`devices/components/moduleIdentityTwin snapshot matches snapshot when no device identity is provided 1`] = ` exports[`devices/components/moduleIdentityTwin snapshot matches snapshot when no device identity is provided 1`] = `
<Component <CollapsibleSection
expanded={false} expanded={false}
label="deviceIdentity.authenticationType.sasToken.label" label="deviceIdentity.authenticationType.sasToken.label"
tooltipText="deviceIdentity.authenticationType.sasToken.toolTip" tooltipText="deviceIdentity.authenticationType.sasToken.toolTip"
@ -38,7 +38,7 @@ exports[`devices/components/moduleIdentityTwin snapshot matches snapshot when no
onIncrement={[Function]} onIncrement={[Function]}
value="5" value="5"
/> />
<Component <MaskedCopyableTextField
allowMask={true} allowMask={true}
ariaLabel="deviceIdentity.authenticationType.sasToken.textField.ariaLabel" ariaLabel="deviceIdentity.authenticationType.sasToken.textField.ariaLabel"
label="deviceIdentity.authenticationType.sasToken.textField.label" label="deviceIdentity.authenticationType.sasToken.textField.label"
@ -53,11 +53,11 @@ exports[`devices/components/moduleIdentityTwin snapshot matches snapshot when no
title="deviceIdentity.authenticationType.sasToken.generateButton.title" title="deviceIdentity.authenticationType.sasToken.generateButton.title"
/> />
</div> </div>
</Component> </CollapsibleSection>
`; `;
exports[`devices/components/moduleIdentityTwin snapshot matches snapshot when no device identity is provided 2`] = ` exports[`devices/components/moduleIdentityTwin snapshot matches snapshot when no device identity is provided 2`] = `
<Component <CollapsibleSection
expanded={false} expanded={false}
label="deviceIdentity.authenticationType.sasToken.label" label="deviceIdentity.authenticationType.sasToken.label"
tooltipText="deviceIdentity.authenticationType.sasToken.toolTip" tooltipText="deviceIdentity.authenticationType.sasToken.toolTip"
@ -94,7 +94,7 @@ exports[`devices/components/moduleIdentityTwin snapshot matches snapshot when no
onIncrement={[Function]} onIncrement={[Function]}
value="5" value="5"
/> />
<Component <MaskedCopyableTextField
allowMask={true} allowMask={true}
ariaLabel="deviceIdentity.authenticationType.sasToken.textField.ariaLabel" ariaLabel="deviceIdentity.authenticationType.sasToken.textField.ariaLabel"
label="deviceIdentity.authenticationType.sasToken.textField.label" label="deviceIdentity.authenticationType.sasToken.textField.label"
@ -109,5 +109,5 @@ exports[`devices/components/moduleIdentityTwin snapshot matches snapshot when no
title="deviceIdentity.authenticationType.sasToken.generateButton.title" title="deviceIdentity.authenticationType.sasToken.generateButton.title"
/> />
</div> </div>
</Component> </CollapsibleSection>
`; `;

Просмотреть файл

@ -2,14 +2,14 @@
exports[`HomeView matches snapshot 1`] = ` exports[`HomeView matches snapshot 1`] = `
<Fragment> <Fragment>
<Component /> <AppVersionMessageBar />
<div <div
className="view-content home-view" className="view-content home-view"
> >
<div <div
className="nav" className="nav"
> >
<Component <HomeViewNavigation
appMenuVisible={true} appMenuVisible={true}
setAppMenuVisible={[Function]} setAppMenuVisible={[Function]}
/> />

Просмотреть файл

@ -7,7 +7,7 @@ exports[`IotHubDevices matches snapshot 1`] = `
exact={true} exact={true}
path="" path=""
/> />
<Component <BreadcrumbRoute
breadcrumb={ breadcrumb={
Object { Object {
"name": "breadcrumb.add", "name": "breadcrumb.add",
@ -16,8 +16,8 @@ exports[`IotHubDevices matches snapshot 1`] = `
exact={true} exact={true}
path="/add" path="/add"
> >
<Component /> <AddDevice />
</Component> </BreadcrumbRoute>
<Component <Component
component={[Function]} component={[Function]}
path="/deviceDetail" path="/deviceDetail"

Просмотреть файл

@ -9,7 +9,7 @@ exports[`IotHubHost matches snapshot 1`] = `
} }
> >
<Component> <Component>
<Component <BreadcrumbRoute
breadcrumb={ breadcrumb={
Object { Object {
"name": "breadcrumb.devices", "name": "breadcrumb.devices",
@ -17,8 +17,8 @@ exports[`IotHubHost matches snapshot 1`] = `
} }
path="/devices" path="/devices"
> >
<Component /> <IotHubDevices />
</Component> </BreadcrumbRoute>
<Component <Component
from="" from=""
to="/devices" to="/devices"

Просмотреть файл

@ -2,7 +2,7 @@
exports[`IotHubResource matches snapshot 1`] = ` exports[`IotHubResource matches snapshot 1`] = `
<Component> <Component>
<Component <BreadcrumbRoute
breadcrumb={ breadcrumb={
Object { Object {
"name": "breadcrumb.devices", "name": "breadcrumb.devices",
@ -10,8 +10,8 @@ exports[`IotHubResource matches snapshot 1`] = `
} }
path="/devices" path="/devices"
> >
<Component /> <IotHubDevices />
</Component> </BreadcrumbRoute>
<Component <Component
from="" from=""
to="/devices" to="/devices"

Просмотреть файл

@ -22,5 +22,5 @@ const FabricTextHighOrder = (highOrderProps?: ITextFieldProps) => (props: ITextF
); );
}; };
export const FabricText: Widget = FabricTextHighOrder(); export const FabricText = FabricTextHighOrder();
export const FabricTextArea: Widget = FabricTextHighOrder({ multiline: true }); export const FabricTextArea = FabricTextHighOrder({ multiline: true });

Просмотреть файл

@ -12,7 +12,7 @@ exports[`components/settings/modelRepositoryLocationList matches snapshot with e
<n <n
key="PUBLIC" key="PUBLIC"
> >
<Component <ModelRepositoryLocationListItem
index={0} index={0}
item={ item={
Object { Object {
@ -26,7 +26,7 @@ exports[`components/settings/modelRepositoryLocationList matches snapshot with e
<n <n
key="LOCAL" key="LOCAL"
> >
<Component <ModelRepositoryLocationListItem
index={1} index={1}
item={ item={
Object { Object {
@ -65,7 +65,7 @@ exports[`components/settings/modelRepositoryLocationList matches snapshot with p
<n <n
key="PUBLIC" key="PUBLIC"
> >
<Component <ModelRepositoryLocationListItem
index={0} index={0}
item={ item={
Object { Object {

Просмотреть файл

@ -93,10 +93,10 @@ exports[`modelRepositoryLocationView matches snapshot when locations greater tha
<div <div
className="view-scroll-vertical" className="view-scroll-vertical"
> >
<Component <ModelRepositoryInstruction
empty={false} empty={false}
/> />
<Component <ModelRepositoryLocationList
onChangeRepositoryLocationSettings={[Function]} onChangeRepositoryLocationSettings={[Function]}
repositoryLocationSettings={ repositoryLocationSettings={
Array [ Array [
@ -205,10 +205,10 @@ exports[`modelRepositoryLocationView matches snapshot when no locations 1`] = `
<div <div
className="view-scroll-vertical" className="view-scroll-vertical"
> >
<Component <ModelRepositoryInstruction
empty={true} empty={true}
/> />
<Component <ModelRepositoryLocationList
onChangeRepositoryLocationSettings={[Function]} onChangeRepositoryLocationSettings={[Function]}
repositoryLocationSettings={Array []} repositoryLocationSettings={Array []}
repositoryLocationSettingsErrors={Object {}} repositoryLocationSettingsErrors={Object {}}

Просмотреть файл

@ -10,7 +10,7 @@ exports[`BreadcrumbRoute matches snapshot 1`] = `
exact={true} exact={true}
path="path" path="path"
> >
<Component <BreadcrumbWrapper
name="name" name="name"
/> />
</Route> </Route>

Просмотреть файл

@ -4,7 +4,7 @@ exports[`Breadcrumbs matches snapshot 1`] = `
<ul <ul
className="breadcrumb" className="breadcrumb"
> >
<Component <Breadcrumb
disableLink={true} disableLink={true}
key="path1" key="path1"
name="name1" name="name1"
@ -12,7 +12,7 @@ exports[`Breadcrumbs matches snapshot 1`] = `
suffix="" suffix=""
url="url1" url="url1"
/> />
<Component <Breadcrumb
disableLink={false} disableLink={false}
key="path2" key="path2"
name="name2" name="name2"
@ -20,7 +20,7 @@ exports[`Breadcrumbs matches snapshot 1`] = `
suffix="" suffix=""
url="url2" url="url2"
/> />
<Component <Breadcrumb
disableLink={true} disableLink={true}
key="path3" key="path3"
name="name3" name="name3"

Просмотреть файл

@ -50,7 +50,7 @@ exports[`notificationList matches snapshot where there is no notifications 2`] =
<div <div
key="0" key="0"
> >
<Component <NotificationListEntry
notification={ notification={
Object { Object {
"text": Object { "text": Object {

Просмотреть файл

@ -15,11 +15,11 @@ exports[`collapsibleSection matches snapshot 1`] = `
onClick={[Function]} onClick={[Function]}
title="collapsibleSection.open" title="collapsibleSection.open"
/> />
<Component <LabelWithTooltip
tooltipText="tooltip" tooltipText="tooltip"
> >
Label Label
</Component> </LabelWithTooltip>
<div <div
className="collapsible-section-children" className="collapsible-section-children"
/> />

Просмотреть файл

@ -10,10 +10,10 @@ exports[`Header matches snapshot 1`] = `
header.applicationName header.applicationName
</div> </div>
<div> <div>
<Component /> <NotificationPane />
</div> </div>
<div> <div>
<Component /> <SettingsPane />
</div> </div>
</header> </header>
`; `;

Просмотреть файл

@ -288,7 +288,7 @@ exports[`components/shared/labelWithRichCallout matches snapshot when tooltip sp
} }
> >
<label <label
className="ms-Label root-53" className="ms-Label root-109"
> >
labelText labelText
</label> </label>
@ -1327,7 +1327,7 @@ exports[`components/shared/labelWithRichCallout matches snapshot when tooltip sp
variantClassName="ms-Button--icon" variantClassName="ms-Button--icon"
> >
<button <button
className="ms-Button ms-Button--icon root-54" className="ms-Button ms-Button--icon root-110"
data-is-focusable={true} data-is-focusable={true}
id="iconbutton0" id="iconbutton0"
onClick={[Function]} onClick={[Function]}
@ -1339,16 +1339,16 @@ exports[`components/shared/labelWithRichCallout matches snapshot when tooltip sp
type="button" type="button"
> >
<span <span
className="ms-Button-flexContainer flexContainer-55" className="ms-Button-flexContainer flexContainer-111"
data-automationid="splitbuttonprimary" data-automationid="splitbuttonprimary"
> >
<FontIcon <FontIcon
className="ms-Button-icon icon-57" className="ms-Button-icon icon-113"
iconName="Info" iconName="Info"
> >
<i <i
aria-hidden={true} aria-hidden={true}
className="ms-Icon root-37 ms-Button-icon icon-57" className="ms-Icon root-105 ms-Button-icon icon-113"
data-icon-name="Info" data-icon-name="Info"
style={ style={
Object { Object {

Просмотреть файл

@ -7,11 +7,11 @@ exports[`MaskedCopyableTextField snapshots it matches snapshot when allowMask =
<div <div
className="labelSection" className="labelSection"
> >
<Component <LabelWithTooltip
htmlFor="maskedCopyableTextField0" htmlFor="maskedCopyableTextField0"
> >
label1 label1
</Component> </LabelWithTooltip>
</div> </div>
<div <div
className="controlSection" className="controlSection"
@ -78,11 +78,11 @@ exports[`MaskedCopyableTextField snapshots it matches snapshot when allowMask =
<div <div
className="labelSection" className="labelSection"
> >
<Component <LabelWithTooltip
htmlFor="maskedCopyableTextField3" htmlFor="maskedCopyableTextField3"
> >
label1 label1
</Component> </LabelWithTooltip>
</div> </div>
<div <div
className="controlSection" className="controlSection"
@ -163,11 +163,11 @@ exports[`MaskedCopyableTextField snapshots it matches snapshot when allowMask =
<div <div
className="labelSection" className="labelSection"
> >
<Component <LabelWithTooltip
htmlFor="maskedCopyableTextField6" htmlFor="maskedCopyableTextField6"
> >
label1 label1
</Component> </LabelWithTooltip>
</div> </div>
<div <div
className="controlSection" className="controlSection"
@ -248,11 +248,11 @@ exports[`MaskedCopyableTextField snapshots it matches snapshot when error messag
<div <div
className="labelSection" className="labelSection"
> >
<Component <LabelWithTooltip
htmlFor="maskedCopyableTextField9" htmlFor="maskedCopyableTextField9"
> >
label1 label1
</Component> </LabelWithTooltip>
</div> </div>
<div <div
className="controlSection" className="controlSection"

Просмотреть файл

@ -3,6 +3,7 @@
* Licensed under the MIT License * Licensed under the MIT License
**********************************************************/ **********************************************************/
import { call } from 'redux-saga/effects'; import { call } from 'redux-saga/effects';
import { SagaIterator } from 'redux-saga';
import { Action } from 'typescript-fsa'; import { Action } from 'typescript-fsa';
import { setConfigurableRepositoryPath, setLocalFolderPath, setRepositoryLocations } from '../../../api/services/modelRepositoryService'; import { setConfigurableRepositoryPath, setLocalFolderPath, setRepositoryLocations } from '../../../api/services/modelRepositoryService';
import { RepositoryLocationSettings } from '../state'; import { RepositoryLocationSettings } from '../state';
@ -11,7 +12,7 @@ import { NotificationType } from '../../../api/models/notification';
import { ResourceKeys } from '../../../../localization/resourceKeys'; import { ResourceKeys } from '../../../../localization/resourceKeys';
import { raiseNotificationToast } from '../../../notifications/components/notificationToast'; import { raiseNotificationToast } from '../../../notifications/components/notificationToast';
export function* setRepositoryLocationsSaga(action: Action<RepositoryLocationSettings[]>) { export function* setRepositoryLocationsSaga(action: Action<RepositoryLocationSettings[]>): SagaIterator {
const localFolderPath = yield call(getLocalFolderPath, action.payload); const localFolderPath = yield call(getLocalFolderPath, action.payload);
yield call(setLocalFolderPath, localFolderPath); yield call(setLocalFolderPath, localFolderPath);

Просмотреть файл

@ -26,10 +26,5 @@
"webpack.*", "webpack.*",
"**/*.spec.ts", "**/*.spec.ts",
"**/*.spec.tsx" "**/*.spec.tsx"
],
"awesomeTypescriptLoaderOptions": {
"reportFiles": [
"./src/**/*"
] ]
}
} }

Просмотреть файл

@ -1,55 +1,43 @@
import * as webpack from 'webpack'; import * as webpack from 'webpack';
import * as path from 'path'; import * as path from 'path';
const HtmlWebpackPlugin = require('html-webpack-plugin'); // tslint:disable-line: no-var-requires const HtmlWebpackPlugin = require('html-webpack-plugin'); // tslint:disable-line: no-var-requires
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); // tslint:disable-line: no-var-requires
const CopyPlugin = require('copy-webpack-plugin'); // tslint:disable-line: no-var-requires const CopyPlugin = require('copy-webpack-plugin'); // tslint:disable-line: no-var-requires
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin'); // tslint:disable-line: no-var-requires
const config: webpack.Configuration = { const config: webpack.Configuration = {
entry: { entry: {
main: ['./src/index.tsx'] main: ['./src/index.tsx']
}, },
output: {
filename: '[name].[contenthash].js',
path: path.resolve(__dirname, '.', 'dist'),
},
module: { module: {
rules: [ rules: [
{ test: /\.tsx?$/, loader: 'ts-loader', exclude: /node_modules/ },
{ {
enforce: 'pre',
exclude: /node_modules/, exclude: /node_modules/,
loader: 'tslint-loader', loader: 'tslint-loader',
options: {
emitErrors: true,
failOnHint: true
},
test: /\.tsx?$/ test: /\.tsx?$/
}, },
{ {
loader: 'file-loader?name=images/[name].[ext]', loader:'file-loader',
options: {
name: '?name=images/[name].[ext]',
},
test: /\.(jpe?g|png|gif|svg)$/i test: /\.(jpe?g|png|gif|svg)$/i
} }
] ]
}, },
optimization: { optimization: {
splitChunks: { splitChunks: {
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/]((?!(monaco-editor)|(@fluentui)).*)[\\/]/,
name(module: any) { // tslint:disable-line:no-any
const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1];
// npm package names are URL-safe, but some servers don't like @ symbols
return `npm.${packageName.replace('@', '')}`;
},
},
},
chunks: 'all', chunks: 'all',
maxInitialRequests: Infinity, maxInitialRequests: Infinity,
minSize: 0, minSize: 0,
}, },
}, },
output: {
filename: '[name].[hash].js',
path: path.resolve(__dirname, '.', 'dist'),
publicPath: ''
},
plugins: [ plugins: [
new NodePolyfillPlugin(),
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
template: path.resolve(__dirname, '.', 'src', 'index.html') template: path.resolve(__dirname, '.', 'src', 'index.html')
}), }),
@ -66,7 +54,7 @@ const config: webpack.Configuration = {
resolve: { resolve: {
// Add '.ts' and '.tsx' as resolvable extensions. // Add '.ts' and '.tsx' as resolvable extensions.
extensions: ['.ts', '.tsx', '.js', '.json'] extensions: ['.ts', '.tsx', '.js', '.json']
}, }
}; };
export default config; export default config;

Просмотреть файл

@ -2,12 +2,17 @@
* Copyright (c) Microsoft Corporation. All rights reserved. * Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License * Licensed under the MIT License
**********************************************************/ **********************************************************/
import * as webpack from 'webpack'; import { Configuration as WebpackConfig, NormalModuleReplacementPlugin } from 'webpack';
import * as merge from 'webpack-merge'; import { Configuration as WebpackDevServerConfig } from "webpack-dev-server";
import { merge } from 'webpack-merge';
import common from './webpack.common'; import common from './webpack.common';
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); // tslint:disable-line: no-var-requires const MiniCssExtractPlugin = require('mini-css-extract-plugin'); // tslint:disable-line: no-var-requires
const config: webpack.Configuration = merge(common, { interface Config extends WebpackConfig {
devServer?: WebpackDevServerConfig
}
const config: Config = merge(common, {
mode: 'development', mode: 'development',
@ -16,9 +21,6 @@ const config: webpack.Configuration = merge(common, {
module: { module: {
rules: [ rules: [
// All files with a '.ts' or '.tsx' extension will be handled by 'awesome-typescript-loader'.
{ test: /\.tsx?$/, loader: 'awesome-typescript-loader', exclude: /node_modules/ },
// All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'. // All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'.
{ enforce: 'pre', test: /\.js$/, loader: 'source-map-loader', exclude: /node_modules/ }, { enforce: 'pre', test: /\.js$/, loader: 'source-map-loader', exclude: /node_modules/ },
{ {
@ -40,7 +42,7 @@ const config: webpack.Configuration = merge(common, {
filename: '[name].css', filename: '[name].css',
ignoreOrder: false, // Enable to remove warnings about conflicting order ignoreOrder: false, // Enable to remove warnings about conflicting order
}), }),
new webpack.NormalModuleReplacementPlugin( new NormalModuleReplacementPlugin(
/(.*)appConfig.ENV(\.*)/, /(.*)appConfig.ENV(\.*)/,
resource => resource.request = resource.request.replace(/ENV/, 'dev') resource => resource.request = resource.request.replace(/ENV/, 'dev')
) )

Просмотреть файл

@ -4,11 +4,10 @@
**********************************************************/ **********************************************************/
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; // tslint:disable-line: no-var-requires const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; // tslint:disable-line: no-var-requires
import * as webpack from 'webpack'; import * as webpack from 'webpack';
import * as merge from 'webpack-merge'; import { merge } from 'webpack-merge';
import common from './webpack.common'; import common from './webpack.common';
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); // tslint:disable-line: no-var-requires const MiniCssExtractPlugin = require('mini-css-extract-plugin'); // tslint:disable-line: no-var-requires
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin'); // tslint:disable-line: no-var-requires const CssMinimizerPlugin = require('css-minimizer-webpack-plugin'); // tslint:disable-line: no-var-requires
const TerserPlugin = require('terser-webpack-plugin'); // tslint:disable-line: no-var-requires
const config: webpack.Configuration = merge(common, { const config: webpack.Configuration = merge(common, {
@ -16,39 +15,25 @@ const config: webpack.Configuration = merge(common, {
module: { module: {
rules: [ rules: [
// All files with a '.ts' or '.tsx' extension will be handled by 'awesome-typescript-loader'.
{ test: /\.tsx?$/, loader: 'awesome-typescript-loader' },
{ {
test: /\.(scss|css)$/, test: /.s?css$/,
use: [ use: [MiniCssExtractPlugin.loader, "css-loader", "sass-loader"],
{ loader: 'style-loader'},
MiniCssExtractPlugin.loader,
{ loader: 'css-loader', options: { sourceMap: false}},
{ loader: 'sass-loader', options: {sourceMap: false, implementation: require('sass')}}]
} }
] ]
}, },
optimization: { optimization: {
minimizer: [new TerserPlugin(), new OptimizeCSSAssetsPlugin({})] minimizer: [new CssMinimizerPlugin({})]
}, },
plugins: [ plugins: [
// new BundleAnalyzerPlugin(), // new BundleAnalyzerPlugin(),
new MiniCssExtractPlugin({ new MiniCssExtractPlugin({
// Options similar to the same options in webpackOptions.output // // Options similar to the same options in webpackOptions.output
// all options are optional // // all options are optional
chunkFilename: '[id].[hash].optimize.css', // chunkFilename: '[id].[hash].optimize.css',
filename: '[name].[hash].optimize.css', // filename: '[name].[hash].optimize.css',
ignoreOrder: false, // Enable to remove warnings about conflicting order // ignoreOrder: false, // Enable to remove warnings about conflicting order
}),
new OptimizeCSSAssetsPlugin({
assetNameRegExp: /\.optimize\.css$/g,
canPrint: true,
cssProcessor: require('cssnano'), // tslint:disable-line
cssProcessorPluginOptions: {
preset: ['default', { discardComments: { removeAll: true } }],
},
}), }),
new webpack.NormalModuleReplacementPlugin( new webpack.NormalModuleReplacementPlugin(
/(.*)appConfig.ENV(\.*)/, /(.*)appConfig.ENV(\.*)/,