fortawesome dep

This commit is contained in:
Virginie Ky 2019-11-28 14:15:04 +01:00
parent 27bbef0ea2
commit 0d8eda80bd
7 changed files with 35 additions and 71 deletions

View File

@ -27,6 +27,7 @@
"@buffetjs/icons": "^1.1.0", "@buffetjs/icons": "^1.1.0",
"@buffetjs/styles": "^1.1.0", "@buffetjs/styles": "^1.1.0",
"@buffetjs/utils": "^1.1.0", "@buffetjs/utils": "^1.1.0",
"@fortawesome/fontawesome-free": "^5.11.2",
"@fortawesome/fontawesome-svg-core": "^1.2.25", "@fortawesome/fontawesome-svg-core": "^1.2.25",
"@fortawesome/free-brands-svg-icons": "^5.11.2", "@fortawesome/free-brands-svg-icons": "^5.11.2",
"@fortawesome/free-solid-svg-icons": "^5.11.2", "@fortawesome/free-solid-svg-icons": "^5.11.2",

View File

@ -1,16 +1,14 @@
import styled from 'styled-components'; import styled, { css } from 'styled-components';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import getColor from './utils/getColor'; import getColor from './utils/getColor';
import getHeight from './utils/getHeight'; import getHeight from './utils/getHeight';
const Wrapper = styled.div` const Wrapper = styled.div`
${({ withLongerHeight }) => { ${({ withLongerHeight }) =>
if (!withLongerHeight) { !withLongerHeight &&
return ` css`
height: 30px; height: 30px;
`; `};
}
}};
min-height: ${({ withLongerHeight }) => getHeight(withLongerHeight)}; min-height: ${({ withLongerHeight }) => getHeight(withLongerHeight)};
padding: 0 10px 0 0; padding: 0 10px 0 0;
flex-basis: calc(100% / ${props => props.count}); flex-basis: calc(100% / ${props => props.count});
@ -21,7 +19,6 @@ const Wrapper = styled.div`
.sub_wrapper { .sub_wrapper {
position: relative; position: relative;
cursor: pointer; cursor: pointer;
background: ${({ isOverEditBlock, isOverRemove, isSelected, isSub }) => { background: ${({ isOverEditBlock, isOverRemove, isSelected, isSub }) => {
if (isOverRemove) { if (isOverRemove) {
return '#ffe9e0'; return '#ffe9e0';
@ -38,70 +35,63 @@ const Wrapper = styled.div`
getColor(isOverRemove, isSelected, isOverEditBlock)}; getColor(isOverRemove, isSelected, isOverEditBlock)};
border-radius: 2px; border-radius: 2px;
.name { .name {
${({ isOverEditBlock, isOverRemove, isSelected }) => { ${({ isOverRemove }) =>
if (isOverRemove) { isOverRemove &&
return ` css`
color: #f64d0a color: #f64d0a;
`; `}
}
if (isSelected || isOverEditBlock) { ${({ isOverEditBlock, isSelected }) =>
return ` (isSelected || isOverEditBlock) &&
color: #007eff css`
`; color: #007eff;
} `}
}}
} }
.grab { .grab {
border-right: 1px solid border-right: 1px solid
${({ isOverEditBlock, isOverRemove, isSelected }) => ${({ isOverEditBlock, isOverRemove, isSelected }) =>
getColor(isOverRemove, isSelected, isOverEditBlock)}; getColor(isOverRemove, isSelected, isOverEditBlock)};
${({ isOverEditBlock, isOverRemove, isSelected }) => { ${({ isOverRemove }) =>
if (isOverRemove) { isOverRemove &&
return ` css`
g { g {
fill: #ffa784; fill: #ffa784;
} }
`; `}
}
if (isSelected || isOverEditBlock) { ${({ isOverEditBlock, isSelected }) =>
return ` (isSelected || isOverEditBlock) &&
css`
g { g {
fill: #007eff; fill: #007eff;
} }
`; `}
}
}}
} }
.remove { .remove {
background-color: ${({ isOverEditBlock, isOverRemove, isSelected }) => background-color: ${({ isOverEditBlock, isOverRemove, isSelected }) =>
getColor(isOverRemove, isSelected, isOverEditBlock)}; getColor(isOverRemove, isSelected, isOverEditBlock)};
cursor: pointer; cursor: pointer;
svg { svg {
align-self: center; align-self: center;
} }
${({ isOverEditBlock, isOverRemove, isSelected }) => { ${({ isOverRemove }) =>
if (isOverRemove) { isOverRemove &&
return ` css`
path { path {
fill: #f64d0a; fill: #f64d0a;
} }
`; `}
}
if (isSelected || isOverEditBlock) { ${({ isOverEditBlock, isSelected }) =>
return ` (isSelected || isOverEditBlock) &&
css`
path { path {
fill: #007eff; fill: #007eff;
} }
`; `}
}
}}
} }
} }
`; `;

