mirror of
https://github.com/strapi/strapi.git
synced 2025-11-01 10:23:34 +00:00
fortawesome dep
This commit is contained in:
parent
27bbef0ea2
commit
0d8eda80bd
@ -27,6 +27,7 @@
|
||||
"@buffetjs/icons": "^1.1.0",
|
||||
"@buffetjs/styles": "^1.1.0",
|
||||
"@buffetjs/utils": "^1.1.0",
|
||||
"@fortawesome/fontawesome-free": "^5.11.2",
|
||||
"@fortawesome/fontawesome-svg-core": "^1.2.25",
|
||||
"@fortawesome/free-brands-svg-icons": "^5.11.2",
|
||||
"@fortawesome/free-solid-svg-icons": "^5.11.2",
|
||||
|
||||
@ -1,16 +1,14 @@
|
||||
import styled from 'styled-components';
|
||||
import styled, { css } from 'styled-components';
|
||||
import PropTypes from 'prop-types';
|
||||
import getColor from './utils/getColor';
|
||||
import getHeight from './utils/getHeight';
|
||||
|
||||
const Wrapper = styled.div`
|
||||
${({ withLongerHeight }) => {
|
||||
if (!withLongerHeight) {
|
||||
return `
|
||||
height: 30px;
|
||||
`;
|
||||
}
|
||||
}};
|
||||
${({ withLongerHeight }) =>
|
||||
!withLongerHeight &&
|
||||
css`
|
||||
height: 30px;
|
||||
`};
|
||||
min-height: ${({ withLongerHeight }) => getHeight(withLongerHeight)};
|
||||
padding: 0 10px 0 0;
|
||||
flex-basis: calc(100% / ${props => props.count});
|
||||
@ -21,7 +19,6 @@ const Wrapper = styled.div`
|
||||
.sub_wrapper {
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
|
||||
background: ${({ isOverEditBlock, isOverRemove, isSelected, isSub }) => {
|
||||
if (isOverRemove) {
|
||||
return '#ffe9e0';
|
||||
@ -38,70 +35,63 @@ const Wrapper = styled.div`
|
||||
getColor(isOverRemove, isSelected, isOverEditBlock)};
|
||||
border-radius: 2px;
|
||||
.name {
|
||||
${({ isOverEditBlock, isOverRemove, isSelected }) => {
|
||||
if (isOverRemove) {
|
||||
return `
|
||||
color: #f64d0a
|
||||
`;
|
||||
}
|
||||
${({ isOverRemove }) =>
|
||||
isOverRemove &&
|
||||
css`
|
||||
color: #f64d0a;
|
||||
`}
|
||||
|
||||
if (isSelected || isOverEditBlock) {
|
||||
return `
|
||||
color: #007eff
|
||||
`;
|
||||
}
|
||||
}}
|
||||
${({ isOverEditBlock, isSelected }) =>
|
||||
(isSelected || isOverEditBlock) &&
|
||||
css`
|
||||
color: #007eff;
|
||||
`}
|
||||
}
|
||||
.grab {
|
||||
border-right: 1px solid
|
||||
${({ isOverEditBlock, isOverRemove, isSelected }) =>
|
||||
getColor(isOverRemove, isSelected, isOverEditBlock)};
|
||||
|
||||
${({ isOverEditBlock, isOverRemove, isSelected }) => {
|
||||
if (isOverRemove) {
|
||||
return `
|
||||
${({ isOverRemove }) =>
|
||||
isOverRemove &&
|
||||
css`
|
||||
g {
|
||||
fill: #ffa784;
|
||||
}
|
||||
`;
|
||||
}
|
||||
`}
|
||||
|
||||
if (isSelected || isOverEditBlock) {
|
||||
return `
|
||||
${({ isOverEditBlock, isSelected }) =>
|
||||
(isSelected || isOverEditBlock) &&
|
||||
css`
|
||||
g {
|
||||
fill: #007eff;
|
||||
}
|
||||
`;
|
||||
}
|
||||
}}
|
||||
`}
|
||||
}
|
||||
|
||||
.remove {
|
||||
background-color: ${({ isOverEditBlock, isOverRemove, isSelected }) =>
|
||||
getColor(isOverRemove, isSelected, isOverEditBlock)};
|
||||
cursor: pointer;
|
||||
|
||||
svg {
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
${({ isOverEditBlock, isOverRemove, isSelected }) => {
|
||||
if (isOverRemove) {
|
||||
return `
|
||||
${({ isOverRemove }) =>
|
||||
isOverRemove &&
|
||||
css`
|
||||
path {
|
||||
fill: #f64d0a;
|
||||
}
|
||||
`;
|
||||
}
|
||||
`}
|
||||
|
||||
if (isSelected || isOverEditBlock) {
|
||||
return `
|
||||
${({ isOverEditBlock, isSelected }) =>
|
||||
(isSelected || isOverEditBlock) &&
|
||||
css`
|
||||
path {
|
||||
fill: #007eff;
|
||||
}
|
||||
`;
|
||||
}
|
||||
}}
|
||||
`}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@ -10,7 +10,6 @@ import { useParams } from 'react-router-dom';
|
||||
import { cloneDeep, get, set } from 'lodash';
|
||||
import {
|
||||
// utils
|
||||
getQueryParameters,
|
||||
request,
|
||||
// contexts
|
||||
// TODO add emit event
|
||||
@ -41,7 +40,6 @@ const EditSettingsView = ({
|
||||
deleteLayouts,
|
||||
componentsAndModelsMainPossibleMainFields,
|
||||
history: { push },
|
||||
location: { search },
|
||||
models,
|
||||
plugins,
|
||||
slug,
|
||||
@ -53,7 +51,6 @@ const EditSettingsView = ({
|
||||
const [isDraggingSibling, setIsDraggingSibling] = useState(false);
|
||||
|
||||
const fieldsReorderClassName = type === 'content-types' ? 'col-8' : 'col-12';
|
||||
const source = getQueryParameters(search, 'source');
|
||||
const abortController = new AbortController();
|
||||
const { signal } = abortController;
|
||||
|
||||
@ -162,7 +159,7 @@ const EditSettingsView = ({
|
||||
abortController.abort();
|
||||
};
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [slug, source, type, componentSlug]);
|
||||
}, [slug, type, componentSlug]);
|
||||
|
||||
const handleChange = ({ target: { name, value } }) => {
|
||||
dispatch({
|
||||
@ -188,7 +185,6 @@ const EditSettingsView = ({
|
||||
|
||||
delete body.schema;
|
||||
delete body.uid;
|
||||
delete body.source;
|
||||
delete body.isComponent;
|
||||
|
||||
emitEvent('willSaveContentTypeLayout');
|
||||
@ -411,7 +407,6 @@ const EditSettingsView = ({
|
||||
plugins,
|
||||
currentEnvironment,
|
||||
slug,
|
||||
source,
|
||||
emitEvent,
|
||||
push
|
||||
)}
|
||||
|
||||
@ -249,8 +249,6 @@ const EditViewDataManagerProvider = ({
|
||||
// emitEvent('didNotSaveEntry', { error: err });
|
||||
strapi.notification.error(error);
|
||||
}
|
||||
|
||||
// setIsSubmitting();
|
||||
} catch (err) {
|
||||
const errors = getYupInnerErrors(err);
|
||||
|
||||
@ -300,7 +298,6 @@ const EditViewDataManagerProvider = ({
|
||||
});
|
||||
};
|
||||
|
||||
// REMOVE_COMPONENT_FROM_FIELD
|
||||
const removeComponentFromDynamicZone = (dynamicZoneName, index) => {
|
||||
dispatch({
|
||||
type: 'REMOVE_COMPONENT_FROM_DYNAMIC_ZONE',
|
||||
|
||||
@ -1,14 +0,0 @@
|
||||
/*
|
||||
* Get the max _temp__id from a List
|
||||
* @param {List} arr
|
||||
* @returns {Int}
|
||||
*/
|
||||
const getMax = arr => {
|
||||
if (arr.size === 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return Math.max.apply(Math, arr.toJS().map(o => o._temp__id));
|
||||
};
|
||||
|
||||
export default getMax;
|
||||
@ -114,7 +114,7 @@ const createYupSchema = (model, { components }) => {
|
||||
if (min) {
|
||||
dynamicZoneSchema = dynamicZoneSchema
|
||||
.min(min, errorsTrads.min)
|
||||
.required();
|
||||
.required(errorsTrads.required);
|
||||
}
|
||||
} else {
|
||||
if (min) {
|
||||
|
||||
@ -993,11 +993,6 @@
|
||||
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-0.2.25.tgz#6df015905081f2762e5cfddeb7a20d2e9b16c786"
|
||||
integrity sha512-3RuZPDuuPELd7RXtUqTCfed14fcny9UiPOkdr2i+cYxBoTOfQgxcDoq77fHiiHcgWuo1LoBUpvGxFF1H/y7s3Q==
|
||||
|
||||
"@fortawesome/fontawesome-free@^5.11.2":
|
||||
version "5.11.2"
|
||||
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-free/-/fontawesome-free-5.11.2.tgz#8644bc25b19475779a7b7c1fc104bc0a794f4465"
|
||||
integrity sha512-XiUPoS79r1G7PcpnNtq85TJ7inJWe0v+b5oZJZKb0pGHNIV6+UiNeQWiFGmuQ0aj7GEhnD/v9iqxIsjuRKtEnQ==
|
||||
|
||||
"@fortawesome/fontawesome-svg-core@^1.2.22", "@fortawesome/fontawesome-svg-core@^1.2.25":
|
||||
version "1.2.25"
|
||||
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-1.2.25.tgz#24b03391d14f0c6171e8cad7057c687b74049790"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user