Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

204 feature create form template upload pdf page #207

Merged
merged 13 commits into from
Nov 30, 2024

Conversation

laurenbrissette
Copy link
Contributor

Description

Created an upload page for the first step in form template process. Allows users to browse or drag pdf.

Motivation and Context

Implement redesigns for form template creation flow.

Closes [#204 ]

How has this been tested?

Tried dragging and browsing for files. Upload size and title were correctly saved/displayed. Styles were inspected and spacing matches Figma.

Screenshots (if appropriate):

Screenshot 2024-11-28 at 4 16 03 PM Screenshot 2024-11-28 at 4 16 20 PM

Not shown in pictures but on the next page, the upload step will display as a blue check mark in the sidebar.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Since this redirects users creating a form template to the start of the new flow, and the other pages are not finished yet, we will not be able to create new templates using this flow until the others are implemented.

The previous modal was not deleted, there are just no links to it right now.

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link

vercel bot commented Nov 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mfa-form-automator ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 30, 2024 5:21pm

Copy link
Collaborator

@kaiyangzheng kaiyangzheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some comments + make sure to delete package-lock.json and cd into apps/web and use yarn add react-dropzone to add the package. I think package-lock.json shows up when you use npm install and we only want to use one package manager for the project.

* @param backLink page router will push on click of 'back'
* @param disabled whether the 'save & continue' button should be activated
*/
export const FormTemButtons = ({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's name this FormTemplateButtons for clarity.

import { BlueTriangle, WhiteCheck } from '@web/static/icons';
import { useRouter } from 'next/router';

export const SideCreateForm = ({ curStep }: { curStep: number }) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥


export default function Upload() {
const router = useRouter();
const [pdf, setPdf] = useState<string | ArrayBuffer | null>(null);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to pull from main (git pull origin main) and use the useBlob hook's localBlobData state and uploadLocalBlob and clearLocalBlob functions to do operations regarding storing PDF data in state.

</Text>
</Flex>
<input
type="file"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should also be able to use inputFileRef from useBlob here for upload to cloud storage at the end (Review step probably)

Changes to blob:
- includes size as a string for form display on upload page
- takes a file rather than a change event because dropbox processes change events and gives a list of accepted files
@kaiyangzheng kaiyangzheng merged commit c5bdbd9 into main Nov 30, 2024
7 checks passed
@kaiyangzheng kaiyangzheng deleted the 204-feature-create-form-template-upload-pdf-page branch November 30, 2024 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Create Form Template Upload PDF page
2 participants