You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

actions.ts 1.3KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import { IStore } from '../app/types';
  2. import { openDialog } from '../base/dialog/actions';
  3. import { hideNotification, showNotification } from '../notifications/actions';
  4. import {
  5. NOTIFICATION_TIMEOUT_TYPE,
  6. NOTIFICATION_TYPE,
  7. SALESFORCE_LINK_NOTIFICATION_ID
  8. } from '../notifications/constants';
  9. // @ts-ignore
  10. import { SalesforceLinkDialog } from './components';
  11. import { isSalesforceEnabled } from './functions';
  12. /**
  13. * Displays the notification for linking the meeting to Salesforce.
  14. *
  15. * @returns {void}
  16. */
  17. export function showSalesforceNotification() {
  18. return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
  19. if (!isSalesforceEnabled(getState())) {
  20. return;
  21. }
  22. dispatch(showNotification({
  23. descriptionKey: 'notify.linkToSalesforceDescription',
  24. titleKey: 'notify.linkToSalesforce',
  25. uid: SALESFORCE_LINK_NOTIFICATION_ID,
  26. customActionNameKey: [ 'notify.linkToSalesforceKey' ],
  27. customActionHandler: [ () => {
  28. dispatch(hideNotification(SALESFORCE_LINK_NOTIFICATION_ID));
  29. dispatch(openDialog(SalesforceLinkDialog));
  30. } ],
  31. appearance: NOTIFICATION_TYPE.NORMAL
  32. }, NOTIFICATION_TIMEOUT_TYPE.STICKY));
  33. };
  34. }