diff --git a/packages/strapi-plugin-content-manager/admin/src/components/FilterOptions/Add.js b/packages/strapi-plugin-content-manager/admin/src/components/FilterOptions/Add.js new file mode 100644 index 0000000000..692a86813e --- /dev/null +++ b/packages/strapi-plugin-content-manager/admin/src/components/FilterOptions/Add.js @@ -0,0 +1,12 @@ +import FilterOptionsCTA from 'components/FilterOptionsCTA'; + +const Add = FilterOptionsCTA.extend` + &:after { + content: '\f067'; + font-family: FontAwesome; + font-size: 9px; + color: #007EFF; + } +`; + +export default Add; diff --git a/packages/strapi-plugin-content-manager/admin/src/components/FilterOptions/Loadable.js b/packages/strapi-plugin-content-manager/admin/src/components/FilterOptions/Loadable.js new file mode 100644 index 0000000000..caed2adc89 --- /dev/null +++ b/packages/strapi-plugin-content-manager/admin/src/components/FilterOptions/Loadable.js @@ -0,0 +1,8 @@ +import Loadable from 'react-loadable'; + +import LoadingIndicator from 'components/LoadingIndicator'; + +export default Loadable({ + loader: () => import('./index'), + loading: LoadingIndicator, +}); diff --git a/packages/strapi-plugin-content-manager/admin/src/components/FilterOptions/Remove.js b/packages/strapi-plugin-content-manager/admin/src/components/FilterOptions/Remove.js new file mode 100644 index 0000000000..f516206f71 --- /dev/null +++ b/packages/strapi-plugin-content-manager/admin/src/components/FilterOptions/Remove.js @@ -0,0 +1,12 @@ +import FilterOptionsCTA from 'components/FilterOptionsCTA'; + +const Remove = FilterOptionsCTA.extend` + &:after { + content: '\f068'; + font-family: FontAwesome; + font-size: 9px; + color: #007EFF; + } +`; + +export default Remove; diff --git a/packages/strapi-plugin-content-manager/admin/src/components/FilterOptions/index.js b/packages/strapi-plugin-content-manager/admin/src/components/FilterOptions/index.js index c7ab565eba..92fda0238d 100644 --- a/packages/strapi-plugin-content-manager/admin/src/components/FilterOptions/index.js +++ b/packages/strapi-plugin-content-manager/admin/src/components/FilterOptions/index.js @@ -5,59 +5,85 @@ */ import React from 'react'; -import PropTypes from 'prop-types'; -import { FormattedMessage } from 'react-intl'; +// import PropTypes from 'prop-types'; -import Button from 'components/CustomButton'; import InputSelect from 'components/InputSelect'; import InputText from 'components/InputText'; +import Add from './Add'; import Div from './Div'; +import Remove from './Remove'; -function FilterOptions({ onSubmit }) { +const FILTER_TYPES = [ + { + id: 'content-manager.components.FilterOptions.FILTER_TYPES.equals', + value: '=', + }, + { + id: 'content-manager.components.FilterOptions.FILTER_TYPES.not_equals', + value: '_ne', + }, + { + id: 'content-manager.components.FilterOptions.FILTER_TYPES.lower', + value: '_lt', + }, + { + id: 'content-manager.components.FilterOptions.FILTER_TYPES.lower_equal', + value: '_lte', + }, + { + id: 'content-manager.components.FilterOptions.FILTER_TYPES.greater', + value: '_gt', + }, + { + id: 'content-manager.components.FilterOptions.FILTER_TYPES.greater_equal', + value: '_gte', + }, + { + id: 'content-manager.components.FilterOptions.FILTER_TYPES.contains', + value: '_contains', + }, + { + id: 'content-manager.components.FilterOptions.FILTER_TYPES.containss', + value: '_containss', + }, +]; + +function FilterOptions() { return ( -