View File

@ -10,7 +10,6 @@ import { useParams } from 'react-router-dom';
import { cloneDeep, get, set } from 'lodash'; import { cloneDeep, get, set } from 'lodash';
import { import {
// utils // utils
getQueryParameters,
request, request,
// contexts // contexts
// TODO add emit event // TODO add emit event
@ -41,7 +40,6 @@ const EditSettingsView = ({
deleteLayouts, deleteLayouts,
componentsAndModelsMainPossibleMainFields, componentsAndModelsMainPossibleMainFields,
history: { push }, history: { push },
location: { search },
models, models,
plugins, plugins,
slug, slug,
@ -53,7 +51,6 @@ const EditSettingsView = ({
const [isDraggingSibling, setIsDraggingSibling] = useState(false); const [isDraggingSibling, setIsDraggingSibling] = useState(false);
const fieldsReorderClassName = type === 'content-types' ? 'col-8' : 'col-12'; const fieldsReorderClassName = type === 'content-types' ? 'col-8' : 'col-12';
const source = getQueryParameters(search, 'source');
const abortController = new AbortController(); const abortController = new AbortController();
const { signal } = abortController; const { signal } = abortController;
@ -162,7 +159,7 @@ const EditSettingsView = ({
abortController.abort(); abortController.abort();
}; };
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
}, [slug, source, type, componentSlug]); }, [slug, type, componentSlug]);
const handleChange = ({ target: { name, value } }) => { const handleChange = ({ target: { name, value } }) => {
dispatch({ dispatch({
@ -188,7 +185,6 @@ const EditSettingsView = ({
delete body.schema; delete body.schema;
delete body.uid; delete body.uid;
delete body.source;
delete body.isComponent; delete body.isComponent;
emitEvent('willSaveContentTypeLayout'); emitEvent('willSaveContentTypeLayout');
@ -411,7 +407,6 @@ const EditSettingsView = ({
plugins, plugins,
currentEnvironment, currentEnvironment,
slug, slug,
source,
emitEvent, emitEvent,
push push
)} )}

View File

@ -249,8 +249,6 @@ const EditViewDataManagerProvider = ({
// emitEvent('didNotSaveEntry', { error: err }); // emitEvent('didNotSaveEntry', { error: err });
strapi.notification.error(error); strapi.notification.error(error);
} }
// setIsSubmitting();
} catch (err) { } catch (err) {
const errors = getYupInnerErrors(err); const errors = getYupInnerErrors(err);
@ -300,7 +298,6 @@ const EditViewDataManagerProvider = ({
}); });
}; };
// REMOVE_COMPONENT_FROM_FIELD
const removeComponentFromDynamicZone = (dynamicZoneName, index) => { const removeComponentFromDynamicZone = (dynamicZoneName, index) => {
dispatch({ dispatch({
type: 'REMOVE_COMPONENT_FROM_DYNAMIC_ZONE', type: 'REMOVE_COMPONENT_FROM_DYNAMIC_ZONE',

View File

@ -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;

View File

@ -114,7 +114,7 @@ const createYupSchema = (model, { components }) => {
if (min) { if (min) {
dynamicZoneSchema = dynamicZoneSchema dynamicZoneSchema = dynamicZoneSchema
.min(min, errorsTrads.min) .min(min, errorsTrads.min)
.required(); .required(errorsTrads.required);
} }
} else { } else {
if (min) { if (min) {

View File

@ -993,11 +993,6 @@
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-0.2.25.tgz#6df015905081f2762e5cfddeb7a20d2e9b16c786" resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-0.2.25.tgz#6df015905081f2762e5cfddeb7a20d2e9b16c786"
integrity sha512-3RuZPDuuPELd7RXtUqTCfed14fcny9UiPOkdr2i+cYxBoTOfQgxcDoq77fHiiHcgWuo1LoBUpvGxFF1H/y7s3Q== 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": "@fortawesome/fontawesome-svg-core@^1.2.22", "@fortawesome/fontawesome-svg-core@^1.2.25":
version "1.2.25" version "1.2.25"
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-1.2.25.tgz#24b03391d14f0c6171e8cad7057c687b74049790" resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-1.2.25.tgz#24b03391d14f0c6171e8cad7057c687b74049790"