1
1
import type { Moment } from 'moment' ;
2
+ import type { TaskLayoutComponent } from '../Layout/TaskLayout' ;
2
3
import { PriorityTools } from '../lib/PriorityTools' ;
3
4
import type { Task } from '../Task/Task' ;
4
- import type { TaskLayoutComponent } from '../Layout/TaskLayout' ;
5
5
6
6
export class TaskFieldRenderer {
7
7
private readonly data = taskFieldHTMLData ;
@@ -139,6 +139,14 @@ export class TaskFieldHTMLData {
139
139
}
140
140
}
141
141
142
+ function createFieldWithoutDataAttributes ( className : string ) {
143
+ return new TaskFieldHTMLData (
144
+ className ,
145
+ TaskFieldHTMLData . noAttributeName ,
146
+ TaskFieldHTMLData . noAttributeValueCalculator ,
147
+ ) ;
148
+ }
149
+
142
150
const taskFieldHTMLData : { [ c in TaskLayoutComponent ] : TaskFieldHTMLData } = {
143
151
// NEW_TASK_FIELD_EDIT_REQUIRED
144
152
createdDate : new TaskFieldHTMLData ( 'task-created' , 'taskCreated' , TaskFieldHTMLData . dateAttributeCalculator ) ,
@@ -148,11 +156,7 @@ const taskFieldHTMLData: { [c in TaskLayoutComponent]: TaskFieldHTMLData } = {
148
156
doneDate : new TaskFieldHTMLData ( 'task-done' , 'taskDone' , TaskFieldHTMLData . dateAttributeCalculator ) ,
149
157
cancelledDate : new TaskFieldHTMLData ( 'task-cancelled' , 'taskCancelled' , TaskFieldHTMLData . dateAttributeCalculator ) ,
150
158
151
- description : new TaskFieldHTMLData (
152
- 'task-description' ,
153
- TaskFieldHTMLData . noAttributeName ,
154
- TaskFieldHTMLData . noAttributeValueCalculator ,
155
- ) ,
159
+ description : createFieldWithoutDataAttributes ( 'task-description' ) ,
156
160
recurrenceRule : new TaskFieldHTMLData (
157
161
'task-recurring' ,
158
162
TaskFieldHTMLData . noAttributeName ,
0 commit comments