Преглед изворни кода

Added comments for future tasks

Taichi Masuyama пре 4 година
родитељ
комит
3e67d0bd63

+ 8 - 3
packages/app/src/client/services/AdminUserGroupDetailContainer.js

@@ -27,9 +27,14 @@ export default class AdminUserGroupDetailContainer extends Container {
     this.state = {
       // TODO: [SPA] get userGroup from props
       userGroup: JSON.parse(rootElem.getAttribute('data-user-group')),
-      childUserGroups: JSON.parse(rootElem.getAttribute('data-child-user-groups')), // TODO 85062: pass data via swig
-      userGroupRelations: [],
-      relatedPages: [],
+      userGroupRelations: [], // For user list
+
+      // TODO 85062: /_api/v3/user-groups/children?include_grand_child=boolean
+      childUserGroups: [], // TODO 85062: fetch data on init (findChildGroupsByParentIds) For child group list
+      grandChildUserGroups: [], // TODO 85062: fetch data on init (findChildGroupsByParentIds) For child group list
+
+      childUserGroupUsers: [], // TODO 85062: fetch data on init (findRelationsByGroupIds) For child group list
+      relatedPages: [], // For page list
       isUserGroupUserModalOpen: false,
       searchType: 'partial',
       isAlsoMailSearched: false,

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

@@ -41,7 +41,7 @@ module.exports = (crowi) => {
    *                      type: object
    *                      description: contains arrays user objects related
    */
-  router.get('/', loginRequiredStrictly, adminRequired, async(req, res) => {
+  router.get('/', loginRequiredStrictly, adminRequired, async(req, res) => { // TODO 85062: enable groupIds to filter
     try {
       const relations = await UserGroupRelation.find().populate('relatedUser');
 

+ 5 - 0
packages/app/src/server/routes/apiv3/user-group.js

@@ -84,6 +84,11 @@ module.exports = (crowi) => {
     }
   });
 
+  /*
+   * TODO 85062: GET /children ?include-grand-children=boolean fetch all children by parent ids
+   * if include-grand-children=true, return grand children as well
+   */
+
   validator.create = [
     body('name', 'Group name is required').trim().exists({ checkFalsy: true }),
     body('description', 'Description must be a string').optional().isString(),