Browse Source

fix project-select showing empty status categories.

main
Gisle Aune 4 years ago
parent
commit
48b439af4f
  1. 15
      svelte-ui/src/components/ProjectSelect.svelte

15
svelte-ui/src/components/ProjectSelect.svelte

@ -1,5 +1,6 @@
<script lang="ts">
import type Project from "../models/project";
import { group } from "console";
import type Project from "../models/project";
import authStore from "../stores/auth";
import projectStore from "../stores/project";
@ -69,10 +70,12 @@ import authStore from "../stores/auth";
<option value={""} selected={"" === value}>None</option>
{/if}
{#each optGroups as group (group.status)}
<optgroup label={group.status}>
{#each group.projects as project (project.id)}
<option value={project.id} selected={project.id === value}>{project.name}</option>
{/each}
</optgroup>
{#if group.projects.length > 0}
<optgroup label={group.status}>
{#each group.projects as project (project.id)}
<option value={project.id} selected={project.id === value}>{project.name}</option>
{/each}
</optgroup>
{/if}
{/each}
</select>
Loading…
Cancel
Save