Gisle Aune
4 years ago
20 changed files with 147 additions and 39 deletions
-
4api/project.go
-
10database/postgres/project.go
-
11migrations/postgres/20210227154406_add_project_column_favorite.sql
-
6models/project.go
-
5svelte-ui/src/clients/stufflog.ts
-
10svelte-ui/src/components/Boi.svelte
-
5svelte-ui/src/components/DateRangeSelect.svelte
-
7svelte-ui/src/components/FocusHandler.svelte
-
1svelte-ui/src/components/ParentEntry.svelte
-
46svelte-ui/src/components/ProjectEntry.svelte
-
2svelte-ui/src/components/ProjectSelect.svelte
-
5svelte-ui/src/components/QuestLog.svelte
-
2svelte-ui/src/forms/LogForm.svelte
-
17svelte-ui/src/forms/ProjectForm.svelte
-
4svelte-ui/src/models/project.ts
-
20svelte-ui/src/pages/FrontPage.svelte
-
2svelte-ui/src/pages/LogsPage.svelte
-
5svelte-ui/src/pages/QLPage.svelte
-
19svelte-ui/src/stores/markStale.ts
-
1svelte-ui/src/stores/project.ts
@ -0,0 +1,11 @@ |
|||||
|
-- +goose Up |
||||
|
-- +goose StatementBegin |
||||
|
ALTER TABLE project |
||||
|
ADD COLUMN favorite BOOLEAN NOT NULL DEFAULT false; |
||||
|
-- +goose StatementEnd |
||||
|
|
||||
|
-- +goose Down |
||||
|
-- +goose StatementBegin |
||||
|
ALTER TABLE project |
||||
|
DROP COLUMN favorite; |
||||
|
-- +goose StatementEnd |
@ -1,31 +1,34 @@ |
|||||
import goalStore, { fpGoalStore } from "./goal"; |
import goalStore, { fpGoalStore } from "./goal"; |
||||
import groupStore from "./group"; |
import groupStore from "./group"; |
||||
import logStore from "./logs"; |
import logStore from "./logs"; |
||||
import projectStore, { fpProjectStore } from "./project"; |
|
||||
|
import projectStore, { fpProjectStore, fpProjectStore2 } from "./project"; |
||||
import taskStore, { fpTaskStore } from "./tasks"; |
import taskStore, { fpTaskStore } from "./tasks"; |
||||
|
|
||||
type ModelName = "goal" | "project" | "task" | "group" | "item" | "log" |
|
||||
|
type ModelName = "goal" | "project" | "task" | "group" | "item" | "log" | "*" |
||||
|
|
||||
export default function markStale(...models: ModelName[]) { |
export default function markStale(...models: ModelName[]) { |
||||
if (models.includes("goal")) { |
|
||||
|
const markAll = models.includes("*"); |
||||
|
|
||||
|
if (markAll || models.includes("goal")) { |
||||
goalStore.markStale(); |
goalStore.markStale(); |
||||
fpGoalStore.markStale(); |
fpGoalStore.markStale(); |
||||
} |
} |
||||
if (models.includes("project")) { |
|
||||
|
if (markAll || models.includes("project")) { |
||||
projectStore.markStale(); |
projectStore.markStale(); |
||||
fpProjectStore.markStale(); |
fpProjectStore.markStale(); |
||||
|
fpProjectStore2.markStale(); |
||||
} |
} |
||||
if (models.includes("task")) { |
|
||||
|
if (markAll || models.includes("task")) { |
||||
taskStore.markStale(); |
taskStore.markStale(); |
||||
fpTaskStore.markStale(); |
fpTaskStore.markStale(); |
||||
} |
} |
||||
if (models.includes("group")) { |
|
||||
|
if (markAll || models.includes("group")) { |
||||
groupStore.markStale(); |
groupStore.markStale(); |
||||
} |
} |
||||
if (models.includes("item")) { |
|
||||
|
if (markAll || models.includes("item")) { |
||||
// Do nothing.
|
// Do nothing.
|
||||
} |
} |
||||
if (models.includes("log")) { |
|
||||
|
if (markAll || models.includes("log")) { |
||||
logStore.markStale(); |
logStore.markStale(); |
||||
} |
} |
||||
} |
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue