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

Merge branch 'master' into support/150156-sidebar-header-text-size

satof3 1 год назад
Родитель
Сommit
435c110aad
22 измененных файлов с 62 добавлено и 47 удалено
  1. 13 1
      CHANGELOG.md
  2. 1 1
      apps/app/docker/README.md
  3. 1 1
      apps/app/package.json
  4. 6 5
      apps/app/src/client/components/Admin/App/V5PageMigration.tsx
  5. 1 3
      apps/app/src/client/components/Admin/Common/LabeledProgressBar.tsx
  6. 2 15
      apps/app/src/client/components/Admin/ElasticsearchManagement/RebuildIndexControls.jsx
  7. 3 3
      apps/app/src/client/components/Bookmarks/BookmarkFolderItem.tsx
  8. 1 0
      apps/app/src/client/components/Bookmarks/BookmarkFolderTree.module.scss
  9. 5 0
      apps/app/src/client/components/InAppNotification/PageNotification/ModelNotification.module.scss
  10. 4 2
      apps/app/src/client/components/InAppNotification/PageNotification/ModelNotification.tsx
  11. 1 1
      apps/app/src/client/components/PageList/PageListItemL.tsx
  12. 1 0
      apps/app/src/client/components/PageList/PageListItemS.module.scss
  13. 4 0
      apps/app/src/client/components/Sidebar/PageTreeItem/PageTreeItem.module.scss
  14. 4 0
      apps/app/src/client/components/Sidebar/RecentChanges/RecentChangesSubstance.module.scss
  15. 2 2
      apps/app/src/client/components/Sidebar/RecentChanges/RecentChangesSubstance.tsx
  16. 1 1
      apps/app/src/client/components/TreeItem/TreeItemLayout.tsx
  17. 3 2
      apps/app/src/server/service/page/index.ts
  18. 1 1
      apps/app/src/server/service/page/page-service.ts
  19. 4 4
      apps/app/src/server/service/search-delegator/aggregate-to-index.ts
  20. 1 1
      apps/slackbot-proxy/package.json
  21. 1 1
      package.json
  22. 2 3
      packages/core/src/interfaces/page.ts

+ 13 - 1
CHANGELOG.md

@@ -1,9 +1,21 @@
 # Changelog
 
-## [Unreleased](https://github.com/weseek/growi/compare/v7.0.14...HEAD)
+## [Unreleased](https://github.com/weseek/growi/compare/v7.0.15...HEAD)
 
 *Please do not manually update this file. We've automated the process.*
 
