Skip to content

Commit

Permalink
Merge branch 'dev/7.0.x' into support/clean-obsoleted-codes
Browse files Browse the repository at this point in the history
  • Loading branch information
yuki-takei committed Feb 28, 2024
2 parents 637b7db + 9600066 commit b43b972
Show file tree
Hide file tree
Showing 38 changed files with 581 additions and 161 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------

FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-18
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-20

# The node image includes a non-root user with sudo access. Use the
# "remoteUser" property in devcontainer.json to use it. On Linux, update
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ci-app-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,32 +51,32 @@ jobs:
test-prod-node16:
uses: weseek/growi/.github/workflows/reusable-app-prod.yml@dev/7.0.x
with:
node-version: 16.x
node-version: 18.x
skip-cypress: true
secrets:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}


test-prod-node18:
test-prod-node20:
uses: weseek/growi/.github/workflows/reusable-app-prod.yml@dev/7.0.x
with:
node-version: 18.x
node-version: 20.x
skip-cypress: ${{ contains( github.event.pull_request.labels.*.name, 'dependencies' ) }}
cypress-report-artifact-name: Cypress report
cypress-config-video: ${{ inputs.cypress-config-video || false }}
secrets:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}


run-reg-suit-node18:
needs: [test-prod-node18]
run-reg-suit-node20:
needs: [test-prod-node20]

uses: weseek/growi/.github/workflows/reusable-app-reg-suit.yml@dev/7.0.x

if: always()

with:
node-version: 18.x
node-version: 20.x
skip-reg-suit: ${{ contains( github.event.pull_request.labels.*.name, 'dependencies' ) }}
cypress-report-artifact-name: Cypress report
secrets:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

strategy:
matrix:
node-version: [18.x]
node-version: [20.x]

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:

strategy:
matrix:
node-version: [18.x]
node-version: [20.x]

services:
mongodb:
Expand Down Expand Up @@ -174,7 +174,7 @@ jobs:

strategy:
matrix:
node-version: [18.x]
node-version: [20.x]

services:
mongodb:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci-slackbot-proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

strategy:
matrix:
node-version: [18.x]
node-version: [20.x]

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:

strategy:
matrix:
node-version: [18.x]
node-version: [20.x]

services:
mysql:
Expand Down Expand Up @@ -179,7 +179,7 @@ jobs:

strategy:
matrix:
node-version: [18.x]
node-version: [20.x]

services:
mysql:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/list-unhealthy-branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: '16'
node-version: '18'

- name: List branches
id: list-branches
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-slackbot-proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: '16'
node-version: '18'
cache: 'yarn'
cache-dependency-path: '**/yarn.lock'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: '18'
node-version: '20'
cache: 'yarn'
cache-dependency-path: '**/yarn.lock'

Expand Down Expand Up @@ -189,7 +189,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: '18'
node-version: '20'
cache: 'yarn'
cache-dependency-path: '**/yarn.lock'

