Skip to content

Conversation

@aasandei-vsp
Copy link
Contributor

@aasandei-vsp aasandei-vsp commented Nov 17, 2025

The public gallery links were not generating correctly, because the endpoint for getting the record has changed and the property used to create it, ParentFolderVOs, is not present anymore. Ideally we would fix the backend, but for now this will do the job. One exception is, the link for records that are in the root folder will have 2 extra parameters, but they will work.

Check the issue bellow for more details on how this should be tackled on BE.

Issue: PER-10348 Get public gallery link not working for individual records

STEPS TO TEST:
Root record

  1. Create a new account or log in to an existing one
  2. Upload a file or click an existing one
  3. Publish the file
  4. Go to public files and click the record you just published
  5. Click Get link
    EXPECTED: A modal with a generated link will appear
  6. Click copy link from the modal
  7. Paste the link in a new tab/window
    EXPECTED:
  • The record preview should load
  • You should be able to see all the details
  • You should be able to see the left and right arrows if there are multiple records in the root folder

Folder

  1. Create a new account or log in to an existing one
  2. Create a folder or use an existing one
  3. Upload files in the folder or use existing ones
  4. Publish the folder
  5. Go to public files and click the folder you just published
  6. Click Get link
    EXPECTED: A modal with a generated link will appear
  7. Click copy link from the modal
  8. Paste the link in a new tab/window
    EXPECTED:
  • The folder preview should load
  • You should be able to click the files and preview them
  • You should be able to see the left and right arrows if there are multiple files in the folder

Record in folder

  1. Create a new account or log in to an existing one
  2. Create a folder or use an existing one
  3. Upload files in the folder or use existing ones
  4. Publish the folder
  5. Go to public files and click the folder you just published
  6. Click one of the files in the folder
  7. Click Get link
    EXPECTED: A modal with a generated link will appear
  8. Click copy link from the modal
  9. Paste the link in a new tab/window
    EXPECTED:
  • The record preview should load
  • You should be able to see all the details
  • You should be able to see the left and right arrows if there are multiple records in the parent folder
  • You should be able to hit the back arrow and get to the preview of the parent folder

@codecov
Copy link

codecov bot commented Nov 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 47.06%. Comparing base (fa260c0) to head (c8e7950).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #820      +/-   ##
==========================================
- Coverage   47.06%   47.06%   -0.01%     
==========================================
  Files         372      372              
  Lines       11492    11495       +3     
  Branches     1907     1909       +2     
==========================================
+ Hits         5409     5410       +1     
  Misses       5897     5897              
- Partials      186      188       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aasandei-vsp aasandei-vsp force-pushed the PER-10348-fix-public-link-for-records branch from d96be6a to 1928e24 Compare November 17, 2025 11:02
@aasandei-vsp aasandei-vsp self-assigned this Nov 17, 2025
value.parentFolderArchiveNumber &&
value.parentFolder_linkId &&
rootArchive !== value.parentFolderArchiveNumber
) {
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens from a UX PoV if this else block's logical conditions are not met? Do we need to cover that case somehow?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The parent folder is not added to the root, so the user will land on the public folder. Maybe this should be done indeed better, but I do think it is out of the scope of this bug.

Copy link
Member

@cecilia-donnelly cecilia-donnelly left a comment

Choose a reason for hiding this comment

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

Agreed with @slifty's point about the backend response intentionally being smaller. I'm impressed you were able to work around this, @aasandei-vsp! I do wonder if the extra parameters mean that old links would now be broken. Do you know? I don't think I have one handy unfortunately.

@aasandei-vsp
Copy link
Contributor Author

aasandei-vsp commented Nov 19, 2025

@cecilia-donnelly @slifty Sorry, I only added this on the story, forgot to put it on the PR:

I have managed to find a fix for the issue, however, it is not ideal. The right way would be to get the ParentFolderVOs property from the BE, when we call v2/record.
This property is needed in the “src/app/shared/pipes/public-route.pipe.ts” file, to get the following properties: archiveNbr, folder_linkId, folder_linkType, type of the parent.

With the current fix, links are generated and they work.

But there is an exception!
When the link is created for a record that is in the root, properties parentFolderArchiveNumber and parentFolderLinkId are different from the ones of the root, so an extra 2 parameters are added to the root.
EXAMPLE:

!!Both versions of the link work ok.

TL:DR The old links should work too!

Copy link
Member

@cecilia-donnelly cecilia-donnelly left a comment

Choose a reason for hiding this comment

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

This works! Thanks @aasandei-vsp. Agreed with @slifty's comments about opening an issue and pointing to it from the comment.

@aasandei-vsp aasandei-vsp force-pushed the PER-10348-fix-public-link-for-records branch from 1928e24 to c5ab1d6 Compare November 20, 2025 16:45
@slifty slifty added good first issue Good for newcomers QA This issue is ready for QA / user acceptance testing and removed good first issue Good for newcomers labels Nov 24, 2025
Copy link
Member

@omnignorant omnignorant left a comment

Choose a reason for hiding this comment

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

This appears to be working as expected now!

The public gallery links were not generating correctly, because the
endpoint for getting the record has changed and the property used to
create it, ParentFolderVOs, is not present anymore.
In order to create the record links, parent properties present on the
record object can be used.
One exception is, the link for records that are in the root folder
will have 2 extra parameters, but they will work.

Issue: PER-10348 Get public gallery link not working for individual records
@aasandei-vsp aasandei-vsp force-pushed the PER-10348-fix-public-link-for-records branch from c5ab1d6 to c8e7950 Compare December 2, 2025 08:34
@aasandei-vsp aasandei-vsp merged commit d867a9e into main Dec 2, 2025
9 checks passed
@aasandei-vsp aasandei-vsp deleted the PER-10348-fix-public-link-for-records branch December 2, 2025 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

QA This issue is ready for QA / user acceptance testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants