MCPcopy Index your code
hub / github.com/callumalpass/tasknotes / initializeFormData

Method initializeFormData

src/modals/TaskEditModal.ts:72–127  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

70 }
71
72 async initializeFormData(): Promise<void> {
73 const formState = buildTaskEditFormStateFromTask({
74 app: this.app,
75 task: this.task,
76 details: this.details,
77 settings: {
78 taskIdentificationMethod: this.plugin.settings.taskIdentificationMethod,
79 taskTag: this.plugin.settings.taskTag,
80 hideIdentifyingTagsMode: this.plugin.settings.hideIdentifyingTagsMode,
81 userFields: this.plugin.settings?.userFields,
82 },
83 normalizeDetails: (value) => this.normalizeDetails(value),
84 });
85
86 this.title = formState.title;
87 this.dueDate = formState.dueDate;
88 this.scheduledDate = formState.scheduledDate;
89 this.priority = formState.priority;
90 this.status = formState.status;
91 this.contexts = formState.contexts;
92
93 // Initialize projects using the new method that handles both old and new formats
94 if (formState.hasValidProjects) {
95 this.initializeProjectsFromStrings(formState.projectValues);
96 } else {
97 this.projects = "";
98 this.selectedProjectItems = [];
99 }
100
101 this.tags = formState.tags;
102 this.initialTags = formState.initialTags;
103 this.timeEstimate = formState.timeEstimate;
104 this.recurrenceRule = formState.recurrenceRule;
105 this.recurrenceAnchor = formState.recurrenceAnchor;
106 this.reminders = formState.reminders;
107 this.details = formState.details;
108 this.originalDetails = formState.originalDetails;
109 this.userFields = formState.userFields;
110
111 // Initialize subtasks (tasks that have this task as a project)
112 await this.initializeSubtasks();
113
114 this.blockedByItems = (this.task.blockedBy ?? []).map((dependency) =>
115 this.createDependencyItemFromDependency(dependency, this.task.path)
116 );
117 this.initialBlockedBy = this.blockedByItems.map((item) => ({ ...item.dependency }));
118
119 this.blockingItems = (this.task.blocking ?? []).map((path) =>
120 this.createDependencyItemFromPath(path)
121 );
122 this.initialBlockingPaths = this.blockingItems
123 .filter((item) => item.path)
124 .map((item) => item.path!);
125 this.pendingBlockingUpdates = { added: [], removed: [], raw: {} };
126 this.unresolvedBlockingEntries = [];
127 }
128
129 protected showReminderContextMenu(event: MouseEvent): void {

Callers 2

openEditModalMethod · 0.95
onOpenFunction · 0.45

Calls 2

initializeSubtasksMethod · 0.95

Tested by

no test coverage detected