From 5b64392a987ba3abad9aef31bfb1e786e7bb52f1 Mon Sep 17 00:00:00 2001 From: Erik Michelson Date: Thu, 29 Jun 2023 21:37:57 +0200 Subject: [PATCH] refactor: move motd modal Signed-off-by: Erik Michelson --- .../src/components/editor-page/editor-page-content.tsx | 4 ++-- .../motd-modal/__snapshots__/motd-modal.spec.tsx.snap | 0 .../motd-modal/fetch-motd.spec.ts | 0 .../motd-modal/fetch-motd.ts | 2 +- .../motd-modal/motd-modal.spec.tsx | 10 +++++----- .../motd-modal/motd-modal.tsx | 4 ++-- .../src/components/landing-layout/landing-layout.tsx | 4 ++-- frontend/src/pages/s/[noteId].tsx | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) rename frontend/src/components/{common => global-dialogs}/motd-modal/__snapshots__/motd-modal.spec.tsx.snap (100%) rename frontend/src/components/{common => global-dialogs}/motd-modal/fetch-motd.spec.ts (100%) rename frontend/src/components/{common => global-dialogs}/motd-modal/fetch-motd.ts (96%) rename frontend/src/components/{common => global-dialogs}/motd-modal/motd-modal.spec.tsx (87%) rename frontend/src/components/{common => global-dialogs}/motd-modal/motd-modal.tsx (94%) diff --git a/frontend/src/components/editor-page/editor-page-content.tsx b/frontend/src/components/editor-page/editor-page-content.tsx index 89960e8a2..30eff1c2d 100644 --- a/frontend/src/components/editor-page/editor-page-content.tsx +++ b/frontend/src/components/editor-page/editor-page-content.tsx @@ -1,11 +1,11 @@ /* - * SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file) + * SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file) * * SPDX-License-Identifier: AGPL-3.0-only */ import { useApplyDarkModeStyle } from '../../hooks/dark-mode/use-apply-dark-mode-style' import { useSaveDarkModePreferenceToLocalStorage } from '../../hooks/dark-mode/use-save-dark-mode-preference-to-local-storage' -import { MotdModal } from '../common/motd-modal/motd-modal' +import { MotdModal } from '../global-dialogs/motd-modal/motd-modal' import { CommunicatorImageLightbox } from '../markdown-renderer/extensions/image/communicator-image-lightbox' import { ExtensionEventEmitterProvider } from '../markdown-renderer/hooks/use-extension-event-emitter' import { AppBar, AppBarMode } from './app-bar/app-bar' diff --git a/frontend/src/components/common/motd-modal/__snapshots__/motd-modal.spec.tsx.snap b/frontend/src/components/global-dialogs/motd-modal/__snapshots__/motd-modal.spec.tsx.snap similarity index 100% rename from frontend/src/components/common/motd-modal/__snapshots__/motd-modal.spec.tsx.snap rename to frontend/src/components/global-dialogs/motd-modal/__snapshots__/motd-modal.spec.tsx.snap diff --git a/frontend/src/components/common/motd-modal/fetch-motd.spec.ts b/frontend/src/components/global-dialogs/motd-modal/fetch-motd.spec.ts similarity index 100% rename from frontend/src/components/common/motd-modal/fetch-motd.spec.ts rename to frontend/src/components/global-dialogs/motd-modal/fetch-motd.spec.ts diff --git a/frontend/src/components/common/motd-modal/fetch-motd.ts b/frontend/src/components/global-dialogs/motd-modal/fetch-motd.ts similarity index 96% rename from frontend/src/components/common/motd-modal/fetch-motd.ts rename to frontend/src/components/global-dialogs/motd-modal/fetch-motd.ts index 6f6d9d36c..4c438d7d0 100644 --- a/frontend/src/components/common/motd-modal/fetch-motd.ts +++ b/frontend/src/components/global-dialogs/motd-modal/fetch-motd.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file) + * SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file) * * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/frontend/src/components/common/motd-modal/motd-modal.spec.tsx b/frontend/src/components/global-dialogs/motd-modal/motd-modal.spec.tsx similarity index 87% rename from frontend/src/components/common/motd-modal/motd-modal.spec.tsx rename to frontend/src/components/global-dialogs/motd-modal/motd-modal.spec.tsx index 0656b5242..a26caf4d1 100644 --- a/frontend/src/components/common/motd-modal/motd-modal.spec.tsx +++ b/frontend/src/components/global-dialogs/motd-modal/motd-modal.spec.tsx @@ -6,9 +6,9 @@ import * as UseBaseUrlModule from '../../../hooks/common/use-base-url' import { mockI18n } from '../../../test-utils/mock-i18n' import { testId } from '../../../utils/test-id' -import type { CommonModalProps } from '../modals/common-modal' -import * as CommonModalModule from '../modals/common-modal' -import * as RendererIframeModule from '../renderer-iframe/renderer-iframe' +import type { CommonModalProps } from '../../common/modals/common-modal' +import * as CommonModalModule from '../../common/modals/common-modal' +import * as RendererIframeModule from '../../common/renderer-iframe/renderer-iframe' import * as fetchMotdModule from './fetch-motd' import { MotdModal } from './motd-modal' import { act, render, screen } from '@testing-library/react' @@ -16,8 +16,8 @@ import type { PropsWithChildren } from 'react' import React from 'react' jest.mock('./fetch-motd') -jest.mock('../modals/common-modal') -jest.mock('../renderer-iframe/renderer-iframe') +jest.mock('../../common/modals/common-modal') +jest.mock('../../common/renderer-iframe/renderer-iframe') jest.mock('../../../hooks/common/use-base-url') describe('motd modal', () => { diff --git a/frontend/src/components/common/motd-modal/motd-modal.tsx b/frontend/src/components/global-dialogs/motd-modal/motd-modal.tsx similarity index 94% rename from frontend/src/components/common/motd-modal/motd-modal.tsx rename to frontend/src/components/global-dialogs/motd-modal/motd-modal.tsx index 2446a04ec..622faabf0 100644 --- a/frontend/src/components/common/motd-modal/motd-modal.tsx +++ b/frontend/src/components/global-dialogs/motd-modal/motd-modal.tsx @@ -6,10 +6,10 @@ import { cypressId } from '../../../utils/cypress-attribute' import { Logger } from '../../../utils/logger' import { testId } from '../../../utils/test-id' +import { CommonModal } from '../../common/modals/common-modal' +import { RendererIframe } from '../../common/renderer-iframe/renderer-iframe' import { EditorToRendererCommunicatorContextProvider } from '../../editor-page/render-context/editor-to-renderer-communicator-context-provider' import { RendererType } from '../../render-page/window-post-message-communicator/rendering-message' -import { CommonModal } from '../modals/common-modal' -import { RendererIframe } from '../renderer-iframe/renderer-iframe' import { fetchMotd, MOTD_LOCAL_STORAGE_KEY } from './fetch-motd' import React, { useCallback, useEffect, useMemo, useState } from 'react' import { Button, Modal } from 'react-bootstrap' diff --git a/frontend/src/components/landing-layout/landing-layout.tsx b/frontend/src/components/landing-layout/landing-layout.tsx index c2c877489..e534f3b97 100644 --- a/frontend/src/components/landing-layout/landing-layout.tsx +++ b/frontend/src/components/landing-layout/landing-layout.tsx @@ -1,11 +1,11 @@ /* - * SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file) + * SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file) * * SPDX-License-Identifier: AGPL-3.0-only */ import { useApplyDarkModeStyle } from '../../hooks/dark-mode/use-apply-dark-mode-style' import { useSaveDarkModePreferenceToLocalStorage } from '../../hooks/dark-mode/use-save-dark-mode-preference-to-local-storage' -import { MotdModal } from '../common/motd-modal/motd-modal' +import { MotdModal } from '../global-dialogs/motd-modal/motd-modal' import { Footer } from './footer/footer' import { HeaderBar } from './navigation/header-bar/header-bar' import type { PropsWithChildren } from 'react' diff --git a/frontend/src/pages/s/[noteId].tsx b/frontend/src/pages/s/[noteId].tsx index 5543964db..4d4f3bc00 100644 --- a/frontend/src/pages/s/[noteId].tsx +++ b/frontend/src/pages/s/[noteId].tsx @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file) + * SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file) * * SPDX-License-Identifier: AGPL-3.0-only */