diff --git a/models/calendar/src/index.ts b/models/calendar/src/index.ts index 94d0eda178..18e32499e9 100644 --- a/models/calendar/src/index.ts +++ b/models/calendar/src/index.ts @@ -120,7 +120,9 @@ export function createModel (builder: Builder): void { descriptor: calendar.viewlet.Calendar, // eslint-disable-next-line @typescript-eslint/consistent-type-assertions config: [''], - hiddenKeys: ['title', 'date'] + configOptions: { + hiddenKeys: ['title', 'date'] + } }, calendar.viewlet.CalendarEvent ) diff --git a/models/contact/src/index.ts b/models/contact/src/index.ts index aebb02eb8d..91e3a5e64c 100644 --- a/models/contact/src/index.ts +++ b/models/contact/src/index.ts @@ -253,7 +253,9 @@ export function createModel (builder: Builder): void { }, 'modifiedOn' ], - hiddenKeys: ['name', 'contact'] + configOptions: { + hiddenKeys: ['name', 'contact'] + } }, contact.viewlet.TableMember ) @@ -282,7 +284,9 @@ export function createModel (builder: Builder): void { sortingKey: ['$lookup.channels.lastMessage', 'channels'] } ], - hiddenKeys: ['name'] + configOptions: { + hiddenKeys: ['name'] + } }, contact.viewlet.TableContact ) diff --git a/models/hr/src/index.ts b/models/hr/src/index.ts index 91b85c5d3d..f20c72f7e9 100644 --- a/models/hr/src/index.ts +++ b/models/hr/src/index.ts @@ -391,8 +391,7 @@ export function createModel (builder: Builder): void { sortingKey: ['$lookup.channels.lastMessage', 'channels'] }, 'modifiedOn' - ], - hiddenKeys: [] + ] }, hr.viewlet.TableMember ) @@ -403,8 +402,7 @@ export function createModel (builder: Builder): void { { attachTo: hr.mixin.Staff, descriptor: view.viewlet.Table, - config: [''], - hiddenKeys: [] + config: [''] }, hr.viewlet.StaffStats ) diff --git a/models/lead/src/index.ts b/models/lead/src/index.ts index 06566b8d26..f90855a83a 100644 --- a/models/lead/src/index.ts +++ b/models/lead/src/index.ts @@ -208,7 +208,9 @@ export function createModel (builder: Builder): void { sortingKey: ['$lookup.channels.lastMessage', 'channels'] } ], - hiddenKeys: ['name'], + configOptions: { + hiddenKeys: ['name'] + }, options: { lookup: { _id: { @@ -288,50 +290,56 @@ export function createModel (builder: Builder): void { { attachTo: lead.class.Lead, descriptor: view.viewlet.List, + configOptions: { + hiddenKeys: ['title'], + extraProps: { + displayProps: { + optional: true + } + } + }, config: [ - { key: '', props: { listProps: { fixed: 'left', key: 'lead' } } }, + { key: '', displayProps: { fixed: 'left', key: 'lead' } }, { key: '', presenter: lead.component.TitlePresenter, - props: { listProps: { fixed: 'left', key: 'title' }, maxWidth: '10rem' } + label: lead.string.Title, + displayProps: { fixed: 'left', key: 'title' }, + props: { maxWidth: '10rem' } }, { key: '$lookup.attachedTo', presenter: contact.component.PersonPresenter, label: lead.string.Customer, sortingKey: '$lookup.attachedTo.name', + displayProps: { fixed: 'left', key: 'talent' }, props: { _class: lead.mixin.Customer, - listProps: { fixed: 'left', key: 'talent' }, inline: true, maxWidth: '10rem' } }, - { key: 'state', props: { listProps: { fixed: 'left', key: 'state' } } }, + { key: 'state', displayProps: { fixed: 'left', key: 'state' } }, { key: '', presenter: tracker.component.RelatedIssueSelector, label: tracker.string.Relations, - props: { listProps: { fixed: 'left', key: 'issues' } } + displayProps: { fixed: 'left', key: 'issues' } }, - { key: 'attachments', props: { listProps: { fixed: 'left', key: 'attachments' } } }, - { key: 'comments', props: { listProps: { fixed: 'left' }, key: 'comments' } }, - { key: '', presenter: view.component.GrowPresenter, props: { type: 'grow' } }, - { key: '', presenter: view.component.DividerPresenter, props: { type: 'divider' } }, + { key: 'attachments', displayProps: { fixed: 'left', key: 'attachments' } }, + { key: 'comments', displayProps: { fixed: 'left', key: 'comments' } }, { key: '$lookup.attachedTo.$lookup.channels', label: contact.string.ContactInfo, sortingKey: ['$lookup.attachedTo.$lookup.channels.lastMessage', '$lookup.attachedTo.channels'], - props: { - listProps: { - fixed: 'left', - key: 'channels' - } + displayProps: { + fixed: 'left', + key: 'channels', + dividerBefore: true } }, - { key: '', presenter: view.component.DividerPresenter, props: { type: 'divider' } }, - { key: 'modifiedOn', props: { listProps: { key: 'modified', fixed: 'left' } } }, - { key: 'assignee', props: { listProps: { key: 'assignee', fixed: 'right' }, shouldShowLabel: false } } + { key: 'modifiedOn', displayProps: { key: 'modified', fixed: 'left', dividerBefore: true } }, + { key: 'assignee', displayProps: { key: 'assignee', fixed: 'right' }, props: { shouldShowLabel: false } } ], viewOptions: leadViewOptions }, @@ -399,7 +407,10 @@ export function createModel (builder: Builder): void { groupDepth: 1 }, options: lookupLeadOptions, - config: [] + config: ['attachedTo', 'attachments', 'comments', 'dueDate', 'assignee'], + configOptions: { + strict: true + } }, lead.viewlet.KanbanLead ) diff --git a/models/recruit/src/index.ts b/models/recruit/src/index.ts index de2d2c6720..b91a6644aa 100644 --- a/models/recruit/src/index.ts +++ b/models/recruit/src/index.ts @@ -399,7 +399,9 @@ export function createModel (builder: Builder): void { sortingKey: ['$lookup.channels.lastMessage', 'channels'] } ], - hiddenKeys: ['name'], + configOptions: { + hiddenKeys: ['name'] + }, options: { lookup: { _id: { @@ -457,7 +459,9 @@ export function createModel (builder: Builder): void { label: core.string.ModifiedDate } ], - hiddenKeys: ['name', 'space', 'modifiedOn'] + configOptions: { + hiddenKeys: ['name', 'space', 'modifiedOn'] + } }, recruit.viewlet.TableVacancy ) @@ -487,7 +491,9 @@ export function createModel (builder: Builder): void { label: core.string.ModifiedDate } ], - hiddenKeys: ['name', 'space', 'modifiedOn'] + configOptions: { + hiddenKeys: ['name', 'space', 'modifiedOn'] + } }, recruit.viewlet.TableVacancyList ) @@ -526,7 +532,9 @@ export function createModel (builder: Builder): void { sortingKey: ['$lookup.attachedTo.$lookup.channels.lastMessage', '$lookup.attachedTo.channels'] } ], - hiddenKeys: ['name', 'attachedTo'], + configOptions: { + hiddenKeys: ['name', 'attachedTo'] + }, options: { lookup: { _id: { @@ -579,7 +587,9 @@ export function createModel (builder: Builder): void { space: recruit.class.Vacancy } }, - hiddenKeys: ['name', 'attachedTo'], + configOptions: { + hiddenKeys: ['name', 'attachedTo'] + }, baseQuery: { doneState: null, '$lookup.space.archived': false @@ -595,7 +605,6 @@ export function createModel (builder: Builder): void { attachTo: recruit.class.ApplicantMatch, descriptor: view.viewlet.Table, config: ['', 'response', 'attachedTo', 'space', 'modifiedOn'], - hiddenKeys: [], options: { lookup: { space: recruit.class.Vacancy @@ -657,23 +666,23 @@ export function createModel (builder: Builder): void { attachTo: recruit.class.Applicant, descriptor: view.viewlet.List, config: [ - { key: '', props: { listProps: { fixed: 'left', key: 'app' } } }, + { key: '', displayProps: { fixed: 'left', key: 'app' } }, { key: '$lookup.attachedTo', presenter: contact.component.PersonPresenter, label: recruit.string.Talent, sortingKey: '$lookup.attachedTo.name', + displayProps: { fixed: 'left', key: 'talent' }, props: { _class: recruit.mixin.Candidate, - listProps: { fixed: 'left', key: 'talent' }, inline: true } }, - { key: 'state', props: { listProps: { fixed: 'left', key: 'state' }, inline: true, showLabel: false } }, + { key: 'state', displayProps: { fixed: 'left', key: 'state' }, props: { inline: true, showLabel: false } }, { key: '$lookup.space.company', + displayProps: { fixed: 'left', key: 'company' }, props: { - listProps: { fixed: 'left', key: 'company' }, inline: true, maxWidth: '10rem' } @@ -682,26 +691,26 @@ export function createModel (builder: Builder): void { key: '', presenter: tracker.component.RelatedIssueSelector, label: tracker.string.Issues, - props: { listProps: { fixed: 'left', key: 'issues' } } + displayProps: { fixed: 'left', key: 'issues' } }, - { key: 'attachments', props: { listProps: { fixed: 'left', key: 'attachments' } } }, - { key: 'comments', props: { listProps: { fixed: 'left' }, key: 'comments' } }, - { key: '', presenter: view.component.GrowPresenter, props: { type: 'grow' } }, - { key: '', presenter: view.component.DividerPresenter, props: { type: 'divider' } }, + { key: 'attachments', displayProps: { fixed: 'left', key: 'attachments' } }, + { key: 'comments', displayProps: { fixed: 'left', key: 'comments' } }, { key: '$lookup.attachedTo.$lookup.channels', label: contact.string.ContactInfo, sortingKey: ['$lookup.attachedTo.$lookup.channels.lastMessage', '$lookup.attachedTo.channels'], props: { - listProps: { - fixed: 'left', - key: 'channels' - } + length: 'full', + size: 'inline' + }, + displayProps: { + fixed: 'left', + key: 'channels', + dividerBefore: true } }, - { key: '', presenter: view.component.DividerPresenter, props: { type: 'divider' } }, - { key: 'modifiedOn', props: { listProps: { key: 'modified', fixed: 'left' } } }, - { key: 'assignee', props: { listProps: { key: 'assignee', fixed: 'right' }, shouldShowLabel: false } } + { key: 'modifiedOn', displayProps: { key: 'modified', fixed: 'left', dividerBefore: true } }, + { key: 'assignee', displayProps: { key: 'assignee', fixed: 'right' }, props: { shouldShowLabel: false } } ], options: { lookup: { @@ -711,7 +720,14 @@ export function createModel (builder: Builder): void { space: recruit.class.Vacancy } }, - hiddenKeys: ['name', 'attachedTo'], + configOptions: { + hiddenKeys: ['name', 'attachedTo'], + extraProps: { + displayProps: { + optional: true + } + } + }, baseQuery: { doneState: null, '$lookup.space.archived': false @@ -739,7 +755,25 @@ export function createModel (builder: Builder): void { options: { lookup: applicantKanbanLookup }, - config: [] + configOptions: { + strict: true + }, + config: [ + 'space', + 'assignee', + 'state', + 'attachments', + 'dueDate', + 'comments', + { + key: 'company', + label: recruit.string.Company + }, + { + key: 'channels', + label: contact.string.ContactInfo + } + ] }, recruit.viewlet.ApplicantKanban ) diff --git a/models/tracker/src/index.ts b/models/tracker/src/index.ts index 1df5aeb0eb..f181497933 100644 --- a/models/tracker/src/index.ts +++ b/models/tracker/src/index.ts @@ -487,86 +487,125 @@ export function createModel (builder: Builder): void { attachTo: tracker.class.Issue, descriptor: view.viewlet.List, viewOptions: issuesOptions(false), + configOptions: { + hiddenKeys: [ + 'title', + 'blockedBy', + 'relations', + 'description', + 'number', + 'titile', + 'reportedTime', + 'reports', + 'priority', + 'component', + 'milestone', + 'estimation', + 'status', + 'dueDate', + 'attachedTo' + ], + extraProps: { + displayProps: { + optional: true + } + } + }, config: [ { key: '', + label: tracker.string.Priority, presenter: tracker.component.PriorityEditor, - props: { type: 'priority', kind: 'list', size: 'small' } + props: { type: 'priority', kind: 'list', size: 'small' }, + displayProps: { key: 'priority' } }, { key: '', + label: tracker.string.Identifier, presenter: tracker.component.IssuePresenter, - props: { type: 'issue', listProps: { key: 'issue', fixed: 'left' } } + displayProps: { key: 'issue', fixed: 'left' } }, { key: '', + label: tracker.string.Status, presenter: tracker.component.StatusEditor, - props: { kind: 'list', size: 'small', justify: 'center' } + props: { kind: 'list', size: 'small', justify: 'center' }, + displayProps: { + key: 'status' + } }, - { key: '', presenter: tracker.component.TitlePresenter, props: {} }, - { key: '', presenter: tracker.component.SubIssuesSelector, props: {} }, - { key: '', presenter: view.component.GrowPresenter, props: { type: 'grow' } }, + { + key: '', + label: tracker.string.Title, + presenter: tracker.component.TitlePresenter, + props: {}, + displayProps: { key: 'title' } + }, + { key: '', label: tracker.string.SubIssues, presenter: tracker.component.SubIssuesSelector, props: {} }, { key: 'labels', presenter: tags.component.LabelsPresenter, - props: { kind: 'list', full: false, listProps: { optional: true, compression: true } } + displayProps: { optional: true, compression: true }, + props: { kind: 'list', full: false } }, { key: '', + label: tracker.string.DueDate, presenter: tracker.component.DueDatePresenter, - props: { kind: 'list', listProps: { optional: true, compression: true } } + displayProps: { key: 'dueDate', optional: true, compression: true }, + props: { kind: 'list' } }, { key: '', + label: tracker.string.Component, presenter: tracker.component.ComponentEditor, props: { kind: 'list', size: 'small', shape: 'round', - shouldShowPlaceholder: false, - listProps: { - excludeByKey: 'component', - compression: true, - optional: true - } + shouldShowPlaceholder: false + }, + displayProps: { + key: 'component', + excludeByKey: 'component', + compression: true, + optional: true } }, { key: '', + label: tracker.string.Milestone, presenter: tracker.component.MilestoneEditor, props: { kind: 'list', size: 'small', shape: 'round', - shouldShowPlaceholder: false, - listProps: { - excludeByKey: 'milestone', - compression: true, - optional: true - } + shouldShowPlaceholder: false + }, + displayProps: { + key: 'milestone', + excludeByKey: 'milestone', + compression: true, + optional: true } }, { key: '', - presenter: view.component.DividerPresenter, - props: { type: 'divider', listProps: { compression: true } } - }, - { - key: '', + label: tracker.string.Estimation, presenter: tracker.component.EstimationEditor, - props: { kind: 'list', size: 'small', listProps: { key: 'estimation', fixed: 'left', compression: true } } + props: { kind: 'list', size: 'small' }, + displayProps: { key: 'estimation', fixed: 'left', compression: true, dividerBefore: true } }, - { key: '', presenter: view.component.DividerPresenter, props: { type: 'divider' } }, { key: 'modifiedOn', presenter: tracker.component.ModificationDatePresenter, - props: { listProps: { key: 'modified', fixed: 'left' } } + displayProps: { key: 'modified', fixed: 'left', dividerBefore: true } }, { key: 'assignee', presenter: tracker.component.AssigneePresenter, + displayProps: { key: 'assigee', fixed: 'right' }, props: { - listProps: { key: 'assigee', fixed: 'right' }, key: 'assignee', defaultClass: contact.class.Employee, shouldShowLabel: false @@ -613,7 +652,8 @@ export function createModel (builder: Builder): void { { key: '', presenter: tracker.component.IssuePresenter, - props: { type: 'issue', listProps: { fixed: 'left' } } + props: { type: 'issue' }, + displayProps: { fixed: 'left' } }, { key: '', @@ -622,8 +662,11 @@ export function createModel (builder: Builder): void { }, { key: '', presenter: tracker.component.TitlePresenter, props: { shouldUseMargin: true, showParent: false } }, { key: '', presenter: tracker.component.SubIssuesSelector, props: {} }, - { key: '', presenter: view.component.GrowPresenter, props: { type: 'grow' } }, - { key: '', presenter: tracker.component.DueDatePresenter, props: { kind: 'list' } }, + { + key: '', + presenter: tracker.component.DueDatePresenter, + props: { kind: 'list' } + }, { key: '', presenter: tracker.component.MilestoneEditor, @@ -631,22 +674,23 @@ export function createModel (builder: Builder): void { kind: 'list', size: 'small', shape: 'round', - shouldShowPlaceholder: false, - listProps: { - excludeByKey: 'milestone', - optional: true - } + shouldShowPlaceholder: false + }, + displayProps: { + excludeByKey: 'milestone', + optional: true } }, { key: '', presenter: tracker.component.EstimationEditor, - props: { kind: 'list', size: 'small', listProps: { optional: true } } + props: { kind: 'list', size: 'small' }, + displayProps: { optional: true } }, { key: 'modifiedOn', presenter: tracker.component.ModificationDatePresenter, - props: { listProps: { fixed: 'right', optional: true } } + displayProps: { fixed: 'right', optional: true } }, { key: 'assignee', @@ -674,6 +718,10 @@ export function createModel (builder: Builder): void { ], other: [showColorsViewOption] }, + configOptions: { + hiddenKeys: ['milestone', 'estimation', 'component', 'title', 'description'], + extraProps: { displayProps: { optional: true } } + }, config: [ // { key: '', presenter: tracker.component.PriorityEditor, props: { kind: 'list', size: 'small' } }, { @@ -681,42 +729,43 @@ export function createModel (builder: Builder): void { presenter: tracker.component.IssueTemplatePresenter, props: { type: 'issue', shouldUseMargin: true } }, - { key: '', presenter: view.component.GrowPresenter, props: { type: 'grow' } }, // { key: '', presenter: tracker.component.DueDatePresenter, props: { kind: 'list' } }, { key: '', presenter: tracker.component.ComponentEditor, + label: tracker.string.Component, props: { kind: 'list', size: 'small', - shouldShowPlaceholder: false, - listProps: { optional: true, compression: true } - } + shouldShowPlaceholder: false + }, + displayProps: { key: 'component', optional: true, compression: true } }, { key: '', + label: tracker.string.Milestone, presenter: tracker.component.MilestoneEditor, props: { kind: 'list', size: 'small', - shouldShowPlaceholder: false, - listProps: { optional: true, compression: true } - } + shouldShowPlaceholder: false + }, + displayProps: { key: 'milestone', optional: true, compression: true } }, { key: '', + label: tracker.string.Estimation, presenter: tracker.component.TemplateEstimationEditor, props: { kind: 'list', - size: 'small', - listProps: { optional: true, compression: true } - } + size: 'small' + }, + displayProps: { key: 'estimation', optional: true, compression: true } }, - { key: '', presenter: view.component.DividerPresenter, props: { type: 'divider' } }, { key: 'modifiedOn', presenter: tracker.component.ModificationDatePresenter, - props: { listProps: { fixed: 'right' } } + displayProps: { fixed: 'right', dividerBefore: true } }, { key: 'assignee', @@ -738,7 +787,10 @@ export function createModel (builder: Builder): void { ...issuesOptions(true), groupDepth: 1 }, - config: [] + configOptions: { + strict: true + }, + config: ['subIssues', 'priority', 'component', 'dueDate', 'labels', 'estimation', 'attachments', 'comments'] }, tracker.viewlet.IssueKanban ) @@ -1807,14 +1859,22 @@ export function createModel (builder: Builder): void { attachTo: tracker.class.Milestone, descriptor: view.viewlet.List, viewOptions: milestoneOptions, + configOptions: { + hiddenKeys: ['targetDate', 'label', 'description'], + extraProps: { displayProps: { optional: true } } + }, config: [ { key: 'status', props: { width: '1rem', kind: 'list', size: 'small', justify: 'center' } }, { key: '', presenter: tracker.component.MilestonePresenter, props: { shouldUseMargin: true } }, - { key: '', presenter: view.component.GrowPresenter, props: { type: 'grow' } }, - { key: '', presenter: tracker.component.MilestoneDatePresenter, props: { field: 'targetDate' } } + { + key: '', + label: tracker.string.TargetDate, + presenter: tracker.component.MilestoneDatePresenter, + props: { field: 'targetDate' } + } ] }, tracker.viewlet.MilestoneList @@ -1879,23 +1939,24 @@ export function createModel (builder: Builder): void { attachTo: tracker.class.Component, descriptor: view.viewlet.List, viewOptions: componentListViewOptions, + configOptions: { + hiddenKeys: ['label', 'description'], + extraProps: { displayProps: { optional: true } } + }, config: [ { key: '', presenter: tracker.component.ComponentPresenter, props: { kind: 'list' } }, - { key: '', presenter: view.component.GrowPresenter, props: { type: 'grow' } }, - { key: '', presenter: view.component.DividerPresenter, props: { type: 'divider' } }, { key: '$lookup.lead', presenter: tracker.component.LeadPresenter, + displayProps: { + dividerBefore: true, + key: 'lead' + }, props: { _class: tracker.class.Component, defaultClass: contact.class.Employee, shouldShowLabel: false } - }, - { - key: '', - presenter: tracker.component.DeleteComponentPresenter, - props: { kind: 'transparent', size: 'small' } } ] }, diff --git a/packages/theme/styles/button.scss b/packages/theme/styles/button.scss index 4c17308f31..8c41c773ca 100644 --- a/packages/theme/styles/button.scss +++ b/packages/theme/styles/button.scss @@ -244,6 +244,9 @@ color: var(--theme-content-color); } } + &.small { + padding: 0 0.25rem; + } } &.link-bordered { padding: 0 0.5rem; diff --git a/packages/ui/src/components/calendar/DatePresenter.svelte b/packages/ui/src/components/calendar/DatePresenter.svelte index 50fdd93760..1f9ba45f67 100644 --- a/packages/ui/src/components/calendar/DatePresenter.svelte +++ b/packages/ui/src/components/calendar/DatePresenter.svelte @@ -134,6 +134,7 @@ } &.small { height: 1.5rem; + padding: 0 0.25rem; } &.medium { height: 2rem; @@ -239,6 +240,10 @@ color: var(--theme-dark-color); border-radius: 0.25rem; + &.small { + padding: 0 0.25rem; + } + .btn-icon { color: var(--theme-darker-color); } diff --git a/plugins/contact-resources/src/components/EmployeeAccountPresenter.svelte b/plugins/contact-resources/src/components/EmployeeAccountPresenter.svelte index 916ecf5bb2..f8ce3a5c62 100644 --- a/plugins/contact-resources/src/components/EmployeeAccountPresenter.svelte +++ b/plugins/contact-resources/src/components/EmployeeAccountPresenter.svelte @@ -28,9 +28,9 @@ export let inline: boolean = false export let accent: boolean = false - $: employee = $employeeByIdStore.get((value as EmployeeAccount).employee) + $: employee = $employeeByIdStore.get((value as EmployeeAccount)?.employee) - const valueLabel = value.email === systemAccountEmail ? core.string.System : getEmbeddedLabel(value.email) + const valueLabel = value?.email === systemAccountEmail ? core.string.System : getEmbeddedLabel(value?.email) {#if value} diff --git a/plugins/lead-resources/src/components/KanbanCard.svelte b/plugins/lead-resources/src/components/KanbanCard.svelte index 94bc915513..0de48c2695 100644 --- a/plugins/lead-resources/src/components/KanbanCard.svelte +++ b/plugins/lead-resources/src/components/KanbanCard.svelte @@ -21,8 +21,8 @@ import type { WithLookup } from '@hcengineering/core' import type { Lead } from '@hcengineering/lead' import { ActionIcon, Component, DueDatePresenter, IconMoreH, showPanel, showPopup } from '@hcengineering/ui' - import view from '@hcengineering/view' - import { ContextMenu } from '@hcengineering/view-resources' + import view, { BuildModelKey } from '@hcengineering/view' + import { ContextMenu, enabledConfig } from '@hcengineering/view-resources' import lead from '../plugin' import notification from '@hcengineering/notification' import { getClient } from '@hcengineering/presentation' @@ -30,6 +30,8 @@ import LeadPresenter from './LeadPresenter.svelte' export let object: WithLookup + export let config: (string | BuildModelKey)[] + const client = getClient() const assigneeAttribute = client.getHierarchy().getAttribute(lead.class.Lead, 'assignee') @@ -63,39 +65,40 @@
- {#if object.$lookup?.attachedTo} + {#if enabledConfig(config, 'attachedTo') && object.$lookup?.attachedTo} {/if} -
- {#if (object.attachments ?? 0) > 0} -
- -
+
+ {#if enabledConfig(config, 'attachments') && (object.attachments ?? 0) > 0} + {/if} - {#if (object.comments ?? 0) > 0} -
- -
+ {#if enabledConfig(config, 'comments') && (object.comments ?? 0) > 0} + {/if}
-
- - { - await client.update(object, { dueDate: e }) - }} - /> +
+ {#if enabledConfig(config, 'dueDate')} + { + await client.update(object, { dueDate: e }) + }} + /> + {/if} + {#if enabledConfig(config, 'assignee')} + + {/if}
diff --git a/plugins/recruit-resources/src/components/KanbanCard.svelte b/plugins/recruit-resources/src/components/KanbanCard.svelte index cb06560d11..35b60a5e81 100644 --- a/plugins/recruit-resources/src/components/KanbanCard.svelte +++ b/plugins/recruit-resources/src/components/KanbanCard.svelte @@ -24,13 +24,14 @@ import { AssigneePresenter, StateRefPresenter } from '@hcengineering/task-resources' import tracker from '@hcengineering/tracker' import { Component, DueDatePresenter, showPanel } from '@hcengineering/ui' - import view from '@hcengineering/view' - import { ObjectPresenter } from '@hcengineering/view-resources' + import view, { BuildModelKey } from '@hcengineering/view' + import { ObjectPresenter, enabledConfig } from '@hcengineering/view-resources' import ApplicationPresenter from './ApplicationPresenter.svelte' export let object: WithLookup export let dragged: boolean export let groupByKey: string + export let config: (string | BuildModelKey)[] const client = getClient() const hierarchy = client.getHierarchy() @@ -48,14 +49,16 @@
-
- - {#if company} -
+ {#if enabledConfig(config, 'space') || enabledConfig(config, 'company')} +
+ {#if enabledConfig(config, 'space')} + + {/if} + {#if company && enabledConfig(config, 'company')} -
- {/if} -
+ {/if} +
+ {/if}
@@ -63,7 +66,7 @@
{object.$lookup?.attachedTo ? getName(object.$lookup.attachedTo) : ''}
- {#if !isTitleHidden} + {#if !isTitleHidden && enabledConfig(config, 'title')}
{object.$lookup?.attachedTo?.title ?? ''}
{/if}
@@ -75,13 +78,13 @@
{/if}
- {#if channels && channels.length > 0} + {#if channels && channels.length > 0 && enabledConfig(config, 'channels')}
@@ -91,25 +94,26 @@
- +
- { - await client.update(object, { dueDate: e }) - }} - /> - {#if (object.attachments ?? 0) > 0} -
- -
+ {#if enabledConfig(config, 'dueDate')} + { + await client.update(object, { dueDate: e }) + }} + /> {/if} - {#if (object.comments ?? 0) > 0 || (object.$lookup?.attachedTo !== undefined && (object.$lookup.attachedTo.comments ?? 0) > 0)} -
+
+ {#if (object.attachments ?? 0) > 0 && enabledConfig(config, 'attachments')} + + {/if} + {#if enabledConfig(config, 'comments')} {#if (object.comments ?? 0) > 0} {/if} @@ -120,19 +124,22 @@ withInput={false} /> {/if} -
- {/if} + {/if} +
- + {#if enabledConfig(config, 'assignee')} + + {/if}
- {#if groupByKey !== 'state'} + {#if groupByKey !== 'state' && enabledConfig(config, 'state')} { client.update(object, { state }) diff --git a/plugins/task-resources/src/components/kanban/KanbanView.svelte b/plugins/task-resources/src/components/kanban/KanbanView.svelte index 827726efa8..715637d4a6 100644 --- a/plugins/task-resources/src/components/kanban/KanbanView.svelte +++ b/plugins/task-resources/src/components/kanban/KanbanView.svelte @@ -38,6 +38,7 @@ } from '@hcengineering/ui' import { AttributeModel, + BuildModelKey, CategoryOption, Viewlet, ViewOptionModel, @@ -70,6 +71,7 @@ export let viewOptionsConfig: ViewOptionModel[] | undefined export let viewOptions: ViewOptions export let viewlet: Viewlet + export let config: (string | BuildModelKey)[] export let options: FindOptions | undefined @@ -296,7 +298,7 @@ - + diff --git a/plugins/task-resources/src/components/state/StateRefPresenter.svelte b/plugins/task-resources/src/components/state/StateRefPresenter.svelte index fde6b06bd5..80556b13ad 100644 --- a/plugins/task-resources/src/components/state/StateRefPresenter.svelte +++ b/plugins/task-resources/src/components/state/StateRefPresenter.svelte @@ -16,6 +16,7 @@ {#if value} {@const state = $statusStore.get(typeof value === 'string' ? value : value.values?.[0]?._id)} {#if onChange !== undefined && state !== undefined} - + {:else} {/if} diff --git a/plugins/tracker-resources/src/components/components/ComponentsContent.svelte b/plugins/tracker-resources/src/components/components/ComponentsContent.svelte index a8eafb9e62..967de0cc7e 100644 --- a/plugins/tracker-resources/src/components/components/ComponentsContent.svelte +++ b/plugins/tracker-resources/src/components/components/ComponentsContent.svelte @@ -15,34 +15,56 @@ {#if viewlet?.$lookup?.descriptor?.component} - + {#if loading} + + {:else} + + {/if} {/if} diff --git a/plugins/tracker-resources/src/components/issues/IssuesContent.svelte b/plugins/tracker-resources/src/components/issues/IssuesContent.svelte index 0b42f36791..27ef395338 100644 --- a/plugins/tracker-resources/src/components/issues/IssuesContent.svelte +++ b/plugins/tracker-resources/src/components/issues/IssuesContent.svelte @@ -1,10 +1,11 @@ {#if viewlet?.$lookup?.descriptor?.component} - + {#if loading} + + {:else} + + {/if} {/if} diff --git a/plugins/tracker-resources/src/components/issues/KanbanView.svelte b/plugins/tracker-resources/src/components/issues/KanbanView.svelte index 3e9eaacc86..60585b7991 100644 --- a/plugins/tracker-resources/src/components/issues/KanbanView.svelte +++ b/plugins/tracker-resources/src/components/issues/KanbanView.svelte @@ -50,6 +50,7 @@ } from '@hcengineering/ui' import { AttributeModel, + BuildModelKey, CategoryOption, Viewlet, ViewOptionModel, @@ -57,6 +58,7 @@ ViewQueryOption } from '@hcengineering/view' import { + enabledConfig, focusStore, getCategories, getCategorySpaces, @@ -90,6 +92,7 @@ export let viewOptionsConfig: ViewOptionModel[] | undefined export let viewOptions: ViewOptions export let viewlet: Viewlet + export let config: (string | BuildModelKey)[] $: currentSpace = space || tracker.project.DefaultProject $: groupByKey = (viewOptions.groupBy[0] ?? noCategory) as IssuesGrouping @@ -251,6 +254,21 @@ space: doc.space } } + + function shouldShowFooter ( + config: (string | BuildModelKey)[], + reports: number, + estimations: number, + issue: WithLookup + ): boolean { + if (enabledConfig(config, 'estimation') && (reports > 0 || estimations > 0)) return true + if (enabledConfig(config, 'comments')) { + if ((issue.comments ?? 0) > 0) return true + if ((issue.$lookup?.attachedTo?.comments ?? 0) > 0) return true + } + if (enabledConfig(config, 'attachments') && (issue.attachments ?? 0) > 0) return true + return false + } {#if categories.length === 0} @@ -361,53 +379,70 @@ {object.title}
- {#if issue && issue.subIssues > 0} + {#if enabledConfig(config, 'subIssues') && issue && issue.subIssues > 0} {/if} - - - + {#if enabledConfig(config, 'priority')} + + {/if} + {#if enabledConfig(config, 'component')} + + {/if} + {#if enabledConfig(config, 'dueDate')} + + {/if}
-
- { - if (res.detail.full) fullFilled[issueId] = true + {#if enabledConfig(config, 'labels')} +
-
- {#if reports > 0 || estimations > 0 || (object.comments ?? 0) > 0 || (object.$lookup?.attachedTo !== undefined && (object.$lookup.attachedTo.comments ?? 0) > 0)} + > + { + if (res.detail.full) fullFilled[issueId] = true + }} + /> +
+ {/if} + {#if shouldShowFooter(config, reports, estimations, object)} diff --git a/plugins/tracker-resources/src/components/issues/related/RelatedIssuePresenter.svelte b/plugins/tracker-resources/src/components/issues/related/RelatedIssuePresenter.svelte index aa9048c2de..1958e4e128 100644 --- a/plugins/tracker-resources/src/components/issues/related/RelatedIssuePresenter.svelte +++ b/plugins/tracker-resources/src/components/issues/related/RelatedIssuePresenter.svelte @@ -28,11 +28,13 @@ $: text = project ? `${getIssueId(project, issue)} ${issue.title}` : issue.title -{#if status} -
- -
-{/if} - - {text} - +
+ {#if status} +
+ +
+ {/if} + + {text} + +
diff --git a/plugins/tracker-resources/src/components/milestones/MilestoneContent.svelte b/plugins/tracker-resources/src/components/milestones/MilestoneContent.svelte index 655e1e0484..9647cc27c3 100644 --- a/plugins/tracker-resources/src/components/milestones/MilestoneContent.svelte +++ b/plugins/tracker-resources/src/components/milestones/MilestoneContent.svelte @@ -1,10 +1,11 @@ {#if viewlet?.$lookup?.descriptor?.component} - + {#if loading} + + {:else} + + {/if} {/if} diff --git a/plugins/tracker-resources/src/components/scrums/ScrumRecordObjects.svelte b/plugins/tracker-resources/src/components/scrums/ScrumRecordObjects.svelte index 9805e604b8..f64105e64f 100644 --- a/plugins/tracker-resources/src/components/scrums/ScrumRecordObjects.svelte +++ b/plugins/tracker-resources/src/components/scrums/ScrumRecordObjects.svelte @@ -15,7 +15,6 @@ @@ -20,7 +38,7 @@ is={viewlet.$lookup.descriptor.component} props={{ _class: tracker.class.IssueTemplate, - config: viewlet.config, + config: preference?.config ?? viewlet.config, options: viewlet.options, createItemDialog, createItemLabel, diff --git a/plugins/tracker/src/index.ts b/plugins/tracker/src/index.ts index 12c38c1048..7f1c22dd11 100644 --- a/plugins/tracker/src/index.ts +++ b/plugins/tracker/src/index.ts @@ -136,6 +136,7 @@ export interface Milestone extends Doc { * @public */ export interface Issue extends AttachedDoc { + attachedTo: Ref title: string description: Markup status: Ref diff --git a/plugins/view-assets/assets/icons.svg b/plugins/view-assets/assets/icons.svg index 2b772a1366..79edd039bd 100644 --- a/plugins/view-assets/assets/icons.svg +++ b/plugins/view-assets/assets/icons.svg @@ -96,4 +96,8 @@ + + + + diff --git a/plugins/view-assets/lang/en.json b/plugins/view-assets/lang/en.json index b20cf86cfb..f5fc3652b3 100644 --- a/plugins/view-assets/lang/en.json +++ b/plugins/view-assets/lang/en.json @@ -97,6 +97,7 @@ "SaveAs": "Save as", "And": "and", "Between": "is between", - "ShowColors": "Use colors" + "ShowColors": "Use colors", + "Show": "Show" } } diff --git a/plugins/view-assets/lang/ru.json b/plugins/view-assets/lang/ru.json index 9bb85e1d61..db00b11a5a 100644 --- a/plugins/view-assets/lang/ru.json +++ b/plugins/view-assets/lang/ru.json @@ -93,6 +93,7 @@ "SaveAs": "Сохранить как", "And": "и", "Between": "между", - "ShowColors": "Использовать цвета" + "ShowColors": "Использовать цвета", + "Show": "Отображение" } } diff --git a/plugins/view-assets/src/index.ts b/plugins/view-assets/src/index.ts index e5c2ec13ce..487e22d0e6 100644 --- a/plugins/view-assets/src/index.ts +++ b/plugins/view-assets/src/index.ts @@ -38,7 +38,8 @@ loadMetadata(view.icon, { Model: `${icons}#model`, DevModel: `${icons}#devmodel`, ViewButton: `${icons}#viewButton`, - Filter: `${icons}#filter` + Filter: `${icons}#filter`, + Configure: `${icons}#configure` }) addStringsLoader(viewId, async (lang: string) => await import(`../lang/${lang}.json`)) diff --git a/plugins/view-resources/src/components/ViewOptionsButton.svelte b/plugins/view-resources/src/components/ViewOptionsButton.svelte new file mode 100644 index 0000000000..dffd2637f0 --- /dev/null +++ b/plugins/view-resources/src/components/ViewOptionsButton.svelte @@ -0,0 +1,63 @@ + + + +{#if viewlet?.viewOptions !== undefined} +