Skip to content

Commit

Permalink
Merge pull request #9007 from weseek/master
Browse files Browse the repository at this point in the history
Release v7.0.17
  • Loading branch information
yuki-takei authored Aug 26, 2024
2 parents 4c8b8f9 + b8d1586 commit e331fe6
Show file tree
Hide file tree
Showing 177 changed files with 1,958 additions and 1,530 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/auto-labeling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ jobs:
runs-on: ubuntu-latest

if: |
!contains(github.event.pull_request.labels.*.name, 'flag/exclude-from-changelog')
(!contains( github.event.pull_request.labels.*.name, 'flag/exclude-from-changelog' )
&& !startsWith( github.head_ref, 'changeset-release/' ))
steps:
- uses: release-drafter/release-drafter@v5
Expand All @@ -33,8 +34,9 @@ jobs:
runs-on: ubuntu-latest

if: |
(!contains( github.event.pull_request.labels.*.name, 'flag/exclude-from-changelog' ) &&
!startsWith( github.head_ref, 'dependabot/' ))
(!contains( github.event.pull_request.labels.*.name, 'flag/exclude-from-changelog' )
&& !startsWith( github.head_ref, 'changeset-release/' )
&& !startsWith( github.head_ref, 'dependabot/' ))
steps:
- uses: amannn/action-semantic-pull-request@v5
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches-ignore:
- release/**
- rc/**
- changeset-release/**
paths:
- .github/workflows/ci-app.yml
- .eslint*
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/reusable-app-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ jobs:
fail-fast: false
matrix:
# List string expressions that is comma separated ids of tests in "test/cypress/integration"
spec-group: ['21', '30', '50']
spec-group: ['21', '50']

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

runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:latest
# Match the Playwright version
# https://github.com/microsoft/playwright/issues/20010
image: mcr.microsoft.com/playwright:v1.46.0-jammy

strategy:
fail-fast: false
Expand Down
11 changes: 7 additions & 4 deletions apps/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@growi/app",
"version": "7.0.16",
"version": "7.0.17-RC.0",
"license": "MIT",
"private": "true",
"scripts": {
Expand Down Expand Up @@ -44,7 +44,8 @@
"vitest:run:components": "vitest run -c vitest.config.components.ts src --coverage",
"previtest:run:integ": "vitest run -c test-with-vite/download-mongo-binary/vitest.config.ts test-with-vite/download-mongo-binary",
"//// misc": "",
"console": "yarn cross-env NODE_ENV=development yarn ts-node --experimental-repl-await src/server/console.js",
"console": "yarn repl",
"repl": "yarn cross-env NODE_ENV=development yarn ts-node src/server/repl.ts",
"swagger-jsdoc": "swagger-jsdoc -o tmp/swagger.json -d config/swagger-definition.js",
"openapi:v3": "yarn cross-env API_VERSION=3 yarn swagger-jsdoc -- \"src/server/routes/apiv3/**/*.js\" \"src/server/models/**/*.js\"",
"openapi:v1": "yarn cross-env API_VERSION=1 yarn swagger-jsdoc -- \"src/server/*/*.js\" \"src/server/models/**/*.js\"",
Expand Down Expand Up @@ -208,15 +209,16 @@
"usehooks-ts": "^2.6.0",
"validator": "^13.7.0",
"ws": "^8.17.1",
"xss": "^1.0.14",
"xss": "^1.0.15",
"y-mongodb-provider": "^0.2.0",
"y-socket.io": "^1.1.3",
"yjs": "^13.6.18"
},
"// comments for defDependencies": {
"bootstrap": "v5.3.3 has a bug. refs: https://github.com/twbs/bootstrap/issues/39798",
"@handsontable/react": "v3 requires handsontable >= 7.0.0.",
"handsontable": "v7.0.0 or above is no loger MIT lisence."
"handsontable": "v7.0.0 or above is no loger MIT lisence.",
"mongodb": "mongoose which is used requires [email protected]."
},
"devDependencies": {
"@growi/core-styles": "link:../../packages/core-styles",
Expand Down Expand Up @@ -260,6 +262,7 @@
"jest-localstorage-mock": "^2.4.14",
"load-css-file": "^1.0.0",
"material-icons": "^1.11.3",
"mongodb": "4.16.0",
"mongodb-memory-server-core": "^9.1.1",
"morgan": "^1.10.0",
"null-loader": "^4.0.1",
Expand Down
227 changes: 227 additions & 0 deletions apps/app/playwright/30-search/search.spect.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
import { test, expect } from '@playwright/test';

test('Search page with "q" param is successfully loaded', async({ page }) => {
// Navigate to the search page with query parameters
await page.goto('/_search?q=alerts');

// Confirm search result elements are visible
await expect(page.getByTestId('search-result-base')).toBeVisible();
await expect(page.getByTestId('search-result-list')).toBeVisible();
await expect(page.getByTestId('search-result-content')).toBeVisible();
await expect(page.locator('.wiki')).toBeVisible();
});

test('checkboxes behaviors', async({ page }) => {
// Navigate to the search page with query parameters
await page.goto('/_search?q=alerts');

// Confirm search result elements are visible
await expect(page.getByTestId('search-result-base')).toBeVisible();
await expect(page.getByTestId('search-result-list')).toBeVisible();
await expect(page.getByTestId('search-result-content')).toBeVisible();
await expect(page.locator('.wiki')).toBeVisible();

// Click the first checkbox
await page.getByTestId('cb-select').first().click({ force: true });

// Unclick the first checkbox
await page.getByTestId('cb-select').first().click({ force: true });

// Click the select all checkbox
await page.getByTestId('delete-control-button').first().click({ force: true });
await page.getByTestId('cb-select-all').click({ force: true });

// Unclick the first checkbox after selecting all
await page.getByTestId('cb-select').first().click({ force: true });

// Click the first checkbox again
await page.getByTestId('cb-select').first().click({ force: true });

// Unclick the select all checkbox
await page.getByTestId('cb-select').first().click({ force: true });
});


test('successfully loads /_private-legacy-pages', async({ page }) => {
await page.goto('/_private-legacy-pages');

// Confirm search result elements are visible
await expect(page.locator('[data-testid="search-result-base"]')).toBeVisible();
await expect(page.locator('[data-testid="search-result-private-legacy-pages"]')).toBeVisible();
});

test('Search all pages by word', async({ page }) => {
await page.goto('/');
await page.getByTestId('open-search-modal-button').click();
await expect(page.getByTestId('search-modal')).toBeVisible();
await page.locator('.form-control').fill('sand');
await expect(page.locator('.search-menu-item').first()).toBeVisible();
});

test.describe.serial('Search all pages', () => {
const tag = 'help';
const searchText = `tag:${tag}`;

test('Successfully created tags', async({ page }) => {
await page.goto('/');

// open Edit Tags Modal to add tag
await page.locator('.grw-side-contents-sticky-container').isVisible();
await page.locator('#edit-tags-btn-wrapper-for-tooltip').click();
await expect(page.locator('#edit-tag-modal')).toBeVisible();
await page.locator('.rbt-input-main').fill(tag);
await page.locator('#tag-typeahead-asynctypeahead-item-0').click();
await page.getByTestId('tag-edit-done-btn').click();

});

test('Search all pages by tag is successfully loaded', async({ page }) => {
await page.goto('/');

// Search
await page.getByTestId('open-search-modal-button').click();
await expect(page.getByTestId('search-modal')).toBeVisible();
await page.locator('.form-control').fill(searchText);
await page.getByTestId('search-all-menu-item').click();

// Confirm search result elements are visible
const searchResultList = page.getByTestId('search-result-list');
await expect(searchResultList).toBeVisible();
await expect(searchResultList.locator('li')).toHaveCount(1);
});

test('Successfully order page search results by tag', async({ page }) => {
await page.goto('/');

await page.locator('.grw-tag-simple-bar').locator('a').click();

expect(page.getByTestId('search-result-base')).toBeVisible();
expect(page.getByTestId('search-result-list')).toBeVisible();
expect(page.getByTestId('search-result-content')).toBeVisible();
});
});

test.describe('Sort with dropdown', () => {
test.beforeEach(async({ page }) => {
await page.goto('/_search?q=sand');

await expect(page.getByTestId('search-result-base')).toBeVisible();
await expect(page.getByTestId('search-result-list')).toBeVisible();
await expect(page.getByTestId('search-result-content')).toBeVisible();

// open sort dropdown
await page.locator('.search-control').locator('button').first().click();
});

test('Open sort dropdown', async({ page }) => {
await expect(page.locator('.search-control .dropdown-menu.show')).toBeVisible();
});

test('Sort by relevance', async({ page }) => {
const dropdownMenu = page.locator('.search-control .dropdown-menu.show');

await expect(dropdownMenu).toBeVisible();
await dropdownMenu.locator('.dropdown-item').nth(0).click();


await expect(page.getByTestId('search-result-base')).toBeVisible();
await expect(page.getByTestId('search-result-list')).toBeVisible();
await expect(page.getByTestId('search-result-content')).toBeVisible();
});

test('Sort by creation date', async({ page }) => {
const dropdownMenu = page.locator('.search-control .dropdown-menu.show');

await expect(dropdownMenu).toBeVisible();
await dropdownMenu.locator('.dropdown-item').nth(1).click();


await expect(page.getByTestId('search-result-base')).toBeVisible();
await expect(page.getByTestId('search-result-list')).toBeVisible();
await expect(page.getByTestId('search-result-content')).toBeVisible();
});

test('Sort by last update date', async({ page }) => {
const dropdownMenu = page.locator('.search-control .dropdown-menu.show');

await expect(dropdownMenu).toBeVisible();
await dropdownMenu.locator('.dropdown-item').nth(2).click();


await expect(page.getByTestId('search-result-base')).toBeVisible();
await expect(page.getByTestId('search-result-list')).toBeVisible();
await expect(page.getByTestId('search-result-content')).toBeVisible();
});
});

test.describe('Search and use', () => {
test.beforeEach(async({ page }) => {
await page.goto('/_search?q=alerts');

await expect(page.getByTestId('search-result-base')).toBeVisible();
await expect(page.getByTestId('search-result-list')).toBeVisible();
await expect(page.getByTestId('search-result-content')).toBeVisible();

await page.getByTestId('page-list-item-L').first().getByTestId('open-page-item-control-btn').click();
await expect(page.locator('.dropdown-menu.show')).toBeVisible();
});

test('Successfully the dropdown is opened', async({ page }) => {
await expect(page.locator('.dropdown-menu.show')).toBeVisible();
});

test('Successfully add bookmark', async({ page }) => {
const dropdonwMenu = page.locator('.dropdown-menu.show');

await expect(dropdonwMenu).toBeVisible();

// Add bookmark
await dropdonwMenu.getByTestId('add-bookmark-btn').click();

await expect(page.getByTestId('search-result-content').locator('.btn-bookmark.active').first()).toBeVisible();
});

test('Successfully open duplicate modal', async({ page }) => {
const dropdonwMenu = page.locator('.dropdown-menu.show');

await expect(dropdonwMenu).toBeVisible();

await dropdonwMenu.getByTestId('open-page-duplicate-modal-btn').click();

await expect(page.getByTestId('page-duplicate-modal')).toBeVisible();
});

test('Successfully open move/rename modal', async({ page }) => {
const dropdonwMenu = page.locator('.dropdown-menu.show');

await expect(dropdonwMenu).toBeVisible();

await dropdonwMenu.getByTestId('rename-page-btn').click();

await expect(page.getByTestId('page-rename-modal')).toBeVisible();
});

test('Successfully open delete modal', async({ page }) => {
const dropdonwMenu = page.locator('.dropdown-menu.show');

await expect(dropdonwMenu).toBeVisible();

await dropdonwMenu.getByTestId('open-page-delete-modal-btn').click();

await expect(page.getByTestId('page-delete-modal')).toBeVisible();
});
});

test('Search current tree by word is successfully loaded', async({ page }) => {
await page.goto('/');
const searchText = 'GROWI';

await page.getByTestId('open-search-modal-button').click();
await expect(page.getByTestId('search-modal')).toBeVisible();
await page.locator('.form-control').fill(searchText);
await page.getByTestId('search-prefix-menu-item').click();

await expect(page.getByTestId('search-result-base')).toBeVisible();
await expect(page.getByTestId('search-result-list')).toBeVisible();
await expect(page.getByTestId('search-result-content')).toBeVisible();
});
1 change: 1 addition & 0 deletions apps/app/public/static/locales/en_US/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,7 @@
"receive_notifications": "Receive Notifications",
"stop_notification": "Stop Notification",
"footprints": "Footprints",
"login_required": "Login required",
"operation": {
"attention": {
"rename": "Renaming paths of descendant pages was not successful, please open the menu from the 3-point reader and select 'Path recovery'"
Expand Down
1 change: 1 addition & 0 deletions apps/app/public/static/locales/fr_FR/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,7 @@
"receive_notifications": "Recevoir les notifications",
"stop_notification": "Stopper les notifications",
"footprints": "Visiteurs",
"login_required": "Connexion requise",
"operation": {
"attention": {
"rename": "Échec du renommage du chemin des pages descendantes, ouvrir le menu du lecteur 3-points et sélectionner 'Récupération du chemin'"
Expand Down
1 change: 1 addition & 0 deletions apps/app/public/static/locales/ja_JP/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,7 @@
"receive_notifications": "通知を受け取る",
"stop_notification": "通知を止める",
"footprints": "足跡",
"login_required": "ログインが必要です",
"operation": {
"attention": {
"rename": "配下のページパスの更新が正常に行われませんでした。3点リーダーからメニューを開き、「パスを修復」を選択してしてください。"
Expand Down
1 change: 1 addition & 0 deletions apps/app/public/static/locales/zh_CN/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,7 @@
"receive_notifications": "接收通知",
"stop_notification": "停止通知",
"footprints": "脚印",
"login_required": "需要登录",
"operation": {
"attention": {
"rename": "重命名子孙页的路径没有成功,请从三点式阅读器上打开菜单,选择 '路径恢复'。"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type Props = {
activityList: IActivityHasId[]
}

const formatDate = (date) => {
const formatDate = (date: Date): string => {
return format(new Date(date), 'yyyy/MM/dd HH:mm:ss');
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import SelectCollectionsModal from './ExportArchiveData/SelectCollectionsModal';


const IGNORED_COLLECTION_NAMES = [
'sessions', 'rlflx', 'activities', 'yjs-writings', 'transferkeys',
'sessions', 'rlflx', 'yjs-writings', 'transferkeys',
];

const ExportArchiveDataPage = (): JSX.Element => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import React, {
import { useTranslation } from 'next-i18next';

import GrowiArchiveImportOption from '~/models/admin/growi-archive-import-option';
import ImportOptionForPages from '~/models/admin/import-option-for-pages';
import ImportOptionForRevisions from '~/models/admin/import-option-for-revisions';
import { ImportOptionForPages } from '~/models/admin/import-option-for-pages';
import { ImportOptionForRevisions } from '~/models/admin/import-option-for-revisions';

import ImportCollectionConfigurationModal from './ImportData/GrowiArchive/ImportCollectionConfigurationModal';
import ImportCollectionItem, { DEFAULT_MODE, MODE_RESTRICTED_COLLECTION } from './ImportData/GrowiArchive/ImportCollectionItem';
Expand Down
Loading

0 comments on commit e331fe6

Please sign in to comment.