From fc7605f279efbc969912701ba7a297112f7e9256 Mon Sep 17 00:00:00 2001 From: Anna No Date: Mon, 18 Apr 2022 23:28:59 +0700 Subject: [PATCH 1/2] Board: Update Date Presenter to reuse as presenter Signed-off-by: Anna No --- .../src/components/editor/CardDetails.svelte | 8 +++-- .../presenters/DatePresenter.svelte | 32 +++++++++---------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/plugins/board-resources/src/components/editor/CardDetails.svelte b/plugins/board-resources/src/components/editor/CardDetails.svelte index 078f2056f0..d2c7e38c33 100644 --- a/plugins/board-resources/src/components/editor/CardDetails.svelte +++ b/plugins/board-resources/src/components/editor/CardDetails.svelte @@ -14,7 +14,7 @@ // limitations under the License. --> -{#if date} +{#if value}
- +
- {#if date.startDate} - + {#if value.startDate} + {/if} - {#if date.startDate && date.dueDate}-{/if} - {#if date.dueDate} - + {#if value.startDate && value.dueDate}-{/if} + {#if value.dueDate} + {/if}
From 4f12f7521f8745a1f306db34894946cf40b94810 Mon Sep 17 00:00:00 2001 From: Anna No Date: Tue, 19 Apr 2022 21:26:47 +0700 Subject: [PATCH 2/2] Board: fix formatting Signed-off-by: Anna No --- .../src/components/EditCard.svelte | 9 +- .../src/components/KanbanCard.svelte | 2 +- .../src/components/KanbanPanelEmpty.svelte | 111 +++++++++--------- .../src/components/KanbanView.svelte | 32 +++-- .../src/components/add-card/AddCard.svelte | 4 +- .../components/add-card/AddCardEditor.svelte | 34 +++--- .../add-card/AddMultipleCardsPopup.svelte | 6 +- .../components/editor/CardAttachments.svelte | 5 +- .../src/components/editor/CardDetails.svelte | 1 - .../components/popups/CardLabelsPicker.svelte | 6 +- .../components/popups/DateRangePicker.svelte | 40 ++++--- .../src/components/popups/MoveCard.svelte | 12 +- .../presenters/AttachmentPresenter.svelte | 1 - .../presenters/DatePresenter.svelte | 2 +- .../components/selectors/RankSelect.svelte | 72 ++++++------ .../components/selectors/SpaceSelect.svelte | 39 +++--- .../components/selectors/StateSelect.svelte | 59 +++++----- .../board-resources/src/utils/BoardUtils.ts | 7 +- 18 files changed, 232 insertions(+), 210 deletions(-) diff --git a/plugins/board-resources/src/components/EditCard.svelte b/plugins/board-resources/src/components/EditCard.svelte index 96cb3076da..ec13ead43f 100644 --- a/plugins/board-resources/src/components/EditCard.svelte +++ b/plugins/board-resources/src/components/EditCard.svelte @@ -44,10 +44,11 @@ let handleMove: () => void $: cardQuery.query(_class, { _id }, async (result) => { - object = result[0] - }) + object = result[0] + }) - $: object?.state && stateQuery.query(task.class.State, { _id: object.state }, async (result) => { + $: object?.state && + stateQuery.query(task.class.State, { _id: object.state }, async (result) => { state = result[0] }) @@ -62,7 +63,7 @@ } }) - function change(field: string, value: any) { + function change (field: string, value: any) { if (object) { updateCard(client, object, field, value) } diff --git a/plugins/board-resources/src/components/KanbanCard.svelte b/plugins/board-resources/src/components/KanbanCard.svelte index 3614074bee..8e60e9529d 100644 --- a/plugins/board-resources/src/components/KanbanCard.svelte +++ b/plugins/board-resources/src/components/KanbanCard.svelte @@ -38,7 +38,7 @@ } function canDropAttachment (e: DragEvent): boolean { - return !!e.dataTransfer?.items && e.dataTransfer?.items.length > 0; + return !!e.dataTransfer?.items && e.dataTransfer?.items.length > 0 } diff --git a/plugins/board-resources/src/components/KanbanPanelEmpty.svelte b/plugins/board-resources/src/components/KanbanPanelEmpty.svelte index cd23167c78..51e289c49b 100644 --- a/plugins/board-resources/src/components/KanbanPanelEmpty.svelte +++ b/plugins/board-resources/src/components/KanbanPanelEmpty.svelte @@ -1,67 +1,68 @@ -
- {#if isAdding} - -
-
- {:else} -
+ {:else} +
diff --git a/plugins/board-resources/src/components/KanbanView.svelte b/plugins/board-resources/src/components/KanbanView.svelte index a056ef6513..216632ea0c 100644 --- a/plugins/board-resources/src/components/KanbanView.svelte +++ b/plugins/board-resources/src/components/KanbanView.svelte @@ -23,7 +23,7 @@ import KanbanCard from './KanbanCard.svelte' import KanbanPanelEmpty from './KanbanPanelEmpty.svelte' import AddCard from './add-card/AddCard.svelte' - + export let _class: Ref> export let space: Ref export let search: string @@ -59,11 +59,7 @@ const client = getClient() async function addItem (title: any) { - const lastOne = await client.findOne( - task.class.State, - { space }, - { sort: { rank: SortingOrder.Descending } } - ) + const lastOne = await client.findOne(task.class.State, { space }, { sort: { rank: SortingOrder.Descending } }) await client.createDoc(task.class.State, space, { title, color: 9, @@ -73,17 +69,29 @@ /* eslint-disable no-undef */ - - + + - - { addItem(e.detail) }} /> + + { + addItem(e.detail) + }} + /> - + diff --git a/plugins/board-resources/src/components/add-card/AddCard.svelte b/plugins/board-resources/src/components/add-card/AddCard.svelte index 509650c808..5fa9ecc7e5 100644 --- a/plugins/board-resources/src/components/add-card/AddCard.svelte +++ b/plugins/board-resources/src/components/add-card/AddCard.svelte @@ -28,7 +28,7 @@ let anchorRef: HTMLDivElement const client = getClient() - async function addCard(title: string) { + async function addCard (title: string) { const newCardId = generateId() as Ref const sequence = await client.findOne(task.class.Sequence, { attachedTo: board.class.Card }) @@ -58,7 +58,7 @@ return client.addCollection(board.class.Card, space, space, board.class.Board, 'cards', value, newCardId) } - async function addCards(title: string, checkNewLine: boolean = false) { + async function addCards (title: string, checkNewLine: boolean = false) { if (!checkNewLine) { return addCard(title.replace('\n', ' ')) } diff --git a/plugins/board-resources/src/components/add-card/AddCardEditor.svelte b/plugins/board-resources/src/components/add-card/AddCardEditor.svelte index 9e4a8616b8..8025065ee0 100644 --- a/plugins/board-resources/src/components/add-card/AddCardEditor.svelte +++ b/plugins/board-resources/src/components/add-card/AddCardEditor.svelte @@ -1,4 +1,4 @@ - - +
-
+