@@ -24,6 +24,7 @@ import {
24
24
Index ,
25
25
Model ,
26
26
Prop ,
27
+ ReadOnly ,
27
28
TypeDate ,
28
29
TypeMarkup ,
29
30
TypeNumber ,
@@ -34,11 +35,12 @@ import {
34
35
import attachment from '@anticrm/model-attachment'
35
36
import chunter from '@anticrm/model-chunter'
36
37
import core , { DOMAIN_SPACE , TAttachedDoc , TDoc , TSpace , TType } from '@anticrm/model-core'
37
- import view , { createAction } from '@anticrm/model-view'
38
+ import view , { classPresenter , createAction } from '@anticrm/model-view'
38
39
import workbench , { createNavigateAction } from '@anticrm/model-workbench'
39
40
import notification from '@anticrm/notification'
40
41
import { Asset , IntlString } from '@anticrm/platform'
41
42
import setting from '@anticrm/setting'
43
+ import tags from '@anticrm/tags'
42
44
import task from '@anticrm/task'
43
45
import {
44
46
Document ,
@@ -52,10 +54,10 @@ import {
52
54
Sprint ,
53
55
SprintStatus ,
54
56
Team ,
57
+ TimeSpendReport ,
55
58
trackerId
56
59
} from '@anticrm/tracker'
57
60
import { KeyBinding } from '@anticrm/view'
58
- import tags from '@anticrm/tags'
59
61
import tracker from './plugin'
60
62
61
63
import presentation from '@anticrm/model-presentation'
@@ -159,6 +161,13 @@ export class TTeam extends TSpace implements Team {
159
161
defaultIssueStatus ! : Ref < IssueStatus >
160
162
}
161
163
164
+ /**
165
+ * @public
166
+ */
167
+ export function TypeReportedTime ( ) : Type < number > {
168
+ return { _class : tracker . class . TypeReportedTime , label : core . string . Number }
169
+ }
170
+
162
171
/**
163
172
* @public
164
173
*/
@@ -219,8 +228,38 @@ export class TIssue extends TAttachedDoc implements Issue {
219
228
220
229
@Prop ( TypeRef ( tracker . class . Sprint ) , tracker . string . Sprint )
221
230
sprint ! : Ref < Sprint > | null
231
+
232
+ @Prop ( TypeNumber ( ) , tracker . string . Estimation )
233
+ estimation ! : number
234
+
235
+ @Prop ( TypeReportedTime ( ) , tracker . string . ReportedTime )
236
+ @ReadOnly ( )
237
+ reportedTime ! : number
238
+
239
+ @Prop ( Collection ( tracker . class . TimeSpendReport ) , tracker . string . TimeSpendReports )
240
+ reports ! : number
222
241
}
223
242
243
+ /**
244
+ * @public
245
+ */
246
+ @Model ( tracker . class . TimeSpendReport , core . class . AttachedDoc , DOMAIN_TRACKER )
247
+ @UX ( tracker . string . TimeSpendReport , tracker . icon . TimeReport , tracker . string . TimeSpendReport )
248
+ export class TTimeSpendReport extends TAttachedDoc implements TimeSpendReport {
249
+ declare attachedTo : Ref < Issue >
250
+
251
+ @Prop ( TypeRef ( contact . class . Employee ) , contact . string . Employee )
252
+ employee ! : Ref < Employee >
253
+
254
+ @Prop ( TypeDate ( ) , tracker . string . TimeSpendReportDate )
255
+ date ! : Timestamp | null
256
+
257
+ @Prop ( TypeNumber ( ) , tracker . string . TimeSpendReportValue )
258
+ value ! : number
259
+
260
+ @Prop ( TypeString ( ) , tracker . string . TimeSpendReportDescription )
261
+ description ! : string
262
+ }
224
263
/**
225
264
* @public
226
265
*/
@@ -321,6 +360,10 @@ export class TSprint extends TDoc implements Sprint {
321
360
declare space : Ref < Team >
322
361
}
323
362
363
+ @UX ( core . string . Number )
364
+ @Model ( tracker . class . TypeReportedTime , core . class . Type )
365
+ export class TTypeReportedTime extends TType { }
366
+
324
367
export function createModel ( builder : Builder ) : void {
325
368
builder . createModel (
326
369
TTeam ,
@@ -331,7 +374,9 @@ export function createModel (builder: Builder): void {
331
374
TTypeIssuePriority ,
332
375
TTypeProjectStatus ,
333
376
TSprint ,
334
- TTypeSprintStatus
377
+ TTypeSprintStatus ,
378
+ TTimeSpendReport ,
379
+ TTypeReportedTime
335
380
)
336
381
337
382
builder . createDoc ( view . class . Viewlet , core . space . Model , {
@@ -357,6 +402,7 @@ export function createModel (builder: Builder): void {
357
402
presenter : tracker . component . SprintEditor ,
358
403
props : { kind : 'list' , size : 'small' , shape : 'round' , shouldShowPlaceholder : false }
359
404
} ,
405
+ { key : '' , presenter : tracker . component . EstimationEditor , props : { kind : 'list' , size : 'small' } } ,
360
406
{ key : 'modifiedOn' , presenter : tracker . component . ModificationDatePresenter , props : { fixed : 'right' } } ,
361
407
{
362
408
key : '$lookup.assignee' ,
@@ -474,6 +520,10 @@ export function createModel (builder: Builder): void {
474
520
presenter : tracker . component . IssuePreview
475
521
} )
476
522
523
+ builder . mixin ( tracker . class . TimeSpendReport , core . class . Class , view . mixin . AttributePresenter , {
524
+ presenter : tracker . component . TimeSpendReport
525
+ } )
526
+
477
527
builder . mixin ( tracker . class . Issue , core . class . Class , view . mixin . ObjectTitle , {
478
528
titleProvider : tracker . function . IssueTitleProvider
479
529
} )
@@ -1015,4 +1065,11 @@ export function createModel (builder: Builder): void {
1015
1065
} ,
1016
1066
tracker . action . Relations
1017
1067
)
1068
+
1069
+ classPresenter (
1070
+ builder ,
1071
+ tracker . class . TypeReportedTime ,
1072
+ view . component . NumberPresenter ,
1073
+ tracker . component . ReportedTimeEditor
1074
+ )
1018
1075
}
0 commit comments