-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Phone as a Device support for QR code (#480)
* Squashed commit of the following: commit f982a59 Author: Paul Montgomery <pamontg@microsoft.com> Date: Wed Oct 20 12:18:31 2021 -0700 When no desiredValue, pre load with any reported Value commit bfe43b6 Author: Paul Montgomery <pamontg@microsoft.com> Date: Fri Sep 24 17:12:21 2021 -0700 QR supporting tesxt and fix falsey reported ack values commit 6a8dc92 Author: Paul Montgomery <pamontg@microsoft.com> Date: Tue Aug 31 14:47:52 2021 -0700 Fix some tests commit 43da209 Author: Paul Montgomery <pamontg@microsoft.com> Date: Tue Aug 31 09:14:07 2021 -0700 Begin implementing extends commit 2dac2d2 Author: Paul Montgomery <pamontg@microsoft.com> Date: Fri Aug 20 09:47:47 2021 -0700 Update electron-builder and handle enums better commit b9ef12f Author: Paul Montgomery <pamontg@microsoft.com> Date: Mon Aug 2 10:02:33 2021 -0700 Add the QR code generating bits for mobile app * Bump version number * update a test
- Loading branch information
Showing
26 changed files
with
320 additions
and
55 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.qrCodeGeneration { | ||
text-align: center; | ||
.storeLinks { | ||
padding-top: 20px; | ||
} | ||
.qrCode { | ||
padding:5px; | ||
background-color: white; | ||
width: 200px; | ||
height: 200px; | ||
border-radius: 8px; | ||
margin-left: auto; | ||
margin-right: auto; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
src/app/devices/deviceIdentity/components/__snapshots__/qrGenerationView.spec.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`DeviceModules matches snapshot 1`] = ` | ||
<Component | ||
expanded={false} | ||
label="deviceIdentity.qrCode.label" | ||
tooltipText="deviceIdentity.qrCode.toolTip" | ||
> | ||
<div | ||
className="qrCodeGeneration" | ||
> | ||
<h1> | ||
deviceIdentity.qrCode.headerText | ||
</h1> | ||
<p> | ||
deviceIdentity.qrCode.callToAction | ||
</p> | ||
<section | ||
className="storeLinks" | ||
> | ||
<StyledLinkBase | ||
href="https://play.google.com/store/apps/details?id=com.iot_pnp" | ||
target="_blank" | ||
> | ||
<img | ||
src="images/qrCodes/playstore.png" | ||
/> | ||
</StyledLinkBase> | ||
<StyledLinkBase | ||
href="https://apps.apple.com/app/iot-plug-and-play/id1563783687" | ||
target="_blank" | ||
> | ||
<img | ||
src="images/qrCodes/appstore.png" | ||
/> | ||
</StyledLinkBase> | ||
</section> | ||
<section> | ||
<div | ||
className="qrCode" | ||
> | ||
<Memo(QRCode) | ||
size={200} | ||
value="eyJkZXZpY2VJZCI6InNvbWVfZGV2aWNlIiwiZGV2aWNlS2V5IjoiaW52YWxpZF9kZXZpY2Vfa2V5IiwiaG9zdE5hbWUiOiJpbnZhbGlkX2hvc3QifQ==" | ||
/> | ||
</div> | ||
</section> | ||
</div> | ||
</Component> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/app/devices/deviceIdentity/components/qrGenerationView.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/*********************************************************** | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License | ||
**********************************************************/ | ||
import * as React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
import { QrGenerationView } from './qrGenerationView'; | ||
|
||
describe('DeviceModules', () => { | ||
it('matches snapshot', () => { | ||
expect(shallow( | ||
<QrGenerationView | ||
deviceId="some_device" | ||
deviceKey="invalid_device_key" | ||
hostName="invalid_host" | ||
/> | ||
)).toMatchSnapshot(); | ||
}); | ||
}); |
Oops, something went wrong.