Skip to content

Commit

Permalink
update: removes upload step stage, updates copy for create, configure
Browse files Browse the repository at this point in the history
  • Loading branch information
mpflex committed Feb 25, 2025
1 parent b51307e commit 18d2c47
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ const meta: Meta<typeof FormManagerLayout> = {
export default meta;
export const Configure = {
args: {
step: NavPage.configure,
step: NavPage.settings,
next: '#',
},
} satisfies StoryObj<typeof FormManagerLayout>;

export const Create = {
export const Edit = {
args: {
step: NavPage.create,
step: NavPage.edit,
next: '#',
back: '#',
preview: '#',
Expand All @@ -55,12 +55,3 @@ export const Publish = {
preview: '#',
},
} satisfies StoryObj<typeof FormManagerLayout>;

export const Upload = {
args: {
step: NavPage.upload,
next: '#',
back: '#',
preview: '#',
},
} satisfies StoryObj<typeof FormManagerLayout>;
32 changes: 10 additions & 22 deletions packages/design/src/FormManager/FormManagerLayout/TopNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ import { useFormManagerStore } from '../store.js';
import styles from './formManagerStyles.module.css';

export enum NavPage {
upload = 1,
create = 2,
configure = 3,
publish = 4,
preview = 5,
edit = 1,
settings = 2,
publish = 3,
preview = 4,
}

const stepClass = (page: NavPage, curPage: NavPage) => {
Expand Down Expand Up @@ -66,35 +65,25 @@ export const TopNavigation = ({
<MyFormsLink uswdsRoot={uswdsRoot} />
</div>
<ol className="usa-step-indicator__segments desktop:grid-col-6 tablet:grid-col-5">
<li
className={classNames(
'usa-step-indicator__segment',
stepClass(NavPage.upload, curPage)
)}
>
<span className="usa-step-indicator__segment-label">
Upload {srHint(NavPage.upload, curPage)}
</span>
</li>
<li
className={classNames(
'usa-step-indicator__segment font-body-xs',
stepClass(NavPage.create, curPage)
stepClass(NavPage.edit, curPage)
)}
>
<span className="usa-step-indicator__segment-label">
Create {srHint(NavPage.create, curPage)}
Edit {srHint(NavPage.edit, curPage)}
</span>
</li>
<li
className={classNames(
'usa-step-indicator__segment font-body-xs',
stepClass(NavPage.configure, curPage)
stepClass(NavPage.settings, curPage)
)}
aria-current="true"
>
<span className="usa-step-indicator__segment-label">
Configure {srHint(NavPage.configure, curPage)}
Settings {srHint(NavPage.settings, curPage)}
</span>
</li>
<li
Expand Down Expand Up @@ -191,9 +180,8 @@ const MobileStepIndicator = ({ curPage }: { curPage: NavPage }) => (
id="options"
defaultValue={curPage}
>
<option value={NavPage.upload}>Upload</option>
<option value={NavPage.create}>Create</option>
<option value={NavPage.configure}>Configure</option>
<option value={NavPage.edit}>Create</option>
<option value={NavPage.settings}>Configure</option>
<option value={NavPage.publish}>Publish</option>
</select>
</div>
Expand Down
4 changes: 2 additions & 2 deletions packages/design/src/FormManager/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export default function FormManager(props: FormManagerProps) {
savePeriodically={true}
>
<FormManagerLayout
step={NavPage.create}
step={NavPage.edit}
back={AppRoutes.GuidedFormCreation.getUrl()}
next={AppRoutes.Configure.getUrl(formId)}
preview={AppRoutes.Preview.getUrl(formId)}
Expand Down Expand Up @@ -201,7 +201,7 @@ export default function FormManager(props: FormManagerProps) {
session={createFormSession(form)}
>
<FormManagerLayout
step={NavPage.configure}
step={NavPage.settings}
back={AppRoutes.Create.getUrl(formId)}
next={AppRoutes.Publish.getUrl(formId)}
preview={AppRoutes.Preview.getUrl(formId)}
Expand Down

0 comments on commit 18d2c47

Please sign in to comment.