Procházet zdrojové kódy

Merge branch 'master' into imprv/144181-wip-page-behavior

Shun Miyazawa před 2 roky
rodič
revize
40656c8812

+ 2 - 2
.github/workflows/ci-app-prod.yml

@@ -62,7 +62,7 @@ jobs:
     with:
     with:
       node-version: 20.x
       node-version: 20.x
       skip-cypress: ${{ contains( github.event.pull_request.labels.*.name, 'dependencies' ) }}
       skip-cypress: ${{ contains( github.event.pull_request.labels.*.name, 'dependencies' ) }}
-      cypress-report-artifact-name: Cypress report
+      cypress-report-artifact-name-prefix: cypress-report-
       cypress-config-video: ${{ inputs.cypress-config-video || false }}
       cypress-config-video: ${{ inputs.cypress-config-video || false }}
     secrets:
     secrets:
       SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
       SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
@@ -78,7 +78,7 @@ jobs:
     with:
     with:
       node-version: 20.x
       node-version: 20.x
       skip-reg-suit: ${{ contains( github.event.pull_request.labels.*.name, 'dependencies' ) }}
       skip-reg-suit: ${{ contains( github.event.pull_request.labels.*.name, 'dependencies' ) }}
-      cypress-report-artifact-name: Cypress report
+      cypress-report-artifact-name-pattern: cypress-report-*
     secrets:
     secrets:
       REG_NOTIFY_GITHUB_PLUGIN_CLIENTID: ${{ secrets.REG_NOTIFY_GITHUB_PLUGIN_CLIENTID }}
       REG_NOTIFY_GITHUB_PLUGIN_CLIENTID: ${{ secrets.REG_NOTIFY_GITHUB_PLUGIN_CLIENTID }}
       AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
       AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}

+ 2 - 2
.github/workflows/reusable-app-prod.yml

@@ -8,7 +8,7 @@ on:
         type: string
         type: string
       skip-cypress:
       skip-cypress:
         type: boolean
         type: boolean
-      cypress-report-artifact-name:
+      cypress-report-artifact-name-prefix:
         type: string
         type: string
       cypress-config-video:
       cypress-config-video:
         type: boolean
         type: boolean
@@ -325,7 +325,7 @@ jobs:
       if: always()
       if: always()
       uses: actions/upload-artifact@v4
       uses: actions/upload-artifact@v4
       with:
       with:
-        name: ${{ inputs.cypress-report-artifact-name }}
+        name: ${{ cypress-report-artifact-name-prefix }}${{ matrix.spec-group }}
         path: |
         path: |
           apps/app/test/cypress/screenshots
           apps/app/test/cypress/screenshots
           apps/app/test/cypress/videos
           apps/app/test/cypress/videos

+ 3 - 2
.github/workflows/reusable-app-reg-suit.yml

@@ -11,7 +11,7 @@ on:
         default: ${{ github.head_ref }}
         default: ${{ github.head_ref }}
       skip-reg-suit:
       skip-reg-suit:
         type: boolean
         type: boolean
-      cypress-report-artifact-name:
+      cypress-report-artifact-name-pattern:
         required: true
         required: true
         type: string
         type: string
     secrets:
     secrets:
@@ -88,8 +88,9 @@ jobs:
     - name: Download screenshots taken by cypress
     - name: Download screenshots taken by cypress
       uses: actions/download-artifact@v4
       uses: actions/download-artifact@v4
       with:
       with:
-        name: ${{ inputs.cypress-report-artifact-name }}
         path: apps/app/test/cypress
         path: apps/app/test/cypress
+        pattern: ${{ inputs.cypress-report-artifact-name-pattern }}
+        merge-multiple: true
 
 
     - name: Run reg-suit
     - name: Run reg-suit
       working-directory: ./apps/app
       working-directory: ./apps/app

+ 6 - 0
apps/app/src/components/PageTags/TagsInput.tsx

