@strapi/admin 4.2.0-alpha.5 → 4.2.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/admin/src/StrapiApp.js +40 -42
- package/admin/src/assets/images/icon_made-by-strapi.svg +5 -0
- package/admin/src/components/GuidedTour/Modal/components/Modal.js +1 -1
- package/admin/src/components/PrivateRoute/index.js +23 -17
- package/admin/src/components/Providers/index.js +65 -32
- package/admin/src/components/Theme/index.js +11 -12
- package/admin/src/components/ThemeToggleProvider/index.js +66 -0
- package/admin/src/content-manager/components/SelectWrapper/utils/getSelectStyles.js +3 -1
- package/admin/src/content-manager/components/Wysiwyg/EditorStylesContainer.js +4 -2
- package/admin/src/contexts/ThemeToggle/index.js +5 -0
- package/admin/src/contexts/index.js +1 -0
- package/admin/src/hooks/index.js +1 -1
- package/admin/src/hooks/useFetchInstalledPlugins/index.js +23 -0
- package/admin/src/{pages/InstalledPluginsPage → hooks/useFetchInstalledPlugins}/utils/api.js +2 -4
- package/admin/src/hooks/useFetchMarketplacePlugins/index.js +23 -0
- package/admin/src/hooks/useFetchMarketplacePlugins/utils/api.js +17 -0
- package/admin/src/hooks/useThemeToggle/index.js +10 -0
- package/admin/src/pages/Admin/Onboarding/index.js +1 -1
- package/admin/src/pages/AuthPage/index.js +22 -5
- package/admin/src/pages/HomePage/SocialLinks.js +0 -3
- package/admin/src/pages/InstalledPluginsPage/Plugins.js +6 -15
- package/admin/src/pages/MarketplacePage/components/EmptyPluginSearch/EmptyPluginGrid.js +27 -0
- package/admin/src/pages/MarketplacePage/components/EmptyPluginSearch/index.js +30 -0
- package/admin/src/pages/MarketplacePage/components/PluginCard/index.js +186 -0
- package/admin/src/pages/MarketplacePage/index.js +199 -107
- package/admin/src/pages/MarketplacePage/utils/api.js +9 -0
- package/admin/src/pages/ProfilePage/index.js +74 -10
- package/admin/src/pages/ProfilePage/utils/api.js +4 -2
- package/admin/src/translations/en.json +21 -15
- package/build/4362.91a4253f.chunk.js +1 -0
- package/build/{6250.836851ca.chunk.js → 6404.3c2d0a81.chunk.js} +1 -1
- package/build/90f49a385afb000fb1d4.svg +5 -0
- package/build/{Admin-authenticatedApp.a24ebaa0.chunk.js → Admin-authenticatedApp.187bd266.chunk.js} +1 -1
- package/build/{Admin_homePage.86604515.chunk.js → Admin_homePage.fd1fc572.chunk.js} +1 -1
- package/build/Admin_marketplace.89a0a014.chunk.js +1 -0
- package/build/Admin_pluginsPage.97a514db.chunk.js +1 -0
- package/build/Admin_profilePage.d7192d06.chunk.js +1 -0
- package/build/{Admin_settingsPage.55ec1f30.chunk.js → Admin_settingsPage.a8c7ded5.chunk.js} +1 -1
- package/build/admin-users.2740c223.chunk.js +1 -0
- package/build/content-manager.f1c46a88.chunk.js +1 -0
- package/build/{content-type-builder.de5d18ad.chunk.js → content-type-builder.cda4ba3c.chunk.js} +1 -1
- package/build/{email-settings-page.27ee4a98.chunk.js → email-settings-page.40ee2bda.chunk.js} +1 -1
- package/build/en-json.73a610d6.chunk.js +1 -0
- package/build/index.html +1 -1
- package/build/{main.4ea77c5f.js → main.c12537d5.js} +2 -2
- package/build/{main.4ea77c5f.js.LICENSE.txt → main.c12537d5.js.LICENSE.txt} +0 -0
- package/build/{runtime~main.83b9ee0b.js → runtime~main.e5240b25.js} +1 -1
- package/build/users-email-settings-page.5abb9575.chunk.js +1 -0
- package/package.json +5 -5
- package/server/controllers/admin.js +12 -1
- package/.env +0 -0
- package/admin/src/hooks/useFetchPluginsFromMarketPlace/index.js +0 -49
- package/admin/src/pages/MarketplacePage/MarketplaceBanner/Wrapper.js +0 -28
- package/admin/src/pages/MarketplacePage/MarketplaceBanner/index.js +0 -37
- package/admin/src/pages/MarketplacePage/PluginCard/Wrapper.js +0 -148
- package/admin/src/pages/MarketplacePage/PluginCard/index.js +0 -185
- package/admin/src/pages/MarketplacePage/Wrapper.js +0 -5
- package/admin/src/pages/MarketplacePage/assets/marketplace-coming-soon.png +0 -0
- package/admin/src/themes/colors.js +0 -51
- package/admin/src/themes/fontWeights.js +0 -8
- package/admin/src/themes/index.js +0 -13
- package/admin/src/themes/sizes.js +0 -31
- package/build/01a600d9e6e0dea21e33.png +0 -0
- package/build/4362.dbe98749.chunk.js +0 -1
- package/build/Admin_marketplace.419010d8.chunk.js +0 -1
- package/build/Admin_pluginsPage.7d1bd7ce.chunk.js +0 -1
- package/build/Admin_profilePage.c497b39d.chunk.js +0 -1
- package/build/admin-users.1fda1f27.chunk.js +0 -1
- package/build/content-manager.31be1448.chunk.js +0 -1
- package/build/en-json.bce44d39.chunk.js +0 -1
- package/build/users-email-settings-page.862eb51e.chunk.js +0 -1
|
@@ -9,12 +9,13 @@ import {
|
|
|
9
9
|
useNotification,
|
|
10
10
|
useOverlayBlocker,
|
|
11
11
|
auth,
|
|
12
|
+
useTracking,
|
|
12
13
|
} from '@strapi/helper-plugin';
|
|
13
14
|
import { useIntl } from 'react-intl';
|
|
14
15
|
import { Formik } from 'formik';
|
|
16
|
+
import upperFirst from 'lodash/upperFirst';
|
|
15
17
|
import { useQuery, useMutation, useQueryClient } from 'react-query';
|
|
16
18
|
import pick from 'lodash/pick';
|
|
17
|
-
import omit from 'lodash/omit';
|
|
18
19
|
import { Helmet } from 'react-helmet';
|
|
19
20
|
import { Main } from '@strapi/design-system/Main';
|
|
20
21
|
import { Typography } from '@strapi/design-system/Typography';
|
|
@@ -31,10 +32,15 @@ import Eye from '@strapi/icons/Eye';
|
|
|
31
32
|
import EyeStriked from '@strapi/icons/EyeStriked';
|
|
32
33
|
import Check from '@strapi/icons/Check';
|
|
33
34
|
import useLocalesProvider from '../../components/LocalesProvider/useLocalesProvider';
|
|
35
|
+
import { useThemeToggle } from '../../hooks';
|
|
34
36
|
import { fetchUser, putUser } from './utils/api';
|
|
35
37
|
import schema from './utils/schema';
|
|
36
38
|
import { getFullName } from '../../utils';
|
|
37
39
|
|
|
40
|
+
const DocumentationLink = styled.a`
|
|
41
|
+
color: ${({ theme }) => theme.colors.primary600};
|
|
42
|
+
`;
|
|
43
|
+
|
|
38
44
|
const PasswordInput = styled(TextInput)`
|
|
39
45
|
::-ms-reveal {
|
|
40
46
|
display: none;
|
|
@@ -59,9 +65,11 @@ const ProfilePage = () => {
|
|
|
59
65
|
const { setUserDisplayName } = useAppInfos();
|
|
60
66
|
const queryClient = useQueryClient();
|
|
61
67
|
const { formatMessage } = useIntl();
|
|
68
|
+
const { trackUsage } = useTracking();
|
|
62
69
|
const toggleNotification = useNotification();
|
|
63
70
|
const { lockApp, unlockApp } = useOverlayBlocker();
|
|
64
71
|
const { notifyStatus } = useNotifyAT();
|
|
72
|
+
const { currentTheme, themes: allApplicationThemes, onChangeTheme } = useThemeToggle();
|
|
65
73
|
useFocusWhenNavigate();
|
|
66
74
|
|
|
67
75
|
const { status, data } = useQuery('user', () => fetchUser(), {
|
|
@@ -83,14 +91,18 @@ const ProfilePage = () => {
|
|
|
83
91
|
|
|
84
92
|
const isLoading = status !== 'success';
|
|
85
93
|
|
|
86
|
-
const submitMutation = useMutation(body => putUser(
|
|
94
|
+
const submitMutation = useMutation(body => putUser(body), {
|
|
87
95
|
onSuccess: async data => {
|
|
88
96
|
await queryClient.invalidateQueries('user');
|
|
89
97
|
|
|
90
|
-
auth.setUserInfo(
|
|
98
|
+
auth.setUserInfo(
|
|
99
|
+
pick(data, ['email', 'firstname', 'lastname', 'username', 'preferedLanguage'])
|
|
100
|
+
);
|
|
91
101
|
const userDisplayName = data.username || getFullName(data.firstname, data.lastname);
|
|
92
102
|
setUserDisplayName(userDisplayName);
|
|
93
103
|
changeLocale(data.preferedLanguage);
|
|
104
|
+
onChangeTheme(data.currentTheme);
|
|
105
|
+
trackUsage('didChangeMode', { newMode: data.currentTheme });
|
|
94
106
|
|
|
95
107
|
toggleNotification({
|
|
96
108
|
type: 'success',
|
|
@@ -128,9 +140,16 @@ const ProfilePage = () => {
|
|
|
128
140
|
);
|
|
129
141
|
};
|
|
130
142
|
|
|
131
|
-
const fieldsToPick = [
|
|
143
|
+
const fieldsToPick = [
|
|
144
|
+
'currentTheme',
|
|
145
|
+
'email',
|
|
146
|
+
'firstname',
|
|
147
|
+
'lastname',
|
|
148
|
+
'username',
|
|
149
|
+
'preferedLanguage',
|
|
150
|
+
];
|
|
132
151
|
|
|
133
|
-
const initialData = pick(data, fieldsToPick);
|
|
152
|
+
const initialData = pick({ ...data, currentTheme }, fieldsToPick);
|
|
134
153
|
|
|
135
154
|
if (isLoading) {
|
|
136
155
|
return (
|
|
@@ -154,6 +173,10 @@ const ProfilePage = () => {
|
|
|
154
173
|
);
|
|
155
174
|
}
|
|
156
175
|
|
|
176
|
+
const themesToDisplay = Object.keys(allApplicationThemes).filter(
|
|
177
|
+
themeName => allApplicationThemes[themeName]
|
|
178
|
+
);
|
|
179
|
+
|
|
157
180
|
return (
|
|
158
181
|
<Main aria-busy={isSubmittingForm}>
|
|
159
182
|
<Helmet
|
|
@@ -424,20 +447,20 @@ const ProfilePage = () => {
|
|
|
424
447
|
id:
|
|
425
448
|
'Settings.profile.form.section.experience.interfaceLanguageHelp',
|
|
426
449
|
defaultMessage:
|
|
427
|
-
'
|
|
450
|
+
'Preference changes will apply only to you. More information is available {here}.',
|
|
428
451
|
},
|
|
429
452
|
{
|
|
430
|
-
|
|
431
|
-
<
|
|
453
|
+
here: (
|
|
454
|
+
<DocumentationLink
|
|
432
455
|
target="_blank"
|
|
433
456
|
rel="noopener noreferrer"
|
|
434
457
|
href="https://docs.strapi.io/developer-docs/latest/development/admin-customization.html#locales"
|
|
435
458
|
>
|
|
436
459
|
{formatMessage({
|
|
437
460
|
id: 'Settings.profile.form.section.experience.documentation',
|
|
438
|
-
defaultMessage: '
|
|
461
|
+
defaultMessage: 'here',
|
|
439
462
|
})}
|
|
440
|
-
</
|
|
463
|
+
</DocumentationLink>
|
|
441
464
|
),
|
|
442
465
|
}
|
|
443
466
|
)}
|
|
@@ -487,6 +510,47 @@ const ProfilePage = () => {
|
|
|
487
510
|
})}
|
|
488
511
|
</Select>
|
|
489
512
|
</GridItem>
|
|
513
|
+
<GridItem s={12} col={6}>
|
|
514
|
+
<Select
|
|
515
|
+
label={formatMessage({
|
|
516
|
+
id: 'Settings.profile.form.section.experience.mode.label',
|
|
517
|
+
defaultMessage: 'Interface mode',
|
|
518
|
+
})}
|
|
519
|
+
placeholder={formatMessage({
|
|
520
|
+
id: 'components.Select.placeholder',
|
|
521
|
+
defaultMessage: 'Select',
|
|
522
|
+
})}
|
|
523
|
+
hint={formatMessage({
|
|
524
|
+
id: 'Settings.profile.form.section.experience.mode.hint',
|
|
525
|
+
defaultMessage: 'Displays your interface in the chosen mode.',
|
|
526
|
+
})}
|
|
527
|
+
value={values.currentTheme}
|
|
528
|
+
onChange={e => {
|
|
529
|
+
handleChange({
|
|
530
|
+
target: { name: 'currentTheme', value: e },
|
|
531
|
+
});
|
|
532
|
+
}}
|
|
533
|
+
>
|
|
534
|
+
{themesToDisplay.map(theme => {
|
|
535
|
+
const label = formatMessage(
|
|
536
|
+
{
|
|
537
|
+
id:
|
|
538
|
+
'Settings.profile.form.section.experience.mode.option-label',
|
|
539
|
+
defaultMessage: '{name} mode',
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
name: upperFirst(theme),
|
|
543
|
+
}
|
|
544
|
+
);
|
|
545
|
+
|
|
546
|
+
return (
|
|
547
|
+
<Option value={theme} key={theme}>
|
|
548
|
+
{label}
|
|
549
|
+
</Option>
|
|
550
|
+
);
|
|
551
|
+
})}
|
|
552
|
+
</Select>
|
|
553
|
+
</GridItem>
|
|
490
554
|
</Grid>
|
|
491
555
|
</Stack>
|
|
492
556
|
</Box>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import omit from 'lodash/omit';
|
|
1
2
|
import { axiosInstance } from '../../../core/utils';
|
|
2
3
|
|
|
3
4
|
const fetchUser = async () => {
|
|
@@ -7,9 +8,10 @@ const fetchUser = async () => {
|
|
|
7
8
|
};
|
|
8
9
|
|
|
9
10
|
const putUser = async body => {
|
|
10
|
-
const
|
|
11
|
+
const dataToSend = omit(body, ['confirmPassword', 'currentTheme']);
|
|
12
|
+
const { data } = await axiosInstance.put('/admin/users/me', dataToSend);
|
|
11
13
|
|
|
12
|
-
return data.data;
|
|
14
|
+
return { ...data.data, currentTheme: body.currentTheme };
|
|
13
15
|
};
|
|
14
16
|
|
|
15
17
|
export { fetchUser, putUser };
|
|
@@ -58,6 +58,21 @@
|
|
|
58
58
|
"Auth.privacy-policy-agreement.policy": "privacy policy",
|
|
59
59
|
"Auth.privacy-policy-agreement.terms": "terms",
|
|
60
60
|
"Auth.reset-password.title": "Reset password",
|
|
61
|
+
"admin.pages.MarketPlacePage.helmet": "Marketplace - Plugins",
|
|
62
|
+
"admin.pages.MarketPlacePage.title": "Marketplace",
|
|
63
|
+
"admin.pages.MarketPlacePage.subtitle": "Get more out of Strapi",
|
|
64
|
+
"admin.pages.MarketPlacePage.plugin.info.text": "Learn more",
|
|
65
|
+
"admin.pages.MarketPlacePage.plugin.info.label": "Learn more about {pluginName}",
|
|
66
|
+
"admin.pages.MarketPlacePage.plugin.copy": "Copy install command",
|
|
67
|
+
"admin.pages.MarketPlacePage.plugin.copy.success": "Install command ready to be pasted in your terminal",
|
|
68
|
+
"admin.pages.MarketPlacePage.plugin.installed": "Installed",
|
|
69
|
+
"admin.pages.MarketPlacePage.plugin.info": "Learn more",
|
|
70
|
+
"admin.pages.MarketPlacePage.submit.plugin.link": "Submit your plugin",
|
|
71
|
+
"admin.pages.MarketPlacePage.plugin.tooltip.verified": "Plugin verified by Strapi",
|
|
72
|
+
"admin.pages.MarketPlacePage.search.placeholder": "Search for a plugin",
|
|
73
|
+
"admin.pages.MarketPlacePage.search.clear": "Clear the plugin search",
|
|
74
|
+
"admin.pages.MarketPlacePage.search.empty": "No result for \"{target}\"",
|
|
75
|
+
"admin.pages.MarketPlacePage.plugin.tooltip.madeByStrapi": "Made by Strapi",
|
|
61
76
|
"Content Manager": "Content Manager",
|
|
62
77
|
"Content Type Builder": "Content-Types Builder",
|
|
63
78
|
"Documentation": "Documentation",
|
|
@@ -133,10 +148,13 @@
|
|
|
133
148
|
"Settings.permissions.users.tabs.label": "Tabs Permissions",
|
|
134
149
|
"Settings.profile.form.notify.data.loaded": "Your profile data has been loaded",
|
|
135
150
|
"Settings.profile.form.section.experience.clear.select": "Clear the interface language selected",
|
|
136
|
-
"Settings.profile.form.section.experience.
|
|
151
|
+
"Settings.profile.form.section.experience.here": "here",
|
|
137
152
|
"Settings.profile.form.section.experience.interfaceLanguage": "Interface language",
|
|
138
153
|
"Settings.profile.form.section.experience.interfaceLanguage.hint": "This will only display your own interface in the chosen language.",
|
|
139
|
-
"Settings.profile.form.section.experience.interfaceLanguageHelp": "
|
|
154
|
+
"Settings.profile.form.section.experience.interfaceLanguageHelp": "Preference changes will apply only to you. More information is available {here}.",
|
|
155
|
+
"Settings.profile.form.section.experience.mode.label": "Interface mode",
|
|
156
|
+
"Settings.profile.form.section.experience.mode.hint": "Displays your interface in the chosen mode.",
|
|
157
|
+
"Settings.profile.form.section.experience.mode.option-label": "{name} mode",
|
|
140
158
|
"Settings.profile.form.section.experience.title": "Experience",
|
|
141
159
|
"Settings.profile.form.section.helmet.title": "User profile",
|
|
142
160
|
"Settings.profile.form.section.password.title": "Change password",
|
|
@@ -227,18 +245,6 @@
|
|
|
227
245
|
"Users.components.List.empty": "There is no users...",
|
|
228
246
|
"Users.components.List.empty.withFilters": "There is no users with the applied filters...",
|
|
229
247
|
"Users.components.List.empty.withSearch": "There is no users corresponding to the search ({search})...",
|
|
230
|
-
"admin.pages.MarketPlacePage.blog.link": "Read our blog post",
|
|
231
|
-
"admin.pages.MarketPlacePage.coming-soon.1": "A new way to make Strapi awesome.",
|
|
232
|
-
"admin.pages.MarketPlacePage.coming-soon.2": "Coming soon.",
|
|
233
|
-
"admin.pages.MarketPlacePage.content.subtitle": "The new marketplace will help you get more out of Strapi. We are working hard to offer the best experience to discover and install plugins.",
|
|
234
|
-
"admin.pages.MarketPlacePage.content.subtitle.published": "The web marketplace helps you get the most of Strapi. In addition, we are working hard to offer the best experience to discover and install plugins, directly from the app.",
|
|
235
|
-
"admin.pages.MarketPlacePage.helmet": "Marketplace - Plugins",
|
|
236
|
-
"admin.pages.MarketPlacePage.illustration": "marketplace illustration",
|
|
237
|
-
"admin.pages.MarketPlacePage.market.link": "Visit the web marketplace",
|
|
238
|
-
"admin.pages.MarketPlacePage.published": "Finally here.",
|
|
239
|
-
"admin.pages.MarketPlacePage.submit.plugin.link": "Submit your plugin",
|
|
240
|
-
"admin.pages.MarketPlacePage.subtitle": "Get more out of Strapi",
|
|
241
|
-
"admin.pages.MarketPlacePage.title": "Marketplace",
|
|
242
248
|
"anErrorOccurred": "Woops! Something went wrong. Please, try again.",
|
|
243
249
|
"app.components.GuidedTour.skip": "Skip the tour",
|
|
244
250
|
"app.components.GuidedTour.title": "3 steps to get started",
|
|
@@ -701,4 +707,4 @@
|
|
|
701
707
|
"request.error.model.unknown": "This model doesn't exist",
|
|
702
708
|
"skipToContent": "Skip to content",
|
|
703
709
|
"submit": "Submit"
|
|
704
|
-
}
|
|
710
|
+
}
|