Expand Down
6 changes: 3 additions & 3 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ pull_request_rules:
conditions:
- author = dependabot[bot]
- '#approved-reviews-by >= 1'
- check-success = "lint (18.x)"
- check-success = "test (18.x)"
- check-success = "launch-dev (18.x)"
- check-success = "lint (20.x)"
- check-success = "test (20.x)"
- check-success = "launch-dev (20.x)"
- check-success = "test-prod-node16 / launch-prod"
- check-success = "test-prod-node18 / launch-prod"
actions:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ See [GROWI Docs: Environment Variables](https://docs.growi.org/en/admin-guide/ad

## Dependencies

- Node.js v16.x or v18.x
- Node.js v18.x or v20.x
- npm 6.x
- yarn
- [Turborepo](https://turbo.build/repo)
Expand Down
2 changes: 1 addition & 1 deletion README_JP.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Crowi からの移行は **[こちら](https://docs.growi.org/en/admin-guide/mig

## 依存関係

- Node.js v16.x or v18.x
- Node.js v18.x or v20.x
- npm 6.x
- yarn
- [Turborepo](https://turbo.build/repo)
Expand Down
8 changes: 4 additions & 4 deletions apps/app/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
##
## base
##
FROM node:18-slim AS base
FROM node:20-slim AS base

ENV optDir /opt

Expand All @@ -18,7 +18,7 @@ RUN turbo prune --scope=@growi/app --docker
##
## deps-resolver
##
FROM node:18-slim AS deps-resolver
FROM node:20-slim AS deps-resolver

ENV optDir /opt

Expand Down Expand Up @@ -62,7 +62,7 @@ RUN tar -cf node_modules.tar \
##
## builder
##
FROM node:18-slim AS builder
FROM node:20-slim AS builder

ENV optDir /opt

Expand Down Expand Up @@ -107,7 +107,7 @@ RUN tar -cf packages.tar \
##
## release
##
FROM node:18-slim
FROM node:20-slim
LABEL maintainer Yuki Takei <[email protected]>

ENV NODE_ENV production
Expand Down
8 changes: 4 additions & 4 deletions apps/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"@akebifiky/remark-simple-plantuml": "^1.0.2",
"@aws-sdk/client-s3": "3.454.0",
"@aws-sdk/s3-request-presigner": "3.454.0",
"@azure/identity": "^3.3.2",
"@azure/identity": "^4.0.1",
"@azure/storage-blob": "^12.16.0",
"@browser-bunyan/console-formatted-stream": "^1.8.0",
"@elastic/elasticsearch7": "npm:@elastic/elasticsearch@^7.17.0",
Expand Down Expand Up @@ -101,7 +101,7 @@
"connect-redis": "^4.0.4",
"cookie-parser": "^1.4.5",
"csurf": "^1.11.0",
"csv-to-markdown-table": "^1.1.0",
"csv-to-markdown-table": "^1.4.1",
"date-fns": "^2.23.0",
"dayjs": "^1.11.7",
"detect-indent": "^7.0.0",
Expand Down Expand Up @@ -131,7 +131,7 @@
"is-iso-date": "^0.0.1",
"ldapjs": "^3.0.2",
"lucene-query-parser": "^1.2.0",
"markdown-table": "^1.1.1",
"markdown-table": "^3.0.3",
"md5": "^2.2.1",
"mermaid": "^10.1.0",
"method-override": "^3.0.0",
Expand Down Expand Up @@ -214,7 +214,7 @@
"xss": "^1.0.14",
"y-mongodb-provider": "^0.1.7",
"y-socket.io": "^1.1.0",
"yjs": "^13.6.7"
"yjs": "^13.6.12"
},
"// comments for defDependencies": {
"@handsontable/react": "v3 requires handsontable >= 7.0.0.",
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/components/PageEditor/HandsontableModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useState } from 'react';

import { useHandsontableModalForEditor } from '@growi/editor/src/stores/use-handsontable';
import { HotTable } from '@handsontable/react';
import Handsontable from 'handsontable';
import type Handsontable from 'handsontable';
import { useTranslation } from 'next-i18next';
import {
Collapse,
Expand Down
13 changes: 13 additions & 0 deletions apps/app/src/components/PageEditor/PageEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,19 @@ export const PageEditor = React.memo((props: Props): JSX.Element => {
}
}, [initialValue, isIndentSizeForced, mutateCurrentIndentSize]);

// set handler to set caret line
useEffect(() => {
const handler = (lineNumber?: number) => {
codeMirrorEditor?.setCaretLine(lineNumber);

// TODO: scroll to the caret line
};
globalEmitter.on('setCaretLine', handler);

return function cleanup() {
globalEmitter.removeListener('setCaretLine', handler);
};
}, [codeMirrorEditor]);

// TODO: Check the reproduction conditions that made this code necessary and confirm reproduction
// // when transitioning to a different page, if the initialValue is the same,
Expand Down
1 change: 1 addition & 0 deletions apps/app/src/components/PageEditor/Preview.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.page-editor-preview-body :global {
.wiki {
max-width: 980px;
padding: 0px 15px;
margin: 0 auto;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState, type FC, useCallback } from 'react';

import { createPage } from '~/client/services/page-operation';
import { useSWRxPageChildren } from '~/stores/page-listing';
import { useSWRxPageChildren, mutatePageTree } from '~/stores/page-listing';
import { usePageTreeDescCountMap } from '~/stores/ui';

import { shouldCreateWipPage } from '../../../utils/should-create-wip-page';
Expand All @@ -10,6 +10,7 @@ import type { TreeItemToolProps } from '../interfaces';
import { NewPageCreateButton } from './NewPageCreateButton';
import { NewPageInput } from './NewPageInput';


type UseNewPageInput = {
Input: FC<TreeItemToolProps>,
CreateButton: FC<TreeItemToolProps>,
Expand Down Expand Up @@ -77,7 +78,7 @@ export const useNewPageInput = (): UseNewPageInput => {
wip: shouldCreateWipPage(newPagePath),
});

mutateChildren();
mutatePageTree();

if (!hasDescendants) {
stateHandlers?.setIsOpen(true);
Expand Down
13 changes: 10 additions & 3 deletions apps/app/src/features/search/client/components/SearchForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, {
useCallback, useRef, useEffect, useMemo,
} from 'react';

import { GetInputProps } from '../interfaces/downshift';
import type { GetInputProps } from '../interfaces/downshift';

type Props = {
searchKeyword: string,
Expand Down Expand Up @@ -35,7 +35,7 @@ export const SearchForm = (props: Props): JSX.Element => {

const inputOptions = useMemo(() => {
return getInputProps({
type: 'search',
type: 'text',
placeholder: 'Search...',
className: 'form-control',
ref: inputRef,
Expand All @@ -52,11 +52,18 @@ export const SearchForm = (props: Props): JSX.Element => {

return (
<form
className="w-100"
className="w-100 position-relative"
onSubmit={submitHandler}
data-testid="search-form"
>
<input {...inputOptions} />
<button
type="button"
className="btn btn-neutral-secondary text-muted position-absolute bottom-0 end-0 w-auto h-100 border-0"
onClick={() => { onChange?.('') }}
>
<span className="material-symbols-outlined p-0">cancel</span>
</button>
</form>
);
};
20 changes: 10 additions & 10 deletions apps/app/src/features/search/client/components/SearchHelp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,40 +11,40 @@ export const SearchHelp = (): JSX.Element => {
return (
<>
<button type="button" className="btn border-0 text-muted d-flex justify-content-center align-items-center ms-1 p-0" onClick={() => setIsOpen(!isOpen)}>
<span className="material-symbols-outlined me-2">help</span>
{ t('search_help.title') }
<span className="material-symbols-outlined ms-2">{isOpen ? 'expand_less' : 'expand_more'}</span>
<span className="material-symbols-outlined me-2 p-0">help</span>
<span>{t('search_help.title')}</span>
<span className="material-symbols-outlined ms-2 p-0">{isOpen ? 'expand_less' : 'expand_more'}</span>
</button>
<Collapse isOpen={isOpen}>
<table className="table m-0">
<table className="table table-borderless m-0">
<tbody>
<tr>
<tr className="border-bottom">
<th className="py-2">
<code>word1</code> <code>word2</code><br />
<small className="text-muted">({ t('search_help.and.syntax help') })</small>
</th>
<td><h6 className="m-0 text-muted">{ t('search_help.and.desc', { word1: 'word1', word2: 'word2' }) }</h6></td>
</tr>
<tr>
<tr className="border-bottom">
<th className="py-2">
<code>&quot;This is GROWI&quot;</code><br />
<small className="text-muted">({ t('search_help.phrase.syntax help') })</small>
</th>
<td><h6 className="m-0 text-muted">{ t('search_help.phrase.desc', { phrase: 'This is GROWI' }) }</h6></td>
</tr>
<tr>
<tr className="border-bottom">
<th className="py-2"><code>-keyword</code></th>
<td><h6 className="m-0 text-muted">{ t('search_help.exclude.desc', { word: 'keyword' }) }</h6></td>
</tr>
<tr>
<tr className="border-bottom">
<th className="py-2"><code>prefix:/user/</code></th>
<td><h6 className="m-0 text-muted">{ t('search_help.prefix.desc', { path: '/user/' }) }</h6></td>
</tr>
<tr>
<tr className="border-bottom">
<th className="py-2"><code>-prefix:/user/</code></th>
<td><h6 className="m-0 text-muted">{ t('search_help.exclude_prefix.desc', { path: '/user/' }) }</h6></td>
</tr>
<tr>
<tr className="border-bottom">
<th className="py-2"><code>tag:wiki</code></th>
<td><h6 className="m-0 text-muted">{ t('search_help.tag.desc', { tag: 'wiki' }) }</h6></td>
</tr>
Expand Down
Loading

0 comments on commit b43b972

Please sign in to comment.