Skip to content

[ENG-11452] My Projects Page: Download Button#1018

Open
nsemets wants to merge 8 commits into
CenterForOpenScience:feature/my-projects-improvementsfrom
nsemets:feat/ENG-11452
Open

[ENG-11452] My Projects Page: Download Button#1018
nsemets wants to merge 8 commits into
CenterForOpenScience:feature/my-projects-improvementsfrom
nsemets:feat/ENG-11452

Conversation

@nsemets

@nsemets nsemets commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Summary of Changes

  1. Added download button for project.

Screenshot(s)

image

@nsemets nsemets marked this pull request as ready for review June 22, 2026 11:44
@nsemets nsemets requested a review from brianjgeiger June 22, 2026 11:44
@brianjgeiger

Copy link
Copy Markdown
Contributor

@nsemets Looks like there are some conflicts now.

@nsemets

nsemets commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator Author

@brianjgeiger Fixed conflicts.

Comment on lines +38 to +48
readonly showDownloadColumn = input<boolean>(false);
readonly emptyMessageKey = input<string>('common.search.noResultsFound');
readonly downloadCellTemplate = input<TemplateRef<{ $implicit: MyResourcesItem }>>();

readonly pageChange = output<TablePageEvent>();
readonly sort = output<SortEvent>();
readonly itemClick = output<MyResourcesItem>();

readonly skeletonData = Array.from({ length: 10 }, () => ({}) as MyResourcesItem);

readonly columnCount = computed(() => (this.showDownloadColumn() ? 4 : 3));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

showDownloadColumn and downloadCellTemplate are two inputs that must always be set together if one is passed without the other you get a broken column silently. Since the column only makes sense when a template exists, just drive the @if and columnCount from downloadCellTemplate() directly and drop the boolean input entirely.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It is good point.

Comment on lines +38 to +48
readonly showDownloadColumn = input<boolean>(false);
readonly emptyMessageKey = input<string>('common.search.noResultsFound');
readonly downloadCellTemplate = input<TemplateRef<{ $implicit: MyResourcesItem }>>();

readonly pageChange = output<TablePageEvent>();
readonly sort = output<SortEvent>();
readonly itemClick = output<MyResourcesItem>();

readonly skeletonData = Array.from({ length: 10 }, () => ({}) as MyResourcesItem);

readonly columnCount = computed(() => (this.showDownloadColumn() ? 4 : 3));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The 3 in computed(() => (this.showDownloadColumn() ? 4 : 3)) is a silent assumption about the number of fixed columns. If a column is added later this breaks without warning. Extract it as a named constant: private static readonly BASE_COLUMN_COUNT = 3.


const addonName = getConfiguredStorageAddonDisplayName(configuredAddons, folder.provider, '');

if (!addonName || !folder.links.download) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

OSF Storage correctly hides the option when totalCount === 0, but connected add-ons show regardless of whether they have any files. The requirements say "avoid showing options that would result in empty downloads", an empty add-on zip would violate that. N+1 calls to check each add-on's file count may not be ideal, but worth aligning with product on whether an empty zip download is acceptable before merging.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No, sorry, the requirement is not ideally worded. Only osfstorage should be gated on files being there; the other storage addons, if they are connected, will show the download links, without us checking for files. The assumption being that, if someone has connected an addon, they have probably added a file or more to it.

</th>

@if (showDownloadColumn()) {
<th aria-hidden="true"></th>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I believe <th aria-hidden="true"> hides the column entirely from screen readers. A visually hidden label is better: <th><span class="sr-only">{{ 'common.labels.download' | translate }}</span></th> to keeps it discoverable when navigating the table by column.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think it is better to use [attr.aria-label] here.

@nsemets nsemets requested a review from omar-cos June 25, 2026 14:20
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