You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: support creation and update of closed issues and PRs #25
- Added a new feature that creates and updates closed issues and PRs .
- Closed issues and PRs are no longer deleted during the cleanup process.
- Only closed issues and PRs within the defined cleanup timer range are created or updated.
// Store reference to allow issue deletion toggle for updating
173
+
letallowDeleteIssueToggle: any;
172
174
newSetting(issuesSettingsContainer)
173
175
.setName("Default: Allow issue deletion")
174
176
.setDesc(
175
177
"If enabled, issue files will be set to be deleted from your vault when the issue is closed or no longer matches your filter criteria",
176
178
)
177
-
.addToggle((toggle)=>
178
-
toggle
179
+
.addToggle((toggle)=>{
180
+
allowDeleteIssueToggle=toggle;
181
+
returntoggle
179
182
.setValue(repo.allowDeleteIssue)
183
+
.setDisabled(repo.includeClosedIssues)
180
184
.onChange(async(value)=>{
181
-
repo.allowDeleteIssue=value;
182
-
awaitthis.plugin.saveSettings();
183
-
}),
184
-
);
185
+
repo.allowDeleteIssue=value;
186
+
awaitthis.plugin.saveSettings();
187
+
});
188
+
});
185
189
186
190
newSetting(issuesSettingsContainer)
187
191
.setName("Issue note template")
@@ -264,6 +268,32 @@ export class RepositoryRenderer {
264
268
awaitthis.plugin.saveSettings();
265
269
}),
266
270
);
271
+
272
+
newSetting(issuesSettingsContainer)
273
+
.setName("Include closed issues")
274
+
.setDesc(
275
+
"If enabled, closed issues will also be created and updated (not just deleted after the cleanup period).",
276
+
)
277
+
.addToggle((toggle)=>
278
+
toggle
279
+
.setValue(repo.includeClosedIssues)
280
+
.onChange(async(value)=>{
281
+
repo.includeClosedIssues=value;
282
+
// If including closed issues, disable deletion to prevent conflicts
283
+
if(value){
284
+
repo.allowDeleteIssue=false;
285
+
// Update the allow deletion toggle directly
286
+
if(allowDeleteIssueToggle){
287
+
allowDeleteIssueToggle.setValue(false);
288
+
}
289
+
}
290
+
// Update the disabled state of the allow deletion toggle
291
+
if(allowDeleteIssueToggle){
292
+
allowDeleteIssueToggle.setDisabled(value);
293
+
}
294
+
awaitthis.plugin.saveSettings();
295
+
}),
296
+
);
267
297
}
268
298
269
299
renderPullRequestSettings(
@@ -486,16 +516,60 @@ export class RepositoryRenderer {
486
516
});
487
517
});
488
518
519
+
// Store reference to allow PR deletion toggle for updating
520
+
letallowDeletePRToggle: any;
489
521
newSetting(pullRequestsSettingsContainer)
490
522
.setName("Default: Allow pull request deletion")
491
523
.setDesc(
492
-
"If enabled, pull request files will be set to be deleted from your vault when the pull request is closed or no longer matches your filter criteria",
524
+
"If enabled, pull request files will be set to be deleted from your vault when the pull request is closed or no longer matches your filter criteria. Automatically disabled when 'Include closed pull requests' is enabled.",
525
+
)
526
+
.addToggle((toggle)=>{
527
+
allowDeletePRToggle=toggle;
528
+
returntoggle
529
+
.setValue(repo.allowDeletePullRequest)
530
+
.setDisabled(repo.includeClosedPullRequests)
531
+
.onChange(async(value)=>{
532
+
repo.allowDeletePullRequest=value;
533
+
awaitthis.plugin.saveSettings();
534
+
});
535
+
});
536
+
537
+
newSetting(pullRequestsSettingsContainer)
538
+
.setName("Include pull request comments")
539
+
.setDesc(
540
+
"If enabled, comments from pull requests will be included in the generated files",
493
541
)
494
542
.addToggle((toggle)=>
495
543
toggle
496
-
.setValue(repo.allowDeletePullRequest)
544
+
.setValue(repo.includePullRequestComments)
545
+
.onChange(async(value)=>{
546
+
repo.includePullRequestComments=value;
547
+
awaitthis.plugin.saveSettings();
548
+
}),
549
+
);
550
+
551
+
newSetting(pullRequestsSettingsContainer)
552
+
.setName("Include closed pull requests")
553
+
.setDesc(
554
+
"If enabled, closed pull requests will also be created and updated (not just deleted after the cleanup period). This is useful for building a knowledge base.",
555
+
)
556
+
.addToggle((toggle)=>
557
+
toggle
558
+
.setValue(repo.includeClosedPullRequests)
497
559
.onChange(async(value)=>{
498
-
repo.allowDeletePullRequest=value;
560
+
repo.includeClosedPullRequests=value;
561
+
// If including closed PRs, disable deletion to prevent conflicts
562
+
if(value){
563
+
repo.allowDeletePullRequest=false;
564
+
// Update the allow deletion toggle directly
565
+
if(allowDeletePRToggle){
566
+
allowDeletePRToggle.setValue(false);
567
+
}
568
+
}
569
+
// Update the disabled state of the allow deletion toggle
0 commit comments