Sha256: 3315255263c2108996067bf3355f8d154bacc4a2b7b908953fb1bde14a9cf3ee

Contents?: true

Size: 517 Bytes

Versions: 31

Compression:

Stored size: 517 Bytes

Contents

import store from 'foremanReact/redux';
import * as ToastActions from 'foremanReact/redux/actions/toasts';

const isStickyType = type => !['success', 'info'].includes(type);

/**
 * Notify the user with a toast-notification
 */
export const notify = ({
  message, type, link, sticky = isStickyType(type),
}) =>
  store.dispatch(ToastActions.addToast({
    type,
    message,
    sticky,
    link,
  }));

/**
 * Clear all toast notifications
 */
export const clear = () => store.dispatch(ToastActions.clearToasts());

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
katello-3.12.3 webpack/move_to_foreman/foreman_toast_notifications.js
katello-3.12.2 webpack/move_to_foreman/foreman_toast_notifications.js
katello-3.12.1 webpack/move_to_foreman/foreman_toast_notifications.js
katello-3.11.2 webpack/move_to_foreman/foreman_toast_notifications.js
katello-3.10.2 webpack/move_to_foreman/foreman_toast_notifications.js
katello-3.12.0 webpack/move_to_foreman/foreman_toast_notifications.js
katello-3.12.0.rc2 webpack/move_to_foreman/foreman_toast_notifications.js
katello-3.10.1.1 webpack/move_to_foreman/foreman_toast_notifications.js
katello-3.12.0.rc1 webpack/move_to_foreman/foreman_toast_notifications.js
katello-3.10.1 webpack/move_to_foreman/foreman_toast_notifications.js
katello-3.11.1 webpack/move_to_foreman/foreman_toast_notifications.js
katello-3.11.0 webpack/move_to_foreman/foreman_toast_notifications.js
katello-3.11.0.rc2 webpack/move_to_foreman/foreman_toast_notifications.js
katello-3.11.0.rc1 webpack/move_to_foreman/foreman_toast_notifications.js
katello-3.10.0 webpack/move_to_foreman/foreman_toast_notifications.js
katello-3.10.0.rc1.1 webpack/move_to_foreman/foreman_toast_notifications.js
katello-3.9.1 webpack/move_to_foreman/foreman_toast_notifications.js
katello-3.10.0.rc1 webpack/move_to_foreman/foreman_toast_notifications.js
katello-3.9.0 webpack/move_to_foreman/foreman_toast_notifications.js
katello-3.8.1 webpack/move_to_foreman/foreman_toast_notifications.js