diff --git a/.github/workflows/_terraform-apply.yml b/.github/workflows/_terraform-apply.yml index 9988a8f8..8f4ddb87 100644 --- a/.github/workflows/_terraform-apply.yml +++ b/.github/workflows/_terraform-apply.yml @@ -28,7 +28,7 @@ jobs: node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }} - name: Install pnpm - uses: pnpm/action-setup@v2 + uses: pnpm/action-setup@v4 id: pnpm-install with: version: 8 diff --git a/.github/workflows/_terraform-plan-pr-comment.yml b/.github/workflows/_terraform-plan-pr-comment.yml index b98ca1b5..5340be84 100644 --- a/.github/workflows/_terraform-plan-pr-comment.yml +++ b/.github/workflows/_terraform-plan-pr-comment.yml @@ -30,7 +30,7 @@ jobs: node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }} - name: Install pnpm - uses: pnpm/action-setup@v2 + uses: pnpm/action-setup@v4 id: pnpm-install with: version: 8 diff --git a/.github/workflows/_validate.yml b/.github/workflows/_validate.yml index c676e3f5..7acb5b7c 100644 --- a/.github/workflows/_validate.yml +++ b/.github/workflows/_validate.yml @@ -22,7 +22,7 @@ jobs: node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }} - name: Install pnpm - uses: pnpm/action-setup@v2 + uses: pnpm/action-setup@v4 id: pnpm-install with: version: 8 diff --git a/README.md b/README.md index f8c1d17a..50e5a97f 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,12 @@ The platform is made up of the following high-level terms. ## Development +This project uses the version of Node.js defined in [.nvmrc](./nvmrc). To ensure you're using the correct node version, you may use the [Node Version Manager (NVM)](https://github.com/nvm-sh/nvm): + +```bash +nvm install +``` + This project uses [pnpm workspaces](https://pnpm.io/workspaces). To work with this project, [install pnpm](https://pnpm.io/installation) and then the project dependencies: ```bash diff --git a/packages/design/src/FormManager/FormEdit/AddPatternDropdown.tsx b/packages/design/src/FormManager/FormEdit/AddPatternDropdown.tsx index d44bbbfa..e5c396e6 100644 --- a/packages/design/src/FormManager/FormEdit/AddPatternDropdown.tsx +++ b/packages/design/src/FormManager/FormEdit/AddPatternDropdown.tsx @@ -172,22 +172,22 @@ export const FieldsetAddPatternButton = ({ isOpen={isOpen} patternSelected={patternSelected} > - - - {' '} setIsOpen(!isOpen)} > + + + {' '} {title} diff --git a/packages/design/src/FormManager/FormEdit/components/PageEdit.tsx b/packages/design/src/FormManager/FormEdit/components/PageEdit.tsx index 24f93e16..bca11468 100644 --- a/packages/design/src/FormManager/FormEdit/components/PageEdit.tsx +++ b/packages/design/src/FormManager/FormEdit/components/PageEdit.tsx @@ -5,6 +5,7 @@ import { PageProps } from '@atj/forms'; import { en as message } from '@atj/common/src/locales/en/app'; import { PagePattern } from '@atj/forms/src/patterns/page/config'; +import { useRouteParams } from '../../../FormRouter/hooks'; import { PatternEditComponent } from '../types'; import { PatternEditActions } from './common/PatternEditActions'; @@ -23,6 +24,10 @@ export const PageEdit: PatternEditComponent = props => { } }; + const { routeParams } = useRouteParams(); + const params = new URLSearchParams(routeParams?.toString()); + const pageNumberText = Number(params.get('page')) + 1; + return ( <> {props.focus ? ( @@ -45,7 +50,7 @@ export const PageEdit: PatternEditComponent = props => { - Page X + Page {pageNumberText} )} diff --git a/packages/design/src/FormManager/FormEdit/components/PageSetEdit.stories.tsx b/packages/design/src/FormManager/FormEdit/components/PageSetEdit.stories.tsx index a8fa12c6..ac6185c7 100644 --- a/packages/design/src/FormManager/FormEdit/components/PageSetEdit.stories.tsx +++ b/packages/design/src/FormManager/FormEdit/components/PageSetEdit.stories.tsx @@ -21,9 +21,10 @@ export default storyConfig; export const Basic: StoryObj = { play: async ({ canvasElement }) => { const canvas = within(canvasElement); + const pagesetHeaderElement = await canvas.findByText(/Page 1/); await testUpdateFormFieldOnSubmitByElement( canvasElement, - await canvas.findByText('Page X'), + pagesetHeaderElement, 'Page title', 'Page 1 updated' ); diff --git a/packages/design/src/FormManager/FormEdit/components/PreviewSequencePattern/DraggableList.tsx b/packages/design/src/FormManager/FormEdit/components/PreviewSequencePattern/DraggableList.tsx index 7be2f102..c3484148 100644 --- a/packages/design/src/FormManager/FormEdit/components/PreviewSequencePattern/DraggableList.tsx +++ b/packages/design/src/FormManager/FormEdit/components/PreviewSequencePattern/DraggableList.tsx @@ -111,12 +111,15 @@ const SortableItemOverlay = ({ children }: { children: React.ReactNode }) => { style={{ boxShadow: '0 16px 24px rgba(0, 0, 0, 0.4)', cursor: 'grabbing', + outline: '0.25rem solid #783cb9', }} > - + { type: 'page', id: 'page-1', data: { - title: 'Page 1', + title: 'First page', patterns: ['element-1', 'element-2'], }, } satisfies PagePattern, @@ -93,7 +93,7 @@ export const createTwoPageTwoPatternTestForm = () => { type: 'page', id: 'page-2', data: { - title: 'Page 2', + title: 'Second page', patterns: [], }, } satisfies PagePattern,