File tree Expand file tree Collapse file tree
src/renderer/components/project-tab/widgets Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -417,6 +417,14 @@ function buildPRActions(
417417 }
418418
419419 actions . appendChild ( reviewGroup ) ;
420+
421+ const kanbanBtn = document . createElement ( 'button' ) ;
422+ kanbanBtn . className = 'widget-github-row-action-btn widget-github-row-action-btn-primary' ;
423+ kanbanBtn . textContent = 'Add to Kanban' ;
424+ kanbanBtn . title = 'Create a board task from this PR' ;
425+ kanbanBtn . addEventListener ( 'click' , onAction ( ( ) => addPRToKanban ( item ) ) ) ;
426+ actions . appendChild ( kanbanBtn ) ;
427+
420428 return actions ;
421429}
422430
@@ -434,5 +442,13 @@ function addIssueToKanban(item: GithubItem): void {
434442 } ) ;
435443}
436444
445+ function addPRToKanban ( item : GithubItem ) : void {
446+ showTaskModal ( 'create' , undefined , undefined , {
447+ title : `[Review] ${ item . title } ` ,
448+ prompt : `Review this PR #${ item . number } : ${ item . html_url } ` ,
449+ tags : [ 'github-prs' ] ,
450+ } ) ;
451+ }
452+
437453export const createGithubPRsWidget : WidgetFactory = ( host ) => makeGithubWidget ( 'prs' , host ) ;
438454export const createGithubIssuesWidget : WidgetFactory = ( host ) => makeGithubWidget ( 'issues' , host ) ;
You can’t perform that action at this time.
0 commit comments