Skip to content
Closed
Changes from 2 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
14 changes: 10 additions & 4 deletions src/routes/(console)/organization-[organization]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@
: [];
});

const activeProjects = $derived.by(() => {
return data.projects.projects.filter((project) => project.status !== 'archived');
});

const activeProjectsCount = $derived(activeProjects.length);

function filterPlatforms(platforms: { name: string; icon: string }[]) {
return platforms.filter(
(value, index, self) => index === self.findIndex((t) => t.name === value.name)
Expand Down Expand Up @@ -235,13 +241,13 @@
</Alert.Inline>
{/if}

{#if data.projects.total > 0}
{#if activeProjectsCount > 0}
<CardContainer
disableEmpty={!$canWriteProjects}
total={data.projects.total}
total={activeProjectsCount}
offset={data.offset}
on:click={handleCreateProject}>
{#each data.projects.projects as project}
{#each activeProjects as project}
{@const platforms = filterPlatforms(
project.platforms.map((platform) => getPlatformInfo(platform.type))
)}
Expand Down Expand Up @@ -323,7 +329,7 @@
name="Projects"
limit={data.limit}
offset={data.offset}
total={data.projects.total} />
total={activeProjectsCount} />

<!-- Archived Projects Section -->
<ArchiveProject
Expand Down