+## [v7.0.15](https://github.com/weseek/growi/compare/v7.0.14...v7.0.15) - 2024-07-23
+
+### 🐛 Bug Fixes
+
+* fix: The $size query when aggregation to rebuild the index (#8987) @yuki-takei
+* fix: Regaining lost backward compatibility for MongoDB 4.4 (#8985) @yuki-takei
+* fix: Activate express-session middlewares for all sockets in SocketIoService (#8981) @yuki-takei
+
+### 🧰 Maintenance
+
+* support: Chage text size in sidebar (#8965) @satof3
+
 ## [v7.0.14](https://github.com/weseek/growi/compare/v7.0.13...v7.0.14) - 2024-07-19
 
 ### 🐛 Bug Fixes

+ 1 - 1
apps/app/docker/README.md

@@ -10,7 +10,7 @@ GROWI Official docker image
 Supported tags and respective Dockerfile links
 ------------------------------------------------
 
-* [`7.0.14`, `7.0`, `7`, `latest` (Dockerfile)](https://github.com/weseek/growi/blob/v7.0.14/apps/app/docker/Dockerfile)
+* [`7.0.15`, `7.0`, `7`, `latest` (Dockerfile)](https://github.com/weseek/growi/blob/v7.0.15/apps/app/docker/Dockerfile)
 * [`6.3.2`, `6.3`, `6` (Dockerfile)](https://github.com/weseek/growi/blob/v6.3.2/apps/app/docker/Dockerfile)
 * [`6.2.4`, `6.2` (Dockerfile)](https://github.com/weseek/growi/blob/v6.2.4/apps/app/docker/Dockerfile)
 * [`6.1.15`, `6.1` (Dockerfile)](https://github.com/weseek/growi/blob/v6.1.15/apps/app/docker/Dockerfile)

+ 1 - 1
apps/app/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@growi/app",
-  "version": "7.0.15-RC.0",
+  "version": "7.0.16-RC.0",
   "license": "MIT",
   "private": "true",
   "scripts": {

+ 6 - 5
apps/app/src/client/components/Admin/App/V5PageMigration.tsx

@@ -1,12 +1,14 @@
-import React, {
-  FC, useCallback, useEffect, useState,
-} from 'react';
+import type { FC } from 'react';
+import React, { useCallback, useEffect, useState } from 'react';
 
 import { useTranslation } from 'next-i18next';
 
 import { toastError, toastSuccess } from '~/client/util/toastr';
+import type {
+  PMStartedData, PMMigratingData, PMErrorCountData, PMEndedData,
+} from '~/interfaces/websocket';
 import {
-  SocketEventName, PMStartedData, PMMigratingData, PMErrorCountData, PMEndedData,
+  SocketEventName,
 } from '~/interfaces/websocket';
 import { useGlobalAdminSocket } from '~/stores/websocket';
 
@@ -64,7 +66,6 @@ const V5PageMigration: FC<Props> = (props: Props) => {
         <LabeledProgressBar
           header={t('admin:v5_page_migration.header_upgrading_progress')}
           currentCount={current}
-          errorsCount={skip}
           totalCount={total}
           isInProgress={isInProgress}
         />

+ 1 - 3
apps/app/src/client/components/Admin/Common/LabeledProgressBar.tsx

@@ -6,13 +6,12 @@ type Props = {
   header: string,
   currentCount: number,
   totalCount: number,
-  errorsCount?: number,
   isInProgress?: boolean,
 }
 
 const LabeledProgressBar = (props: Props): JSX.Element => {
   const {
-    header, currentCount, totalCount, errorsCount, isInProgress,
+    header, currentCount, totalCount, isInProgress,
   } = props;
 
   const progressingColor = isInProgress ? 'info' : 'success';
@@ -25,7 +24,6 @@ const LabeledProgressBar = (props: Props): JSX.Element => {
       </h6>
       <Progress multi>
         <Progress bar max={totalCount} color={progressingColor} striped={isInProgress} animated={isInProgress} value={currentCount} />
-        <Progress bar max={totalCount} color="danger" striped={isInProgress} animated={isInProgress} value={errorsCount} />
       </Progress>
     </>
   );

+ 2 - 15
apps/app/src/client/components/Admin/ElasticsearchManagement/RebuildIndexControls.jsx

@@ -16,7 +16,6 @@ class RebuildIndexControls extends React.Component {
     this.state = {
       total: 0,
       current: 0,
-      skip: 0,
     };
   }
 
@@ -32,7 +31,6 @@ class RebuildIndexControls extends React.Component {
         this.setState({
           total: data.totalCount,
           current: data.count,
-          skip: data.skipped,
         });
       });
 
@@ -40,7 +38,6 @@ class RebuildIndexControls extends React.Component {
         this.setState({
           total: data.totalCount,
           current: data.count,
-          skip: data.skipped,
         });
       });
     }
@@ -51,7 +48,7 @@ class RebuildIndexControls extends React.Component {
       isRebuildingProcessing, isRebuildingCompleted,
     } = this.props;
     const {
-      total, current, skip,
+      total, current,
     } = this.state;
     const showProgressBar = isRebuildingProcessing || isRebuildingCompleted;
 
@@ -59,23 +56,13 @@ class RebuildIndexControls extends React.Component {
       return null;
     }
 
-    function getCompletedLabel() {
-      const completedLabel = skip === 0 ? 'Completed' : `Done (${skip} skips)`;
-      return completedLabel;
-    }
-
-    function getSkipLabel() {
-      return `Processing.. (${skip} skips)`;
-    }
-
-    const header = isRebuildingCompleted ? getCompletedLabel() : getSkipLabel();
+    const header = isRebuildingCompleted ? 'Completed' : 'Processing..';
 
     return (
       <div className="mb-3">
         <LabeledProgressBar
           header={header}
           currentCount={current}
-          errorsCount={skip}
           totalCount={total}
         />
       </div>

+ 3 - 3
apps/app/src/client/components/Bookmarks/BookmarkFolderItem.tsx

@@ -4,11 +4,11 @@ import { useCallback, useState } from 'react';
 import type { IPageToDeleteWithMeta } from '@growi/core';
 import { DropdownToggle } from 'reactstrap';
 
+import { FolderIcon } from '~/client/components/Icons/FolderIcon';
 import {
   addBookmarkToFolder, addNewFolder, hasChildren, updateBookmarkFolder,
 } from '~/client/util/bookmark-utils';
 import { toastError } from '~/client/util/toastr';
-import { FolderIcon } from '~/client/components/Icons/FolderIcon';
 import type { BookmarkFolderItems, DragItemDataType, DragItemType } from '~/interfaces/bookmark-info';
 import { DRAG_ITEM_TYPE } from '~/interfaces/bookmark-info';
 import type { onDeletedBookmarkFolderFunction } from '~/interfaces/ui';
@@ -250,7 +250,7 @@ export const BookmarkFolderItem: FC<BookmarkFolderItemProps> = (props: BookmarkF
               onClick={loadChildFolder}
             >
               <div className="d-flex justify-content-center">
-                <span className="material-symbols-outlined">arrow_right</span>
+                <span className="material-symbols-outlined fs-5">arrow_right</span>
               </div>
             </button>
           </div>
@@ -268,7 +268,7 @@ export const BookmarkFolderItem: FC<BookmarkFolderItemProps> = (props: BookmarkF
           ) : (
             <>
               <div className="grw-foldertree-title-anchor ps-1">
-                <p className="text-truncate m-auto ">{name}</p>
+                <p className="text-truncate m-auto">{name}</p>
               </div>
             </>
           )}

+ 1 - 0
apps/app/src/client/components/Bookmarks/BookmarkFolderTree.module.scss

@@ -51,6 +51,7 @@ $grw-bookmark-item-padding-left: 35px;
     .grw-foldertree-title-anchor {
       width: 100%;
       overflow: hidden;
+      font-size: 14px;
       text-decoration: none;
     }
   }

+ 5 - 0
apps/app/src/client/components/InAppNotification/PageNotification/ModelNotification.module.scss

@@ -0,0 +1,5 @@
+.modal-notification :global {
+  .page-title {
+    font-size: 14px;
+  }
+}

+ 4 - 2
apps/app/src/client/components/InAppNotification/PageNotification/ModelNotification.tsx

@@ -8,6 +8,8 @@ import type { IInAppNotification } from '~/interfaces/in-app-notification';
 
 import FormattedDistanceDate from '../../FormattedDistanceDate';
 
+import styles from './ModelNotification.module.scss';
+
 type Props = {
   notification: IInAppNotification & HasObjectId
   actionMsg: string
@@ -21,8 +23,8 @@ export const ModelNotification: FC<Props> = (props) => {
   } = props;
 
   return (
-    <div className="p-2 overflow-hidden">
-      <div className="text-truncate">
+    <div className={`${styles['modal-notification']} p-2 overflow-hidden`}>
+      <div className="text-truncate page-title">
         <b>{actionUsers}</b>
         {actionMsg}
         <PagePathLabel path={notification.parsedSnapshot?.path ?? ''} />

+ 1 - 1
apps/app/src/client/components/PageList/PageListItemL.tsx

@@ -31,10 +31,10 @@ import {
 } from '~/stores/modal';
 import { useIsDeviceLargerThanLg } from '~/stores/ui';
 
+import { PagePathHierarchicalLink } from '../../../components/Common/PagePathHierarchicalLink';
 import { useSWRMUTxPageInfo, useSWRxPageInfo } from '../../../stores/page';
 import type { ForceHideMenuItems } from '../Common/Dropdown/PageItemControl';
 import { PageItemControl } from '../Common/Dropdown/PageItemControl';
-import { PagePathHierarchicalLink } from '../../../components/Common/PagePathHierarchicalLink';
 
 type Props = {
   page: IPageWithSearchMeta | IPageWithMeta<IPageInfoForListing & IPageSearchMeta>,

+ 1 - 0
apps/app/src/client/components/PageList/PageListItemS.module.scss

@@ -1,4 +1,5 @@
 .page-title {
   flex: 1;
+  font-size: 14px;
   line-height: 1.2;
 }

+ 4 - 0
apps/app/src/client/components/Sidebar/PageTreeItem/PageTreeItem.module.scss

@@ -8,6 +8,10 @@
   }
 }
 
+// font size
+.page-tree-item :global {
+    font-size: 14px;
+}
 
 // == Colors
 

+ 4 - 0
apps/app/src/client/components/Sidebar/RecentChanges/RecentChangesSubstance.module.scss

@@ -8,6 +8,10 @@
 .list-group-item :global {
   font-size: 12px;
 
+  h6 {
+    font-size: 14px;
+  }
+
   .grw-recent-changes-skeleton-small {
     @include grw-skeleton-text($font-size: 14px, $line-height: 16px);
 

+ 2 - 2
apps/app/src/client/components/Sidebar/RecentChanges/RecentChangesSubstance.tsx

@@ -9,10 +9,10 @@ import { DevidedPagePath } from '@growi/core/dist/models';
 import { UserPicture } from '@growi/ui/dist/components';
 import { useTranslation } from 'react-i18next';
 
-import { useKeywordManager } from '~/client/services/search-operation';
-import { PagePathHierarchicalLink } from '~/components/Common/PagePathHierarchicalLink';
 import FormattedDistanceDate from '~/client/components/FormattedDistanceDate';
 import InfiniteScroll from '~/client/components/InfiniteScroll';
+import { useKeywordManager } from '~/client/services/search-operation';
+import { PagePathHierarchicalLink } from '~/components/Common/PagePathHierarchicalLink';
 import LinkedPagePath from '~/models/linked-page-path';
 import { useSWRINFxRecentlyUpdated } from '~/stores/page-listing';
 import loggerFactory from '~/utils/logger';

+ 1 - 1
apps/app/src/client/components/TreeItem/TreeItemLayout.tsx

@@ -152,7 +152,7 @@ export const TreeItemLayout: FC<TreeItemLayoutProps> = (props) => {
               onClick={onClickLoadChildren}
             >
               <div className="d-flex justify-content-center">
-                <span className="material-symbols-outlined">arrow_right</span>
+                <span className="material-symbols-outlined fs-5">arrow_right</span>
               </div>
             </button>
           )}

+ 3 - 2
apps/app/src/server/service/page/index.ts

@@ -2542,7 +2542,7 @@ class PageService implements IPageService {
     });
   }
 
-  constructBasicPageInfo(page: PageDocument, isGuestUser?: boolean): IPageInfo | IPageInfoForEntity {
+  constructBasicPageInfo(page: PageDocument, isGuestUser?: boolean): IPageInfo | Omit<IPageInfoForEntity, 'bookmarkCount'> {
     const isMovable = isGuestUser ? false : isMovablePage(page.path);
     const isDeletable = !(isGuestUser || isTopPage(page.path) || isUsersTopPage(page.path));
 
@@ -2560,7 +2560,7 @@ class PageService implements IPageService {
     const likers = page.liker.slice(0, 15) as Ref<IUserHasId>[];
     const seenUsers = page.seenUsers.slice(0, 15) as Ref<IUserHasId>[];
 
-    return {
+    const infoForEntity: Omit<IPageInfoForEntity, 'bookmarkCount'> = {
       isV5Compatible: isTopPage(page.path) || page.parent != null,
       isEmpty: false,
       sumOfLikers: page.liker.length,
@@ -2576,6 +2576,7 @@ class PageService implements IPageService {
       commentCount: page.commentCount,
     };
 
+    return infoForEntity;
   }
 
   async shortBodiesMapByPageIds(pageIds: ObjectId[] = [], user?): Promise<Record<string, string | null>> {

+ 1 - 1
apps/app/src/server/service/page/page-service.ts

@@ -23,7 +23,7 @@ export interface IPageService {
   findAncestorsChildrenByPathAndViewer(path: string, user, userGroups?): Promise<Record<string, PageDocument[]>>,
   findChildrenByParentPathOrIdAndViewer(parentPathOrId: string, user, userGroups?): Promise<PageDocument[]>,
   shortBodiesMapByPageIds(pageIds?: ObjectId[], user?): Promise<Record<string, string | null>>,
-  constructBasicPageInfo(page: PageDocument, isGuestUser?: boolean): IPageInfo | IPageInfoForEntity,
+  constructBasicPageInfo(page: PageDocument, isGuestUser?: boolean): IPageInfo | Omit<IPageInfoForEntity, 'bookmarkCount'>,
   canDelete(page: PageDocument, creatorId: ObjectIdLike | null, operator: any | null, isRecursively: boolean): boolean,
   canDeleteCompletely(
     page: PageDocument, creatorId: ObjectIdLike | null, operator: any | null, isRecursively: boolean, userRelatedGroups: PopulatedGrantedGroup[]

+ 4 - 4
apps/app/src/server/service/search-delegator/aggregate-to-index.ts

@@ -88,7 +88,7 @@ export const aggregatePipelineToIndex = (maxBodyLengthToIndex: number, query?: Q
     },
     {
       $addFields: {
-        commentsCount: { $size: '$comments' },
+        commentsCount: { $size: { $ifNull: ['$comments', []] } },
       },
     },
 
@@ -103,19 +103,19 @@ export const aggregatePipelineToIndex = (maxBodyLengthToIndex: number, query?: Q
     },
     {
       $addFields: {
-        bookmarksCount: { $size: '$bookmarks' },
+        bookmarksCount: { $size: { $ifNull: ['$bookmarks', []] } },
       },
     },
 
     // add counts for embedded arrays
     {
       $addFields: {
-        likeCount: { $size: '$liker' },
+        likeCount: { $size: { $ifNull: ['$liker', []] } },
       },
     },
     {
       $addFields: {
-        seenUsersCount: { $size: '$seenUsers' },
+        seenUsersCount: { $size: { $ifNull: ['$seenUsers', []] } },
       },
     },
 

+ 1 - 1
apps/slackbot-proxy/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@growi/slackbot-proxy",
-  "version": "7.0.15-slackbot-proxy.0",
+  "version": "7.0.16-slackbot-proxy.0",
   "license": "MIT",
   "private": "true",
   "scripts": {

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "growi",
-  "version": "7.0.15-RC.0",
+  "version": "7.0.16-RC.0",
   "description": "Team collaboration software using markdown",
   "license": "MIT",
   "private": "true",

+ 2 - 3
packages/core/src/interfaces/page.ts

@@ -103,9 +103,8 @@ export type IPageInfoAll = IPageInfo | IPageInfoForEntity | IPageInfoForOperatio
 // eslint-disable-next-line @typescript-eslint/no-explicit-any
 export const isIPageInfoForEntity = (pageInfo: any | undefined): pageInfo is IPageInfoForEntity => {
   return pageInfo != null && pageInfo instanceof Object
-    && ('commentCount' in pageInfo)
-    && ('bookmarkCount' in pageInfo)
-    && ('descendantCount' in pageInfo);
+    && ('isEmpty' in pageInfo)
+    && pageInfo.isEmpty === false;
 };
 
 // eslint-disable-next-line @typescript-eslint/no-explicit-any