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

Feat: Add placeholder icons for file upload preview #21

Merged
merged 4 commits into from
Jan 26, 2024

Conversation

wilwong89
Copy link
Collaborator

Description

In the screen displaying uploaded files, have a placeholder image preview of the file based on file extension.
Several SVG files uploaded
DocumentCard.vue component updated to display different svg placeholder based on extension

Types of changes

New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING doc
  • I have checked that unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

Copy link

Coverage Report (Application)

Totals Coverage
Statements: 43.57% ( 61 / 140 )
Methods: 26.32% ( 5 / 19 )
Lines: 60.76% ( 48 / 79 )
Branches: 19.05% ( 8 / 42 )

Copy link

github-actions bot commented Jan 24, 2024

Coverage Report (Frontend)

Totals Coverage
Statements: 34.45% ( 185 / 537 )
Methods: 34.95% ( 36 / 103 )
Lines: 40% ( 118 / 295 )
Branches: 22.3% ( 31 / 139 )

@TimCsaky
Copy link
Contributor

not sure why.. but an file.xlsx i uploaded is showing with the 'image' icon.

.. separate conversation but i wonder if we should base the icon on the mimeType (https://www.digipres.org/formats/mime-types/) which is available in pcns db.
i guess it's not 100 reliable but it is more accurate than the extension i believe because it looks at the encoding of the file.. where the extension can be anything.

@wilwong89 wilwong89 force-pushed the feat/list-attach-docs branch from 520723a to df572e2 Compare January 24, 2024 19:58
@wilwong89 wilwong89 marked this pull request as ready for review January 25, 2024 00:23
Moved logic for mimetype detection to a utils function.

Files changed:
utils.ts
DocumentCard.vue
@wilwong89 wilwong89 force-pushed the feat/list-attach-docs branch from a8e4d53 to 3daeba4 Compare January 25, 2024 18:29
@wilwong89 wilwong89 force-pushed the feat/list-attach-docs branch from 3ca0ca9 to 5a8c935 Compare January 25, 2024 21:53
@kyle1morel kyle1morel merged commit da369ab into master Jan 26, 2024
18 of 20 checks passed
@kyle1morel kyle1morel deleted the feat/list-attach-docs branch January 26, 2024 21:02
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.

3 participants