[ENG-9958] Files in draft registrations cannot be previewed#957
Draft
mkovalua wants to merge 3 commits intoCenterForOpenScience:feature/pbs-26-6from
Draft
[ENG-9958] Files in draft registrations cannot be previewed#957mkovalua wants to merge 3 commits intoCenterForOpenScience:feature/pbs-26-6from
mkovalua wants to merge 3 commits intoCenterForOpenScience:feature/pbs-26-6from
Conversation
nsemets
requested changes
Apr 17, 2026
Comment on lines
+163
to
+168
| if (this.draftId() && file.guid) { | ||
| const url = this.router.serializeUrl( | ||
| this.router.createUrlTree(['registries', 'drafts', this.draftId(), 'files', file.guid]) | ||
| ); | ||
| window.open(url, '_blank'); | ||
| } |
Collaborator
There was a problem hiding this comment.
It is better to move in custom-step.component.ts.
| projectId = input.required<string>(); | ||
| provider = input.required<string>(); | ||
| filesViewOnly = input<boolean>(false); | ||
| draftId = input<string>(''); |
| }); | ||
| } | ||
|
|
||
| private readonly router = inject(Router); |
| [filesLink]="filesLink()" | ||
| [projectId]="projectId()" | ||
| [provider]="provider()" | ||
| [draftId]="draftId()" |
Comment on lines
+36
to
+39
| MockProvider(ViewOnlyLinkHelperService, { | ||
| hasViewOnlyParam: () => false, | ||
| getViewOnlyParam: () => null, | ||
| }), |
Collaborator
There was a problem hiding this comment.
Use ViewOnlyLinkHelperMock.simple()
| ], | ||
| }), | ||
| ], | ||
| }).compileComponents(); |
Collaborator
There was a problem hiding this comment.
Suggested change
| }).compileComponents(); | |
| }); |
|
|
||
| it('should set safeLink when getIframeLink is called with a valid render link', () => { | ||
| const mfrUrl = 'https://mfr.osf.io/render?url=https%3A%2F%2Fosf.io%2Fdownload%2Fch7jz%2F'; | ||
| component.file = signal({ links: { render: mfrUrl } }) as any; |
| }); | ||
|
|
||
| it('should not set safeLink when file has no render link', () => { | ||
| component.file = signal({ links: {} }) as any; |
| }); | ||
|
|
||
| it('should return null from getMfrUrlWithVersion when file has no render link', () => { | ||
| component.file = signal({ links: {} }) as any; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Prior to the Angular release, files attached to draft registrations could be previewed directly within the registration. This functionality no longer exists in Angular.
Summary of Changes
open preview url on draft registry file click
Screenshot(s)
Side Effects
QA Notes