Skip to content

Commit

Permalink
feat(sharing): use stronger wording about public sharing of devices
Browse files Browse the repository at this point in the history
  • Loading branch information
coderbyheart committed Dec 5, 2024
1 parent d5e7f6a commit e9937da
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 25 deletions.
2 changes: 1 addition & 1 deletion dashboard/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
href="https://fonts.googleapis.com/css2?family=Inter+Tight:wght@200;300&family=Roboto+Condensed:wght@100;300;400;500&family=Share+Tech+Mono&display=swap"
rel="stylesheet"
/>
<title>hello.nrfcloud.com/map &middot; Dashboard</title>
<title>hello.nrfcloud.com/map &middot; Manage your public devices</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/add-device-by-fingerprint.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ test('Add an out-of-box experience device using its fingerprint', async ({
await expect(page.getByTestId('device-deviceId')).toHaveText(
/oob-3526561666[0-9]+/,
)
await page.getByRole('button', { name: 'share device' }).click()
await page.getByRole('button', { name: 'make device public' }).click()

await expect(
page.getByText('We will now show data sent by the device on the map!'),
Expand Down
2 changes: 2 additions & 0 deletions src/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
--color-progress-bg: #283b5e;
--color-success-bg: #44663f;
--color-success-fg: #3d724a;
--color-warning-bg: #594e12;
--color-warning-fg: #d4c53a;

/* Fonts */
--regular-font-family: "Inter Tight", sans-serif;
Expand Down
2 changes: 1 addition & 1 deletion src/component/AddDevice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const Sidebar = () => {
<a
class="button"
href={'/map/dashboard/#add-device'}
title="Dashboard"
title="Manage your public devices"
>
logging in to the Dashboard
</a>
Expand Down
2 changes: 1 addition & 1 deletion src/component/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const SidebarButton = () => {
<a
class="button"
href={location.linkToPage('dashboard')}
title="Dashboard"
title="Manage your public devices"
>
<Dashboard strokeWidth={2} />
</a>
Expand Down
13 changes: 13 additions & 0 deletions src/component/notifications/Warning.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.warning {
width: 100%;
background-color: var(--color-warning-bg);
border: 1px solid var(--color-warning-fg);
padding: var(--gap-small);
border-radius: var(--border-radius);
position: relative;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
7 changes: 7 additions & 0 deletions src/component/notifications/Warning.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { type ParentProps } from 'solid-js'

import './Warning.css'

export const Warning = (props: ParentProps<{ class?: string }>) => (
<div class={`warning ${props.class ?? ''}`}>{props.children}</div>
)
10 changes: 6 additions & 4 deletions src/dashboard/DashboardApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,12 @@ export const DashboardApp = () => {
const Unauthenticated = () => (
<Card>
<CardHeader>
<h1>Dashboard</h1>
<h1>Manage your public devices</h1>
</CardHeader>
<CardBody>
<p>
Welcome to the dashboard. Here you can view and manage your devices.
Welcome to the dashboard. Here you can view and manage your public
devices.
</p>
<hr />
<p>Get started by logging in with your email.</p>
Expand All @@ -126,14 +127,15 @@ const Home = () => {
<>
<Card>
<CardHeader>
<h1>Dashboard</h1>
<h1>Manage your public devices</h1>
<Show when={user() !== undefined}>
<p>Welcome {user()?.email}!</p>
</Show>
</CardHeader>
<CardBody>
<p>
Welcome to the dashboard. Here you can view and manage your devices.
Welcome to the dashboard. Here you can view and manage your public
devices.
</p>
</CardBody>
</Card>
Expand Down
10 changes: 5 additions & 5 deletions src/dashboard/DeviceList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ export const DeviceList = () => {
<h1>Your devices</h1>
<p>
To extend the time the device is visible on the map by 30 days select
one or more devices below and click &quot;extend sharing&quot;.
one or more devices below and click &quot;extend publication&quot;.
</p>
<div class="one-line">
<p>Click here to extend the sharing for all devices:</p>
<p>Click here to extend the publication for all devices:</p>
<Show when={submit() === false}>
<button
type="button"
Expand All @@ -87,7 +87,7 @@ export const DeviceList = () => {
})
}}
>
extend all
extend publication for all
</button>
</Show>
</div>
Expand Down Expand Up @@ -238,7 +238,7 @@ export const DeviceList = () => {
when={checked().size > 0}
fallback={
<button type="button" class="btn" disabled>
extend sharing
extend publication
</button>
}
>
Expand All @@ -252,7 +252,7 @@ export const DeviceList = () => {
})
}}
>
extend sharing
extend publication
</button>
</Show>
</CardFooter>
Expand Down
24 changes: 14 additions & 10 deletions src/dashboard/ShareOOBDevice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { ModelInfoBlock } from '#component/ModelInfoBlock.tsx'
import { Problem } from '#component/notifications/Problem.tsx'
import { Progress } from '#component/notifications/Progress.tsx'
import { Success } from '#component/notifications/Success.tsx'
import { Warning } from '#component/notifications/Warning.tsx'
import { ResourcesDL } from '#component/ResourcesDL.tsx'
import { useParameters } from '#context/Parameters.tsx'
import { useUser } from '#context/User.tsx'
Expand All @@ -28,7 +29,7 @@ export const ShareOOBDevice = (props: {
return (
<Card>
<CardHeader>
<h1>Share device</h1>
<h1>Make your device public</h1>
</CardHeader>
<Show when={modelValid()} fallback={<InvalidModel model={props.model} />}>
<Show
Expand Down Expand Up @@ -65,14 +66,17 @@ export const ShareOOBDevice = (props: {

const ShareInfo = (props: { device: Static<typeof DeviceIdentity> }) => (
<section>
<p>
You're about to make your device <code>{props.device.id}</code> publicly
available on{' '}
<a href="/map" target="_blank">
the map
</a>
.
</p>
<Warning class="pad-s pad-e pad-t gap-b">
<p>
You're about to make your device <code>{props.device.id}</code>{' '}
<strong>publicly available</strong> on{' '}
<a href="/map" target="_blank">
the map
</a>
. Everyone will be able to see data sent by your device, which may
include the precise location.
</p>
</Warning>
<ResourcesDL>
<CopyableProp
name={'Device ID'}
Expand Down Expand Up @@ -179,7 +183,7 @@ const DoShare = (props: {
onClick={() => setShare(true)}
disabled={shareDeviceRequest.loading}
>
share device
make device public
</button>
</CardFooter>
</>
Expand Down
4 changes: 2 additions & 2 deletions src/dashboard/ShowDevice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const ShowDevice = () => {
{deviceInfo()!.model.about.title}
</a>
</dd>
<dt>Sharing expires</dt>
<dt>Public until</dt>
<dd class="pad-b pad-t">
<ExtendSharing
id={deviceInfo()!.id}
Expand Down Expand Up @@ -139,7 +139,7 @@ const ExtendSharing = (props: { id: string; expires: Date }) => {
setExtend(true)
}}
>
extend sharing
extend publication for 30 days
</button>
}
>
Expand Down

0 comments on commit e9937da

Please sign in to comment.