From b70f58860e6d9579f40b096960ed10b532bc226f Mon Sep 17 00:00:00 2001 From: Peter Zimon Date: Fri, 18 Aug 2023 06:55:50 +0200 Subject: [PATCH] AdminX Labs static UI (#17754) refs. https://github.com/TryGhost/Product/issues/3745 - added static UI for Labs in AdminX --- .../src/admin-x-ds/global/ListItem.tsx | 4 +- .../src/assets/images/labs-bg.svg | 8 + .../settings/advanced/AdvancedSettings.tsx | 3 + .../src/components/settings/advanced/Labs.tsx | 165 ++++++++++++++++++ 4 files changed, 179 insertions(+), 1 deletion(-) create mode 100644 apps/admin-x-settings/src/assets/images/labs-bg.svg create mode 100644 apps/admin-x-settings/src/components/settings/advanced/Labs.tsx diff --git a/apps/admin-x-settings/src/admin-x-ds/global/ListItem.tsx b/apps/admin-x-settings/src/admin-x-ds/global/ListItem.tsx index 7f004ae7c5..fd6e69e28f 100644 --- a/apps/admin-x-settings/src/admin-x-ds/global/ListItem.tsx +++ b/apps/admin-x-settings/src/admin-x-ds/global/ListItem.tsx @@ -17,6 +17,7 @@ interface ListItemProps { separator?: boolean; bgOnHover?: boolean; + paddingRight?: boolean; onClick?: (e: React.MouseEvent) => void; children?: React.ReactNode; } @@ -32,6 +33,7 @@ const ListItem: React.FC = ({ testId, separator = true, bgOnHover = true, + paddingRight = true, onClick, children }) => { @@ -58,7 +60,7 @@ const ListItem: React.FC = ({ } {action && -
+
{action}
} diff --git a/apps/admin-x-settings/src/assets/images/labs-bg.svg b/apps/admin-x-settings/src/assets/images/labs-bg.svg new file mode 100644 index 0000000000..96fe975ba8 --- /dev/null +++ b/apps/admin-x-settings/src/assets/images/labs-bg.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/apps/admin-x-settings/src/components/settings/advanced/AdvancedSettings.tsx b/apps/admin-x-settings/src/components/settings/advanced/AdvancedSettings.tsx index 7fc078428b..935e77dc25 100644 --- a/apps/admin-x-settings/src/components/settings/advanced/AdvancedSettings.tsx +++ b/apps/admin-x-settings/src/components/settings/advanced/AdvancedSettings.tsx @@ -1,12 +1,14 @@ import CodeInjection from './CodeInjection'; import History from './History'; import Integrations from './Integrations'; +import Labs from './Labs'; import React from 'react'; import SettingSection from '../../../admin-x-ds/settings/SettingSection'; const searchKeywords = { integrations: ['integration', 'zapier', 'slack', 'amp', 'unsplash', 'first promoter', 'firstpromoter', 'pintura', 'disqus', 'analytics', 'ulysses', 'typeform', 'buffer', 'plausible', 'github'], codeInjection: ['newsletter', 'enable', 'disable', 'turn on'], + labs: ['labs', 'alpha', 'beta', 'flag', 'import', 'export', 'migrate', 'routes', 'redirects', 'translation', 'delete'], history: ['history', 'log', 'events', 'user events', 'staff'] }; @@ -15,6 +17,7 @@ const AdvancedSettings: React.FC = () => { + ); diff --git a/apps/admin-x-settings/src/components/settings/advanced/Labs.tsx b/apps/admin-x-settings/src/components/settings/advanced/Labs.tsx new file mode 100644 index 0000000000..e655265459 --- /dev/null +++ b/apps/admin-x-settings/src/components/settings/advanced/Labs.tsx @@ -0,0 +1,165 @@ +import Button from '../../../admin-x-ds/global/Button'; +import LabsBubbles from '../../../assets/images/labs-bg.svg'; +import List from '../../../admin-x-ds/global/List'; +import ListItem from '../../../admin-x-ds/global/ListItem'; +import React, {useState} from 'react'; +import SettingGroup from '../../../admin-x-ds/settings/SettingGroup'; +import SettingGroupHeader from '../../../admin-x-ds/settings/SettingGroupHeader'; +import TabView from '../../../admin-x-ds/global/TabView'; +import Toggle from '../../../admin-x-ds/global/form/Toggle'; + +const LabItem: React.FC<{ + title?: React.ReactNode; + detail?: React.ReactNode; + action?: React.ReactNode; +}> = ({ + title, + detail, + action +}) => { + return ( + + ); +}; + +const MigrationOptions: React.FC = () => { + return ( + + } + detail='Import posts from a JSON or zip file' + title='Import content' + /> + } + detail='Download all of your posts and settings in a single, glorious JSON file' + title='Export your content' + /> + } + detail='Permanently delete all posts and tags from the database, a hard reset' + title='Delete all content' + /> + + ); +}; + +/* + +*/ + +const AlphaFeatures: React.FC = () => { + return ( + + } + detail={<>Try out Ghost{`'`}s brand new editor, and get early access to the latest features and improvements} + title='Ghost editor (beta)' + /> + } + detail={<>A step-by-step tool to easily import all your content, members and paid subscriptions} + title='Substack migrator' + /> + } + detail={<>Translate your membership flows into your publication language (supported languages). Don’t see yours? Get involved} + title='Portal translation' + /> + +
+ } + detail={<>Configure redirects for old or moved content,
more info in the docs} + title='Redirects' + /> + +