diff --git a/models/tracker/src/index.ts b/models/tracker/src/index.ts index e785d304098..179c381bef2 100644 --- a/models/tracker/src/index.ts +++ b/models/tracker/src/index.ts @@ -234,6 +234,11 @@ function defineFilters (builder: Builder): void { getVisibleFilters: tracker.function.GetVisibleFilters }) + builder.mixin(tracker.class.TimeSpendReport, core.class.Class, view.mixin.ClassFilters, { + filters: ['employee', 'space', 'attachedTo', 'date'], + ignoreKeys: ['value'] + }) + builder.mixin(tracker.class.Issue, core.class.Class, view.mixin.ObjectIdentifier, { provider: tracker.function.IssueIdentifierProvider }) @@ -339,6 +344,7 @@ function defineApplication ( opt: { myIssuesId: string allIssuesId: string + timeReportsId: string issuesId: string componentsId: string milestonesId: string @@ -392,6 +398,18 @@ function defineApplication ( allProjectsTypes: true } }, + { + id: opt.timeReportsId, + position: 'top', + label: tracker.string.TimeReports, + icon: tracker.icon.TimeReport, + component: workbench.component.SpecialView, + componentProps: { + _class: tracker.class.TimeSpendReport, + icon: tracker.icon.TimeReport, + label: tracker.string.TimeReports + } + }, { id: 'all-projects', component: workbench.component.SpecialView, @@ -540,6 +558,7 @@ export function createModel (builder: Builder): void { const templatesId = 'templates' const myIssuesId = 'my-issues' const allIssuesId = 'all-issues' + const timeReportsId = 'time-reports' const labelsId = 'labels' // const scrumsId = 'scrums' @@ -553,6 +572,10 @@ export function createModel (builder: Builder): void { presenters: [tracker.component.IssueStatistics] }) + builder.mixin(tracker.class.TimeSpendReport, core.class.Class, view.mixin.ListHeaderExtra, { + presenters: [tracker.component.TimeSpendReportTotal] + }) + defineSortAndGrouping(builder) builder.createDoc>(core.class.ClassCollaborators, core.space.Model, { @@ -689,7 +712,16 @@ export function createModel (builder: Builder): void { tracker.ids.IssueTemplateUpdatedActivityViewlet ) - defineApplication(builder, { myIssuesId, allIssuesId, issuesId, componentsId, milestonesId, templatesId, labelsId }) + defineApplication(builder, { + myIssuesId, + allIssuesId, + timeReportsId, + issuesId, + componentsId, + milestonesId, + templatesId, + labelsId + }) defineActions(builder, issuesId, componentsId, myIssuesId) diff --git a/models/tracker/src/plugin.ts b/models/tracker/src/plugin.ts index 89d904ac03f..959f8d3193e 100644 --- a/models/tracker/src/plugin.ts +++ b/models/tracker/src/plugin.ts @@ -51,6 +51,7 @@ export default mergeIds(trackerId, tracker, { component: { MilestoneSelector: '' as AnyComponent, IssueStatistics: '' as AnyComponent, + TimeSpendReportTotal: '' as AnyComponent, TimeSpendReportPopup: '' as AnyComponent, NotificationIssuePresenter: '' as AnyComponent, MilestoneFilter: '' as AnyComponent, @@ -75,7 +76,9 @@ export default mergeIds(trackerId, tracker, { MilestoneList: '' as Ref, ComponentList: '' as Ref, ProjectList: '' as Ref, - ProjectListGrouped: '' as Ref + ProjectListGrouped: '' as Ref, + TimeSpendReportTable: '' as Ref, + TimeSpendReportList: '' as Ref }, ids: { TrackerNotificationGroup: '' as Ref, diff --git a/models/tracker/src/types.ts b/models/tracker/src/types.ts index 853e19450ca..011c10e5009 100644 --- a/models/tracker/src/types.ts +++ b/models/tracker/src/types.ts @@ -364,6 +364,9 @@ export class TTimeSpendReport extends TAttachedDoc implements TimeSpendReport { @Prop(TypeRef(tracker.class.Issue), tracker.string.Issue) declare attachedTo: Ref + @Prop(TypeRef(tracker.class.Project), tracker.string.Project) + declare space: Ref + @Prop(TypeRef(contact.mixin.Employee), contact.string.Employee) employee!: Ref diff --git a/models/tracker/src/viewlets.ts b/models/tracker/src/viewlets.ts index 30282c7ae08..cf91f95a00f 100644 --- a/models/tracker/src/viewlets.ts +++ b/models/tracker/src/viewlets.ts @@ -1063,4 +1063,63 @@ export function defineViewlets (builder: Builder): void { }, tracker.viewlet.MilestoneList ) + + const timeSpendReportOptions = (grouping: boolean): ViewOptionsModel => ({ + groupBy: grouping ? ['employee', 'space', 'createdBy'] : [], + orderBy: [ + ['date', SortingOrder.Descending], + ['value', SortingOrder.Descending], + ['modifiedOn', SortingOrder.Descending], + ['createdOn', SortingOrder.Descending] + ], + other: [] + }) + + builder.createDoc( + view.class.Viewlet, + core.space.Model, + { + attachTo: tracker.class.TimeSpendReport, + descriptor: view.viewlet.Table, + viewOptions: timeSpendReportOptions(false), + configOptions: { + hiddenKeys: ['value'], + sortable: true + }, + config: [ + 'date', + 'employee', + '$lookup.attachedTo', + '$lookup.attachedTo.title', + 'space', + { key: '', sortingKey: 'value' }, + 'description' + ] + }, + tracker.viewlet.TimeSpendReportTable + ) + + builder.createDoc( + view.class.Viewlet, + core.space.Model, + { + attachTo: tracker.class.TimeSpendReport, + descriptor: view.viewlet.List, + viewOptions: timeSpendReportOptions(true), + configOptions: { + strict: true, + hiddenKeys: ['value'] + }, + config: [ + { key: '$lookup.attachedTo', displayProps: { key: 'issue', fixed: 'left' } }, + { key: '$lookup.attachedTo.title', displayProps: { grow: true } }, + { key: 'description', displayProps: { key: 'description', compression: true } }, + { key: 'space', displayProps: { key: 'space', compression: true } }, + { key: 'employee', displayProps: { key: 'employee' } }, + { key: 'date', displayProps: { key: 'date', fixed: 'right' } }, + { key: '', displayProps: { key: 'value', fixed: 'right', dividerBefore: true } } + ] + }, + tracker.viewlet.TimeSpendReportList + ) } diff --git a/plugins/tracker-assets/lang/cs.json b/plugins/tracker-assets/lang/cs.json index a86d17ab3ca..7be4e87802d 100644 --- a/plugins/tracker-assets/lang/cs.json +++ b/plugins/tracker-assets/lang/cs.json @@ -221,6 +221,7 @@ "ReportedTime": "Strávený čas", "RemainingTime": "Zbývající čas", "TimeSpendReports": "Zprávy o stráveném čase", + "TimeReports": "Výkazy času", "TimeSpendReport": "Čas", "TimeSpendReportAdd": "Přidat zprávu o čase", "TimeSpendReportDate": "Datum", diff --git a/plugins/tracker-assets/lang/de.json b/plugins/tracker-assets/lang/de.json index 4ef15e6c56f..50c657407a3 100644 --- a/plugins/tracker-assets/lang/de.json +++ b/plugins/tracker-assets/lang/de.json @@ -262,6 +262,7 @@ "ReportedTime": "Aufgewendete Zeit", "RemainingTime": "Verbleibende Zeit", "TimeSpendReports": "Zeiterfassungsberichte", + "TimeReports": "Zeiterfassung", "TimeSpendReport": "Zeit", "TimeSpendReportAdd": "Zeiterfassung hinzufügen", "TimeSpendReportDate": "Datum", diff --git a/plugins/tracker-assets/lang/en.json b/plugins/tracker-assets/lang/en.json index 01a260ee457..1eabd753f3a 100644 --- a/plugins/tracker-assets/lang/en.json +++ b/plugins/tracker-assets/lang/en.json @@ -248,6 +248,7 @@ "ReportedTime": "Spent time", "RemainingTime": "Remaining time", "TimeSpendReports": "Time spent reports", + "TimeReports": "Time reports", "TimeSpendReport": "Time", "TimeSpendReportAdd": "Add time report", "TimeSpendReportDate": "Date", diff --git a/plugins/tracker-assets/lang/es.json b/plugins/tracker-assets/lang/es.json index e64739a8677..c6aab0a79f8 100644 --- a/plugins/tracker-assets/lang/es.json +++ b/plugins/tracker-assets/lang/es.json @@ -218,6 +218,7 @@ "ReportedTime": "Tiempo empleado", "RemainingTime": "Tiempo restante", "TimeSpendReports": "Informes de tiempo empleado", + "TimeReports": "Informes de tiempo", "TimeSpendReport": "Tiempo", "TimeSpendReportAdd": "Agregar informe de tiempo", "TimeSpendReportDate": "Fecha", diff --git a/plugins/tracker-assets/lang/fr.json b/plugins/tracker-assets/lang/fr.json index f50efabb503..540047c3284 100644 --- a/plugins/tracker-assets/lang/fr.json +++ b/plugins/tracker-assets/lang/fr.json @@ -218,6 +218,7 @@ "ReportedTime": "Temps passé", "RemainingTime": "Temps restant", "TimeSpendReports": "Rapports de temps passé", + "TimeReports": "Rapports de temps", "TimeSpendReport": "Temps", "TimeSpendReportAdd": "Ajouter un rapport de temps", "TimeSpendReportDate": "Date", diff --git a/plugins/tracker-assets/lang/it.json b/plugins/tracker-assets/lang/it.json index 6987099ebb9..9fc6aa18c63 100644 --- a/plugins/tracker-assets/lang/it.json +++ b/plugins/tracker-assets/lang/it.json @@ -218,6 +218,7 @@ "ReportedTime": "Tempo trascorso", "RemainingTime": "Tempo rimanente", "TimeSpendReports": "Rapporti sul tempo trascorso", + "TimeReports": "Rapporti sui tempi", "TimeSpendReport": "Tempo", "TimeSpendReportAdd": "Aggiungi rapporto sul tempo", "TimeSpendReportDate": "Data", diff --git a/plugins/tracker-assets/lang/ja.json b/plugins/tracker-assets/lang/ja.json index 72af11ae93f..2c816e6e743 100644 --- a/plugins/tracker-assets/lang/ja.json +++ b/plugins/tracker-assets/lang/ja.json @@ -218,6 +218,7 @@ "ReportedTime": "消費時間", "RemainingTime": "残り時間", "TimeSpendReports": "時間消費レポート", + "TimeReports": "時間レポート", "TimeSpendReport": "時間", "TimeSpendReportAdd": "時間レポートを追加", "TimeSpendReportDate": "日付", diff --git a/plugins/tracker-assets/lang/ko.json b/plugins/tracker-assets/lang/ko.json index 628aad44b3b..5d161caf344 100644 --- a/plugins/tracker-assets/lang/ko.json +++ b/plugins/tracker-assets/lang/ko.json @@ -218,6 +218,7 @@ "ReportedTime": "사용 시간", "RemainingTime": "남은 시간", "TimeSpendReports": "시간 사용 보고서", + "TimeReports": "시간 보고서", "TimeSpendReport": "시간", "TimeSpendReportAdd": "시간 보고서 추가", "TimeSpendReportDate": "날짜", diff --git a/plugins/tracker-assets/lang/pl.json b/plugins/tracker-assets/lang/pl.json index 9f2fe1c26da..346d8e72c22 100644 --- a/plugins/tracker-assets/lang/pl.json +++ b/plugins/tracker-assets/lang/pl.json @@ -228,6 +228,7 @@ "ReportedTime": "Czas poświęcony", "RemainingTime": "Pozostały czas", "TimeSpendReports": "Raporty poświęconego czasu", + "TimeReports": "Raporty czasu", "TimeSpendReport": "Czas", "TimeSpendReportAdd": "Dodaj raport", "TimeSpendReportDate": "Data", diff --git a/plugins/tracker-assets/lang/pt-br.json b/plugins/tracker-assets/lang/pt-br.json index af8ed33bea5..f5120624ab1 100644 --- a/plugins/tracker-assets/lang/pt-br.json +++ b/plugins/tracker-assets/lang/pt-br.json @@ -218,6 +218,7 @@ "ReportedTime": "Tempo gasto", "RemainingTime": "Tempo restante", "TimeSpendReports": "Relatórios de tempo gasto", + "TimeReports": "Relatórios de tempo", "TimeSpendReport": "Tempo", "TimeSpendReportAdd": "Adicionar relatório de tempo", "TimeSpendReportDate": "Data", diff --git a/plugins/tracker-assets/lang/pt.json b/plugins/tracker-assets/lang/pt.json index 7742053a95e..3949d8371e0 100644 --- a/plugins/tracker-assets/lang/pt.json +++ b/plugins/tracker-assets/lang/pt.json @@ -218,6 +218,7 @@ "ReportedTime": "Tempo gasto", "RemainingTime": "Tempo restante", "TimeSpendReports": "Relatórios de tempo gasto", + "TimeReports": "Relatórios de tempo", "TimeSpendReport": "Tempo", "TimeSpendReportAdd": "Adicionar relatório de tempo", "TimeSpendReportDate": "Data", diff --git a/plugins/tracker-assets/lang/ru.json b/plugins/tracker-assets/lang/ru.json index b67cf1828c5..f0d2a2bd18e 100644 --- a/plugins/tracker-assets/lang/ru.json +++ b/plugins/tracker-assets/lang/ru.json @@ -248,6 +248,7 @@ "ReportedTime": "Потраченное времени", "RemainingTime": "Осталось времени", "TimeSpendReports": "Отчеты по времени", + "TimeReports": "Отчеты по времени", "TimeSpendReport": "Время", "TimeSpendReportAdd": "Добавить затраченное время", "TimeSpendReportDate": "Дата", diff --git a/plugins/tracker-assets/lang/tr.json b/plugins/tracker-assets/lang/tr.json index f465a56e61a..06e61a235d1 100644 --- a/plugins/tracker-assets/lang/tr.json +++ b/plugins/tracker-assets/lang/tr.json @@ -235,6 +235,7 @@ "ReportedTime": "Harcanan zaman", "RemainingTime": "Kalan zaman", "TimeSpendReports": "Harcanan zaman raporları", + "TimeReports": "Zaman raporları", "TimeSpendReport": "Zaman", "TimeSpendReportAdd": "Zaman raporu ekle", "TimeSpendReportDate": "Tarih", diff --git a/plugins/tracker-assets/lang/zh.json b/plugins/tracker-assets/lang/zh.json index 68634b0207a..197beb6f196 100644 --- a/plugins/tracker-assets/lang/zh.json +++ b/plugins/tracker-assets/lang/zh.json @@ -231,6 +231,7 @@ "ReportedTime": "花费时间", "RemainingTime": "剩余时间", "TimeSpendReports": "花费时间报告", + "TimeReports": "时间报告", "TimeSpendReport": "时间", "TimeSpendReportAdd": "添加时间报告", "TimeSpendReportDate": "日期", diff --git a/plugins/tracker-resources/src/components/issues/timereport/TimeSpendReportTotal.svelte b/plugins/tracker-resources/src/components/issues/timereport/TimeSpendReportTotal.svelte new file mode 100644 index 00000000000..c093076bca6 --- /dev/null +++ b/plugins/tracker-resources/src/components/issues/timereport/TimeSpendReportTotal.svelte @@ -0,0 +1,49 @@ + + + +{#if total !== undefined} + +{/if} diff --git a/plugins/tracker-resources/src/index.ts b/plugins/tracker-resources/src/index.ts index 0dc6d9d6822..7be7d4b21d5 100644 --- a/plugins/tracker-resources/src/index.ts +++ b/plugins/tracker-resources/src/index.ts @@ -118,6 +118,7 @@ import SubIssuesSelector from './components/issues/edit/SubIssuesSelector.svelte import EstimationEditor from './components/issues/timereport/EstimationEditor.svelte' import ReportedTimeEditor from './components/issues/timereport/ReportedTimeEditor.svelte' import TimeSpendReport from './components/issues/timereport/TimeSpendReport.svelte' +import TimeSpendReportTotal from './components/issues/timereport/TimeSpendReportTotal.svelte' import RelatedIssues from './components/issues/related/RelatedIssues.svelte' import RelatedIssueTemplates from './components/issues/related/RelatedIssueTemplates.svelte' @@ -457,6 +458,7 @@ export default async (): Promise => ({ MilestoneEditor, ReportedTimeEditor, TimeSpendReport, + TimeSpendReportTotal, EstimationEditor, SubIssuesSelector, RelatedIssues, diff --git a/plugins/tracker-resources/src/plugin.ts b/plugins/tracker-resources/src/plugin.ts index b4e326877ae..4783485f7e0 100644 --- a/plugins/tracker-resources/src/plugin.ts +++ b/plugins/tracker-resources/src/plugin.ts @@ -268,6 +268,7 @@ export default mergeIds(trackerId, tracker, { TimeSpendReport: '' as IntlString, TimeSpendReportAdd: '' as IntlString, TimeSpendReports: '' as IntlString, + TimeReports: '' as IntlString, TimeSpendReportDate: '' as IntlString, TimeSpendReportValue: '' as IntlString, TimeSpendReportDescription: '' as IntlString, diff --git a/plugins/view-resources/src/components/list/ListCategory.svelte b/plugins/view-resources/src/components/list/ListCategory.svelte index 665615ed033..7d2a5421686 100644 --- a/plugins/view-resources/src/components/list/ListCategory.svelte +++ b/plugins/view-resources/src/components/list/ListCategory.svelte @@ -159,6 +159,8 @@ docsQuery.unsubscribe() } + $: categoryQuery = { ...resultQuery, ...docKeys } + $: categoryCollapseKey = `list_collapsing_${location.pathname}_${groupPersistKey}` $: storedCollapseState = localStorage.getItem(categoryCollapseKey) @@ -477,6 +479,7 @@ {lastCat} {viewOptions} {loading} + {categoryQuery} on:collapse={() => { collapsed = !collapsed if (collapsed) { diff --git a/plugins/view-resources/src/components/list/ListHeader.svelte b/plugins/view-resources/src/components/list/ListHeader.svelte index 2fac066863d..d71a4f89af0 100644 --- a/plugins/view-resources/src/components/list/ListHeader.svelte +++ b/plugins/view-resources/src/components/list/ListHeader.svelte @@ -13,7 +13,7 @@ // limitations under the License. -->