@strapi/admin 4.5.2 → 4.6.0-alpha.0
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/core/apis/CustomFields.js +46 -1
- package/admin/src/pages/MarketplacePage/components/SortSelect/index.js +20 -0
- package/admin/src/translations/en.json +4 -0
- package/build/{1233.bddaaa76.chunk.js → 1233.32d6888d.chunk.js} +6 -6
- package/build/{4306.e62b841c.chunk.js → 4306.53359960.chunk.js} +7 -7
- package/build/{4318.7931eee7.chunk.js → 4318.daf31770.chunk.js} +2 -2
- package/build/8881.bfdb6877.chunk.js +245 -0
- package/build/{Admin-authenticatedApp.7484bdf1.chunk.js → Admin-authenticatedApp.cfc3b4c9.chunk.js} +5 -5
- package/build/{Admin_homePage.54e33c2d.chunk.js → Admin_homePage.b4db4df8.chunk.js} +1 -1
- package/build/{Admin_marketplace.ff012eb2.chunk.js → Admin_marketplace.fa51405b.chunk.js} +5 -5
- package/build/{Admin_pluginsPage.3c872de7.chunk.js → Admin_pluginsPage.14d2840f.chunk.js} +1 -1
- package/build/{Admin_profilePage.e9fcce92.chunk.js → Admin_profilePage.6c2c8398.chunk.js} +1 -1
- package/build/{Admin_settingsPage.a1a5218b.chunk.js → Admin_settingsPage.5e740514.chunk.js} +7 -7
- package/build/{admin-app.9cb0abc7.chunk.js → admin-app.ee1211cb.chunk.js} +18 -18
- package/build/admin-edit-roles-page.c7c338b3.chunk.js +1 -0
- package/build/{admin-edit-users.283b49ed.chunk.js → admin-edit-users.d254c128.chunk.js} +1 -1
- package/build/{admin-users.a0748674.chunk.js → admin-users.7c423e41.chunk.js} +1 -1
- package/build/{api-tokens-create-page.93dd0689.chunk.js → api-tokens-create-page.4ca2778d.chunk.js} +1 -1
- package/build/{api-tokens-edit-page.b0adac81.chunk.js → api-tokens-edit-page.70a791c2.chunk.js} +1 -1
- package/build/{api-tokens-list-page.700e575f.chunk.js → api-tokens-list-page.fe994b6b.chunk.js} +1 -1
- package/build/{content-manager.577fddcb.chunk.js → content-manager.794d3373.chunk.js} +1 -1
- package/build/en-json.7dd57947.chunk.js +1 -0
- package/build/index.html +1 -1
- package/build/main.a6470578.js +2031 -0
- package/build/{runtime~main.4dc8c7c6.js → runtime~main.6e7d95b9.js} +1 -1
- package/build/sso-settings-page.eb30a02e.chunk.js +1 -0
- package/build/{webhook-edit-page.3285abc4.chunk.js → webhook-edit-page.c5efc08b.chunk.js} +2 -2
- package/build/{webhook-list-page.b87821f2.chunk.js → webhook-list-page.42533b59.chunk.js} +1 -1
- package/ee/server/services/passport/provider-registry.js +1 -1
- package/package.json +7 -7
- package/build/1920.208c77f8.chunk.js +0 -245
- package/build/admin-edit-roles-page.23f15909.chunk.js +0 -1
- package/build/en-json.4a269f6b.chunk.js +0 -1
- package/build/main.23670c4c.js +0 -2026
- package/build/sso-settings-page.9f091262.chunk.js +0 -1
|
@@ -19,6 +19,40 @@ const ALLOWED_TYPES = [
|
|
|
19
19
|
'uid',
|
|
20
20
|
];
|
|
21
21
|
|
|
22
|
+
const ALLOWED_ROOT_LEVEL_OPTIONS = [
|
|
23
|
+
'min',
|
|
24
|
+
'minLength',
|
|
25
|
+
'max',
|
|
26
|
+
'maxLength',
|
|
27
|
+
'required',
|
|
28
|
+
'regex',
|
|
29
|
+
'enum',
|
|
30
|
+
'unique',
|
|
31
|
+
'private',
|
|
32
|
+
'default',
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
const optionValidationsReducer = (acc, option) => {
|
|
36
|
+
if (option.items) {
|
|
37
|
+
return option.items.reduce(optionValidationsReducer, acc);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (!option.name) {
|
|
41
|
+
acc.push({
|
|
42
|
+
isValidOptionPath: false,
|
|
43
|
+
errorMessage: "The 'name' property is required on an options object",
|
|
44
|
+
});
|
|
45
|
+
} else {
|
|
46
|
+
acc.push({
|
|
47
|
+
isValidOptionPath:
|
|
48
|
+
ALLOWED_ROOT_LEVEL_OPTIONS.includes(option.name) || option.name.startsWith('options'),
|
|
49
|
+
errorMessage: `'${option.name}' must be prefixed with 'options.'`,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return acc;
|
|
54
|
+
};
|
|
55
|
+
|
|
22
56
|
class CustomFields {
|
|
23
57
|
constructor() {
|
|
24
58
|
this.customFields = {};
|
|
@@ -32,7 +66,8 @@ class CustomFields {
|
|
|
32
66
|
});
|
|
33
67
|
} else {
|
|
34
68
|
// Handle individual custom field
|
|
35
|
-
const { name, pluginId, type, intlLabel, intlDescription, components } =
|
|
69
|
+
const { name, pluginId, type, intlLabel, intlDescription, components, options } =
|
|
70
|
+
customFields;
|
|
36
71
|
|
|
37
72
|
// Ensure required attributes are provided
|
|
38
73
|
invariant(name, 'A name must be provided');
|
|
@@ -55,6 +90,16 @@ class CustomFields {
|
|
|
55
90
|
`Custom field name: '${name}' is not a valid object key`
|
|
56
91
|
);
|
|
57
92
|
|
|
93
|
+
// Ensure options have valid name paths
|
|
94
|
+
const allFormOptions = [...(options?.base || []), ...(options?.advanced || [])];
|
|
95
|
+
|
|
96
|
+
if (allFormOptions.length) {
|
|
97
|
+
const optionPathValidations = allFormOptions.reduce(optionValidationsReducer, []);
|
|
98
|
+
optionPathValidations.forEach(({ isValidOptionPath, errorMessage }) => {
|
|
99
|
+
invariant(isValidOptionPath, errorMessage);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
|
|
58
103
|
// When no plugin is specified, default to the global namespace
|
|
59
104
|
const uid = pluginId ? `plugin::${pluginId}.${name}` : `global::${name}`;
|
|
60
105
|
|
|
@@ -37,6 +37,26 @@ const SortSelect = ({ sortQuery, handleSelectChange }) => {
|
|
|
37
37
|
defaultMessage: 'Newest',
|
|
38
38
|
},
|
|
39
39
|
},
|
|
40
|
+
'githubStars:desc': {
|
|
41
|
+
selected: {
|
|
42
|
+
id: 'admin.pages.MarketPlacePage.sort.githubStars.selected',
|
|
43
|
+
defaultMessage: 'Sort by GitHub stars',
|
|
44
|
+
},
|
|
45
|
+
option: {
|
|
46
|
+
id: 'admin.pages.MarketPlacePage.sort.githubStars',
|
|
47
|
+
defaultMessage: 'Number of GitHub stars',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
'npmDownloads:desc': {
|
|
51
|
+
selected: {
|
|
52
|
+
id: 'admin.pages.MarketPlacePage.sort.npmDownloads.selected',
|
|
53
|
+
defaultMessage: 'Sort by npm downloads',
|
|
54
|
+
},
|
|
55
|
+
option: {
|
|
56
|
+
id: 'admin.pages.MarketPlacePage.sort.npmDownloads',
|
|
57
|
+
defaultMessage: 'Number of downloads',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
40
60
|
};
|
|
41
61
|
|
|
42
62
|
return (
|
|
@@ -290,6 +290,10 @@
|
|
|
290
290
|
"admin.pages.MarketPlacePage.sort.newest": "Newest",
|
|
291
291
|
"admin.pages.MarketPlacePage.sort.alphabetical.selected": "Sort by alphabetical order",
|
|
292
292
|
"admin.pages.MarketPlacePage.sort.newest.selected": "Sort by newest",
|
|
293
|
+
"admin.pages.MarketPlacePage.sort.githubStars": "Number of GitHub stars",
|
|
294
|
+
"admin.pages.MarketPlacePage.sort.githubStars.selected": "Sort by GitHub stars",
|
|
295
|
+
"admin.pages.MarketPlacePage.sort.npmDownloads": "Number of downloads",
|
|
296
|
+
"admin.pages.MarketPlacePage.sort.npmDownloads.selected": "Sort by npm downloads",
|
|
293
297
|
"admin.pages.MarketPlacePage.filters.collections": "Collections",
|
|
294
298
|
"admin.pages.MarketPlacePage.filters.collectionsSelected": "{count, plural, =0 {No collections} one {# collection} other {# collections}} selected",
|
|
295
299
|
"admin.pages.MarketPlacePage.filters.categories": "Categories",
|