Compare commits

..

No commits in common. "9597e0a2502bb5c050a2121119e42902413a8cef" and "691c02366e12761d9174648a21c36bf8c14dd9f7" have entirely different histories.

4 changed files with 14 additions and 30 deletions

View File

@ -8,8 +8,8 @@
export let card: Card; export let card: Card;
export let showModal: boolean; export let showModal: boolean;
let newTitle: string = card.title; let newTitle = card.title;
let newContent: string = card.content; let newContent = card.content;
async function save(closeModal: boolean = true) { async function save(closeModal: boolean = true) {
if (card.title !== newTitle || card.content !== newContent) { if (card.title !== newTitle || card.content !== newContent) {
@ -21,28 +21,22 @@
} }
</script> </script>
<svelte:window
on:keydown|once={(e) => {
if (e.key === 'Escape') return save(true);
}}
/>
<!-- svelte-ignore a11y-click-events-have-key-events --> <!-- svelte-ignore a11y-click-events-have-key-events -->
<!-- svelte-ignore a11y-no-static-element-interactions --> <!-- svelte-ignore a11y-no-static-element-interactions -->
<div class="modal" on:click|self|preventDefault={() => save(true)}> <div class="modal" on:click={() => save(true)}>
<div class="content" on:click|stopPropagation> <div class="content" on:click|stopPropagation>
<div class="header"> <div class="header">
<input class="title" bind:value={newTitle} on:blur={() => save(false)} /> <input class="title" bind:value={newTitle} on:blur={() => save(false)} />
<div class="buttons"> <div class="buttons">
<button <button
on:click|once={async () => { on:click={async () => {
await card.delete(); await card.delete();
showModal = false; showModal = false;
}} }}
> >
<TrashIcon /> <TrashIcon />
</button> </button>
<button on:click|once={() => (showModal = false)}> <button on:click={() => (showModal = false)}>
<CloseIcon /> <CloseIcon />
</button> </button>
</div> </div>

View File

@ -1,12 +1,12 @@
<script lang="ts"> <script lang="ts">
import currentDraggedCard from '$lib/stores/currentDraggedCard';
import currentView from '$lib/stores/currentView';
import Card, { cards } from '$lib/types/Card'; import Card, { cards } from '$lib/types/Card';
import type Project from '$lib/types/Project';
import ProjectTag, { projectTags } from '$lib/types/ProjectTag';
import type TagOption from '$lib/types/TagOption';
import CardComponent from '../card/Card.svelte'; import CardComponent from '../card/Card.svelte';
import AddIcon from '../icons/AddIcon.svelte'; import AddIcon from '../icons/AddIcon.svelte';
import type TagOption from '$lib/types/TagOption';
import ProjectTag, { projectTags } from '$lib/types/ProjectTag';
import type Project from '$lib/types/Project';
import currentDraggedCard from '$lib/stores/currentDraggedCard';
import currentView from '$lib/stores/currentView';
export let project: Project; export let project: Project;
export let option: TagOption | null = null; export let option: TagOption | null = null;
@ -45,8 +45,6 @@
if (!card) return; if (!card) return;
await card.updateTitle(`untitled ${card.id}`);
if ($currentView?.filters && $currentView.filters.length > 0) { if ($currentView?.filters && $currentView.filters.length > 0) {
for (const projectTag of $projectTags) { for (const projectTag of $projectTags) {
for (const filter of $currentView.filters) { for (const filter of $currentView.filters) {
@ -107,7 +105,7 @@
</span> </span>
</header> </header>
<ul> <ul>
{#each columnCards as card (card.id)} {#each columnCards as card}
<CardComponent {card} /> <CardComponent {card} />
{/each} {/each}
</ul> </ul>

View File

@ -15,8 +15,7 @@
{#if tagType} {#if tagType}
<td> <td>
{#if tagType?.hasOptions} {#if tagType?.hasOptions}
<!-- multiple={false} --> <SelectTags multiple={false} {projectTag} {card} {cardTag} />
<SelectTags {projectTag} {card} {cardTag} />
{:else if !tagType?.hasOptions} {:else if !tagType?.hasOptions}
<input /> <input />
{/if} {/if}

View File

@ -1,14 +1,11 @@
<script lang="ts"> <script lang="ts">
import { page } from '$app/stores';
import projectsApi from '$lib/api/projectsApi'; import projectsApi from '$lib/api/projectsApi';
import ProjectComponent from '$lib/components/project/Project.svelte';
import Sidebar from '$lib/components/project/Sidebar.svelte'; import Sidebar from '$lib/components/project/Sidebar.svelte';
import currentView from '$lib/stores/currentView';
import type Project from '$lib/types/Project'; import type Project from '$lib/types/Project';
import { views } from '$lib/types/View';
import { SvelteToast } from '@zerodevx/svelte-toast'; import { SvelteToast } from '@zerodevx/svelte-toast';
import { onMount } from 'svelte'; import { onMount } from 'svelte';
import { get } from 'svelte/store'; import ProjectComponent from '$lib/components/project/Project.svelte';
import { page } from '$app/stores';
let project: Project; let project: Project;
@ -23,10 +20,6 @@
await projectsApi.getTags(project); await projectsApi.getTags(project);
await projectsApi.getViews(project); await projectsApi.getViews(project);
await projectsApi.getCards(project); await projectsApi.getCards(project);
if (get(views).length > 0) {
currentView.set(get(views)[0]);
}
}); });
</script> </script>