mirror of
https://github.com/hcengineering/platform.git
synced 2025-06-08 00:37:42 +00:00
Tasks custom attributes hot fix (#1667)
Signed-off-by: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com>
This commit is contained in:
parent
612f36c079
commit
a58d0d9374
@ -15,14 +15,17 @@
|
|||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import contact from '@anticrm/contact'
|
import contact from '@anticrm/contact'
|
||||||
import core, { Class, Doc, Ref, RefTo } from '@anticrm/core'
|
import core, { Class, Doc, Mixin, Ref, RefTo } from '@anticrm/core'
|
||||||
import { AttributesBar, getClient, KeyedAttribute, UserBox } from '@anticrm/presentation'
|
import { AttributesBar, getClient, KeyedAttribute, UserBox } from '@anticrm/presentation'
|
||||||
import { Label } from '@anticrm/ui'
|
import { Label } from '@anticrm/ui'
|
||||||
import { Task } from '@anticrm/task'
|
import { Task } from '@anticrm/task'
|
||||||
import task from '../plugin'
|
import task from '../plugin'
|
||||||
|
import { DocAttributeBar } from '@anticrm/view-resources'
|
||||||
|
|
||||||
export let object: Task
|
export let object: Task
|
||||||
export let keys: KeyedAttribute[]
|
export let keys: KeyedAttribute[]
|
||||||
|
export let mixins: Mixin<Doc>[]
|
||||||
|
export let ignoreKeys: string[]
|
||||||
export let vertical: boolean = false
|
export let vertical: boolean = false
|
||||||
|
|
||||||
const client = getClient()
|
const client = getClient()
|
||||||
@ -51,7 +54,9 @@
|
|||||||
return contact.class.Employee
|
return contact.class.Employee
|
||||||
}
|
}
|
||||||
|
|
||||||
$: filtredKeys = keys.filter((p) => p.key !== 'state' && p.key !== 'assignee' && p.key !== 'doneState') // todo
|
const taskKeys = ['state', 'assignee', 'doneState']
|
||||||
|
|
||||||
|
$: filtredKeys = keys.filter((p) => !taskKeys.includes(p.key)) // todo
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if !vertical}
|
{#if !vertical}
|
||||||
@ -73,7 +78,7 @@
|
|||||||
<AttributesBar {object} keys={['doneState', 'state']} showHeader={false} />
|
<AttributesBar {object} keys={['doneState', 'state']} showHeader={false} />
|
||||||
</div>
|
</div>
|
||||||
{:else}
|
{:else}
|
||||||
<div class="task-attr-prop">
|
<div class="task-attr-prop mb-4">
|
||||||
<span class="fs-bold"><Label label={task.string.TaskAssignee} /></span>
|
<span class="fs-bold"><Label label={task.string.TaskAssignee} /></span>
|
||||||
<UserBox
|
<UserBox
|
||||||
_class={getAssigneeClass(object)}
|
_class={getAssigneeClass(object)}
|
||||||
@ -88,9 +93,9 @@
|
|||||||
/>
|
/>
|
||||||
<div style:grid-column={'1/3'}>
|
<div style:grid-column={'1/3'}>
|
||||||
<AttributesBar {object} keys={['doneState', 'state']} vertical />
|
<AttributesBar {object} keys={['doneState', 'state']} vertical />
|
||||||
<AttributesBar {object} keys={filtredKeys} vertical />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<DocAttributeBar {object} ignoreKeys={[...ignoreKeys, ...taskKeys]} {mixins} on:update />
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
@ -240,7 +240,11 @@
|
|||||||
<svelte:fragment slot="attributes" let:direction={dir}>
|
<svelte:fragment slot="attributes" let:direction={dir}>
|
||||||
{#if !headerLoading}
|
{#if !headerLoading}
|
||||||
{#if headerEditor !== undefined}
|
{#if headerEditor !== undefined}
|
||||||
<Component is={headerEditor} props={{ object, keys, vertical: dir === 'column' }} />
|
<Component
|
||||||
|
is={headerEditor}
|
||||||
|
props={{ object, keys, mixins, ignoreKeys, vertical: dir === 'column' }}
|
||||||
|
on:update={updateKeys}
|
||||||
|
/>
|
||||||
{:else if dir === 'column'}
|
{:else if dir === 'column'}
|
||||||
<DocAttributeBar {object} {mixins} {ignoreKeys} on:update={updateKeys} />
|
<DocAttributeBar {object} {mixins} {ignoreKeys} on:update={updateKeys} />
|
||||||
{:else}
|
{:else}
|
||||||
|
@ -43,6 +43,7 @@ import StringTypeEditor from './components/typeEditors/StringTypeEditor.svelte'
|
|||||||
import BooleanTypeEditor from './components/typeEditors/BooleanTypeEditor.svelte'
|
import BooleanTypeEditor from './components/typeEditors/BooleanTypeEditor.svelte'
|
||||||
import DateTypeEditor from './components/typeEditors/DateTypeEditor.svelte'
|
import DateTypeEditor from './components/typeEditors/DateTypeEditor.svelte'
|
||||||
import NumberTypeEditor from './components/typeEditors/NumberTypeEditor.svelte'
|
import NumberTypeEditor from './components/typeEditors/NumberTypeEditor.svelte'
|
||||||
|
import DocAttributeBar from './components/DocAttributeBar.svelte'
|
||||||
|
|
||||||
export { getActions } from './actions'
|
export { getActions } from './actions'
|
||||||
export { default as ActionContext } from './components/ActionContext.svelte'
|
export { default as ActionContext } from './components/ActionContext.svelte'
|
||||||
@ -53,7 +54,7 @@ export { default as LinkPresenter } from './components/LinkPresenter.svelte'
|
|||||||
export * from './context'
|
export * from './context'
|
||||||
export * from './selection'
|
export * from './selection'
|
||||||
export { buildModel, getCollectionCounter, getObjectPresenter, LoadingProps } from './utils'
|
export { buildModel, getCollectionCounter, getObjectPresenter, LoadingProps } from './utils'
|
||||||
export { Table, TableView, EditDoc, ColorsPopup, Menu, SpacePresenter, UpDownNavigator }
|
export { Table, TableView, DocAttributeBar, EditDoc, ColorsPopup, Menu, SpacePresenter, UpDownNavigator }
|
||||||
|
|
||||||
export default async (): Promise<Resources> => ({
|
export default async (): Promise<Resources> => ({
|
||||||
actionImpl: actionImpl,
|
actionImpl: actionImpl,
|
||||||
|
Loading…
Reference in New Issue
Block a user