Skip to content

Commit b5b1e5f

Browse files
peterzimonErisDS
authored andcommitted
Removed ui60 flag from Settings (#24390)
ref https://linear.app/ghost/issue/PROD-2317/remove-settings-related-ui60-flag - Removed `ui60` flag for settings sidebar navigation and search, content area and related tests. This PR doesn't remove the flag itself as it's still used in the Admin.
1 parent bb3fbd7 commit b5b1e5f

File tree

17 files changed

+65
-929
lines changed

17 files changed

+65
-929
lines changed

apps/admin-x-settings/src/components/Settings.tsx

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,17 @@ import GeneralSettings from './settings/general/GeneralSettings';
66
import GrowthSettings from './settings/growth/GrowthSettings';
77
import MembershipSettings from './settings/membership/MembershipSettings';
88
import SiteSettings from './settings/site/SiteSettings';
9-
import useFeatureFlag from '../hooks/useFeatureFlag';
109

1110
const Settings: React.FC = () => {
12-
const ui60 = useFeatureFlag('ui60');
13-
1411
return (
1512
<>
1613
<div className='mb-[60vh] px-8 pt-16 tablet:max-w-[760px] tablet:px-14 tablet:pt-0'>
17-
{ui60 ?
18-
<>
19-
<GeneralSettings />
20-
<SiteSettings />
21-
<MembershipSettings />
22-
<EmailSettings />
23-
<GrowthSettings />
24-
<AdvancedSettings />
25-
</>
26-
:
27-
<>
28-
<GeneralSettings />
29-
<SiteSettings />
30-
<MembershipSettings />
31-
<GrowthSettings />
32-
<EmailSettings />
33-
<AdvancedSettings />
34-
</>
35-
}
14+
<GeneralSettings />
15+
<SiteSettings />
16+
<MembershipSettings />
17+
<EmailSettings />
18+
<GrowthSettings />
19+
<AdvancedSettings />
3620
</div>
3721
</>
3822
);

apps/admin-x-settings/src/components/Sidebar.tsx

Lines changed: 42 additions & 124 deletions
Large diffs are not rendered by default.

apps/admin-x-settings/src/components/settings/advanced/AdvancedSettings.tsx

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,6 @@ import Labs from './Labs';
66
import MigrationTools from './MigrationTools';
77
import React from 'react';
88
import SearchableSection from '../../SearchableSection';
9-
import SpamFilters from './SpamFilters';
10-
import useFeatureFlag from '../../../hooks/useFeatureFlag';
11-
12-
export const searchKeywords5x = {
13-
integrations: ['advanced', 'integrations', 'zapier', 'slack', 'unsplash', 'first promoter', 'firstpromoter', 'pintura', 'disqus', 'analytics', 'ulysses', 'typeform', 'buffer', 'plausible', 'github', 'webhooks'],
14-
migrationtools: ['import', 'export', 'migrate', 'substack', 'substack', 'migration', 'medium', 'wordpress', 'wp', 'squarespace'],
15-
codeInjection: ['advanced', 'code injection', 'head', 'footer'],
16-
labs: ['advanced', 'labs', 'alpha', 'private', 'beta', 'flag', 'routes', 'redirect', 'translation', 'editor', 'portal'],
17-
history: ['advanced', 'history', 'log', 'events', 'user events', 'staff', 'audit', 'action'],
18-
dangerzone: ['danger', 'danger zone', 'delete', 'content', 'delete all content', 'delete site'],
19-
spamFilters: ['membership', 'signup', 'sign up', 'spam', 'filters', 'prevention', 'prevent', 'block', 'domains', 'email']
20-
};
219

2210
export const searchKeywords = {
2311
integrations: ['advanced', 'integrations', 'zapier', 'slack', 'unsplash', 'first promoter', 'firstpromoter', 'pintura', 'disqus', 'analytics', 'ulysses', 'typeform', 'buffer', 'plausible', 'github', 'webhooks'],
@@ -29,22 +17,6 @@ export const searchKeywords = {
2917
};
3018

3119
const AdvancedSettings: React.FC = () => {
32-
const ui60 = useFeatureFlag('ui60');
33-
34-
if (!ui60) {
35-
return (
36-
<SearchableSection keywords={Object.values(searchKeywords5x).flat()} title='Advanced'>
37-
<Integrations keywords={searchKeywords5x.integrations} />
38-
<MigrationTools keywords={searchKeywords5x.migrationtools} />
39-
<SpamFilters keywords={searchKeywords5x.spamFilters} />
40-
<CodeInjection keywords={searchKeywords5x.codeInjection} />
41-
<Labs keywords={searchKeywords5x.labs} />
42-
<History keywords={searchKeywords5x.history} />
43-
<DangerZone keywords={searchKeywords5x.dangerzone} />
44-
</SearchableSection>
45-
);
46-
}
47-
4820
return (
4921
<SearchableSection keywords={Object.values(searchKeywords).flat()} title='Advanced'>
5022
<Integrations keywords={searchKeywords.integrations} />

apps/admin-x-settings/src/components/settings/general/Facebook.tsx

Lines changed: 0 additions & 141 deletions
This file was deleted.

apps/admin-x-settings/src/components/settings/general/GeneralSettings.tsx

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,14 @@
11
import React from 'react';
22

33
import Analytics from '../membership/Analytics';
4-
import Facebook from './Facebook';
54
import LockSite from './LockSite';
6-
import Metadata from './Metadata';
75
import PublicationLanguage from './PublicationLanguage';
86
import SEOMeta from './SEOMeta';
97
import SearchableSection from '../../SearchableSection';
108
import SocialAccounts from './SocialAccounts';
119
import TimeZone from './TimeZone';
1210
import TitleAndDescription from './TitleAndDescription';
13-
import Twitter from './Twitter';
1411
import Users from './Users';
15-
import useFeatureFlag from '../../../hooks/useFeatureFlag';
16-
17-
// @TODO: Remove this for 6.0 -->
18-
export const searchKeywords5x = {
19-
titleAndDescription: ['general', 'title and description', 'site title', 'site description', 'title & description'],
20-
timeZone: ['general', 'time', 'date', 'site timezone', 'time zone'],
21-
publicationLanguage: ['general', 'publication language', 'locale'],
22-
metadata: ['general', 'metadata', 'title', 'description', 'search', 'engine', 'google', 'meta data'],
23-
twitter: ['general', 'twitter card', 'structured data', 'rich cards', 'x card', 'social'],
24-
facebook: ['general', 'facebook card', 'structured data', 'rich cards', 'social'],
25-
socialAccounts: ['general', 'social accounts', 'facebook', 'twitter', 'structured data', 'rich cards'],
26-
lockSite: ['general', 'password protection', 'lock site', 'make this site private'],
27-
users: ['general', 'users and permissions', 'roles', 'staff', 'invite people', 'contributors', 'editors', 'authors', 'administrators']
28-
};
29-
// <--
3012

3113
export const searchKeywords = {
3214
titleAndDescription: ['general', 'title and description', 'site title', 'site description', 'title & description'],
@@ -40,24 +22,6 @@ export const searchKeywords = {
4022
};
4123

4224
const GeneralSettings: React.FC = () => {
43-
const ui60 = useFeatureFlag('ui60');
44-
45-
if (!ui60) {
46-
return (
47-
<SearchableSection keywords={Object.values(searchKeywords5x).flat()} title="General settings">
48-
<TitleAndDescription keywords={searchKeywords5x.titleAndDescription} />
49-
<TimeZone keywords={searchKeywords5x.timeZone} />
50-
<PublicationLanguage keywords={searchKeywords5x.publicationLanguage} />
51-
<Metadata keywords={searchKeywords5x.metadata} />
52-
<Twitter keywords={searchKeywords5x.twitter} />
53-
<Facebook keywords={searchKeywords5x.facebook} />
54-
<SocialAccounts keywords={searchKeywords5x.socialAccounts} />
55-
<LockSite keywords={searchKeywords5x.lockSite} />
56-
<Users keywords={searchKeywords5x.users} />
57-
</SearchableSection>
58-
);
59-
}
60-
6125
// This section is going to be updated with merging Twitter and Facebook to the Metadata group,
6226
// that's why we're using a dedicated searchKeywords array for it.
6327
return (

0 commit comments

Comments
 (0)