-
Notifications
You must be signed in to change notification settings - Fork 1
[PER-10107] Make preview show for unlisted shares #727
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
base: main
Are you sure you want to change the base?
Conversation
Should this use the get record (by stela) that we recently added here: #669 |
This story has the following dependencies, these 2 changes need to go before the preview of unlisted share: Creation of unlisted share(maybe hide it under the feature flag and activate it when the preview will also be available) Getting record/folder information using the share token for authentication |
d8cb7d9
to
d12d5b3
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #727 +/- ##
==========================================
+ Coverage 45.12% 46.46% +1.33%
==========================================
Files 370 371 +1
Lines 11314 11372 +58
Branches 1867 1885 +18
==========================================
+ Hits 5106 5284 +178
+ Misses 6033 5910 -123
- Partials 175 178 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Please ignore files:
They are being thoroughly reviewed in PR: #720, my changes are minimal. Not the best choice, maybe I should have rebased on that branch instead of copy/pasting the files, but I wanted to make sure I'm up to date with main. @slifty @cecilia-donnelly @liam-lloyd Just FYI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is exciting! A few thoughts:
-
Can you write an additional comment (for QA) that describes what should change as the result of this PR? It might also be good for us to create a few unlisted shares (one expired, say, and one with preview on, one with preview off...that kind of thing) on dev.permanent.org for QA purposes.
-
General note: we generally don't have a separate "linting fixes" commit. I like how you've separated out the steps here! In the future when you're creating your commits, try to have each one pass linting separately (that lets reviewers look at them one by one).
-
I don't think this should need to wait for unlisted share creation, since it would only be visible if someone did create an unlisted share. Am I missing something? I'd like to get it merged if we can.
This is a big change! When I first went through I was surprised how many pieces were involved. I think I understand it more now - it seems like a lot of it is for an unlisted share of a folder specifically. Is that right? If so, we should include that in the test plan (mainly what I've referenced in (1), above).
const isUnlistedShare = await this.shareLinksService.isUnlistedShare(); | ||
if (isUnlistedShare) { | ||
itemsToFetch = []; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not entirely sure why we need to check for this in this component, though that's probably my lack of knowledge of the web-app. I expected this component to only be used inside a workspace (that is, the part of the app that a member sees when logged in.) Can you explain?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great catch! We do not need this code anymore, it was for testing purposes. Before using stela to get records, I had to bypass this call in order to test the preview for unlisted shares.
In all honesty, it might actually be redundant in general to make this BE call here, but I did not investigate this enough to make sure that removing it wouldn't break other flows in the app.
this.currentRecord.accessRole, | ||
AccessRole.Editor, | ||
) && !route.snapshot.data?.isPublicArchive; | ||
this.canEdit = this.isUnlistedShare |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
canEdit
might be misleading here, but viewers of an unlisted share can't edit, so I wouldn't expect to have to check that value for editing at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file viewer component is the one that loads when you double-click on a record(the big picture with the details and download button appears). So I have reused it for the unlisted share as well. When you double click on a record thumbnail, the same view loads, but the difference is you cannot edit the details of it, you can only download if you want.
This is the component, when we use it in a private folder to view our records, which we can edit(the link in the browser shows it is from private):
And this is the same component, when we view an unlisted share, but we cannot click on anything but the download button(the link in the browser shows it's a share):
So I do believe the canEdit property makes sense, but let me know your opinion on it.
One specific aspect of "preview" is whether this change should include being able to view a record full size in an unlisted share. That is something we need but might be coming in a future PR (for me, the record is still thumbnail size when I open an unlisted share on this branch). |
9868552
to
248aade
Compare
Maybe I didn't understand the question right or maybe there are some issues locally, but this is the behavior I implemented(just to mention, the details preview opens up at double click):
record-details-preview.webm
|
The change is for both records and folders as unlisted shares, but the code might be a bit misleading, because a lot of components are tied together and contain more logic than they should.
|
Thank you so much @aasandei-vsp! I was able to see that this is working for me locally - I just didn't double click initially, silly. @omnignorant, should we be able to view a record at full size with a single click or is double click fine? Two requests:
Here are the links for QA on dev:
|
95a3e19
to
bf311b1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems right to me! I would appreciate an additional review from @slifty since you've been deep in the folder/record world lately.
Thank you for your hard work, @aasandei-vsp ! One note for QA-ers is that this worked for me in a private (Firefox) window but not my main window (even when logged out) so there might be some caching/data weirdness to look out for.
<div | ||
class="file-list-item" | ||
(click)="onItemClick($event)" | ||
(dblclick)="showUnlistedPreview($event)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer if a single click opened the item full size, but maybe we can't do that because we're already using click
for an event here. How hard would that be?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was a very easy change, so I've done it and rebased. Ready for review and test again!
8b8dc4a
to
1e5da12
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything checks out for me! The unlisted share links are working and so are the restricted ones!
This is the main story tackled here: https://permanent.atlassian.net/browse/PER-10107
This story was more of a collateral need and has been done in this PR as well: https://permanent.atlassian.net/browse/PER-10306
STEPS TO TEST
OBSERVATION: Unlisted share links will be provided, because as of now we do not have a way of creating unlisted shares from the UI.
Record as unlisted share:
Video for reference(can only be viewed in Chrome):
record-unlisted-share-preview-on.webm
Folder as unlisted share:
Video for reference(can only be viewed in Chrome):
folder-unlisted-share-preview-on.webm
Expired unlisted share:
Video for reference(can only be viewed in Chrome):
expired-link.webm
EXTRA TESTS FOR EXISTING SHARE LINK BEHAVIOUR
This tests would be useful to make sure that while developing this new feature, we did not introduce any new bugs or created regressions.
Auto-approve share link:
1 .Create account or sign in to account A
2. Upload a file
3. Create a share link for the uploaded file
4. Copy the link
5. Open a new browser instance
6. Create or sign in to a different account B
8. Paste the link in the browser where the account B is signed in
9. The share link preview will appear, with the "Accept Share" button at the bottom of the screen
Video for reference(can only be viewed in Chrome):
auto-approve-share-link.webm
Request access share link:
1 .Create account or sign in to account A
2. Upload a file
3. Create a share link for the uploaded file
4. Copy the link
5. Open a new browser instance
6. Create or sign in to a different account B
8. Paste the link in the browser where the account B is signed in
9. The share link preview will appear, with the "Request Access" button at the bottom of the screen
Video for reference(can only be viewed in Chrome):
request-access-share-link.webm
Try to access share link with no account:
1 .Create account or sign in to account A
2. Upload a file
3. Create a share link for the uploaded file
4. Copy the link
5. Open a new browser instance in incognito mode
8. Paste the link in the browser
9. The share link preview will appear, with an overlay and a modal asking you to create an account or log in
Video for reference(can only be viewed in Chrome):
no-account-share-link.webm