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 file extension type column to shared data card for files #1660

Merged
merged 5 commits into from
Mar 22, 2024

Conversation

knipec
Copy link
Contributor

@knipec knipec commented Mar 20, 2024

Description

In the "Shared Files and Links" section, shared files now display a column with the file extension type.
This addresses GitHub Issue #1551.

Checklist

  • New tests added
  • Verified on mobile
  • Verified on desktop

Related Issues

Will file some other issues found in the process of looking at this, but not directly related. One on grid layout particulars, one on localization, and one on edit description save button.

Verification steps

  1. Go to a landscape and scroll down to the "Shared Files and Links" card
  2. Add files if there aren't any already
  3. Confirm there is a column for the file extension type, that it displays the correct file extension, that it looks ok on different size screens

Aside

  • The fileSize and resourceType props are only relevant for SharedDataEntryFile, but the concepts exist in SharedDataEntryBase (previously, there was just one prop that was also only relevant for SharedDataEntryFile, but was more generally named 'info')

@knipec knipec requested review from paulschreiber and josebui March 20, 2024 23:08
@paulschreiber
Copy link
Member

@knipec I recommend transforming the text to uppercase in the view layer. This also avoids the null dereference causing test failures.

@paulschreiber paulschreiber self-requested a review March 21, 2024 21:10
@knipec knipec merged commit 8d661ac into main Mar 22, 2024
9 of 10 checks passed
@knipec knipec deleted the feature/shared-file-type branch March 22, 2024 20:43
knipec added a commit that referenced this pull request Apr 2, 2024
)

Displaying the domain was tied to the info prop. The bug was caused when I removed/renamed info, such that it then only applied to files, and failed to pass the domain info through for links.
The info concept is now replaced by InfoComponent -- whose implementation will differ for files and links, as they will show different info with different layouts.

Fixes #1690 
(which was caused by #1660)

Commits:
* fix: Display domain url for links in shared files again

* refactor: create InfoComponent for Link and File, instead of conditional logic in Base

* refactor: Wrap InfoComponent in a Grid item and change the file and link implementations with respect to that parent Grid item

It's not quite a refactor because the spacing changes very slightly, but I'm just gonna call it a refactor.

* chore: Clean up comments

* test: Add test that the expected items are in the shared data entries for files and links

* refactor: Change Grid container to React fragment
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