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

Merge branch 'master' into fix/115501-search-results-are-not-highlighted-when-searching-for-quoteted-words

Shun Miyazawa 3 лет назад
Родитель
Сommit
9bf506cdcb

+ 0 - 1
.devcontainer/docker-compose.yml

@@ -50,7 +50,6 @@ services:
       dockerfile: ./Dockerfile
       args:
         - version=7.16.1
-    container_name: elasticsearch
     restart: unless-stopped
     ports:
       - 9200:9200

+ 21 - 1
CHANGELOG.md

@@ -1,9 +1,29 @@
 # Changelog
 
-## [Unreleased](https://github.com/weseek/growi/compare/v6.0.7...HEAD)
+## [Unreleased](https://github.com/weseek/growi/compare/v6.0.8...HEAD)
 
 *Please do not manually update this file. We've automated the process.*
 
+## [v6.0.8](https://github.com/weseek/growi/compare/v6.0.7...v6.0.8) - 2023-03-06
+
+### 💎 Features
+
+- feat: Compare all page revisions on PageAccessoriesModal History tab (#7414) @jam411
+
+### 🚀 Improvement
+
+- imprv: Save the correct page body when uploading the attachment (#7432) @miya
+- imprv: Determine page grant considering wiki mode when creating a new page by uploading attachments (#7428) @miya
+
+### 🐛 Bug Fixes
+
+- fix: Email is not sent to Admin user when the user is created at user registration restricted (#7454) @miya
+- fix: Error when trying to create a new page with attachments (#7424) @miya
+- fix: Unable to delete multiple pages (#7435) @miya
+- fix: PageDeleteModal warns even if you have delete permission (#7436) @miya
+- fix: Color of the close icon in modal header (#7419) @ayaka0417
+- fix: Behavior when conflicts occur when saving pages (#7425) @miya
+
 ## [v6.0.7](https://github.com/weseek/growi/compare/v6.0.6...v6.0.7) - 2023-02-21
 
 ### 💎 Features

+ 1 - 1
lerna.json

@@ -1,7 +1,7 @@
 {
   "npmClient": "yarn",
   "useWorkspaces": true,
-  "version": "6.0.8-RC.0",
+  "version": "6.0.9-RC.0",
   "packages": [
     "packages/*"
   ]

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "growi",
-  "version": "6.0.8-RC.0",
+  "version": "6.0.9-RC.0",
   "description": "Team collaboration software using markdown",
   "tags": [
     "wiki",

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

@@ -10,7 +10,7 @@ GROWI Official docker image
 Supported tags and respective Dockerfile links
 ------------------------------------------------
 
-* [`6.0.7`, `6.0`, `6`, `latest` (Dockerfile)](https://github.com/weseek/growi/blob/v6.0.7/packages/app/docker/Dockerfile)
+* [`6.0.8`, `6.0`, `6`, `latest` (Dockerfile)](https://github.com/weseek/growi/blob/v6.0.8/packages/app/docker/Dockerfile)
 * [`5.1.7`, `5.1`, `5`](https://github.com/weseek/growi/blob/v5.1.7/packages/app/docker/Dockerfile)
 * [`5.1.7-nocdn`, `5.1-nocdn`, `5-nocdn`](https://github.com/weseek/growi/blob/v5.1.7/packages/app/docker/Dockerfile)
 * [`4.5.23`, `4.5`, `4`, `latest` (Dockerfile)](https://github.com/weseek/growi/blob/v4.5.23/packages/app/docker/Dockerfile)

+ 11 - 11
packages/app/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@growi/app",
-  "version": "6.0.8-RC.0",
+  "version": "6.0.9-RC.0",
   "license": "MIT",
   "scripts": {
     "//// for production": "",
@@ -67,14 +67,14 @@
     "@elastic/elasticsearch7": "npm:@elastic/elasticsearch@^7.17.0",
     "@godaddy/terminus": "^4.9.0",
     "@google-cloud/storage": "^5.8.5",
-    "@growi/codemirror-textlint": "^6.0.8-RC.0",
-    "@growi/core": "^6.0.8-RC.0",
-    "@growi/hackmd": "^6.0.8-RC.0",
-    "@growi/preset-themes": "^6.0.8-RC.0",
-    "@growi/remark-drawio": "^6.0.8-RC.0",
-    "@growi/remark-growi-directive": "^6.0.8-RC.0",
-    "@growi/remark-lsx": "^6.0.8-RC.0",
-    "@growi/slack": "^6.0.8-RC.0",
+    "@growi/codemirror-textlint": "^6.0.9-RC.0",
+    "@growi/core": "^6.0.9-RC.0",
+    "@growi/hackmd": "^6.0.9-RC.0",
+    "@growi/preset-themes": "^6.0.9-RC.0",
+    "@growi/remark-drawio": "^6.0.9-RC.0",
+    "@growi/remark-growi-directive": "^6.0.9-RC.0",
+    "@growi/remark-lsx": "^6.0.9-RC.0",
+    "@growi/slack": "^6.0.9-RC.0",
     "@promster/express": "^7.0.6",
     "@promster/server": "^7.0.8",
     "@slack/web-api": "^6.2.4",
@@ -203,8 +203,8 @@
     "handsontable": "v7.0.0 or above is no loger MIT lisence."
   },
   "devDependencies": {
-    "@growi/presentation": "^6.0.8-RC.0",
-    "@growi/ui": "^6.0.8-RC.0",
+    "@growi/presentation": "^6.0.9-RC.0",
+    "@growi/ui": "^6.0.9-RC.0",
     "@handsontable/react": "=2.1.0",
     "@icon/themify-icons": "1.0.1-alpha.3",
     "@next/bundle-analyzer": "^12.2.3",

+ 5 - 3
packages/app/src/server/models/page.ts

@@ -57,7 +57,7 @@ type PaginatedPages = {
 export type CreateMethod = (path: string, body: string, user, options: PageCreateOptions) => Promise<PageDocument & { _id: any }>
 export interface PageModel extends Model<PageDocument> {
   [x: string]: any; // for obsolete static methods
-  findByIdsAndViewer(pageIds: ObjectIdLike[], user, userGroups?, includeEmpty?: boolean): Promise<PageDocument[]>
+  findByIdsAndViewer(pageIds: ObjectIdLike[], user, userGroups?, includeEmpty?: boolean, includeAnyoneWithTheLink?: boolean): Promise<PageDocument[]>
   findByPathAndViewer(path: string | null, user, userGroups?, useFindOne?: true, includeEmpty?: boolean): Promise<PageDocument & HasObjectId | null>
   findByPathAndViewer(path: string | null, user, userGroups?, useFindOne?: false, includeEmpty?: boolean): Promise<(PageDocument & HasObjectId)[]>
   countByPathAndViewer(path: string | null, user, userGroups?, includeEmpty?:boolean): Promise<number>
@@ -553,11 +553,13 @@ schema.statics.replaceTargetWithPage = async function(exPage, pageToReplaceWith?
 /*
  * Find pages by ID and viewer.
  */
-schema.statics.findByIdsAndViewer = async function(pageIds: string[], user, userGroups?, includeEmpty?: boolean): Promise<PageDocument[]> {
+schema.statics.findByIdsAndViewer = async function(
+    pageIds: string[], user, userGroups?, includeEmpty?: boolean, includeAnyoneWithTheLink?: boolean,
+): Promise<PageDocument[]> {
   const baseQuery = this.find({ _id: { $in: pageIds } });
   const queryBuilder = new PageQueryBuilder(baseQuery, includeEmpty);
 
-  await queryBuilder.addViewerCondition(user, userGroups);
+  await queryBuilder.addViewerCondition(user, userGroups, includeAnyoneWithTheLink);
 
   return queryBuilder.query.exec();
 };

+ 15 - 2
packages/app/src/server/routes/apiv3/pages.js

@@ -1,6 +1,7 @@
 
 import { SupportedTargetModel, SupportedAction } from '~/interfaces/activity';
 import { subscribeRuleNames } from '~/interfaces/in-app-notification';
+import { PageGrant } from '~/interfaces/page';
 import loggerFactory from '~/utils/logger';
 
 import { generateAddActivityMiddleware } from '../../middlewares/add-activity';
@@ -202,6 +203,9 @@ module.exports = (crowi) => {
       body('isRecursively')
         .custom(v => v === 'true' || v === true || v == null)
         .withMessage('The body property "isRecursively" must be "true" or true. (Omit param for false)'),
+      body('isAnyoneWithTheLink')
+        .custom(v => v === 'true' || v === true || v == null)
+        .withMessage('The body property "isAnyoneWithTheLink" must be "true" or true. (Omit param for false)'),
     ],
     legacyPagesMigration: [
       body('convertPath').optional().isString().withMessage('convertPath must be a string'),
@@ -831,24 +835,33 @@ module.exports = (crowi) => {
   });
 
   router.post('/delete', accessTokenParser, loginRequiredStrictly, validator.deletePages, apiV3FormValidator, async(req, res) => {
-    const { pageIdToRevisionIdMap, isCompletely, isRecursively } = req.body;
+    const {
+      pageIdToRevisionIdMap, isCompletely, isRecursively, isAnyoneWithTheLink,
+    } = req.body;
+
     const pageIds = Object.keys(pageIdToRevisionIdMap);
 
     if (pageIds.length === 0) {
       return res.apiv3Err(new ErrorV3('Select pages to delete.', 'no_page_selected'), 400);
     }
+    if (isAnyoneWithTheLink && pageIds.length !== 1) {
+      return res.apiv3Err(new ErrorV3('Only one restricted page can be selected', 'not_single_page'), 400);
+    }
     if (pageIds.length > LIMIT_FOR_MULTIPLE_PAGE_OP) {
       return res.apiv3Err(new ErrorV3(`The maximum number of pages you can select is ${LIMIT_FOR_MULTIPLE_PAGE_OP}.`, 'exceeded_maximum_number'), 400);
     }
 
     let pagesToDelete;
     try {
-      pagesToDelete = await Page.findByIdsAndViewer(pageIds, req.user, null, true);
+      pagesToDelete = await Page.findByIdsAndViewer(pageIds, req.user, null, true, isAnyoneWithTheLink);
     }
     catch (err) {
       logger.error('Failed to find pages to delete.', err);
       return res.apiv3Err(new ErrorV3('Failed to find pages to delete.'));
     }
+    if (isAnyoneWithTheLink && pagesToDelete[0].grant !== PageGrant.GRANT_RESTRICTED) {
+      return res.apiv3Err(new ErrorV3('The grant of the retrieved page is not restricted'), 500);
+    }
 
     let pagesCanBeDeleted;
     /*

+ 1 - 1
packages/app/src/server/routes/login.js

@@ -28,8 +28,8 @@ module.exports = function(crowi, app) {
         subject: `[${appTitle}:admin] A New User Created and Waiting for Activation`,
         template: path.join(crowi.localeDir, 'en_US/admin/userWaitingActivation.txt'),
         vars: {
+          adminUser: admin,
           createdUser: userData,
-          admin,
           url: appService.getSiteUrl(),
           appTitle,
         },

+ 1 - 1
packages/codemirror-textlint/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@growi/codemirror-textlint",
-  "version": "6.0.8-RC.0",
+  "version": "6.0.9-RC.0",
   "license": "MIT",
   "main": "dist/index.js",
   "scripts": {

+ 1 - 1
packages/core/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@growi/core",
-  "version": "6.0.8-RC.0",
+  "version": "6.0.9-RC.0",
   "description": "GROWI Core Libraries",
   "license": "MIT",
   "keywords": [

+ 3 - 3
packages/core/src/interfaces/attachment.ts

@@ -1,6 +1,6 @@
-import { Ref } from './common';
-import { IPage } from './page';
-import { IUser } from './user';
+import type { Ref } from './common';
+import type { IPage } from './page';
+import type { IUser } from './user';
 
 export type IAttachment = {
   page?: Ref<IPage>,

+ 1 - 1
packages/core/src/interfaces/common.ts

@@ -2,7 +2,7 @@
  * Common types and interfaces
  */
 
-import { HasObjectId } from './has-object-id';
+import type { HasObjectId } from './has-object-id';
 
 
 // Foreign key field

+ 1 - 1
packages/core/src/interfaces/growi-facade.ts

@@ -1,4 +1,4 @@
-import { ITemplate } from './template';
+import type { ITemplate } from './template';
 
 export type GrowiFacade = {
   markdownRenderer?: {

+ 6 - 6
packages/core/src/interfaces/page.ts

@@ -1,9 +1,9 @@
-import { Ref } from './common';
-import { HasObjectId } from './has-object-id';
-import { IRevision, HasRevisionShortbody, IRevisionHasId } from './revision';
-import { SubscriptionStatusType } from './subscription';
-import { ITag } from './tag';
-import { IUser, IUserGroupHasId, IUserHasId } from './user';
+import type { Ref } from './common';
+import type { HasObjectId } from './has-object-id';
+import type { IRevision, HasRevisionShortbody, IRevisionHasId } from './revision';
+import type { SubscriptionStatusType } from './subscription';
+import type { ITag } from './tag';
+import type { IUser, IUserGroupHasId, IUserHasId } from './user';
 
 
 export type IPage = {

+ 2 - 2
packages/core/src/interfaces/revision.ts

@@ -1,5 +1,5 @@
-import { HasObjectId } from './has-object-id';
-import { IUser } from './user';
+import type { HasObjectId } from './has-object-id';
+import type { IUser } from './user';
 
 export type IRevision = {
   body: string,

+ 3 - 3
packages/core/src/interfaces/subscription.ts

@@ -1,6 +1,6 @@
-import { Ref } from './common';
-import { IPage } from './page';
-import { IUser } from './user';
+import type { Ref } from './common';
+import type { IPage } from './page';
+import type { IUser } from './user';
 
 export const SubscriptionStatusType = {
   SUBSCRIBE: 'SUBSCRIBE',

+ 4 - 4
packages/core/src/interfaces/user.ts

@@ -1,7 +1,7 @@
-import { IAttachment } from './attachment';
-import { Ref } from './common';
-import { HasObjectId } from './has-object-id';
-import { Lang } from './lang';
+import type { IAttachment } from './attachment';
+import type { Ref } from './common';
+import type { HasObjectId } from './has-object-id';
+import type { Lang } from './lang';
 
 export type IUser = {
   name: string,

+ 1 - 1
packages/hackmd/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@growi/hackmd",
-  "version": "6.0.8-RC.0",
+  "version": "6.0.9-RC.0",
   "description": "GROWI js and css files to use hackmd",
   "license": "MIT",
   "main": "dist/index.js",

+ 2 - 2
packages/presentation/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@growi/presentation",
-  "version": "6.0.8-RC.0",
+  "version": "6.0.9-RC.0",
   "description": "GROWI plugin for presentation",
   "license": "MIT",
   "keywords": ["growi", "growi-plugin"],
@@ -15,7 +15,7 @@
     "test": ""
   },
   "dependencies": {
-    "@growi/core": "^6.0.8-RC.0"
+    "@growi/core": "^6.0.9-RC.0"
   },
   "devDependencies": {
     "@marp-team/marp-core": "^3.4.2",

+ 1 - 1
packages/preset-themes/package.json

@@ -1,7 +1,7 @@
 {
   "name": "@growi/preset-themes",
   "description": "GROWI preset themes",
-  "version": "6.0.8-RC.0",
+  "version": "6.0.9-RC.0",
   "license": "MIT",
   "main": "dist/libs/index.js",
   "files": [

+ 1 - 1
packages/remark-drawio/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@growi/remark-drawio",
-  "version": "6.0.8-RC.0",
+  "version": "6.0.9-RC.0",
   "description": "remark plugin to draw diagrams with draw.io (diagrams.net)",
   "license": "MIT",
   "keywords": [

+ 1 - 1
packages/remark-growi-directive/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@growi/remark-growi-directive",
-  "version": "6.0.8-RC.0",
+  "version": "6.0.9-RC.0",
   "description": "remark plugin to support GROWI plugin (forked from remark-directive@2.0.1)",
   "license": "MIT",
   "keywords": [

+ 4 - 4
packages/remark-lsx/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@growi/remark-lsx",
-  "version": "6.0.8-RC.0",
+  "version": "6.0.9-RC.0",
   "description": "GROWI plugin to list pages",
   "license": "MIT",
   "keywords": ["growi", "growi-plugin"],
@@ -20,9 +20,9 @@
     "test": ""
   },
   "dependencies": {
-    "@growi/core": "^6.0.8-RC.0",
-    "@growi/remark-growi-directive": "^6.0.8-RC.0",
-    "@growi/ui": "^6.0.8-RC.0",
+    "@growi/core": "^6.0.9-RC.0",
+    "@growi/remark-growi-directive": "^6.0.9-RC.0",
+    "@growi/ui": "^6.0.9-RC.0",
     "swr": "^2.0.3"
   },
   "devDependencies": {

+ 1 - 1
packages/slack/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@growi/slack",
-  "version": "6.0.8-RC.0",
+  "version": "6.0.9-RC.0",
   "license": "MIT",
   "main": "dist/index.js",
   "typings": "dist/index.d.ts",

+ 2 - 2
packages/slackbot-proxy/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@growi/slackbot-proxy",
-  "version": "6.0.8-slackbot-proxy.0",
+  "version": "6.0.9-slackbot-proxy.0",
   "license": "MIT",
   "scripts": {
     "build": "yarn tsc && tsc-alias -p tsconfig.build.json",
@@ -26,7 +26,7 @@
   },
   "dependencies": {
     "@godaddy/terminus": "^4.9.0",
-    "@growi/slack": "^6.0.8-RC.0",
+    "@growi/slack": "^6.0.9-RC.0",
     "@slack/oauth": "^2.0.1",
     "@slack/web-api": "^6.2.4",
     "@tsed/common": "^6.43.0",

+ 2 - 2
packages/ui/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@growi/ui",
-  "version": "6.0.8-RC.0",
+  "version": "6.0.9-RC.0",
   "description": "GROWI UI Libraries",
   "license": "MIT",
   "keywords": ["growi"],
@@ -17,7 +17,7 @@
     "test": "jest --verbose"
   },
   "dependencies": {
-    "@growi/core": "^6.0.8-RC.0"
+    "@growi/core": "^6.0.9-RC.0"
   },
   "devDependencies": {
     "eslint-plugin-regex": "^1.8.0",