diff --git a/packages/strapi-plugin-content-type-builder/admin/src/components/BodyModal/index.js b/packages/strapi-helper-plugin/lib/src/components/BodyModal/index.js
similarity index 100%
rename from packages/strapi-plugin-content-type-builder/admin/src/components/BodyModal/index.js
rename to packages/strapi-helper-plugin/lib/src/components/BodyModal/index.js
diff --git a/packages/strapi-plugin-content-type-builder/admin/src/components/BodyModal/styles.scss b/packages/strapi-helper-plugin/lib/src/components/BodyModal/styles.scss
similarity index 100%
rename from packages/strapi-plugin-content-type-builder/admin/src/components/BodyModal/styles.scss
rename to packages/strapi-helper-plugin/lib/src/components/BodyModal/styles.scss
diff --git a/packages/strapi-plugin-content-type-builder/admin/src/components/BodyModal/tests/index.test.js b/packages/strapi-helper-plugin/lib/src/components/BodyModal/tests/index.test.js
similarity index 100%
rename from packages/strapi-plugin-content-type-builder/admin/src/components/BodyModal/tests/index.test.js
rename to packages/strapi-helper-plugin/lib/src/components/BodyModal/tests/index.test.js
diff --git a/packages/strapi-plugin-content-type-builder/admin/src/components/FooterModal/index.js b/packages/strapi-helper-plugin/lib/src/components/FooterModal/index.js
similarity index 83%
rename from packages/strapi-plugin-content-type-builder/admin/src/components/FooterModal/index.js
rename to packages/strapi-helper-plugin/lib/src/components/FooterModal/index.js
index 557468d430..99ce986dc5 100644
--- a/packages/strapi-plugin-content-type-builder/admin/src/components/FooterModal/index.js
+++ b/packages/strapi-helper-plugin/lib/src/components/FooterModal/index.js
@@ -6,7 +6,8 @@
import styled from 'styled-components';
-import { colors, sizes } from 'strapi-helper-plugin';
+import colors from '../../assets/styles/colors';
+import sizes from '../../assets/styles/sizes';
const FooterModal = styled.div`
padding-top: ${sizes.margin * 0.9}px;
diff --git a/packages/strapi-plugin-content-type-builder/admin/src/components/FooterModal/tests/index.test.js b/packages/strapi-helper-plugin/lib/src/components/FooterModal/tests/index.test.js
similarity index 79%
rename from packages/strapi-plugin-content-type-builder/admin/src/components/FooterModal/tests/index.test.js
rename to packages/strapi-helper-plugin/lib/src/components/FooterModal/tests/index.test.js
index 143393fbb6..d7cc68b5be 100644
--- a/packages/strapi-plugin-content-type-builder/admin/src/components/FooterModal/tests/index.test.js
+++ b/packages/strapi-helper-plugin/lib/src/components/FooterModal/tests/index.test.js
@@ -10,7 +10,11 @@ describe('', () => {
it('should render its children', () => {
const Child = () =>
This is a child
;
- const wrapper = shallow();
+ const wrapper = shallow(
+
+
+
+ );
expect(wrapper.find(Child).exists()).toBe(true);
});
diff --git a/packages/strapi-plugin-content-type-builder/admin/src/components/FormModal/index.js b/packages/strapi-helper-plugin/lib/src/components/FormModal/index.js
similarity index 100%
rename from packages/strapi-plugin-content-type-builder/admin/src/components/FormModal/index.js
rename to packages/strapi-helper-plugin/lib/src/components/FormModal/index.js
diff --git a/packages/strapi-plugin-content-type-builder/admin/src/components/HeaderModal/index.js b/packages/strapi-helper-plugin/lib/src/components/HeaderModal/index.js
similarity index 90%
rename from packages/strapi-plugin-content-type-builder/admin/src/components/HeaderModal/index.js
rename to packages/strapi-helper-plugin/lib/src/components/HeaderModal/index.js
index 69947dfc3d..d3cb265685 100644
--- a/packages/strapi-plugin-content-type-builder/admin/src/components/HeaderModal/index.js
+++ b/packages/strapi-helper-plugin/lib/src/components/HeaderModal/index.js
@@ -5,8 +5,8 @@
*/
import styled from 'styled-components';
-
-import { colors, sizes } from 'strapi-helper-plugin';
+import colors from '../../assets/styles/colors';
+import sizes from '../../assets/styles/sizes';
const HeaderModal = styled.div`
color: ${colors.black};
diff --git a/packages/strapi-plugin-content-type-builder/admin/src/components/HeaderModalTitle/index.js b/packages/strapi-helper-plugin/lib/src/components/HeaderModalTitle/index.js
similarity index 100%
rename from packages/strapi-plugin-content-type-builder/admin/src/components/HeaderModalTitle/index.js
rename to packages/strapi-helper-plugin/lib/src/components/HeaderModalTitle/index.js
diff --git a/packages/strapi-plugin-content-type-builder/admin/src/components/WrapperModal/index.js b/packages/strapi-helper-plugin/lib/src/components/Modal/index.js
similarity index 100%
rename from packages/strapi-plugin-content-type-builder/admin/src/components/WrapperModal/index.js
rename to packages/strapi-helper-plugin/lib/src/components/Modal/index.js
diff --git a/packages/strapi-plugin-content-type-builder/admin/src/components/WrapperModal/styles.scss b/packages/strapi-helper-plugin/lib/src/components/Modal/styles.scss
similarity index 100%
rename from packages/strapi-plugin-content-type-builder/admin/src/components/WrapperModal/styles.scss
rename to packages/strapi-helper-plugin/lib/src/components/Modal/styles.scss
diff --git a/packages/strapi-plugin-content-type-builder/admin/src/components/WrapperModal/tests/index.test.js b/packages/strapi-helper-plugin/lib/src/components/Modal/tests/index.test.js
similarity index 100%
rename from packages/strapi-plugin-content-type-builder/admin/src/components/WrapperModal/tests/index.test.js
rename to packages/strapi-helper-plugin/lib/src/components/Modal/tests/index.test.js
diff --git a/packages/strapi-helper-plugin/lib/src/index.js b/packages/strapi-helper-plugin/lib/src/index.js
index b9511cfc31..0ea51c7633 100644
--- a/packages/strapi-helper-plugin/lib/src/index.js
+++ b/packages/strapi-helper-plugin/lib/src/index.js
@@ -18,6 +18,8 @@ export { default as ErrorBoundary } from './components/ErrorBoundary';
export { default as ExtendComponent } from './components/ExtendComponent';
export { default as GlobalPagination } from './components/GlobalPagination';
export { default as HeaderNav } from './components/HeaderNav';
+export { default as HeaderModal } from './components/HeaderModal';
+export { default as HeaderModalTitle } from './components/HeaderModalTitle';
export { default as IcoContainer } from './components/IcoContainer';
export { default as InputAddon } from './components/InputAddon';
@@ -87,6 +89,10 @@ export {
default as LoadingIndicatorPage,
} from './components/LoadingIndicatorPage';
+export { default as Modal } from './components/Modal';
+export { default as ModalBody } from './components/BodyModal';
+export { default as ModalFooter } from './components/FooterModal';
+export { default as ModalForm } from './components/FormModal';
export { default as NotFound } from './components/NotFound';
export { default as OverlayBlocker } from './components/OverlayBlocker';
export { default as PageFooter } from './components/PageFooter';
diff --git a/packages/strapi-plugin-content-type-builder/admin/src/components/HeaderModal/tests/index.test.js b/packages/strapi-plugin-content-type-builder/admin/src/components/HeaderModal/tests/index.test.js
deleted file mode 100644
index 6ed6b9e40a..0000000000
--- a/packages/strapi-plugin-content-type-builder/admin/src/components/HeaderModal/tests/index.test.js
+++ /dev/null
@@ -1,17 +0,0 @@
-import React from 'react';
-import { shallow } from 'enzyme';
-
-import HeaderModal from '../index';
-
-describe('', () => {
- it('should not crash', () => {
- shallow();
- });
-
- it('should render its children', () => {
- const Child = () => Some child
;
- const wrapper = shallow();
-
- expect(wrapper.find(Child).exists()).toBe(true);
- });
-});
diff --git a/packages/strapi-plugin-content-type-builder/admin/src/components/HeaderModalTitle/tests/index.test.js b/packages/strapi-plugin-content-type-builder/admin/src/components/HeaderModalTitle/tests/index.test.js
deleted file mode 100644
index 0bf2fcb10b..0000000000
--- a/packages/strapi-plugin-content-type-builder/admin/src/components/HeaderModalTitle/tests/index.test.js
+++ /dev/null
@@ -1,10 +0,0 @@
-import React from 'react';
-import { shallow } from 'enzyme';
-
-import HeaderModalTitle from '../index';
-
-describe('', () => {
- it('should not crash', () => {
- shallow();
- });
-});
diff --git a/packages/strapi-plugin-content-type-builder/admin/src/containers/AttributeForm/index.js b/packages/strapi-plugin-content-type-builder/admin/src/containers/AttributeForm/index.js
index 7918fd3a75..bf9f4eaa07 100644
--- a/packages/strapi-plugin-content-type-builder/admin/src/containers/AttributeForm/index.js
+++ b/packages/strapi-plugin-content-type-builder/admin/src/containers/AttributeForm/index.js
@@ -9,20 +9,23 @@ import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';
import { get, isEmpty } from 'lodash';
-import { ButtonModal, InputsIndex as Input } from 'strapi-helper-plugin';
+import {
+ ButtonModal,
+ HeaderModal,
+ HeaderModalTitle,
+ Modal,
+ ModalBody,
+ ModalFooter,
+ ModalForm,
+ InputsIndex as Input,
+} from 'strapi-helper-plugin';
import pluginId from '../../pluginId';
-import BodyModal from '../../components/BodyModal';
import ButtonModalPrimary from '../../components/ButtonModalPrimary';
import CustomCheckbox from '../../components/CustomCheckbox';
-import FooterModal from '../../components/FooterModal';
-import FormModal from '../../components/FormModal';
-import HeaderModal from '../../components/HeaderModal';
-import HeaderModalTitle from '../../components/HeaderModalTitle';
import HeaderModalNavContainer from '../../components/HeaderModalNavContainer';
import HeaderNavLink from '../../components/HeaderNavLink';
-import WrapperModal from '../../components/WrapperModal';
import Icon from '../../assets/icons/icon_type_ct.png';
import IconGroup from '../../assets/icons/icon_type_groups.png';
@@ -318,7 +321,7 @@ class AttributeForm extends React.Component {
const currentForm = this.getCurrentForm();
return (
-
-
+
);
}
}
diff --git a/packages/strapi-plugin-content-type-builder/admin/src/containers/AttributeForm/tests/index.test.js b/packages/strapi-plugin-content-type-builder/admin/src/containers/AttributeForm/tests/index.test.js
index 8feb44851c..a610577863 100644
--- a/packages/strapi-plugin-content-type-builder/admin/src/containers/AttributeForm/tests/index.test.js
+++ b/packages/strapi-plugin-content-type-builder/admin/src/containers/AttributeForm/tests/index.test.js
@@ -4,14 +4,13 @@ import { FormattedMessage } from 'react-intl';
import mountWithIntl from 'testUtils/mountWithIntl';
import formatMessagesWithPluginId from 'testUtils/formatMessages';
-import { InputsIndex as Input } from 'strapi-helper-plugin';
+import { HeaderModalTitle, InputsIndex as Input } from 'strapi-helper-plugin';
// This part is needed if you need to test the lifecycle of a container that contains FormattedMessages
import pluginId from '../../../pluginId';
import pluginTradsEn from '../../../translations/en.json';
import CustomCheckbox from '../../../components/CustomCheckbox';
-import HeaderModalTitle from '../../../components/HeaderModalTitle';
import AttributeForm from '../index';
const messages = formatMessagesWithPluginId(pluginId, pluginTradsEn);
diff --git a/packages/strapi-plugin-content-type-builder/admin/src/containers/AttributesPickerModal/index.js b/packages/strapi-plugin-content-type-builder/admin/src/containers/AttributesPickerModal/index.js
index a408df838c..29ab747fe6 100644
--- a/packages/strapi-plugin-content-type-builder/admin/src/containers/AttributesPickerModal/index.js
+++ b/packages/strapi-plugin-content-type-builder/admin/src/containers/AttributesPickerModal/index.js
@@ -7,15 +7,16 @@
import React from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';
-
+import {
+ HeaderModal,
+ HeaderModalTitle,
+ Modal,
+ ModalBody,
+ ModalFooter,
+} from 'strapi-helper-plugin';
import pluginId from '../../pluginId';
import AttributeOption from '../../components/AttributeOption';
-import BodyModal from '../../components/BodyModal';
-import FooterModal from '../../components/FooterModal';
-import HeaderModal from '../../components/HeaderModal';
-import HeaderModalTitle from '../../components/HeaderModalTitle';
-import WrapperModal from '../../components/WrapperModal';
import Icon from '../../assets/icons/icon_type_ct.png';
import IconGroup from '../../assets/icons/icon_type_groups.png';
@@ -164,7 +165,7 @@ class AttributesPickerModal extends React.Component {
const { featureName, featureType, isOpen } = this.props;
return (
-
-
+
{attributes.map(this.renderAttribute)}
-
-
-
+
+
+
);
}
}
diff --git a/packages/strapi-plugin-content-type-builder/admin/src/containers/ModelForm/index.js b/packages/strapi-plugin-content-type-builder/admin/src/containers/ModelForm/index.js
index 5b02c0904f..5154f4ddc7 100644
--- a/packages/strapi-plugin-content-type-builder/admin/src/containers/ModelForm/index.js
+++ b/packages/strapi-plugin-content-type-builder/admin/src/containers/ModelForm/index.js
@@ -9,17 +9,20 @@ import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';
import { get, isEmpty, upperFirst } from 'lodash';
-import { ButtonModal, InputsIndex as Input } from 'strapi-helper-plugin';
+import {
+ ButtonModal,
+ HeaderModal,
+ HeaderModalTitle,
+ Modal,
+ ModalBody,
+ ModalFooter,
+ InputsIndex as Input,
+} from 'strapi-helper-plugin';
import pluginId from '../../pluginId';
-import BodyModal from '../../components/BodyModal';
-import FooterModal from '../../components/FooterModal';
-import HeaderModal from '../../components/HeaderModal';
-import HeaderModalTitle from '../../components/HeaderModalTitle';
import HeaderModalNavContainer from '../../components/HeaderModalNavContainer';
import HeaderNavLink from '../../components/HeaderNavLink';
-import WrapperModal from '../../components/WrapperModal';
import Icon from '../../assets/icons/icon_type_ct.png';
import IconGroup from '../../assets/icons/icon_type_groups.png';
@@ -226,7 +229,7 @@ class ModelForm extends React.Component {
const currentForm = get(forms, activeTab, forms.base);
return (
-
-
+
);
}
}
diff --git a/packages/strapi-plugin-content-type-builder/admin/src/containers/RelationForm/index.js b/packages/strapi-plugin-content-type-builder/admin/src/containers/RelationForm/index.js
index a05536005a..a8f8fdc51e 100644
--- a/packages/strapi-plugin-content-type-builder/admin/src/containers/RelationForm/index.js
+++ b/packages/strapi-plugin-content-type-builder/admin/src/containers/RelationForm/index.js
@@ -9,19 +9,23 @@ import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';
import { get, isEmpty } from 'lodash';
-import { ButtonModal, InputsIndex as Input } from 'strapi-helper-plugin';
+import {
+ ButtonModal,
+ HeaderModal,
+ HeaderModalTitle,
+ Modal,
+ ModalBody,
+ ModalFooter,
+ ModalForm,
+ InputsIndex as Input,
+} from 'strapi-helper-plugin';
import pluginId from '../../pluginId';
-import BodyModal from '../../components/BodyModal';
import ButtonModalPrimary from '../../components/ButtonModalPrimary';
-import FooterModal from '../../components/FooterModal';
-import FormModal from '../../components/FormModal';
-import HeaderModal from '../../components/HeaderModal';
+
import HeaderModalNavContainer from '../../components/HeaderModalNavContainer';
-import HeaderModalTitle from '../../components/HeaderModalTitle';
import HeaderNavLink from '../../components/HeaderNavLink';
-import WrapperModal from '../../components/WrapperModal';
import NaturePicker from './NaturePicker';
import RelationWrapper from './RelationWrapper';
@@ -287,7 +291,7 @@ class RelationForm extends React.Component {
: this.renderAdvancedSettings();
return (
-
-
+
);
}
}
diff --git a/packages/strapi-plugin-content-type-builder/admin/src/containers/RelationFormGroup/index.js b/packages/strapi-plugin-content-type-builder/admin/src/containers/RelationFormGroup/index.js
index 01bd83a636..0a3f09cb44 100644
--- a/packages/strapi-plugin-content-type-builder/admin/src/containers/RelationFormGroup/index.js
+++ b/packages/strapi-plugin-content-type-builder/admin/src/containers/RelationFormGroup/index.js
@@ -9,22 +9,27 @@ import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';
import { get, isEmpty } from 'lodash';
-import { ButtonModal, InputsIndex as Input } from 'strapi-helper-plugin';
+import {
+ ButtonModal,
+ HeaderModal,
+ HeaderModalTitle,
+ Modal,
+ ModalBody,
+ ModalFooter,
+ ModalForm,
+ InputsIndex as Input,
+} from 'strapi-helper-plugin';
import pluginId from '../../pluginId';
-import BodyModal from '../../components/BodyModal';
import ButtonModalPrimary from '../../components/ButtonModalPrimary';
-import FooterModal from '../../components/FooterModal';
-import FormModal from '../../components/FormModal';
-import HeaderModal from '../../components/HeaderModal';
+
import HeaderModalNavContainer from '../../components/HeaderModalNavContainer';
-import HeaderModalTitle from '../../components/HeaderModalTitle';
+
import HeaderNavLink from '../../components/HeaderNavLink';
import RelationNaturePicker from '../../components/RelationNaturePicker';
import RelationBox from '../../components/RelationBox';
import RelationsWrapper from '../../components/RelationsWrapper';
-import WrapperModal from '../../components/WrapperModal';
import Icon from '../../assets/icons/icon_type_ct.png';
import IconGroup from '../../assets/icons/icon_type_groups.png';
@@ -295,7 +300,7 @@ class RelationFormGroup extends React.Component {
: this.renderAdvancedSettings();
return (
-
-
+
);
}
}