Browse Source

test commit for drone.

main
Gisle Aune 3 years ago
parent
commit
ea01af1091
  1. 13
      svelte-ui/src/clients/stufflog.ts
  2. 35
      svelte-ui/src/models/projectgroup.ts
  3. 2
      svelte-ui/src/pages/FrontPage.svelte

13
svelte-ui/src/clients/stufflog.ts

@ -5,6 +5,7 @@ import type { TaskFilter, TaskInput, TaskLink, TaskResult, TaskUpdate } from "..
import type { LogFilter, LogInput, LogResult, LogUpdate } from "../models/log"; import type { LogFilter, LogInput, LogResult, LogUpdate } from "../models/log";
import type { GroupInput, GroupResult, GroupUpdate } from "../models/group"; import type { GroupInput, GroupResult, GroupUpdate } from "../models/group";
import type { ItemInput, ItemResult, ItemUpdate } from "../models/item"; import type { ItemInput, ItemResult, ItemUpdate } from "../models/item";
import type { ProjectGroupResult } from "../models/projectgroup";
export class StufflogClient { export class StufflogClient {
private root: string; private root: string;
@ -98,6 +99,18 @@ export class StufflogClient {
async findProjectGroup(id: string): Promise<ProjectGroupResult> {
const data = await this.fetch("GET", `/api/projectgroup/${id}`);
return data.projectGroup;
}
async listProjectGroups(): Promise<ProjectGroupResult[]> {
const data = await this.fetch("GET", `/api/projectgroup/`);
return data.projectGroups;
}
async findLog(id: string): Promise<LogResult> { async findLog(id: string): Promise<LogResult> {
const data = await this.fetch("GET", `/api/log/${id}`); const data = await this.fetch("GET", `/api/log/${id}`);
return data.log; return data.log;

35
svelte-ui/src/models/projectgroup.ts

@ -0,0 +1,35 @@
import type Project from "./project";
export default interface ProjectGroup {
id: string
name: string
description: string
abbreviation: string
categoryNames: ProjectGroupCategoryMap
}
export interface ProjectGroupResult extends ProjectGroup {
projectCounts: ProjectGroupCountMap
taskCounts: ProjectGroupCountMap
}
export interface ProjectGroupCategoryMap {
"completed"?: string
"failed"?: string
"on hold"?: string
"to do"?: string
"declined"?: string
"progress"?: string
"background"?: string
}
export interface ProjectGroupCountMap {
total: number
"completed"?: number
"failed"?: number
"on hold"?: number
"to do"?: number
"declined"?: number
"progress"?: number
"background"?: number
}

2
svelte-ui/src/pages/FrontPage.svelte

@ -1,4 +1,6 @@
<script lang="ts"> <script lang="ts">
import stuffLogClient from "../clients/stufflog";
import DateRangeSelect from "../components/DateRangeSelect.svelte"; import DateRangeSelect from "../components/DateRangeSelect.svelte";
import EmptyList from "../components/EmptyList.svelte"; import EmptyList from "../components/EmptyList.svelte";

Loading…
Cancel
Save