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 accordion to pipeline parameter headers #2044

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 27 additions & 12 deletions src/components/schema/SchemaListingGroup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,15 @@
});
</script>

<div class="card my-2" class:collapse={hidden} class:show={$showHidden}>
<div class="card-header position-sticky bg-body-secondary">
<h2 class="card-title text-success scroll-target my-1" id={id.replaceAll('_', '-')}>
<div class="accordion my-2">
<div class="accordion-item">
<h2
class="accordion-button bg-body-secondary scroll-target"
data-bs-toggle="collapse"
data-bs-target={'#' + id.replaceAll('_', '-') + '_body'}
aria-controls={'#' + id.replaceAll('_', '-') + '_body'}
id={id.replaceAll('_', '-')}
>
<a
class="text-decoration-none text-success"
aria-hidden="true"
Expand All @@ -38,21 +44,30 @@
{definition.title}
</a>
</h2>
</div>
<div class="card-body pb-0">
<p class="mb-0">{definition.description ? definition.description : ''}</p>
{#if definition.properties}
<div class="properties">
{#each Object.entries(definition.properties) as [title, property] (title)}
<SchemaListingElement {title} {property} />
{/each}
<div id={id.replaceAll('_', '-') + '_body'} class="accordion-collapse collapse show">
<div class="accordion-body">
<p class="mb-0">{definition.description ? definition.description : ''}</p>
{#if definition.properties}
<div class="properties">
{#each Object.entries(definition.properties) as [title, property] (title)}
<SchemaListingElement {title} {property} />
{/each}
</div>
{/if}
</div>
{/if}
</div>
</div>
</div>

<style lang="scss">
.properties > :global(.row) {
margin-top: -1px; // avoid doubled borders
}
.accordion-button {
font-size: 2rem;
font-weight: 500;
}
.accordion-button.collapsed {
background: #eaecef;
}
</style>
Loading