Skip to content
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

Add basic table for similar bed files and pdf download button for plots #155

Merged
merged 9 commits into from
Nov 15, 2024

Conversation

sanghoonio
Copy link
Member

This is per @khoroshevskyi's request to have something in time for Bing's poster presentation tomorrow and lab meeting next week. I added a basic table showing similar bed files (same component as text-2-bed search table results) for now and buttons for downloading full pdfs for all figures. I also cleaned up some small bootstrap details so things align better.

Copy link

cloudflare-workers-and-pages bot commented Nov 15, 2024

Deploying bedhost-ui with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0fc1b37
Status: ✅  Deploy successful!
Preview URL: https://9197dc33.bedhost.pages.dev
Branch Preview URL: https://dev-sam.bedhost.pages.dev

View logs

Copy link
Member

@nleroy917 nleroy917 left a comment

Choose a reason for hiding this comment

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

Yeah I mean this looks great. If you don't mind... I'm gonna pull it down and run prettier.

@@ -55,13 +57,15 @@ const Plot = (props: PlotProps) => {

export const Plots = (props: PlotsProps) => {
const { metadata } = props;
console.log(props)
Copy link
Member

Choose a reason for hiding this comment

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

Remove console.log?

Comment on lines +187 to +190
if (!(e.target as HTMLElement).closest('button')) {
window.location.href = `/bed/${id}`;
}
};
Copy link
Member

Choose a reason for hiding this comment

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

Curious what this is doing? Are we able to somehow make it an href or anchor tag (<a />)?

Copy link
Member

Choose a reason for hiding this comment

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

I think I get it. I was looking at it seems that there's not really a nice "right" way to make a row a link: https://stackoverflow.com/questions/17147821/how-to-make-a-whole-row-in-a-table-clickable-as-a-link

I'm confused why its not just window.location.href = /bed/idand whatclosest` is doing? Im sure I am missing something.

Comment on lines +20 to +25
const handleRowClick = (id?: string) => (e: React.MouseEvent) => {
if (!(e.target as HTMLElement).closest('button')) {
window.location.href = `/bed/${id}`;
}
};

Copy link
Member

Choose a reason for hiding this comment

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

Third time i've seen... should we abstract this into a util function?

<p className='mb-0'>
<div className="badge bg-primary text-wrap">
<i className="bi bi-file-earmark-text me-1" />
{metadata.bed_ids?.length} BED files
Copy link
Member

Choose a reason for hiding this comment

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

Should we check for bed_ids first? Otherwise this will render as just BED files. Small thing, just curious

Comment on lines 29 to 33
console.log(useBedsetMetadata({
md5: bedsetId,
autoRun: true,
}));

Copy link
Member

Choose a reason for hiding this comment

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

Remove?

@@ -0,0 +1,24 @@
import { useQuery } from '@tanstack/react-query';
Copy link
Member

Choose a reason for hiding this comment

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

Awesome

@sanghoonio sanghoonio merged commit 6afecec into dev Nov 15, 2024
2 checks passed
@khoroshevskyi khoroshevskyi deleted the dev_sam branch November 26, 2024 17:58
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.

2 participants