diff --git a/.gitignore b/.gitignore index 206a281644..3bc7ee66c6 100644 --- a/.gitignore +++ b/.gitignore @@ -77,4 +77,5 @@ dist_cache tsconfig.tsbuildinfo ingest-attachment-*.zip tsdoc-metadata.json -pods/front/dist \ No newline at end of file +pods/front/dist +*.cpuprofile diff --git a/models/tracker/src/index.ts b/models/tracker/src/index.ts index 563c55f191..eba6f49259 100644 --- a/models/tracker/src/index.ts +++ b/models/tracker/src/index.ts @@ -550,6 +550,74 @@ export function createModel (builder: Builder): void { ] }) + const subIssuesOptions: ViewOptionsModel = { + groupBy: ['status', 'assignee', 'priority', 'sprint'], + orderBy: [ + ['status', SortingOrder.Ascending], + ['priority', SortingOrder.Ascending], + ['modifiedOn', SortingOrder.Descending], + ['dueDate', SortingOrder.Descending], + ['rank', SortingOrder.Ascending] + ], + other: [] + } + + builder.createDoc( + view.class.Viewlet, + core.space.Model, + { + attachTo: tracker.class.Issue, + descriptor: view.viewlet.List, + viewOptions: subIssuesOptions, + variant: 'subissue', + config: [ + { + key: '', + presenter: tracker.component.PriorityEditor, + props: { type: 'priority', kind: 'list', size: 'small' } + }, + { key: '', presenter: tracker.component.IssuePresenter, props: { type: 'issue', fixed: 'left' } }, + { + key: '', + presenter: tracker.component.StatusEditor, + props: { kind: 'list', size: 'small', justify: 'center' } + }, + { 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.SprintEditor, + props: { + kind: 'list', + size: 'small', + shape: 'round', + shouldShowPlaceholder: false, + excludeByKey: 'sprint', + optional: true + } + }, + { + key: '', + presenter: tracker.component.EstimationEditor, + props: { kind: 'list', size: 'small', optional: true } + }, + { + key: 'modifiedOn', + presenter: tracker.component.ModificationDatePresenter, + props: { fixed: 'right', optional: true } + }, + { + key: '$lookup.assignee', + presenter: tracker.component.AssigneePresenter, + props: { issueClass: tracker.class.Issue, defaultClass: contact.class.Employee, shouldShowLabel: false } + } + ] + }, + tracker.viewlet.SubIssues + ) + builder.createDoc(view.class.Viewlet, core.space.Model, { attachTo: tracker.class.IssueTemplate, descriptor: view.viewlet.List, diff --git a/models/view/src/plugin.ts b/models/view/src/plugin.ts index 1658fba407..40470e8a7a 100644 --- a/models/view/src/plugin.ts +++ b/models/view/src/plugin.ts @@ -63,8 +63,7 @@ export default mergeIds(viewId, view, { HTMLEditor: '' as AnyComponent, MarkupEditor: '' as AnyComponent, MarkupEditorPopup: '' as AnyComponent, - ListView: '' as AnyComponent, - GrowPresenter: '' as AnyComponent + ListView: '' as AnyComponent }, string: { Table: '' as IntlString, diff --git a/packages/core/src/hierarchy.ts b/packages/core/src/hierarchy.ts index 14f0be4f1c..0c17e6031f 100644 --- a/packages/core/src/hierarchy.ts +++ b/packages/core/src/hierarchy.ts @@ -20,6 +20,7 @@ import core from './component' import { _createMixinProxy, _mixinClass, _toDoc } from './proxy' import type { Tx, TxCreateDoc, TxMixin, TxRemoveDoc, TxUpdateDoc } from './tx' import { TxProcessor } from './tx' +import getTypeOf from './typeof' /** * @public @@ -463,11 +464,12 @@ export class Hierarchy { if (typeof obj === 'function') { return obj } - const result: any = Array.isArray(obj) ? [] : {} + const isArray = Array.isArray(obj) + const result: any = isArray ? [] : Object.assign({}, obj) for (const key in obj) { // include prototype properties const value = obj[key] - const type = {}.toString.call(value).slice(8, -1) + const type = getTypeOf(value) if (type === 'Array') { result[key] = this.clone(value) } else if (type === 'Object') { @@ -477,7 +479,9 @@ export class Hierarchy { } else if (type === 'Date') { result[key] = new Date(value.getTime()) } else { - result[key] = value + if (isArray) { + result[key] = value + } } } return result diff --git a/packages/core/src/typeof.ts b/packages/core/src/typeof.ts new file mode 100644 index 0000000000..f9af5b1d25 --- /dev/null +++ b/packages/core/src/typeof.ts @@ -0,0 +1,35 @@ +const se = typeof Symbol !== 'undefined' +const ste = se && typeof Symbol.toStringTag !== 'undefined' + +export default function getTypeOf (obj: any): string { + const typeofObj = typeof obj + if (typeofObj !== 'object') { + return typeofObj + } + if (obj === null) { + return 'null' + } + + if (Array.isArray(obj) && (!ste || !(Symbol.toStringTag in obj))) { + return 'Array' + } + + const stringTag = ste && obj[Symbol.toStringTag] + if (typeof stringTag === 'string') { + return stringTag + } + + const objPrototype = Object.getPrototypeOf(obj) + + if (objPrototype === RegExp.prototype) { + return 'RegExp' + } + if (objPrototype === Date.prototype) { + return 'Date' + } + + if (objPrototype === null) { + return 'Object' + } + return {}.toString.call(obj).slice(8, -1) +} diff --git a/packages/platform/src/event.ts b/packages/platform/src/event.ts index 697e153409..62c32882f8 100644 --- a/packages/platform/src/event.ts +++ b/packages/platform/src/event.ts @@ -14,7 +14,7 @@ // limitations under the License. // -import { Status, OK, unknownError } from './status' +import { Status, OK, unknownError, Severity } from './status' /** * @public @@ -68,7 +68,9 @@ async function broadcastEvent (event: string, data: any): Promise { * @returns */ export async function setPlatformStatus (status: Status): Promise { - // console.log(await translate(status.code, status.params)) + if (status.severity === Severity.ERROR) { + console.trace('Platform Error Status', status) + } return await broadcastEvent(PlatformEvent, status) } diff --git a/packages/presentation/src/components/Avatar.svelte b/packages/presentation/src/components/Avatar.svelte index 47c01f9b12..295eaac241 100644 --- a/packages/presentation/src/components/Avatar.svelte +++ b/packages/presentation/src/components/Avatar.svelte @@ -12,11 +12,26 @@ // See the License for the specific language governing permissions and // limitations under the License. --> + + -{#await translation} +{#if _value} + {_value} +{:else} {label} -{:then text} - {text} -{/await} +{/if} diff --git a/plugins/attachment-resources/src/plugin.ts b/plugins/attachment-resources/src/plugin.ts index 1ec3d54e1b..6cf916e30b 100644 --- a/plugins/attachment-resources/src/plugin.ts +++ b/plugins/attachment-resources/src/plugin.ts @@ -23,7 +23,6 @@ export default mergeIds(attachmentId, attachment, { string: { NoAttachments: '' as IntlString, UploadDropFilesHere: '' as IntlString, - Attachments: '' as IntlString, Photos: '' as IntlString, FileBrowser: '' as IntlString, FileBrowserFileCounter: '' as IntlString, diff --git a/plugins/attachment/src/index.ts b/plugins/attachment/src/index.ts index 7386a9c96e..e93d94951b 100644 --- a/plugins/attachment/src/index.ts +++ b/plugins/attachment/src/index.ts @@ -86,6 +86,7 @@ export default plugin(attachmentId, { FileBrowserTypeFilterAudio: '' as IntlString, FileBrowserTypeFilterVideos: '' as IntlString, FileBrowserTypeFilterPDFs: '' as IntlString, - DeleteFile: '' as IntlString + DeleteFile: '' as IntlString, + Attachments: '' as IntlString } }) diff --git a/plugins/calendar-resources/src/components/Events.svelte b/plugins/calendar-resources/src/components/Events.svelte index 2eefc81284..f41e0b76d7 100644 --- a/plugins/calendar-resources/src/components/Events.svelte +++ b/plugins/calendar-resources/src/components/Events.svelte @@ -30,7 +30,7 @@ TabList } from '@hcengineering/ui' import view, { Viewlet, ViewletPreference } from '@hcengineering/view' - import { FilterButton, ViewletSettingButton } from '@hcengineering/view-resources' + import { FilterButton, getViewOptions, ViewletSettingButton } from '@hcengineering/view-resources' import calendar from '../plugin' import { deviceOptionsStore as deviceInfo } from '@hcengineering/ui' @@ -101,6 +101,8 @@ }) $: twoRows = $deviceInfo.twoRows + + $: viewOptions = getViewOptions(selectedViewlet)
@@ -133,7 +135,7 @@ }} /> {/if} - +
@@ -148,6 +150,7 @@ space, options: selectedViewlet.options, config: preference?.config ?? selectedViewlet.config, + viewOptions, viewlet: selectedViewlet, query: resultQuery, search, diff --git a/plugins/contact-resources/src/components/Contacts.svelte b/plugins/contact-resources/src/components/Contacts.svelte index ca9e74cc79..3e40664609 100644 --- a/plugins/contact-resources/src/components/Contacts.svelte +++ b/plugins/contact-resources/src/components/Contacts.svelte @@ -18,7 +18,13 @@ import { createQuery, getClient } from '@hcengineering/presentation' import { Button, Icon, IconAdd, Label, Loading, SearchEdit, showPopup } from '@hcengineering/ui' import view, { Viewlet, ViewletPreference } from '@hcengineering/view' - import { ActionContext, FilterButton, TableBrowser, ViewletSettingButton } from '@hcengineering/view-resources' + import { + ActionContext, + FilterButton, + getViewOptions, + TableBrowser, + ViewletSettingButton + } from '@hcengineering/view-resources' import contact from '../plugin' import CreateContact from './CreateContact.svelte' import { deviceOptionsStore as deviceInfo } from '@hcengineering/ui' @@ -64,6 +70,8 @@ } $: twoRows = $deviceInfo.twoRows + + $: viewOptions = getViewOptions(viewlet) showCreateDialog(ev)} /> - + diff --git a/plugins/contact-resources/src/components/Members.svelte b/plugins/contact-resources/src/components/Members.svelte index 5166687b7e..d2666d3f7a 100644 --- a/plugins/contact-resources/src/components/Members.svelte +++ b/plugins/contact-resources/src/components/Members.svelte @@ -18,7 +18,7 @@ import { createQuery, getClient, UsersPopup, IconMembersOutline } from '@hcengineering/presentation' import { Button, IconAdd, Label, showPopup, Icon } from '@hcengineering/ui' import view, { Viewlet, ViewletPreference } from '@hcengineering/view' - import { Table, ViewletSettingButton } from '@hcengineering/view-resources' + import { getViewOptions, Table, ViewletSettingButton } from '@hcengineering/view-resources' import contact from '../plugin' export let objectId: Ref @@ -90,6 +90,7 @@ } }) } + $: viewOptions = getViewOptions(descr)
@@ -101,7 +102,7 @@
@@ -118,6 +119,7 @@ + diff --git a/plugins/document-resources/src/components/Documents.svelte b/plugins/document-resources/src/components/Documents.svelte index 7e73ef61a2..ee1b9d176b 100644 --- a/plugins/document-resources/src/components/Documents.svelte +++ b/plugins/document-resources/src/components/Documents.svelte @@ -20,7 +20,13 @@ import { createQuery, getClient } from '@hcengineering/presentation' import { deviceOptionsStore as deviceInfo, Icon, Label, Loading, SearchEdit } from '@hcengineering/ui' import view, { Viewlet, ViewletPreference } from '@hcengineering/view' - import { ActionContext, FilterButton, TableBrowser, ViewletSettingButton } from '@hcengineering/view-resources' + import { + ActionContext, + FilterButton, + getViewOptions, + TableBrowser, + ViewletSettingButton + } from '@hcengineering/view-resources' import document from '../plugin' export let query: DocumentQuery = {} @@ -63,6 +69,8 @@ let twoRows: boolean $: twoRows = $deviceInfo.docWidth <= 680 + + $: viewOptions = getViewOptions(viewlet)
- +
diff --git a/plugins/hr-resources/src/components/DepartmentStaff.svelte b/plugins/hr-resources/src/components/DepartmentStaff.svelte index a1744091e9..181e55263a 100644 --- a/plugins/hr-resources/src/components/DepartmentStaff.svelte +++ b/plugins/hr-resources/src/components/DepartmentStaff.svelte @@ -19,7 +19,7 @@ import { createQuery, getClient, UsersPopup } from '@hcengineering/presentation' import { Button, eventToHTMLElement, IconAdd, Label, Scroller, showPopup } from '@hcengineering/ui' import view, { Viewlet, ViewletPreference } from '@hcengineering/view' - import { Table, ViewletSettingButton } from '@hcengineering/view-resources' + import { getViewOptions, Table, ViewletSettingButton } from '@hcengineering/view-resources' import hr from '../plugin' import { addMember } from '../utils' @@ -91,6 +91,8 @@ } }) } + + $: viewOptions = getViewOptions(descr)
@@ -99,7 +101,7 @@
diff --git a/plugins/hr-resources/src/components/schedule/MonthTableView.svelte b/plugins/hr-resources/src/components/schedule/MonthTableView.svelte index fd171687a8..653371ac28 100644 --- a/plugins/hr-resources/src/components/schedule/MonthTableView.svelte +++ b/plugins/hr-resources/src/components/schedule/MonthTableView.svelte @@ -20,7 +20,7 @@ import { createQuery, getClient } from '@hcengineering/presentation' import { Button, Label, Loading, Scroller, tableSP } from '@hcengineering/ui' import view, { BuildModelKey, Viewlet, ViewletPreference } from '@hcengineering/view' - import { Table, ViewletSettingButton } from '@hcengineering/view-resources' + import { getViewOptions, Table, ViewletSettingButton } from '@hcengineering/view-resources' import hr from '../../plugin' import { EmployeeReports, @@ -215,6 +215,8 @@ } return result } + + $: viewOptions = getViewOptions(descr) {#if departmentStaff.length} @@ -226,7 +228,7 @@ {:else}
- +
- -
- -
- + + {/if} diff --git a/plugins/recruit-resources/src/components/Vacancies.svelte b/plugins/recruit-resources/src/components/Vacancies.svelte index 1d33f85338..f12132e7a9 100644 --- a/plugins/recruit-resources/src/components/Vacancies.svelte +++ b/plugins/recruit-resources/src/components/Vacancies.svelte @@ -18,7 +18,7 @@ import { Vacancy } from '@hcengineering/recruit' import { Button, Icon, IconAdd, Label, Loading, SearchEdit, showPopup } from '@hcengineering/ui' import view, { BuildModelKey, Viewlet, ViewletPreference } from '@hcengineering/view' - import { FilterButton, TableBrowser, ViewletSettingButton } from '@hcengineering/view-resources' + import { FilterButton, getViewOptions, TableBrowser, ViewletSettingButton } from '@hcengineering/view-resources' import recruit from '../plugin' import CreateVacancy from './CreateVacancy.svelte' import { deviceOptionsStore as deviceInfo } from '@hcengineering/ui' @@ -132,6 +132,8 @@ } $: twoRows = $deviceInfo.twoRows + + $: viewOptions = getViewOptions(descr)
@@ -156,7 +158,7 @@ kind={'primary'} on:click={showCreateDialog} /> - +
diff --git a/plugins/tracker-resources/package.json b/plugins/tracker-resources/package.json index 3076e5893f..13910df745 100644 --- a/plugins/tracker-resources/package.json +++ b/plugins/tracker-resources/package.json @@ -9,6 +9,7 @@ "build:docs": "api-extractor run --local", "lint": "svelte-check && eslint", "lint:fix": "eslint --fix src", + "svelte-check": "svelte-check", "format": "prettier --write --plugin-search-dir=. src && eslint --fix src" }, "devDependencies": { diff --git a/plugins/tracker-resources/src/components/AccountPopup.svelte b/plugins/tracker-resources/src/components/AccountPopup.svelte index ae8cffa496..956f3041e8 100644 --- a/plugins/tracker-resources/src/components/AccountPopup.svelte +++ b/plugins/tracker-resources/src/components/AccountPopup.svelte @@ -91,6 +91,7 @@
{#await getItems() then items} +
{ diff --git a/plugins/tracker-resources/src/components/RelationsPopup.svelte b/plugins/tracker-resources/src/components/RelationsPopup.svelte index cbc98a1515..96ad60e2bb 100644 --- a/plugins/tracker-resources/src/components/RelationsPopup.svelte +++ b/plugins/tracker-resources/src/components/RelationsPopup.svelte @@ -27,7 +27,7 @@ refDocument: Doc, type: keyof typeof relations, operation: '$push' | '$pull', - placeholder: IntlString + _: IntlString ) { const prop = type === 'isBlocking' ? 'blockedBy' : type if (type !== 'isBlocking') { @@ -69,7 +69,7 @@ await update(value, type, docs, label) } - const makeAddAction = (type: keyof typeof relations, placeholder: IntlString) => async (props: any, evt: Event) => { + const makeAddAction = (type: keyof typeof relations, placeholder: IntlString) => async () => { closePopup('popup') showPopup( ObjectSearchPopup, @@ -81,7 +81,7 @@ } ) } - async function removeRelation (evt: MouseEvent) { + async function removeRelation () { closePopup('popup') showPopup( ObjectSearchPopup, diff --git a/plugins/tracker-resources/src/components/issues/Duration.svelte b/plugins/tracker-resources/src/components/issues/Duration.svelte index b5b8d341f2..f534645477 100644 --- a/plugins/tracker-resources/src/components/issues/Duration.svelte +++ b/plugins/tracker-resources/src/components/issues/Duration.svelte @@ -44,14 +44,6 @@ } } - $: tooltipValue = new Date(value).toLocaleString('default', { - minute: '2-digit', - hour: 'numeric', - day: '2-digit', - month: 'short', - year: 'numeric' - }) - $: formatTime(value) diff --git a/plugins/tracker-resources/src/components/issues/IssueNotification.svelte b/plugins/tracker-resources/src/components/issues/IssueNotification.svelte index 01d1875309..c3288bdf33 100644 --- a/plugins/tracker-resources/src/components/issues/IssueNotification.svelte +++ b/plugins/tracker-resources/src/components/issues/IssueNotification.svelte @@ -1,22 +1,22 @@
- + {#if icon} + + {/if}
-
@@ -105,7 +108,7 @@ {subTitle}
- {params.subTitlePostfix} + {params?.subTitlePostfix}
diff --git a/plugins/tracker-resources/src/components/issues/IssuePresenter.svelte b/plugins/tracker-resources/src/components/issues/IssuePresenter.svelte index b5cc18870d..4e80ed3703 100644 --- a/plugins/tracker-resources/src/components/issues/IssuePresenter.svelte +++ b/plugins/tracker-resources/src/components/issues/IssuePresenter.svelte @@ -13,7 +13,7 @@ // limitations under the License. --> {#if value} + , WithLookup>, - now: number + _: number ): Promise { const result: WithTime[] = [] diff --git a/plugins/tracker-resources/src/components/issues/IssueStatusIcon.svelte b/plugins/tracker-resources/src/components/issues/IssueStatusIcon.svelte index df1a957fdb..9c4e3fcaf3 100644 --- a/plugins/tracker-resources/src/components/issues/IssueStatusIcon.svelte +++ b/plugins/tracker-resources/src/components/issues/IssueStatusIcon.svelte @@ -24,6 +24,8 @@ export let size: IconSize export let fill: string | undefined = undefined + export let issueStatuses: IssueStatus[] | undefined = undefined + const dynamicFillCategories = [tracker.issueStatusCategory.Started] const client = getClient() @@ -36,12 +38,19 @@ } = { index: undefined, count: undefined } const categoriesQuery = createQuery() - categoriesQuery.query( - tracker.class.IssueStatus, - { category: tracker.issueStatusCategory.Started }, - (res) => (statuses = res), - { sort: { rank: SortingOrder.Ascending } } - ) + + $: if (issueStatuses === undefined) { + categoriesQuery.query( + tracker.class.IssueStatus, + { category: tracker.issueStatusCategory.Started }, + (res) => (statuses = res), + { sort: { rank: SortingOrder.Ascending } } + ) + } else { + const _s = [...issueStatuses.filter((it) => it.category === tracker.issueStatusCategory.Started)] + _s.sort((a, b) => a.rank.localeCompare(b.rank)) + categoriesQuery.unsubscribe() + } async function updateCategory (status: WithLookup, statuses: IssueStatus[]) { if (status.$lookup?.category) { diff --git a/plugins/tracker-resources/src/components/issues/IssuesContent.svelte b/plugins/tracker-resources/src/components/issues/IssuesContent.svelte index 86790a7ad4..4605780390 100644 --- a/plugins/tracker-resources/src/components/issues/IssuesContent.svelte +++ b/plugins/tracker-resources/src/components/issues/IssuesContent.svelte @@ -1,8 +1,8 @@ @@ -24,9 +29,11 @@ createItemDialog, createItemLabel, viewlet, - viewOptions: viewlet.viewOptions?.other, + viewOptions, + viewOptionsConfig: viewlet.viewOptions?.other, space, - query + query, + props: { teams, issueStatuses } }} /> {/if} diff --git a/plugins/tracker-resources/src/components/issues/IssuesFilterMenu.svelte b/plugins/tracker-resources/src/components/issues/IssuesFilterMenu.svelte index 7c7c9ec150..51c24783f0 100644 --- a/plugins/tracker-resources/src/components/issues/IssuesFilterMenu.svelte +++ b/plugins/tracker-resources/src/components/issues/IssuesFilterMenu.svelte @@ -45,7 +45,7 @@ $: groupedByProject = getGroupedIssues('project', issues) $: groupedBySprint = getGroupedIssues('sprint', issues) - const handleStatusFilterMenuSectionOpened = (event: MouseEvent | KeyboardEvent) => { + const handleStatusFilterMenuSectionOpened = () => { const statusGroups: { [key: string]: number } = {} for (const status of defaultStatuses) { @@ -66,7 +66,7 @@ ) } - const handlePriorityFilterMenuSectionOpened = (event: MouseEvent | KeyboardEvent) => { + const handlePriorityFilterMenuSectionOpened = () => { const priorityGroups: { [key: string]: number } = {} for (const priority of defaultPriorities) { @@ -86,7 +86,7 @@ ) } - const handleProjectFilterMenuSectionOpened = (event: MouseEvent | KeyboardEvent) => { + const handleProjectFilterMenuSectionOpened = () => { const projectGroups: { [key: string]: number } = {} for (const [project, value] of Object.entries(groupedByProject)) { @@ -105,7 +105,7 @@ ) } - const handleSprintFilterMenuSectionOpened = (event: MouseEvent | KeyboardEvent) => { + const handleSprintFilterMenuSectionOpened = () => { const sprintGroups: { [key: string]: number } = {} for (const [project, value] of Object.entries(groupedBySprint)) { diff --git a/plugins/tracker-resources/src/components/issues/IssuesView.svelte b/plugins/tracker-resources/src/components/issues/IssuesView.svelte index 65859e7227..8d77d5dd42 100644 --- a/plugins/tracker-resources/src/components/issues/IssuesView.svelte +++ b/plugins/tracker-resources/src/components/issues/IssuesView.svelte @@ -1,11 +1,11 @@ @@ -71,7 +106,7 @@ {#if viewlet} - + {/if} {#if asideFloat && $$slots.aside}
@@ -90,8 +125,8 @@ (resultQuery = e.detail)} />
- {#if viewlet} - + {#if viewlet && _teams && issueStatuses} + {/if} {#if $$slots.aside !== undefined && asideShown}
diff --git a/plugins/tracker-resources/src/components/issues/KanbanView.svelte b/plugins/tracker-resources/src/components/issues/KanbanView.svelte index cc8733ef04..446ae9b5b6 100644 --- a/plugins/tracker-resources/src/components/issues/KanbanView.svelte +++ b/plugins/tracker-resources/src/components/issues/KanbanView.svelte @@ -37,8 +37,7 @@ ListSelectionProvider, noCategory, SelectDirection, - selectionStore, - viewOptionsStore + selectionStore } from '@hcengineering/view-resources' import ActionContext from '@hcengineering/view-resources/src/components/ActionContext.svelte' import Menu from '@hcengineering/view-resources/src/components/Menu.svelte' @@ -59,11 +58,12 @@ export let space: Ref | undefined = undefined export let baseMenuClass: Ref> | undefined = undefined export let query: DocumentQuery = {} - export let viewOptions: ViewOptionModel[] | undefined + export let viewOptionsConfig: ViewOptionModel[] | undefined + export let viewOptions: ViewOptions $: currentSpace = space || tracker.team.DefaultTeam - $: groupBy = ($viewOptionsStore.groupBy ?? noCategory) as IssuesGrouping - $: orderBy = $viewOptionsStore.orderBy + $: groupBy = (viewOptions.groupBy ?? noCategory) as IssuesGrouping + $: orderBy = viewOptions.orderBy $: sort = { [orderBy[0]]: orderBy[1] } $: dontUpdateRank = orderBy[0] !== IssuesOrdering.Manual @@ -76,7 +76,7 @@ }) let resultQuery: DocumentQuery = query - $: getResultQuery(query, viewOptions, $viewOptionsStore).then((p) => (resultQuery = p)) + $: getResultQuery(query, viewOptionsConfig, viewOptions).then((p) => (resultQuery = p)) const client = getClient() const hierarchy = client.getHierarchy() @@ -188,6 +188,7 @@ mode: 'browser' }} /> + {/if} {issue.title} +
{#each value.parents as parentInfo} + handleIssueEditorOpened(parentInfo)} >{parentInfo.parentTitle} diff --git a/plugins/tracker-resources/src/components/issues/PriorityEditor.svelte b/plugins/tracker-resources/src/components/issues/PriorityEditor.svelte index be73e38a4e..1b2201db01 100644 --- a/plugins/tracker-resources/src/components/issues/PriorityEditor.svelte +++ b/plugins/tracker-resources/src/components/issues/PriorityEditor.svelte @@ -73,6 +73,7 @@ {#if value} {#if kind === 'list' || kind === 'list-header'} +
{#if issuePriorities[value.priority]?.icon}{/if} diff --git a/plugins/tracker-resources/src/components/issues/StatusEditor.svelte b/plugins/tracker-resources/src/components/issues/StatusEditor.svelte index 7a0ac461af..1be7f6ee1d 100644 --- a/plugins/tracker-resources/src/components/issues/StatusEditor.svelte +++ b/plugins/tracker-resources/src/components/issues/StatusEditor.svelte @@ -15,7 +15,7 @@ @@ -95,7 +103,11 @@
- {#if selectedStatus}{/if} + {#if selectedStatus}{/if}
{#if selectedStatusLabel} -{#each issues as issue, index (issue._id)} - {@const currentTeam = teams.get(issue.space)} - {@const openIssueCall = () => openIssue(issue)} -
draggingIndex && index === hoveringIndex} - animate:flip={{ duration: 400 }} - draggable={true} - on:click|self={openIssueCall} - on:contextmenu|preventDefault={(ev) => showContextMenu(ev, issue)} - on:dragstart={(ev) => handleDragStart(ev, index)} - on:dragover|preventDefault={() => false} - on:dragenter={() => (hoveringIndex = index)} - on:drop|preventDefault={(ev) => handleDrop(ev, index)} - on:dragend={resetDrag} - > -
-
-
-
- - - - {#if currentTeam} - {getIssueId(currentTeam, issue)} - {/if} - - - - - {issue.title} - - {#if issue.subIssues > 0} - - {/if} -
-
- - {#if issue.dueDate !== null} - - {/if} - -
-
-{/each} - - +{#if viewlet} + +{/if} diff --git a/plugins/tracker-resources/src/components/issues/edit/SubIssueSelector.svelte b/plugins/tracker-resources/src/components/issues/edit/SubIssueSelector.svelte index 77552ce933..31af729f6b 100644 --- a/plugins/tracker-resources/src/components/issues/edit/SubIssueSelector.svelte +++ b/plugins/tracker-resources/src/components/issues/edit/SubIssueSelector.svelte @@ -92,7 +92,7 @@ $: areSubIssuesLoading = !subIssues $: parentIssue = issue.$lookup?.attachedTo ? (issue.$lookup?.attachedTo as Issue) : null - $: if (parentIssue) { + $: if (parentIssue && parentIssue.subIssues > 0) { subIssuesQeury.query( tracker.class.Issue, { space: issue.space, attachedTo: parentIssue._id }, @@ -113,6 +113,7 @@ {#if parentIssue}
+
{:else} +
@@ -73,38 +94,42 @@ {/if} - -
- {#if subIssues && issueStatuses} - - {#if hasSubIssues} + {#if issueStatuses} + {#if hasSubIssues && viewOptions && viewlet} +
(isCreating = false)} - on:move={handleIssueSwap} + teams={_teams} + {viewlet} + {viewOptions} + issueStatuses={_issueStatuses} + query={{ attachedTo: issue._id }} />
- {/if} -
+
+ {/if} {#if isCreating} {@const team = teams.get(issue.space)} @@ -121,10 +146,6 @@ {/if} {/if} - {:else} -
- -
{/if}
diff --git a/plugins/tracker-resources/src/components/issues/related/RelatedIssues.svelte b/plugins/tracker-resources/src/components/issues/related/RelatedIssues.svelte index 3c96b83414..b8b9f4c4d5 100644 --- a/plugins/tracker-resources/src/components/issues/related/RelatedIssues.svelte +++ b/plugins/tracker-resources/src/components/issues/related/RelatedIssues.svelte @@ -17,10 +17,13 @@ import presentation, { createQuery, getClient } from '@hcengineering/presentation' import { calcRank, Issue, IssueStatus, Team } from '@hcengineering/tracker' import { Label, Spinner } from '@hcengineering/ui' + import { Viewlet, ViewOptions } from '@hcengineering/view' import tracker from '../../../plugin' import SubIssueList from '../edit/SubIssueList.svelte' export let object: Doc + export let viewlet: Viewlet + export let viewOptions: ViewOptions let query: DocumentQuery $: query = { 'relations._id': object._id, 'relations._class': object._class } @@ -75,9 +78,9 @@
- {#if subIssues !== undefined} + {#if subIssues !== undefined && viewlet !== undefined} {#if issueStatuses.size > 0 && teams} - + {:else}