Browse Source

add a few fixes and tweaks related to the previous commit.

main
Gisle Aune 4 years ago
parent
commit
ef94b1556a
  1. 2
      svelte-ui/src/components/Composition.svelte
  2. 5
      svelte-ui/src/components/IconSelect.svelte
  3. 8
      svelte-ui/src/components/ProjectEntry.svelte
  4. 2
      svelte-ui/src/components/ProjectProgress.svelte
  5. 2
      svelte-ui/src/external/icons.ts
  6. 8
      svelte-ui/src/forms/ProjectForm.svelte
  7. 4
      svelte-ui/src/forms/TaskForm.svelte

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

@ -1,5 +1,5 @@
<script lang="ts">
import type { GoalCompositionMode, GoalLogResult } from "../models/goal";
import type { GoalCompositionMode } from "../models/goal";
import type { LogResult } from "../models/log";
interface CompositionItem {

5
svelte-ui/src/components/IconSelect.svelte

@ -15,7 +15,7 @@
<div class:disabled class="icon-select">
{#each commonIcons as iconName (iconName)}
<div class="icon-item common" class:selected={value===iconName} on:click={() => {if (!disabled) { value = iconName }}}>
<div class="icon-item" class:selected={value===iconName} on:click={() => {if (!disabled) { value = iconName }}}>
<Icon name={iconName} />
</div>
{/each}
@ -53,9 +53,6 @@ div.icon-item {
cursor: pointer;
}
div.icon-item.uncommon {
color: #888;
}
div.icon-item:hover {
background-color: #292929;
}

8
svelte-ui/src/components/ProjectEntry.svelte

@ -22,8 +22,8 @@
let activeTasks: TaskResult[] = [];
let inactiveTasks: TaskResult[] = [];
let completedTasks: TaskResult[] = [];
let todoTasks: TaskResult[] = [];
let completedTasks: TaskResult[] = [];
let onholdTasks: TaskResult[] = [];
let failedTasks: TaskResult[] = [];
@ -37,14 +37,14 @@
if (!hideInactive) {
inactiveTasks = project.tasks.filter(t => !t.active);
completedTasks = inactiveTasks.filter(t => t.statusTag === "completed" || t.statusTag == null);
todoTasks = inactiveTasks.filter(t => t.statusTag === "to do" || t.statusTag === "idea");
completedTasks = inactiveTasks.filter(t => t.statusTag === "completed" || t.statusTag == null);
onholdTasks = inactiveTasks.filter(t => t.statusTag === "on hold" || t.statusTag === "postponed");
failedTasks = inactiveTasks.filter(t => t.statusTag === "failed" || t.statusTag === "declined" || t.statusTag === "wont do");
} else {
inactiveTasks = [];
completedTasks = [];
todoTasks = [];
completedTasks = [];
onholdTasks = [];
failedTasks = [];
}
@ -72,8 +72,8 @@
<TaskList header="" tasks={activeTasks} project={project} showAllOptions={showAllOptions} />
{:else}
<TaskList header="Active" tasks={activeTasks} project={project} showAllOptions={showAllOptions} />
<TaskList header="Completed" tasks={completedTasks} project={project} showAllOptions={showAllOptions} />
<TaskList header="To Do" tasks={todoTasks} project={project} showAllOptions={showAllOptions} />
<TaskList header="Completed" tasks={completedTasks} project={project} showAllOptions={showAllOptions} />
<TaskList header="On Hold" tasks={onholdTasks} project={project} showAllOptions={showAllOptions} />
<TaskList header="Failed" tasks={failedTasks} project={project} showAllOptions={showAllOptions} />
{/if}

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

@ -12,7 +12,7 @@
let progressAmount: number;
let progressTarget: number;
$: progressAmount = (project.tasks||[]).map(t => t.active
$: progressAmount = (project.tasks||[]).map(t => (t.active || t.statusTag === "to do" || t.statusTag === "on hold")
? Math.min(t.completedAmount, t.itemAmount) * t.item.groupWeight
: t.itemAmount * t.item.groupWeight
).reduce((n,m) => n+m, 0);

2
svelte-ui/src/external/icons.ts

@ -224,7 +224,7 @@ export const commonIcons: IconName[] = [
export type IconName = keyof typeof icons;
export const iconNames = Object.keys(icons).sort() as IconName[];
export const DEFAULT_ICON = iconNames[0] as IconName;
export const DEFAULT_ICON = commonIcons[0];
export const uncommonIcons = iconNames.filter(n => !commonIcons.includes(n));

8
svelte-ui/src/forms/ProjectForm.svelte

@ -1,10 +1,9 @@
<script lang="ts">
import stuffLogClient from "../clients/stufflog";
import Checkbox from "../components/Checkbox.svelte";
import IconSelect from "../components/IconSelect.svelte";
import Modal from "../components/Modal.svelte";
import StatusTagSelect from "../components/StatusTagSelect.svelte";
import { iconNames } from "../external/icons";
import { DEFAULT_ICON } from "../external/icons";
import type { ProjectResult } from "../models/project";
import markStale from "../stores/markStale";
import modalStore from "../stores/modal";
@ -19,8 +18,9 @@ import StatusTagSelect from "../components/StatusTagSelect.svelte";
id: "",
name: "",
description: "",
icon: iconNames[0],
active: true,
icon: DEFAULT_ICON,
active: false,
statusTag: "to do",
createdTime: "",
tasks: [],
}

4
svelte-ui/src/forms/TaskForm.svelte

@ -21,12 +21,12 @@
name: "",
description: "",
icon: iconNames[0],
active: true,
active: false,
createdTime: "",
item: null,
logs: [],
completedAmount: 0,
statusTag: null,
statusTag: "to do",
}
let verb = "Add";
if (md.name === "task.edit" || md.name === "task.delete") {

Loading…
Cancel
Save