Sha256: b21781982a76fc9fc4c76fb460eaf8da54bfdf54b6167dd6e1816e22acf9c1cb

Contents?: true

Size: 549 Bytes

Versions: 13

Compression:

Stored size: 549 Bytes

Contents

import { foremanUrl } from 'foremanReact/common/helpers';
import { sprintf, translate as __ } from 'foremanReact/common/I18n';
import { post } from 'foremanReact/redux/API';

export const runFeature = (hostId, feature, label) => dispatch => {
  const url = foremanUrl(
    `/job_invocations?feature=${feature}&host_ids%5B%5D=${hostId}`
  );

  const successToast = () => sprintf(__('%s job has been invoked'), label);
  const errorToast = ({ message }) => message;
  dispatch(post({ key: feature.toUpperCase(), url, successToast, errorToast }));
};

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
foreman_remote_execution-7.2.2 webpack/react_app/components/FeaturesDropdown/actions.js
foreman_remote_execution-7.2.1 webpack/react_app/components/FeaturesDropdown/actions.js
foreman_remote_execution-7.2.0 webpack/react_app/components/FeaturesDropdown/actions.js
foreman_remote_execution-5.0.8 webpack/react_app/components/FeaturesDropdown/actions.js
foreman_remote_execution-8.0.0 webpack/react_app/components/FeaturesDropdown/actions.js
foreman_remote_execution-7.1.1 webpack/react_app/components/FeaturesDropdown/actions.js
foreman_remote_execution-7.1.0 webpack/react_app/components/FeaturesDropdown/actions.js
foreman_remote_execution-7.0.0 webpack/react_app/components/FeaturesDropdown/actions.js
foreman_remote_execution-5.0.7 webpack/react_app/components/FeaturesDropdown/actions.js
foreman_remote_execution-5.0.6 webpack/react_app/components/FeaturesDropdown/actions.js
foreman_remote_execution-6.2.0 webpack/react_app/components/FeaturesDropdown/actions.js
foreman_remote_execution-5.0.5 webpack/react_app/components/FeaturesDropdown/actions.js
foreman_remote_execution-6.1.0 webpack/react_app/components/FeaturesDropdown/actions.js