Skip to content

Commit f2af62b

Browse files
committed
refactor: . reuse createFieldWithoutDataAttributes()
1 parent dce05bb commit f2af62b

File tree

1 file changed

+4
-20
lines changed

1 file changed

+4
-20
lines changed

src/Renderer/TaskFieldRenderer.ts

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -157,29 +157,13 @@ const taskFieldHTMLData: { [c in TaskLayoutComponent]: TaskFieldHTMLData } = {
157157
cancelledDate: new TaskFieldHTMLData('task-cancelled', 'taskCancelled', TaskFieldHTMLData.dateAttributeCalculator),
158158

159159
description: createFieldWithoutDataAttributes('task-description'),
160-
recurrenceRule: new TaskFieldHTMLData(
161-
'task-recurring',
162-
TaskFieldHTMLData.noAttributeName,
163-
TaskFieldHTMLData.noAttributeValueCalculator,
164-
),
160+
recurrenceRule: createFieldWithoutDataAttributes('task-recurring'),
165161

166162
priority: new TaskFieldHTMLData('task-priority', 'taskPriority', (_component, task) => {
167163
return PriorityTools.priorityNameUsingNormal(task.priority).toLocaleLowerCase();
168164
}),
169165

170-
blockedBy: new TaskFieldHTMLData(
171-
'task-blockedBy',
172-
TaskFieldHTMLData.noAttributeName,
173-
TaskFieldHTMLData.noAttributeValueCalculator,
174-
),
175-
id: new TaskFieldHTMLData(
176-
'task-id',
177-
TaskFieldHTMLData.noAttributeName,
178-
TaskFieldHTMLData.noAttributeValueCalculator,
179-
),
180-
blockLink: new TaskFieldHTMLData(
181-
'task-block-link',
182-
TaskFieldHTMLData.noAttributeName,
183-
TaskFieldHTMLData.noAttributeValueCalculator,
184-
),
166+
blockedBy: createFieldWithoutDataAttributes('task-blockedBy'),
167+
id: createFieldWithoutDataAttributes('task-id'),
168+
blockLink: createFieldWithoutDataAttributes('task-block-link'),
185169
};

0 commit comments

Comments
 (0)