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

Sveltekit upload #476

Merged
merged 64 commits into from
Apr 16, 2024
Merged

Sveltekit upload #476

merged 64 commits into from
Apr 16, 2024

Conversation

eyeseast
Copy link
Collaborator

@eyeseast eyeseast commented Mar 21, 2024

Closes #464
Closes #506
Closes #482

Backend methods:

  • create documents
  • upload files
  • process documents
  • redirect on success

Frontend:

  • action in +page.server.ts
  • upload form component
  • form on +page.svelte
  • layout updates to handle two-column form
  • style
  • form property to handle success or error states
  • pass in user projects for select field
  • document and tell user the upload limit

Tests and demos:

  • unit tests for backend methods
  • component test for upload form
  • storybook for upload form

Copy link

netlify bot commented Mar 21, 2024

Deploy Preview for documentcloud-frontend ready!

Name Link
🔨 Latest commit f772b1e
🔍 Latest deploy log https://app.netlify.com/sites/documentcloud-frontend/deploys/661ebe6088fa430008d0d7b1
😎 Deploy Preview https://deploy-preview-476.muckcloud.com
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@allanlasser allanlasser left a comment

Choose a reason for hiding this comment

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

Phew, big review! Overall looks great, I'm gonna jump into the branch to add a little extra styling and write some tests. I expect this should be in shape to merge Monday.

src/lib/api/documents.test.ts Outdated Show resolved Hide resolved
src/lib/components/forms/DocumentUpload.svelte Outdated Show resolved Hide resolved
src/routes/app/sidebar/Projects.svelte Outdated Show resolved Hide resolved
src/routes/app/upload/+layout.ts Outdated Show resolved Hide resolved
src/routes/app/upload/[email protected] Show resolved Hide resolved
@eyeseast eyeseast requested a review from allanlasser April 16, 2024 14:59
Copy link

github-actions bot commented Apr 16, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 34.6% 2116 / 6114
🔵 Statements 34.6% 2116 / 6114
🔵 Functions 22.22% 30 / 135
🔵 Branches 39.13% 63 / 161
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
src/lib/api/accounts.ts 100% 100% 100% 100%
src/lib/api/documents.ts 84.81% 90% 81.25% 84.81% 23-49, 55-70, 102-103, 165
src/lib/api/projects.js 44% 100% 0% 44% 24-43, 54-75
src/lib/api/types.d.ts 0% 0% 0% 0% 1-202
src/lib/components/common/Button.svelte 100% 50% 100% 100%
src/lib/components/common/Field.svelte 100% 62.5% 100% 100%
src/lib/components/common/FieldLabel.svelte 100% 33.33% 100% 100%
src/lib/components/common/Flex.svelte 100% 80% 100% 100%
src/lib/components/common/Premium.svelte 100% 0% 100% 100%
src/lib/components/documents/DocumentListItem.svelte 100% 50% 100% 100%
src/lib/components/forms/DocumentUpload.svelte 100% 12.5% 0% 100%
src/lib/components/inputs/AccessLevel.svelte 100% 100% 100% 100%
src/lib/components/inputs/Dropzone.svelte 100% 100% 100% 100%
src/lib/components/inputs/File.svelte 100% 0% 100% 100%
src/lib/components/inputs/Language.svelte 100% 100% 100% 100%
src/lib/components/inputs/Select.svelte 100% 100% 100% 100%
src/lib/components/inputs/Switch.svelte 100% 100% 100% 100%
src/lib/components/inputs/Text.svelte 100% 100% 100% 100%
src/lib/components/sidebar/SidebarItem.svelte 0% 0% 0% 0% 1-100
src/lib/utils/files.ts 100% 100% 100% 100%
src/lib/utils/isOrg.ts 0% 0% 0% 0% 1-6
src/routes/+layout.ts 0% 0% 0% 0% 1-28
src/routes/app/+layout.ts 0% 0% 0% 0% 1-14
src/routes/app/+page.svelte 0% 0% 0% 0% 1-79
src/routes/app/sidebar/Documents.svelte 0% 0% 0% 0% 1-63
src/routes/app/sidebar/Projects.svelte 0% 0% 0% 0% 1-42
src/routes/app/upload/+layout.ts 0% 0% 0% 0% 1-24
src/routes/app/upload/[email protected] 0% 0% 0% 0% 1-20
src/routes/app/upload/+page.server.ts 0% 0% 0% 0% 1-28
src/routes/app/upload/+page.svelte 0% 0% 0% 0% 1-63
Generated in workflow #11

Copy link
Member

@allanlasser allanlasser left a comment

Choose a reason for hiding this comment

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

Just one last piece of feedback on the documents.test.ts. I think asserting that fetch is called correctly is critical to the validity of the function.

src/lib/api/documents.test.ts Show resolved Hide resolved
@eyeseast eyeseast merged commit 27e634e into sveltekit Apr 16, 2024
9 of 10 checks passed
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.

2 participants