fix missing key tag on piecharts

This commit is contained in:
Christoph Kluge 2023-08-29 15:58:25 +02:00
parent 3014f59cc2
commit 1771883754

View File

@ -57,7 +57,6 @@
}) })
const paging = { itemsPerPage: 10, page: 1 }; // Top 10 const paging = { itemsPerPage: 10, page: 1 }; // Top 10
// const sorting = { field: "totalCores", order: "DESC" };
$: topUserQuery = queryStore({ $: topUserQuery = queryStore({
client: client, client: client,
query: gql` query: gql`
@ -203,18 +202,20 @@
<Col class="p-2"> <Col class="p-2">
<div bind:clientWidth={colWidth1}> <div bind:clientWidth={colWidth1}>
<h4 class="text-center">Top Users on {cluster.charAt(0).toUpperCase() + cluster.slice(1)}</h4> <h4 class="text-center">Top Users on {cluster.charAt(0).toUpperCase() + cluster.slice(1)}</h4>
{#if $topUserQuery.fetching} {#key $topUserQuery.data}
<Spinner/> {#if $topUserQuery.fetching}
{:else if $topUserQuery.error} <Spinner/>
<Card body color="danger">{$topUserQuery.error.message}</Card> {:else if $topUserQuery.error}
{:else} <Card body color="danger">{$topUserQuery.error.message}</Card>
<Pie {:else}
size={colWidth1} <Pie
sliceLabel={topUserSelection.label} size={colWidth1}
quantities={$topUserQuery.data.topUser.map((tu) => tu[topUserSelection.key])} sliceLabel={topUserSelection.label}
entities={$topUserQuery.data.topUser.map((tu) => tu.id)} quantities={$topUserQuery.data.topUser.map((tu) => tu[topUserSelection.key])}
/> entities={$topUserQuery.data.topUser.map((tu) => tu.id)}
{/if} />
{/if}
{/key}
</div> </div>
</Col> </Col>
<Col class="px-4 py-2"> <Col class="px-4 py-2">
@ -251,18 +252,20 @@
</Col> </Col>
<Col class="p-2"> <Col class="p-2">
<h4 class="text-center">Top Projects on {cluster.charAt(0).toUpperCase() + cluster.slice(1)}</h4> <h4 class="text-center">Top Projects on {cluster.charAt(0).toUpperCase() + cluster.slice(1)}</h4>
{#if $topProjectQuery.fetching} {#key $topProjectQuery.data}
<Spinner/> {#if $topProjectQuery.fetching}
{:else if $topProjectQuery.error} <Spinner/>
<Card body color="danger">{$topProjectQuery.error.message}</Card> {:else if $topProjectQuery.error}
{:else} <Card body color="danger">{$topProjectQuery.error.message}</Card>
<Pie {:else}
size={colWidth1} <Pie
sliceLabel={topProjectSelection.label} size={colWidth1}
quantities={$topProjectQuery.data.topProjects.map((tp) => tp[topProjectSelection.key])} sliceLabel={topProjectSelection.label}
entities={$topProjectQuery.data.topProjects.map((tp) => tp.id)} quantities={$topProjectQuery.data.topProjects.map((tp) => tp[topProjectSelection.key])}
/> entities={$topProjectQuery.data.topProjects.map((tp) => tp.id)}
{/if} />
{/if}
{/key}
</Col> </Col>
<Col class="px-4 py-2"> <Col class="px-4 py-2">
{#key $topProjectQuery.data} {#key $topProjectQuery.data}