Browse Source

Change None -> Any in logs page.

main
Gisle Aune 3 years ago
parent
commit
ed37d4dbcc
  1. 2
      svelte-ui/src/components/ItemProgress.svelte
  2. 3
      svelte-ui/src/components/ItemSelect.svelte
  3. 3
      svelte-ui/src/components/ProjectGroupSelect.svelte
  4. 6
      svelte-ui/src/components/ProjectSelect.svelte
  5. 6
      svelte-ui/src/pages/LogsPage.svelte

2
svelte-ui/src/components/ItemProgress.svelte

@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import type Item from "../models/item"; import type Item from "../models/item";
import type { LogResult } from "../models/log";
import type { LogResult } from "../models/log";
import type { ProjectResult } from "../models/project"; import type { ProjectResult } from "../models/project";
import Icon from "./Icon.svelte"; import Icon from "./Icon.svelte";

3
svelte-ui/src/components/ItemSelect.svelte

@ -3,6 +3,7 @@
export let value = ""; export let value = "";
export let name = ""; export let name = "";
export let placeholder = "None"
export let disabled = false; export let disabled = false;
export let optional = false; export let optional = false;
export let enableWholeGroup = false; export let enableWholeGroup = false;
@ -25,7 +26,7 @@
<select name={name} bind:value={value} disabled={disabled || $groupStore.loading}> <select name={name} bind:value={value} disabled={disabled || $groupStore.loading}>
{#if optional} {#if optional}
<option value={""} selected={"" === value}>None</option>
<option value={""} selected={"" === value}>{placeholder}</option>
{/if} {/if}
{#each $groupStore.groups as group (group.id)} {#each $groupStore.groups as group (group.id)}
<optgroup label={group.name}> <optgroup label={group.name}>

3
svelte-ui/src/components/ProjectGroupSelect.svelte

@ -3,13 +3,14 @@
export let value = ""; export let value = "";
export let name = ""; export let name = "";
export let placeholder = "None"
export let disabled = false; export let disabled = false;
export let optional = false; export let optional = false;
</script> </script>
<select name={name} bind:value={value} disabled={disabled || $projectGroupStore.loading}> <select name={name} bind:value={value} disabled={disabled || $projectGroupStore.loading}>
{#if optional} {#if optional}
<option value={""} selected={"" === value}>{$projectGroupStore.loading ? "Loading..." : "None"}</option>
<option value={""} selected={"" === value}>{$projectGroupStore.loading ? "Loading..." : placeholder}</option>
{/if} {/if}
{#each $projectGroupStore.groups as group (group.id)} {#each $projectGroupStore.groups as group (group.id)}
{#if group.id !== "META_UNGROUPED"} {#if group.id !== "META_UNGROUPED"}

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

@ -1,7 +1,8 @@
<script lang="ts"> <script lang="ts">
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}

6
svelte-ui/src/pages/LogsPage.svelte

@ -136,15 +136,15 @@
<div class="extra-filters"> <div class="extra-filters">
<div class="filter-group"> <div class="filter-group">
<label for="projectGroup">Project Group</label> <label for="projectGroup">Project Group</label>
<ProjectGroupSelect name="projectGroup" optional bind:value={projectGroupId} />
<ProjectGroupSelect name="projectGroup" optional bind:value={projectGroupId} placeholder="Any" />
</div> </div>
<div class="filter-group"> <div class="filter-group">
<label for="project">Project</label> <label for="project">Project</label>
<ProjectSelect name="project" disabled={projectGroupId === ""} optional bind:value={projectId} groupId={projectGroupId} forceGroup />
<ProjectSelect name="project" disabled={projectGroupId === ""} optional bind:value={projectId} groupId={projectGroupId} forceGroup placeholder="Any" />
</div> </div>
<div class="filter-group"> <div class="filter-group">
<label for="item">Item</label> <label for="item">Item</label>
<ItemSelect name="item" optional bind:value={itemId} enableWholeGroup />
<ItemSelect name="item" optional bind:value={itemId} enableWholeGroup placeholder="Any" />
</div> </div>
</div> </div>
<div class="error">{error}</div> <div class="error">{error}</div>

Loading…
Cancel
Save