|
@ -2,6 +2,7 @@ |
|
|
import type Project from "../models/project"; |
|
|
import type Project from "../models/project"; |
|
|
import projectStore from "../stores/project"; |
|
|
import projectStore from "../stores/project"; |
|
|
import projectGroupStore from "../stores/projectGroup"; |
|
|
import projectGroupStore from "../stores/projectGroup"; |
|
|
|
|
|
|
|
|
interface OptGroup { |
|
|
interface OptGroup { |
|
|
status: string |
|
|
status: string |
|
|
projects: Project[] |
|
|
projects: Project[] |
|
@ -10,6 +11,7 @@ import projectGroupStore from "../stores/projectGroup"; |
|
|
export let value = ""; |
|
|
export let value = ""; |
|
|
export let name = ""; |
|
|
export let name = ""; |
|
|
export let groupId = ""; |
|
|
export let groupId = ""; |
|
|
|
|
|
export let placeholder = "None"; |
|
|
export let disabled = false; |
|
|
export let disabled = false; |
|
|
export let optional = false; |
|
|
export let optional = false; |
|
|
export let forceGroup = false; |
|
|
export let forceGroup = false; |
|
@ -85,7 +87,7 @@ import projectGroupStore from "../stores/projectGroup"; |
|
|
|
|
|
|
|
|
<select name={name} bind:value={value} disabled={disabled || $projectStore.loading}> |
|
|
<select name={name} bind:value={value} disabled={disabled || $projectStore.loading}> |
|
|
{#if optional} |
|
|
{#if optional} |
|
|
<option value={""} selected={"" === value}>{$projectStore.loading ? "Loading..." : "None"}</option> |
|
|
|
|
|
|
|
|
<option value={""} selected={"" === value}>{$projectStore.loading ? "Loading..." : placeholder}</option> |
|
|
{/if} |
|
|
{/if} |
|
|
{#each optGroups as group (group.status)} |
|
|
{#each optGroups as group (group.status)} |
|
|
{#if group.projects.length > 0} |
|
|
{#if group.projects.length > 0} |
|
|