Signed-off-by: Dvinyanin Alexandr <dvinyanin.alexandr@gmail.com>
This commit is contained in:
Alex 2022-04-18 17:25:52 +07:00 committed by GitHub
parent 2e5069f762
commit ffa04233fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 4 deletions

View File

@ -99,7 +99,9 @@
<div class="text-md font-medium">
<Label label={board.string.Dates} />
</div>
<DatePresenter {value} on:click={dateHandler} />
{#key value.date}
<DatePresenter {value} on:click={dateHandler} />
{/key}
</div>
{/if}
{/if}

View File

@ -1,7 +1,7 @@
<script lang="ts">
import { createEventDispatcher } from 'svelte'
import { Label, Button, DateRangePresenter, CheckBox, Component } from '@anticrm/ui'
import { Card } from '@anticrm/board'
import { Card, CardDate } from '@anticrm/board'
import calendar from '@anticrm/calendar'
import board from '../../plugin'
import { getClient } from '@anticrm/presentation';
@ -19,6 +19,13 @@
let savedDueDate = object.date?.dueDate ?? Date.now()
let dueDateEnabled = dueDate !== undefined
$: dueDate && (savedDueDate = dueDate)
function update () {
const date: CardDate = {}
if (startDate !== undefined) date.startDate = startDate
if (dueDate !== undefined) date.dueDate = dueDate
client.update(object, {date})
}
</script>
<div class="antiPopup antiPopup-withHeader antiPopup-withTitle antiPopup-withCategory w-85">
@ -70,7 +77,7 @@
size={'small'}
kind={'primary'}
on:click={() => {
client.update(object, {date: {startDate, dueDate}})
update()
dispatch('close')
}}
/>

View File

@ -8,11 +8,16 @@
const client = getClient()
const {date} = value
let isChecked = date?.isChecked
function update(){
if (isChecked === undefined) return
client.update(value, {date: {...date, isChecked}})
}
</script>
{#if date}
<div class="flex-presenter flex-gap-1 h-full">
<CheckBox bind:checked={isChecked} on:value={() => client.update(value, {date: {...date, isChecked}})}/>
<CheckBox bind:checked={isChecked} on:value={update}/>
<div class="flex-center h-full" on:click>
<div class="flex-row-center background-button-bg-color border-radius-1 w-full">
{#if date.startDate}