2022-06-06 13:44:21 +00:00
|
|
|
<script lang="ts">
|
|
|
|
import { Ref } from '@anticrm/core'
|
|
|
|
import { createQuery, getClient } from '@anticrm/presentation'
|
|
|
|
import { StyledTextBox } from '@anticrm/text-editor'
|
|
|
|
import { Project } from '@anticrm/tracker'
|
|
|
|
import { EditBox, getCurrentLocation } from '@anticrm/ui'
|
|
|
|
import { DocAttributeBar } from '@anticrm/view-resources'
|
2022-06-08 14:03:26 +00:00
|
|
|
import IssuesView from '../issues/IssuesView.svelte'
|
2022-06-06 13:44:21 +00:00
|
|
|
|
|
|
|
import tracker from '../../plugin'
|
|
|
|
|
|
|
|
let object: Project | undefined
|
|
|
|
$: project = getCurrentLocation().path[3] as Ref<Project>
|
|
|
|
|
|
|
|
const client = getClient()
|
|
|
|
const projectQuery = createQuery()
|
|
|
|
$: projectQuery.query(tracker.class.Project, { _id: project }, (result) => {
|
|
|
|
;[object] = result
|
|
|
|
})
|
|
|
|
|
|
|
|
async function change (field: string, value: any) {
|
|
|
|
if (object) {
|
|
|
|
await client.update(object, { [field]: value })
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
{#if object}
|
2022-06-08 14:03:26 +00:00
|
|
|
<IssuesView currentSpace={object.space} query={{ project }} label={object.label}>
|
2022-06-06 13:44:21 +00:00
|
|
|
<svelte:fragment slot="aside">
|
|
|
|
<div class="flex-row p-4">
|
|
|
|
<div class="fs-title text-xl">
|
|
|
|
<EditBox bind:value={object.label} maxWidth="39rem" on:change={() => change('label', object?.label)} />
|
|
|
|
</div>
|
|
|
|
<div class="mt-2">
|
|
|
|
<StyledTextBox
|
|
|
|
alwaysEdit={true}
|
|
|
|
showButtons={false}
|
|
|
|
placeholder={tracker.string.Description}
|
|
|
|
content={object.description ?? ''}
|
|
|
|
on:value={(evt) => change('description', evt.detail)}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<DocAttributeBar {object} mixins={[]} ignoreKeys={['icon', 'label', 'description']} />
|
|
|
|
</div>
|
|
|
|
</svelte:fragment>
|
2022-06-08 14:03:26 +00:00
|
|
|
</IssuesView>
|
2022-06-06 13:44:21 +00:00
|
|
|
{/if}
|