Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const filterByDigitalExchanges = (digitalExchanges, paginationMetadata) => {
const filter = {
formValues: { digitalExchangeId: digitalExchanges },
operators: { digitalExchangeId: FILTER_OPERATORS.EQUAL },
};
return applyFilter(filter, paginationMetadata);
};
const toFilter = formState => Object.keys(formState).reduce((acc, key) => ({
formValues: {
...acc.formValues,
[key]: formState[key],
},
operators: {
...acc.operators,
[key]: FILTER_OPERATORS.EQUAL,
},
}), {
formValues: {},
export const navigateDECategory = (category, paginationMetadata) => (dispatch, getState) => {
dispatch(setSelectedDECategory(category));
if (category !== ALL_CATEGORIES_CATEGORY) {
const filter = {
formValues: { type: category ? [category] : [] },
operators: { type: FILTER_OPERATORS.EQUAL },
};
dispatch(setDEFilter(filter, category));
}
const filters = getDEFilters(getState());
const params = filters[category] ? convertToQueryString(filters[category]) : '';
return dispatch(fetchDEComponents(paginationMetadata, params));
};
import { connect } from 'react-redux';
import { convertToQueryString, FILTER_OPERATORS, formattedText } from '@entando/utils';
import { fetchWidgetList } from 'state/widgets/actions';
import { fetchPlugins, fetchFragments } from 'state/fragments/actions';
import FragmentSearchForm from 'ui/fragments/list/FragmentSearchForm';
import { getWidgetTypesOptions, getPluginsOptions } from 'state/fragments/selectors';
const FIELD_OPERATORS = {
code: FILTER_OPERATORS.EQUAL,
widgetType: FILTER_OPERATORS.GREATER_THAN,
plugin: FILTER_OPERATORS.LIKE,
};
export const mapStateToProps = state => ({
widgetTypes: getWidgetTypesOptions(state),
plugins: getPluginsOptions(state),
});
export const mapDispatchToProps = dispatch => ({
onWillMount: () => {
dispatch(fetchWidgetList());
dispatch(fetchPlugins());
},