瀏覽代碼

Show human readable last review date

apiraino 2 年之前
父節點
當前提交
6fabf07f04
共有 4 個文件被更改,包括 6 次插入5 次删除
  1. 2 1
      src/actions.rs
  2. 1 1
      src/github.rs
  3. 2 2
      src/github/graphql.rs
  4. 1 1
      templates/_issue.tt

+ 2 - 1
src/actions.rs

@@ -43,7 +43,8 @@ pub struct IssueDecorator {
     pub repo_name: String,
     pub labels: String,
     pub assignees: String,
-    pub updated_at: String,
+    // Human (readable) timestamp
+    pub updated_at_hts: String,
 
     pub fcp_details: Option<FCPDetails>,
 }

+ 1 - 1
src/github.rs

@@ -1151,7 +1151,7 @@ impl<'q> IssuesQuery for Query<'q> {
                     .map(|u| u.login.as_ref())
                     .collect::<Vec<_>>()
                     .join(", "),
-                updated_at: crate::actions::to_human(issue.updated_at),
+                updated_at_hts: crate::actions::to_human(issue.updated_at),
                 fcp_details,
             });
         }

+ 2 - 2
src/github/graphql.rs

@@ -308,7 +308,7 @@ impl super::IssuesQuery for LeastRecentlyReviewedPullRequests {
             .take(50)
             .map(
                 |(updated_at, number, title, html_url, repo_name, labels, assignees)| {
-                    let updated_at = crate::actions::to_human(updated_at);
+                    let updated_at_hts = crate::actions::to_human(updated_at);
 
                     crate::actions::IssueDecorator {
                         number,
@@ -317,7 +317,7 @@ impl super::IssuesQuery for LeastRecentlyReviewedPullRequests {
                         repo_name,
                         labels,
                         assignees,
-                        updated_at,
+                        updated_at_hts,
                         fcp_details: None,
                     }
                 },

+ 1 - 1
templates/_issue.tt

@@ -1 +1 @@
-{% macro render(issue, with_age="") %}"{{issue.title}}" [{{issue.repo_name}}#{{issue.number}}]({{issue.html_url}}) {% if with_age %}(last review activity: {{issue.updated_at}}){% endif %}{% endmacro %}
+{% macro render(issue, with_age="") %}"{{issue.title}}" [{{issue.repo_name}}#{{issue.number}}]({{issue.html_url}}) {% if with_age %}(last review activity: {{issue.updated_at_hts}}){% endif %}{% endmacro %}