@strapi/admin 4.2.0-alpha.1 → 4.2.0-alpha.7
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/app.js +7 -4
- package/admin/src/components/GuidedTour/Homepage/index.js +13 -3
- package/admin/src/components/GuidedTour/Modal/index.js +4 -1
- package/admin/src/components/GuidedTour/layout.js +9 -0
- package/admin/src/content-manager/components/Inputs/index.js +3 -4
- package/admin/src/pages/AuthPage/index.js +1 -0
- package/admin/src/translations/en.json +2 -2
- package/admin/src/translations/ja.json +2 -2
- package/admin/src/translations/ko.json +2 -2
- package/build/{4362.86a4e939.chunk.js → 4362.ce36d91a.chunk.js} +1 -1
- package/build/9260.d9bb874f.chunk.js +2 -0
- package/build/{9260.fa40c7bd.chunk.js.LICENSE.txt → 9260.d9bb874f.chunk.js.LICENSE.txt} +0 -0
- package/build/Admin-authenticatedApp.0b6b5c7e.chunk.js +1 -0
- package/build/Admin_homePage.fd1fc572.chunk.js +1 -0
- package/build/content-manager.f1c46a88.chunk.js +1 -0
- package/build/en-json.98c7c4be.chunk.js +1 -0
- package/build/index.html +1 -1
- package/build/ja-json.e13f04e8.chunk.js +1 -0
- package/build/ko-json.2200c9c9.chunk.js +1 -0
- package/build/{main.34ee547b.js → main.1f025df1.js} +2 -2
- package/build/{main.34ee547b.js.LICENSE.txt → main.1f025df1.js.LICENSE.txt} +0 -0
- package/build/{runtime~main.3ef9943c.js → runtime~main.53294538.js} +1 -1
- package/index.js +53 -244
- package/package.json +7 -5
- package/server/routes/serve-admin-panel.js +1 -1
- package/utils/create-cache-dir.js +119 -0
- package/utils/get-custom-webpack-config.js +38 -0
- package/utils/index.js +13 -0
- package/utils/should-build-admin.js +51 -0
- package/utils/watch-admin-files.js +56 -0
- package/webpack.config.js +36 -3
- package/build/9260.fa40c7bd.chunk.js +0 -2
- package/build/Admin-authenticatedApp.2d44e117.chunk.js +0 -1
- package/build/Admin_homePage.d6754c66.chunk.js +0 -1
- package/build/content-manager.de808f2c.chunk.js +0 -1
- package/build/en-json.b35c285f.chunk.js +0 -1
- package/build/ja-json.46e29f04.chunk.js +0 -1
- package/build/ko-json.dd36fdc0.chunk.js +0 -1
package/admin/src/app.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { useGuidedTour } from '@strapi/helper-plugin';
|
|
2
|
+
import { useGuidedTour, useTracking } from '@strapi/helper-plugin';
|
|
3
3
|
import { useIntl } from 'react-intl';
|
|
4
4
|
import { Stack } from '@strapi/design-system/Stack';
|
|
5
5
|
import { Flex } from '@strapi/design-system/Flex';
|
|
@@ -14,12 +14,17 @@ import layout from '../layout';
|
|
|
14
14
|
const GuidedTourHomepage = () => {
|
|
15
15
|
const { guidedTourState, setSkipped } = useGuidedTour();
|
|
16
16
|
const { formatMessage } = useIntl();
|
|
17
|
+
const { trackUsage } = useTracking();
|
|
17
18
|
|
|
18
19
|
const sections = Object.entries(layout).map(([key, val]) => ({
|
|
19
20
|
key,
|
|
20
21
|
title: val.home.title,
|
|
21
22
|
content: (
|
|
22
|
-
<LinkButton
|
|
23
|
+
<LinkButton
|
|
24
|
+
onClick={() => trackUsage(val.home.trackingEvent)}
|
|
25
|
+
to={val.home.cta.target}
|
|
26
|
+
endIcon={<ArrowRight />}
|
|
27
|
+
>
|
|
23
28
|
{formatMessage(val.home.cta.title)}
|
|
24
29
|
</LinkButton>
|
|
25
30
|
),
|
|
@@ -32,6 +37,11 @@ const GuidedTourHomepage = () => {
|
|
|
32
37
|
|
|
33
38
|
const activeSection = enrichedSections.find(section => !section.isDone)?.key;
|
|
34
39
|
|
|
40
|
+
const handleSkip = () => {
|
|
41
|
+
setSkipped(true);
|
|
42
|
+
trackUsage('didSkipGuidedtour');
|
|
43
|
+
};
|
|
44
|
+
|
|
35
45
|
return (
|
|
36
46
|
<Box
|
|
37
47
|
hasRadius
|
|
@@ -52,7 +62,7 @@ const GuidedTourHomepage = () => {
|
|
|
52
62
|
<StepperHomepage sections={sections} currentSectionKey={activeSection} />
|
|
53
63
|
</Stack>
|
|
54
64
|
<Flex justifyContent="flex-end">
|
|
55
|
-
<Button variant="tertiary" onClick={
|
|
65
|
+
<Button variant="tertiary" onClick={handleSkip}>
|
|
56
66
|
{formatMessage({ id: 'app.components.GuidedTour.skip', defaultMessage: 'Skip the tour' })}
|
|
57
67
|
</Button>
|
|
58
68
|
</Flex>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState, useReducer } from 'react';
|
|
2
2
|
import at from 'lodash/at';
|
|
3
|
-
import { useGuidedTour } from '@strapi/helper-plugin';
|
|
3
|
+
import { useGuidedTour, useTracking } from '@strapi/helper-plugin';
|
|
4
4
|
import layout from '../layout';
|
|
5
5
|
import Modal from './components/Modal';
|
|
6
6
|
import reducer, { initialState } from './reducer';
|
|
@@ -20,6 +20,7 @@ const GuidedTourModal = () => {
|
|
|
20
20
|
{ stepContent, sectionIndex, stepIndex, hasSectionAfter, hasStepAfter },
|
|
21
21
|
dispatch,
|
|
22
22
|
] = useReducer(reducer, initialState);
|
|
23
|
+
const { trackUsage } = useTracking();
|
|
23
24
|
|
|
24
25
|
useEffect(() => {
|
|
25
26
|
if (!currentStep) {
|
|
@@ -56,6 +57,7 @@ const GuidedTourModal = () => {
|
|
|
56
57
|
|
|
57
58
|
const handleCtaClick = () => {
|
|
58
59
|
setStepState(currentStep, true);
|
|
60
|
+
trackUsage(stepContent.trackingEvent);
|
|
59
61
|
|
|
60
62
|
setCurrentStep(null);
|
|
61
63
|
};
|
|
@@ -63,6 +65,7 @@ const GuidedTourModal = () => {
|
|
|
63
65
|
const handleSkip = () => {
|
|
64
66
|
setSkipped(true);
|
|
65
67
|
setCurrentStep(null);
|
|
68
|
+
trackUsage('didSkipGuidedtour');
|
|
66
69
|
};
|
|
67
70
|
|
|
68
71
|
if (isVisible && stepContent) {
|
|
@@ -13,6 +13,7 @@ const layout = {
|
|
|
13
13
|
type: 'REDIRECT',
|
|
14
14
|
target: '/plugins/content-type-builder',
|
|
15
15
|
},
|
|
16
|
+
trackingEvent: 'didClickGuidedTourHomepageContentTypeBuilder',
|
|
16
17
|
},
|
|
17
18
|
create: {
|
|
18
19
|
title: {
|
|
@@ -31,6 +32,7 @@ const layout = {
|
|
|
31
32
|
},
|
|
32
33
|
type: 'CLOSE',
|
|
33
34
|
},
|
|
35
|
+
trackingEvent: 'didClickGuidedTourStep1CollectionType',
|
|
34
36
|
},
|
|
35
37
|
success: {
|
|
36
38
|
title: {
|
|
@@ -49,6 +51,7 @@ const layout = {
|
|
|
49
51
|
type: 'REDIRECT',
|
|
50
52
|
target: '/content-manager',
|
|
51
53
|
},
|
|
54
|
+
trackingEvent: 'didCreateGuidedTourCollectionType',
|
|
52
55
|
},
|
|
53
56
|
},
|
|
54
57
|
contentManager: {
|
|
@@ -65,6 +68,7 @@ const layout = {
|
|
|
65
68
|
type: 'REDIRECT',
|
|
66
69
|
target: '/content-manager',
|
|
67
70
|
},
|
|
71
|
+
trackingEvent: 'didClickGuidedTourHomepageContentManager',
|
|
68
72
|
},
|
|
69
73
|
create: {
|
|
70
74
|
title: {
|
|
@@ -83,6 +87,7 @@ const layout = {
|
|
|
83
87
|
},
|
|
84
88
|
type: 'CLOSE',
|
|
85
89
|
},
|
|
90
|
+
trackingEvent: 'didClickGuidedTourStep2ContentManager',
|
|
86
91
|
},
|
|
87
92
|
success: {
|
|
88
93
|
title: {
|
|
@@ -101,6 +106,7 @@ const layout = {
|
|
|
101
106
|
type: 'REDIRECT',
|
|
102
107
|
target: '/settings/api-tokens',
|
|
103
108
|
},
|
|
109
|
+
trackingEvent: 'didCreateGuidedTourEntry',
|
|
104
110
|
},
|
|
105
111
|
},
|
|
106
112
|
apiTokens: {
|
|
@@ -117,6 +123,7 @@ const layout = {
|
|
|
117
123
|
type: 'REDIRECT',
|
|
118
124
|
target: '/settings/api-tokens',
|
|
119
125
|
},
|
|
126
|
+
trackingEvent: 'didClickGuidedTourHomepageApiTokens',
|
|
120
127
|
},
|
|
121
128
|
create: {
|
|
122
129
|
title: {
|
|
@@ -135,6 +142,7 @@ const layout = {
|
|
|
135
142
|
},
|
|
136
143
|
type: 'CLOSE',
|
|
137
144
|
},
|
|
145
|
+
trackingEvent: 'didClickGuidedTourStep3ApiTokens',
|
|
138
146
|
},
|
|
139
147
|
success: {
|
|
140
148
|
title: {
|
|
@@ -146,6 +154,7 @@ const layout = {
|
|
|
146
154
|
defaultMessage:
|
|
147
155
|
"<p>See content in action by making an HTTP request:</p><ul><li><p>To this URL: <light>https://'<'YOUR_DOMAIN'>'/api/'<'YOUR_CT'>'</light></p></li><li><p>With the header: <light>Authorization: bearer '<'YOUR_API_TOKEN'>'</light></p></li></ul><p>For more ways to interact with content, see the <documentationLink>documentation</documentationLink>.</p>",
|
|
148
156
|
},
|
|
157
|
+
trackingEvent: 'didGenerateGuidedTourApiTokens',
|
|
149
158
|
},
|
|
150
159
|
},
|
|
151
160
|
};
|
|
@@ -224,6 +224,8 @@ function Inputs({
|
|
|
224
224
|
attribute={fieldSchema}
|
|
225
225
|
autoComplete="new-password"
|
|
226
226
|
intlLabel={{ id: label, defaultMessage: label }}
|
|
227
|
+
// in case the default value of the boolean is null, attribute.default doesn't exist
|
|
228
|
+
isNullable={inputType === 'bool' && [null, undefined].includes(fieldSchema.default)}
|
|
227
229
|
description={description ? { id: description, defaultMessage: description } : null}
|
|
228
230
|
disabled={shouldDisableField}
|
|
229
231
|
error={errorId}
|
|
@@ -279,7 +281,4 @@ Inputs.propTypes = {
|
|
|
279
281
|
|
|
280
282
|
const Memoized = memo(Inputs, isEqual);
|
|
281
283
|
|
|
282
|
-
export default connect(
|
|
283
|
-
Memoized,
|
|
284
|
-
select
|
|
285
|
-
);
|
|
284
|
+
export default connect(Memoized, select);
|
|
@@ -357,8 +357,8 @@
|
|
|
357
357
|
"app.components.PluginCard.compatible": "Compatible with your app",
|
|
358
358
|
"app.components.PluginCard.compatibleCommunity": "Compatible with the community",
|
|
359
359
|
"app.components.PluginCard.more-details": "More details",
|
|
360
|
-
"app.components.ToggleCheckbox.off-label": "
|
|
361
|
-
"app.components.ToggleCheckbox.on-label": "
|
|
360
|
+
"app.components.ToggleCheckbox.off-label": "False",
|
|
361
|
+
"app.components.ToggleCheckbox.on-label": "True",
|
|
362
362
|
"app.components.UpgradePlanModal.button": "Learn more",
|
|
363
363
|
"app.components.UpgradePlanModal.limit-reached": "You have reached the limit",
|
|
364
364
|
"app.components.UpgradePlanModal.text-ce": "Community Edition",
|
|
@@ -315,8 +315,8 @@
|
|
|
315
315
|
"app.components.PluginCard.compatible": "アプリとの互換性",
|
|
316
316
|
"app.components.PluginCard.compatibleCommunity": "コミュニティとの互換性",
|
|
317
317
|
"app.components.PluginCard.more-details": "詳細を見る",
|
|
318
|
-
"app.components.ToggleCheckbox.off-label": "
|
|
319
|
-
"app.components.ToggleCheckbox.on-label": "
|
|
318
|
+
"app.components.ToggleCheckbox.off-label": "False",
|
|
319
|
+
"app.components.ToggleCheckbox.on-label": "True",
|
|
320
320
|
"app.components.UpgradePlanModal.button": "Learn more",
|
|
321
321
|
"app.components.UpgradePlanModal.limit-reached": "You have reached the limit",
|
|
322
322
|
"app.components.UpgradePlanModal.text-ce": "Community Edition",
|
|
@@ -317,8 +317,8 @@
|
|
|
317
317
|
"app.components.PluginCard.compatible": "이 애플리케이션에 호환됩니다.",
|
|
318
318
|
"app.components.PluginCard.compatibleCommunity": "션뮤니티에 호환됩니다.",
|
|
319
319
|
"app.components.PluginCard.more-details": "[더보기]",
|
|
320
|
-
"app.components.ToggleCheckbox.off-label": "
|
|
321
|
-
"app.components.ToggleCheckbox.on-label": "
|
|
320
|
+
"app.components.ToggleCheckbox.off-label": "False",
|
|
321
|
+
"app.components.ToggleCheckbox.on-label": "True",
|
|
322
322
|
"app.components.UpgradePlanModal.button": "Learn more",
|
|
323
323
|
"app.components.UpgradePlanModal.limit-reached": "You have reached the limit",
|
|
324
324
|
"app.components.UpgradePlanModal.text-ce": "Community Edition",
|