Просмотр исходного кода

when load revisions, get users but userIds

yusuketk 6 лет назад
Родитель
Сommit
7ad992d20b

+ 1 - 1
src/client/js/components/PageHistory.jsx

@@ -49,7 +49,7 @@ class PageHistory extends React.Component {
     const diffOpened = {};
     const diffOpened = {};
     const lastId = rev.length - 1;
     const lastId = rev.length - 1;
     res.revisions.forEach((revision, i) => {
     res.revisions.forEach((revision, i) => {
-      const user = this.props.crowi.findUserById(revision.author);
+      const user = revision.author;
       if (user) {
       if (user) {
         rev[i].author = user;
         rev[i].author = user;
       }
       }

+ 1 - 1
src/server/routes/revision.js

@@ -170,7 +170,7 @@ module.exports = function(crowi, app) {
       Page.findByIdAndViewer(pageId, req.user)
       Page.findByIdAndViewer(pageId, req.user)
         .then((pageData) => {
         .then((pageData) => {
           debug('Page found', pageData._id, pageData.path);
           debug('Page found', pageData._id, pageData.path);
-          return Revision.findRevisionIdList(pageData.path);
+          return Revision.findRevisionList(pageData.path);
         })
         })
         .then((revisions) => {
         .then((revisions) => {
           return res.json(ApiResponse.success({ revisions }));
           return res.json(ApiResponse.success({ revisions }));

+ 2 - 1
src/server/views/widget/user_page_header.html

@@ -4,7 +4,8 @@
     <h4 id="revision-path"></h4>
     <h4 id="revision-path"></h4>
 
 
     <div class="users-info d-flex align-items-center">
     <div class="users-info d-flex align-items-center">
-      <img src="{{ pageUser|picture }}" class="picture img-circle">
+    <!-- [TODO][GW-1942] add method for updating imageUrlCached -->
+      <img src="{{ pageUser.imageUrlCached }}" class="picture img-circle">
       <div class="users-meta" style="flex: 1;">
       <div class="users-meta" style="flex: 1;">
         <div class="d-flex align-items-center">
         <div class="d-flex align-items-center">
           <h1>
           <h1>