Sha256: a55d9322a6038e95b2a2f3c50f0d8154c43efaca73da05b2aadf2737407f4917

Contents?: true

Size: 850 Bytes

Versions: 8

Compression:

Stored size: 850 Bytes

Contents

import React from 'react';
import { post } from 'foremanReact/redux/API';
import { translate as __ } from 'foremanReact/common/I18n';
import { insightsCloudUrl } from './InsightsCloudSyncHelpers';
import { INSIGHTS_CLOUD_SYNC } from './InsightsCloudSyncConstants';
import { foremanUrl } from '../ForemanRhCloudHelpers';

export const syncInsights = () =>
  post({
    key: INSIGHTS_CLOUD_SYNC,
    url: insightsCloudUrl('tasks'),
    successToast: response => (
      <span>
        {__('Recommendation sync has started: ')}
        <a
          target="_blank"
          rel="noopener noreferrer"
          href={foremanUrl(`/foreman_tasks/tasks/${response.data?.task?.id}`)}
        >
          {__('view the task in progress')}
        </a>
      </span>
    ),
    errorToast: error => `${__('Recommendation sync has failed: ')} ${error}`,
  });

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
foreman_rh_cloud-4.0.21.1 webpack/InsightsCloudSync/InsightsCloudSyncActions.js
foreman_rh_cloud-3.0.21.1 webpack/InsightsCloudSync/InsightsCloudSyncActions.js
foreman_rh_cloud-3.0.21 webpack/InsightsCloudSync/InsightsCloudSyncActions.js
foreman_rh_cloud-3.0.20 webpack/InsightsCloudSync/InsightsCloudSyncActions.js
foreman_rh_cloud-3.0.19 webpack/InsightsCloudSync/InsightsCloudSyncActions.js
foreman_rh_cloud-3.0.18.1 webpack/InsightsCloudSync/InsightsCloudSyncActions.js
foreman_rh_cloud-3.0.18 webpack/InsightsCloudSync/InsightsCloudSyncActions.js
foreman_rh_cloud-3.0.17 webpack/InsightsCloudSync/InsightsCloudSyncActions.js