Merge branch 'master' of github.com:strapi/strapi into sanitize-filters

This commit is contained in:
Convly 2022-01-12 11:38:04 +01:00
commit 76b5c09444
47 changed files with 4083 additions and 4797 deletions

View File

@ -1,7 +1,7 @@
{
"name": "getstarted",
"private": true,
"version": "4.0.3",
"version": "4.0.4",
"description": "A Strapi application.",
"scripts": {
"develop": "strapi develop",
@ -12,17 +12,17 @@
"strapi": "strapi"
},
"dependencies": {
"@strapi/admin": "4.0.3",
"@strapi/plugin-documentation": "4.0.3",
"@strapi/plugin-graphql": "4.0.3",
"@strapi/plugin-i18n": "4.0.3",
"@strapi/plugin-sentry": "4.0.3",
"@strapi/plugin-users-permissions": "4.0.3",
"@strapi/provider-email-mailgun": "4.0.3",
"@strapi/provider-upload-aws-s3": "4.0.3",
"@strapi/provider-upload-cloudinary": "4.0.3",
"@strapi/strapi": "4.0.3",
"@strapi/utils": "4.0.3",
"@strapi/admin": "4.0.4",
"@strapi/plugin-documentation": "4.0.4",
"@strapi/plugin-graphql": "4.0.4",
"@strapi/plugin-i18n": "4.0.4",
"@strapi/plugin-sentry": "4.0.4",
"@strapi/plugin-users-permissions": "4.0.4",
"@strapi/provider-email-mailgun": "4.0.4",
"@strapi/provider-upload-aws-s3": "4.0.4",
"@strapi/provider-upload-cloudinary": "4.0.4",
"@strapi/strapi": "4.0.4",
"@strapi/utils": "4.0.4",
"lodash": "4.17.21",
"mysql": "2.18.1",
"passport-google-oauth2": "0.2.0",

View File

@ -1,7 +1,7 @@
{
"name": "kitchensink",
"private": true,
"version": "4.0.3",
"version": "4.0.4",
"description": "A Strapi application.",
"scripts": {
"develop": "strapi develop",
@ -12,12 +12,12 @@
"strapi": "strapi"
},
"dependencies": {
"@strapi/admin": "4.0.3",
"@strapi/provider-email-mailgun": "4.0.3",
"@strapi/provider-upload-aws-s3": "4.0.3",
"@strapi/provider-upload-cloudinary": "4.0.3",
"@strapi/strapi": "4.0.3",
"@strapi/utils": "4.0.3",
"@strapi/admin": "4.0.4",
"@strapi/provider-email-mailgun": "4.0.4",
"@strapi/provider-upload-aws-s3": "4.0.4",
"@strapi/provider-upload-cloudinary": "4.0.4",
"@strapi/strapi": "4.0.4",
"@strapi/utils": "4.0.4",
"lodash": "4.17.21",
"mysql": "2.18.1",
"passport-google-oauth2": "0.2.0",

View File

@ -1,5 +1,5 @@
{
"version": "4.0.3",
"version": "4.0.4",
"packages": [
"packages/*",
"examples/*"

View File

@ -1,6 +1,6 @@
{
"name": "@strapi/admin-test-utils",
"version": "4.0.3",
"version": "4.0.4",
"private": true,
"description": "Test utilities for the Strapi administration panel",
"license": "MIT",

View File

@ -1,6 +1,6 @@
{
"name": "create-strapi-app",
"version": "4.0.3",
"version": "4.0.4",
"description": "Generate a new Strapi application.",
"keywords": [
"create-strapi-app",
@ -38,7 +38,7 @@
"test": "echo \"no tests yet\""
},
"dependencies": {
"@strapi/generate-new": "4.0.3",
"@strapi/generate-new": "4.0.4",
"commander": "6.1.0",
"inquirer": "8.2.0"
},

View File

@ -1,6 +1,6 @@
{
"name": "create-strapi-starter",
"version": "4.0.3",
"version": "4.0.4",
"description": "Generate a new Strapi application.",
"keywords": [
"create-strapi-starter",
@ -38,7 +38,7 @@
"test": "echo \"no tests yet\""
},
"dependencies": {
"@strapi/generate-new": "4.0.3",
"@strapi/generate-new": "4.0.4",
"chalk": "4.1.1",
"ci-info": "3.1.1",
"commander": "7.1.0",

View File

@ -70,9 +70,14 @@ const UpgradePlanModal = ({ onClose, isOpen }) => {
return (
<Portal>
<UpgradeWrapper>
<UpgradeWrapper onClick={onClose}>
<FocusTrap onEscape={onClose}>
<UpgradeContainer aria-labelledby="upgrade-plan" background="neutral0" hasRadius>
<UpgradeContainer
onClick={e => e.stopPropagation()}
aria-labelledby="upgrade-plan"
background="neutral0"
hasRadius
>
<img src={AirBalloon} alt="air-balloon" />
<CloseButtonContainer>
<IconButton onClick={onClose} aria-label="Close" icon={<Cross />} />

View File

@ -25,9 +25,8 @@ const Editor = ({
lineWrapping: true,
extraKeys: {
Enter: 'newlineAndIndentContinueMarkdownList',
// Leaving this commented for now
// Tab: false,
// 'Shift-Tab': false,
Tab: false,
'Shift-Tab': false,
},
readOnly: false,
smartIndent: false,

View File

@ -68,6 +68,7 @@ export const EditorLayout = ({ children, isExpandMode, error, previewContent, on
bottom={0}
zIndex={4}
justifyContent="center"
onClick={onCollapse}
>
<Box
id="wysiwyg-expand"
@ -77,6 +78,7 @@ export const EditorLayout = ({ children, isExpandMode, error, previewContent, on
overflow="hidden"
width="70%"
height="70%"
onClick={e => e.stopPropagation()}
>
<Flex height="100%" alignItems="flex-start">
<BoxWithBorder flex="1" height="100%">

View File

@ -7,13 +7,13 @@ import { Typography } from '@strapi/design-system/Typography';
import Expand from '@strapi/icons/Expand';
import { ExpandButton } from './WysiwygStyles';
const WysiwygFooter = ({ isPreviewMode, onToggleExpand }) => {
const WysiwygFooter = ({ onToggleExpand }) => {
const { formatMessage } = useIntl();
return (
<Box padding={2} background="neutral100" hasRadius>
<Flex justifyContent="flex-end" alignItems="flex-end">
<ExpandButton id="expand" disabled={isPreviewMode} onClick={onToggleExpand}>
<ExpandButton id="expand" onClick={onToggleExpand}>
<Typography>
{formatMessage({
id: 'components.WysiwygBottomControls.fullscreen',
@ -29,12 +29,10 @@ const WysiwygFooter = ({ isPreviewMode, onToggleExpand }) => {
WysiwygFooter.defaultProps = {
onToggleExpand: () => {},
isPreviewMode: false,
};
WysiwygFooter.propTypes = {
onToggleExpand: PropTypes.func,
isPreviewMode: PropTypes.bool,
};
export default WysiwygFooter;

View File

@ -1,6 +1,7 @@
import React, { useRef, useState } from 'react';
import PropTypes from 'prop-types';
import { useIntl } from 'react-intl';
import { FocusTrap } from '@strapi/design-system/FocusTrap';
import { Box } from '@strapi/design-system/Box';
import { Button } from '@strapi/design-system/Button';
import { IconButtonGroup } from '@strapi/design-system/IconButton';
@ -41,7 +42,9 @@ const WysiwygNav = ({
});
const buttonMoreRef = useRef();
const handleTogglePopover = () => setVisiblePopover(prev => !prev);
const handleTogglePopover = () => {
setVisiblePopover(prev => !prev);
};
if (isPreviewMode) {
return (
@ -81,10 +84,10 @@ const WysiwygNav = ({
/>
</MainButtons>
<MoreButton disabled ref={buttonMoreRef} id="more" label="More" icon={<More />} />
<MoreButton disabled id="more" label="More" icon={<More />} />
</Flex>
<Button onClick={onTogglePreviewMode} variant="tertiary" size="L" id="preview">
<Button onClick={onTogglePreviewMode} variant="tertiary" id="preview">
{formatMessage({
id: 'components.Wysiwyg.ToggleMode.markdown-mode',
defaultMessage: 'Markdown mode',
@ -146,65 +149,67 @@ const WysiwygNav = ({
/>
{visiblePopover && (
<Popover centered source={buttonMoreRef} spacing={4} id="popover">
<Flex>
<IconButtonGroupMargin>
<CustomIconButton
onClick={() => onActionClick('Strikethrough', editorRef, handleTogglePopover)}
id="Strikethrough"
label="Strikethrough"
name="Strikethrough"
icon={<Strikethrough />}
/>
<CustomIconButton
onClick={() => onActionClick('BulletList', editorRef, handleTogglePopover)}
id="BulletList"
label="BulletList"
name="BulletList"
icon={<BulletList />}
/>
<CustomIconButton
onClick={() => onActionClick('NumberList', editorRef, handleTogglePopover)}
id="NumberList"
label="NumberList"
name="NumberList"
icon={<NumberList />}
/>
</IconButtonGroupMargin>
<IconButtonGroup>
<CustomIconButton
onClick={() => onActionClick('Code', editorRef, handleTogglePopover)}
id="Code"
label="Code"
name="Code"
icon={<Code />}
/>
<CustomIconButton
onClick={() => {
handleTogglePopover();
onToggleMediaLib();
}}
id="Image"
label="Image"
name="Image"
icon={<Image />}
/>
<CustomLinkIconButton
onClick={() => onActionClick('Link', editorRef, handleTogglePopover)}
id="Link"
label="Link"
name="Link"
// eslint-disable-next-line jsx-a11y/anchor-is-valid
icon={<Link />}
/>
<CustomIconButton
onClick={() => onActionClick('Quote', editorRef, handleTogglePopover)}
id="Quote"
label="Quote"
name="Quote"
icon={<Quote />}
/>
</IconButtonGroup>
</Flex>
<FocusTrap onEscape={handleTogglePopover}>
<Flex>
<IconButtonGroupMargin>
<CustomIconButton
onClick={() => onActionClick('Strikethrough', editorRef, handleTogglePopover)}
id="Strikethrough"
label="Strikethrough"
name="Strikethrough"
icon={<Strikethrough />}
/>
<CustomIconButton
onClick={() => onActionClick('BulletList', editorRef, handleTogglePopover)}
id="BulletList"
label="BulletList"
name="BulletList"
icon={<BulletList />}
/>
<CustomIconButton
onClick={() => onActionClick('NumberList', editorRef, handleTogglePopover)}
id="NumberList"
label="NumberList"
name="NumberList"
icon={<NumberList />}
/>
</IconButtonGroupMargin>
<IconButtonGroup>
<CustomIconButton
onClick={() => onActionClick('Code', editorRef, handleTogglePopover)}
id="Code"
label="Code"
name="Code"
icon={<Code />}
/>
<CustomIconButton
onClick={() => {
handleTogglePopover();
onToggleMediaLib();
}}
id="Image"
label="Image"
name="Image"
icon={<Image />}
/>
<CustomLinkIconButton
onClick={() => onActionClick('Link', editorRef, handleTogglePopover)}
id="Link"
label="Link"
name="Link"
// eslint-disable-next-line jsx-a11y/anchor-is-valid
icon={<Link />}
/>
<CustomIconButton
onClick={() => onActionClick('Quote', editorRef, handleTogglePopover)}
id="Quote"
label="Quote"
name="Quote"
icon={<Quote />}
/>
</IconButtonGroup>
</Flex>
</FocusTrap>
</Popover>
)}
</Flex>

View File

@ -54,7 +54,10 @@ const Wysiwyg = ({
const handleToggleMediaLib = () => setMediaLibVisible(prev => !prev);
const handleTogglePreviewMode = () => setIsPreviewMode(prev => !prev);
const handleToggleExpand = () => setIsExpandMode(prev => !prev);
const handleToggleExpand = () => {
setIsPreviewMode(false);
setIsExpandMode(prev => !prev);
};
const handleActionClick = (value, currentEditorRef, togglePopover) => {
switch (value) {
@ -160,9 +163,7 @@ const Wysiwyg = ({
value={value}
/>
{!isExpandMode && (
<WysiwygFooter isPreviewMode={isPreviewMode} onToggleExpand={handleToggleExpand} />
)}
{!isExpandMode && <WysiwygFooter onToggleExpand={handleToggleExpand} />}
</EditorLayout>
<Hint description={description} name={name} error={error} />
</Stack>

View File

@ -1,6 +1,6 @@
{
"name": "@strapi/admin",
"version": "4.0.3",
"version": "4.0.4",
"description": "Strapi Admin",
"repository": {
"type": "git",
@ -52,11 +52,11 @@
"@fortawesome/free-brands-svg-icons": "^5.15.3",
"@fortawesome/free-solid-svg-icons": "^5.15.3",
"@fortawesome/react-fontawesome": "^0.1.14",
"@strapi/babel-plugin-switch-ee-ce": "4.0.3",
"@strapi/babel-plugin-switch-ee-ce": "4.0.4",
"@strapi/design-system": "0.0.1-alpha.71",
"@strapi/helper-plugin": "4.0.3",
"@strapi/helper-plugin": "4.0.4",
"@strapi/icons": "0.0.1-alpha.71",
"@strapi/utils": "4.0.3",
"@strapi/utils": "4.0.4",
"axios": "0.24.0",
"babel-loader": "8.2.3",
"babel-plugin-styled-components": "2.0.2",

View File

@ -1,6 +1,6 @@
{
"name": "@strapi/plugin-content-manager",
"version": "4.0.3",
"version": "4.0.4",
"description": "A powerful UI to easily manage your data.",
"repository": {
"type": "git",
@ -24,7 +24,7 @@
},
"dependencies": {
"@sindresorhus/slugify": "1.1.0",
"@strapi/utils": "4.0.3",
"@strapi/utils": "4.0.4",
"lodash": "4.17.21"
},
"engines": {

View File

@ -28,6 +28,7 @@ import retrieveComponentsFromSchema from './utils/retrieveComponentsFromSchema';
import retrieveNestedComponents from './utils/retrieveNestedComponents';
import { retrieveComponentsThatHaveComponents } from './utils/retrieveComponentsThatHaveComponents';
import { getComponentsToPost, formatMainDataType, sortContentType } from './utils/cleanData';
import validateSchema from './utils/validateSchema';
import {
ADD_ATTRIBUTE,
@ -440,6 +441,21 @@ const DataManagerProvider = ({
initialData.contentType
);
const isValidSchema = validateSchema(contentType);
if (!isValidSchema) {
toggleNotification({
type: 'warning',
message: {
id: getTrad('notification.error.dynamiczone-min.validation'),
defaultMessage:
'At least one component is required in a dynamic zone to be able to save a content type',
},
});
return;
}
body.contentType = contentType;
trackUsage('willSaveContentType');

View File

@ -0,0 +1,11 @@
const validateSchema = schema => {
const dynamicZoneAttributes = Object.values(schema.attributes).filter(
({ type }) => type === 'dynamiczone'
);
return dynamicZoneAttributes.every(
({ components }) => Array.isArray(components) && components.length > 0
);
};
export default validateSchema;

View File

@ -166,6 +166,7 @@
"modelPage.attribute.relation-polymorphic": "Relation (polymorphic)",
"modelPage.attribute.relationWith": "Relation with",
"none": "None",
"notification.error.dynamiczone-min.validation": "At least one component is required in a dynamic zone to be able to save a content type",
"notification.info.autoreaload-disable": "The autoReload feature is required to use this plugin. Start your server with `strapi develop`",
"notification.info.creating.notSaved": "Please save your work before creating a new collection type or component",
"plugin.description.long": "Modelize the data structure of your API. Create new fields and relations in just a minute. The files are automatically created and updated in your project.",

View File

@ -1,6 +1,6 @@
{
"name": "@strapi/plugin-content-type-builder",
"version": "4.0.3",
"version": "4.0.4",
"description": "Strapi plugin to create content type",
"repository": {
"type": "git",
@ -28,9 +28,9 @@
},
"dependencies": {
"@sindresorhus/slugify": "1.1.0",
"@strapi/generators": "4.0.3",
"@strapi/helper-plugin": "4.0.3",
"@strapi/utils": "4.0.3",
"@strapi/generators": "4.0.4",
"@strapi/helper-plugin": "4.0.4",
"@strapi/utils": "4.0.4",
"fs-extra": "^9.1.0",
"lodash": "4.17.21",
"pluralize": "^8.0.0",

View File

@ -43,6 +43,42 @@ describe('Type validators', () => {
});
});
describe('Dynamiczone type validator', () => {
test('Components cannot be empty', () => {
const attributes = {
dz: {
type: 'dynamiczone',
components: [],
},
};
const validator = getTypeValidator(attributes.dz, {
types: ['dynamiczone'],
modelType: 'collectionType',
attributes,
});
expect(validator.isValidSync(attributes.dz)).toBeFalsy();
});
test('Components must have at least one item', () => {
const attributes = {
dz: {
type: 'dynamiczone',
components: ['compoA', 'compoB'],
},
};
const validator = getTypeValidator(attributes.dz, {
types: ['dynamiczone'],
modelType: 'collectionType',
attributes,
});
expect(validator.isValidSync(attributes.dz)).toBeTruthy();
});
});
describe('UID type validator', () => {
test('Target field can be null', () => {
const attributes = {

View File

@ -258,7 +258,8 @@ const getTypeShape = (attribute, { modelType, attributes } = {}) => {
components: yup
.array()
.of(yup.string().required())
.test('isArray', '${path} must be an array', value => Array.isArray(value)),
.test('isArray', '${path} must be an array', value => Array.isArray(value))
.min(1),
min: yup.number(),
max: yup.number(),
};

View File

@ -1,6 +1,6 @@
{
"name": "@strapi/database",
"version": "4.0.3",
"version": "4.0.4",
"description": "Strapi's database layer",
"homepage": "https://strapi.io",
"bugs": {

View File

@ -1,6 +1,6 @@
{
"name": "@strapi/plugin-email",
"version": "4.0.3",
"version": "4.0.4",
"description": "Easily configure your Strapi application to send emails.",
"repository": {
"type": "git",
@ -26,12 +26,12 @@
"test:front:watch:ce": "cross-env IS_EE=false jest --config ./jest.config.front.js --watchAll"
},
"dependencies": {
"@strapi/provider-email-sendmail": "4.0.3",
"@strapi/utils": "4.0.3",
"@strapi/provider-email-sendmail": "4.0.4",
"@strapi/utils": "4.0.4",
"lodash": "4.17.21"
},
"devDependencies": {
"@strapi/helper-plugin": "4.0.3"
"@strapi/helper-plugin": "4.0.4"
},
"engines": {
"node": ">=12.22.0 <=16.x.x",

View File

@ -1,6 +1,6 @@
{
"name": "@strapi/helper-plugin",
"version": "4.0.3",
"version": "4.0.4",
"description": "Helper for Strapi plugins development",
"repository": {
"type": "git",
@ -70,11 +70,11 @@
"@babel/preset-env": "7.16.7",
"@babel/preset-react": "7.16.7",
"@babel/runtime": "7.16.7",
"@storybook/addon-actions": "^6.3.7",
"@storybook/addon-essentials": "^6.3.7",
"@storybook/addon-links": "^6.3.7",
"@storybook/builder-webpack5": "^6.3.7",
"@storybook/manager-webpack5": "^6.3.7",
"@storybook/addon-actions": "6.4.10",
"@storybook/addon-essentials": "6.4.10",
"@storybook/addon-links": "6.4.10",
"@storybook/builder-webpack5": "6.4.10",
"@storybook/manager-webpack5": "6.4.10",
"@storybook/react": "^6.3.7",
"@strapi/design-system": "0.0.1-alpha.71",
"@strapi/icons": "0.0.1-alpha.71",

View File

@ -1,6 +1,6 @@
{
"name": "@strapi/strapi",
"version": "4.0.3",
"version": "4.0.4",
"description": "An open source headless CMS solution to create and manage your own API. It provides a powerful dashboard and features to make your life easier. Databases supported: MySQL, MariaDB, PostgreSQL, SQLite",
"keywords": [
"strapi",
@ -80,22 +80,22 @@
"dependencies": {
"@koa/cors": "3.1.0",
"@koa/router": "10.1.1",
"@strapi/admin": "4.0.3",
"@strapi/database": "4.0.3",
"@strapi/generate-new": "4.0.3",
"@strapi/generators": "4.0.3",
"@strapi/logger": "4.0.3",
"@strapi/plugin-content-manager": "4.0.3",
"@strapi/plugin-content-type-builder": "4.0.3",
"@strapi/plugin-email": "4.0.3",
"@strapi/plugin-upload": "4.0.3",
"@strapi/utils": "4.0.3",
"@strapi/admin": "4.0.4",
"@strapi/database": "4.0.4",
"@strapi/generate-new": "4.0.4",
"@strapi/generators": "4.0.4",
"@strapi/logger": "4.0.4",
"@strapi/plugin-content-manager": "4.0.4",
"@strapi/plugin-content-type-builder": "4.0.4",
"@strapi/plugin-email": "4.0.4",
"@strapi/plugin-upload": "4.0.4",
"@strapi/utils": "4.0.4",
"bcryptjs": "2.4.3",
"boxen": "5.1.2",
"chalk": "4.1.2",
"chokidar": "3.5.2",
"ci-info": "3.2.0",
"cli-table3": "0.6.0",
"cli-table3": "0.6.1",
"commander": "8.2.0",
"configstore": "5.0.1",
"debug": "4.3.2",

View File

@ -1,6 +1,6 @@
{
"name": "@strapi/plugin-upload",
"version": "4.0.3",
"version": "4.0.4",
"description": "Makes it easy to upload images and files to your Strapi Application.",
"license": "SEE LICENSE IN LICENSE",
"author": {
@ -23,9 +23,9 @@
"test:front:watch:ce": "cross-env IS_EE=false jest --config ./jest.config.front.js --watchAll"
},
"dependencies": {
"@strapi/helper-plugin": "4.0.3",
"@strapi/provider-upload-local": "4.0.3",
"@strapi/utils": "4.0.3",
"@strapi/helper-plugin": "4.0.4",
"@strapi/provider-upload-local": "4.0.4",
"@strapi/utils": "4.0.4",
"byte-size": "7.0.1",
"cropperjs": "1.5.11",
"immer": "9.0.6",

View File

@ -1,6 +1,6 @@
{
"name": "@strapi/utils",
"version": "4.0.3",
"version": "4.0.4",
"description": "Shared utilities for the Strapi packages",
"keywords": [
"strapi",

View File

@ -1,6 +1,6 @@
{
"name": "@strapi/generate-new",
"version": "4.0.3",
"version": "4.0.4",
"description": "Generate a new Strapi application.",
"keywords": [
"generate",

View File

@ -1,6 +1,6 @@
{
"name": "@strapi/generators",
"version": "4.0.3",
"version": "4.0.4",
"description": "Interactive API generator.",
"keywords": [
"strapi",
@ -30,7 +30,7 @@
"main": "lib/index.js",
"dependencies": {
"@sindresorhus/slugify": "1.1.0",
"@strapi/utils": "4.0.3",
"@strapi/utils": "4.0.4",
"chalk": "4.1.2",
"fs-extra": "10.0.0",
"node-plop": "0.26.3",

View File

@ -1,6 +1,6 @@
{
"name": "@strapi/plugin-documentation",
"version": "4.0.3",
"version": "4.0.4",
"description": "Create an OpenAPI Document and visualize your API with SWAGGER UI.",
"repository": {
"type": "git",
@ -24,8 +24,8 @@
"test": "echo \"no tests yet\""
},
"dependencies": {
"@strapi/helper-plugin": "4.0.3",
"@strapi/utils": "4.0.3",
"@strapi/helper-plugin": "4.0.4",
"@strapi/utils": "4.0.4",
"bcryptjs": "2.4.3",
"cheerio": "^1.0.0-rc.5",
"fs-extra": "^9.1.0",

View File

@ -1,6 +1,6 @@
{
"name": "@strapi/plugin-graphql",
"version": "4.0.3",
"version": "4.0.4",
"description": "Adds GraphQL endpoint with default API methods.",
"repository": {
"type": "git",
@ -30,7 +30,7 @@
"@apollo/federation": "^0.28.0",
"@graphql-tools/schema": "8.1.2",
"@graphql-tools/utils": "^8.0.2",
"@strapi/utils": "4.0.3",
"@strapi/utils": "4.0.4",
"apollo-server-core": "3.1.2",
"apollo-server-koa": "3.1.2",
"glob": "^7.1.7",

View File

@ -1,6 +1,6 @@
{
"name": "@strapi/plugin-i18n",
"version": "4.0.3",
"version": "4.0.4",
"description": "This plugin enables to create, to read and to update content in different languages, both from the Admin Panel and from the API",
"repository": {
"type": "git",
@ -24,7 +24,7 @@
"test:unit": "jest --verbose"
},
"dependencies": {
"@strapi/utils": "4.0.3",
"@strapi/utils": "4.0.4",
"lodash": "4.17.21"
},
"engines": {

View File

@ -1,6 +1,6 @@
{
"name": "@strapi/plugin-sentry",
"version": "4.0.3",
"version": "4.0.4",
"description": "Send Strapi error events to Sentry",
"repository": {
"type": "git",

View File

@ -1,6 +1,6 @@
{
"name": "@strapi/plugin-users-permissions",
"version": "4.0.3",
"version": "4.0.4",
"description": "Protect your API with a full-authentication process based on JWT",
"repository": {
"type": "git",
@ -28,8 +28,8 @@
},
"dependencies": {
"@purest/providers": "^1.0.2",
"@strapi/helper-plugin": "4.0.3",
"@strapi/utils": "4.0.3",
"@strapi/helper-plugin": "4.0.4",
"@strapi/utils": "4.0.4",
"bcryptjs": "2.4.3",
"grant-koa": "5.4.8",
"jsonwebtoken": "^8.1.0",

View File

@ -8,6 +8,7 @@
const crypto = require('crypto');
const bcrypt = require('bcryptjs');
const urlJoin = require('url-join');
const { getAbsoluteServerUrl, sanitize } = require('@strapi/utils');
const { getService } = require('../utils');
@ -54,14 +55,10 @@ module.exports = ({ strapi }) => ({
params.password = await getService('user').hashPassword(params);
}
return strapi.entityService.update(
'plugin::users-permissions.user',
userId,
{
data: params,
populate: ['role']
}
);
return strapi.entityService.update('plugin::users-permissions.user', userId, {
data: params,
populate: ['role'],
});
},
/**
@ -141,8 +138,9 @@ module.exports = ({ strapi }) => ({
await this.edit(user.id, { confirmationToken });
const apiPrefix = strapi.config.get('api.rest.prefix');
settings.message = await userPermissionService.template(settings.message, {
URL: `${getAbsoluteServerUrl(strapi.config)}/auth/email-confirmation`,
URL: urlJoin(getAbsoluteServerUrl(strapi.config), apiPrefix, '/auth/email-confirmation'),
USER: sanitizedUserInfo,
CODE: confirmationToken,
});

View File

@ -2,6 +2,7 @@
const _ = require('lodash');
const { filter, map, pipe, prop } = require('lodash/fp');
const urlJoin = require('url-join');
const { getService } = require('../utils');
@ -112,9 +113,10 @@ module.exports = ({ strapi }) => ({
return;
}
const apiPrefix = strapi.config.get('api.rest.prefix');
routesMap[`api::${apiName}`] = routes.map(route => ({
...route,
path: `/api${route.path}`,
path: urlJoin(apiPrefix, route.path),
}));
});
@ -133,9 +135,10 @@ module.exports = ({ strapi }) => ({
return;
}
const apiPrefix = strapi.config.get('api.rest.prefix');
routesMap[`plugin::${pluginName}`] = routes.map(route => ({
...route,
path: `/api${route.path}`,
path: urlJoin(apiPrefix, route.path),
}));
});

View File

@ -1,6 +1,6 @@
{
"name": "@strapi/provider-email-amazon-ses",
"version": "4.0.3",
"version": "4.0.4",
"description": "Amazon SES provider for strapi email",
"keywords": [
"email",
@ -36,7 +36,7 @@
"test": "echo \"no tests yet\""
},
"dependencies": {
"@strapi/utils": "4.0.3",
"@strapi/utils": "4.0.4",
"node-ses": "^3.0.3"
},
"engines": {

View File

@ -1,6 +1,6 @@
{
"name": "@strapi/provider-email-mailgun",
"version": "4.0.3",
"version": "4.0.4",
"description": "Mailgun provider for strapi email plugin",
"keywords": [
"email",
@ -36,7 +36,7 @@
"test": "echo \"no tests yet\""
},
"dependencies": {
"@strapi/utils": "4.0.3",
"@strapi/utils": "4.0.4",
"mailgun-js": "0.22.0"
},
"engines": {

View File

@ -1,6 +1,6 @@
{
"name": "@strapi/provider-email-nodemailer",
"version": "4.0.3",
"version": "4.0.4",
"description": "Nodemailer provider for Strapi 3",
"keywords": [
"strapi",

View File

@ -1,6 +1,6 @@
{
"name": "@strapi/provider-email-sendgrid",
"version": "4.0.3",
"version": "4.0.4",
"description": "Sendgrid provider for strapi email",
"keywords": [
"email",
@ -37,7 +37,7 @@
},
"dependencies": {
"@sendgrid/mail": "7.4.7",
"@strapi/utils": "4.0.3"
"@strapi/utils": "4.0.4"
},
"engines": {
"node": ">=12.22.0 <=16.x.x",

View File

@ -1,6 +1,6 @@
{
"name": "@strapi/provider-email-sendmail",
"version": "4.0.3",
"version": "4.0.4",
"description": "Sendmail provider for strapi email",
"keywords": [
"email",
@ -35,7 +35,7 @@
"test": "echo \"no tests yet\""
},
"dependencies": {
"@strapi/utils": "4.0.3",
"@strapi/utils": "4.0.4",
"sendmail": "^1.6.1"
},
"engines": {

View File

@ -1,6 +1,6 @@
{
"name": "@strapi/provider-upload-aws-s3",
"version": "4.0.3",
"version": "4.0.4",
"description": "AWS S3 provider for strapi upload",
"keywords": [
"upload",

View File

@ -1,6 +1,6 @@
{
"name": "@strapi/provider-upload-cloudinary",
"version": "4.0.3",
"version": "4.0.4",
"description": "Cloudinary provider for strapi upload",
"keywords": [
"upload",
@ -36,7 +36,7 @@
"test": "echo \"no tests yet\""
},
"dependencies": {
"@strapi/utils": "4.0.3",
"@strapi/utils": "4.0.4",
"cloudinary": "^1.25.1",
"into-stream": "^5.1.0"
},

View File

@ -1,6 +1,6 @@
{
"name": "@strapi/provider-upload-local",
"version": "4.0.3",
"version": "4.0.4",
"description": "Local provider for strapi upload",
"keywords": [
"upload",
@ -35,7 +35,7 @@
"test": "echo \"no tests yet\""
},
"dependencies": {
"@strapi/utils": "4.0.3"
"@strapi/utils": "4.0.4"
},
"engines": {
"node": ">=12.22.0 <=16.x.x",

View File

@ -1,6 +1,6 @@
{
"name": "@strapi/provider-upload-rackspace",
"version": "4.0.3",
"version": "4.0.4",
"description": "Rackspace provider for strapi upload",
"repository": {
"type": "git",

View File

@ -1,6 +1,6 @@
{
"name": "@strapi/babel-plugin-switch-ee-ce",
"version": "4.0.3",
"version": "4.0.4",
"private": false,
"description": "Babel plugin to switch from CE to EE at runtime",
"repository": "git://github.com/strapi/strapi.git",

View File

@ -1,6 +1,6 @@
{
"name": "@strapi/logger",
"version": "4.0.3",
"version": "4.0.4",
"description": "Strapi's logger",
"homepage": "https://strapi.io",
"bugs": {

8442
yarn.lock

File diff suppressed because it is too large Load Diff