refactor: remove remains of markdown specific code

This commit is contained in:
Karl-Philipp Wulfert
2019-03-20 16:30:42 +01:00
parent 04eb1f1f36
commit 5577ffee7d
4 changed files with 128 additions and 125 deletions

View File

@@ -55,7 +55,11 @@ export interface AssigneeWithIssues {
*/
export interface IssueWithMeta extends Issue {
$branchExists: boolean;
$labels: string;
$closed: boolean;
$labels: Array<{
bold: boolean;
label: string;
}>;
$mergeRequestUrl: string;
$project: string;
$weeksOpen: number;
@@ -202,15 +206,14 @@ export async function getIssuesGroupedByAssignees(api: Api, label: string): Prom
...{
$branchExists: typeof issueBranches[issue.project_id] !== 'undefined'
&& issueBranches[issue.project_id].indexOf(issue.iid) >= 0,
$closed: issue.state === IssueState.CLOSED,
$issue: issue,
$labels: issue.labels.map((issueLabel: string) => {
// print specific labels bold
if (BOLD_LABELS.indexOf(issueLabel) >= 0) {
issueLabel = '__' + issueLabel + '__';
}
return issueLabel;
}).join(', '),
return {
bold: BOLD_LABELS.includes(issueLabel),
label: issueLabel,
};
}),
$mergeRequestUrl: getMergeRequestUrls(mergeRequests, issue.project_id, issue.iid)[0],
$project: issue.web_url.replace('https://gitlab.com/', '').split('/issues/')[0],
$weeksOpen: moment().diff(moment(issue.created_at), 'weeks'),