Sha256: 991f1f7edfca1acf522b86bbf446a211b37218ef520d78d91f2bd10e67c31eaf
Contents?: true
Size: 1.01 KB
Versions: 33
Compression:
Stored size: 1.01 KB
Contents
import API from 'foremanReact/API'; import { translate as __ } from 'foremanReact/common/I18n'; import { foremanUrl } from '../../ForemanRhCloudHelpers'; import { inventoryUrl } from '../ForemanInventoryHelpers'; export const subscriptionCountListener = (itemsCount, unsubscribe) => { const showToast = autoUploadEnabled => { !autoUploadEnabled && window.tfm.toastNotifications.notify({ message: __('Now you can enable Red Hat inventory upload'), type: 'info', link: { children: __('Go to inventory upload settings'), href: foremanUrl('foreman_rh_cloud/inventory_upload'), }, }); unsubscribe(); }; itemsCount && fetchInventoryAutoUploadSetting(showToast); }; const fetchInventoryAutoUploadSetting = async processApiResponse => { let settingValue; try { const { data: { autoUploadEnabled }, } = await API.get(inventoryUrl('auto_upload')); settingValue = autoUploadEnabled; } finally { processApiResponse(settingValue); } };
Version data entries
33 entries across 33 versions & 1 rubygems