Fix formatting issues (#1617)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2022-04-30 00:40:51 +07:00 committed by GitHub
parent be49938461
commit e253148103
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 85 additions and 72 deletions

View File

@ -1,29 +1,33 @@
<script lang="ts">
import { Ref, Space } from '@anticrm/core'
import { Button } from '@anticrm/ui'
import board from '../plugin'
import CardsArchive from './CardArchive.svelte'
import ListArchive from './ListArchive.svelte'
import TextArea from '@anticrm/ui/src/components/TextArea.svelte'
import { Ref, Space } from '@anticrm/core'
import { Button } from '@anticrm/ui'
import board from '../plugin'
import CardsArchive from './CardArchive.svelte'
import ListArchive from './ListArchive.svelte'
import TextArea from '@anticrm/ui/src/components/TextArea.svelte'
export let space: Ref<Space>
export let space: Ref<Space>
let isCardArchive = true
let search: string = ''
$: query = { space, title: { $like: '%' + search + '%' } }
$: label = isCardArchive
? board.string.SwitchToLists
: board.string.SwitchToCards
let isCardArchive = true
let search: string = ''
$: query = { space, title: { $like: '%' + search + '%' } }
$: label = isCardArchive ? board.string.SwitchToLists : board.string.SwitchToCards
</script>
<div class="p-4">
<Button {label} width={'100%'} on:click={() => { isCardArchive = !isCardArchive }} />
<div class="pt-4">
<TextArea bind:value={search} placeholder={board.string.SearchArchive}/>
</div>
<Button
{label}
width={'100%'}
on:click={() => {
isCardArchive = !isCardArchive
}}
/>
<div class="pt-4">
<TextArea bind:value={search} placeholder={board.string.SearchArchive} />
</div>
</div>
{#if isCardArchive}
<CardsArchive {query}/>
<CardsArchive {query} />
{:else}
<ListArchive {query}/>
<ListArchive {query} />
{/if}

View File

@ -9,7 +9,9 @@
let space: Space
const query = createQuery()
$: query.query(core.class.Space, { _id: spaceId }, result => { space = result[0] })
$: query.query(core.class.Space, { _id: spaceId }, (result) => {
space = result[0]
})
const client = getClient()
@ -22,7 +24,7 @@
<div class="ac-header divide full">
{#if space}
<Header icon={classIcon(client, space._class)} label={space.name} description={space.description}/>
<Button label={border.string.ShowMenu} on:click={showMenu}/>
<Header icon={classIcon(client, space._class)} label={space.name} description={space.description} />
<Button label={border.string.ShowMenu} on:click={showMenu} />
{/if}
</div>

View File

@ -1,52 +1,53 @@
<script lang="ts">
import { Ref, Space } from '@anticrm/core'
import Label from '@anticrm/ui/src/components/Label.svelte'
import board from '../plugin'
import { createQuery } from '@anticrm/presentation'
import { MenuPage } from '@anticrm/board'
import { Button, Component, IconBack, IconClose } from '@anticrm/ui'
import { createEventDispatcher } from 'svelte'
import { Ref, Space } from '@anticrm/core'
import Label from '@anticrm/ui/src/components/Label.svelte'
import board from '../plugin'
import { createQuery } from '@anticrm/presentation'
import { MenuPage } from '@anticrm/board'
import { Button, Component, IconBack, IconClose } from '@anticrm/ui'
import { createEventDispatcher } from 'svelte'
export let currentSpace: Ref<Space> | undefined
export let currentSpace: Ref<Space> | undefined
const dispatch = createEventDispatcher()
let currentPageId = board.menuPageId.Main
let trace: string[] = []
let page: MenuPage
const query = createQuery()
$: query.query(board.class.MenuPage, { pageId: currentPageId }, result => {
;[page] = result
})
function setKey (e: CustomEvent) {
trace = [currentPageId, ...trace]
currentPageId = e.detail
}
function onBack () {
[currentPageId = board.menuPageId.Main, ...trace] = trace
}
const dispatch = createEventDispatcher()
let currentPageId = board.menuPageId.Main
let trace: string[] = []
let page: MenuPage
const query = createQuery()
$: query.query(board.class.MenuPage, { pageId: currentPageId }, (result) => {
;[page] = result
})
function setKey (e: CustomEvent) {
trace = [currentPageId, ...trace]
currentPageId = e.detail
}
function onBack () {
;[currentPageId = board.menuPageId.Main, ...trace] = trace
}
</script>
{#if page}
<div class="ac-header flex-between w-full divide">
{#if trace.length}
<Button icon={IconBack} kind="transparent" size="x-large" on:click={onBack} />
{:else}
<div class="ml-12"/>
{/if}
<div class="flex-center fs-title">
<Label label={page.label} />
</div>
<Button
icon={IconClose}
kind="transparent"
size="x-large"
on:click={() => {
dispatch('close')
}} />
</div>
{#if currentSpace}
<div class="vScroll mb-4">
<Component is={page.component} props={{ space: currentSpace }} on:change={setKey}/>
</div>
<div class="ac-header flex-between w-full divide">
{#if trace.length}
<Button icon={IconBack} kind="transparent" size="x-large" on:click={onBack} />
{:else}
<div class="ml-12" />
{/if}
<div class="flex-center fs-title">
<Label label={page.label} />
</div>
<Button
icon={IconClose}
kind="transparent"
size="x-large"
on:click={() => {
dispatch('close')
}}
/>
</div>
{#if currentSpace}
<div class="vScroll mb-4">
<Component is={page.component} props={{ space: currentSpace }} on:change={setKey} />
</div>
{/if}
{/if}

View File

@ -1,12 +1,18 @@
<script lang="ts">
import { Button } from '@anticrm/ui'
import { createEventDispatcher } from 'svelte'
import board from '@anticrm/board'
import plugin from '../plugin'
import { Button } from '@anticrm/ui'
import { createEventDispatcher } from 'svelte'
import board from '@anticrm/board'
import plugin from '../plugin'
const dispatch = createEventDispatcher()
const dispatch = createEventDispatcher()
</script>
<div class="p-4">
<Button label={plugin.string.Archive} width={'100%'} on:click={() => { dispatch('change', board.menuPageId.Archive) }} />
<Button
label={plugin.string.Archive}
width={'100%'}
on:click={() => {
dispatch('change', board.menuPageId.Archive)
}}
/>
</div>