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

+ 6 - 6
src/server/models/page.js

@@ -109,7 +109,7 @@ const addSlashOfEnd = (path) => {
  */
 /* eslint-disable object-curly-newline, object-property-newline */
 const populateDataToShowRevision = (page, userPublicFields) => {
-  // [TODO][user-profile-cache] change how to get profile image data in client side.
+  // [TODO][user-profile-cache][GW-1775] change how to get profile image data in client side.
   return page
     .populate([
       { path: 'lastUpdateUser', model: 'User', select: userPublicFields },
@@ -265,7 +265,7 @@ class PageQueryBuilder {
   }
 
   populateDataToList(userPublicFields) {
-    // [TODO][user-profile-cache] change how to get profile image data in client side.
+    // [TODO][user-profile-cache][GW-1775] change how to get profile image data in client side.
     this.query = this.query
       .populate({
         path: 'lastUpdateUser',
@@ -275,7 +275,7 @@ class PageQueryBuilder {
   }
 
   populateDataToShowRevision(userPublicFields, imagePopulation) {
-    this.query = populateDataToShowRevision(this.query, userPublicFields, imagePopulation);
+    this.query = populateDataToShowRevision(this.query, userPublicFields);
     return this;
   }
 
@@ -461,7 +461,7 @@ module.exports = function(crowi) {
   pageSchema.methods.populateDataToShowRevision = async function() {
     validateCrowi();
 
-    // [TODO][user-profile-cache] change how to get profile image data in client side.
+    // [TODO][user-profile-cache][GW-1775] change how to get profile image data in client side.
     const User = crowi.model('User');
     return populateDataToShowRevision(this, User.USER_PUBLIC_FIELDS)
       .execPopulate();
@@ -756,7 +756,7 @@ module.exports = function(crowi) {
     const totalCount = await builder.query.exec('count');
 
     // find
-    // [TODO][user-profile-cache] change how to get profile image data in client side.
+    // [TODO][user-profile-cache][GW-1775] change how to get profile image data in client side.
     builder.populateDataToList(User.USER_PUBLIC_FIELDS);
     const pages = await builder.query.exec('find');
 
@@ -798,7 +798,7 @@ module.exports = function(crowi) {
     // count
     const totalCount = await builder.query.exec('count');
 
-    // [TODO][user-profile-cache] change how to get profile image data in client side.
+    // [TODO][user-profile-cache][GW-1775] change how to get profile image data in client side.
     // find
     builder.addConditionToPagenate(opt.offset, opt.limit, sortOpt);
     builder.populateDataToList(User.USER_PUBLIC_FIELDS);

+ 1 - 1
src/server/models/user-group-relation.js

@@ -87,7 +87,7 @@ class UserGroupRelation {
   static findAllRelationForUserGroup(userGroup) {
     const User = UserGroupRelation.crowi.model('User');
     debug('findAllRelationForUserGroup is called', userGroup);
-    // [TODO][user-profile-cache] change how to get profile image data in client side.
+    // [TODO][user-profile-cache][GW-1775] change how to get profile image data in client side.
     return this
       .find({ relatedGroup: userGroup })
       .populate({

+ 1 - 0
src/server/models/user.js

@@ -737,6 +737,7 @@ module.exports = function(crowi) {
     });
   };
 
+  // maybe use in GW-1942
   userSchema.statics.addImageUrlCachedsByIdList = async function(userIdList) {
     const users = await this.find(
       {

+ 1 - 1
src/server/routes/apiv3/user-group.js

@@ -577,7 +577,7 @@ module.exports = (crowi) => {
     const { id } = req.params;
     const { limit, offset } = req.query;
 
-    // [TODO][user-profile-cache] change how to get profile image data in client side.
+    // [TODO][user-profile-cache][GW-1775] change how to get profile image data in client side.
     try {
       const { docs, total } = await Page.paginate({
         grant: Page.GRANT_USER_GROUP,

+ 1 - 1
src/server/routes/apiv3/users.js

@@ -167,7 +167,7 @@ module.exports = (crowi) => {
     };
 
     try {
-    // [TODO][user-profile-cache] change how to get profile image data in client side.
+    // [TODO][user-profile-cache][GW-1775] change how to get profile image data in client side.
       const paginateResult = await User.paginate(
         {
           $and: [

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

@@ -352,7 +352,7 @@ module.exports = function(crowi, app) {
       return res.json(ApiResponse.error('Parameters page_id is required.'));
     }
 
-    // [TODO][user-profile-cache] change how to get profile image data in client side.
+    // [TODO][user-profile-cache][GW-1775] change how to get profile image data in client side.
     let attachments = await Attachment.find({ page: id })
       .sort({ updatedAt: 1 })
       .populate({ path: 'creator', select: User.USER_PUBLIC_FIELDS });

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

@@ -127,7 +127,7 @@ module.exports = function(crowi, app) {
       return res.json(ApiResponse.error(err));
     }
 
-    // [TODO][user-profile-cache] change how to get profile image data in client side.
+    // [TODO][user-profile-cache][GW-1775] change how to get profile image data in client side.
     const comments = await fetcher.populate(
       { path: 'creator', select: User.USER_PUBLIC_FIELDS },
     );

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

@@ -265,7 +265,7 @@ module.exports = function(crowi, app) {
   }
 
   async function addRenderVarsForUserPage(renderVars, page, requestUser) {
-    // [TODO][user-profile-cache] change how to get profile image data in client side.
+    // [TODO][user-profile-cache][GW-1775] change how to get profile image data in client side.
     const userData = await User.findUserByUsername(User.getUsernameByPath(page.path));
 
     if (userData != null) {

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

@@ -138,7 +138,7 @@ module.exports = function(crowi, app) {
 
     const data = {};
     try {
-      // [TODO][user-profile-cache] change how to get profile image data in client side.
+      // [TODO][user-profile-cache][GW-1775] change how to get profile image data in client side.
       const users = await userFetcher;
       data.users = users.map((user) => {
         // omit email

+ 1 - 1
src/server/service/passport.js

@@ -850,7 +850,7 @@ class PassportService {
     });
     passport.deserializeUser(async(id, done) => {
       try {
-        // [TODO][user-profile-cache] change how to get profile image data in client side.
+        // [TODO][user-profile-cache][GW-1775] change how to get profile image data in client side.
         const user = await User.findById(id);
         if (user == null) {
           throw new Error('user not found');