浏览代码

Remove PR support for issues searching

The pull_request portion of the response is not about associated pull
requests of the current issue.
Santiago Pastorino 4 年之前
父节点
当前提交
4d435e2e52
共有 2 个文件被更改,包括 17 次插入30 次删除
  1. 16 29
      src/actions.rs
  2. 1 1
      templates/_issue_with_meta.tt

+ 16 - 29
src/actions.rs

@@ -31,7 +31,6 @@ pub struct IssueDecorator {
     pub number: u64,
     pub title: String,
     pub html_url: String,
-    pub pr: String,
     pub labels: String,
     pub assignees: String,
 }
@@ -72,34 +71,22 @@ impl<'a> Action for Step<'a> {
                             Ok(issues) => {
                                 let issues_decorator: Vec<_> = issues
                                     .iter()
-                                    .map(|issue| {
-                                        let pr = if issue.pull_request.is_some() {
-                                            // FIXME: link to PR.
-                                            // We need to tweak PullRequestDetails for this
-                                            "[has_pr] "
-                                        } else {
-                                            ""
-                                        }
-                                        .to_string();
-
-                                        IssueDecorator {
-                                            title: issue.title.clone(),
-                                            number: issue.number,
-                                            html_url: issue.html_url.clone(),
-                                            pr,
-                                            labels: issue
-                                                .labels
-                                                .iter()
-                                                .map(|l| l.name.as_ref())
-                                                .collect::<Vec<_>>()
-                                                .join(", "),
-                                            assignees: issue
-                                                .assignees
-                                                .iter()
-                                                .map(|u| u.login.as_ref())
-                                                .collect::<Vec<_>>()
-                                                .join(", "),
-                                        }
+                                    .map(|issue| IssueDecorator {
+                                        title: issue.title.clone(),
+                                        number: issue.number,
+                                        html_url: issue.html_url.clone(),
+                                        labels: issue
+                                            .labels
+                                            .iter()
+                                            .map(|l| l.name.as_ref())
+                                            .collect::<Vec<_>>()
+                                            .join(", "),
+                                        assignees: issue
+                                            .assignees
+                                            .iter()
+                                            .map(|u| u.login.as_ref())
+                                            .collect::<Vec<_>>()
+                                            .join(", "),
                                     })
                                     .collect();
 

+ 1 - 1
templates/_issue_with_meta.tt

@@ -1,3 +1,3 @@
 {% import "_issue.tt" as issue %}
 
-{% macro render(issue) %}{{issue::render(issue=issue)}} {{issue.pr}}labels=[{{issue.labels}}}] assignees=[{{issue.assignees}}]{% endmacro %}
+{% macro render(issue) %}{{issue::render(issue=issue)}} labels=[{{issue.labels}}}] assignees=[{{issue.assignees}}]{% endmacro %}