-
Notifications
You must be signed in to change notification settings - Fork 245
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
[WIP] Show included modules on pipeline pages #3094
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for nf-core-main-site ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
So the implementation for this in Astro is looking more scuffed than it needs to be. I think it could be better to abstract this out from the other places its implemented (module/subworkflow cards and pages) into a new svelte component so we can reuse it across all 3 places. This approach should make it easier to maintain and fix issues like this going forward too. I can do up a draft for now in svelte 5 and wait for #3047 before opening a new PR/updating this one. Let me know what you think. Probably something along these lines with a few extras for handling the differences with pipelines: <script lang="ts">
const {
tags,
maxSliced = 5,
type,
}: { tags: string[]; maxSliced?: number; type: "modules" | "subworkflows" | "pipelines" } = $props();
let expanded = $state(false);
</script>
<div class="tags-section mb-2">
{#each expanded ? tags : tags.slice(0, maxSliced) as tag}
<a
href={`/${type}/${tag.replace("/", "_")}/`}
class="badge fw-normal border border-info-subtle bg-info-subtle text-body me-2 text-decoration-none"
>
{tag}
</a>
{/each}
</div>
<span
class="text-small cursor-pointer tags-show-more"
title={`click to show all ${tags}`}
on:click={() => (expanded = !expanded)}
on:keydown={() => (expanded = !expanded)}
role="button"
data-bs-toggle="tooltip"
data-bs-delay="500">+{tags.length - maxSliced} more {tags}</span
> |
great idea! |
#3047 is merged so give the component approach a shot |
awesome! I'll get started |
Preview for #2722