Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

middleware.web.ts 4.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /* eslint-disable lines-around-comment */
  2. import LoginDialog from '../../authentication/components/web/LoginDialog';
  3. import WaitForOwnerDialog from '../../authentication/components/web/WaitForOwnerDialog';
  4. import ChatPrivacyDialog from '../../chat/components/web/ChatPrivacyDialog';
  5. import DesktopPicker from '../../desktop-picker/components/DesktopPicker';
  6. import DisplayNamePrompt from '../../display-name/components/web/DisplayNamePrompt';
  7. import ParticipantVerificationDialog from '../../e2ee/components/ParticipantVerificationDialog';
  8. import EmbedMeetingDialog from '../../embed-meeting/components/EmbedMeetingDialog';
  9. // @ts-ignore
  10. import FeedbackDialog from '../../feedback/components/FeedbackDialog.web';
  11. import AddPeopleDialog from '../../invite/components/add-people-dialog/web/AddPeopleDialog';
  12. import PremiumFeatureDialog from '../../jaas/components/web/PremiumFeatureDialog';
  13. import KeyboardShortcutsDialog from '../../keyboard-shortcuts/components/web/KeyboardShortcutsDialog';
  14. // @ts-ignore
  15. import StartLiveStreamDialog from '../../recording/components/LiveStream/web/StartLiveStreamDialog';
  16. // @ts-ignore
  17. import StopLiveStreamDialog from '../../recording/components/LiveStream/web/StopLiveStreamDialog';
  18. // @ts-ignore
  19. import StartRecordingDialog from '../../recording/components/Recording/web/StartRecordingDialog';
  20. // @ts-ignore
  21. import StopRecordingDialog from '../../recording/components/Recording/web/StopRecordingDialog';
  22. // @ts-ignore
  23. import RemoteControlAuthorizationDialog from '../../remote-control/components/RemoteControlAuthorizationDialog';
  24. import SalesforceLinkDialog from '../../salesforce/components/web/SalesforceLinkDialog';
  25. import ShareAudioDialog from '../../screen-share/components/web/ShareAudioDialog';
  26. import ShareScreenWarningDialog from '../../screen-share/components/web/ShareScreenWarningDialog';
  27. import SecurityDialog from '../../security/components/security-dialog/web/SecurityDialog';
  28. import LogoutDialog from '../../settings/components/web/LogoutDialog';
  29. import SharedVideoDialog from '../../shared-video/components/web/SharedVideoDialog';
  30. import SpeakerStats from '../../speaker-stats/components/web/SpeakerStats';
  31. import LanguageSelectorDialog from '../../subtitles/components/LanguageSelectorDialog.web';
  32. import GrantModeratorDialog from '../../video-menu/components/web/GrantModeratorDialog';
  33. import KickRemoteParticipantDialog from '../../video-menu/components/web/KickRemoteParticipantDialog';
  34. import MuteEveryoneDialog from '../../video-menu/components/web/MuteEveryoneDialog';
  35. import MuteEveryonesVideoDialog from '../../video-menu/components/web/MuteEveryonesVideoDialog';
  36. import MuteRemoteParticipantsVideoDialog from '../../video-menu/components/web/MuteRemoteParticipantsVideoDialog';
  37. // @ts-ignore
  38. import VideoQualityDialog from '../../video-quality/components/VideoQualityDialog.web';
  39. import VirtualBackgroundDialog from '../../virtual-background/components/VirtualBackgroundDialog';
  40. import MiddlewareRegistry from '../redux/MiddlewareRegistry';
  41. import { OPEN_DIALOG } from './actionTypes';
  42. // ! IMPORTANT - This whole middleware is only needed for the transition from from @atlaskit dialog to our component.
  43. // ! It should be removed when the transition is over.
  44. const NEW_DIALOG_LIST = [ KeyboardShortcutsDialog, ChatPrivacyDialog, DisplayNamePrompt, EmbedMeetingDialog,
  45. FeedbackDialog, AddPeopleDialog, PremiumFeatureDialog, StartLiveStreamDialog, StopLiveStreamDialog,
  46. StartRecordingDialog, StopRecordingDialog, ShareAudioDialog, ShareScreenWarningDialog, SecurityDialog,
  47. SharedVideoDialog, SpeakerStats, LanguageSelectorDialog, MuteEveryoneDialog, MuteEveryonesVideoDialog,
  48. GrantModeratorDialog, KickRemoteParticipantDialog, MuteRemoteParticipantsVideoDialog, VideoQualityDialog,
  49. VirtualBackgroundDialog, LoginDialog, WaitForOwnerDialog, DesktopPicker, RemoteControlAuthorizationDialog,
  50. LogoutDialog, SalesforceLinkDialog, ParticipantVerificationDialog ];
  51. // This function is necessary while the transition from @atlaskit dialog to our component is ongoing.
  52. const isNewDialog = (component: any) => NEW_DIALOG_LIST.some(comp => comp === component);
  53. /**
  54. * Implements the entry point of the middleware of the feature base/media.
  55. *
  56. * @param {IStore} store - The redux store.
  57. * @returns {Function}
  58. */
  59. MiddlewareRegistry.register(() => (next: Function) => (action: any) => {
  60. switch (action.type) {
  61. case OPEN_DIALOG: {
  62. action.isNewDialog = isNewDialog(action.component);
  63. }
  64. }
  65. return next(action);
  66. });