Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e268c1fd97 | ||
|
|
7b7a46eae9 | ||
|
|
6825584b8d | ||
|
|
a530bed697 | ||
|
|
e65349662a | ||
|
|
fd5d732851 | ||
|
|
9259609efe | ||
|
|
a5b9f85eda |
@@ -58,6 +58,8 @@ export const handle: Handle = async({ event, resolve }) => {
|
||||
for (const key in newCookies) {
|
||||
response.headers.append("Set-Cookie", cookie.serialize(key, newCookies[key], {
|
||||
path: "/",
|
||||
maxAge: 8640000,
|
||||
expires: new Date(Date.now() + 8640000000),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
for (const stat of actualScope.stats) {
|
||||
const found = value.find(v => v.statId == stat.id);
|
||||
|
||||
enabledMap[stat.id] = found != null && (!!found?.required || !!found?.acquired);
|
||||
enabledMap[stat.id] = found != null && (found?.required > (zeroDeletes ? 0 : -1));
|
||||
requiredMap[stat.id] = found?.required || 0;
|
||||
acquiredMap[stat.id] = found?.acquired || 0;
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
import { faChevronDown } from "@fortawesome/free-solid-svg-icons/faChevronDown";
|
||||
import { faTrash } from "@fortawesome/free-solid-svg-icons/faTrash";
|
||||
import { faCheckToSlot } from "@fortawesome/free-solid-svg-icons/faCheckToSlot";
|
||||
import { faEye } from "@fortawesome/free-solid-svg-icons/faEye";
|
||||
|
||||
const icons = {
|
||||
"clock": faClock,
|
||||
@@ -66,6 +67,7 @@
|
||||
"chevron_down": faChevronDown,
|
||||
"trash": faTrash,
|
||||
"check_slot": faCheckToSlot,
|
||||
"eye": faEye,
|
||||
};
|
||||
|
||||
export type IconName = keyof typeof icons;
|
||||
|
||||
@@ -6,14 +6,15 @@
|
||||
import SprintBody from "./SprintBody.svelte";
|
||||
import { projectPrettyId } from "$lib/utils/prettyIds";
|
||||
import Section from "../layout/Section.svelte";
|
||||
import Icon from "../layout/Icon.svelte";
|
||||
|
||||
export let sprint: Sprint;
|
||||
</script>
|
||||
|
||||
<Section anchor={projectPrettyId(sprint)} noProgress title={sprint.name}>
|
||||
<OptionsRow slot="right">
|
||||
<Option open={{name: "sprint.edit", sprint}}>Edit</Option>
|
||||
<Option open={{name: "sprint.delete", sprint}} color="red">Delete</Option>
|
||||
<Option open={{name: "sprint.edit", sprint}}><Icon name="pen" /></Option>
|
||||
<Option open={{name: "sprint.delete", sprint}} color="red"><Icon name="trash" /></Option>
|
||||
</OptionsRow>
|
||||
<SprintBody sprint={sprint} />
|
||||
</Section>
|
||||
@@ -9,6 +9,7 @@
|
||||
import { projectPrettyId, scopePrettyId } from "$lib/utils/prettyIds";
|
||||
import { getScopeContext } from "../contexts/ScopeContext.svelte";
|
||||
import { getScopeListContext } from "../contexts/ScopeListContext.svelte";
|
||||
import Icon from "../layout/Icon.svelte";
|
||||
|
||||
export let sprint: Sprint;
|
||||
const {scope, lastHistoryRange} = getScopeContext();
|
||||
@@ -16,7 +17,7 @@
|
||||
|
||||
function gotoSprint() {
|
||||
let sc = $scope;
|
||||
if (sc.id !== sprint.id) {
|
||||
if (sc.id !== sprint.scopeId) {
|
||||
sc = $scopes.find(s => s.id === sprint.scopeId);
|
||||
}
|
||||
|
||||
@@ -26,9 +27,9 @@
|
||||
|
||||
<SubSection noProgress title={sprint.name}>
|
||||
<OptionsRow slot="right">
|
||||
<Option on:click={gotoSprint}>View</Option>
|
||||
<Option open={{name: "sprint.edit", sprint}}>Edit</Option>
|
||||
<Option open={{name: "sprint.delete", sprint}} color="red">Delete</Option>
|
||||
<Option on:click={gotoSprint}><Icon name="eye" /></Option>
|
||||
<Option open={{name: "sprint.edit", sprint}}><Icon name="pen" /></Option>
|
||||
<Option open={{name: "sprint.delete", sprint}} color="red"><Icon name="trash" /></Option>
|
||||
</OptionsRow>
|
||||
<SprintBody compact sprint={sprint} />
|
||||
</SubSection>
|
||||
@@ -3,6 +3,7 @@
|
||||
import Amount from "../common/Amount.svelte";
|
||||
import AmountRow from "../common/AmountRow.svelte";
|
||||
import Markdown from "../common/Markdown.svelte";
|
||||
import Icon from "../layout/Icon.svelte";
|
||||
import Option from "../layout/Option.svelte";
|
||||
import OptionsRow from "../layout/OptionsRow.svelte";
|
||||
import SubSection from "../layout/SubSection.svelte";
|
||||
@@ -12,8 +13,8 @@
|
||||
|
||||
<SubSection noProgress title={stat.name}>
|
||||
<OptionsRow slot="right">
|
||||
<Option open={{name: "stat.edit", stat}}>Edit</Option>
|
||||
<Option open={{name: "stat.delete", stat}} color="red">Delete</Option>
|
||||
<Option open={{name: "stat.edit", stat}}><Icon name="pen" /></Option>
|
||||
<Option open={{name: "stat.delete", stat}} color="red"><Icon name="trash" /></Option>
|
||||
</OptionsRow>
|
||||
<Markdown source={stat.description} />
|
||||
{#if stat.weight !== 1}
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
<label for="description">Description</label>
|
||||
<textarea name="description" bind:value={item.description} />
|
||||
<label for="stats">Stats</label>
|
||||
<StatInput showAcquired hideUnseen noToggle bind:value={item.stats} />
|
||||
<StatInput overrideScopeId={scopeId} showAcquired hideUnseen noToggle bind:value={item.stats} />
|
||||
</ModalBody>
|
||||
</Modal>
|
||||
</form>
|
||||
@@ -62,6 +62,7 @@
|
||||
import ItemMultiListContext from "$lib/components/contexts/ItemMultiListContext.svelte";
|
||||
import { getTimeContext } from "$lib/components/contexts/TimeContext.svelte";
|
||||
import ItemListRow from "$lib/components/scope/ItemListRow.svelte";
|
||||
import Icon from "$lib/components/layout/Icon.svelte";
|
||||
|
||||
export let acquiredItems: Item[];
|
||||
export let scheduledItems: Item[];
|
||||
@@ -106,13 +107,13 @@
|
||||
<Column>
|
||||
<Row title="Sprints">
|
||||
<OptionsRow slot="right">
|
||||
<Option open={{name: "sprint.create"}}>Create</Option>
|
||||
<Option open={{name: "sprint.create"}}><Icon name="plus" /></Option>
|
||||
</OptionsRow>
|
||||
<SprintList sub />
|
||||
</Row>
|
||||
<Row title="Stats">
|
||||
<OptionsRow slot="right">
|
||||
<Option open={{name: "stat.create"}}>Create</Option>
|
||||
<Option open={{name: "stat.create"}}><Icon name="plus" /></Option>
|
||||
</OptionsRow>
|
||||
{#each $scope.stats as stat (stat.id)}
|
||||
<StatSubSection stat={stat} />
|
||||
|
||||
@@ -58,6 +58,7 @@
|
||||
import SprintCreateUpdateModal from "$lib/modals/SprintCreateUpdateModal.svelte";
|
||||
import SprintListContext from "$lib/components/contexts/SprintListContext.svelte";
|
||||
import type Sprint from "$lib/models/sprint";
|
||||
import Icon from "$lib/components/layout/Icon.svelte";
|
||||
|
||||
export let scopes: Scope[] = [];
|
||||
export let acquiredItems: Item[];
|
||||
@@ -77,7 +78,7 @@
|
||||
<Column>
|
||||
<Row title="Scopes">
|
||||
<OptionsRow slot="right">
|
||||
<Option open={{name: "scope.create"}}>Create</Option>
|
||||
<Option open={{name: "scope.create"}}><Icon name="plus" /></Option>
|
||||
</OptionsRow>
|
||||
<ScopeLinkList />
|
||||
</Row>
|
||||
|
||||
@@ -88,6 +88,7 @@ func (r *statsRepository) List(ctx context.Context, scopeIDs ...int) ([]entities
|
||||
Select("id, scope_id, name, description, weight, allowed_amounts, is_primary").
|
||||
From("stat").
|
||||
Where(squirrel.Eq{"scope_id": scopeIDs}).
|
||||
OrderBy("is_primary DESC", "name").
|
||||
RunWith(r.db).
|
||||
Query()
|
||||
if err == sql.ErrNoRows {
|
||||
|
||||
@@ -195,12 +195,12 @@ func generateRequirementResult(req entities.Requirement, scope scopes.Result, re
|
||||
continue
|
||||
}
|
||||
|
||||
if item.AcquiredTime != nil {
|
||||
for _, stat := range item.Stats {
|
||||
if resStats[stat.ID] != nil {
|
||||
if item.AcquiredTime != nil {
|
||||
resStats[stat.ID].Acquired += stat.Acquired
|
||||
resStats[stat.ID].Planned += stat.Required
|
||||
}
|
||||
resStats[stat.ID].Planned += stat.Required
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -68,6 +68,7 @@ func generateResult(scope entities.Scope, members []entities.ScopeMember, stats
|
||||
Owner: member.Owner,
|
||||
}
|
||||
}
|
||||
|
||||
if stats != nil {
|
||||
res.Stats = make([]ResultStat, 0, len(stats))
|
||||
for _, stat := range stats {
|
||||
|
||||
Reference in New Issue
Block a user