UBERF-7794: Restore related issues control (#6244)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2024-08-05 12:37:34 +07:00 committed by GitHub
parent 576027f98b
commit 8667b7482d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 62 additions and 8 deletions

View File

@ -227,6 +227,12 @@ export function createModel (builder: Builder): void {
'status',
'attachments',
'comments',
{
key: '',
label: tracker.string.RelatedIssues,
presenter: tracker.component.RelatedIssueSelector,
displayProps: { key: 'related', suffix: true }
},
'modifiedOn',
{
key: '$lookup.attachedTo.$lookup.channels',
@ -294,6 +300,12 @@ export function createModel (builder: Builder): void {
},
{ key: 'attachments', displayProps: { key: 'attachments', suffix: true } },
{ key: 'comments', displayProps: { key: 'comments', suffix: true } },
{
key: '',
label: tracker.string.RelatedIssues,
presenter: tracker.component.RelatedIssueSelector,
displayProps: { key: 'related', suffix: true }
},
{ key: '', displayProps: { grow: true } },
{
key: '$lookup.attachedTo.$lookup.channels',
@ -441,7 +453,7 @@ export function createModel (builder: Builder): void {
groupDepth: 1
},
options: lookupLeadOptions,
config: ['attachedTo', 'attachments', 'comments', 'dueDate', 'assignee'],
config: ['attachedTo', 'status', 'attachments', 'comments', 'dueDate', 'assignee'],
configOptions: {
strict: true
}

View File

@ -21,6 +21,7 @@ import calendar from '@hcengineering/model-calendar'
import chunter from '@hcengineering/model-chunter'
import contact from '@hcengineering/model-contact'
import core from '@hcengineering/model-core'
import gmail from '@hcengineering/model-gmail'
import { generateClassNotificationTypes } from '@hcengineering/model-notification'
import presentation from '@hcengineering/model-presentation'
import tags from '@hcengineering/model-tags'
@ -33,7 +34,6 @@ import { type IntlString } from '@hcengineering/platform'
import { recruitId, type Applicant } from '@hcengineering/recruit'
import setting from '@hcengineering/setting'
import { type KeyBinding, type ViewOptionModel, type ViewOptionsModel } from '@hcengineering/view'
import gmail from '@hcengineering/model-gmail'
import recruit from './plugin'
import { createReviewModel, reviewTableConfig, reviewTableOptions } from './review'
@ -475,6 +475,12 @@ export function createModel (builder: Builder): void {
'status',
'attachments',
'comments',
{
key: '',
label: tracker.string.RelatedIssues,
presenter: tracker.component.RelatedIssueSelector,
displayProps: { key: 'related', suffix: true }
},
'modifiedOn',
'$lookup.space.company',
{
@ -604,6 +610,12 @@ export function createModel (builder: Builder): void {
},
{ key: 'attachments', displayProps: { key: 'attachments', suffix: true } },
{ key: 'comments', displayProps: { key: 'comments', suffix: true } },
{
key: '',
label: tracker.string.RelatedIssues,
presenter: tracker.component.RelatedIssueSelector,
displayProps: { key: 'related', suffix: true }
},
{ key: '', displayProps: { grow: true } },
{
key: '$lookup.space.company',

View File

@ -52,6 +52,7 @@
"@hcengineering/presentation": "^0.6.3",
"@hcengineering/task": "^0.6.20",
"@hcengineering/task-resources": "^0.6.0",
"@hcengineering/tracker": "^0.6.24",
"@hcengineering/text-editor-resources": "^0.6.0",
"@hcengineering/ui": "^0.6.15",
"@hcengineering/view": "^0.6.13",

View File

@ -23,16 +23,18 @@
import notification from '@hcengineering/notification'
import { getClient } from '@hcengineering/presentation'
import task from '@hcengineering/task'
import { AssigneePresenter } from '@hcengineering/task-resources'
import { AssigneePresenter, StateRefPresenter } from '@hcengineering/task-resources'
import { ActionIcon, Component, DueDatePresenter, IconMoreH } from '@hcengineering/ui'
import { BuildModelKey } from '@hcengineering/view'
import { enabledConfig, openDoc, showMenu, statusStore } from '@hcengineering/view-resources'
import tracker from '@hcengineering/tracker'
import lead from '../plugin'
import LeadPresenter from './LeadPresenter.svelte'
export let object: WithLookup<Lead>
export let config: (string | BuildModelKey)[]
export let groupByKey: string
const client = getClient()
const assigneeAttribute = client.getHierarchy().getAttribute(lead.class.Lead, 'assignee')
@ -69,8 +71,21 @@
<ContactPresenter value={object.$lookup.attachedTo} avatarSize={'small'} />
{/if}
</div>
{#if enabledConfig(config, 'dueDate')}
<div class="card-labels labels mb-2">
<div class="card-labels mb-2">
{#if groupByKey !== 'status' && enabledConfig(config, 'status')}
<StateRefPresenter
size={'small'}
kind={'link-bordered'}
space={object.space}
shrink={1}
value={object.status}
onChange={(status) => {
client.update(object, { status })
}}
/>
{/if}
<Component showLoading={false} is={tracker.component.RelatedIssueSelector} props={{ object, size: 'small' }} />
{#if enabledConfig(config, 'dueDate')}
<DueDatePresenter
size={'small'}
kind={'link-bordered'}
@ -82,8 +97,8 @@
await client.update(object, { dueDate: e })
}}
/>
</div>
{/if}
{/if}
</div>
<div class="flex-between">
<div class="flex-row-center gap-3 reverse mr-4">
<LeadPresenter value={object} />
@ -105,3 +120,17 @@
{/if}
</div>
</div>
<style lang="scss">
.card-labels {
display: flex;
flex-wrap: nowrap;
min-width: 0;
&.labels {
overflow: hidden;
flex-shrink: 1;
border-radius: 0.5rem;
}
}
</style>

View File

@ -111,7 +111,7 @@
}}
/>
{/if}
<!-- <Component showLoading={false} is={tracker.component.RelatedIssueSelector} props={{ object, size: 'small' }} /> -->
<Component showLoading={false} is={tracker.component.RelatedIssueSelector} props={{ object, size: 'small' }} />
{#if enabledConfig(config, 'dueDate')}
<DueDatePresenter
size={'small'}