@@ -42,6 +42,12 @@ export const TagsInput: FC<Props> = (props: Props) => {
     if (event.key === ' ') {
     if (event.key === ' ') {
       event.preventDefault();
       event.preventDefault();
 
 
+      // fix: https://redmine.weseek.co.jp/issues/140689
+      const isComposing = event.nativeEvent.isComposing;
+      if (isComposing) {
+        return;
+      }
+
       const initialItem = tagsInputRef?.current?.state?.initialItem;
       const initialItem = tagsInputRef?.current?.state?.initialItem;
       const handleMenuItemSelect = tagsInputRef?.current?._handleMenuItemSelect;
       const handleMenuItemSelect = tagsInputRef?.current?._handleMenuItemSelect;
 
 

+ 0 - 1
apps/app/src/components/Sidebar/PageCreateButton/CreateButton.tsx

@@ -15,7 +15,6 @@ export const CreateButton = (props: Props): JSX.Element => {
       type="button"
       type="button"
       {...props}
       {...props}
       className={`${moduleClass} btn btn-primary ${props.className ?? ''}`}
       className={`${moduleClass} btn btn-primary ${props.className ?? ''}`}
-      data-testid="grw-sidebar-nav-page-create-button"
     >
     >
       <Hexagon />
       <Hexagon />
       <span className="icon material-symbols-outlined position-absolute">edit</span>
       <span className="icon material-symbols-outlined position-absolute">edit</span>

+ 1 - 0
apps/app/src/components/Sidebar/PageCreateButton/DropendMenu.tsx

@@ -26,6 +26,7 @@ export const DropendMenu = React.memo((props: DropendMenuProps): JSX.Element =>
   return (
   return (
     <DropdownMenu
     <DropdownMenu
       container="body"
       container="body"
+      data-testid="grw-page-create-button-dropend-menu"
     >
     >
       <DropdownItem
       <DropdownItem
         onClick={onClickCreateNewPage}
         onClick={onClickCreateNewPage}

+ 1 - 0
apps/app/src/components/Sidebar/PageCreateButton/DropendToggle.tsx

@@ -14,6 +14,7 @@ export const DropendToggle = (): JSX.Element => {
       color="primary"
       color="primary"
       className={`position-absolute z-1 ${moduleClass}`}
       className={`position-absolute z-1 ${moduleClass}`}
       aria-expanded={false}
       aria-expanded={false}
+      data-testid="grw-page-create-button-dropend-toggle"
     >
     >
       <Hexagon />
       <Hexagon />
       <div className="hitarea position-absolute" />
       <div className="hitarea position-absolute" />

+ 1 - 0
apps/app/src/components/Sidebar/PageCreateButton/PageCreateButton.tsx

@@ -45,6 +45,7 @@ export const PageCreateButton = React.memo((): JSX.Element => {
       className="d-flex flex-row mt-2"
       className="d-flex flex-row mt-2"
       onMouseEnter={onMouseEnterHandler}
       onMouseEnter={onMouseEnterHandler}
       onMouseLeave={onMouseLeaveHandler}
       onMouseLeave={onMouseLeaveHandler}
+      data-testid="grw-page-create-button"
     >
     >
       <div className="btn-group flex-grow-1">
       <div className="btn-group flex-grow-1">
         <CreateButton
         <CreateButton

+ 6 - 7
apps/app/src/components/Sidebar/Tag.tsx

@@ -2,7 +2,7 @@ import type { FC } from 'react';
 import React, { useState, useCallback } from 'react';
 import React, { useState, useCallback } from 'react';
 
 
 import { useTranslation } from 'next-i18next';
 import { useTranslation } from 'next-i18next';
-import { useRouter } from 'next/router';
+import Link from 'next/link';
 
 
 import type { IDataTagCount } from '~/interfaces/tag';
 import type { IDataTagCount } from '~/interfaces/tag';
 import { useSWRxTagsList } from '~/stores/tag';
 import { useSWRxTagsList } from '~/stores/tag';
@@ -19,8 +19,6 @@ const TAG_CLOUD_LIMIT = 20;
 
 
 const Tag: FC = () => {
 const Tag: FC = () => {
 
 
-  const router = useRouter();
-
   const [activePage, setActivePage] = useState<number>(1);
   const [activePage, setActivePage] = useState<number>(1);
   const [offset, setOffset] = useState<number>(0);
   const [offset, setOffset] = useState<number>(0);
 
 
@@ -71,13 +69,14 @@ const Tag: FC = () => {
       }
       }
 
 
       <div className="d-flex justify-content-center my-5">
       <div className="d-flex justify-content-center my-5">
-        <button
+        <Link
+          href="/tags"
           className="btn btn-primary rounded px-4"
           className="btn btn-primary rounded px-4"
-          type="button"
-          onClick={() => router.push('/tags')}
+          role="button"
+          prefetch={false}
         >
         >
           {t('Check All tags')}
           {t('Check All tags')}
-        </button>
+        </Link>
       </div>
       </div>
 
 
       <h6 className="my-3 pb-1 border-bottom">{t('popular_tags')}</h6>
       <h6 className="my-3 pb-1 border-bottom">{t('popular_tags')}</h6>

+ 16 - 20
apps/app/test/cypress/e2e/23-editor/23-editor--saving.cy.ts

@@ -1,4 +1,4 @@
-context('PageCreateModal', () => {
+context('PageCreateButton', () => {
 
 
   const ssPrefix = 'page-create-modal-';
   const ssPrefix = 'page-create-modal-';
 
 
@@ -9,41 +9,37 @@ context('PageCreateModal', () => {
     });
     });
   });
   });
 
 
-  it("PageCreateModal is shown and closed successfully", () => {
+  it("DropendMenu is shown successfully", () => {
     cy.visit('/');
     cy.visit('/');
     cy.collapseSidebar(true, true);
     cy.collapseSidebar(true, true);
 
 
+    cy.getByTestid('grw-page-create-button').trigger('mouseover');
+
     cy.waitUntil(() => {
     cy.waitUntil(() => {
       // do
       // do
-      cy.getByTestid('newPageBtn').click({force: true});
+      cy.getByTestid('grw-page-create-button-dropend-toggle').click({force: true});
       // wait until
       // wait until
-      return cy.getByTestid('page-create-modal').then($elem => $elem.is(':visible'));
-    });
-
-    cy.getByTestid('page-create-modal').should('be.visible').within(() => {
-      cy.screenshot(`${ssPrefix}new-page-modal-opened`);
-      cy.get('button.close').click();
+      return cy.getByTestid('grw-page-create-button-dropend-menu').then($elem => $elem.is(':visible'));
     });
     });
 
 
-    cy.screenshot(`${ssPrefix}page-create-modal-closed`);
+    cy.screenshot(`${ssPrefix}page-create-button-dropend-menu-shown`);
   });
   });
 
 
   it("Successfully Create Today's page", () => {
   it("Successfully Create Today's page", () => {
-    const pageName = "Today's page";
     cy.visit('/');
     cy.visit('/');
     cy.collapseSidebar(true);
     cy.collapseSidebar(true);
 
 
+    cy.getByTestid('grw-page-create-button').trigger('mouseover');
+
     cy.waitUntil(() => {
     cy.waitUntil(() => {
       // do
       // do
-      cy.getByTestid('newPageBtn').click({force: true});
+      cy.getByTestid('grw-page-create-button-dropend-toggle').click({force: true});
       // wait until
       // wait until
-      return cy.getByTestid('page-create-modal').then($elem => $elem.is(':visible'));
+      return cy.getByTestid('grw-page-create-button-dropend-menu').then($elem => $elem.is(':visible'));
     });
     });
 
 
-    cy.getByTestid('page-create-modal').should('be.visible').within(() => {
-      cy.get('.page-today-input2').type(pageName);
-      cy.screenshot(`${ssPrefix}today-add-page-name`);
-      cy.getByTestid('btn-create-memo').click();
+    cy.getByTestid('grw-page-create-button-dropend-menu').should('be.visible').within(() => {
+      cy.get('button').eq(1).click();
     });
     });
 
 
     cy.getByTestid('page-editor').should('be.visible');
     cy.getByTestid('page-editor').should('be.visible');
@@ -60,7 +56,7 @@ context('PageCreateModal', () => {
     cy.screenshot(`${ssPrefix}create-today-page`);
     cy.screenshot(`${ssPrefix}create-today-page`);
   });
   });
 
 
-  it('Successfully create page under specific path', () => {
+  it.skip('Successfully create page under specific path', () => {
     const pageName = 'child';
     const pageName = 'child';
 
 
     cy.visit('/foo/bar');
     cy.visit('/foo/bar');
@@ -98,7 +94,7 @@ context('PageCreateModal', () => {
     cy.screenshot(`${ssPrefix}create-page-under-specific-page`);
     cy.screenshot(`${ssPrefix}create-page-under-specific-page`);
   });
   });
 
 
-  it('Trying to create template page under the root page fail', () => {
+  it.skip('Trying to create template page under the root page fail', () => {
     cy.visit('/');
     cy.visit('/');
     cy.collapseSidebar(true);
     cy.collapseSidebar(true);
 
 
@@ -137,7 +133,7 @@ context('PageCreateModal', () => {
 });
 });
 
 
 
 
-context('Shortcuts', () => {
+context.skip('Shortcuts', () => {
   const ssPrefix = 'shortcuts';
   const ssPrefix = 'shortcuts';
 
 
   beforeEach(() => {
   beforeEach(() => {

+ 3 - 3
apps/app/test/cypress/e2e/50-sidebar/50-sidebar--access-to-side-bar.cy.ts

@@ -22,7 +22,7 @@ describe('Access to sidebar', () => {
         cy.visit('/');
         cy.visit('/');
 
 
         // Since this is a sidebar test, call collapseSidebar in beforeEach.
         // Since this is a sidebar test, call collapseSidebar in beforeEach.
-        cy.collapseSidebar(false);
+        cy.collapseSidebar(false, true);
       });
       });
 
 
       describe('Test show/collapse button', () => {
       describe('Test show/collapse button', () => {
@@ -197,7 +197,7 @@ describe('Access to sidebar', () => {
 
 
         it('Successfully access to custom sidebar', () => {
         it('Successfully access to custom sidebar', () => {
           cy.getByTestid('grw-sidebar-contents').within(() => {
           cy.getByTestid('grw-sidebar-contents').within(() => {
-            cy.get('.grw-sidebar-content-header > h3').find('a');
+            cy.get('.grw-sidebar-content-header > h4').find('a');
 
 
             cy.waitUntilSkeletonDisappear();
             cy.waitUntilSkeletonDisappear();
             cy.screenshot(`${ssPrefix}custom-sidebar-1-access-to-custom-sidebar`, { blackout: blackoutOverride });
             cy.screenshot(`${ssPrefix}custom-sidebar-1-access-to-custom-sidebar`, { blackout: blackoutOverride });
@@ -270,7 +270,7 @@ describe('Access to sidebar', () => {
 
 
         it('Succesfully click all tags button', () => {
         it('Succesfully click all tags button', () => {
           cy.getByTestid('grw-sidebar-content-tags').within(() => {
           cy.getByTestid('grw-sidebar-content-tags').within(() => {
-            cy.get('.btn-primary').click({force: true});
+            cy.get('.btn-primary').click();
           });
           });
           cy.collapseSidebar(true);
           cy.collapseSidebar(true);
           cy.getByTestid('grw-tags-list').should('be.visible');
           cy.getByTestid('grw-tags-list').should('be.visible');