How to use the @entando/utils.FILTER_OPERATORS.EQUAL function in @entando/utils

To help you get started, we’ve selected a few @entando/utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github entando / app-builder / src / state / digital-exchange / actions.js View on Github external
export const filterByDigitalExchanges = (digitalExchanges, paginationMetadata) => {
  const filter = {
    formValues: { digitalExchangeId: digitalExchanges },
    operators: { digitalExchangeId: FILTER_OPERATORS.EQUAL },
  };
  return applyFilter(filter, paginationMetadata);
};
github entando / app-builder / src / ui / widgets / config / forms / ContentPickerContainer.js View on Github external
const toFilter = formState => Object.keys(formState).reduce((acc, key) => ({
  formValues: {
    ...acc.formValues,
    [key]: formState[key],
  },
  operators: {
    ...acc.operators,
    [key]: FILTER_OPERATORS.EQUAL,
  },
}), {
  formValues: {},
github entando / app-builder / src / state / digital-exchange / actions.js View on Github external
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));
};
github entando / app-builder / src / ui / fragments / list / FragmentSearchFormContainer.js View on Github external
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());
  },