-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from nathonius/issue-columns
✨ feat: #17 Add special issue columns
- Loading branch information
Showing
12 changed files
with
152 additions
and
55 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,35 @@ | ||
import type { SearchIssueResponse } from "src/github/response"; | ||
import { getSearchResultIssueStatus, type SearchIssueResponse } from "src/github/response"; | ||
import { CommonIssuePRColumns, type ColumnsMap } from "./base"; | ||
import { setIssueIcon } from "src/icon"; | ||
import { titleCase } from "src/util"; | ||
import { createTag } from "src/inline/inline"; | ||
import { getPRForIssue } from "src/github/github"; | ||
|
||
export const IssueColumns: ColumnsMap<SearchIssueResponse["items"][number]> = { ...CommonIssuePRColumns }; | ||
export const IssueColumns: ColumnsMap<SearchIssueResponse["items"][number]> = { | ||
...CommonIssuePRColumns, | ||
status: { | ||
header: "Status", | ||
cell: (row, el) => { | ||
const wrapper = el.createDiv({ cls: "github-link-table-status" }); | ||
const status = getSearchResultIssueStatus(row); | ||
const icon = wrapper.createSpan({ cls: "github-link-status-icon" }); | ||
setIssueIcon(icon, status, row.state_reason); | ||
wrapper.createSpan({ text: row.state_reason === "not_planned" ? "Not Planned" : titleCase(status) }); | ||
}, | ||
}, | ||
pr: { | ||
header: "PR", | ||
cell: async (row, el) => { | ||
// TODO: Figure out how to include org here for private repos | ||
if (!row.timeline_url) { | ||
return; | ||
} | ||
const pullRequestUrl = await getPRForIssue(row.timeline_url); | ||
if (!pullRequestUrl) { | ||
return; | ||
} | ||
const tag = await createTag(pullRequestUrl); | ||
el.appendChild(tag); | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters