diff --git a/packages/core/admin/admin/src/assets/images/onboarding-preview.png b/packages/core/admin/admin/src/assets/images/onboarding-preview.png deleted file mode 100644 index a63d2b51c8..0000000000 Binary files a/packages/core/admin/admin/src/assets/images/onboarding-preview.png and /dev/null differ diff --git a/packages/core/admin/admin/src/components/Onboarding.tsx b/packages/core/admin/admin/src/components/Onboarding.tsx deleted file mode 100644 index 74246f9b80..0000000000 --- a/packages/core/admin/admin/src/components/Onboarding.tsx +++ /dev/null @@ -1,272 +0,0 @@ -import * as React from 'react'; - -import { - Box, - Button, - Divider, - Flex, - FlexComponent, - Popover, - Typography, - TypographyComponent, - VisuallyHidden, -} from '@strapi/design-system'; -import { Cross, Message, Play, Question, Book, PaperPlane } from '@strapi/icons'; -import { useIntl } from 'react-intl'; -import { styled } from 'styled-components'; - -import onboardingPreview from '../assets/images/onboarding-preview.png'; -import { useAppInfo } from '../features/AppInfo'; - -const Onboarding = () => { - const [isOpen, setIsOpen] = React.useState(false); - const { formatMessage } = useIntl(); - const communityEdition = useAppInfo('Onboarding', (state) => state.communityEdition); - - const docLinks = [ - ...DOCUMENTATION_LINKS, - { - label: { id: 'Settings.application.get-help', defaultMessage: 'Get help' }, - icon: Message, - href: communityEdition - ? 'https://discord.strapi.io' - : 'https://support.strapi.io/support/home', - }, - ]; - - const Icon = isOpen ? Cross : Question; - - return ( - - - - - - - - - - - {formatMessage({ - id: 'app.components.Onboarding.title', - defaultMessage: 'Get started videos', - })} - - - {formatMessage(WATCH_MORE.label)} - - - - {VIDEO_LINKS.map(({ href, duration, label }, index) => ( - - - - {index + 1} - - - - - - - - - - - : - - {duration} - - - - ))} - - {docLinks.map(({ label, href, icon: Icon }) => ( - - - - {formatMessage(label)} - - - ))} - - - - - ); -}; - -// TODO: use new Button props derived from Box props with next DS release -const HelperButton = styled(Button)` - border-radius: 50%; - padding: ${({ theme }) => theme.spaces[3]}; - /* Resetting 2rem height defined by Button component */ - height: unset; - width: unset; - - & > span { - display: flex; - - svg { - width: 1.6rem; - height: 1.6rem; - } - } -`; - -const IconWrapper = styled(Flex)` - transform: translate(-50%, -50%); -`; - -const Number = styled(Typography)``; - -const Label = styled(Typography)``; - -const VideoLinkWrapper = styled>(Flex)` - text-decoration: none; - - :focus-visible { - outline-offset: ${({ theme }) => `-${theme.spaces[1]}`}; - } - - :hover { - background: ${({ theme }) => theme.colors.primary100}; - - /* Hover style for the number displayed */ - ${Number} { - color: ${({ theme }) => theme.colors.primary500}; - } - - /* Hover style for the label */ - ${Label} { - color: ${({ theme }) => theme.colors.primary600}; - } - } -`; - -const Preview = styled.img` - width: ${({ theme }) => theme.spaces[10]}; - height: ${({ theme }) => theme.spaces[8]}; - /* Same overlay used in ModalLayout */ - background: ${({ theme }) => `${theme.colors.neutral800}1F`}; - border-radius: ${({ theme }) => theme.borderRadius}; -`; - -const TypographyLineHeight = styled(Typography)` - /* line height of label and watch more to 1 so they can be better aligned visually */ - line-height: 1; -`; - -const TextLink = styled>(Typography)` - text-decoration: none; - line-height: 1; - - :hover { - text-decoration: underline; - } -`; - -const VIDEO_LINKS = [ - { - label: { - id: 'app.components.Onboarding.link.build-content', - defaultMessage: 'Build a content architecture', - }, - href: 'https://www.youtube.com/watch?v=G9GjN0RxhkE', - duration: '5:48', - }, - { - label: { - id: 'app.components.Onboarding.link.manage-content', - defaultMessage: 'Add & manage content', - }, - href: 'https://www.youtube.com/watch?v=DEZw4KbybAI', - duration: '3:18', - }, - { - label: { id: 'app.components.Onboarding.link.manage-media', defaultMessage: 'Manage media' }, - href: 'https://www.youtube.com/watch?v=-61MuiMQb38', - duration: '3:41', - }, -]; - -const WATCH_MORE = { - href: 'https://www.youtube.com/playlist?list=PL7Q0DQYATmvidz6lEmwE5nIcOAYagxWqq', - label: { - id: 'app.components.Onboarding.link.more-videos', - defaultMessage: 'Watch more videos', - }, -}; - -const DOCUMENTATION_LINKS = [ - { - label: { id: 'global.documentation', defaultMessage: 'documentation' }, - href: 'https://docs.strapi.io', - icon: Book, - }, - { - label: { id: 'app.static.links.cheatsheet', defaultMessage: 'cheatsheet' }, - href: 'https://strapi-showcase.s3-us-west-2.amazonaws.com/CheatSheet.pdf', - icon: PaperPlane, - }, -]; - -export { Onboarding }; diff --git a/packages/core/admin/admin/src/components/Providers.tsx b/packages/core/admin/admin/src/components/Providers.tsx index 09d2359e27..351b7a95ab 100644 --- a/packages/core/admin/admin/src/components/Providers.tsx +++ b/packages/core/admin/admin/src/components/Providers.tsx @@ -59,7 +59,6 @@ const Providers = ({ children, strapi, store }: ProvidersProps) => { {children} diff --git a/packages/core/admin/admin/src/components/tests/Onboarding.test.tsx b/packages/core/admin/admin/src/components/tests/Onboarding.test.tsx deleted file mode 100644 index 7ee768c0f1..0000000000 --- a/packages/core/admin/admin/src/components/tests/Onboarding.test.tsx +++ /dev/null @@ -1,51 +0,0 @@ -import { render } from '@tests/utils'; - -import { useAppInfo } from '../../features/AppInfo'; -import { Onboarding } from '../Onboarding'; - -jest.mock('../../features/AppInfo', () => ({ - ...jest.requireActual('../../features/AppInfo'), - useAppInfo: jest.fn((name, getter) => getter({ communityEdition: true })), -})); - -describe('Onboarding', () => { - test.each([ - 'watch more videos', - 'build a content architecture', - 'add & manage content', - 'manage media', - 'documentation', - 'cheatsheet', - 'get help', - ])('should display %s link', async (link) => { - const { getByRole, user } = render(); - - await user.click(getByRole('button', { name: /open help menu/i })); - - expect(getByRole('link', { name: new RegExp(link, 'i') })).toBeInTheDocument(); - }); - - test('should display discord link for CE edition', async () => { - const { getByRole, user } = render(); - - await user.click(getByRole('button', { name: /open help menu/i })); - - expect(getByRole('link', { name: /get help/i })).toHaveAttribute( - 'href', - 'https://discord.strapi.io' - ); - }); - - test('should display support link for EE edition', async () => { - // @ts-expect-error - mock - useAppInfo.mockImplementation((name, getter) => getter({ communityEdition: false })); - const { getByRole, user } = render(); - - await user.click(getByRole('button', { name: /open help menu/i })); - - expect(getByRole('link', { name: /get help/i })).toHaveAttribute( - 'href', - 'https://support.strapi.io/support/home' - ); - }); -}); diff --git a/packages/core/admin/admin/src/features/Configuration.tsx b/packages/core/admin/admin/src/features/Configuration.tsx index 31fb3556fe..edadf376b6 100644 --- a/packages/core/admin/admin/src/features/Configuration.tsx +++ b/packages/core/admin/admin/src/features/Configuration.tsx @@ -43,7 +43,6 @@ interface ConfigurationContextValue { auth: ConfigurationLogo; menu: ConfigurationLogo; }; - showTutorials: boolean; showReleaseNotification: boolean; updateProjectSettings: (body: UpdateProjectSettingsBody) => Promise; } @@ -60,7 +59,6 @@ interface ConfigurationProviderProps { defaultAuthLogo: StrapiApp['configurations']['authLogo']; defaultMenuLogo: StrapiApp['configurations']['menuLogo']; showReleaseNotification?: boolean; - showTutorials?: boolean; } const ConfigurationProvider = ({ @@ -68,7 +66,6 @@ const ConfigurationProvider = ({ defaultAuthLogo, defaultMenuLogo, showReleaseNotification = false, - showTutorials = false, }: ConfigurationProviderProps) => { const { trackUsage } = useTracking(); const { formatMessage } = useIntl(); @@ -160,7 +157,6 @@ const ConfigurationProvider = ({ return ( { defaultAuthLogo={'strapi.jpg'} defaultMenuLogo={'strapi.jpg'} showReleaseNotification={false} - showTutorials={false} > @@ -58,7 +57,6 @@ describe('ConfigurationProvider', () => { defaultAuthLogo={'strapi.jpg'} defaultMenuLogo={'strapi.jpg'} showReleaseNotification={false} - showTutorials={false} > diff --git a/packages/core/admin/admin/src/layouts/AuthenticatedLayout.tsx b/packages/core/admin/admin/src/layouts/AuthenticatedLayout.tsx index 3c9c98c5e5..ea461696ba 100644 --- a/packages/core/admin/admin/src/layouts/AuthenticatedLayout.tsx +++ b/packages/core/admin/admin/src/layouts/AuthenticatedLayout.tsx @@ -13,7 +13,6 @@ import { GuidedTourModal } from '../components/GuidedTour/Modal'; import { useGuidedTour } from '../components/GuidedTour/Provider'; import { LeftMenu } from '../components/LeftMenu'; import { NpsSurvey } from '../components/NpsSurvey'; -import { Onboarding } from '../components/Onboarding'; import { Page } from '../components/PageHelpers'; import { PluginsInitializer } from '../components/PluginsInitializer'; import { PrivateRoute } from '../components/PrivateRoute'; @@ -91,7 +90,6 @@ const AdminLayout = () => { generalSectionLinks, pluginsSectionLinks, } = useMenu(checkLatestStrapiVersion(strapiVersion, tagName)); - const { showTutorials } = useConfiguration('Admin'); /** * Make sure the event is only send once after accessing the admin panel @@ -130,7 +128,6 @@ const AdminLayout = () => { - {showTutorials && } diff --git a/packages/core/admin/admin/tests/utils.tsx b/packages/core/admin/admin/tests/utils.tsx index 16839cd19c..1ced67f93f 100644 --- a/packages/core/admin/admin/tests/utils.tsx +++ b/packages/core/admin/admin/tests/utils.tsx @@ -155,7 +155,6 @@ const Providers = ({ children, initialEntries, storeConfig, permissions = [] }: ( return ( - setPopoverOpen(true)} color="primary600" > {children} - + diff --git a/packages/core/content-manager/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/utils/prismLanguages.ts b/packages/core/content-manager/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/utils/prismLanguages.ts deleted file mode 100644 index c48c367c69..0000000000 --- a/packages/core/content-manager/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/utils/prismLanguages.ts +++ /dev/null @@ -1,49 +0,0 @@ -import 'prismjs/components/prism-asmatmel'; -import 'prismjs/components/prism-bash'; -import 'prismjs/components/prism-basic'; -import 'prismjs/components/prism-c'; -import 'prismjs/components/prism-clojure'; -import 'prismjs/components/prism-cobol'; -import 'prismjs/components/prism-cpp'; -import 'prismjs/components/prism-csharp'; -import 'prismjs/components/prism-dart'; -import 'prismjs/components/prism-docker'; -import 'prismjs/components/prism-elixir'; -import 'prismjs/components/prism-erlang'; -import 'prismjs/components/prism-fortran'; -import 'prismjs/components/prism-fsharp'; -import 'prismjs/components/prism-go'; -import 'prismjs/components/prism-graphql'; -import 'prismjs/components/prism-groovy'; -import 'prismjs/components/prism-haskell'; -import 'prismjs/components/prism-haxe'; -import 'prismjs/components/prism-ini'; -import 'prismjs/components/prism-java'; -import 'prismjs/components/prism-javascript'; -import 'prismjs/components/prism-jsx'; -import 'prismjs/components/prism-json'; -import 'prismjs/components/prism-julia'; -import 'prismjs/components/prism-kotlin'; -import 'prismjs/components/prism-latex'; -import 'prismjs/components/prism-lua'; -import 'prismjs/components/prism-markdown'; -import 'prismjs/components/prism-matlab'; -import 'prismjs/components/prism-makefile'; -import 'prismjs/components/prism-objectivec'; -import 'prismjs/components/prism-perl'; -import 'prismjs/components/prism-php'; -import 'prismjs/components/prism-powershell'; -import 'prismjs/components/prism-python'; -import 'prismjs/components/prism-r'; -import 'prismjs/components/prism-ruby'; -import 'prismjs/components/prism-rust'; -import 'prismjs/components/prism-sas'; -import 'prismjs/components/prism-scala'; -import 'prismjs/components/prism-scheme'; -import 'prismjs/components/prism-sql'; -import 'prismjs/components/prism-stata'; -import 'prismjs/components/prism-swift'; -import 'prismjs/components/prism-typescript'; -import 'prismjs/components/prism-tsx'; -import 'prismjs/components/prism-vbnet'; -import 'prismjs/components/prism-yaml'; diff --git a/packages/core/content-manager/rollup.config.mjs b/packages/core/content-manager/rollup.config.mjs index 0094ad9185..3ca00fc62d 100644 --- a/packages/core/content-manager/rollup.config.mjs +++ b/packages/core/content-manager/rollup.config.mjs @@ -18,7 +18,7 @@ export default defineConfig([ { dir: path.join(import.meta.dirname, 'dist/server'), entryFileNames: '[name].mjs', - chunkFileNames: 'chunks/[name]-[hash].js', + chunkFileNames: 'chunks/[name]-[hash].mjs', exports: 'auto', format: 'esm', sourcemap: true, @@ -41,7 +41,7 @@ export default defineConfig([ { dir: path.join(import.meta.dirname, 'dist/admin'), entryFileNames: '[name].mjs', - chunkFileNames: 'chunks/[name]-[hash].js', + chunkFileNames: 'chunks/[name]-[hash].mjs', exports: 'named', format: 'esm', sourcemap: true, @@ -64,7 +64,7 @@ export default defineConfig([ { dir: path.join(import.meta.dirname, 'dist/shared'), entryFileNames: '[name].mjs', - chunkFileNames: 'chunks/[name]-[hash].js', + chunkFileNames: 'chunks/[name]-[hash].mjs', exports: 'auto', format: 'esm', sourcemap: true, diff --git a/packages/core/content-releases/rollup.config.mjs b/packages/core/content-releases/rollup.config.mjs index a39fd97248..673463691f 100644 --- a/packages/core/content-releases/rollup.config.mjs +++ b/packages/core/content-releases/rollup.config.mjs @@ -18,7 +18,7 @@ export default defineConfig([ { dir: path.join(import.meta.dirname, 'dist/server'), entryFileNames: '[name].mjs', - chunkFileNames: 'chunks/[name]-[hash].js', + chunkFileNames: 'chunks/[name]-[hash].mjs', exports: 'auto', format: 'esm', sourcemap: true, @@ -41,7 +41,7 @@ export default defineConfig([ { dir: path.join(import.meta.dirname, 'dist/admin'), entryFileNames: '[name].mjs', - chunkFileNames: 'chunks/[name]-[hash].js', + chunkFileNames: 'chunks/[name]-[hash].mjs', exports: 'auto', format: 'esm', sourcemap: true, diff --git a/packages/core/content-type-builder/admin/src/components/DataManagerProvider/DataManagerProvider.tsx b/packages/core/content-type-builder/admin/src/components/DataManagerProvider/DataManagerProvider.tsx index 0ade63f219..d3108a70f2 100644 --- a/packages/core/content-type-builder/admin/src/components/DataManagerProvider/DataManagerProvider.tsx +++ b/packages/core/content-type-builder/admin/src/components/DataManagerProvider/DataManagerProvider.tsx @@ -306,6 +306,7 @@ const DataManagerProvider = ({ children }: DataManagerProviderProps) => { try { const requestURL = `/${pluginId}/${endPoint}/${currentUid}`; const isTemporary = get(modifiedData, [firstKeyToMainSchema, 'isTemporary'], false); + // eslint-disable-next-line no-alert const userConfirm = window.confirm( formatMessage({ @@ -339,6 +340,7 @@ const DataManagerProvider = ({ children }: DataManagerProviderProps) => { // Unlock the app await unlockAppWithAutoreload?.(); + await getDataRef.current(); // Refetch the permissions await updatePermissions(); } @@ -562,7 +564,6 @@ const DataManagerProvider = ({ children }: DataManagerProviderProps) => { // refetch and update initial state after the data has been saved await getDataRef.current(); - dispatch(actions.updateInitialState()); // Update the app's permissions await updatePermissions(); diff --git a/packages/core/content-type-builder/admin/src/components/DataManagerProvider/reducer.ts b/packages/core/content-type-builder/admin/src/components/DataManagerProvider/reducer.ts index cd8fcd7ddd..bf4729516b 100644 --- a/packages/core/content-type-builder/admin/src/components/DataManagerProvider/reducer.ts +++ b/packages/core/content-type-builder/admin/src/components/DataManagerProvider/reducer.ts @@ -160,6 +160,35 @@ const slice = createSlice({ state.contentTypes = contentTypes; state.reservedNames = reservedNames; state.isLoading = false; + + state.modifiedData = { + ...DEFAULT_MODIFIED_DATA, + component: state.modifiedData.component + ? components[state.modifiedData.component.uid] + : undefined, + contentType: state.modifiedData.contentType + ? contentTypes[state.modifiedData.contentType.uid] + : undefined, + components: state.modifiedData.components + ? Object.keys(state.modifiedData.components).reduce( + (acc, key) => { + acc[key] = components[key]; + return acc; + }, + {} as Record + ) + : {}, + contentTypes: state.modifiedData.contentTypes + ? Object.keys(state.modifiedData.contentTypes).reduce( + (acc, key) => { + acc[key] = contentTypes[key]; + return acc; + }, + {} as Record + ) + : {}, + }; + state.initialData = state.modifiedData; }, addAttribute: (state, action: PayloadAction) => { const { attributeToSet, forTarget, targetUid, shouldAddComponentToData } = action.payload; diff --git a/packages/core/content-type-builder/admin/src/types.ts b/packages/core/content-type-builder/admin/src/types.ts index da49e95152..443f9a0c0e 100644 --- a/packages/core/content-type-builder/admin/src/types.ts +++ b/packages/core/content-type-builder/admin/src/types.ts @@ -30,7 +30,7 @@ export interface Component { } export interface ContentType { - uid?: Internal.UID.ContentType; + uid: Internal.UID.ContentType; isTemporary?: boolean; visible?: boolean; name?: string; diff --git a/packages/core/content-type-builder/admin/src/utils/formAPI.ts b/packages/core/content-type-builder/admin/src/utils/formAPI.ts index 92331de775..eb74c6f77a 100644 --- a/packages/core/content-type-builder/admin/src/utils/formAPI.ts +++ b/packages/core/content-type-builder/admin/src/utils/formAPI.ts @@ -47,7 +47,9 @@ export const formsAPI: any = { extendContentType({ validator, form: { advanced, base } }: any) { const { contentType } = this.types; - contentType.validators.push(validator); + if (validator) { + contentType.validators.push(validator); + } contentType.form.advanced.push(advanced); contentType.form.base.push(base); }, @@ -69,7 +71,9 @@ export const formsAPI: any = { }; } - formType[field].validators.push(validator); + if (validator) { + formType[field].validators.push(validator); + } formType[field].form.advanced.push(advanced); formType[field].form.base.push(base); }); diff --git a/packages/core/content-type-builder/rollup.config.mjs b/packages/core/content-type-builder/rollup.config.mjs index a39fd97248..673463691f 100644 --- a/packages/core/content-type-builder/rollup.config.mjs +++ b/packages/core/content-type-builder/rollup.config.mjs @@ -18,7 +18,7 @@ export default defineConfig([ { dir: path.join(import.meta.dirname, 'dist/server'), entryFileNames: '[name].mjs', - chunkFileNames: 'chunks/[name]-[hash].js', + chunkFileNames: 'chunks/[name]-[hash].mjs', exports: 'auto', format: 'esm', sourcemap: true, @@ -41,7 +41,7 @@ export default defineConfig([ { dir: path.join(import.meta.dirname, 'dist/admin'), entryFileNames: '[name].mjs', - chunkFileNames: 'chunks/[name]-[hash].js', + chunkFileNames: 'chunks/[name]-[hash].mjs', exports: 'auto', format: 'esm', sourcemap: true, diff --git a/packages/core/email/rollup.config.mjs b/packages/core/email/rollup.config.mjs index a39fd97248..673463691f 100644 --- a/packages/core/email/rollup.config.mjs +++ b/packages/core/email/rollup.config.mjs @@ -18,7 +18,7 @@ export default defineConfig([ { dir: path.join(import.meta.dirname, 'dist/server'), entryFileNames: '[name].mjs', - chunkFileNames: 'chunks/[name]-[hash].js', + chunkFileNames: 'chunks/[name]-[hash].mjs', exports: 'auto', format: 'esm', sourcemap: true, @@ -41,7 +41,7 @@ export default defineConfig([ { dir: path.join(import.meta.dirname, 'dist/admin'), entryFileNames: '[name].mjs', - chunkFileNames: 'chunks/[name]-[hash].js', + chunkFileNames: 'chunks/[name]-[hash].mjs', exports: 'auto', format: 'esm', sourcemap: true, diff --git a/packages/core/review-workflows/rollup.config.mjs b/packages/core/review-workflows/rollup.config.mjs index a39fd97248..673463691f 100644 --- a/packages/core/review-workflows/rollup.config.mjs +++ b/packages/core/review-workflows/rollup.config.mjs @@ -18,7 +18,7 @@ export default defineConfig([ { dir: path.join(import.meta.dirname, 'dist/server'), entryFileNames: '[name].mjs', - chunkFileNames: 'chunks/[name]-[hash].js', + chunkFileNames: 'chunks/[name]-[hash].mjs', exports: 'auto', format: 'esm', sourcemap: true, @@ -41,7 +41,7 @@ export default defineConfig([ { dir: path.join(import.meta.dirname, 'dist/admin'), entryFileNames: '[name].mjs', - chunkFileNames: 'chunks/[name]-[hash].js', + chunkFileNames: 'chunks/[name]-[hash].mjs', exports: 'auto', format: 'esm', sourcemap: true, diff --git a/packages/core/strapi/rollup.config.mjs b/packages/core/strapi/rollup.config.mjs index 37c269a5e4..f074f59a01 100644 --- a/packages/core/strapi/rollup.config.mjs +++ b/packages/core/strapi/rollup.config.mjs @@ -23,7 +23,7 @@ export default defineConfig([ { dir: import.meta.dirname + '/dist', entryFileNames: '[name].mjs', - chunkFileNames: 'chunks/[name]-[hash].js', + chunkFileNames: 'chunks/[name]-[hash].mjs', exports: 'auto', format: 'esm', sourcemap: true, diff --git a/packages/core/upload/rollup.config.mjs b/packages/core/upload/rollup.config.mjs index a39fd97248..673463691f 100644 --- a/packages/core/upload/rollup.config.mjs +++ b/packages/core/upload/rollup.config.mjs @@ -18,7 +18,7 @@ export default defineConfig([ { dir: path.join(import.meta.dirname, 'dist/server'), entryFileNames: '[name].mjs', - chunkFileNames: 'chunks/[name]-[hash].js', + chunkFileNames: 'chunks/[name]-[hash].mjs', exports: 'auto', format: 'esm', sourcemap: true, @@ -41,7 +41,7 @@ export default defineConfig([ { dir: path.join(import.meta.dirname, 'dist/admin'), entryFileNames: '[name].mjs', - chunkFileNames: 'chunks/[name]-[hash].js', + chunkFileNames: 'chunks/[name]-[hash].mjs', exports: 'auto', format: 'esm', sourcemap: true, diff --git a/packages/plugins/cloud/rollup.config.mjs b/packages/plugins/cloud/rollup.config.mjs index 553457cb2a..f88f3aa9c0 100644 --- a/packages/plugins/cloud/rollup.config.mjs +++ b/packages/plugins/cloud/rollup.config.mjs @@ -17,7 +17,7 @@ export default defineConfig({ { dir: path.join(import.meta.dirname, 'dist/admin'), entryFileNames: '[name].mjs', - chunkFileNames: 'chunks/[name]-[hash].js', + chunkFileNames: 'chunks/[name]-[hash].mjs', exports: 'auto', format: 'esm', sourcemap: true, diff --git a/packages/plugins/color-picker/rollup.config.mjs b/packages/plugins/color-picker/rollup.config.mjs index a39fd97248..673463691f 100644 --- a/packages/plugins/color-picker/rollup.config.mjs +++ b/packages/plugins/color-picker/rollup.config.mjs @@ -18,7 +18,7 @@ export default defineConfig([ { dir: path.join(import.meta.dirname, 'dist/server'), entryFileNames: '[name].mjs', - chunkFileNames: 'chunks/[name]-[hash].js', + chunkFileNames: 'chunks/[name]-[hash].mjs', exports: 'auto', format: 'esm', sourcemap: true, @@ -41,7 +41,7 @@ export default defineConfig([ { dir: path.join(import.meta.dirname, 'dist/admin'), entryFileNames: '[name].mjs', - chunkFileNames: 'chunks/[name]-[hash].js', + chunkFileNames: 'chunks/[name]-[hash].mjs', exports: 'auto', format: 'esm', sourcemap: true, diff --git a/packages/plugins/documentation/rollup.config.mjs b/packages/plugins/documentation/rollup.config.mjs index a39fd97248..673463691f 100644 --- a/packages/plugins/documentation/rollup.config.mjs +++ b/packages/plugins/documentation/rollup.config.mjs @@ -18,7 +18,7 @@ export default defineConfig([ { dir: path.join(import.meta.dirname, 'dist/server'), entryFileNames: '[name].mjs', - chunkFileNames: 'chunks/[name]-[hash].js', + chunkFileNames: 'chunks/[name]-[hash].mjs', exports: 'auto', format: 'esm', sourcemap: true, @@ -41,7 +41,7 @@ export default defineConfig([ { dir: path.join(import.meta.dirname, 'dist/admin'), entryFileNames: '[name].mjs', - chunkFileNames: 'chunks/[name]-[hash].js', + chunkFileNames: 'chunks/[name]-[hash].mjs', exports: 'auto', format: 'esm', sourcemap: true, diff --git a/packages/plugins/graphql/rollup.config.mjs b/packages/plugins/graphql/rollup.config.mjs index a39fd97248..673463691f 100644 --- a/packages/plugins/graphql/rollup.config.mjs +++ b/packages/plugins/graphql/rollup.config.mjs @@ -18,7 +18,7 @@ export default defineConfig([ { dir: path.join(import.meta.dirname, 'dist/server'), entryFileNames: '[name].mjs', - chunkFileNames: 'chunks/[name]-[hash].js', + chunkFileNames: 'chunks/[name]-[hash].mjs', exports: 'auto', format: 'esm', sourcemap: true, @@ -41,7 +41,7 @@ export default defineConfig([ { dir: path.join(import.meta.dirname, 'dist/admin'), entryFileNames: '[name].mjs', - chunkFileNames: 'chunks/[name]-[hash].js', + chunkFileNames: 'chunks/[name]-[hash].mjs', exports: 'auto', format: 'esm', sourcemap: true, diff --git a/packages/plugins/i18n/rollup.config.mjs b/packages/plugins/i18n/rollup.config.mjs index a39fd97248..673463691f 100644 --- a/packages/plugins/i18n/rollup.config.mjs +++ b/packages/plugins/i18n/rollup.config.mjs @@ -18,7 +18,7 @@ export default defineConfig([ { dir: path.join(import.meta.dirname, 'dist/server'), entryFileNames: '[name].mjs', - chunkFileNames: 'chunks/[name]-[hash].js', + chunkFileNames: 'chunks/[name]-[hash].mjs', exports: 'auto', format: 'esm', sourcemap: true, @@ -41,7 +41,7 @@ export default defineConfig([ { dir: path.join(import.meta.dirname, 'dist/admin'), entryFileNames: '[name].mjs', - chunkFileNames: 'chunks/[name]-[hash].js', + chunkFileNames: 'chunks/[name]-[hash].mjs', exports: 'auto', format: 'esm', sourcemap: true, diff --git a/packages/plugins/sentry/rollup.config.mjs b/packages/plugins/sentry/rollup.config.mjs index a39fd97248..673463691f 100644 --- a/packages/plugins/sentry/rollup.config.mjs +++ b/packages/plugins/sentry/rollup.config.mjs @@ -18,7 +18,7 @@ export default defineConfig([ { dir: path.join(import.meta.dirname, 'dist/server'), entryFileNames: '[name].mjs', - chunkFileNames: 'chunks/[name]-[hash].js', + chunkFileNames: 'chunks/[name]-[hash].mjs', exports: 'auto', format: 'esm', sourcemap: true, @@ -41,7 +41,7 @@ export default defineConfig([ { dir: path.join(import.meta.dirname, 'dist/admin'), entryFileNames: '[name].mjs', - chunkFileNames: 'chunks/[name]-[hash].js', + chunkFileNames: 'chunks/[name]-[hash].mjs', exports: 'auto', format: 'esm', sourcemap: true, diff --git a/packages/plugins/users-permissions/rollup.config.mjs b/packages/plugins/users-permissions/rollup.config.mjs index 705d971517..15810a010f 100644 --- a/packages/plugins/users-permissions/rollup.config.mjs +++ b/packages/plugins/users-permissions/rollup.config.mjs @@ -18,7 +18,7 @@ export default defineConfig([ { dir: path.join(import.meta.dirname, 'dist/admin'), entryFileNames: '[name].mjs', - chunkFileNames: 'chunks/[name]-[hash].js', + chunkFileNames: 'chunks/[name]-[hash].mjs', exports: 'auto', format: 'esm', sourcemap: true, @@ -41,7 +41,7 @@ export default defineConfig([ { dir: path.join(import.meta.dirname, 'dist/server'), entryFileNames: '[name].mjs', - chunkFileNames: 'chunks/[name]-[hash].js', + chunkFileNames: 'chunks/[name]-[hash].mjs', exports: 'auto', format: 'esm', sourcemap: true, diff --git a/tests/e2e/tests/content-manager/history.spec.ts b/tests/e2e/tests/content-manager/history.spec.ts index 29588f1d5a..1e17228e9c 100644 --- a/tests/e2e/tests/content-manager/history.spec.ts +++ b/tests/e2e/tests/content-manager/history.spec.ts @@ -28,11 +28,9 @@ const goToHistoryPage = async (page: Page) => { await moreActionsButton.click(); const historyButton = page.getByRole('menuitem', { name: /content history/i }); - // TODO find out why the history button sometimes doesn't appear. Reloading shouldn't be necessary if (await historyButton.isVisible()) { await clickAndWait(page, historyButton); } else { - await page.reload(); await goToHistoryPage(page); } }; diff --git a/tests/e2e/tests/content-type-builder/collection-type/edit-collection-type.spec.ts b/tests/e2e/tests/content-type-builder/collection-type/edit-collection-type.spec.ts index 14bb577a6a..640cf27d3b 100644 --- a/tests/e2e/tests/content-type-builder/collection-type/edit-collection-type.spec.ts +++ b/tests/e2e/tests/content-type-builder/collection-type/edit-collection-type.spec.ts @@ -41,8 +41,6 @@ test.describe('Edit collection type', () => { await page.getByRole('button', { name: 'Finish' }).click(); await page.getByRole('button', { name: 'Save' }).click(); - // TODO: this is here because of a bug where the admin UI doesn't understand the option has changed - // Fix the bug then remove this await waitForRestart(page); await expect(page.getByRole('cell', { name: 'product', exact: true })).toBeVisible(); @@ -66,10 +64,6 @@ test.describe('Edit collection type', () => { await waitForRestart(page); await expect(page.getByRole('heading', { name: ctName })).toBeVisible(); - // TODO: this is here because of a bug where the admin UI doesn't understand the option has changed - // Fix the bug then remove this - await page.reload(); - // toggle on - we see that the "off" worked because here it doesn't prompt to confirm data loss await page.getByRole('button', { name: 'Edit' }).first().click(); await page.getByRole('tab', { name: 'Advanced settings' }).click(); @@ -89,10 +83,6 @@ test.describe('Edit collection type', () => { await waitForRestart(page); await expect(page.getByRole('heading', { name: ctName })).toBeVisible(); - // TODO: this is here because of a bug where the admin UI doesn't understand the option has changed - // Fix the bug then remove this - await page.reload(); - // toggle on - we see that the "off" worked because here it doesn't prompt to confirm data loss await page.getByRole('button', { name: 'Edit' }).first().click(); await page.getByRole('tab', { name: 'Advanced settings' }).click(); @@ -176,9 +166,6 @@ test.describe('Edit collection type', () => { await waitForRestart(page); - // TODO: fix bug that requires a page refresh to see that content types have been updated - await page.reload(); - await expect(page.getByRole('heading', { name: newname })).toBeVisible(); }); @@ -192,9 +179,6 @@ test.describe('Edit collection type', () => { await waitForRestart(page); - // TODO: fix bug that requires a page refresh to see that content types have been updated - await page.reload(); - await expect(page.getByRole('heading', { name: ctName })).not.toBeVisible(); }); diff --git a/tests/e2e/tests/content-type-builder/components/update-components.spec.ts b/tests/e2e/tests/content-type-builder/components/update-components.spec.ts index 812ac27f74..4648a94aae 100644 --- a/tests/e2e/tests/content-type-builder/components/update-components.spec.ts +++ b/tests/e2e/tests/content-type-builder/components/update-components.spec.ts @@ -137,9 +137,6 @@ test.describe('Update a new component', () => { // delete it await deleteComponent(page, 'SomeComponent'); - // TODO: fix issue that components aren't removed from side navigation or content types until refresh - await page.reload({ waitUntil: 'networkidle' }); - // confirm that it no longer exists in the content type this component was in await navToHeader(page, ['Content-Type Builder', collectionType.name], collectionType.name); await expect(page.getByText(componentAttributeName, { exact: true })).not.toBeVisible(); diff --git a/tests/e2e/tests/content-type-builder/single-type/edit-single-type.spec.ts b/tests/e2e/tests/content-type-builder/single-type/edit-single-type.spec.ts index a1a3b47c93..40b4ca6edf 100644 --- a/tests/e2e/tests/content-type-builder/single-type/edit-single-type.spec.ts +++ b/tests/e2e/tests/content-type-builder/single-type/edit-single-type.spec.ts @@ -40,10 +40,6 @@ test.describe('Edit single type', () => { await waitForRestart(page); await expect(page.getByRole('heading', { name: ctName })).toBeVisible(); - // TODO: this is here because of a bug where the admin UI doesn't understand the option has changed - // Fix the bug then remove this - await page.reload(); - // toggle on - we see that the "off" worked because here it doesn't prompt to confirm data loss await page.getByRole('button', { name: 'Edit', exact: true }).click(); await page.getByRole('tab', { name: 'Advanced settings' }).click(); @@ -63,10 +59,6 @@ test.describe('Edit single type', () => { await waitForRestart(page); await expect(page.getByRole('heading', { name: ctName })).toBeVisible(); - // TODO: this is here because of a bug where the admin UI doesn't understand the option has changed - // Fix the bug then remove this - await page.reload(); - // toggle on - we see that the "off" worked because here it doesn't prompt to confirm data loss await page.getByRole('button', { name: 'Edit', exact: true }).click(); await page.getByRole('tab', { name: 'Advanced settings' }).click(); @@ -102,9 +94,6 @@ test.describe('Edit single type', () => { await waitForRestart(page); - // TODO: fix bug that requires a page refresh to see that content types have been updated - await page.reload(); - await expect(page.getByRole('heading', { name: newname })).toBeVisible(); }); @@ -118,9 +107,6 @@ test.describe('Edit single type', () => { await waitForRestart(page); - // TODO: fix bug that requires a page refresh to see that content types have been updated - await page.reload(); - await expect(page.getByRole('heading', { name: ctName })).not.toBeVisible(); }); });