Skip to content

Commit b3803a7

Browse files
authored
enhanched onboarding experience (#32)
* Added option to skip the selecting phase * Added warning for docker desktop settings * changed the filter for error toast * changed default os/user if previously selected * applied review suggestions
1 parent f5bcb0d commit b3803a7

File tree

10 files changed

+296
-218
lines changed

10 files changed

+296
-218
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
IMAGE?=localstack/localstack-docker-desktop
2-
TAG?=0.3.2
2+
TAG?=0.4.1
33

44
BUILDER=buildx-multi-arch
55

ui/src/App.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { ReactElement, useState } from 'react';
22
import { createStyles, makeStyles } from '@mui/styles';
3-
import { ControlledTabPanels, Header, LogsPage, MountPointForm, ConfigPage, StatusPage } from './components';
4-
import { useDDClient, useMountPoint } from './services/hooks';
3+
import { ControlledTabPanels, Header, LogsPage, ConfigPage, StatusPage, SettingsForm } from './components';
4+
import { useMountPoint } from './services/hooks';
55

66
const useStyles = makeStyles(() => createStyles({
77
sticky: {
@@ -13,15 +13,12 @@ const useStyles = makeStyles(() => createStyles({
1313

1414
export const App = (): ReactElement => {
1515
const [selected, setSelected] = useState<number>(0);
16-
const { user, os } = useMountPoint();
16+
const { showForm, showSetupWarning } = useMountPoint();
1717
const classes = useStyles();
18-
const ddClient = useDDClient();
19-
const userMissing = !user;
20-
const shouldDialogOpen = ddClient.host.platform === 'win32' ? !os || userMissing : userMissing;
2118

2219
return (
2320
<>
24-
{shouldDialogOpen && <MountPointForm />}
21+
{showForm && <SettingsForm initialState={showSetupWarning ? 0 : 1} />}
2522
<div className={classes.sticky}>
2623
<Header />
2724
</div>

ui/src/components/Header/Controller.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,24 @@ import {
88
LATEST_IMAGE,
99
START_ARGS,
1010
FLAGS,
11-
ERROR_USER,
1211
} from '../../constants';
1312
import { LongMenu } from './Menu';
1413
import { DockerContainer, DockerImage } from '../../types';
1514
import { DownloadProgressDialog } from '../Feedback/DownloadProgressDialog';
1615
import { ProgressButton } from '../Feedback';
1716

18-
const EXCLUDED_ERROR_TOAST = ['Successfully activated API key', 'Execution of "prepare_host"', 'DEBUG'];
17+
const EXCLUDED_ERROR_TOAST = ['INFO', 'WARN', 'DEBUG'];
1918

2019
export const Controller = (): ReactElement => {
21-
const ddClient = useDDClient();
2220
const { runConfig, isLoading, createConfig } = useRunConfig();
2321
const { data, mutate } = useLocalStack();
22+
const { user, os, hasSkippedConfiguration } = useMountPoint();
2423
const [runningConfig, setRunningConfig] = useState<string>('Default');
25-
const isRunning = data && data.State === 'running';
26-
const { user, os } = useMountPoint();
2724
const [downloadProps, setDownloadProps] = useState({ open: false, image: LATEST_IMAGE });
2825
const [isStarting, setIsStarting] = useState<boolean>(false);
2926
const [isStopping, setIsStopping] = useState<boolean>(false);
30-
27+
const ddClient = useDDClient();
28+
const isRunning = data && data.State === 'running';
3129
const isUnhealthy = data && data.Status.includes('unhealthy');
3230
const tooltipLabel = isUnhealthy ? 'Unhealthy' : 'Healthy';
3331

@@ -43,7 +41,7 @@ export const Controller = (): ReactElement => {
4341
const buildMountArg = () => {
4442
let location = 'LOCALSTACK_VOLUME_DIR=/tmp/localstack/volume';
4543

46-
if (user !== ERROR_USER) {
44+
if (!hasSkippedConfiguration) {
4745
switch (ddClient.host.platform) {
4846
case 'win32':
4947
location = `LOCALSTACK_VOLUME_DIR=\\\\wsl$\\${os}\\home\\${user}\\.cache\\localstack\\volume`;

ui/src/components/Views/Configs/ConfigPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const useStyles = makeStyles((theme: Theme) => createStyles({
1919
export const ConfigPage = (): ReactElement => {
2020

2121
const { runConfig, deleteConfig } = useRunConfig();
22-
const { deleteMountPointData } = useMountPoint();
22+
const mountPoint = useMountPoint();
2323
const [openModal, setOpenModal] = useState<boolean>(false);
2424
const [targetConfig, setTargetConfig] = useState<RunConfig | null>(null);
2525

@@ -82,7 +82,7 @@ export const ConfigPage = (): ReactElement => {
8282
>
8383
New
8484
</Button>
85-
<Button onClick={deleteMountPointData}>
85+
<Button onClick={() => mountPoint.setMountPointData({ ...mountPoint, showForm: true })}>
8686
Change mount point
8787
</Button>
8888
</ButtonGroup>

ui/src/components/Views/Configs/MountPointForm.tsx

Lines changed: 0 additions & 192 deletions
This file was deleted.

0 commit comments

Comments
 (0)