Skip to content

Commit

Permalink
fix(app-headless-cms): various full screen editor (#4480)
Browse files Browse the repository at this point in the history
  • Loading branch information
leopuleo authored Jan 9, 2025
1 parent eacc7af commit 6bf1d8f
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import { ShowConfirmationOnUnpublish } from "~/admin/components/Decorators/ShowC
import { ShowConfirmationOnDeleteRevision } from "~/admin/components/Decorators/ShowConfirmationOnDeleteRevision";
import { FullScreenContentEntry } from "~/admin/views/contentEntries/ContentEntry/FullScreenContentEntry";
import { ShowRevisionList } from "~/admin/components/ContentEntryForm/Header/ShowRevisionsList";
import { featureFlags } from "@webiny/feature-flags";
import { cmsLegacyEntryEditor } from "~/utils/cmsLegacyEntryEditor";

const { Browser } = ContentEntryListConfig;
const { Actions } = ContentEntryEditorConfig;
Expand Down Expand Up @@ -116,12 +116,12 @@ export const ContentEntriesModule = () => {
<Actions.MenuItemAction name={"delete"} element={<DeleteEntryMenuItem />} />
{/*
The following Menu Action registration is needed
only when the 'allowCmsFullScreenEditor' feature is enabled.
only when the 'cmsLegacyEntryEditor' feature is NOT enabled.
*/}
<Actions.MenuItemAction
name={"showRevisionsList"}
element={<ShowRevisionList />}
remove={!featureFlags.allowCmsFullScreenEditor}
remove={cmsLegacyEntryEditor}
/>
</ContentEntryEditorConfig>
<FullScreenContentEntry />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export const FullScreenContentEntryContentFormWrapper = styled.div`

export const FullScreenContentEntryContentFormInner = styled.div`
flex-shrink: 1;
flex-basis: 920px;
flex-basis: 1020px;
`;

export const FullScreenContentEntryContentFormInnerCss = css`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { useState } from "react";
import { createPortal } from "react-dom";
import { featureFlags } from "@webiny/feature-flags";
import { CircularProgress } from "@webiny/ui/Progress";
import { useContentEntry } from "~/admin/views/contentEntries/hooks";
import { RevisionListDrawer } from "./RevisionListDrawer";
Expand All @@ -16,6 +15,7 @@ import {
} from "./FullScreenContentEntry.styled";
import { FullScreenContentEntryProvider } from "./useFullScreenContentEntry";
import { ContentEntryEditorConfig } from "~/ContentEntryEditorConfig";
import { cmsLegacyEntryEditor } from "~/utils/cmsLegacyEntryEditor";

const { ContentEntry } = ContentEntryEditorConfig;

Expand Down Expand Up @@ -79,7 +79,7 @@ const FullScreenContentEntryFormHeaderDecorator =
});

export const FullScreenContentEntry = () => {
if (!featureFlags.allowCmsFullScreenEditor) {
if (cmsLegacyEntryEditor) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import React from "react";
import { useHotkeys } from "react-hotkeyz";
import { DrawerContent } from "@webiny/ui/Drawer";
import { RevisionsList } from "~/admin/views/contentEntries/ContentEntry/RevisionsList/RevisionsList";
import { featureFlags } from "@webiny/feature-flags";
import { cmsLegacyEntryEditor } from "~/utils/cmsLegacyEntryEditor";
import { useFullScreenContentEntry } from "../useFullScreenContentEntry";
import { Header } from "./Header";
import { Drawer } from "./RevisionListDrawer.styled";

export const RevisionListDrawer = () => {
const { isRevisionListOpen, openRevisionList } = useFullScreenContentEntry();

if (!featureFlags.allowCmsFullScreenEditor) {
if (cmsLegacyEntryEditor) {
return null;
}

Expand Down
3 changes: 3 additions & 0 deletions packages/app-headless-cms/src/utils/cmsLegacyEntryEditor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { featureFlags } from "@webiny/feature-flags";

export const cmsLegacyEntryEditor = featureFlags.cmsLegacyEntryEditor === true;
2 changes: 1 addition & 1 deletion packages/feature-flags/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export type FeatureFlags<TFeatureFlags = Record<string, any>> = {
experimentalAdminOmniSearch?: boolean;
allowCmsLegacyRichTextInput?: boolean;
allowCmsFullScreenEditor?: boolean;
cmsLegacyEntryEditor?: boolean;
experimentalDynamicPages?: boolean;
newWatchCommand?: boolean;
} & TFeatureFlags;
Expand Down
1 change: 0 additions & 1 deletion webiny.project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ export default {
featureFlags: {
experimentalAdminOmniSearch: true,
newWatchCommand: true,
allowCmsFullScreenEditor: false,
experimentalDynamicPages: false
}
};

0 comments on commit 6bf1d8f

Please sign in to comment.