Skip to content

Commit 5b8a16b

Browse files
committed
Update workflow based on feedback
1 parent cc168f8 commit 5b8a16b

10 files changed

Lines changed: 68 additions & 38 deletions

File tree

src-tauri/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ pub fn run() {
5757
}))
5858
// Persistent storage with file system
5959
.plugin(tauri_plugin_store::Builder::new().build())
60+
.plugin(tauri_plugin_notification::init())
6061
.plugin(tauri_plugin_upload::init())
6162
// LocalHost REST Client (in v2, use http plugin instead of request_client)
6263
.plugin(tauri_plugin_http::init())

src/App.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ const App = () => {
1818

1919
onMount(() => {
2020
get('settings').then((settings) => {
21-
console.log('got settings', settings)
2221
if (settings) {
2322
debug('loading settings')
2423
setEnableNotifications(settings.enableNotifications)

src/components/Cards/Card/index.tsx

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,20 @@ import Button from '@components/Buttons/Button'
22
import DefaultButton from '@components/Buttons/DefaultButton'
33
import PrimaryButton from '@components/Buttons/PrimaryButton'
44
import Typography from '@components/Typography'
5+
import { classNames } from '@src/utils'
56
import { IconTypes } from 'solid-icons'
67
import { IoChevronBackSharp } from 'solid-icons/io'
7-
import { ParentComponent, Show } from 'solid-js'
88
import { VsSettings } from 'solid-icons/vs'
9-
import { classNames } from '@src/utils'
9+
import { ParentComponent, Show } from 'solid-js'
1010

1111
export interface IProps {
1212
onClickSettings?: () => void
1313
onClickBack?: () => void
1414
onClickSecondary?: () => void
1515
onClickPrimary?: () => void
1616
onClickOption?: () => void
17+
onClickAdvanced?: () => void
18+
advancedButtonLabel?: string
1719
onClickOptionLabel?: string
1820
label: string
1921
icon: IconTypes
@@ -96,25 +98,34 @@ const Card: ParentComponent<IProps> = (props) => {
9698
</Show>
9799
{props.children}
98100
</div>
99-
<div class="flex flex-row gap-12 w-full">
100-
<Show when={typeof props.onClickSecondary !== 'undefined'}>
101-
<Button
102-
label={props.secondaryButtonLabel ?? '--'}
103-
onClick={props.onClickSecondary}
104-
/>
105-
</Show>
106-
<Show when={typeof props.onClickOption !== 'undefined'}>
101+
<div class="flex flex-col gap-12 w-full">
102+
<div class="flex flex-row gap-12 w-full">
103+
<Show when={typeof props.onClickSecondary !== 'undefined'}>
104+
<Button
105+
label={props.secondaryButtonLabel ?? '--'}
106+
onClick={props.onClickSecondary}
107+
/>
108+
</Show>
109+
110+
<Show when={typeof props.onClickOption !== 'undefined'}>
111+
<Button
112+
label={props.onClickOptionLabel ?? '--'}
113+
onClick={props.onClickOption}
114+
/>
115+
</Show>
116+
<Show when={typeof props.onClickPrimary !== 'undefined'}>
117+
<PrimaryButton
118+
label={props.primaryButtonLabel ?? '--'}
119+
onClick={props.onClickPrimary}
120+
isActive={props.isActive}
121+
disabled={!props.isActive}
122+
/>
123+
</Show>
124+
</div>
125+
<Show when={typeof props.onClickAdvanced !== 'undefined'}>
107126
<Button
108-
label={props.onClickOptionLabel ?? '--'}
109-
onClick={props.onClickOption}
110-
/>
111-
</Show>
112-
<Show when={typeof props.onClickPrimary !== 'undefined'}>
113-
<PrimaryButton
114-
label={props.primaryButtonLabel ?? '--'}
115-
onClick={props.onClickPrimary}
116-
isActive={props.isActive}
117-
disabled={!props.isActive}
127+
label={props.advancedButtonLabel ?? '--'}
128+
onClick={props.onClickAdvanced}
118129
/>
119130
</Show>
120131
</div>

src/containers/FlashWizard/SelectPortWizard/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ const SelectPortWizard = () => {
105105
case STEP_ACTION.UPDATE_NETWORK:
106106
case STEP_ACTION.SELECT_NETWORK: {
107107
batch(() => {
108-
setStep(INIT_WIZARD_STEPS.SELECT_PROCESS, false)
108+
setStep(INIT_WIZARD_STEPS.ADVANCED_BOARD_OPTIONS, false)
109109
setAction(ACTION.PREV)
110110
})
111111
break

src/containers/FlashWizard/SetupWizard/index.tsx

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const SetupWizard = () => {
2121
<Switch>
2222
<Match when={activeStep() === INIT_WIZARD_STEPS.PROCESS_INIT}>
2323
<Card
24-
primaryButtonLabel="Setup process"
24+
primaryButtonLabel="Install openiris"
2525
secondaryButtonLabel="Show Logs"
2626
isActive
2727
icon={BiRegularChip}
@@ -31,7 +31,7 @@ const SetupWizard = () => {
3131
onClickPrimary={() => {
3232
batch(() => {
3333
setAction(ACTION.NEXT)
34-
setStep(INIT_WIZARD_STEPS.SELECT_PROCESS)
34+
setStep(INIT_WIZARD_STEPS.SELECT_BOARD)
3535
})
3636
}}
3737
onClickSecondary={() => {
@@ -40,11 +40,19 @@ const SetupWizard = () => {
4040
setStep(TERMINAL_WIZARD_STEPS.TERMINAL_BEFORE_PROCEEDING)
4141
})
4242
}}
43+
onClickAdvanced={() => {
44+
batch(() => {
45+
setAction(ACTION.NEXT)
46+
setStep(INIT_WIZARD_STEPS.ADVANCED_BOARD_OPTIONS)
47+
setActiveAction(STEP_ACTION.ADVANCED_BOARD_OPTIONS)
48+
})
49+
}}
50+
advancedButtonLabel="Advanced board options"
4351
label="Flash Your Board"
4452
description="Click the button below to start the flashing process and follow the on-screen prompts to complete the setup."
4553
/>
4654
</Match>
47-
<Match when={activeStep() === INIT_WIZARD_STEPS.SELECT_PROCESS}>
55+
<Match when={activeStep() === INIT_WIZARD_STEPS.ADVANCED_BOARD_OPTIONS}>
4856
<Card
4957
icon={BiRegularChip}
5058
onClickBack={() => {
@@ -54,15 +62,9 @@ const SetupWizard = () => {
5462
})
5563
}}
5664
isActive
57-
primaryButtonLabel="Install openiris"
58-
onClickPrimary={() => {
59-
batch(() => {
60-
setAction(ACTION.NEXT)
61-
setStep(INIT_WIZARD_STEPS.SELECT_BOARD)
62-
})
63-
}}
64-
label="Select process">
65-
<div class="w-full flex-col flex gap-12 h-full ">
65+
label="Advanced board options"
66+
description="Additional utilities for updating your boards config after flashing">
67+
<div class="w-full flex-col flex gap-12 h-full">
6668
<Button
6769
label="Change device mode"
6870
onClick={() => {
@@ -93,7 +95,7 @@ const SetupWizard = () => {
9395
onClickBack={() => {
9496
batch(() => {
9597
setAction(ACTION.PREV)
96-
setStep(INIT_WIZARD_STEPS.SELECT_PROCESS)
98+
setStep(INIT_WIZARD_STEPS.PROCESS_INIT)
9799
})
98100
}}
99101
onClickPrimary={() => {

src/containers/FlashWizard/WiredWizard/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ const WiredWizard = () => {
9898
let cleanedName = name.replace(/^\s+/, '').replace(/\s+/g, ' ')
9999
setTrackerName(cleanedName)
100100
}}
101-
placeholder="Enter your wifi name"
101+
placeholder="Enter your tracker name"
102102
value={trackerName()}
103103
/>
104104
</div>

src/store/actions/animation/verifyPortConnection.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
WIRED_WIZARD_STEPS,
66
WIRELESS_WIZARD_STEPS,
77
} from '@interfaces/animation/enums'
8+
import { NOTIFICATION_TYPE } from '@interfaces/notifications/enums'
89
import { getApi } from '@src/esp'
910
import { DeviceMode } from '@src/esp/interfaces/types'
1011
import { logger } from '@src/logger'
@@ -14,6 +15,7 @@ import { setActivePort } from '@store/esp/esp'
1415
import { activePort } from '@store/esp/selectors'
1516
import { setAvailableNetworks } from '@store/network/network'
1617
import { batch } from 'solid-js'
18+
import { addNotification } from '../notifications/addNotification'
1719

1820
export const verifyPortConnection = async (isLocked: boolean = false, mode?: DeviceMode) => {
1921
batch(() => {
@@ -71,6 +73,11 @@ export const verifyPortConnection = async (isLocked: boolean = false, mode?: Dev
7173
}
7274
} catch (err) {
7375
batch(() => {
76+
addNotification({
77+
message: "Port verification failed. Make sure you've replugged the board",
78+
title: 'Port verification failed',
79+
type: NOTIFICATION_TYPE.ERROR,
80+
})
7481
logger.errorStart('Verify Port connection ERROR')
7582
logger.add(err instanceof Error ? err.message : `${err}`)
7683
logger.errorEnd('Verify Port connection ERROR')

src/store/actions/notifications/addNotification.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ export const addNotification = (notification: Notifications) => {
2525
const { message, type } = notification
2626

2727
const toastOptions = {
28-
style: { background: '#0D1B26', color: '#fff', border: '1px solid #192736' },
28+
style: {
29+
background: '#0D1B26',
30+
color: '#fff',
31+
border: '1px solid #192736',
32+
textAlign: 'left',
33+
},
2934
actionButtonStyle: {
3035
background: '#192736',
3136
border: '1px solid #192736',

src/styles/index.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,7 @@ body {
7777
background-color 0.5s;
7878
color: #a8b1ff;
7979
}
80+
81+
.my-custom-toast {
82+
text-align: left;
83+
}

src/types/animation/enums.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export enum ACTION {
3030
}
3131

3232
export enum STEP_ACTION {
33+
ADVANCED_BOARD_OPTIONS = 'ADVANCED_BOARD_OPTIONS',
3334
CHANGE_DEVICE_MODE = 'CHANGE_DEVICE_MODE',
3435
INSTALL_OPENIRIS = 'INSTALL_OPENIRIS',
3536
SELECT_NETWORK = 'SELECT_NETWORK',
@@ -39,7 +40,7 @@ export enum STEP_ACTION {
3940

4041
export enum INIT_WIZARD_STEPS {
4142
PROCESS_INIT = 'PROCESS_INIT',
42-
SELECT_PROCESS = 'SELECT_PROCESS',
43+
ADVANCED_BOARD_OPTIONS = 'ADVANCED_BOARD_OPTIONS',
4344
SELECT_BOARD = 'SELECT_BOARD',
4445
}
4546

0 commit comments

Comments
 (0)