( prePopulatedValues: Partial<TaskInfo> | undefined, context: ParentNoteProjectDefaultContext )
| 1192 | } |
| 1193 | |
| 1194 | private applyParentNoteProjectDefault( |
| 1195 | prePopulatedValues: Partial<TaskInfo> | undefined, |
| 1196 | context: ParentNoteProjectDefaultContext |
| 1197 | ): Partial<TaskInfo> | undefined { |
| 1198 | if (!shouldApplyParentNoteProjectDefault(this.settings.taskCreationDefaults, context)) { |
| 1199 | return prePopulatedValues; |
| 1200 | } |
| 1201 | |
| 1202 | const currentFile = this.app.workspace.getActiveFile(); |
| 1203 | const parentNote = currentFile |
| 1204 | ? this.app.fileManager.generateMarkdownLink(currentFile, currentFile.path) |
| 1205 | : undefined; |
| 1206 | |
| 1207 | return applyParentNoteProjectDefault(prePopulatedValues, parentNote); |
| 1208 | } |
| 1209 | |
| 1210 | /** |
| 1211 | * Convert the current note to a task by adding required task frontmatter. |
no test coverage detected