How to use the strapi-helper-plugin.getQueryParameters function in strapi-helper-plugin

To help you get started, we’ve selected a few strapi-helper-plugin 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 strapi / strapi / packages / strapi-plugin-content-manager / admin / src / containers / ListPage / index.js View on Github external
getData = (props, setUpdatingParams = false) => {
    const source = getQueryParameters(props.location.search, 'source');
    const _limit =
      toInteger(getQueryParameters(props.location.search, '_limit')) ||
      this.getCurrentModelDefaultLimit();
    const _page =
      toInteger(getQueryParameters(props.location.search, '_page')) || 1;
    const _sort = this.findPageSort(props); // TODO sort
    const _q = getQueryParameters(props.location.search, '_q') || '';
    const params = { _limit, _page, _sort, _q };
    const filters = generateFiltersFromSearch(props.location.search);

    this.props.setParams(params, filters);
    this.props.getData(props.match.params.slug, source, setUpdatingParams);
  };
github strapi / strapi / packages / strapi-plugin-content-manager / admin / src / containers / SettingViewModel / index.js View on Github external
removeRelation,
  reorderDiffRow,
  reorderRow,
  resetProps,
  setEditFieldToSelect,
  setListFieldToEditIndex,
  shouldToggleModalSubmit,
}) {
  strapi.useInjectReducer({ key: 'settingViewModel', reducer, pluginId });
  strapi.useInjectSaga({ key: 'settingViewModel', saga, pluginId });
  const [showWarningSubmit, setWarningSubmit] = useState(false);
  const [showWarningCancel, setWarningCancel] = useState(false);
  const toggleWarningSubmit = () => setWarningSubmit(prevState => !prevState);
  const toggleWarningCancel = () => setWarningCancel(prevState => !prevState);
  const source = getQueryParameters(search, 'source');
  const redirectUrl = getQueryParameters(search, 'redirectUrl');

  useEffect(() => {
    getData(name, source);

    return () => {
      resetProps();
    };
  }, [getData, name, resetProps, source]);
  useEffect(() => {
    if (showWarningSubmit) {
      toggleWarningSubmit();
    }
    // eslint-disable-next-line react-hooks/exhaustive-deps
  }, [shouldToggleModalSubmit]);

  const getAttributes = useMemo(() => {
github strapi / strapi / packages / strapi-plugin-content-manager / admin / src / containers / EditView / index.js View on Github external
const [reducerState, dispatch] = useReducer(reducer, initialState, () =>
    init(initialState, layout, isCreatingEntry)
  );

  const state = reducerState.toJS();
  const {
    didCheckErrors,
    errors,
    groupLayoutsData,
    initialData,
    modifiedData,
    isLoading,
    isLoadingForLayouts,
  } = state;

  const source = getQueryParameters(search, 'source');
  const shouldShowLoader =
    isLoadingForLayouts || (!isCreatingEntry && isLoading);

  useEffect(() => {
    const fetchGroupLayouts = async () => {
      try {
        const data = await Promise.all(
          groupLayoutsToGet.map(uid =>
            request(`/${pluginId}/groups/${uid}`, {
              method: 'GET',
              signal,
            })
          )
        );

        const groupLayouts = data.reduce((acc, current) => {
github strapi / strapi / packages / strapi-plugin-content-type-builder / admin / src / containers / App / index.js View on Github external
getActionType = () => {
    return getQueryParameters(this.getSearch(), 'actionType');
  };
github strapi / strapi / packages / strapi-plugin-content-type-builder / admin / src / containers / GroupPage / index.js View on Github external
getAttributeIndex = () => {
    return getQueryParameters(this.getSearch(), 'attributeName');
  };
github strapi / strapi / packages / strapi-plugin-content-type-builder / admin / src / containers / App / index.js View on Github external
getFeatureNameFromSearch = () =>
    getQueryParameters(this.getSearch(), `${this.getFeatureType()}Name`);
github strapi / strapi / packages / strapi-plugin-content-type-builder / admin / src / containers / ModelPage / index.js View on Github external
getSource = () => {
    const {
      match: {
        params: { modelName },
      },
    } = this.props;

    const source = getQueryParameters(modelName, 'source');

    return !!source ? source : null;
  };