@messenger-box/platform-browser 10.0.3-alpha.17 → 10.0.3-alpha.171
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/InboxMessage/InboxDetails/index.d.ts +6 -1
- package/lib/components/InboxMessage/InboxDetails/index.d.ts.map +1 -1
- package/lib/components/InboxMessage/InboxDetails/index.js +10 -11
- package/lib/components/InboxMessage/InboxDetails/index.js.map +1 -1
- package/lib/components/InboxMessage/InboxSidebar/index.d.ts.map +1 -1
- package/lib/components/InboxMessage/InboxSidebar/index.js +23 -32
- package/lib/components/InboxMessage/InboxSidebar/index.js.map +1 -1
- package/lib/components/InboxMessage/Messages/index.d.ts.map +1 -1
- package/lib/components/InboxMessage/Messages/index.js +42 -81
- package/lib/components/InboxMessage/Messages/index.js.map +1 -1
- package/lib/components/InboxMessage/MessagesList/index.d.ts.map +1 -1
- package/lib/components/InboxMessage/MessagesList/index.js +53 -74
- package/lib/components/InboxMessage/MessagesList/index.js.map +1 -1
- package/lib/components/InboxMessage/Popover/index.d.ts +5 -1
- package/lib/components/InboxMessage/Popover/index.d.ts.map +1 -1
- package/lib/components/InboxMessage/Popover/index.js +8 -35
- package/lib/components/InboxMessage/Popover/index.js.map +1 -1
- package/lib/components/InboxMessage/UserModalContent/index.d.ts.map +1 -1
- package/lib/components/InboxMessage/UserModalContent/index.js +50 -47
- package/lib/components/InboxMessage/UserModalContent/index.js.map +1 -1
- package/lib/components/InboxMessage/index.d.ts.map +1 -1
- package/lib/components/InboxMessage/index.js +38 -70
- package/lib/components/InboxMessage/index.js.map +1 -1
- package/lib/components/channel_view/DirectChannelView.js.map +1 -1
- package/lib/components/channel_view/PublicChannelView.js.map +1 -1
- package/lib/components/dashboard/menu_header.d.ts.map +1 -1
- package/lib/components/dashboard/menu_header.js +38 -24
- package/lib/components/dashboard/menu_header.js.map +1 -1
- package/lib/components/dashboard/modals/direct_modal.d.ts +10 -8
- package/lib/components/dashboard/modals/direct_modal.d.ts.map +1 -1
- package/lib/components/dashboard/modals/direct_modal.js +59 -39
- package/lib/components/dashboard/modals/direct_modal.js.map +1 -1
- package/lib/components/dashboard/modals.d.ts +18 -6
- package/lib/components/dashboard/modals.d.ts.map +1 -1
- package/lib/components/dashboard/modals.js +60 -101
- package/lib/components/dashboard/modals.js.map +1 -1
- package/lib/components/messenger/avatar/index.d.ts.map +1 -1
- package/lib/components/messenger/index.d.ts.map +1 -1
- package/lib/components/messenger/index.js +45 -82
- package/lib/components/messenger/index.js.map +1 -1
- package/lib/components/messenger/messagesList/index.d.ts.map +1 -1
- package/lib/components/messenger/messagesList/index.js +174 -454
- package/lib/components/messenger/messagesList/index.js.map +1 -1
- package/lib/components/messenger/messagesList/messageBox.d.ts +0 -1
- package/lib/components/messenger/messagesList/messageBox.d.ts.map +1 -1
- package/lib/components/messenger/more_action/index.d.ts.map +1 -1
- package/lib/components/messenger/postMessage/postMessage.d.ts +7 -2
- package/lib/components/messenger/postMessage/postMessage.d.ts.map +1 -1
- package/lib/components/messenger/sidebarThreadList/index.d.ts.map +1 -1
- package/lib/components/messenger/threadSidebar/index.d.ts.map +1 -1
- package/lib/components/messenger/types/message.d.ts +11 -11
- package/lib/components/messenger/types/message.d.ts.map +1 -1
- package/lib/components/post/channel_intro_message/channel_intro_message.d.ts.map +1 -1
- package/lib/components/post/channel_layout/channel_identifier_router/channel_identifier_router.d.ts.map +1 -1
- package/lib/components/post/channel_view/channel_view.d.ts.map +1 -1
- package/lib/components/post/create_post/create_post.d.ts +10 -1
- package/lib/components/post/create_post/create_post.d.ts.map +1 -1
- package/lib/components/post/failed_post_options/failed_post_options.d.ts.map +1 -1
- package/lib/components/post/index.d.ts +5 -3
- package/lib/components/post/index.d.ts.map +1 -1
- package/lib/components/post/index.js +63 -97
- package/lib/components/post/index.js.map +1 -1
- package/lib/components/post/markdown/markdown.d.ts.map +1 -1
- package/lib/components/post/post/post.d.ts.map +1 -1
- package/lib/components/post/post_body/post_body.d.ts.map +1 -1
- package/lib/components/post/post_body_additional_content/post_body_additional_content.d.ts.map +1 -1
- package/lib/components/post/post_header/post_header.d.ts.map +1 -1
- package/lib/components/post/post_header/post_header_custom_status.d.ts.map +1 -1
- package/lib/components/post/post_info/post_info.d.ts.map +1 -1
- package/lib/components/post/post_list/post_list.d.ts.map +1 -1
- package/lib/components/post/post_list_row/post_list_row.d.ts.map +1 -1
- package/lib/components/post/post_list_virtualized/post_list_virtualized.d.ts.map +1 -1
- package/lib/components/post/post_markdown/post_markdown.d.ts.map +1 -1
- package/lib/components/post/post_message_view/post_message_view.d.ts.map +1 -1
- package/lib/components/post/post_pre_header/post_pre_header.d.ts.map +1 -1
- package/lib/components/post/post_profile_picture/post_profile_picture.d.ts.map +1 -1
- package/lib/components/post/profile_picture/profile_picture.d.ts.map +1 -1
- package/lib/components/post/show_more/show_more.d.ts.map +1 -1
- package/lib/components/post/suggestion/suggestion_box.d.ts.map +1 -1
- package/lib/components/post/textbox/textbox.d.ts.map +1 -1
- package/lib/components/post/threading/channel_threads/thread_footer/thread_footer.d.ts.map +1 -1
- package/lib/components/post/tutorial/menu_tutorial_tip.d.ts.map +1 -1
- package/lib/components/post/tutorial/tutorial_tip/tutorial_tip.d.ts.map +1 -1
- package/lib/components/post_view/post_attachment_container/post_attachment_container.d.ts.map +1 -1
- package/lib/components/status_icon.d.ts.map +1 -1
- package/lib/compute.js.map +1 -1
- package/lib/containers/Dashboard.d.ts.map +1 -1
- package/lib/containers/Dashboard.js +110 -124
- package/lib/containers/Dashboard.js.map +1 -1
- package/lib/containers/DashboardWithLoader.d.ts.map +1 -1
- package/lib/containers/DashboardWithLoader.js +14 -5
- package/lib/containers/DashboardWithLoader.js.map +1 -1
- package/lib/containers/Inbox.js.map +1 -1
- package/lib/containers/Messenger.js.map +1 -1
- package/lib/module.js.map +1 -1
- package/lib/utils/index.d.ts.map +1 -1
- package/lib/utils/index.js.map +1 -1
- package/lib/widgets/simple_tooltip/simple_tooltip.d.ts.map +1 -1
- package/package.json +5 -5
- package/CHANGELOG.md +0 -135
- package/jest.config.js +0 -24
- package/lib/components/InboxMessage/InboxDetails/style.d.ts +0 -2
- package/lib/components/InboxMessage/InboxDetails/style.d.ts.map +0 -1
- package/lib/components/InboxMessage/InboxDetails/style.js +0 -27
- package/lib/components/InboxMessage/InboxDetails/style.js.map +0 -1
- package/lib/components/InboxMessage/InboxSidebar/styles.d.ts +0 -2
- package/lib/components/InboxMessage/InboxSidebar/styles.d.ts.map +0 -1
- package/lib/components/InboxMessage/InboxSidebar/styles.js +0 -57
- package/lib/components/InboxMessage/InboxSidebar/styles.js.map +0 -1
- package/lib/components/InboxMessage/Messages/styles.d.ts +0 -81
- package/lib/components/InboxMessage/Messages/styles.d.ts.map +0 -1
- package/lib/components/InboxMessage/Messages/styles.js +0 -85
- package/lib/components/InboxMessage/Messages/styles.js.map +0 -1
- package/lib/components/InboxMessage/Popover/style.d.ts +0 -28
- package/lib/components/InboxMessage/Popover/style.d.ts.map +0 -1
- package/lib/components/InboxMessage/Popover/style.js +0 -27
- package/lib/components/InboxMessage/Popover/style.js.map +0 -1
- package/lib/components/InboxMessage/UserModalContent/style.d.ts +0 -2
- package/lib/components/InboxMessage/UserModalContent/style.d.ts.map +0 -1
- package/lib/components/InboxMessage/UserModalContent/style.js +0 -98
- package/lib/components/InboxMessage/UserModalContent/style.js.map +0 -1
- package/lib/components/InboxMessage/style.js +0 -189
- package/lib/components/InboxMessage/style.js.map +0 -1
- package/lib/components/messenger/avatar/style.d.ts +0 -2
- package/lib/components/messenger/avatar/style.d.ts.map +0 -1
- package/lib/components/messenger/messagesList/style.js +0 -446
- package/lib/components/messenger/messagesList/style.js.map +0 -1
- package/lib/components/messenger/more_action/index.js +0 -48
- package/lib/components/messenger/more_action/index.js.map +0 -1
- package/lib/components/messenger/more_action/style.d.ts +0 -2
- package/lib/components/messenger/more_action/style.d.ts.map +0 -1
- package/lib/components/messenger/more_action/style.js +0 -45
- package/lib/components/messenger/more_action/style.js.map +0 -1
- package/lib/components/post/style.js +0 -20101
- package/lib/components/post/style.js.map +0 -1
- package/lib/style.js +0 -400
- package/lib/style.js.map +0 -1
- package/rollup.config.mjs +0 -35
- package/src/cdm-locales/en/translations.json +0 -95
- package/src/cdm-locales/es/translations.json +0 -95
- package/src/components/InboxMessage/InboxDetails/index.tsx +0 -25
- package/src/components/InboxMessage/InboxDetails/style.ts +0 -27
- package/src/components/InboxMessage/InboxSidebar/index.tsx +0 -89
- package/src/components/InboxMessage/InboxSidebar/styles.ts +0 -57
- package/src/components/InboxMessage/Messages/index.tsx +0 -161
- package/src/components/InboxMessage/Messages/styles.ts +0 -85
- package/src/components/InboxMessage/MessagesList/index.tsx +0 -93
- package/src/components/InboxMessage/Popover/index.tsx +0 -60
- package/src/components/InboxMessage/Popover/style.ts +0 -27
- package/src/components/InboxMessage/UserModalContent/index.tsx +0 -63
- package/src/components/InboxMessage/UserModalContent/style.ts +0 -98
- package/src/components/InboxMessage/index.tsx +0 -289
- package/src/components/InboxMessage/mock.ts +0 -53
- package/src/components/InboxMessage/style.ts +0 -189
- package/src/components/NavBar.tsx +0 -10
- package/src/components/channel_view/DirectChannelView.tsx +0 -25
- package/src/components/channel_view/PublicChannelView.tsx +0 -25
- package/src/components/dashboard/menu_header.tsx +0 -62
- package/src/components/dashboard/modals/direct_modal.tsx +0 -54
- package/src/components/dashboard/modals.tsx +0 -121
- package/src/components/messenger/avatar/index.tsx +0 -39
- package/src/components/messenger/avatar/style.ts +0 -86
- package/src/components/messenger/index.tsx +0 -382
- package/src/components/messenger/messagesList/index.tsx +0 -764
- package/src/components/messenger/messagesList/messageBox.tsx +0 -66
- package/src/components/messenger/messagesList/style.ts +0 -448
- package/src/components/messenger/mock.ts +0 -77
- package/src/components/messenger/more_action/index.tsx +0 -79
- package/src/components/messenger/more_action/style.ts +0 -45
- package/src/components/messenger/postMessage/postMessage.tsx +0 -28
- package/src/components/messenger/postMessage/style.ts +0 -24
- package/src/components/messenger/sidebarThreadList/index.tsx +0 -201
- package/src/components/messenger/style.ts +0 -40
- package/src/components/messenger/threadSidebar/index.tsx +0 -129
- package/src/components/messenger/threadSidebar/style.ts +0 -65
- package/src/components/messenger/types/message.ts +0 -16
- package/src/components/messenger/utils/utils.ts +0 -5
- package/src/components/overlay_trigger.tsx +0 -59
- package/src/components/post/channel_intro_message/add_members_button.tsx +0 -152
- package/src/components/post/channel_intro_message/channel_intro_message.tsx +0 -53
- package/src/components/post/channel_intro_message/index.ts +0 -1
- package/src/components/post/channel_layout/center_channel/center_channel.test.tsx +0 -50
- package/src/components/post/channel_layout/center_channel/center_channel.tsx +0 -125
- package/src/components/post/channel_layout/center_channel/index.ts +0 -69
- package/src/components/post/channel_layout/channel_controller.test.tsx +0 -76
- package/src/components/post/channel_layout/channel_controller.tsx +0 -85
- package/src/components/post/channel_layout/channel_identifier_router/actions.test.ts +0 -243
- package/src/components/post/channel_layout/channel_identifier_router/actions.ts +0 -353
- package/src/components/post/channel_layout/channel_identifier_router/channel_identifier_router.test.tsx +0 -101
- package/src/components/post/channel_layout/channel_identifier_router/channel_identifier_router.tsx +0 -6
- package/src/components/post/channel_layout/channel_identifier_router/index.ts +0 -1
- package/src/components/post/channel_view/channel_view.test.tsx +0 -68
- package/src/components/post/channel_view/channel_view.tsx +0 -92
- package/src/components/post/channel_view/index.ts +0 -1
- package/src/components/post/create_post/create_post.test.jsx +0 -1335
- package/src/components/post/create_post/create_post.tsx +0 -225
- package/src/components/post/create_post/index.ts +0 -1
- package/src/components/post/failed_post_options/failed_post_options.tsx +0 -32
- package/src/components/post/failed_post_options/index.ts +0 -4
- package/src/components/post/index.tsx +0 -131
- package/src/components/post/markdown/index.ts +0 -1
- package/src/components/post/markdown/markdown.test.tsx +0 -62
- package/src/components/post/markdown/markdown.tsx +0 -38
- package/src/components/post/post/defaultpost.ts +0 -25
- package/src/components/post/post/post.tsx +0 -270
- package/src/components/post/post/style.ts +0 -0
- package/src/components/post/post_aria_label_div.tsx +0 -43
- package/src/components/post/post_body/post_body.tsx +0 -80
- package/src/components/post/post_body_additional_content/post_body_additional_content.tsx +0 -6
- package/src/components/post/post_context.tsx +0 -10
- package/src/components/post/post_header/index.ts +0 -38
- package/src/components/post/post_header/post_header.scss +0 -53
- package/src/components/post/post_header/post_header.tsx +0 -98
- package/src/components/post/post_header/post_header_custom_status.tsx +0 -49
- package/src/components/post/post_header/style.ts +0 -54
- package/src/components/post/post_info/post_info.tsx +0 -195
- package/src/components/post/post_list/index.tsx +0 -10
- package/src/components/post/post_list/post_list.tsx +0 -27
- package/src/components/post/post_list_row/index.ts +0 -42
- package/src/components/post/post_list_row/post_list_row.test.tsx +0 -176
- package/src/components/post/post_list_row/post_list_row.tsx +0 -130
- package/src/components/post/post_list_virtualized/latest_post_reader.tsx +0 -9
- package/src/components/post/post_list_virtualized/post_list_virtualized.tsx +0 -269
- package/src/components/post/post_markdown/index.test.js +0 -119
- package/src/components/post/post_markdown/index.ts +0 -1
- package/src/components/post/post_markdown/post_markdown.test.tsx +0 -178
- package/src/components/post/post_markdown/post_markdown.tsx +0 -58
- package/src/components/post/post_markdown/system_message_helpers.tsx +0 -420
- package/src/components/post/post_message_view/index.ts +0 -4
- package/src/components/post/post_message_view/post_message_view.test.tsx +0 -89
- package/src/components/post/post_message_view/post_message_view.tsx +0 -71
- package/src/components/post/post_pre_header/post_pre_header.tsx +0 -141
- package/src/components/post/post_profile_picture/post_profile_picture.tsx +0 -95
- package/src/components/post/post_view.tsx +0 -10
- package/src/components/post/profile_picture/profile_picture.tsx +0 -21
- package/src/components/post/show_more/index.ts +0 -1
- package/src/components/post/show_more/show_more.test.tsx +0 -102
- package/src/components/post/show_more/show_more.tsx +0 -97
- package/src/components/post/style.ts +0 -20101
- package/src/components/post/suggestion/suggestion_box.tsx +0 -5
- package/src/components/post/textbox/index.ts +0 -1
- package/src/components/post/textbox/textbox.tsx +0 -80
- package/src/components/post/textbox/textbox_links/index.ts +0 -24
- package/src/components/post/textbox/textbox_links/textbox_links.tsx +0 -143
- package/src/components/post/threading/channel_threads/thread_footer/index.ts +0 -4
- package/src/components/post/threading/channel_threads/thread_footer/thread_footer.scss +0 -72
- package/src/components/post/threading/channel_threads/thread_footer/thread_footer.tsx +0 -206
- package/src/components/post/threading/common/button/__snapshots__/button.test.tsx.snap +0 -68
- package/src/components/post/threading/common/button/button.scss +0 -148
- package/src/components/post/threading/common/button/button.test.tsx +0 -75
- package/src/components/post/threading/common/button/button.tsx +0 -51
- package/src/components/post/threading/common/button/index.ts +0 -4
- package/src/components/post/threading/common/follow_button/__snapshots__/follow_button.test.tsx.snap +0 -50
- package/src/components/post/threading/common/follow_button/follow_button.test.tsx +0 -56
- package/src/components/post/threading/common/follow_button/follow_button.tsx +0 -39
- package/src/components/post/threading/common/follow_button/index.ts +0 -4
- package/src/components/post/timestamp/__snapshots__/semantic_time.test.tsx.snap +0 -13
- package/src/components/post/timestamp/__snapshots__/timestamp.test.tsx.snap +0 -13
- package/src/components/post/timestamp/index.ts +0 -50
- package/src/components/post/timestamp/relative_ranges.tsx +0 -58
- package/src/components/post/timestamp/semantic_time.test.tsx +0 -47
- package/src/components/post/timestamp/semantic_time.tsx +0 -28
- package/src/components/post/timestamp/timestamp.stories.tsx +0 -190
- package/src/components/post/timestamp/timestamp.test.tsx +0 -309
- package/src/components/post/timestamp/timestamp.tsx +0 -441
- package/src/components/post/tutorial/menu_tutorial_tip.tsx +0 -63
- package/src/components/post/tutorial/tutorial_tip/index.ts +0 -0
- package/src/components/post/tutorial/tutorial_tip/tutorial_tip.test.tsx +0 -111
- package/src/components/post/tutorial/tutorial_tip/tutorial_tip.tsx +0 -224
- package/src/components/post/user_profile/index.tsx +0 -6
- package/src/components/post/user_profile/user_profile.tsx +0 -114
- package/src/components/post_view/__snapshots__/post_view.test.js.snap +0 -25
- package/src/components/post_view/channel_intro_message/add_members_button.scss +0 -72
- package/src/components/post_view/channel_intro_message/add_members_button.tsx +0 -152
- package/src/components/post_view/channel_intro_message/channel_intro_message.tsx +0 -549
- package/src/components/post_view/channel_intro_message/index.ts +0 -67
- package/src/components/post_view/combined_system_message/__snapshots__/combined_system_message.test.tsx.snap +0 -238
- package/src/components/post_view/combined_system_message/__snapshots__/last_users.test.tsx.snap +0 -74
- package/src/components/post_view/combined_system_message/combined_system_message.test.tsx +0 -167
- package/src/components/post_view/combined_system_message/combined_system_message.tsx +0 -380
- package/src/components/post_view/combined_system_message/index.ts +0 -46
- package/src/components/post_view/combined_system_message/last_users.test.tsx +0 -56
- package/src/components/post_view/combined_system_message/last_users.tsx +0 -135
- package/src/components/post_view/combined_user_activity_post/index.ts +0 -28
- package/src/components/post_view/comment_icon/index.ts +0 -31
- package/src/components/post_view/commented_on/__snapshots__/commented_on.test.tsx.snap +0 -276
- package/src/components/post_view/commented_on/commented_on.test.tsx +0 -184
- package/src/components/post_view/commented_on/commented_on.tsx +0 -92
- package/src/components/post_view/commented_on/index.ts +0 -37
- package/src/components/post_view/commented_on_files_message/__snapshots__/commented_on_files_message.test.jsx.snap +0 -24
- package/src/components/post_view/commented_on_files_message/commented_on_files_message.jsx +0 -47
- package/src/components/post_view/commented_on_files_message/commented_on_files_message.test.jsx +0 -53
- package/src/components/post_view/commented_on_files_message/index.js +0 -25
- package/src/components/post_view/date_separator/__snapshots__/date_separator.test.tsx.snap +0 -35
- package/src/components/post_view/date_separator/date_separator.test.tsx +0 -26
- package/src/components/post_view/date_separator/date_separator.tsx +0 -40
- package/src/components/post_view/date_separator/index.ts +0 -4
- package/src/components/post_view/embedded_bindings/button_binding/__snapshots__/button_binding.test.tsx.snap +0 -23
- package/src/components/post_view/embedded_bindings/button_binding/button_binding.test.tsx +0 -124
- package/src/components/post_view/embedded_bindings/button_binding/button_binding.tsx +0 -141
- package/src/components/post_view/embedded_bindings/button_binding/index.ts +0 -34
- package/src/components/post_view/embedded_bindings/embedded_binding/__snapshots__/embedded_binding.test.tsx.snap +0 -249
- package/src/components/post_view/embedded_bindings/embedded_binding/embedded_binding.test.tsx +0 -76
- package/src/components/post_view/embedded_bindings/embedded_binding/embedded_binding.tsx +0 -205
- package/src/components/post_view/embedded_bindings/embedded_binding/index.ts +0 -17
- package/src/components/post_view/embedded_bindings/embedded_bindings.tsx +0 -59
- package/src/components/post_view/embedded_bindings/select_binding/index.ts +0 -33
- package/src/components/post_view/embedded_bindings/select_binding/select_binding.test.tsx +0 -170
- package/src/components/post_view/embedded_bindings/select_binding/select_binding.tsx +0 -188
- package/src/components/post_view/failed_post_options/__snapshots__/failed_post_options.test.tsx.snap +0 -29
- package/src/components/post_view/failed_post_options/failed_post_options.test.tsx +0 -59
- package/src/components/post_view/failed_post_options/failed_post_options.tsx +0 -67
- package/src/components/post_view/failed_post_options/index.ts +0 -23
- package/src/components/post_view/floating_timestamp/__snapshots__/floating_timestamp.test.tsx.snap +0 -41
- package/src/components/post_view/floating_timestamp/floating_timestamp.test.tsx +0 -23
- package/src/components/post_view/floating_timestamp/floating_timestamp.tsx +0 -52
- package/src/components/post_view/floating_timestamp/index.ts +0 -35
- package/src/components/post_view/index.js +0 -61
- package/src/components/post_view/index.test.js +0 -37
- package/src/components/post_view/message_attachments/action_button/__snapshots__/action_button.test.tsx.snap +0 -26
- package/src/components/post_view/message_attachments/action_button/action_button.test.tsx +0 -113
- package/src/components/post_view/message_attachments/action_button/action_button.tsx +0 -80
- package/src/components/post_view/message_attachments/action_button/index.ts +0 -17
- package/src/components/post_view/message_attachments/action_menu/action_menu.test.tsx +0 -61
- package/src/components/post_view/message_attachments/action_menu/action_menu.tsx +0 -156
- package/src/components/post_view/message_attachments/action_menu/index.ts +0 -41
- package/src/components/post_view/message_attachments/message_attachment/__snapshots__/message_attachment.test.tsx.snap +0 -726
- package/src/components/post_view/message_attachments/message_attachment/index.ts +0 -32
- package/src/components/post_view/message_attachments/message_attachment/message_attachment.test.tsx +0 -234
- package/src/components/post_view/message_attachments/message_attachment/message_attachment.tsx +0 -544
- package/src/components/post_view/message_attachments/message_attachment_list.tsx +0 -64
- package/src/components/post_view/new_message_separator/__snapshots__/new_message_separator.test.tsx.snap +0 -16
- package/src/components/post_view/new_message_separator/new_message_separator.test.tsx +0 -16
- package/src/components/post_view/new_message_separator/new_message_separator.tsx +0 -31
- package/src/components/post_view/post/__snapshots__/post.test.js.snap +0 -337
- package/src/components/post_view/post/index.test.js +0 -61
- package/src/components/post_view/post/index.ts +0 -96
- package/src/components/post_view/post/post.jsx +0 -446
- package/src/components/post_view/post/post.test.js +0 -222
- package/src/components/post_view/post_add_channel_member/__snapshots__/post_add_channel_member.test.tsx.snap +0 -226
- package/src/components/post_view/post_add_channel_member/index.ts +0 -47
- package/src/components/post_view/post_add_channel_member/post_add_channel_member.test.tsx +0 -140
- package/src/components/post_view/post_add_channel_member/post_add_channel_member.tsx +0 -231
- package/src/components/post_view/post_aria_label_div.test.jsx +0 -106
- package/src/components/post_view/post_aria_label_div.tsx +0 -48
- package/src/components/post_view/post_attachment_container/__snapshots__/post_attachment_container.test.tsx.snap +0 -25
- package/src/components/post_view/post_attachment_container/post_attachment_container.test.tsx +0 -21
- package/src/components/post_view/post_attachment_container/post_attachment_container.tsx +0 -40
- package/src/components/post_view/post_attachment_opengraph/get_nearest_point.test.ts +0 -55
- package/src/components/post_view/post_attachment_opengraph/get_nearest_point.ts +0 -31
- package/src/components/post_view/post_attachment_opengraph/index.ts +0 -48
- package/src/components/post_view/post_attachment_opengraph/post_attachment_opengraph.test.tsx +0 -264
- package/src/components/post_view/post_attachment_opengraph/post_attachment_opengraph.tsx +0 -262
- package/src/components/post_view/post_body/index.js +0 -36
- package/src/components/post_view/post_body/post_body.jsx +0 -235
- package/src/components/post_view/post_body_additional_content/__snapshots__/post_body_additional_content.test.tsx.snap +0 -295
- package/src/components/post_view/post_body_additional_content/index.ts +0 -36
- package/src/components/post_view/post_body_additional_content/post_body_additional_content.test.tsx +0 -425
- package/src/components/post_view/post_body_additional_content/post_body_additional_content.tsx +0 -194
- package/src/components/post_view/post_context.js +0 -14
- package/src/components/post_view/post_flag_icon/__snapshots__/post_flag_icon.test.js.snap +0 -81
- package/src/components/post_view/post_flag_icon/index.js +0 -20
- package/src/components/post_view/post_flag_icon/post_flag_icon.js +0 -125
- package/src/components/post_view/post_flag_icon/post_flag_icon.test.js +0 -39
- package/src/components/post_view/post_header/__snapshots__/post_header.test.tsx.snap +0 -196
- package/src/components/post_view/post_header/index.ts +0 -38
- package/src/components/post_view/post_header/post_header.scss +0 -53
- package/src/components/post_view/post_header/post_header.test.tsx +0 -68
- package/src/components/post_view/post_header/post_header.tsx +0 -202
- package/src/components/post_view/post_header/post_header_custom_status.tsx +0 -73
- package/src/components/post_view/post_image/index.js +0 -6
- package/src/components/post_view/post_image/post_image.jsx +0 -69
- package/src/components/post_view/post_info/__snapshots__/post_info.test.tsx.snap +0 -322
- package/src/components/post_view/post_info/index.ts +0 -66
- package/src/components/post_view/post_info/post_info.test.tsx +0 -170
- package/src/components/post_view/post_info/post_info.tsx +0 -403
- package/src/components/post_view/post_list/__snapshots__/post_list.test.jsx.snap +0 -71
- package/src/components/post_view/post_list/index.js +0 -105
- package/src/components/post_view/post_list/post_list.jsx +0 -324
- package/src/components/post_view/post_list/post_list.test.jsx +0 -274
- package/src/components/post_view/post_list_row/__snapshots__/post_list_row.test.tsx.snap +0 -108
- package/src/components/post_view/post_list_row/index.ts +0 -42
- package/src/components/post_view/post_list_row/post_list_row.test.tsx +0 -176
- package/src/components/post_view/post_list_row/post_list_row.tsx +0 -165
- package/src/components/post_view/post_list_virtualized/latest_post_reader.test.jsx +0 -80
- package/src/components/post_view/post_list_virtualized/latest_post_reader.tsx +0 -46
- package/src/components/post_view/post_list_virtualized/post_list_virtualized.jsx +0 -626
- package/src/components/post_view/post_list_virtualized/post_list_virtualized.test.jsx +0 -623
- package/src/components/post_view/post_message_preview/__snapshots__/post_message_preview.test.tsx.snap +0 -88
- package/src/components/post_view/post_message_preview/index.ts +0 -35
- package/src/components/post_view/post_message_preview/post_message_preview.test.tsx +0 -50
- package/src/components/post_view/post_message_preview/post_message_preview.tsx +0 -92
- package/src/components/post_view/post_message_view/__snapshots__/post_message_view.test.tsx.snap +0 -242
- package/src/components/post_view/post_message_view/index.ts +0 -27
- package/src/components/post_view/post_message_view/post_message_view.test.tsx +0 -89
- package/src/components/post_view/post_message_view/post_message_view.tsx +0 -192
- package/src/components/post_view/post_pre_header/__snapshots__/post_pre_header.test.tsx.snap +0 -209
- package/src/components/post_view/post_pre_header/index.js +0 -18
- package/src/components/post_view/post_pre_header/post_pre_header.test.tsx +0 -188
- package/src/components/post_view/post_pre_header/post_pre_header.tsx +0 -148
- package/src/components/post_view/post_reaction/__snapshots__/post_reaction.test.tsx.snap +0 -63
- package/src/components/post_view/post_reaction/index.ts +0 -21
- package/src/components/post_view/post_reaction/post_reaction.test.tsx +0 -39
- package/src/components/post_view/post_reaction/post_reaction.tsx +0 -124
- package/src/components/post_view/post_time/index.ts +0 -18
- package/src/components/post_view/post_time/post_time.tsx +0 -113
- package/src/components/post_view/post_view.jsx +0 -83
- package/src/components/post_view/post_view.test.js +0 -53
- package/src/components/post_view/reaction/__snapshots__/reaction.test.jsx.snap +0 -339
- package/src/components/post_view/reaction/index.ts +0 -120
- package/src/components/post_view/reaction/reaction.scss +0 -157
- package/src/components/post_view/reaction/reaction.test.jsx +0 -80
- package/src/components/post_view/reaction/reaction.tsx +0 -263
- package/src/components/post_view/reaction/reaction_tooltip/index.test.js +0 -56
- package/src/components/post_view/reaction/reaction_tooltip/index.ts +0 -67
- package/src/components/post_view/reaction/reaction_tooltip/reaction_tooltip.tsx +0 -140
- package/src/components/post_view/reaction_list/__snapshots__/reactions_list.test.jsx.snap +0 -95
- package/src/components/post_view/reaction_list/index.ts +0 -52
- package/src/components/post_view/reaction_list/reaction_list.tsx +0 -201
- package/src/components/post_view/reaction_list/reactions_list.test.jsx +0 -57
- package/src/components/post_view/scroll_to_bottom_arrows.jsx +0 -37
- package/src/components/post_view/show_more/__snapshots__/show_more.test.tsx.snap +0 -237
- package/src/components/post_view/show_more/index.ts +0 -23
- package/src/components/post_view/show_more/show_more.test.tsx +0 -102
- package/src/components/post_view/show_more/show_more.tsx +0 -196
- package/src/components/status_icon.tsx +0 -49
- package/src/components/status_icon_new.tsx +0 -35
- package/src/compute.ts +0 -74
- package/src/containers/Dashboard.tsx +0 -527
- package/src/containers/DashboardWithLoader.tsx +0 -38
- package/src/containers/Inbox.tsx +0 -13
- package/src/containers/Loading.tsx +0 -12
- package/src/containers/Messenger.tsx +0 -18
- package/src/containers/__tests__/ApolloProvider.test.tsx +0 -48
- package/src/containers/__tests__/Counter.test.tsx +0 -49
- package/src/containers/__tests__/PersonList.test.tsx +0 -43
- package/src/containers/__tests__/__snapshots__/Counter.test.tsx.snap +0 -299
- package/src/containers/__tests__/__snapshots__/PersonList.test.tsx.snap +0 -230
- package/src/containers/__tests__/redux.test.tsx +0 -86
- package/src/containers/__tests__/setup.ts +0 -18
- package/src/containers/__tests__/utils.ts +0 -5
- package/src/containers/index.ts +0 -4
- package/src/index.ts +0 -5
- package/src/inversify-containers/index.ts +0 -1
- package/src/inversify-containers/module.ts +0 -4
- package/src/module.ts +0 -21
- package/src/packages/constants/constants.ts +0 -1831
- package/src/packages/types/channels.ts +0 -194
- package/src/packages/types/emojis.ts +0 -41
- package/src/packages/types/files.ts +0 -43
- package/src/packages/types/posts.ts +0 -155
- package/src/packages/types/reactions.ts +0 -8
- package/src/packages/types/teams.ts +0 -105
- package/src/packages/types/utilities.ts +0 -30
- package/src/services/index.ts +0 -0
- package/src/style.ts +0 -401
- package/src/utils/constants.tsx +0 -1120
- package/src/utils/i18n.tsx +0 -15
- package/src/utils/index.ts +0 -34
- package/src/utils/post_list.ts +0 -54
- package/src/utils/post_utils.ts +0 -33
- package/src/utils/user_agent.tsx +0 -153
- package/src/utils/utils.tsx +0 -54
- package/src/widgets/badges/badge.scss +0 -21
- package/src/widgets/badges/badge.tsx +0 -30
- package/src/widgets/badges/bot_badge.tsx +0 -31
- package/src/widgets/badges/guest_badge.tsx +0 -31
- package/src/widgets/badges/style.ts +0 -24
- package/src/widgets/icons/accordion_toggle_icon.tsx +0 -59
- package/src/widgets/icons/add_reaction_icon.tsx +0 -23
- package/src/widgets/icons/admin_eye_icon.tsx +0 -30
- package/src/widgets/icons/alert_icon.tsx +0 -22
- package/src/widgets/icons/archive_icon.tsx +0 -23
- package/src/widgets/icons/arrow_right_icon.tsx +0 -23
- package/src/widgets/icons/at_icon.tsx +0 -22
- package/src/widgets/icons/attachment_icon.tsx +0 -38
- package/src/widgets/icons/back_icon.tsx +0 -22
- package/src/widgets/icons/bot_icon.tsx +0 -23
- package/src/widgets/icons/camera_icon.tsx +0 -41
- package/src/widgets/icons/checkbox_checked_icon.tsx +0 -62
- package/src/widgets/icons/checkbox_partial_icon.tsx +0 -62
- package/src/widgets/icons/close_circle_icon.tsx +0 -25
- package/src/widgets/icons/close_circle_solid_icon.tsx +0 -25
- package/src/widgets/icons/close_icon.tsx +0 -27
- package/src/widgets/icons/dots_horizontal.tsx +0 -22
- package/src/widgets/icons/download_icon.tsx +0 -46
- package/src/widgets/icons/draft_icon.tsx +0 -32
- package/src/widgets/icons/ellipsis_h_icon.tsx +0 -23
- package/src/widgets/icons/email_icon.tsx +0 -23
- package/src/widgets/icons/emoji_icon.tsx +0 -22
- package/src/widgets/icons/fa_add_icon.tsx +0 -15
- package/src/widgets/icons/fa_back_icon.tsx +0 -16
- package/src/widgets/icons/fa_dropdown_icon.tsx +0 -15
- package/src/widgets/icons/fa_edit_icon.tsx +0 -16
- package/src/widgets/icons/fa_logout_icon.tsx +0 -15
- package/src/widgets/icons/fa_next_icon.tsx +0 -28
- package/src/widgets/icons/fa_previous_icon.tsx +0 -28
- package/src/widgets/icons/fa_reload_icon.tsx +0 -16
- package/src/widgets/icons/fa_remove_icon.tsx +0 -16
- package/src/widgets/icons/fa_search_icon.tsx +0 -16
- package/src/widgets/icons/fa_select_icon.tsx +0 -16
- package/src/widgets/icons/fa_success_icon.tsx +0 -16
- package/src/widgets/icons/fa_warning_icon.tsx +0 -28
- package/src/widgets/icons/flag_icon.tsx +0 -22
- package/src/widgets/icons/flag_icon_filled.tsx +0 -41
- package/src/widgets/icons/gfycat_icon.tsx +0 -38
- package/src/widgets/icons/gif_reactions_icon.tsx +0 -52
- package/src/widgets/icons/gif_search_clear_icon.tsx +0 -27
- package/src/widgets/icons/gif_search_icon.tsx +0 -29
- package/src/widgets/icons/gif_trending_icon.tsx +0 -49
- package/src/widgets/icons/globe_icon.tsx +0 -22
- package/src/widgets/icons/icons.stories.js +0 -110
- package/src/widgets/icons/info_icon.tsx +0 -40
- package/src/widgets/icons/info_small_icon.tsx +0 -35
- package/src/widgets/icons/invite_icon.tsx +0 -22
- package/src/widgets/icons/invite_members_icon.tsx +0 -22
- package/src/widgets/icons/leave_team_icon.tsx +0 -30
- package/src/widgets/icons/link_icon.tsx +0 -23
- package/src/widgets/icons/lock_icon.tsx +0 -41
- package/src/widgets/icons/mail_icon.tsx +0 -22
- package/src/widgets/icons/mail_plus_icon.tsx +0 -22
- package/src/widgets/icons/mattermost_logo.tsx +0 -40
- package/src/widgets/icons/member_icon.tsx +0 -22
- package/src/widgets/icons/mentions_icon.tsx +0 -24
- package/src/widgets/icons/menu_icon.tsx +0 -42
- package/src/widgets/icons/message_icon.tsx +0 -42
- package/src/widgets/icons/pin_icon.tsx +0 -23
- package/src/widgets/icons/plugin_channel_header_icon.tsx +0 -23
- package/src/widgets/icons/plugin_icon.tsx +0 -44
- package/src/widgets/icons/reply_icon.tsx +0 -23
- package/src/widgets/icons/scroll_to_bottom_icon.tsx +0 -23
- package/src/widgets/icons/search_icon.tsx +0 -22
- package/src/widgets/icons/shield_outline_icon.tsx +0 -23
- package/src/widgets/icons/status_away_avatar_icon.tsx +0 -33
- package/src/widgets/icons/status_away_icon.tsx +0 -33
- package/src/widgets/icons/status_dnd_avatar_icon.tsx +0 -41
- package/src/widgets/icons/status_dnd_icon.tsx +0 -33
- package/src/widgets/icons/status_offline_avatar_icon.tsx +0 -45
- package/src/widgets/icons/status_offline_icon.tsx +0 -31
- package/src/widgets/icons/status_online_avatar_icon.tsx +0 -49
- package/src/widgets/icons/status_online_icon.tsx +0 -33
- package/src/widgets/icons/team_info_icon.tsx +0 -32
- package/src/widgets/icons/unarchive_icon.tsx +0 -22
- package/src/widgets/icons/unread_below_icon.tsx +0 -23
- package/src/widgets/icons/user_guide_icon.tsx +0 -26
- package/src/widgets/overlay_trigger.tsx +0 -59
- package/src/widgets/shared_user_indicator.tsx +0 -37
- package/src/widgets/simple_tooltip/index.ts +0 -7
- package/src/widgets/simple_tooltip/simple_tooltip.tsx +0 -63
- package/src/widgets/users/avatar/avatar.test.tsx +0 -34
- package/src/widgets/users/avatar/avatar.tsx +0 -38
- package/src/widgets/users/avatar/index.ts +0 -4
- package/src/widgets/users/avatar/style.ts +0 -79
- package/src/widgets/users/avatars/__snapshots__/avatars.test.tsx.snap +0 -1585
- package/src/widgets/users/avatars/avatars.scss +0 -64
- package/src/widgets/users/avatars/avatars.test.tsx +0 -184
- package/src/widgets/users/avatars/avatars.tsx +0 -146
- package/src/widgets/users/avatars/index.ts +0 -4
- package/src/widgets/users/users.stories.tsx +0 -37
- package/tsconfig.json +0 -14
- package/webpack.config.js +0 -58
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
// // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
2
|
-
// // See LICENSE.txt for license information.
|
|
3
|
-
|
|
4
|
-
// import thunk from 'redux-thunk';
|
|
5
|
-
// import configureStore from 'redux-mock-store';
|
|
6
|
-
|
|
7
|
-
// import {getChannelByNameAndTeamName, getChannelMember, joinChannel} from 'mattermost-redux/actions/channels';
|
|
8
|
-
// import {getUserByEmail} from 'mattermost-redux/actions/users';
|
|
9
|
-
|
|
10
|
-
// import {emitChannelClickEvent} from 'actions/global_actions';
|
|
11
|
-
// import {
|
|
12
|
-
// goToChannelByChannelName,
|
|
13
|
-
// goToDirectChannelByUserId,
|
|
14
|
-
// goToDirectChannelByUserIds,
|
|
15
|
-
// goToChannelByChannelId,
|
|
16
|
-
// goToDirectChannelByEmail,
|
|
17
|
-
// getPathFromIdentifier,
|
|
18
|
-
// } from 'components/channel_layout/channel_identifier_router/actions';
|
|
19
|
-
// import {joinPrivateChannelPrompt} from 'utils/channel_utils';
|
|
20
|
-
|
|
21
|
-
// jest.mock('actions/global_actions', () => ({
|
|
22
|
-
// emitChannelClickEvent: jest.fn(),
|
|
23
|
-
// }));
|
|
24
|
-
|
|
25
|
-
// jest.mock('mattermost-redux/actions/channels', () => ({
|
|
26
|
-
// joinChannel: jest.fn(() => ({type: '', data: {channel: {id: 'channel_id3', name: 'achannel3', team_id: 'team_id1', type: 'O'}}})),
|
|
27
|
-
// getChannelByNameAndTeamName: jest.fn(() => ({type: '', data: {id: 'channel_id3', name: 'achannel3', team_id: 'team_id1', type: 'O'}})),
|
|
28
|
-
// getChannelMember: jest.fn(() => ({type: '', error: {}})),
|
|
29
|
-
// }));
|
|
30
|
-
|
|
31
|
-
// jest.mock('mattermost-redux/actions/users', () => ({
|
|
32
|
-
// getUserByEmail: jest.fn(() => ({type: '', data: {id: 'user_id3', email: 'user3@bladekick.com', username: 'user3'}})),
|
|
33
|
-
// getUser: jest.fn(() => ({type: '', data: {id: 'user_id3', email: 'user3@bladekick.com', username: 'user3'}})),
|
|
34
|
-
// }));
|
|
35
|
-
|
|
36
|
-
// jest.mock('utils/channel_utils', () => ({
|
|
37
|
-
// joinPrivateChannelPrompt: jest.fn(() => {
|
|
38
|
-
// return async () => {
|
|
39
|
-
// return {data: {join: true}};
|
|
40
|
-
// };
|
|
41
|
-
// }),
|
|
42
|
-
// }));
|
|
43
|
-
|
|
44
|
-
// const mockStore = configureStore([thunk]);
|
|
45
|
-
|
|
46
|
-
// describe('Actions', () => {
|
|
47
|
-
// const channel1 = {id: 'channel_id1', name: 'achannel', team_id: 'team_id1'};
|
|
48
|
-
// const channel2 = {id: 'channel_id2', name: 'achannel', team_id: 'team_id2'};
|
|
49
|
-
// const channel3 = {id: 'channel_id3', name: 'achannel3', team_id: 'team_id1', type: 'O'};
|
|
50
|
-
// const channel4 = {id: 'channel_id4', name: 'additional-abilities---community-systems', team_id: 'team_id1', type: 'O'};
|
|
51
|
-
// const channel5 = {id: 'channel_id5', name: 'some-group-channel', team_id: 'team_id1', type: 'G'};
|
|
52
|
-
|
|
53
|
-
// const initialState = {
|
|
54
|
-
// entities: {
|
|
55
|
-
// channels: {
|
|
56
|
-
// currentChannelId: 'channel_id1',
|
|
57
|
-
// channels: {channel_id1: channel1, channel_id2: channel2, channel_id3: channel3, channel_id4: channel4, channel_id5: channel5},
|
|
58
|
-
// myMembers: {channel_id1: {channel_id: 'channel_id1', user_id: 'current_user_id'}, channel_id2: {channel_id: 'channel_id2', user_id: 'current_user_id'}},
|
|
59
|
-
// channelsInTeam: {team_id1: ['channel_id1'], team_id2: ['channel_id2']},
|
|
60
|
-
// },
|
|
61
|
-
// teams: {
|
|
62
|
-
// currentTeamId: 'team_id1',
|
|
63
|
-
// teams: {
|
|
64
|
-
// team_id1: {
|
|
65
|
-
// id: 'team_id1',
|
|
66
|
-
// name: 'team1',
|
|
67
|
-
// },
|
|
68
|
-
// team_id2: {
|
|
69
|
-
// id: 'team_id2',
|
|
70
|
-
// name: 'team2',
|
|
71
|
-
// },
|
|
72
|
-
// },
|
|
73
|
-
// },
|
|
74
|
-
// users: {
|
|
75
|
-
// currentUserId: 'current_user_id',
|
|
76
|
-
// profiles: {user_id2: {id: 'user_id2', username: 'user2', email: 'user2@bladekick.com'}},
|
|
77
|
-
// },
|
|
78
|
-
// general: {license: {IsLicensed: 'false'}, config: {}},
|
|
79
|
-
// preferences: {myPreferences: {}},
|
|
80
|
-
// },
|
|
81
|
-
// };
|
|
82
|
-
|
|
83
|
-
// describe('getPathFromIdentifier', () => {
|
|
84
|
-
// test('Should return channel_name if identifier is a channel name', () => {
|
|
85
|
-
// const path = getPathFromIdentifier((initialState as any), 'channels', 'channelName');
|
|
86
|
-
// expect(path).toEqual('channel_name');
|
|
87
|
-
// });
|
|
88
|
-
// test('Should return channel_id if identifier is a channel id', () => {
|
|
89
|
-
// const path = getPathFromIdentifier((initialState as any), 'channels', 'pjz4yj7jw7nzmmo3upi4htmt1y');
|
|
90
|
-
// expect(path).toEqual('channel_id');
|
|
91
|
-
// });
|
|
92
|
-
// test('Should return group_id path if identifier is a group id', () => {
|
|
93
|
-
// const path = getPathFromIdentifier((initialState as any), 'channels', '9c992e32cc7b3e5651f68b0ead4935fdf40d67ff');
|
|
94
|
-
// expect(path).toEqual('group_channel_group_id');
|
|
95
|
-
// });
|
|
96
|
-
// test('Should return group_id path if channel exists and is type G', () => {
|
|
97
|
-
// const path = getPathFromIdentifier((initialState as any), 'channels', 'some-group-channel');
|
|
98
|
-
// expect(path).toEqual('group_channel_group_id');
|
|
99
|
-
// });
|
|
100
|
-
// test('Should return group_id path if identifier is a group id', () => {
|
|
101
|
-
// const path = getPathFromIdentifier((initialState as any), 'messages', '9c992e32cc7b3e5651f68b0ead4935fdf40d67ff');
|
|
102
|
-
// expect(path).toEqual('group_channel_group_id');
|
|
103
|
-
// });
|
|
104
|
-
// test('Should return direct channel path if identifier is in the format userid__userid2', () => {
|
|
105
|
-
// const path = getPathFromIdentifier((initialState as any), 'channels', '3y8ujrgtbfn78ja5nfms3qm5jw__3y8ujrgtbfn78ja5nfms3qm5jw');
|
|
106
|
-
// expect(path).toEqual('direct_channel_user_ids');
|
|
107
|
-
// });
|
|
108
|
-
// test('Should return channel by name path if identifier looks like a group id but matching channel is an open channel', () => {
|
|
109
|
-
// const path = getPathFromIdentifier((initialState as any), 'channels', 'additional-abilities---community-systems');
|
|
110
|
-
// expect(path).toEqual('channel_name');
|
|
111
|
-
// });
|
|
112
|
-
// test('Should return channel by name path if identifier is in the format userid--userid2', () => {
|
|
113
|
-
// const path = getPathFromIdentifier((initialState as any), 'channels', '3y8ujrgtbfn78ja5nfms3qm5jw--3y8ujrgtbfn78ja5nfms3qm5jw');
|
|
114
|
-
// expect(path).toEqual('channel_name');
|
|
115
|
-
// });
|
|
116
|
-
// test('Should return direct channel by username if identifier is the username', () => {
|
|
117
|
-
// const path = getPathFromIdentifier((initialState as any), 'messages', '@user1');
|
|
118
|
-
// expect(path).toEqual('direct_channel_username');
|
|
119
|
-
// });
|
|
120
|
-
// test('Should return direct channel by email if identifier is the user email', () => {
|
|
121
|
-
// const path = getPathFromIdentifier((initialState as any), 'messages', 'user1@bladekick.com');
|
|
122
|
-
// expect(path).toEqual('direct_channel_email');
|
|
123
|
-
// });
|
|
124
|
-
// test('Should return direct channel by id if identifier is the user id', () => {
|
|
125
|
-
// const path = getPathFromIdentifier((initialState as any), 'messages', '3y8ujrgtbfn78ja5nfms3qm5jw');
|
|
126
|
-
// expect(path).toEqual('direct_channel_user_id');
|
|
127
|
-
// });
|
|
128
|
-
// test('Should return error in case the path is not right', () => {
|
|
129
|
-
// const path = getPathFromIdentifier((initialState as any), 'messages', 'test');
|
|
130
|
-
// expect(path).toEqual('error');
|
|
131
|
-
// });
|
|
132
|
-
// });
|
|
133
|
-
|
|
134
|
-
// describe('goToChannelByChannelId', () => {
|
|
135
|
-
// test('switch to public channel we have locally but need to join', async () => {
|
|
136
|
-
// const testStore = await mockStore(initialState);
|
|
137
|
-
// const history = {replace: jest.fn()};
|
|
138
|
-
|
|
139
|
-
// await testStore.dispatch((goToChannelByChannelId({params: {team: 'team1', identifier: 'channel_id3', path: '/'}, url: ''}, history as any) as any));
|
|
140
|
-
// expect(joinChannel).toHaveBeenCalledWith('current_user_id', 'team_id1', 'channel_id3', '');
|
|
141
|
-
// expect(history.replace).toHaveBeenCalledWith('/team1/channels/achannel3');
|
|
142
|
-
// });
|
|
143
|
-
// });
|
|
144
|
-
|
|
145
|
-
// describe('goToChannelByChannelName', () => {
|
|
146
|
-
// test('switch to channel on different team with same name', async () => {
|
|
147
|
-
// const testStore = await mockStore(initialState);
|
|
148
|
-
|
|
149
|
-
// await testStore.dispatch((goToChannelByChannelName({params: {team: 'team2', identifier: 'achannel', path: '/'}, url: ''}, {} as any) as any));
|
|
150
|
-
// expect(emitChannelClickEvent).toHaveBeenCalledWith(channel2);
|
|
151
|
-
// });
|
|
152
|
-
|
|
153
|
-
// test('switch to public channel we have locally but need to join', async () => {
|
|
154
|
-
// const testStore = await mockStore(initialState);
|
|
155
|
-
|
|
156
|
-
// await testStore.dispatch((goToChannelByChannelName({params: {team: 'team1', identifier: 'achannel3', path: '/'}, url: ''}, {} as any) as any));
|
|
157
|
-
// expect(joinChannel).toHaveBeenCalledWith('current_user_id', 'team_id1', '', 'achannel3');
|
|
158
|
-
// expect(emitChannelClickEvent).toHaveBeenCalledWith(channel3);
|
|
159
|
-
// });
|
|
160
|
-
|
|
161
|
-
// test('switch to private channel we don\'t have locally and get prompted if super user and then join', async () => {
|
|
162
|
-
// const testStore = await mockStore({
|
|
163
|
-
// ...initialState,
|
|
164
|
-
// entities: {
|
|
165
|
-
// ...initialState.entities,
|
|
166
|
-
// users: {
|
|
167
|
-
// ...initialState.entities.users,
|
|
168
|
-
// profiles: {
|
|
169
|
-
// ...initialState.entities.users.profiles,
|
|
170
|
-
// current_user_id: {
|
|
171
|
-
// roles: 'system_admin',
|
|
172
|
-
// },
|
|
173
|
-
// },
|
|
174
|
-
// },
|
|
175
|
-
// },
|
|
176
|
-
// });
|
|
177
|
-
// const channel = {id: 'channel_id6', name: 'achannel6', team_id: 'team_id1', type: 'P'};
|
|
178
|
-
// (joinChannel as jest.Mock).mockReturnValueOnce({type: '', data: {channel}});
|
|
179
|
-
// (getChannelByNameAndTeamName as jest.Mock).mockReturnValueOnce({type: '', data: channel});
|
|
180
|
-
// await testStore.dispatch((goToChannelByChannelName({params: {team: 'team1', identifier: channel.name, path: '/'}, url: ''}, {} as any) as any));
|
|
181
|
-
// expect(getChannelByNameAndTeamName).toHaveBeenCalledWith('team1', channel.name, true);
|
|
182
|
-
// expect(getChannelMember).toHaveBeenCalledWith(channel.id, 'current_user_id');
|
|
183
|
-
// expect(joinPrivateChannelPrompt).toHaveBeenCalled();
|
|
184
|
-
// expect(joinChannel).toHaveBeenCalledWith('current_user_id', 'team_id1', '', channel.name);
|
|
185
|
-
// });
|
|
186
|
-
// });
|
|
187
|
-
|
|
188
|
-
// describe('goToDirectChannelByUserId', () => {
|
|
189
|
-
// test('switch to a direct channel by user id on the same team', async () => {
|
|
190
|
-
// const testStore = await mockStore(initialState);
|
|
191
|
-
// const history = {replace: jest.fn()};
|
|
192
|
-
|
|
193
|
-
// await testStore.dispatch((goToDirectChannelByUserId({params: {team: 'team1', identifier: 'channel', path: '/'}, url: ''}, history as any, 'user_id2') as any));
|
|
194
|
-
// expect(history.replace).toHaveBeenCalledWith('/team1/messages/@user2');
|
|
195
|
-
// });
|
|
196
|
-
|
|
197
|
-
// test('switch to a direct channel by user id on different team', async () => {
|
|
198
|
-
// const testStore = await mockStore(initialState);
|
|
199
|
-
// const history = {replace: jest.fn()};
|
|
200
|
-
|
|
201
|
-
// await testStore.dispatch((goToDirectChannelByUserId({params: {team: 'team2', identifier: 'channel', path: '/'}, url: ''}, history as any, 'user_id2') as any));
|
|
202
|
-
// expect(history.replace).toHaveBeenCalledWith('/team2/messages/@user2');
|
|
203
|
-
// });
|
|
204
|
-
// });
|
|
205
|
-
|
|
206
|
-
// describe('goToDirectChannelByUserIds', () => {
|
|
207
|
-
// test('switch to a direct channel by name on the same team', async () => {
|
|
208
|
-
// const testStore = await mockStore(initialState);
|
|
209
|
-
// const history = {replace: jest.fn()};
|
|
210
|
-
|
|
211
|
-
// await testStore.dispatch((goToDirectChannelByUserIds({params: {team: 'team1', identifier: 'current_user_id__user_id2', path: '/'}, url: ''}, history as any) as any));
|
|
212
|
-
// expect(history.replace).toHaveBeenCalledWith('/team1/messages/@user2');
|
|
213
|
-
// });
|
|
214
|
-
|
|
215
|
-
// test('switch to a direct channel by name on different team', async () => {
|
|
216
|
-
// const testStore = await mockStore(initialState);
|
|
217
|
-
// const history = {replace: jest.fn()};
|
|
218
|
-
|
|
219
|
-
// await testStore.dispatch((goToDirectChannelByUserIds({params: {team: 'team2', identifier: 'current_user_id__user_id2', path: '/'}, url: ''}, history as any) as any));
|
|
220
|
-
// expect(history.replace).toHaveBeenCalledWith('/team2/messages/@user2');
|
|
221
|
-
// });
|
|
222
|
-
// });
|
|
223
|
-
|
|
224
|
-
// describe('goToDirectChannelByEmail', () => {
|
|
225
|
-
// test('switch to a direct channel by email with user already existing locally', async () => {
|
|
226
|
-
// const testStore = await mockStore(initialState);
|
|
227
|
-
// const history = {replace: jest.fn()};
|
|
228
|
-
|
|
229
|
-
// await testStore.dispatch((goToDirectChannelByEmail({params: {team: 'team1', identifier: 'user2@bladekick.com', path: '/'}, url: ''}, history as any) as any));
|
|
230
|
-
// expect(getUserByEmail).not.toHaveBeenCalled();
|
|
231
|
-
// expect(history.replace).toHaveBeenCalledWith('/team1/messages/@user2');
|
|
232
|
-
// });
|
|
233
|
-
|
|
234
|
-
// test('switch to a direct channel by email with user not existing locally', async () => {
|
|
235
|
-
// const testStore = await mockStore(initialState);
|
|
236
|
-
// const history = {replace: jest.fn()};
|
|
237
|
-
|
|
238
|
-
// await testStore.dispatch((goToDirectChannelByEmail({params: {team: 'team1', identifier: 'user3@bladekick.com', path: '/'}, url: ''}, history as any) as any));
|
|
239
|
-
// expect(getUserByEmail).toHaveBeenCalledWith('user3@bladekick.com');
|
|
240
|
-
// expect(history.replace).toHaveBeenCalledWith('/team1/messages/@user3');
|
|
241
|
-
// });
|
|
242
|
-
// });
|
|
243
|
-
// });
|
|
@@ -1,353 +0,0 @@
|
|
|
1
|
-
// // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
2
|
-
// // See LICENSE.txt for license information.
|
|
3
|
-
|
|
4
|
-
// import {History} from 'history';
|
|
5
|
-
|
|
6
|
-
// import {joinChannel, getChannelByNameAndTeamName, getChannelMember, markGroupChannelOpen, fetchMyChannelsAndMembers} from 'mattermost-redux/actions/channels';
|
|
7
|
-
// import {getUser, getUserByUsername, getUserByEmail} from 'mattermost-redux/actions/users';
|
|
8
|
-
// import {getTeamByName} from 'mattermost-redux/selectors/entities/teams';
|
|
9
|
-
// import {getCurrentUser, getCurrentUserId, getUserByUsername as selectUserByUsername, getUser as selectUser, getUserByEmail as selectUserByEmail} from 'mattermost-redux/selectors/entities/users';
|
|
10
|
-
// import {getChannelByName, getOtherChannels, getChannel, getChannelsNameMapInTeam, getRedirectChannelNameForTeam} from 'mattermost-redux/selectors/entities/channels';
|
|
11
|
-
// import {GetStateFunc, DispatchFunc, ActionFunc} from 'mattermost-redux/types/actions';
|
|
12
|
-
// import {GlobalState} from 'mattermost-redux/types/store';
|
|
13
|
-
// import {Channel} from 'mattermost-redux/types/channels';
|
|
14
|
-
|
|
15
|
-
// import {openDirectChannelToUserId} from 'actions/channel_actions';
|
|
16
|
-
// import * as GlobalActions from 'actions/global_actions';
|
|
17
|
-
// import {joinPrivateChannelPrompt} from 'utils/channel_utils';
|
|
18
|
-
// import {Constants} from 'utils/constants';
|
|
19
|
-
// import * as Utils from 'utils/utils.jsx';
|
|
20
|
-
|
|
21
|
-
// import {Match, MatchAndHistory} from './channel_identifier_router';
|
|
22
|
-
|
|
23
|
-
// const LENGTH_OF_ID = 26;
|
|
24
|
-
// const LENGTH_OF_GROUP_ID = 40;
|
|
25
|
-
// const LENGTH_OF_USER_ID_PAIR = 54;
|
|
26
|
-
// const USER_ID_PAIR_REGEXP = new RegExp(`^[a-zA-Z0-9]{${LENGTH_OF_ID}}__[a-zA-Z0-9]{${LENGTH_OF_ID}}$`);
|
|
27
|
-
|
|
28
|
-
// export function onChannelByIdentifierEnter({match, history}: MatchAndHistory): ActionFunc {
|
|
29
|
-
// return async (dispatch: DispatchFunc, getState: GetStateFunc) => {
|
|
30
|
-
// const state = getState();
|
|
31
|
-
// const {path, identifier, team} = match.params;
|
|
32
|
-
|
|
33
|
-
// if (!identifier) {
|
|
34
|
-
// return {data: undefined};
|
|
35
|
-
// }
|
|
36
|
-
|
|
37
|
-
// const teamObj = getTeamByName(state, team);
|
|
38
|
-
// if (!teamObj) {
|
|
39
|
-
// return {data: undefined};
|
|
40
|
-
// }
|
|
41
|
-
|
|
42
|
-
// const channelPath = getPathFromIdentifier(state, path, identifier);
|
|
43
|
-
|
|
44
|
-
// switch (channelPath) {
|
|
45
|
-
// case 'channel_name':
|
|
46
|
-
// dispatch(goToChannelByChannelName(match, history));
|
|
47
|
-
// break;
|
|
48
|
-
// case 'channel_id':
|
|
49
|
-
// dispatch(goToChannelByChannelId(match, history));
|
|
50
|
-
// break;
|
|
51
|
-
// case 'group_channel_group_id':
|
|
52
|
-
// dispatch(goToGroupChannelByGroupId(match, history));
|
|
53
|
-
// break;
|
|
54
|
-
// case 'direct_channel_username':
|
|
55
|
-
// dispatch(goToDirectChannelByUsername(match, history));
|
|
56
|
-
// break;
|
|
57
|
-
// case 'direct_channel_email':
|
|
58
|
-
// dispatch(goToDirectChannelByEmail(match, history));
|
|
59
|
-
// break;
|
|
60
|
-
// case 'direct_channel_user_ids':
|
|
61
|
-
// dispatch(goToDirectChannelByUserIds(match, history));
|
|
62
|
-
// break;
|
|
63
|
-
// case 'direct_channel_user_id':
|
|
64
|
-
// dispatch(goToDirectChannelByUserId(match, history, identifier));
|
|
65
|
-
// break;
|
|
66
|
-
// case 'error':
|
|
67
|
-
// await dispatch(fetchMyChannelsAndMembers(teamObj!.id));
|
|
68
|
-
// handleError(match, history, getRedirectChannelNameForTeam(state, teamObj!.id));
|
|
69
|
-
// break;
|
|
70
|
-
// }
|
|
71
|
-
// return {data: undefined};
|
|
72
|
-
// };
|
|
73
|
-
// }
|
|
74
|
-
|
|
75
|
-
// export function getPathFromIdentifier(state: GlobalState, path: string, identifier: string) {
|
|
76
|
-
// if (path === 'channels') {
|
|
77
|
-
// // It's hard to tell an ID apart from a channel name of the same length, so check first if
|
|
78
|
-
// // the identifier matches a channel that we have
|
|
79
|
-
// const channelsByName = getChannelByName(state, identifier);
|
|
80
|
-
// const moreChannelsByName = getOtherChannels(state).find((chan) => chan.name === identifier);
|
|
81
|
-
|
|
82
|
-
// if (identifier.length === LENGTH_OF_ID) {
|
|
83
|
-
// return channelsByName || moreChannelsByName ? 'channel_name' : 'channel_id';
|
|
84
|
-
// } else if (
|
|
85
|
-
// (!channelsByName && !moreChannelsByName && identifier.length === LENGTH_OF_GROUP_ID) ||
|
|
86
|
-
// (
|
|
87
|
-
// (channelsByName && channelsByName.type === Constants.GM_CHANNEL) ||
|
|
88
|
-
// (moreChannelsByName && moreChannelsByName.type === Constants.GM_CHANNEL)
|
|
89
|
-
// )
|
|
90
|
-
// ) {
|
|
91
|
-
// return 'group_channel_group_id';
|
|
92
|
-
// } else if (isDirectChannelIdentifier(identifier)) {
|
|
93
|
-
// return 'direct_channel_user_ids';
|
|
94
|
-
// }
|
|
95
|
-
// return 'channel_name';
|
|
96
|
-
// } else if (path === 'messages') {
|
|
97
|
-
// if (identifier.indexOf('@') === 0) {
|
|
98
|
-
// return 'direct_channel_username';
|
|
99
|
-
// } else if (identifier.indexOf('@') > 0) {
|
|
100
|
-
// return 'direct_channel_email';
|
|
101
|
-
// } else if (identifier.length === LENGTH_OF_ID) {
|
|
102
|
-
// return 'direct_channel_user_id';
|
|
103
|
-
// } else if (identifier.length === LENGTH_OF_GROUP_ID) {
|
|
104
|
-
// return 'group_channel_group_id';
|
|
105
|
-
// }
|
|
106
|
-
// return 'error';
|
|
107
|
-
// }
|
|
108
|
-
|
|
109
|
-
// return 'error';
|
|
110
|
-
// }
|
|
111
|
-
|
|
112
|
-
// export function goToChannelByChannelId(match: Match, history: History): ActionFunc {
|
|
113
|
-
// return async (dispatch: DispatchFunc, getState: GetStateFunc) => {
|
|
114
|
-
// const state = getState();
|
|
115
|
-
// const {team, identifier} = match.params;
|
|
116
|
-
// const channelId = identifier.toLowerCase();
|
|
117
|
-
|
|
118
|
-
// let channel = getChannel(state, channelId);
|
|
119
|
-
// const member = state.entities.channels.myMembers[channelId];
|
|
120
|
-
// const teamObj = getTeamByName(state, team);
|
|
121
|
-
// if (!channel || !member) {
|
|
122
|
-
// const dispatchResult = await dispatch(joinChannel(getCurrentUserId(state), teamObj!.id, channelId, ''));
|
|
123
|
-
// if ('error' in dispatchResult) {
|
|
124
|
-
// await dispatch(fetchMyChannelsAndMembers(teamObj!.id));
|
|
125
|
-
// handleChannelJoinError(match, history, getRedirectChannelNameForTeam(state, teamObj!.id));
|
|
126
|
-
// return {data: undefined};
|
|
127
|
-
// }
|
|
128
|
-
// channel = dispatchResult.data.channel;
|
|
129
|
-
// }
|
|
130
|
-
|
|
131
|
-
// if (channel.type === Constants.DM_CHANNEL) {
|
|
132
|
-
// dispatch(goToDirectChannelByUserId(match, history, Utils.getUserIdFromChannelId(channel.name, getCurrentUserId(state))));
|
|
133
|
-
// } else if (channel.type === Constants.GM_CHANNEL) {
|
|
134
|
-
// history.replace(`/${team}/messages/${channel.name}`);
|
|
135
|
-
// } else {
|
|
136
|
-
// history.replace(`/${team}/channels/${channel.name}`);
|
|
137
|
-
// }
|
|
138
|
-
// return {data: undefined};
|
|
139
|
-
// };
|
|
140
|
-
// }
|
|
141
|
-
|
|
142
|
-
// export function goToChannelByChannelName(match: Match, history: History): ActionFunc {
|
|
143
|
-
// return async (dispatch: DispatchFunc, getState: GetStateFunc) => {
|
|
144
|
-
// const state = getState();
|
|
145
|
-
// const {team, identifier} = match.params;
|
|
146
|
-
// const channelName = identifier.toLowerCase();
|
|
147
|
-
|
|
148
|
-
// const teamObj = getTeamByName(state, team);
|
|
149
|
-
// if (!teamObj) {
|
|
150
|
-
// return {data: undefined};
|
|
151
|
-
// }
|
|
152
|
-
|
|
153
|
-
// let channel = getChannelsNameMapInTeam(state, teamObj!.id)[channelName];
|
|
154
|
-
// if (!channel) {
|
|
155
|
-
// const getChannelDispatchResult = await dispatch(getChannelByNameAndTeamName(team, channelName, true));
|
|
156
|
-
// if ('data' in getChannelDispatchResult) {
|
|
157
|
-
// channel = getChannelDispatchResult.data;
|
|
158
|
-
// }
|
|
159
|
-
// }
|
|
160
|
-
|
|
161
|
-
// let member;
|
|
162
|
-
// if (channel) {
|
|
163
|
-
// member = state.entities.channels.myMembers[channel.id];
|
|
164
|
-
// if (!member) {
|
|
165
|
-
// const membership = await dispatch(getChannelMember(channel.id, getCurrentUserId(state)));
|
|
166
|
-
// if ('data' in membership) {
|
|
167
|
-
// member = membership.data;
|
|
168
|
-
// }
|
|
169
|
-
// }
|
|
170
|
-
// }
|
|
171
|
-
|
|
172
|
-
// if (!channel || !member) {
|
|
173
|
-
// // Prompt system admin before joining the private channel
|
|
174
|
-
// const user = getCurrentUser(getState());
|
|
175
|
-
// const isSystemAdmin = Utils.isSystemAdmin(user?.roles);
|
|
176
|
-
// if (isSystemAdmin) {
|
|
177
|
-
// if (channel?.type === Constants.PRIVATE_CHANNEL) {
|
|
178
|
-
// const joinPromptResult = await dispatch(joinPrivateChannelPrompt(teamObj, channel));
|
|
179
|
-
// if ('data' in joinPromptResult && !joinPromptResult.data.join) {
|
|
180
|
-
// return {data: undefined};
|
|
181
|
-
// }
|
|
182
|
-
// }
|
|
183
|
-
// }
|
|
184
|
-
|
|
185
|
-
// const joinChannelDispatchResult = await dispatch(joinChannel(getCurrentUserId(state), teamObj!.id, '', channelName));
|
|
186
|
-
// if ('error' in joinChannelDispatchResult) {
|
|
187
|
-
// if (!channel) {
|
|
188
|
-
// const getChannelDispatchResult = await dispatch(getChannelByNameAndTeamName(team, channelName, true));
|
|
189
|
-
// if ('error' in getChannelDispatchResult || getChannelDispatchResult.data.delete_at === 0) {
|
|
190
|
-
// await dispatch(fetchMyChannelsAndMembers(teamObj!.id));
|
|
191
|
-
// handleChannelJoinError(match, history, getRedirectChannelNameForTeam(state, teamObj!.id));
|
|
192
|
-
// return {data: undefined};
|
|
193
|
-
// }
|
|
194
|
-
// channel = getChannelDispatchResult.data;
|
|
195
|
-
// }
|
|
196
|
-
// } else {
|
|
197
|
-
// channel = joinChannelDispatchResult.data.channel;
|
|
198
|
-
// }
|
|
199
|
-
// }
|
|
200
|
-
|
|
201
|
-
// if (channel.type === Constants.DM_CHANNEL) {
|
|
202
|
-
// dispatch(goToDirectChannelByUserIds(match, history));
|
|
203
|
-
// } else if (channel.type === Constants.GM_CHANNEL) {
|
|
204
|
-
// history.replace(`/${team}/messages/${channel.name}`);
|
|
205
|
-
// } else {
|
|
206
|
-
// doChannelChange(channel);
|
|
207
|
-
// }
|
|
208
|
-
// return {data: undefined};
|
|
209
|
-
// };
|
|
210
|
-
// }
|
|
211
|
-
|
|
212
|
-
// function goToDirectChannelByUsername(match: Match, history: History): ActionFunc {
|
|
213
|
-
// return async (dispatch: DispatchFunc, getState: GetStateFunc) => {
|
|
214
|
-
// const state = getState();
|
|
215
|
-
// const {team, identifier} = match.params;
|
|
216
|
-
// const username = identifier.slice(1, identifier.length).toLowerCase();
|
|
217
|
-
// const teamObj = getTeamByName(state, team);
|
|
218
|
-
|
|
219
|
-
// let user = selectUserByUsername(state, username);
|
|
220
|
-
// if (!user) {
|
|
221
|
-
// const dispatchResult = await dispatch(getUserByUsername(username));
|
|
222
|
-
// if ('error' in dispatchResult) {
|
|
223
|
-
// await dispatch(fetchMyChannelsAndMembers(teamObj!.id));
|
|
224
|
-
// handleError(match, history, getRedirectChannelNameForTeam(state, teamObj!.id));
|
|
225
|
-
// return {data: undefined};
|
|
226
|
-
// }
|
|
227
|
-
// user = dispatchResult.data;
|
|
228
|
-
// }
|
|
229
|
-
|
|
230
|
-
// const directChannelDispatchRes = await dispatch(openDirectChannelToUserId(user.id));
|
|
231
|
-
// if ('error' in directChannelDispatchRes) {
|
|
232
|
-
// await dispatch(fetchMyChannelsAndMembers(teamObj!.id));
|
|
233
|
-
// handleError(match, history, getRedirectChannelNameForTeam(state, teamObj!.id));
|
|
234
|
-
// return {data: undefined};
|
|
235
|
-
// }
|
|
236
|
-
|
|
237
|
-
// doChannelChange(directChannelDispatchRes.data);
|
|
238
|
-
// return {data: undefined};
|
|
239
|
-
// };
|
|
240
|
-
// }
|
|
241
|
-
|
|
242
|
-
// export function goToDirectChannelByUserId(match: Match, history: History, userId: string): ActionFunc {
|
|
243
|
-
// return async (dispatch: DispatchFunc, getState: GetStateFunc) => {
|
|
244
|
-
// const state = getState();
|
|
245
|
-
// const {team} = match.params;
|
|
246
|
-
// const teamObj = getTeamByName(state, team);
|
|
247
|
-
|
|
248
|
-
// let user = selectUser(state, userId);
|
|
249
|
-
// if (!user) {
|
|
250
|
-
// const dispatchResult = await dispatch(getUser(userId));
|
|
251
|
-
// if ('error' in dispatchResult) {
|
|
252
|
-
// await dispatch(fetchMyChannelsAndMembers(teamObj!.id));
|
|
253
|
-
// handleError(match, history, getRedirectChannelNameForTeam(state, teamObj!.id));
|
|
254
|
-
// return {data: undefined};
|
|
255
|
-
// }
|
|
256
|
-
// user = dispatchResult.data;
|
|
257
|
-
// }
|
|
258
|
-
|
|
259
|
-
// history.replace(`/${team}/messages/@${user.username}`);
|
|
260
|
-
// return {data: undefined};
|
|
261
|
-
// };
|
|
262
|
-
// }
|
|
263
|
-
|
|
264
|
-
// export function goToDirectChannelByUserIds(match: Match, history: History): ActionFunc {
|
|
265
|
-
// return async (dispatch: DispatchFunc, getState: GetStateFunc) => {
|
|
266
|
-
// const state = getState();
|
|
267
|
-
// const {team, identifier} = match.params;
|
|
268
|
-
// const userId = Utils.getUserIdFromChannelId(identifier.toLowerCase(), getCurrentUserId(getState()));
|
|
269
|
-
// const teamObj = getTeamByName(state, team);
|
|
270
|
-
|
|
271
|
-
// let user = selectUser(state, userId);
|
|
272
|
-
// if (!user) {
|
|
273
|
-
// const dispatchResult = await dispatch(getUser(userId));
|
|
274
|
-
// if ('error' in dispatchResult) {
|
|
275
|
-
// await dispatch(fetchMyChannelsAndMembers(teamObj!.id));
|
|
276
|
-
// handleError(match, history, getRedirectChannelNameForTeam(state, teamObj!.id));
|
|
277
|
-
// return {data: undefined};
|
|
278
|
-
// }
|
|
279
|
-
// user = dispatchResult.data;
|
|
280
|
-
// }
|
|
281
|
-
|
|
282
|
-
// history.replace(`/${team}/messages/@${user.username}`);
|
|
283
|
-
// return {data: undefined};
|
|
284
|
-
// };
|
|
285
|
-
// }
|
|
286
|
-
|
|
287
|
-
// export function goToDirectChannelByEmail(match: Match, history: History): ActionFunc {
|
|
288
|
-
// return async (dispatch: DispatchFunc, getState: GetStateFunc) => {
|
|
289
|
-
// const state = getState();
|
|
290
|
-
// const {team, identifier} = match.params;
|
|
291
|
-
// const email = identifier.toLowerCase();
|
|
292
|
-
// const teamObj = getTeamByName(state, team);
|
|
293
|
-
|
|
294
|
-
// let user = selectUserByEmail(state, email);
|
|
295
|
-
// if (!user) {
|
|
296
|
-
// const dispatchResult = await dispatch(getUserByEmail(email));
|
|
297
|
-
// if ('error' in dispatchResult) {
|
|
298
|
-
// await dispatch(fetchMyChannelsAndMembers(teamObj!.id));
|
|
299
|
-
// handleError(match, history, getRedirectChannelNameForTeam(state, teamObj!.id));
|
|
300
|
-
// return {data: undefined};
|
|
301
|
-
// }
|
|
302
|
-
// user = dispatchResult.data;
|
|
303
|
-
// }
|
|
304
|
-
|
|
305
|
-
// history.replace(`/${team}/messages/@${user.username}`);
|
|
306
|
-
// return {data: undefined};
|
|
307
|
-
// };
|
|
308
|
-
// }
|
|
309
|
-
|
|
310
|
-
// function goToGroupChannelByGroupId(match: Match, history: History): ActionFunc {
|
|
311
|
-
// return async (dispatch: DispatchFunc, getState: GetStateFunc) => {
|
|
312
|
-
// const state = getState();
|
|
313
|
-
// const {identifier, team} = match.params;
|
|
314
|
-
// const groupId = identifier.toLowerCase();
|
|
315
|
-
|
|
316
|
-
// history.replace(match.url.replace('/channels/', '/messages/'));
|
|
317
|
-
|
|
318
|
-
// let channel = getChannelByName(state, groupId);
|
|
319
|
-
// const teamObj = getTeamByName(state, team);
|
|
320
|
-
// if (!channel) {
|
|
321
|
-
// const dispatchResult = await dispatch(joinChannel(getCurrentUserId(state), teamObj!.id, '', groupId));
|
|
322
|
-
// if ('error' in dispatchResult) {
|
|
323
|
-
// await dispatch(fetchMyChannelsAndMembers(teamObj!.id));
|
|
324
|
-
// handleError(match, history, getRedirectChannelNameForTeam(state, teamObj!.id));
|
|
325
|
-
// return {data: undefined};
|
|
326
|
-
// }
|
|
327
|
-
// channel = dispatchResult.data.channel;
|
|
328
|
-
// }
|
|
329
|
-
|
|
330
|
-
// dispatch(markGroupChannelOpen(channel!.id));
|
|
331
|
-
|
|
332
|
-
// doChannelChange(channel!);
|
|
333
|
-
// return {data: undefined};
|
|
334
|
-
// };
|
|
335
|
-
// }
|
|
336
|
-
|
|
337
|
-
// function doChannelChange(channel: Channel) {
|
|
338
|
-
// GlobalActions.emitChannelClickEvent(channel);
|
|
339
|
-
// }
|
|
340
|
-
|
|
341
|
-
// function handleError(match: Match, history: History, defaultChannel: string) {
|
|
342
|
-
// const {team} = match.params;
|
|
343
|
-
// history.push(team ? `/${team}/channels/${defaultChannel}` : '/');
|
|
344
|
-
// }
|
|
345
|
-
|
|
346
|
-
// function isDirectChannelIdentifier(identifier: string) {
|
|
347
|
-
// return identifier.length === LENGTH_OF_USER_ID_PAIR && USER_ID_PAIR_REGEXP.test(identifier);
|
|
348
|
-
// }
|
|
349
|
-
|
|
350
|
-
// async function handleChannelJoinError(match: Match, history: History, defaultChannel: string) {
|
|
351
|
-
// const {team} = match.params;
|
|
352
|
-
// history.push(team ? `/error?type=channel_not_found&returnTo=/${team}/channels/${defaultChannel}` : '/');
|
|
353
|
-
// }
|