1
1
import type { Moment } from 'moment' ;
2
- import { type TaskLayoutComponent , TaskLayoutOptions } from '../Layout/TaskLayoutOptions' ;
2
+ import { TaskLayoutComponent , TaskLayoutOptions } from '../Layout/TaskLayoutOptions' ;
3
3
import { Recurrence } from '../Task/Recurrence' ;
4
4
import { Task } from '../Task/Task' ;
5
5
import { Priority } from '../Task/Priority' ;
@@ -136,9 +136,9 @@ export class DefaultTaskSerializer implements TaskSerializer {
136
136
137
137
switch ( component ) {
138
138
// NEW_TASK_FIELD_EDIT_REQUIRED
139
- case 'description' :
139
+ case TaskLayoutComponent . Description :
140
140
return task . description ;
141
- case 'priority' : {
141
+ case TaskLayoutComponent . Priority : {
142
142
let priority : string = '' ;
143
143
144
144
if ( task . priority === Priority . Highest ) {
@@ -154,29 +154,29 @@ export class DefaultTaskSerializer implements TaskSerializer {
154
154
}
155
155
return priority ;
156
156
}
157
- case 'startDate' :
157
+ case TaskLayoutComponent . StartDate :
158
158
return symbolAndDateValue ( shortMode , startDateSymbol , task . startDate ) ;
159
- case 'createdDate' :
159
+ case TaskLayoutComponent . CreatedDate :
160
160
return symbolAndDateValue ( shortMode , createdDateSymbol , task . createdDate ) ;
161
- case 'scheduledDate' :
161
+ case TaskLayoutComponent . ScheduledDate :
162
162
if ( task . scheduledDateIsInferred ) return '' ;
163
163
return symbolAndDateValue ( shortMode , scheduledDateSymbol , task . scheduledDate ) ;
164
- case 'doneDate' :
164
+ case TaskLayoutComponent . DoneDate :
165
165
return symbolAndDateValue ( shortMode , doneDateSymbol , task . doneDate ) ;
166
- case 'cancelledDate' :
166
+ case TaskLayoutComponent . CancelledDate :
167
167
return symbolAndDateValue ( shortMode , cancelledDateSymbol , task . cancelledDate ) ;
168
- case 'dueDate' :
168
+ case TaskLayoutComponent . DueDate :
169
169
return symbolAndDateValue ( shortMode , dueDateSymbol , task . dueDate ) ;
170
- case 'recurrenceRule' :
170
+ case TaskLayoutComponent . RecurrenceRule :
171
171
if ( ! task . recurrence ) return '' ;
172
172
return symbolAndStringValue ( shortMode , recurrenceSymbol , task . recurrence . toText ( ) ) ;
173
- case 'blockedBy' : {
173
+ case TaskLayoutComponent . BlockedBy : {
174
174
if ( task . blockedBy . length === 0 ) return '' ;
175
175
return symbolAndStringValue ( shortMode , blockedBySymbol , task . blockedBy . join ( ',' ) ) ;
176
176
}
177
- case 'id' :
177
+ case TaskLayoutComponent . Id :
178
178
return symbolAndStringValue ( shortMode , idSymbol , task . id ) ;
179
- case 'blockLink' :
179
+ case TaskLayoutComponent . BlockLink :
180
180
return task . blockLink ?? '' ;
181
181
default :
182
182
throw new Error ( `Don't know how to render task component of type '${ component } '` ) ;
0 commit comments