Repository: superdesk/superdesk-publisher (language: python)

Issue:
add: updated at to content list items, tooltip with hour



Discussion / hints:

Fix patch:
diff --git a/client/components/ContentLists/Automatic/ArticleItem.jsx b/client/components/ContentLists/Automatic/ArticleItem.jsx
index d9b9b423..dbe6fb5d 100644
--- a/client/components/ContentLists/Automatic/ArticleItem.jsx
+++ b/client/components/ContentLists/Automatic/ArticleItem.jsx
@@ -52,7 +52,24 @@ const ArticleItem = ({
         </div>
         <div className="sd-list-item__row">
           <span className="sd-overflow-ellipsis sd-list-item--element-grow">
-            {moment(item.content.published_at).format("YYYY-MM-DD")}
+            <time
+              title={moment(item.content.published_at).format()}
+              sd-tooltip={moment(item.content.published_at).format("HH:mm")}
+              flow="right"
+            >
+              {moment(item.content.published_at).format("YYYY-MM-DD")}
+            </time>
+            {item.content.updated_at &&
+            item.content.updated_at !== item.content.published_at ? (
+              <time
+                title={moment(item.content.updated_at).format()}
+                sd-tooltip={moment(item.content.updated_at).format("HH:mm")}
+                flow="right"
+              >
+                (updated at:{" "}
+                {moment(item.content.updated_at).format("YYYY-MM-DD")})
+              </time>
+            ) : null}
           </span>
           <span
             className={classNames("label", {
diff --git a/client/components/ContentLists/Manual/ArticleItem.jsx b/client/components/ContentLists/Manual/ArticleItem.jsx
index 5c6e3c4f..ed09e43d 100644
--- a/client/components/ContentLists/Manual/ArticleItem.jsx
+++ b/client/components/ContentLists/Manual/ArticleItem.jsx
@@ -75,8 +75,24 @@ const ArticleItem = ({
         </div>
         <div className="sd-list-item__row">
           <span className="sd-overflow-ellipsis sd-list-item--element-grow">
-            {moment(item.published_at).format("YYYY-MM-DD")}
+            <time
+              title={moment(item.published_at).format()}
+              sd-tooltip={moment(item.published_at).format("HH:mm")}
+              flow="right"
+            >
+              {moment(item.published_at).format("YYYY-MM-DD")}
+            </time>
+            {item.updated_at && item.updated_at !== item.published_at ? (
+              <time
+                title={moment(item.updated_at).format()}
+                sd-tooltip={moment(item.updated_at).format("HH:mm")}
+                flow="right"
+              >
+                (updated at: {moment(item.updated_at).format("YYYY-MM-DD")})
+              </time>
+            ) : null}
           </span>
+
           <Label
             text={item.route && item.route.name}
             type="success"
diff --git a/client/components/Output/ArticleItem.jsx b/client/components/Output/ArticleItem.jsx
index de23a169..b9d4eb6f 100644
--- a/client/components/Output/ArticleItem.jsx
+++ b/client/components/Output/ArticleItem.jsx
@@ -82,11 +82,19 @@ const ArticleItem = ({ item, style, onRemove }) => {
             {item.headline}
           </span>
 
-          <time title={moment(item.created_at).format()}>
+          <time
+            title={moment(item.created_at).format()}
+            sd-tooltip={moment(item.created_at).format("HH:mm")}
+            flow="right"
+          >
             {moment(item.created_at).format("YYYY-MM-DD")}
           </time>
-          {item.updated_at ? (
-            <time title={moment(item.updated_at).format()}>
+          {item.updated_at && item.updated_at !== item.created_at ? (
+            <time
+              title={moment(item.updated_at).format()}
+              sd-tooltip={moment(item.updated_at).format("HH:mm")}
+              flow="right"
+            >
               (updated at: {moment(item.updated_at).format("YYYY-MM-DD")})
             </time>
           ) : null}


Test patch:
diff --git a/client/__tests__/components/ContentLists/Automatic/__snapshots__/ArticleItem.js.snap b/client/__tests__/components/ContentLists/Automatic/__snapshots__/ArticleItem.js.snap
index 7805de8a..8a64e8ec 100644
--- a/client/__tests__/components/ContentLists/Automatic/__snapshots__/ArticleItem.js.snap
+++ b/client/__tests__/components/ContentLists/Automatic/__snapshots__/ArticleItem.js.snap
@@ -22,7 +22,13 @@ exports[`ContentLists/Automatic/ArticleItem renders correctly 1`] = `
       <span
         class="sd-overflow-ellipsis sd-list-item--element-grow"
       >
-        2017-07-26
+        <time
+          flow="right"
+          sd-tooltip="15:43"
+          title="2017-07-26T15:43:33+02:00"
+        >
+          2017-07-26
+        </time>
       </span>
       <span
         class="label"
diff --git a/client/__tests__/components/ContentLists/Manual/__snapshots__/ArticleItem.js.snap b/client/__tests__/components/ContentLists/Manual/__snapshots__/ArticleItem.js.snap
index 15fd1374..69eb35e1 100644
--- a/client/__tests__/components/ContentLists/Manual/__snapshots__/ArticleItem.js.snap
+++ b/client/__tests__/components/ContentLists/Manual/__snapshots__/ArticleItem.js.snap
@@ -32,7 +32,13 @@ exports[`ContentLists/Manual/ArticleItem renders correctly with extras 1`] = `
       <span
         class="sd-overflow-ellipsis sd-list-item--element-grow"
       >
-        2017-07-26
+        <time
+          flow="right"
+          sd-tooltip="15:43"
+          title="2017-07-26T15:43:33+02:00"
+        >
+          2017-07-26
+        </time>
       </span>
       <span
         class="label label--success label--hollow"
@@ -89,7 +95,13 @@ exports[`ContentLists/Manual/ArticleItem renders correctly without extras 1`] =
       <span
         class="sd-overflow-ellipsis sd-list-item--element-grow"
       >
-        2017-07-26
+        <time
+          flow="right"
+          sd-tooltip="15:43"
+          title="2017-07-26T15:43:33+02:00"
+        >
+          2017-07-26
+        </time>
       </span>
       <span
         class="label label--success label--hollow"
diff --git a/client/__tests__/components/ContentLists/Manual/__snapshots__/Manual.js.snap b/client/__tests__/components/ContentLists/Manual/__snapshots__/Manual.js.snap
index d429d7a1..2bc7a928 100644
--- a/client/__tests__/components/ContentLists/Manual/__snapshots__/Manual.js.snap
+++ b/client/__tests__/components/ContentLists/Manual/__snapshots__/Manual.js.snap
@@ -236,7 +236,13 @@ exports[`ContentLists/Manual/Manual renders properly 1`] = `
                   <span
                     class="sd-overflow-ellipsis sd-list-item--element-grow"
                   >
-                    2019-12-28
+                    <time
+                      flow="right"
+                      sd-tooltip="12:09"
+                      title="2019-12-28T12:09:32+01:00"
+                    >
+                      2019-12-28
+                    </time>
                   </span>
                   <span
                     class="label label--success label--hollow"
diff --git a/client/__tests__/components/Output/__snapshots__/ArticleItem.js.snap b/client/__tests__/components/Output/__snapshots__/ArticleItem.js.snap
index 6a0d0195..4c208072 100644
--- a/client/__tests__/components/Output/__snapshots__/ArticleItem.js.snap
+++ b/client/__tests__/components/Output/__snapshots__/ArticleItem.js.snap
@@ -19,11 +19,15 @@ exports[`Output/ArticleItem renders correctly 1`] = `
         Med test1.3
       </span>
       <time
+        flow="right"
+        sd-tooltip="2020–01–01T12:00:00+00:00"
         title="2020–01–01T12:00:00+00:00"
       >
         2020–01–01T12:00:00+00:00
       </time>
       <time
+        flow="right"
+        sd-tooltip="2020–01–01T12:00:00+00:00"
         title="2020–01–01T12:00:00+00:00"
       >
         (updated at: