Skip to content

Commit

Permalink
feat(OY2-26082): package actions multi-file download
Browse files Browse the repository at this point in the history
  • Loading branch information
pkim-gswell committed Jan 12, 2024
1 parent 5c3dd43 commit 43199b8
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ export const PA_InitialSubmission: FC<opensearch.changelog.Document> = (
hook.onUrl(ATC).then(window.open);
}}
>
{hook.loading && (
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
)}
{ATC.filename}
</Button>
</Table.TableCell>
Expand Down Expand Up @@ -93,7 +90,6 @@ export const PA_ResponseSubmitted: FC<opensearch.changelog.Document> = (
hook.onUrl(ATC).then(window.open);
}}
>
{hook.loading && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}
{ATC.filename}
</Button>
))}
Expand Down Expand Up @@ -124,7 +120,6 @@ export const PA_ResponseWithdrawn: FC<opensearch.changelog.Document> = (
hook.onUrl(ATC).then(window.open);
}}
>
{hook.loading && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}
{ATC.filename}
</Button>
))}
Expand Down Expand Up @@ -153,7 +148,6 @@ export const PA_RaiIssued: FC<opensearch.changelog.Document> = (props) => {
hook.onUrl(ATC).then(window.open);
}}
>
{hook.loading && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}
{ATC.filename}
</Button>
))}
Expand Down
4 changes: 2 additions & 2 deletions src/services/ui/src/pages/detail/package-activity/hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ export const useAttachmentService = (
setLoading(true);
const zip = new JSZip();

const remoteZips = attachments.map(async (ATT) => {
const remoteZips = attachments.map(async (ATT, index) => {
const url = await onUrl(ATT);
if (!url) return;
const response = await fetch(url);
const data = await response.blob();
zip.file(ATT.filename, data);
zip.file(`${ATT.filename}_${index + 1}`, data);
return data;
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export const PackageActivities: FC<opensearch.main.Document> = (props) => {
[props.changelog]
);

// TODO: OY2-26538
const onDownloadAll = () => {
const attachments = props.changelog?.reduce((ACC, ATT) => {
if (!ATT._source.attachments) return ACC;
Expand Down

0 comments on commit 43199b8

Please sign in to comment.