From d13429aa920ba923e29aa3237d244aa6db97caab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Espino=20Garc=C3=ADa?= Date: Wed, 6 Sep 2023 12:51:55 +0200 Subject: [PATCH] Enable import order (#24091) * Enable import order * Add new order groups and add consistent-type-imports * Remove types group, move react to top and fix issues * Add store and reducers to the redux group and move imports from types folder to the end * Fix tsc * Remove react rule * Fix test * Fix eslint disable --- webapp/channels/.eslintrc.json | 48 +++++-- webapp/channels/src/actions/admin_actions.jsx | 10 +- webapp/channels/src/actions/apps.ts | 20 ++- .../src/actions/channel_actions.test.ts | 17 +-- .../channels/src/actions/channel_actions.ts | 29 ++-- .../channels/src/actions/channel_queries.ts | 8 +- webapp/channels/src/actions/cloud.tsx | 16 ++- webapp/channels/src/actions/command.test.js | 11 +- webapp/channels/src/actions/command.ts | 50 ++++--- webapp/channels/src/actions/emoji_actions.js | 3 +- .../src/actions/emoji_actions.test.js | 5 +- webapp/channels/src/actions/file_actions.ts | 16 +-- .../src/actions/global_actions.test.ts | 10 +- .../channels/src/actions/global_actions.tsx | 40 +++--- webapp/channels/src/actions/hooks.test.js | 1 + .../channels/src/actions/hosted_customer.tsx | 19 +-- .../src/actions/integration_actions.jsx | 2 +- .../src/actions/integration_actions.test.js | 4 +- .../src/actions/invite_actions.test.ts | 9 +- webapp/channels/src/actions/invite_actions.ts | 17 +-- webapp/channels/src/actions/marketplace.ts | 25 ++-- webapp/channels/src/actions/new_post.test.ts | 11 +- webapp/channels/src/actions/new_post.ts | 21 ++- .../src/actions/notification_actions.jsx | 7 +- .../src/actions/notification_actions.test.js | 1 - .../channels/src/actions/post_actions.test.ts | 9 +- webapp/channels/src/actions/post_actions.ts | 25 ++-- .../src/actions/status_actions.test.ts | 7 +- webapp/channels/src/actions/status_actions.ts | 8 +- webapp/channels/src/actions/storage.ts | 2 +- .../channels/src/actions/team_actions.test.ts | 3 +- webapp/channels/src/actions/team_actions.ts | 14 +- .../src/actions/telemetry_actions.jsx | 1 - .../channels/src/actions/user_actions.test.ts | 14 +- webapp/channels/src/actions/user_actions.ts | 15 +- webapp/channels/src/actions/views/browser.ts | 2 +- .../src/actions/views/channel.test.js | 7 +- webapp/channels/src/actions/views/channel.ts | 23 ++-- .../src/actions/views/channel_sidebar.test.ts | 2 +- .../src/actions/views/channel_sidebar.ts | 6 +- .../src/actions/views/create_comment.test.jsx | 10 +- .../src/actions/views/create_comment.tsx | 31 +++-- .../channels/src/actions/views/drafts.test.ts | 15 +- webapp/channels/src/actions/views/drafts.ts | 29 ++-- webapp/channels/src/actions/views/group.js | 8 +- webapp/channels/src/actions/views/lhs.test.ts | 12 +- webapp/channels/src/actions/views/lhs.ts | 12 +- .../channels/src/actions/views/login.test.ts | 4 +- webapp/channels/src/actions/views/login.ts | 6 +- webapp/channels/src/actions/views/mfa.test.js | 1 + .../src/actions/views/modals.test.jsx | 3 +- webapp/channels/src/actions/views/modals.ts | 4 +- .../src/actions/views/onboarding_tasks.ts | 17 ++- webapp/channels/src/actions/views/posts.js | 18 +-- .../src/actions/views/profile_popover.ts | 5 +- webapp/channels/src/actions/views/rhs.test.ts | 22 +-- webapp/channels/src/actions/views/rhs.ts | 27 ++-- .../channels/src/actions/views/root.test.ts | 2 +- webapp/channels/src/actions/views/root.ts | 12 +- webapp/channels/src/actions/views/textbox.js | 2 +- .../src/actions/websocket_actions.jsx | 107 +++++++-------- .../src/actions/websocket_actions.test.jsx | 11 +- .../about_build_modal.test.tsx | 3 +- .../about_build_modal/about_build_modal.tsx | 11 +- .../about_build_modal_cloud.tsx | 7 +- .../src/components/about_build_modal/index.ts | 2 +- .../access_history_modal.test.tsx | 5 +- .../access_history_modal.tsx | 3 +- .../components/access_history_modal/index.ts | 7 +- .../actions_menu/actions_menu.test.tsx | 9 +- .../components/actions_menu/actions_menu.tsx | 40 +++--- .../actions_menu/actions_menu_empty.test.tsx | 4 +- .../actions_menu/actions_menu_mobile.test.tsx | 4 +- .../src/components/actions_menu/index.ts | 43 +++--- .../src/components/actions_menu/selectors.ts | 7 +- .../activity_log_modal.test.tsx | 7 +- .../activity_log_modal/activity_log_modal.tsx | 5 +- .../components/activity_log.test.tsx | 5 +- .../components/activity_log.tsx | 7 +- .../components/more_info.test.tsx | 3 +- .../components/more_info.tsx | 2 +- .../components/activity_log_modal/index.ts | 11 +- .../add_groups_to_channel_modal.test.tsx | 5 +- .../add_groups_to_channel_modal.tsx | 15 +- .../add_groups_to_channel_modal/index.ts | 19 +-- .../add_groups_to_team_modal.test.tsx | 2 +- .../add_groups_to_team_modal.tsx | 17 ++- .../add_groups_to_team_modal/index.ts | 16 ++- .../add_user_to_channel_modal.test.tsx | 3 +- .../add_user_to_channel_modal.tsx | 19 +-- .../add_user_to_channel_modal/index.ts | 13 +- .../add_user_to_group_multiselect.test.tsx | 9 +- .../add_user_to_group_multiselect.tsx | 12 +- .../add_user_to_group_multiselect/index.ts | 14 +- .../multiselect_option/multiselect_option.tsx | 16 +-- .../add_users_to_group_modal.test.tsx | 3 +- .../add_users_to_group_modal.tsx | 20 +-- .../add_users_to_group_modal/index.ts | 13 +- .../add_users_to_team_modal.test.tsx | 6 +- .../add_users_to_team_modal.tsx | 20 +-- .../add_users_to_team_modal/index.ts | 12 +- .../admin_button_outline.test.tsx | 2 +- .../admin_button_outline.tsx | 2 +- .../admin_console/admin_console.tsx | 22 +-- .../admin_console/admin_definition.jsx | 95 +++++++------ .../admin_console/admin_definition.test.jsx | 1 + .../admin_navbar_dropdown.tsx | 14 +- .../admin_navbar_dropdown/index.ts | 9 +- .../admin_console/admin_settings.tsx | 10 +- .../admin_sidebar/admin_sidebar.test.tsx | 13 +- .../admin_sidebar/admin_sidebar.tsx | 30 ++-- .../admin_sidebar/admin_sidebar_category.tsx | 2 +- .../admin_sidebar/admin_sidebar_section.tsx | 6 +- .../admin_console/admin_sidebar/index.ts | 16 ++- .../admin_sidebar_header.tsx | 9 +- .../admin_sidebar_header/index.ts | 2 +- .../admin_user_card/admin_user_card.test.tsx | 1 - .../admin_user_card/admin_user_card.tsx | 5 +- .../admin_console/audits/audits.tsx | 6 +- .../components/admin_console/audits/index.ts | 10 +- .../billing/billing_history.test.tsx | 3 +- .../admin_console/billing/billing_history.tsx | 7 +- .../billing/billing_history_modal.tsx | 15 +- .../billing/billing_history_table.tsx | 7 +- .../cancel_subscription.tsx | 1 + .../cloud_trial_banner.test.tsx | 5 +- .../cloud_trial_banner.tsx | 21 ++- .../contact_sales_card.tsx | 9 +- .../billing/billing_subscriptions/index.tsx | 39 +++--- .../limit_reached_banner.test.tsx | 9 +- .../limit_reached_banner.tsx | 12 +- .../billing_subscriptions/limits.test.tsx | 15 +- .../billing/billing_subscriptions/limits.tsx | 8 +- .../to_paid_plan_nudge_banner.tsx | 26 ++-- .../to_yearly_nudge_banner.tsx | 22 +-- .../billing_summary/billing_summary.tsx | 24 ++-- .../billing/billing_summary/index.tsx | 1 - .../billing/billing_summary/upsell_card.tsx | 18 ++- .../admin_console/billing/company_info.tsx | 4 +- .../billing/company_info_display.tsx | 9 +- .../billing/company_info_edit.tsx | 12 +- .../delete_workspace/delete_feedback.tsx | 8 +- .../delete_workspace/delete_workspace_cta.tsx | 9 +- .../delete_workspace_modal.tsx | 38 +++--- .../delete_workspace/failure_modal.tsx | 2 + .../delete_workspace/progress_modal.tsx | 13 +- .../billing/delete_workspace/result_modal.tsx | 19 +-- .../billing/invoice_user_count.test.tsx | 5 +- .../billing/invoice_user_count.tsx | 3 +- .../admin_console/billing/payment_details.tsx | 3 +- .../admin_console/billing/payment_info.tsx | 6 +- .../billing/payment_info_display.tsx | 11 +- .../billing/payment_info_edit.tsx | 23 ++-- .../plan_details/feature_list.test.tsx | 30 ++-- .../billing/plan_details/feature_list.tsx | 3 +- .../billing/plan_details/index.tsx | 4 +- .../billing/plan_details/plan_details.tsx | 6 +- .../billing/plan_details/plan_pricing.tsx | 7 +- .../admin_console/bleve_settings.test.tsx | 4 +- .../admin_console/bleve_settings.tsx | 14 +- .../admin_console/blockable_link/index.ts | 6 +- .../brand_image_setting.test.tsx | 2 +- .../brand_image_setting.tsx | 8 +- .../admin_console/cluster_settings.jsx | 7 +- .../admin_console/cluster_settings.test.jsx | 2 +- .../admin_console/cluster_table.tsx | 11 +- .../admin_console/cluster_table_container.tsx | 9 +- .../compliance_reports/compliance_reports.tsx | 8 +- .../admin_console/compliance_reports/index.ts | 13 +- ...le_disable_guest_accounts_setting.test.tsx | 3 +- ..._enable_disable_guest_accounts_setting.tsx | 3 +- .../custom_plugin_settings.test.tsx | 8 +- .../enable_plugin_setting.ts | 8 +- .../custom_plugin_settings/index.ts | 21 +-- .../custom_terms_of_service_settings.test.tsx | 4 +- .../custom_terms_of_service_settings.tsx | 9 +- .../custom_terms_of_service_settings/index.ts | 8 +- .../custom_url_schemes_setting.test.tsx | 4 +- .../custom_url_schemes_setting.tsx | 9 +- .../data_grid/data_grid.test.tsx | 2 +- .../admin_console/data_grid/data_grid.tsx | 7 +- .../data_grid/data_grid_header.tsx | 7 +- .../admin_console/data_grid/data_grid_row.tsx | 5 +- .../data_grid/data_grid_search.tsx | 4 +- .../channel_list/channel_list.test.tsx | 6 +- .../channel_list/channel_list.tsx | 22 +-- .../channel_list/index.ts | 18 +-- .../custom_policy_form.test.tsx | 2 +- .../custom_policy_form/custom_policy_form.tsx | 32 ++--- .../custom_policy_form/index.ts | 22 +-- .../data_retention_settings.test.tsx | 2 +- .../data_retention_settings.tsx | 35 ++--- .../global_policy_form.test.tsx | 2 +- .../global_policy_form/global_policy_form.tsx | 16 +-- .../global_policy_form/index.ts | 10 +- .../data_retention_settings/index.ts | 14 +- .../team_list/index.ts | 16 +-- .../team_list/team_list.test.tsx | 6 +- .../team_list/team_list.tsx | 16 ++- .../admin_console/database/index.tsx | 7 +- .../database/migrations_table.tsx | 9 +- .../admin_console/database_settings.jsx | 10 +- .../admin_console/database_settings.test.jsx | 2 +- .../admin_console/dropdown_setting.tsx | 6 +- .../elasticsearch_settings.test.jsx | 4 +- .../admin_console/elasticsearch_settings.tsx | 15 +- .../feature_discovery.test.tsx | 5 +- .../feature_discovery/feature_discovery.tsx | 39 +++--- .../features/announcement_banner.tsx | 6 +- .../features/compliance_export.tsx | 6 +- .../features/custom_terms_of_service.tsx | 6 +- .../features/data_retention.tsx | 6 +- .../feature_discovery/features/groups.tsx | 6 +- .../features/guest_access.tsx | 6 +- .../feature_discovery/features/index.ts | 12 +- .../feature_discovery/features/ldap.tsx | 6 +- .../feature_discovery/features/openid.tsx | 6 +- .../features/openid_custom.tsx | 6 +- .../feature_discovery/features/saml.tsx | 6 +- .../features/system_roles.tsx | 6 +- .../admin_console/feature_discovery/index.tsx | 17 +-- .../admin_console/feature_flags.tsx | 2 +- .../admin_console/filter/filter.tsx | 2 +- .../admin_console/filter/filter_list.tsx | 3 +- .../filter/team_filter_dropdown/index.tsx | 12 +- .../team_filter_dropdown.tsx | 9 +- .../full_log_event_modal.tsx | 17 ++- .../admin_console/generated_setting.tsx | 1 - .../group_details/group_details.test.tsx | 10 +- .../group_details/group_details.tsx | 34 +++-- .../group_profile_and_settings.tsx | 1 - .../group_teams_and_channels.tsx | 12 +- .../group_teams_and_channels_row.tsx | 15 +- .../group_details/group_users.test.tsx | 3 +- .../group_details/group_users.tsx | 15 +- .../group_details/group_users_row.tsx | 1 + .../group_settings/group_details/index.ts | 13 +- .../group_settings/group_row.test.tsx | 4 +- .../group_settings/group_row.tsx | 6 +- .../group_settings/group_settings.test.tsx | 2 +- .../group_settings/group_settings.tsx | 8 +- .../groups_list/groups_list.test.tsx | 2 +- .../groups_list/groups_list.tsx | 8 +- .../group_settings/groups_list/index.ts | 7 +- .../components/admin_console/highlight.tsx | 4 +- .../src/components/admin_console/index.ts | 30 ++-- .../components/admin_console/jobs/index.tsx | 13 +- .../admin_console/jobs/job_cancel_button.tsx | 3 +- .../admin_console/jobs/job_download_link.tsx | 6 +- .../admin_console/jobs/job_finish_at.tsx | 2 +- .../admin_console/jobs/job_run_length.tsx | 2 +- .../admin_console/jobs/job_status.tsx | 2 +- .../admin_console/jobs/table.test.tsx | 5 +- .../components/admin_console/jobs/table.tsx | 14 +- .../enterprise_edition_left_panel.test.tsx | 22 +-- .../enterprise_edition_left_panel.tsx | 32 +++-- .../enterprise_edition_right_panel.test.tsx | 6 +- .../enterprise_edition_right_panel.tsx | 11 +- .../admin_console/license_settings/index.ts | 25 ++-- .../license_settings.test.tsx | 4 +- .../license_settings/license_settings.tsx | 36 ++--- .../confirm_license_removal_modal.test.tsx | 6 +- .../modals/confirm_license_removal_modal.tsx | 10 +- .../modals/ee_license_modal.tsx | 13 +- .../modals/upload_license_modal.test.tsx | 14 +- .../modals/upload_license_modal.tsx | 37 +++-- .../renew_license_card.test.tsx | 3 +- .../renew_license_card/renew_license_card.tsx | 16 +-- .../starter_edition/starter_left_panel.tsx | 3 +- .../starter_edition/starter_right_panel.tsx | 4 +- .../team_edition/team_edition_right_panel.tsx | 10 +- .../trial_banner/trial_banner.tsx | 24 ++-- .../trial_license_card/trial_license_card.tsx | 14 +- .../admin_console/manage_roles_modal/index.ts | 11 +- .../manage_roles_modal/manage_roles_modal.tsx | 12 +- .../manage_teams_modal/index.tsx | 13 +- .../manage_teams_dropdown.test.tsx | 3 +- .../manage_teams_dropdown.tsx | 14 +- .../manage_teams_modal.test.tsx | 7 +- .../manage_teams_modal/manage_teams_modal.tsx | 17 +-- .../remove_from_team_button.test.tsx | 2 +- .../manage_tokens_modal/index.ts | 10 +- .../manage_tokens_modal.test.tsx | 2 +- .../manage_tokens_modal.tsx | 8 +- .../admin_console/member_list_group/index.ts | 12 +- .../member_list_group.test.tsx | 4 +- .../member_list_group/member_list_group.tsx | 10 +- .../admin_console/message_export_settings.jsx | 7 +- .../message_export_settings.test.jsx | 2 +- .../admin_console/multiselect_settings.tsx | 3 +- .../admin_console/openid_convert/index.ts | 8 +- .../openid_convert/openid_convert.test.tsx | 2 +- .../openid_convert/openid_convert.tsx | 15 +- .../admin_console/password_settings.tsx | 11 +- .../edit_post_time_limit_button/index.tsx | 4 +- .../edit_post_time_limit_modal.tsx | 10 +- .../edit_post_time_limit_modal/index.tsx | 10 +- .../guest_permissions_tree.test.tsx | 5 +- .../guest_permissions_tree.tsx | 11 +- .../guest_permissions_tree/index.tsx | 5 +- .../permission_schemes_settings/index.tsx | 13 +- .../permission_checkbox.test.tsx | 2 +- .../permission_description.tsx | 11 +- .../permission_group.test.tsx | 2 +- .../permission_group.tsx | 11 +- .../permission_row.test.tsx | 2 +- .../permission_row.tsx | 4 +- .../permission_schemes_settings.test.tsx | 7 +- .../permission_schemes_settings.tsx | 14 +- .../index.tsx | 11 +- ...permission_system_scheme_settings.test.tsx | 4 +- .../permission_system_scheme_settings.tsx | 28 ++-- .../permission_team_scheme_settings/index.tsx | 27 ++-- .../permission_team_scheme_settings.test.tsx | 2 +- .../permission_team_scheme_settings.tsx | 43 +++--- .../team_in_list/index.tsx | 10 +- .../team_in_list/team_in_list.test.tsx | 5 +- .../team_in_list/team_in_list.tsx | 3 +- .../permissions_scheme_summary/index.tsx | 14 +- .../permissions_scheme_summary.test.tsx | 4 +- .../permissions_scheme_summary.tsx | 13 +- .../permissions_tree/index.tsx | 5 +- .../permissions_tree.test.tsx | 10 +- .../permissions_tree/permissions_tree.tsx | 10 +- .../permissions_tree/types.ts | 2 +- .../permissions_tree_playbooks.test.tsx | 9 +- .../permissions_tree_playbooks.tsx | 4 +- .../admin_console/plugin_management/index.ts | 8 +- .../plugin_management.test.tsx | 2 +- .../plugin_management/plugin_management.tsx | 23 ++-- .../admin_console/push_settings.test.tsx | 5 +- .../admin_console/push_settings.tsx | 6 +- .../admin_console/radio_setting.test.tsx | 2 +- .../admin_console/remove_file_setting.tsx | 6 +- .../request_button/request_button.test.tsx | 2 +- .../request_button/request_button.tsx | 7 +- .../admin_console/reset_email_modal/index.ts | 9 +- .../reset_email_modal.test.tsx | 6 +- .../reset_email_modal/reset_email_modal.tsx | 4 +- .../reset_password_modal/index.ts | 9 +- .../reset_password_modal.test.tsx | 7 +- .../reset_password_modal.tsx | 5 +- .../revoke_token_button/index.ts | 5 +- .../revoke_token_button.tsx | 3 +- .../admin_console/schema_admin_settings.jsx | 47 ++++--- .../schema_admin_settings.test.jsx | 2 +- .../admin_console/server_logs/index.ts | 9 +- .../admin_console/server_logs/log_list.tsx | 12 +- .../admin_console/server_logs/logs.tsx | 8 +- .../admin_console/session_length_settings.tsx | 6 +- .../admin_console/system_roles/index.tsx | 2 +- .../add_users_to_role_modal.test.tsx | 2 +- .../add_users_to_role_modal.tsx | 24 ++-- .../add_users_to_role_modal/index.tsx | 13 +- .../system_roles/system_role/index.tsx | 15 +- .../system_role/system_role.test.tsx | 2 +- .../system_roles/system_role/system_role.tsx | 29 ++-- .../system_role_permission.test.tsx | 5 +- .../system_role/system_role_permission.tsx | 3 +- .../system_role_permission_dropdown.test.tsx | 5 +- .../system_role_permission_dropdown.tsx | 9 +- .../system_role_permissions.test.tsx | 7 +- .../system_role/system_role_permissions.tsx | 15 +- .../system_role/system_role_users/index.tsx | 18 +-- .../system_role_users.test.tsx | 2 +- .../system_role_users/system_role_users.tsx | 18 +-- .../system_roles/system_roles.test.tsx | 2 +- .../system_roles/system_roles.tsx | 13 +- .../admin_console/system_user_detail/index.ts | 20 ++- .../system_user_detail.test.tsx | 2 +- .../system_user_detail/system_user_detail.tsx | 37 ++--- .../team_list/abstract_list.test.tsx | 4 +- .../team_list/abstract_list.tsx | 4 +- .../system_user_detail/team_list/index.ts | 11 +- .../team_list/team_list.test.tsx | 2 +- .../team_list/team_list.tsx | 8 +- .../team_list/team_list_dropdown.tsx | 6 +- .../system_user_detail/team_list/team_row.tsx | 10 +- .../system_user_detail/team_list/types.ts | 2 +- .../admin_console/system_users/index.ts | 23 ++-- .../admin_console/system_users/list/index.ts | 12 +- .../system_users/list/selectors.test.tsx | 6 +- .../system_users/list/selectors.tsx | 5 +- .../list/system_users_list.test.tsx | 7 +- .../system_users/list/system_users_list.tsx | 15 +- .../system_users/system_users.test.tsx | 3 +- .../system_users/system_users.tsx | 29 ++-- .../system_users_dropdown/index.ts | 21 ++- .../system_users_dropdown.test.tsx | 11 +- .../system_users_dropdown.tsx | 30 ++-- .../abstract_list.test.tsx | 10 +- .../team_channel_settings/abstract_list.tsx | 12 +- .../channel/channel_settings.test.tsx | 2 +- .../channel/channel_settings.tsx | 5 +- .../channel/details/channel_details.test.tsx | 10 +- .../channel/details/channel_details.tsx | 40 +++--- .../channel/details/channel_groups.test.tsx | 6 +- .../channel/details/channel_groups.tsx | 4 +- .../channel_members/channel_members.test.tsx | 8 +- .../channel_members/channel_members.tsx | 22 +-- .../channel/details/channel_members/index.ts | 18 +-- .../details/channel_moderation.test.tsx | 4 +- .../channel/details/channel_moderation.tsx | 11 +- .../channel/details/channel_modes.test.tsx | 2 +- .../channel/details/channel_modes.tsx | 5 +- .../channel/details/channel_profile.test.tsx | 6 +- .../channel/details/channel_profile.tsx | 20 ++- .../channel/details/index.ts | 31 ++--- .../team_channel_settings/channel/index.ts | 4 +- .../channel/list/channel_list.test.tsx | 4 +- .../channel/list/channel_list.tsx | 24 ++-- .../channel/list/index.ts | 10 +- .../convert_and_remove_confirm_modal.tsx | 5 +- .../convert_confirm_modal.tsx | 15 +- .../team_channel_settings/errors.tsx | 4 +- .../group/group_list.test.tsx | 4 +- .../group/group_list.tsx | 6 +- .../group/group_members_modal.test.tsx | 2 +- .../group/group_members_modal.tsx | 2 +- .../group/group_row.test.tsx | 2 +- .../team_channel_settings/group/group_row.tsx | 9 +- .../group/group_users/index.ts | 22 +-- .../group_users/users_to_remove.test.tsx | 6 +- .../group/group_users/users_to_remove.tsx | 18 +-- .../users_to_remove_groups.test.tsx | 6 +- .../group_users/users_to_remove_groups.tsx | 4 +- .../group_users/users_to_remove_role.tsx | 8 +- .../remove_confirm_modal.tsx | 3 +- .../save_changes_panel.tsx | 6 +- .../team/details/index.ts | 20 +-- .../team/details/team_details.test.tsx | 2 +- .../team/details/team_details.tsx | 25 ++-- .../team/details/team_groups.test.tsx | 2 +- .../team/details/team_groups.tsx | 4 +- .../team/details/team_members/index.ts | 18 +-- .../team_members/team_members.test.tsx | 8 +- .../details/team_members/team_members.tsx | 24 ++-- .../team/details/team_modes.test.tsx | 2 +- .../team/details/team_modes.tsx | 5 +- .../team/details/team_profile.test.tsx | 5 +- .../team/details/team_profile.tsx | 36 ++--- .../team_channel_settings/team/index.ts | 3 +- .../team_channel_settings/team/list/index.ts | 14 +- .../team/list/team_list.test.tsx | 2 +- .../team/list/team_list.tsx | 16 +-- .../team/team_settings.test.tsx | 2 +- .../team/team_settings.tsx | 5 +- .../users_to_be_removed_modal.tsx | 4 +- .../components/admin_console/text_setting.tsx | 3 +- .../user_autocomplete_setting/index.tsx | 9 +- .../user_autocomplete_setting.tsx | 6 +- .../user_grid/user_grid.test.tsx | 6 +- .../admin_console/user_grid/user_grid.tsx | 17 +-- .../user_grid/user_grid_name.tsx | 3 +- .../user_grid/user_grid_remove.tsx | 3 +- .../user_grid/user_grid_role_dropdown.tsx | 19 ++- .../chips_list.test.tsx | 5 +- .../cta_buttons.test.tsx | 2 +- .../workspace-optimization/dashboard.data.tsx | 17 ++- .../workspace-optimization/dashboard.tsx | 23 ++-- .../dashboard_checks/access.ts | 15 +- .../dashboard_checks/config.ts | 10 +- .../dashboard_checks/data_privacy.ts | 15 +- .../dashboard_checks/easy_management.ts | 13 +- .../dashboard_checks/performance.ts | 11 +- .../dashboard_checks/updates.ts | 11 +- .../advanced_create_comment.test.tsx | 22 +-- .../advanced_create_comment.tsx | 66 ++++----- .../advanced_create_comment/index.ts | 56 ++++---- .../advanced_create_post.test.jsx | 17 ++- .../advanced_create_post.tsx | 80 +++++------ .../components/advanced_create_post/index.ts | 82 ++++++----- .../advanced_create_post/prewritten_chips.tsx | 6 +- .../advanced_create_post/priority_labels.tsx | 10 +- .../advanced_text_editor.tsx | 52 +++---- .../formatting_bar/formatting_bar.tsx | 8 +- .../formatting_bar/formatting_icon.tsx | 11 +- .../formatting_bar/hooks.tsx | 7 +- .../send_button/send_button.tsx | 1 + .../show_formatting/show_formatting.tsx | 6 +- .../toggle_formatting_bar.tsx | 4 +- .../index.tsx | 6 +- .../src/components/alert_banner.test.tsx | 2 +- .../channels/src/components/alert_banner.tsx | 5 +- .../analytics/activated_users_card/index.tsx | 2 +- .../analytics/doughnut_chart.test.tsx | 8 +- .../components/analytics/doughnut_chart.tsx | 4 +- .../components/analytics/line_chart.test.tsx | 2 +- .../src/components/analytics/line_chart.tsx | 4 +- .../analytics/statistic_count.test.tsx | 2 +- .../components/analytics/statistic_count.tsx | 3 +- .../analytics/system_analytics/index.ts | 2 +- .../system_analytics/system_analytics.tsx | 15 +- .../components/analytics/table_chart.test.tsx | 5 +- .../analytics/team_analytics/index.ts | 13 +- .../team_analytics/team_analytics.tsx | 22 +-- .../analytics/true_up_review.test.tsx | 8 +- .../components/analytics/true_up_review.tsx | 39 +++--- .../announcement_bar.test.tsx | 3 +- .../announcement_bar_controller.tsx | 25 ++-- ...loud_delinquency_announcement_bar.test.tsx | 2 +- .../cloud_delinquency/index.tsx | 21 +-- .../cloud_trial_announcement_bar.tsx | 19 ++- .../cloud_trial_announcement_bar/index.ts | 19 ++- ...loud_trial_ended_announcement_bar.test.tsx | 7 +- .../index.tsx | 34 ++--- .../configuration_bar.test.tsx | 3 +- .../configuration_bar/configuration_bar.tsx | 36 ++--- .../configuration_bar/index.ts | 12 +- .../contact_sales/contact_us.tsx | 2 +- .../announcement_bar.tsx | 11 +- .../default_announcement_bar/index.ts | 8 +- .../src/components/announcement_bar/index.ts | 18 +-- .../no_internet_connection.tsx | 4 +- .../index.tsx | 24 ++-- ...y_admin_downgrade_delinquency_bar.test.tsx | 11 +- .../overage_users_banner/index.tsx | 24 ++-- .../overage_users_banner.test.tsx | 18 ++- .../payment_announcement_bar/index.test.tsx | 3 +- .../payment_announcement_bar/index.tsx | 6 +- .../purchase_link/purchase_link.tsx | 10 +- .../announcement_bar/renewal_link/index.ts | 5 +- .../renewal_link/renewal_link.test.tsx | 5 +- .../renewal_link/renewal_link.tsx | 5 +- .../show_start_trial_modal.test.tsx | 6 +- .../show_start_trial_modal.tsx | 18 +-- .../show_three_days_left_trial_modal.test.tsx | 7 +- .../show_three_days_left_trial_modal.tsx | 28 ++-- .../text_dismissable_bar.test.tsx | 2 +- .../announcement_bar/text_dismissable_bar.tsx | 1 + .../announcement_bar/version_bar/index.ts | 2 +- .../version_bar/version_bar.test.tsx | 4 +- .../version_bar/version_bar.tsx | 1 - webapp/channels/src/components/app.tsx | 6 +- .../src/components/app_bar/app_bar.test.tsx | 13 +- .../src/components/app_bar/app_bar.tsx | 20 +-- .../components/app_bar/app_bar_binding.tsx | 12 +- .../app_bar/app_bar_marketplace.tsx | 10 +- .../app_bar/app_bar_plugin_component.tsx | 12 +- .../new_channel_with_board_tour_tip.tsx | 5 +- .../apps_form/apps_form_component.test.tsx | 14 +- .../apps_form/apps_form_component.tsx | 23 ++-- .../apps_form/apps_form_container.test.tsx | 3 +- .../apps_form/apps_form_container.tsx | 8 +- .../apps_form_field/apps_form_field.test.tsx | 7 +- .../apps_form_field/apps_form_field.tsx | 14 +- .../apps_form_select_field.tsx | 10 +- .../apps_form/apps_form_field/index.ts | 11 +- .../apps_form_field/select_channel_option.tsx | 5 +- .../apps_form_field/select_user_option.tsx | 15 +- .../apps_form/apps_form_header.test.tsx | 2 +- .../src/components/apps_form/index.ts | 8 +- .../src/components/archived_preview.tsx | 3 +- .../components/at_mention/at_mention.test.tsx | 7 +- .../src/components/at_mention/at_mention.tsx | 20 +-- .../at_mention/at_mention_group.tsx | 11 +- .../src/components/at_mention/index.tsx | 4 +- .../at_plan_mention/at_plan_mention.test.tsx | 2 +- .../at_sum_members_mention/index.tsx | 1 + .../notification_from_members_modal.tsx | 31 ++--- .../audio_video_preview.tsx | 2 +- .../components/audio_video_preview/index.ts | 2 +- .../audit_table/audit_row/audit_row.test.tsx | 8 +- .../audit_table/audit_row/audit_row.tsx | 11 +- .../audit_table/audit_table.test.tsx | 3 +- .../components/audit_table/audit_table.tsx | 10 +- .../channel_row/channel_create_direct_row.tsx | 10 +- .../channel_row/channel_default_row.tsx | 7 +- .../audit_table/channel_row/channel_row.tsx | 12 +- .../audit_table/format_audit.test.tsx | 8 +- .../components/audit_table/format_audit.tsx | 9 +- .../src/components/audit_table/index.ts | 7 +- .../audit_table/user_row/user_row.tsx | 8 +- .../user_update_active_session_row.tsx | 7 +- .../components/authorize/authorize.test.tsx | 2 +- .../src/components/authorize/authorize.tsx | 10 +- .../src/components/authorize/index.ts | 11 +- .../components/autocomplete_selector.test.jsx | 2 +- .../src/components/autosize_textarea.test.tsx | 2 +- .../src/components/autosize_textarea.tsx | 3 +- .../backstage/backstage_controller.tsx | 33 ++--- .../components/backstage_category.tsx | 5 +- .../backstage/components/backstage_header.tsx | 3 +- .../backstage/components/backstage_list.tsx | 7 +- .../backstage/components/backstage_navbar.tsx | 2 +- .../components/backstage_section.tsx | 3 +- .../components/backstage_sidebar.test.tsx | 5 +- .../components/backstage_sidebar.tsx | 6 +- .../src/components/backstage/index.ts | 8 +- .../browse_channels/browse_channels.test.tsx | 10 +- .../browse_channels/browse_channels.tsx | 22 +-- .../src/components/browse_channels/index.ts | 26 ++-- .../src/components/card/card.test.tsx | 2 +- webapp/channels/src/components/card/card.tsx | 4 +- .../src/components/card/card_body.tsx | 2 +- .../src/components/card/card_header.tsx | 2 +- .../center_message_lock/index.test.tsx | 8 +- .../components/center_message_lock/index.tsx | 15 +- .../channel_groups_manage_modal.tsx | 24 ++-- .../channel_groups_manage_modal/index.ts | 12 +- .../channel_header/channel_header.test.tsx | 14 +- .../channel_header/channel_header.tsx | 52 +++---- .../channel_header/channel_info_button.tsx | 9 +- .../components/header_icon_wrapper.test.tsx | 5 +- .../components/header_icon_wrapper.tsx | 9 +- .../src/components/channel_header/index.ts | 16 ++- .../channel_header_dropdown.test.tsx | 4 +- .../channel_header_dropdown.tsx | 3 +- .../channel_header_dropdown_items.tsx | 47 +++---- .../channel_header_dropdown/index.ts | 20 ++- .../close_channel/close_channel.test.tsx | 2 +- .../close_channel/close_channel.tsx | 4 +- .../menu_items/close_channel/index.ts | 5 +- .../close_message/close_message.test.tsx | 7 +- .../close_message/close_message.tsx | 15 +- .../menu_items/close_message/index.ts | 8 +- .../menu_items/leave_channel/index.ts | 8 +- .../leave_channel/leave_channel.test.tsx | 4 +- .../leave_channel/leave_channel.tsx | 8 +- .../menu_items/open_members_rhs/index.ts | 10 +- .../open_members_rhs/open_members_rhs.tsx | 3 +- .../toggle_favorite_channel/index.ts | 5 +- .../toggle_favorite_channel.test.tsx | 4 +- .../toggle_favorite_channel.tsx | 6 +- .../menu_items/toggle_info/index.ts | 10 +- .../menu_items/toggle_info/toggle_info.tsx | 6 +- .../menu_items/toggle_mute_channel/index.ts | 8 +- .../toggle_mute_channel.test.tsx | 10 +- .../toggle_mute_channel.tsx | 17 ++- .../menu_items/view_pinned_posts/index.ts | 10 +- .../view_pinned_posts.test.tsx | 2 +- .../view_pinned_posts/view_pinned_posts.tsx | 6 +- .../mobile_channel_header_dropdown.tsx | 15 +- ...bile_channel_header_dropdown_animation.tsx | 3 +- .../channel_header_mobile.tsx | 8 +- .../channel_info_button.tsx | 5 +- .../channel_info_button/index.ts | 3 +- .../collapse_lhs_button/index.ts | 5 +- .../collapse_rhs_button/index.ts | 5 +- .../components/channel_header_mobile/index.ts | 12 +- .../show_search_button/index.ts | 5 +- .../show_search_button/show_search_button.tsx | 4 +- .../unmute_channel_button/index.ts | 6 +- .../unmute_channel_button.test.tsx | 2 +- .../unmute_channel_button.tsx | 2 +- .../channel_info_rhs/about_area.tsx | 10 +- .../about_area_channel.test.tsx | 3 +- .../channel_info_rhs/about_area_channel.tsx | 8 +- .../channel_info_rhs/about_area_dm.test.tsx | 5 +- .../channel_info_rhs/about_area_dm.tsx | 17 +-- .../channel_info_rhs/about_area_gm.test.tsx | 5 +- .../channel_info_rhs/about_area_gm.tsx | 11 +- .../channel_info_rhs.test.tsx | 8 +- .../channel_info_rhs/channel_info_rhs.tsx | 23 ++-- .../components/linelimiter.tsx | 2 +- .../channel_info_rhs/header.test.tsx | 3 +- .../components/channel_info_rhs/header.tsx | 7 +- .../src/components/channel_info_rhs/index.ts | 38 +++--- .../components/channel_info_rhs/menu.test.tsx | 4 +- .../src/components/channel_info_rhs/menu.tsx | 6 +- .../channel_info_rhs/top_buttons.test.tsx | 3 +- .../channel_info_rhs/top_buttons.tsx | 5 +- .../channel_invite_modal.test.tsx | 12 +- .../channel_invite_modal.tsx | 27 ++-- .../components/channel_invite_modal/index.ts | 23 ++-- .../center_channel/center_channel.test.tsx | 2 +- .../center_channel/center_channel.tsx | 8 +- .../channel_layout/center_channel/index.ts | 21 +-- .../channel_layout/channel_controller.tsx | 13 +- .../channel_identifier_router/actions.test.ts | 4 +- .../channel_identifier_router/actions.ts | 17 +-- .../channel_identifier_router.test.tsx | 2 +- .../channel_identifier_router.tsx | 1 + .../channel_identifier_router/index.ts | 5 +- .../channel_layout/playbook_runner.tsx | 12 +- .../channel_members_dropdown.test.tsx | 11 +- .../channel_members_dropdown.tsx | 23 ++-- .../channel_members_dropdown/index.ts | 16 ++- .../channel_members_modal.test.tsx | 5 +- .../channel_members_modal.tsx | 8 +- .../components/channel_members_modal/index.ts | 9 +- .../channel_members_rhs/action_bar.test.tsx | 3 +- .../channel_members_rhs.tsx | 15 +- .../components/channel_members_rhs/header.tsx | 6 +- .../components/channel_members_rhs/index.ts | 32 +++-- .../components/channel_members_rhs/member.tsx | 28 ++-- .../channel_members_rhs/member_list.tsx | 10 +- .../components/channel_members_rhs/search.tsx | 3 +- .../channel_move_to_sub_menu/index.tsx | 25 ++-- .../channel_move_to_sub_menu_old/index.tsx | 24 ++-- .../channel_notifications_modal.test.tsx | 11 +- .../channel_notifications_modal.tsx | 9 +- .../components/collapse_view.test.tsx | 6 +- .../components/describe.test.tsx | 6 +- .../components/expand_view.test.tsx | 6 +- .../components/expand_view.tsx | 12 +- .../components/extra_info.test.tsx | 6 +- .../components/notification_section.test.jsx | 6 +- .../components/section_title.test.tsx | 6 +- .../channel_notifications_modal/index.ts | 16 ++- .../channel_select/channel_select.test.tsx | 6 +- .../channel_select/channel_select.tsx | 5 +- .../src/components/channel_select/index.ts | 4 +- .../channel_selector_modal.test.tsx | 6 +- .../channel_selector_modal.tsx | 12 +- .../channel_selector_modal/index.ts | 12 +- .../channel_view/channel_view.test.tsx | 5 +- .../components/channel_view/channel_view.tsx | 12 +- .../src/components/channel_view/index.ts | 5 +- .../choose_different_shipping/index.tsx | 1 - .../src/components/claim/claim_controller.tsx | 12 +- .../claim/components/email_to_ldap.tsx | 15 +- .../claim/components/email_to_oauth.tsx | 17 ++- .../claim/components/ldap_to_email.test.tsx | 2 +- .../claim/components/ldap_to_email.tsx | 19 ++- .../claim/components/oauth_to_email.tsx | 12 +- webapp/channels/src/components/claim/index.ts | 11 +- .../components/cloud_effects/index.test.tsx | 11 +- .../components/cloud_fetch_error/index.tsx | 10 +- .../cloud_invoice_preview/index.tsx | 12 +- .../cloud_start_trial_btn.test.tsx | 12 +- .../cloud_start_trial_btn.tsx | 11 +- .../input_business_email.test.tsx | 2 +- .../input_business_email.tsx | 3 +- .../request_business_email_modal.test.tsx | 12 +- .../request_business_email_modal.tsx | 20 ++- .../cloud_subscribe_result_modal/error.tsx | 19 ++- .../success.test.tsx | 1 - .../cloud_subscribe_result_modal/success.tsx | 11 +- .../cloud_usage_modal/index.test.tsx | 14 +- .../components/cloud_usage_modal/index.tsx | 11 +- .../lhs_nearing_limit_modal.tsx | 13 +- .../workspace_limits_panel.tsx | 6 +- .../components/code_block/code_block.test.tsx | 3 +- .../src/components/code_block/code_block.tsx | 6 +- .../channels/src/components/code_preview.tsx | 12 +- .../src/components/color_input.test.tsx | 2 +- .../channels/src/components/color_input.tsx | 3 +- .../commercial_support_modal.test.tsx | 3 +- .../commercial_support_modal.tsx | 6 +- .../commercial_support_modal/index.ts | 2 +- .../common/accordion/accordion.test.tsx | 2 +- .../components/common/accordion/accordion.tsx | 3 +- .../common/accordion/accordion_card.tsx | 7 +- .../common/auto_height_switcher.tsx | 3 +- .../src/components/common/back_button.tsx | 2 +- .../common/carousel/carousel.test.tsx | 2 +- .../common/carousel/carousel_button.tsx | 5 +- .../circular_chart/circular_chart.test.tsx | 2 +- .../src/components/common/comment_icon.tsx | 6 +- .../with_get_cloud_subscription.test.tsx | 3 +- .../cloud/with_get_cloud_subscription.tsx | 6 +- .../with_open_start_trial_form_modal.tsx | 3 +- .../cloud/with_use_get_usage_deltas.test.tsx | 3 +- .../hocs/cloud/with_use_get_usage_deltas.tsx | 3 +- .../common/hooks/useCanSelfHostedExpand.ts | 7 +- .../common/hooks/useControlModal.ts | 7 +- .../useControlSelfHostedExpansionModal.ts | 15 +- .../useControlSelfHostedPurchaseModal.ts | 22 +-- .../hooks/useExpandOverageUsersCheck.ts | 7 +- .../common/hooks/useFetchAdminConfig.ts | 8 +- .../common/hooks/useFetchStandardAnalytics.ts | 7 +- .../useGetHighestThresholdCloudLimit.test.ts | 5 +- .../hooks/useGetHighestThresholdCloudLimit.ts | 3 +- .../components/common/hooks/useGetLimits.ts | 5 +- .../useGetMultiplesExceededCloudLimit.test.ts | 5 +- .../useGetMultiplesExceededCloudLimit.ts | 3 +- .../common/hooks/useGetNotifyAdmin.ts | 4 +- .../common/hooks/useGetSelfHostedProducts.ts | 12 +- .../common/hooks/useGetSubscription.ts | 6 +- .../common/hooks/useGetTotalUsersNoBots.ts | 2 +- .../components/common/hooks/useGetUsage.ts | 7 +- .../common/hooks/useGetUsageDeltas.ts | 4 +- .../components/common/hooks/useLoadStripe.ts | 9 +- .../common/hooks/useOpenCloudPurchaseModal.ts | 4 +- .../common/hooks/useOpenDowngradeModal.ts | 4 +- .../common/hooks/useOpenInvitePeopleModal.ts | 4 +- .../common/hooks/useOpenPricingModal.ts | 6 +- .../common/hooks/useOpenSalesLink.ts | 3 +- .../hooks/useOpenStartTrialFormModal.ts | 7 +- .../common/hooks/useOpenZendeskForm.ts | 1 + .../components/common/hooks/usePreference.ts | 4 +- .../common/hooks/useSavePreferences.ts | 3 +- .../hooks/useShowAdminLimitReached.test.tsx | 14 +- .../common/hooks/useShowAdminLimitReached.ts | 7 +- .../common/hooks/useTelemetryIdentifySync.tsx | 1 - .../components/common/hooks/useTooltip.tsx | 5 +- .../common/infinite_scroll.test.tsx | 2 +- .../src/components/common/infinite_scroll.tsx | 3 +- .../common/multi_select_cards/index.tsx | 3 +- .../multi_select_cards/multi_select_card.tsx | 1 - .../components/common/plan_label/index.tsx | 8 +- .../components/common/radio_group.test.tsx | 2 +- .../src/components/common/radio_group.tsx | 3 +- .../common/site_name_and_description.test.tsx | 2 +- .../magnifying_glass_svg.tsx | 3 +- .../common/usage_percent_bar/index.tsx | 5 +- .../compass_design_provider/index.tsx | 8 +- .../compass_theme_provider.tsx | 2 +- .../convert_channel_modal.tsx | 6 +- .../components/convert_channel_modal/index.ts | 3 +- .../channels/src/components/copy_button.tsx | 8 +- .../copy_url_context_menu.test.tsx | 2 +- .../components/copy_url_context_menu/index.ts | 4 +- .../__snapshots__/create_team.test.tsx.snap | 2 +- .../components/display_name.test.tsx | 6 +- .../create_team/components/display_name.tsx | 8 +- .../create_team/components/team_url/index.ts | 11 +- .../components/team_url/team_url.test.tsx | 11 +- .../components/team_url/team_url.tsx | 15 +- .../create_team/create_team.test.tsx | 3 +- .../components/create_team/create_team.tsx | 11 +- .../src/components/create_team/index.ts | 10 +- .../create_user_groups_modal.test.tsx | 7 +- .../create_user_groups_modal.tsx | 35 ++--- .../create_user_groups_modal/index.ts | 11 +- .../index.tsx | 23 ++-- .../index.tsx | 21 +-- .../custom_status_emoji.test.tsx | 1 - .../custom_status/custom_status_emoji.tsx | 8 +- .../custom_status_modal.test.tsx | 2 +- .../custom_status/custom_status_modal.tsx | 41 +++--- .../custom_status_suggestion.test.tsx | 1 - .../custom_status_suggestion.tsx | 49 +++---- .../custom_status/custom_status_text.test.tsx | 1 - .../custom_status/custom_status_text.tsx | 7 +- .../custom_status/date_time_input.test.tsx | 3 +- .../custom_status/date_time_input.tsx | 33 +++-- .../custom_status/expiry_menu.test.tsx | 4 +- .../components/custom_status/expiry_menu.tsx | 6 +- .../components/custom_status/expiry_time.tsx | 6 +- .../src/components/data_prefetch/actions.ts | 4 +- .../data_prefetch/data_prefetch.test.tsx | 2 +- .../data_prefetch/data_prefetch.tsx | 7 +- .../src/components/data_prefetch/index.ts | 22 ++- .../components/date_picker/date_picker.tsx | 6 +- .../delete_category_modal.tsx | 5 +- .../components/delete_category_modal/index.ts | 3 +- .../delete_channel_modal.test.tsx | 9 +- .../delete_channel_modal.tsx | 5 +- .../components/delete_channel_modal/index.ts | 10 +- .../delete_post_modal.test.tsx | 8 +- .../delete_post_modal/delete_post_modal.tsx | 4 +- .../src/components/delete_post_modal/index.ts | 11 +- .../delinquency_modal.test.tsx | 7 +- .../delinquency_modal/delinquency_modal.tsx | 19 ++- .../delinquency_modal_controller.test.tsx | 9 +- .../delinquency_modal_controller.tsx | 8 +- .../delinquency_modal/freemium_modal.test.tsx | 9 +- .../delinquency_modal/freemium_modal.tsx | 22 +-- .../src/components/delinquency_modal/index.ts | 13 +- .../useDelinquencyModalController.tsx | 17 ++- .../src/components/desktop_auth_token.tsx | 8 +- .../dnd_custom_time_picker_modal.tsx | 29 ++-- .../dnd_custom_time_picker_modal/index.ts | 9 +- .../do_verify_email/do_verify_email.tsx | 12 +- .../src/components/dot_menu/dot_menu.test.tsx | 14 +- .../src/components/dot_menu/dot_menu.tsx | 25 ++-- .../dot_menu/dot_menu_empty.test.tsx | 1 + .../dot_menu/dot_menu_mobile.test.tsx | 1 + .../channels/src/components/dot_menu/index.ts | 39 +++--- .../dot_menu/post_reminder_submenu.tsx | 18 +-- .../src/components/dot_menu/utils.tsx | 2 +- .../src/components/downgrade_modal/index.tsx | 12 +- .../channel_draft/channel_draft.test.tsx | 9 +- .../drafts/channel_draft/channel_draft.tsx | 21 +-- .../components/drafts/channel_draft/index.ts | 4 +- .../drafts/draft_actions/action.test.tsx | 2 +- .../drafts/draft_actions/action.tsx | 3 +- .../draft_actions/delete_draft_modal.test.tsx | 2 +- .../draft_actions/draft_actions.test.tsx | 2 +- .../drafts/draft_actions/draft_actions.tsx | 3 +- .../components/drafts/draft_actions/index.ts | 4 +- .../draft_actions/send_draft_modal.test.tsx | 2 +- .../src/components/drafts/draft_row.test.tsx | 8 +- .../src/components/drafts/draft_row.tsx | 1 + .../drafts/draft_title/draft_title.test.tsx | 9 +- .../drafts/draft_title/draft_title.tsx | 10 +- .../components/drafts/draft_title/index.ts | 6 +- .../src/components/drafts/drafts.test.tsx | 8 +- .../channels/src/components/drafts/drafts.tsx | 12 +- .../drafts/drafts_link/drafts_link.test.tsx | 2 +- .../drafts/drafts_link/drafts_link.tsx | 5 +- .../drafts_tour_tip/drafts_tour_tip.tsx | 6 +- .../channels/src/components/drafts/index.ts | 6 +- .../components/drafts/panel/panel.test.tsx | 2 +- .../drafts/panel/panel_body.test.tsx | 12 +- .../components/drafts/panel/panel_body.tsx | 13 +- .../drafts/panel/panel_header.test.tsx | 2 +- .../components/drafts/panel/panel_header.tsx | 12 +- .../components/drafts/thread_draft/index.ts | 6 +- .../drafts/thread_draft/thread_draft.test.tsx | 11 +- .../drafts/thread_draft/thread_draft.tsx | 16 +-- .../src/components/dropdown_input.tsx | 6 +- .../edit_category_modal.test.tsx | 2 +- .../edit_category_modal.tsx | 4 +- .../components/edit_category_modal/index.ts | 11 +- .../edit_channel_header_modal.test.tsx | 9 +- .../edit_channel_header_modal.tsx | 13 +- .../edit_channel_header_modal/index.ts | 19 +-- .../edit_channel_purpose_modal.test.tsx | 6 +- .../edit_channel_purpose_modal.tsx | 11 +- .../edit_channel_purpose_modal/index.tsx | 14 +- .../src/components/edit_post/edit_post.tsx | 26 ++-- .../components/edit_post/edit_post_footer.tsx | 7 +- .../src/components/edit_post/index.ts | 24 ++-- .../emoji/add_emoji/add_emoji.test.tsx | 11 +- .../components/emoji/add_emoji/add_emoji.tsx | 19 +-- .../src/components/emoji/add_emoji/index.ts | 11 +- .../emoji/emoji_list/emoji_list.tsx | 18 +-- .../src/components/emoji/emoji_list/index.ts | 14 +- .../emoji/emoji_list_item/emoji_list_item.tsx | 7 +- .../components/emoji/emoji_list_item/index.ts | 16 +-- .../src/components/emoji/emoji_page.tsx | 3 +- webapp/channels/src/components/emoji/index.ts | 9 +- .../src/components/emoji/render_emoji.tsx | 3 +- .../components/emoji_picker_categories.tsx | 12 +- .../components/emoji_picker_category.tsx | 9 +- .../emoji_picker_category_or_emoji_row.tsx | 9 +- .../components/emoji_picker_category_row.tsx | 5 +- .../emoji_picker_current_results.tsx | 15 +- .../components/emoji_picker_header.test.tsx | 2 +- .../components/emoji_picker_header.tsx | 3 +- .../components/emoji_picker_item.tsx | 12 +- .../components/emoji_picker_preview.tsx | 3 +- .../components/emoji_picker_search.tsx | 7 +- .../components/emoji_picker_skin.tsx | 12 +- .../emoji_picker/constants/index.ts | 4 +- .../emoji_picker/emoji_picker.test.tsx | 1 - .../components/emoji_picker/emoji_picker.tsx | 22 +-- .../emoji_picker_overlay.tsx | 11 +- .../emoji_picker_overlay/index.ts | 7 +- .../emoji_picker/emoji_picker_tabs.tsx | 7 +- .../src/components/emoji_picker/index.ts | 21 +-- .../components/emoji_picker/types/index.ts | 4 +- .../components/emoji_picker/utils/index.ts | 30 ++-- .../components/error_page/error_link.test.tsx | 2 +- .../src/components/error_page/error_link.tsx | 1 - .../error_page/error_message.test.tsx | 2 +- .../components/error_page/error_page.test.tsx | 4 +- .../src/components/error_page/error_page.tsx | 6 +- .../error_page/error_title.test.tsx | 2 +- .../src/components/error_page/index.tsx | 7 +- .../external_image/external_image.tsx | 2 +- .../src/components/external_image/index.ts | 2 +- .../external_link/external_link.test.tsx | 11 +- .../src/components/external_link/index.tsx | 5 +- .../external_login_button.tsx | 2 +- .../favicon_title_handler.test.tsx | 15 +- .../favicon_title_handler.tsx | 20 ++- .../components/favicon_title_handler/index.ts | 13 +- .../feature_restricted_modal.test.tsx | 2 +- .../feature_restricted_modal.tsx | 38 +++--- .../feedback_modal/downgrade_feedback.tsx | 8 +- .../components/feedback_modal/feedback.tsx | 8 +- .../file_attachment/archived_tooltip.tsx | 1 + .../file_attachment/file_attachment.test.tsx | 5 +- .../file_attachment/file_attachment.tsx | 15 +- .../file_thumbnail/file_thumbnail.test.tsx | 2 +- .../file_thumbnail/file_thumbnail.tsx | 3 +- .../file_attachment/file_thumbnail/index.ts | 2 +- .../file_attachment/filename_overlay.test.tsx | 2 +- .../file_attachment/filename_overlay.tsx | 8 +- .../src/components/file_attachment/index.ts | 15 +- .../file_attachment_list.test.tsx | 6 +- .../file_attachment_list.tsx | 8 +- .../components/file_attachment_list/index.ts | 16 ++- .../file_info_preview.test.tsx | 5 +- .../file_info_preview/file_info_preview.tsx | 6 +- .../src/components/file_info_preview/index.ts | 4 +- .../file_limit_sticky_banner/index.tsx | 16 +-- .../components/file_preview/file_preview.tsx | 7 +- .../file_progress_preview.test.tsx | 2 +- .../file_preview/file_progress_preview.tsx | 5 +- .../src/components/file_preview/index.ts | 2 +- .../file_preview_modal.test.tsx | 2 +- .../file_preview_modal/file_preview_modal.tsx | 27 ++-- .../file_preview_modal_footer.test.tsx | 2 +- .../file_preview_modal_footer.tsx | 6 +- .../file_preview_modal_header.test.tsx | 4 +- .../file_preview_modal_header.tsx | 9 +- .../file_preview_modal_info.test.tsx | 7 +- .../file_preview_modal_info.tsx | 9 +- .../file_preview_modal_main_actions.test.tsx | 12 +- .../file_preview_modal_main_actions.tsx | 14 +- .../file_preview_modal_main_nav.tsx | 7 +- .../file_preview_modal/image_preview.test.tsx | 3 +- .../file_preview_modal/image_preview.tsx | 2 +- .../components/file_preview_modal/index.ts | 11 +- .../popover_bar/popover_bar.test.tsx | 2 +- .../popover_bar/popover_bar.tsx | 1 + .../components/file_preview_modal/types.ts | 2 +- .../file_search_result_item.test.tsx | 5 +- .../file_search_result_item.tsx | 18 ++- .../components/file_search_results/index.tsx | 17 ++- .../file_upload/file_upload.test.tsx | 13 +- .../components/file_upload/file_upload.tsx | 32 ++--- .../src/components/file_upload/index.ts | 11 +- .../src/components/file_upload_overlay.tsx | 1 - .../formatted_markdown_message.test.tsx | 2 +- .../components/formatted_markdown_message.tsx | 2 +- .../forward_post_channel_select.tsx | 32 ++--- .../forward_post_channel_select_styles.tsx | 8 +- .../forward_post_comment_input.tsx | 10 +- .../forward_post_modal/forward_post_modal.tsx | 37 +++-- .../components/forward_post_modal/index.ts | 15 +- .../src/components/get_link_modal.test.tsx | 5 +- .../get_public_link_modal.test.tsx | 4 +- .../components/get_public_link_modal/index.ts | 12 +- .../components/InfiniteScroll/index.js | 2 +- .../components/gif_picker_items.tsx | 5 +- .../components/gif_picker_search.tsx | 5 +- .../src/components/gif_picker/gif_picker.tsx | 7 +- .../center_controls/center_controls.tsx | 3 +- .../global_search_nav.test.tsx | 2 +- .../global_search_nav/global_search_nav.tsx | 6 +- .../user_guide_dropdown/index.ts | 18 +-- .../user_guide_dropdown.test.tsx | 4 +- .../user_guide_dropdown.tsx | 14 +- .../global_header/global_header.test.tsx | 7 +- .../global_header/global_header.tsx | 12 +- .../src/components/global_header/hooks.tsx | 10 +- .../history_buttons/history_buttons.tsx | 9 +- .../product_branding.test.tsx | 3 +- .../product_branding/product_branding.tsx | 3 +- .../product_menu/product_menu.test.tsx | 6 +- .../product_menu/product_menu.tsx | 26 ++-- .../product_menu_item/product_menu_item.tsx | 5 +- .../product_menu/product_menu_list/index.ts | 31 +++-- .../product_menu_list.test.tsx | 7 +- .../product_menu_list/product_menu_list.tsx | 11 +- .../at_mentions_button.test.tsx | 4 +- .../at_mentions_button/at_mentions_button.tsx | 10 +- .../plan_upgrade_button/index.tsx | 8 +- .../plan_upgrade_button.test.tsx | 8 +- .../right_controls/right_controls.tsx | 15 +- .../saved_posts_button.test.tsx | 4 +- .../saved_posts_button/saved_posts_button.tsx | 7 +- .../right_controls/settings_button/index.ts | 6 +- .../settings_button/settings_button.tsx | 4 +- .../content_layouts/alternate_link.test.tsx | 2 +- .../content_layouts/alternate_link.tsx | 2 +- .../components/header_footer_route/header.tsx | 6 +- .../header_footer_route.tsx | 2 +- .../header_footer_template.test.tsx | 5 +- .../header_footer_template.tsx | 1 + .../header_footer_template_route.tsx | 6 +- .../components/hint-toast/hint_toast.test.tsx | 2 +- .../components/info_toast/info_toast.test.tsx | 3 +- .../src/components/info_toast/info_toast.tsx | 5 +- .../integrations/abstract_command.test.tsx | 4 +- .../integrations/abstract_command.tsx | 26 ++-- .../abstract_incoming_hook.test.tsx | 6 +- .../abstract_incoming_webhook.tsx | 12 +- .../integrations/abstract_oauth_app.jsx | 8 +- .../integrations/abstract_oauth_app.test.jsx | 2 +- .../abstract_outgoing_webhook.test.tsx | 7 +- .../abstract_outgoing_webhook.tsx | 16 ++- .../add_command/add_command.test.tsx | 2 +- .../integrations/add_command/add_command.tsx | 9 +- .../integrations/add_command/index.ts | 8 +- .../add_incoming_webhook.test.tsx | 2 +- .../add_incoming_webhook.tsx | 8 +- .../add_incoming_webhook/index.ts | 11 +- .../add_oauth_app/add_oauth_app.test.tsx | 2 +- .../add_oauth_app/add_oauth_app.tsx | 7 +- .../integrations/add_oauth_app/index.ts | 8 +- .../add_outgoing_webhook.test.tsx | 2 +- .../add_outgoing_webhook.tsx | 10 +- .../add_outgoing_webhook/index.ts | 10 +- .../bots/add_bot/add_bot.test.tsx | 2 +- .../integrations/bots/add_bot/add_bot.tsx | 29 ++-- .../integrations/bots/add_bot/index.ts | 19 +-- .../components/integrations/bots/bot.test.tsx | 8 +- .../src/components/integrations/bots/bot.tsx | 14 +- .../integrations/bots/bots.test.tsx | 2 +- .../src/components/integrations/bots/bots.tsx | 18 +-- .../src/components/integrations/bots/index.ts | 21 +-- .../commands_container/commands_container.tsx | 15 +- .../integrations/commands_container/index.ts | 9 +- .../confirm_integration.test.tsx | 14 +- .../confirm_integration.tsx | 20 +-- .../integrations/confirm_integration/index.ts | 4 +- .../delete_integration_link.tsx | 2 +- .../edit_command/edit_command.test.tsx | 9 +- .../edit_command/edit_command.tsx | 12 +- .../integrations/edit_command/index.ts | 12 +- .../edit_incoming_webhook.test.tsx | 12 +- .../edit_incoming_webhook.tsx | 12 +- .../edit_incoming_webhook/index.ts | 11 +- .../edit_oauth_app/edit_oauth_app.test.tsx | 11 +- .../edit_oauth_app/edit_oauth_app.tsx | 13 +- .../integrations/edit_oauth_app/index.ts | 11 +- .../edit_outgoing_webhook.test.tsx | 4 +- .../edit_outgoing_webhook.tsx | 9 +- .../edit_outgoing_webhook/index.ts | 12 +- .../src/components/integrations/index.ts | 2 +- .../integrations/installed_command.test.tsx | 4 +- .../integrations/installed_command.tsx | 8 +- .../integrations/installed_commands/index.ts | 10 +- .../installed_commands/installed_commands.tsx | 19 +-- .../installed_incoming_webhook.test.tsx | 6 +- .../installed_incoming_webhook.tsx | 8 +- .../installed_incoming_webhooks/index.ts | 15 +- .../installed_incoming_webhooks.tsx | 16 +-- .../integrations/installed_oauth_app/index.ts | 7 +- .../installed_oauth_app.test.tsx | 2 +- .../installed_oauth_app.tsx | 9 +- .../installed_oauth_apps/index.ts | 15 +- .../installed_oauth_apps.test.tsx | 4 +- .../installed_oauth_apps.tsx | 11 +- .../installed_outgoing_webhook.test.tsx | 11 +- .../installed_outgoing_webhook.tsx | 10 +- .../installed_outgoing_webhooks/index.ts | 18 +-- .../installed_outgoing_webhooks.test.tsx | 7 +- .../installed_outgoing_webhooks.tsx | 20 +-- .../components/integrations/integrations.tsx | 14 +- .../dialog_element/dialog_element.test.tsx | 4 +- .../dialog_element/dialog_element.tsx | 21 +-- .../dialog_element/index.ts | 10 +- .../dialog_introduction_text.test.tsx | 2 +- .../dialog_introduction_text.tsx | 2 +- .../interactive_dialog/interactive_dialog.jsx | 2 +- .../interactive_dialog.test.jsx | 5 +- .../src/components/intl_provider/index.tsx | 8 +- .../intl_provider/intl_provider.tsx | 9 +- .../invitation_modal/add_to_channels.test.tsx | 12 +- .../invitation_modal/add_to_channels.tsx | 7 +- .../invitation_modal/index.test.tsx | 7 +- .../src/components/invitation_modal/index.tsx | 32 +++-- .../invitation_modal.test.tsx | 22 +-- .../invitation_modal/invitation_modal.tsx | 26 ++-- .../invitation_modal/invite_as.test.tsx | 8 +- .../components/invitation_modal/invite_as.tsx | 19 ++- .../invitation_modal/invite_view.test.tsx | 18 +-- .../invitation_modal/invite_view.tsx | 24 ++-- .../invitation_modal/no_permissions_view.tsx | 2 +- .../overage_users_banner_notice/index.tsx | 28 ++-- .../overage_users_banner_notice.test.tsx | 14 +- .../invitation_modal/result_table.test.tsx | 15 +- .../invitation_modal/result_table.tsx | 11 +- .../invitation_modal/result_view.tsx | 4 +- .../keyboard_shortcuts_modal.test.tsx | 6 +- .../keyboard_shortcuts_modal.tsx | 8 +- .../keyboard_shortcuts.ts | 2 +- .../keyboard_shortcuts_sequence.tsx | 6 +- .../src/components/latex_block/index.ts | 4 +- .../latex_block/latex_block.test.tsx | 2 +- .../components/latex_block/latex_block.tsx | 2 +- .../src/components/latex_inline/index.ts | 4 +- .../latex_inline/latex_inline.test.tsx | 2 +- .../components/latex_inline/latex_inline.tsx | 2 +- .../learn_more_trial_modal.test.tsx | 5 +- .../learn_more_trial_modal.tsx | 35 ++--- .../learn_more_trial_modal_step.test.tsx | 8 +- .../learn_more_trial_modal_step.tsx | 10 +- .../start_trial_btn.test.tsx | 10 +- .../start_trial_btn.tsx | 2 +- .../components/leave_channel_modal/index.ts | 5 +- .../leave_channel_modal.test.tsx | 4 +- .../leave_channel_modal.tsx | 6 +- .../src/components/leave_team_modal/index.ts | 11 +- .../leave_team_modal/leave_team_modal.tsx | 5 +- .../link_tooltip/link_tooltip.test.tsx | 5 +- .../components/link_tooltip/link_tooltip.tsx | 9 +- .../components/linking_landing_page/index.tsx | 2 +- .../linking_landing_page.tsx | 11 +- .../src/components/list_modal.test.tsx | 8 +- webapp/channels/src/components/list_modal.tsx | 3 +- .../components/loading_image_preview.test.tsx | 2 +- .../src/components/loading_screen.tsx | 5 +- .../src/components/localized_icon.tsx | 8 +- .../localized_input/localized_input.tsx | 8 +- .../src/components/logged_in/index.ts | 14 +- .../components/logged_in/logged_in.test.tsx | 11 +- .../src/components/logged_in/logged_in.tsx | 18 +-- .../src/components/login/login.test.tsx | 19 +-- .../channels/src/components/login/login.tsx | 49 +++---- .../src/components/login/login_mfa.test.tsx | 2 +- .../src/components/login/login_mfa.tsx | 7 +- .../src/components/main_menu/index.tsx | 21 ++- .../components/main_menu/main_menu.test.tsx | 19 ++- .../src/components/main_menu/main_menu.tsx | 44 +++--- .../channels/src/components/markdown/index.ts | 11 +- .../src/components/markdown/markdown.test.tsx | 8 +- .../src/components/markdown/markdown.tsx | 12 +- .../src/components/markdown_image/index.ts | 9 +- .../markdown_image/markdown_image.test.tsx | 7 +- .../markdown_image/markdown_image.tsx | 15 +- .../components/markdown_image_expand/index.ts | 10 +- .../components/member_list_channel/index.ts | 25 ++-- .../member_list_channel.tsx | 12 +- .../src/components/member_list_team/index.ts | 16 ++- .../member_list_team/member_list_team.tsx | 13 +- webapp/channels/src/components/menu/menu.tsx | 26 ++-- .../src/components/menu/menu_item.tsx | 21 +-- .../components/menu/menu_item_separator.tsx | 2 +- .../src/components/menu/menu_styled.tsx | 3 +- .../channels/src/components/menu/sub_menu.tsx | 24 ++-- .../components/message_submit_error.test.tsx | 2 +- .../src/components/message_submit_error.tsx | 5 +- .../message_with_additional_content.tsx | 6 +- .../src/components/mfa/confirm.test.tsx | 5 +- .../channels/src/components/mfa/confirm.tsx | 6 +- .../components/mfa/mfa_controller/index.ts | 2 +- .../mfa/mfa_controller/mfa_controller.tsx | 9 +- .../src/components/mfa/setup/index.ts | 8 +- .../src/components/mfa/setup/setup.tsx | 10 +- .../src/components/modal_controller/index.ts | 9 +- .../modal_controller.test.tsx | 2 +- .../components/more_direct_channels/index.ts | 17 +-- .../more_direct_channels/list/index.test.ts | 9 +- .../more_direct_channels/list/index.ts | 11 +- .../more_direct_channels/list/list.tsx | 8 +- .../more_direct_channels/list_item/index.ts | 2 +- .../list_item/list_item.test.tsx | 5 +- .../list_item/list_item.tsx | 8 +- .../list_item/user_details/index.ts | 6 +- .../list_item/user_details/user_details.tsx | 10 +- .../more_direct_channels.test.tsx | 7 +- .../more_direct_channels.tsx | 13 +- .../components/more_direct_channels/types.ts | 6 +- .../src/components/msg_typing/actions.test.ts | 2 - .../src/components/msg_typing/actions.ts | 7 +- .../src/components/msg_typing/index.ts | 2 +- .../components/msg_typing/msg_typing.test.tsx | 2 +- .../src/components/msg_typing/msg_typing.tsx | 2 +- .../multiselect/multiselect.test.tsx | 9 +- .../components/multiselect/multiselect.tsx | 13 +- .../multiselect/multiselect_list.test.tsx | 8 +- .../multiselect/multiselect_list.tsx | 10 +- .../new_channel_modal.test.tsx | 5 +- .../new_channel_modal/new_channel_modal.tsx | 34 +++-- .../components/new_replies_banner/index.ts | 9 +- .../new_replies_banner/new_replies_banner.tsx | 4 +- .../no_results_indicator.test.tsx | 2 +- .../no_results_indicator.tsx | 10 +- .../notification_box/notification_box.tsx | 3 +- .../notify_admin_cta/notify_admin_cta.tsx | 6 +- .../src/components/notify_counts/index.ts | 2 +- .../notify_counts/notify_counts.test.tsx | 8 +- .../notify_counts/notify_counts.tsx | 2 +- .../onboarding_tasklist.tsx | 129 +++++++++--------- .../onboarding_tasklist_animations.tsx | 1 + .../onboarding_tasklist_completed.test.tsx | 2 +- .../onboarding_tasklist_completed.tsx | 15 +- .../onboarding_tasklist_popover.tsx | 5 +- .../complete_your_profile_tour_tip.tsx | 4 +- .../onboarding_tasks_manager.test.tsx | 3 +- .../onboarding_tasks_manager.tsx | 36 ++--- .../onboarding_video_modal.tsx | 2 +- .../visit_system_console_tour_tip.tsx | 1 + .../src/components/outlined_input/index.tsx | 3 +- .../src/components/overlay_trigger.test.tsx | 3 +- .../src/components/overlay_trigger.tsx | 9 +- .../components/password_reset_form/index.ts | 12 +- .../password_reset_form.tsx | 5 +- .../password_reset_send_link/index.ts | 8 +- .../password_reset_send_link.tsx | 3 +- .../components/payment_form/address_form.tsx | 8 +- .../components/payment_form/card_image.tsx | 1 - .../components/payment_form/card_input.tsx | 6 +- .../gather_intent/gather_intent.test.tsx | 2 +- .../gather_intent/gather_intent.tsx | 10 +- .../gather_intent_modal.test.tsx | 3 +- .../gather_intent/gather_intent_modal.tsx | 4 +- .../gather_intent_submitted_modal.tsx | 5 +- .../gather_intent/useGatherIntent.ts | 8 +- .../components/payment_form/payment_form.tsx | 26 ++-- .../payment_form/state_selector.tsx | 6 +- .../src/components/payment_form/stripe.ts | 5 +- .../channels/src/components/pdf_preview.jsx | 4 +- .../src/components/pdf_preview.test.jsx | 2 +- .../src/components/permalink_view/actions.ts | 17 +-- .../src/components/permalink_view/index.ts | 7 +- .../permalink_view/permalink_view.test.tsx | 26 ++-- .../permalink_view/permalink_view.tsx | 2 +- .../any_team_permission_gate.test.tsx | 2 +- .../any_team_permission_gate/index.ts | 3 +- .../channel_permission_gate.test.tsx | 4 +- .../channel_permission_gate/index.ts | 3 +- .../system_permission_gate/index.ts | 2 +- .../system_permission_gate.test.tsx | 2 +- .../team_permission_gate/index.ts | 2 +- .../team_permission_gate.test.tsx | 2 +- .../persist_notification_confirm_modal.tsx | 11 +- .../marketplace_item/marketplace_item.tsx | 6 +- .../marketplace_item_app/index.ts | 15 +- .../marketplace_item_app.test.tsx | 5 +- .../marketplace_item_app.tsx | 4 +- .../marketplace_item_plugin/index.ts | 19 +-- .../marketplace_item_plugin.test.tsx | 10 +- .../marketplace_item_plugin.tsx | 18 ++- .../marketplace_list.test.tsx | 9 +- .../marketplace_list/marketplace_list.tsx | 3 +- .../marketplace_modal.test.tsx | 13 +- .../plugin_marketplace/marketplace_modal.tsx | 25 ++-- .../web_marketplace_banner.tsx | 7 +- .../channels/src/components/post/actions.ts | 12 +- webapp/channels/src/components/post/index.tsx | 28 ++-- .../components/post/post_component.test.tsx | 11 +- .../src/components/post/post_component.tsx | 76 +++++------ .../src/components/post/post_options.tsx | 22 +-- .../src/components/post/user_profile.tsx | 17 +-- .../components/post_deleted_modal.test.tsx | 2 +- .../edited_post_item.test.tsx | 12 +- .../edited_post_item/edited_post_item.tsx | 30 ++-- .../edited_post_item/index.ts | 22 +-- .../src/components/post_edit_history/index.ts | 8 +- .../post_edit_history.test.tsx | 5 +- .../post_edit_history/post_edit_history.tsx | 15 +- .../post_edit_history/restore_post_modal.tsx | 4 +- .../src/components/post_emoji/index.tsx | 2 +- .../components/post_markdown/index.test.ts | 2 +- .../src/components/post_markdown/index.ts | 21 ++- .../post_markdown/post_markdown.test.tsx | 3 +- .../post_markdown/post_markdown.tsx | 13 +- .../post_markdown/system_message_helpers.tsx | 14 +- .../post_priority/post_priority_badge.tsx | 1 - .../post_priority/post_priority_label.tsx | 5 +- .../post_priority/post_priority_picker.tsx | 9 +- .../post_priority_picker_item.tsx | 2 +- .../post_priority_picker_overlay.tsx | 9 +- .../components/post_profile_picture/index.ts | 13 +- .../post_profile_picture.test.tsx | 4 +- .../post_profile_picture.tsx | 6 +- .../index.ts | 13 +- ...post_reminder_custom_time_picker_modal.tsx | 6 +- .../post_view/acknowledgements/index.ts | 6 +- .../post_acknowledgements.tsx | 13 +- .../post_acknowledgements_users_popover.tsx | 12 +- .../add_members_button.test.tsx | 5 +- .../add_members_button.tsx | 19 ++- .../channel_intro_message.test.tsx | 10 +- .../channel_intro_message.tsx | 18 ++- .../post_view/channel_intro_message/index.ts | 23 ++-- .../pluggable_intro_buttons/index.ts | 4 +- .../pluggable_intro_buttons.tsx | 4 +- .../combined_system_message.test.tsx | 10 +- .../combined_system_message.tsx | 11 +- .../combined_system_message/index.ts | 8 +- .../last_users.test.tsx | 1 - .../combined_system_message/last_users.tsx | 8 +- .../combined_user_activity_post/index.ts | 5 +- .../commented_on/commented_on.test.tsx | 4 +- .../post_view/commented_on/commented_on.tsx | 10 +- .../post_view/commented_on/index.ts | 8 +- .../commented_on_files_message/index.ts | 2 +- .../date_separator/date_separator.tsx | 4 +- .../button_binding/button_binding.test.tsx | 4 +- .../button_binding/button_binding.tsx | 16 ++- .../embedded_bindings/button_binding/index.ts | 11 +- .../embedded_binding.test.tsx | 9 +- .../embedded_binding/embedded_binding.tsx | 20 +-- .../embedded_binding/index.ts | 3 +- .../embedded_bindings/embedded_bindings.tsx | 7 +- .../embedded_bindings/select_binding/index.ts | 10 +- .../select_binding/select_binding.test.tsx | 7 +- .../select_binding/select_binding.tsx | 21 ++- .../failed_post_options.test.tsx | 1 - .../failed_post_options.tsx | 12 +- .../post_view/failed_post_options/index.ts | 5 +- .../floating_timestamp/floating_timestamp.tsx | 2 +- .../post_view/floating_timestamp/index.ts | 3 +- .../src/components/post_view/index.test.ts | 6 +- .../src/components/post_view/index.ts | 13 +- .../action_button/action_button.test.tsx | 2 +- .../action_button/action_button.tsx | 9 +- .../action_button/index.ts | 3 +- .../action_menu/action_menu.tsx | 10 +- .../message_attachments/action_menu/index.ts | 8 +- .../message_attachment/index.ts | 11 +- .../message_attachment.test.tsx | 12 +- .../message_attachment/message_attachment.tsx | 33 +++-- .../message_attachment_list.tsx | 6 +- .../new_message_separator.tsx | 3 +- .../post_add_channel_member/index.ts | 10 +- .../post_add_channel_member.test.tsx | 11 +- .../post_add_channel_member.tsx | 8 +- .../post_view/post_aria_label_div.test.tsx | 5 +- .../post_view/post_aria_label_div.tsx | 2 +- .../post_attachment_container.test.tsx | 10 +- .../post_attachment_container.tsx | 14 +- .../post_attachment_opengraph/index.ts | 15 +- .../post_attachment_opengraph.test.tsx | 8 +- .../post_attachment_opengraph.tsx | 10 +- .../post_body_additional_content/index.ts | 13 +- .../post_body_additional_content.test.tsx | 6 +- .../post_body_additional_content.tsx | 15 +- .../post_view/post_edited_indicator/index.ts | 23 ++-- .../post_edited_indicator.tsx | 16 ++- .../post_view/post_flag_icon/index.ts | 8 +- .../post_flag_icon/post_flag_icon.test.tsx | 2 +- .../post_flag_icon/post_flag_icon.tsx | 8 +- .../post_header_custom_status.tsx | 10 +- .../components/post_view/post_image/index.ts | 3 +- .../post_view/post_image/post_image.tsx | 10 +- .../components/post_view/post_list/index.tsx | 19 +-- .../post_view/post_list/post_list.test.tsx | 2 +- .../post_view/post_list/post_list.tsx | 14 +- .../post_view/post_list_row/index.ts | 23 ++-- .../post_list_row/post_list_row.test.tsx | 10 +- .../post_view/post_list_row/post_list_row.tsx | 26 ++-- .../latest_post_reader.test.tsx | 2 - .../latest_post_reader.tsx | 8 +- .../post_list_virtualized.test.tsx | 10 +- .../post_list_virtualized.tsx | 14 +- .../post_view/post_message_preview/index.ts | 20 ++- .../post_message_preview.test.tsx | 10 +- .../post_message_preview.tsx | 38 +++--- .../post_view/post_message_view/index.ts | 2 +- .../post_message_view.test.tsx | 6 +- .../post_message_view/post_message_view.tsx | 16 +-- .../post_view/post_pre_header/index.ts | 3 +- .../post_pre_header/post_pre_header.test.tsx | 4 +- .../post_pre_header/post_pre_header.tsx | 7 +- .../post_view/post_reaction/index.ts | 8 +- .../post_reaction/post_reaction.test.tsx | 4 +- .../post_view/post_reaction/post_reaction.tsx | 17 ++- .../post_view/post_recent_reactions/index.ts | 15 +- .../post_recent_reactions.tsx | 9 +- .../recent_reactions_emoji_item.tsx | 5 +- .../components/post_view/post_time/index.ts | 2 +- .../post_view/post_time/post_time.tsx | 10 +- .../components/post_view/post_view.test.tsx | 2 +- .../components/post_view/reaction/index.ts | 19 ++- .../post_view/reaction/reaction.test.tsx | 5 +- .../post_view/reaction/reaction.tsx | 5 +- .../reaction/reaction_tooltip/index.test.ts | 5 +- .../reaction/reaction_tooltip/index.ts | 12 +- .../reaction_tooltip/reaction_tooltip.tsx | 2 +- .../post_view/reaction_list/index.ts | 13 +- .../post_view/reaction_list/reaction_list.tsx | 16 ++- .../reaction_list/reactions_list.test.tsx | 6 +- .../components/post_view/show_more/index.ts | 3 +- .../post_view/show_more/show_more.test.tsx | 2 +- .../components/preparing_workspace/index.tsx | 8 +- .../invite_members.test.tsx | 5 +- .../preparing_workspace/invite_members.tsx | 21 ++- .../invite_members_illustration.tsx | 3 +- .../invite_members_link.test.tsx | 2 +- .../invite_members_link.tsx | 3 +- .../launching_workspace.tsx | 7 +- .../preparing_workspace/organization.tsx | 30 ++-- .../organization_status.test.tsx | 3 +- .../organization_status.tsx | 6 +- .../preparing_workspace/plugins.tsx | 14 +- .../preparing_workspace.tsx | 49 +++---- .../preparing_workspace/progress.tsx | 3 +- .../src/components/pricing_modal/card.tsx | 7 +- .../pricing_modal/contact_sales_cta.tsx | 3 +- .../src/components/pricing_modal/content.tsx | 43 +++--- .../src/components/pricing_modal/index.tsx | 11 +- .../pricing_modal/self_hosted_content.tsx | 38 +++--- .../pricing_modal/start_trial_caution.tsx | 5 +- .../pricing_modal/starter_disclaimer_cta.tsx | 7 +- .../product_notices_modal/index.tsx | 18 ++- .../product_notices.test.tsx | 3 +- .../product_notices_modal.tsx | 6 +- .../profile_picture/profile_picture.test.tsx | 3 +- .../profile_picture/profile_picture.tsx | 9 +- .../src/components/profile_popover/index.ts | 34 ++--- .../profile_popover/profile_localtime.tsx | 9 +- .../profile_popover/profile_popover.test.tsx | 10 +- .../profile_popover/profile_popover.tsx | 61 +++++---- .../profile_popover_call_button/index.tsx | 2 +- .../profile_popover_call_button.tsx | 8 +- .../purchase_in_progress_modal/index.test.tsx | 10 +- .../purchase_in_progress_modal/index.tsx | 11 +- .../purchase_modal/icon_message.tsx | 2 +- .../src/components/purchase_modal/index.ts | 37 +++-- .../purchase_modal/process_payment_setup.tsx | 29 ++-- .../purchase_modal/purchase_modal.tsx | 80 ++++++----- .../quick_input/max_length_input.test.tsx | 2 +- .../quick_input/max_length_input.tsx | 4 +- .../quick_input/quick_input.test.tsx | 2 +- .../components/quick_input/quick_input.tsx | 11 +- .../components/quick_switch_modal/index.tsx | 13 +- .../quick_switch_modal.test.tsx | 6 +- .../quick_switch_modal/quick_switch_modal.tsx | 22 +-- .../removed_from_channel_modal/index.ts | 2 +- .../removed_from_channel_modal.test.tsx | 5 +- .../components/rename_channel_modal/index.ts | 12 +- .../rename_channel_modal.test.tsx | 9 +- .../rename_channel_modal.tsx | 13 +- .../components/reset_status_modal/index.ts | 15 +- .../reset_status_modal.test.tsx | 2 +- .../reset_status_modal/reset_status_modal.tsx | 8 +- .../resizable_sidebar/resizable_divider.tsx | 15 +- .../resizable_sidebar/resizable_lhs/index.tsx | 3 +- .../resizable_sidebar/resizable_rhs/index.tsx | 5 +- .../channels/src/components/rhs_card/index.ts | 4 +- .../src/components/rhs_card/rhs_card.test.tsx | 7 +- .../src/components/rhs_card/rhs_card.tsx | 27 ++-- .../src/components/rhs_card_header/index.tsx | 7 +- .../rhs_card_header/rhs_card_header.tsx | 10 +- .../src/components/rhs_header_post/index.ts | 20 ++- .../rhs_header_post/rhs_header_post.spec.tsx | 7 +- .../rhs_header_post/rhs_header_post.tsx | 17 +-- .../src/components/rhs_thread/index.ts | 9 +- .../components/rhs_thread/rhs_thread.test.tsx | 8 +- .../src/components/rhs_thread/rhs_thread.tsx | 12 +- .../root/__snapshots__/root.test.tsx.snap | 2 +- .../channels/src/components/root/effects.ts | 6 +- webapp/channels/src/components/root/index.ts | 31 +++-- .../src/components/root/root.test.tsx | 29 ++-- webapp/channels/src/components/root/root.tsx | 90 ++++++------ .../src/components/root/root_provider.tsx | 3 +- .../components/root/root_redirect/index.ts | 12 +- .../index.test.tsx | 4 +- .../screening_in_progress_modal/index.tsx | 3 +- .../channels/src/components/search/index.tsx | 14 +- .../channels/src/components/search/search.tsx | 29 ++-- .../channels/src/components/search/types.ts | 14 +- .../search/user_guide_dropdown/index.ts | 12 +- .../user_guide_dropdown.test.tsx | 4 +- .../user_guide_dropdown.tsx | 17 +-- .../components/search_bar/search_bar.test.tsx | 6 +- .../src/components/search_bar/search_bar.tsx | 17 +-- .../search_hint/search_hint.test.tsx | 6 +- .../components/search_hint/search_hint.tsx | 7 +- .../search_results/files_filter_menu.test.tsx | 3 +- .../search_results/files_filter_menu.tsx | 9 +- .../src/components/search_results/index.tsx | 12 +- .../messages_or_files_selector.test.tsx | 3 +- .../messages_or_files_selector.tsx | 7 +- .../post_search_results_item.tsx | 2 +- .../search_limits_banner.test.tsx | 10 +- .../search_results/search_limits_banner.tsx | 12 +- .../search_results/search_results.tsx | 30 ++-- .../src/components/search_results/types.ts | 12 +- .../search_results_header/index.tsx | 8 +- .../search_results_header.test.tsx | 4 +- .../search_results_header.tsx | 10 +- .../search_shortcut/search_shortcut.test.tsx | 2 +- .../search_shortcut/search_shortcut.tsx | 2 +- .../searchable_channel_list.test.tsx | 3 +- .../components/searchable_channel_list.tsx | 31 ++--- .../searchable_user_list.tsx | 11 +- .../searchable_user_list_container.tsx | 6 +- .../seats_calculator/consequences.tsx | 8 +- .../src/components/seats_calculator/index.tsx | 6 +- .../__snapshots__/select_team.test.tsx.snap | 14 +- .../components/select_team_item.test.tsx | 2 +- .../components/select_team_item.tsx | 5 +- .../src/components/select_team/index.ts | 17 +-- .../select_team/select_team.test.tsx | 10 +- .../components/select_team/select_team.tsx | 28 ++-- .../self_hosted_purchases/address.tsx | 8 +- .../contact_sales_link.tsx | 6 +- .../error_page.tsx | 7 +- .../expansion_card.tsx | 4 +- .../index.test.tsx | 17 +-- .../self_hosted_expansion_modal/index.tsx | 53 +++---- .../submitting.tsx | 6 +- .../success_page.tsx | 5 +- .../self_hosted_purchase_modal/error.tsx | 7 +- .../self_hosted_purchase_modal/index.test.tsx | 14 +- .../self_hosted_purchase_modal/index.tsx | 89 ++++++------ .../self_hosted_card.tsx | 14 +- .../self_hosted_purchase_modal/submitting.tsx | 7 +- .../success_page.tsx | 5 +- .../self_hosted_purchases/stripe_provider.tsx | 5 +- .../channels/src/components/setting_item.tsx | 5 +- .../src/components/setting_item_max.test.jsx | 5 +- .../src/components/setting_item_max.tsx | 5 +- .../src/components/setting_item_min/index.ts | 2 +- .../setting_item_min.test.tsx | 2 +- .../setting_item_min/setting_item_min.tsx | 7 +- .../src/components/setting_picture.test.tsx | 4 +- .../src/components/setting_picture.tsx | 12 +- .../src/components/settings_sidebar/index.ts | 2 +- .../settings_sidebar/settings_sidebar.tsx | 5 +- .../components/shared_channel_indicator.tsx | 3 +- .../src/components/shared_user_indicator.tsx | 1 + .../shortcut_key/shortcut_key.test.tsx | 2 +- .../components/shortcut_key/shortcut_key.tsx | 2 +- .../should_verify_email.tsx | 8 +- .../sidebar/add_channel_dropdown.tsx | 4 +- .../sidebar/add_channels_cta_button.test.tsx | 14 +- .../sidebar/add_channels_cta_button.tsx | 31 ++--- .../channel_filter/channel_filter.test.tsx | 4 +- .../sidebar/channel_filter/channel_filter.tsx | 12 +- .../sidebar/channel_filter/index.ts | 8 +- .../channel_navigator.test.tsx | 7 +- .../channel_navigator/channel_navigator.tsx | 4 +- .../sidebar/channel_navigator/index.ts | 12 +- .../channels/src/components/sidebar/index.ts | 14 +- .../sidebar/invite_members_button.test.tsx | 7 +- .../sidebar/invite_members_button.tsx | 7 +- .../contents/contents.tsx | 6 +- .../mobile_sidebar_header/contents/index.ts | 9 +- .../src/components/sidebar/sidebar.test.tsx | 5 +- .../src/components/sidebar/sidebar.tsx | 27 ++-- .../sidebar/sidebar_category/index.ts | 11 +- .../sidebar_category.test.tsx | 5 +- .../sidebar_category/sidebar_category.tsx | 41 +++--- .../create_new_category_menu_item.tsx | 12 +- .../sidebar_category_menu/index.test.tsx | 7 +- .../sidebar_category_menu/index.tsx | 28 ++-- .../mark_as_read_menu_item.tsx | 10 +- .../sidebar_category_generic_menu.tsx | 2 +- .../sidebar_category_sorting_menu.test.tsx | 2 +- .../sidebar_category_sorting_menu.tsx | 22 +-- .../sidebar/sidebar_category_header.tsx | 2 +- .../sidebar_channel/channel_mention_badge.tsx | 2 +- .../channel_pencil_icon/index.ts | 9 +- .../sidebar/sidebar_channel/index.ts | 6 +- .../sidebar_base_channel/index.ts | 6 +- .../sidebar_base_channel.test.tsx | 4 +- .../sidebar_base_channel.tsx | 9 +- .../sidebar_channel/sidebar_channel.test.tsx | 4 +- .../sidebar_channel/sidebar_channel.tsx | 5 +- .../sidebar_channel_link/index.ts | 23 ++-- .../sidebar_channel_link.test.tsx | 4 +- .../sidebar_channel_link.tsx | 13 +- .../sidebar_channel_menu/index.ts | 13 +- .../sidebar_channel_menu.test.tsx | 5 +- .../sidebar_channel_menu.tsx | 2 +- .../sidebar_direct_channel/index.ts | 12 +- .../sidebar_direct_channel.test.tsx | 6 +- .../sidebar_direct_channel.tsx | 13 +- .../sidebar_group_channel/index.ts | 12 +- .../sidebar_group_channel.tsx | 9 +- .../sidebar_header/sidebar_header.test.tsx | 10 +- .../sidebar/sidebar_header/sidebar_header.tsx | 30 ++-- .../components/sidebar/sidebar_list/index.ts | 12 +- .../sidebar_list/sidebar_list.test.tsx | 14 +- .../sidebar/sidebar_list/sidebar_list.tsx | 33 +++-- .../unread_channel_indicator.test.tsx | 2 +- .../components/sidebar/unread_channels.tsx | 19 +-- .../src/components/sidebar_right/index.ts | 16 +-- .../sidebar_right/sidebar_right.tsx | 31 ++--- .../components/sidebar_right_menu/index.ts | 9 +- .../sidebar_right_menu/sidebar_right_menu.tsx | 5 +- .../src/components/signup/signup.test.tsx | 19 +-- .../channels/src/components/signup/signup.tsx | 56 ++++---- .../src/components/single_image_view/index.ts | 15 +- .../single_image_view.test.tsx | 3 +- .../single_image_view/single_image_view.tsx | 8 +- .../src/components/size_aware_image.jsx | 14 +- .../src/components/size_aware_image.test.jsx | 6 +- .../src/components/spinner_button.test.tsx | 2 +- .../src/components/spinner_button.tsx | 3 +- .../air_gapped_modal.tsx | 3 +- .../start_trial_form_modal/failure_modal.tsx | 5 +- .../start_trial_form_modal/index.tsx | 35 ++--- .../start_trial_form_modal.test.tsx | 14 +- .../src/components/status_dropdown/index.ts | 12 +- .../status_dropdown/status_dropdown.test.tsx | 4 +- .../status_dropdown/status_dropdown.tsx | 30 ++-- .../at_mention_provider.jsx | 7 +- .../at_mention_provider.test.jsx | 3 +- .../at_mention_suggestion.test.tsx | 5 +- .../at_mention_suggestion.tsx | 29 ++-- .../suggestion/channel_mention_provider.tsx | 11 +- .../app_command_parser.test.ts | 23 ++-- .../app_command_parser/app_command_parser.ts | 31 +++-- .../app_command_parser_dependencies.ts | 45 +++--- .../tests/app_command_parser_test_data.ts | 5 +- .../command_provider/app_provider.tsx | 30 ++-- .../command_provider.test.tsx | 6 +- .../command_provider/command_provider.tsx | 18 +-- .../command_provider/mentions/index.ts | 8 +- .../suggestion/emoticon_provider.test.jsx | 3 +- .../suggestion/emoticon_provider.tsx | 11 +- .../suggestion/generic_channel_provider.tsx | 13 +- .../suggestion/generic_user_provider.tsx | 17 +-- .../suggestion/menu_action_provider.tsx | 6 +- .../src/components/suggestion/provider.tsx | 2 +- .../suggestion/search_channel_provider.tsx | 12 +- .../search_channel_suggestion/index.ts | 5 +- .../search_channel_suggestion.test.tsx | 2 +- .../search_channel_suggestion.tsx | 12 +- ...channel_with_permissions_provider.test.tsx | 1 + ...arch_channel_with_permissions_provider.tsx | 17 ++- .../suggestion/search_date_provider.tsx | 3 +- .../search_date_suggestion/index.ts | 5 +- .../search_date_suggestion.tsx | 10 +- .../search_suggestion_list.test.tsx | 3 +- .../suggestion/search_suggestion_list.tsx | 6 +- .../suggestion/search_user_provider.tsx | 16 ++- .../suggestion_box/suggestion_box.jsx | 1 + .../suggestion_box/suggestion_box.test.jsx | 5 +- .../suggestion/suggestion_list.test.tsx | 2 +- .../components/suggestion/suggestion_list.tsx | 8 +- .../switch_channel_provider.test.jsx | 4 +- .../suggestion/switch_channel_provider.tsx | 52 +++---- .../index.tsx | 12 +- .../src/components/system_notice/index.ts | 24 ++-- .../src/components/system_notice/notices.tsx | 10 +- .../system_notice/system_notice.test.tsx | 4 +- .../system_notice/system_notice.tsx | 13 +- .../src/components/system_notice/types.ts | 4 +- .../team_controller/actions/index.test.ts | 5 +- .../team_controller/actions/index.ts | 23 ++-- .../src/components/team_controller/index.ts | 17 +-- .../team_controller/team_controller.tsx | 19 ++- .../src/components/team_general_tab/index.ts | 16 ++- .../team_general_tab/open_invite.test.tsx | 2 +- .../team_general_tab/open_invite.tsx | 9 +- .../team_general_tab.test.tsx | 7 +- .../team_general_tab/team_general_tab.tsx | 15 +- .../team_groups_manage_modal/index.ts | 15 +- .../team_groups_manage_modal.tsx | 24 ++-- .../components/team_members_dropdown/index.ts | 14 +- .../team_members_dropdown.test.tsx | 4 +- .../team_members_dropdown.tsx | 19 +-- .../components/team_members_modal/index.ts | 14 +- .../team_members_modal.test.tsx | 2 +- .../team_members_modal/team_members_modal.tsx | 12 +- .../components/team_selector_modal/index.ts | 8 +- .../team_selector_modal.test.tsx | 5 +- .../team_selector_modal.tsx | 12 +- .../src/components/team_settings/index.ts | 4 +- .../team_settings/team_settings.tsx | 4 +- .../components/team_settings_modal/index.ts | 5 +- .../team_settings_modal.tsx | 9 +- .../components/team_button.test.tsx | 1 - .../team_sidebar/components/team_button.tsx | 23 ++-- .../src/components/team_sidebar/index.ts | 24 ++-- .../components/team_sidebar/team_sidebar.tsx | 24 ++-- .../src/components/terms_of_service/index.ts | 14 +- .../terms_of_service.test.tsx | 7 +- .../terms_of_service/terms_of_service.tsx | 10 +- .../channels/src/components/textbox.test.tsx | 2 +- .../channels/src/components/textbox/index.ts | 24 ++-- .../src/components/textbox/textbox.tsx | 18 +-- .../components/textbox/textbox_links/index.ts | 4 +- .../textbox/textbox_links/textbox_links.tsx | 3 +- .../posts_channel_reset_watcher.tsx | 3 +- .../thread_footer/thread_footer.test.tsx | 14 +- .../thread_footer/thread_footer.tsx | 23 ++-- .../threading/common/button/button.test.tsx | 2 +- .../threading/common/button/button.tsx | 3 +- .../follow_button/follow_button.test.tsx | 4 +- .../common/follow_button/follow_button.tsx | 7 +- .../components/threading/common/options.ts | 4 +- .../global_threads/global_threads.tsx | 46 +++---- .../attachments/file_card/file_card.tsx | 7 +- .../attachments/file_card/index.ts | 8 +- .../thread_item/attachments/index.tsx | 4 +- .../global_threads/thread_item/index.ts | 13 +- .../thread_item/thread_item.test.tsx | 31 +++-- .../thread_item/thread_item.tsx | 47 ++++--- .../thread_list/thread_list.test.tsx | 18 +-- .../thread_list/thread_list.tsx | 45 +++--- .../virtualized_thread_list.test.tsx | 3 +- .../thread_list/virtualized_thread_list.tsx | 4 +- .../virtualized_thread_list_row.test.tsx | 3 +- .../virtualized_thread_list_row.tsx | 4 +- .../thread_menu/thread_menu.test.tsx | 27 ++-- .../thread_menu/thread_menu.tsx | 21 +-- .../thread_pane/thread_pane.test.tsx | 19 +-- .../thread_pane/thread_pane.tsx | 17 ++- .../global_threads_link.tsx | 36 ++--- .../global_threads_link/threads_icon.tsx | 3 +- .../src/components/threading/hooks.ts | 8 +- .../threading/thread_viewer/index.ts | 42 +++--- .../thread_viewer/thread_viewer.test.tsx | 15 +- .../threading/thread_viewer/thread_viewer.tsx | 15 +- .../create_comment.tsx | 14 +- .../virtualized_thread_viewer/index.ts | 11 +- .../virtualized_thread_viewer/reply/index.ts | 2 +- .../virtualized_thread_viewer/reply/reply.tsx | 5 +- .../thread_viewer_row.tsx | 13 +- .../virtualized_thread_viewer.test.tsx | 8 +- .../virtualized_thread_viewer.tsx | 27 ++-- .../three_days_left_trial_modal.test.tsx | 10 +- .../three_days_left_trial_modal.tsx | 28 ++-- .../src/components/timestamp/index.test.tsx | 2 +- .../src/components/timestamp/index.ts | 14 +- .../components/timestamp/relative_ranges.tsx | 2 +- .../timestamp/semantic_time.test.tsx | 2 +- .../components/timestamp/semantic_time.tsx | 3 +- .../components/timestamp/timestamp.test.tsx | 8 +- .../src/components/timestamp/timestamp.tsx | 23 ++-- .../src/components/toast/toast.test.tsx | 7 +- .../channels/src/components/toast/toast.tsx | 11 +- .../src/components/toast_wrapper/index.ts | 13 +- .../toast_wrapper/toast_wrapper.test.tsx | 10 +- .../toast_wrapper/toast_wrapper.tsx | 21 +-- webapp/channels/src/components/toggle.tsx | 2 +- .../components/toggle_modal_button/index.ts | 3 +- .../toggle_modal_button.tsx | 5 +- webapp/channels/src/components/tooltip.tsx | 3 +- .../components/tours/channels_tour_tip.tsx | 8 +- .../collapsed_reply_threads_modal.tsx | 12 +- .../tours/crt_tour/crt_list_tutorial_tip.tsx | 6 +- .../crt_threads_pane_tutorial_tip.tsx | 12 +- .../tours/crt_tour/crt_tour_tip.tsx | 3 +- .../crt_tour/crt_unread_tutorial_tip.tsx | 3 +- webapp/channels/src/components/tours/hooks.ts | 18 +-- .../onboarding_explore_tools_tour_tip.tsx | 3 +- .../playbooks_tour_tip.tsx | 4 +- .../channels_and_direct_messages_tour_tip.tsx | 12 +- .../customize_your_experience_tour_tip.tsx | 4 +- .../components/tours/onboarding_tour/hooks.ts | 4 +- .../onboarding_tour/onboarding_tour_tip.tsx | 3 +- .../onboarding_tour/send_message_tour_tip.tsx | 7 +- .../src/components/tours/tour_manager.tsx | 18 +-- webapp/channels/src/components/tours/utils.ts | 2 +- .../trial_benefits_modal.test.tsx | 6 +- .../trial_benefits_modal.tsx | 32 ++--- .../trial_benefits_modal_step.test.tsx | 3 +- .../trial_benefits_modal_step_more.test.tsx | 3 +- .../unarchive_channel_modal/index.ts | 9 +- .../unarchive_channel_modal.test.tsx | 2 +- .../unarchive_channel_modal.tsx | 8 +- .../update_user_group_modal/index.ts | 16 ++- .../update_user_group_modal.test.tsx | 3 +- .../update_user_group_modal.tsx | 23 ++-- .../user_group_popover/constants.ts | 8 ++ .../group_member_list.test.tsx | 8 +- .../group_member_list/group_member_list.tsx | 30 ++-- .../group_member_list/index.ts | 26 ++-- .../components/user_group_popover/index.ts | 14 +- .../user_group_popover.test.tsx | 6 +- .../user_group_popover/user_group_popover.tsx | 38 +++--- .../ad_ldap_upsell_banner.test.tsx | 4 +- .../ad_ldap_upsell_banner.tsx | 21 ++- .../src/components/user_groups_modal/index.ts | 21 +-- .../user_groups_filter/user_groups_filter.tsx | 2 +- .../user_groups_list/index.ts | 15 +- .../user_groups_list.test.tsx | 5 +- .../user_groups_list/user_groups_list.tsx | 25 ++-- .../user_groups_modal.test.tsx | 4 +- .../user_groups_modal/user_groups_modal.tsx | 17 ++- .../user_groups_modal_header/index.ts | 15 +- .../user_groups_modal_header.test.tsx | 3 +- .../user_groups_modal_header.tsx | 6 +- .../src/components/user_list.test.tsx | 2 +- webapp/channels/src/components/user_list.tsx | 11 +- .../src/components/user_list_row/index.ts | 6 +- .../user_list_row/user_list_row.tsx | 21 ++- .../user_list_row_with_error/index.ts | 7 +- .../user_list_row_with_error.tsx | 20 ++- .../src/components/user_profile/index.ts | 5 +- .../user_profile/user_profile.test.tsx | 5 +- .../components/user_profile/user_profile.tsx | 18 ++- .../src/components/user_profile/utils.ts | 2 +- .../user_settings/advanced/index.ts | 16 ++- .../advanced/join_leave_section/index.ts | 12 +- .../join_leave_section.test.tsx | 12 +- .../join_leave_section/join_leave_section.tsx | 9 +- .../performance_debugging_section/index.ts | 7 +- .../performance_debugging_section.tsx | 2 +- .../advanced/user_settings_advanced.test.tsx | 3 +- .../advanced/user_settings_advanced.tsx | 24 ++-- .../components/user_settings/display/index.ts | 21 ++- .../display/manage_languages/index.ts | 8 +- .../manage_languages.test.tsx | 5 +- .../manage_languages/manage_languages.tsx | 18 +-- .../display/manage_timezones/index.ts | 11 +- .../manage_timezones.test.tsx | 4 +- .../manage_timezones/manage_timezones.tsx | 15 +- .../display/user_settings_display.test.tsx | 2 +- .../display/user_settings_display.tsx | 33 ++--- .../color_chooser/color_chooser.test.tsx | 2 +- .../custom_theme_chooser.test.tsx | 7 +- .../custom_theme_chooser.tsx | 17 ++- .../display/user_settings_theme/index.ts | 7 +- .../premade_theme_chooser/index.ts | 2 +- .../premade_theme_chooser.tsx | 6 +- .../user_settings_theme.test.tsx | 3 +- .../user_settings_theme.tsx | 16 +-- .../components/user_settings/general/index.ts | 11 +- .../general/user_settings_general.test.tsx | 5 +- .../general/user_settings_general.tsx | 17 +-- .../user_settings/import_theme_modal.tsx | 5 +- .../src/components/user_settings/index.ts | 3 +- .../components/user_settings/modal/index.ts | 11 +- .../modal/user_settings_modal.tsx | 16 ++- .../desktop_notification_settings.test.tsx | 3 +- .../desktop_notification_settings.tsx | 16 ++- .../email_notification_setting.test.tsx | 7 +- .../email_notification_setting.tsx | 17 +-- .../email_notification_setting/index.ts | 12 +- .../user_settings/notifications/index.ts | 13 +- .../manage_auto_responder.test.tsx | 3 +- .../manage_auto_responder.tsx | 3 +- .../user_settings_notifications.test.tsx | 7 +- .../user_settings_notifications.tsx | 20 +-- .../user_settings/security/index.ts | 16 ++- .../security/mfa_section/index.ts | 11 +- .../security/mfa_section/mfa_section.test.tsx | 1 + .../security/mfa_section/mfa_section.tsx | 5 +- .../user_access_token_section/index.ts | 8 +- .../user_access_token_section.tsx | 23 ++-- .../security/user_settings_security.test.tsx | 6 +- .../security/user_settings_security.tsx | 25 ++-- .../sidebar/limit_visible_gms_dms/index.ts | 2 +- .../limit_visible_gms_dms.tsx | 14 +- .../sidebar/show_unreads_category/index.ts | 2 +- .../show_unreads_category.tsx | 12 +- .../sidebar/user_settings_sidebar.tsx | 2 +- .../user_settings/user_settings.tsx | 2 +- .../components/view_user_group_modal/index.ts | 22 +-- .../view_user_group_header_sub_menu/index.ts | 14 +- .../view_user_group_header_sub_menu.tsx | 20 +-- .../view_user_group_list_item/index.ts | 13 +- .../view_user_group_list_item.tsx | 13 +- .../view_user_group_modal.test.tsx | 5 +- .../view_user_group_modal.tsx | 61 +++++---- .../view_user_group_modal_header/index.ts | 18 +-- .../view_user_group_modal_header.tsx | 17 ++- .../components/warn_metric_ack_modal/index.ts | 19 +-- .../warn_metric_ack_modal.test.tsx | 5 +- .../warn_metric_ack_modal.tsx | 23 ++-- .../widgets/admin_console/admin_header.tsx | 3 +- .../admin_console/admin_panel.test.tsx | 2 +- .../admin_panel_togglable.test.tsx | 2 +- .../admin_panel_with_button.test.tsx | 2 +- .../admin_console/admin_panel_with_button.tsx | 2 +- .../admin_panel_with_link.test.tsx | 2 +- .../admin_console/admin_panel_with_link.tsx | 2 +- .../components/widgets/header/header.test.tsx | 4 +- .../src/components/widgets/header/header.tsx | 3 +- .../widgets/icons/fa_search_icon.tsx | 1 + .../widgets/icons/fa_success_icon.tsx | 1 + .../components/widgets/icons/giphy_icon.tsx | 3 +- .../widgets/icons/leave_team_icon.tsx | 3 +- .../widgets/icons/mattermost_logo.tsx | 3 +- .../widgets/icons/status_away_avatar_icon.tsx | 3 +- .../widgets/icons/status_away_icon.tsx | 3 +- .../widgets/icons/status_dnd_icon.tsx | 3 +- .../widgets/icons/status_offline_icon.tsx | 3 +- .../widgets/icons/status_online_icon.tsx | 3 +- .../widgets/icons/team_info_icon.tsx | 3 +- .../widgets/inputs/channels_input.test.tsx | 2 +- .../widgets/inputs/channels_input.tsx | 19 +-- .../components/widgets/inputs/check/index.tsx | 3 +- .../widgets/inputs/dropdown_input_hybrid.tsx | 22 +-- .../components/widgets/inputs/input/input.tsx | 2 +- .../inputs/password_input/password_input.tsx | 12 +- .../widgets/inputs/url_input/url_input.tsx | 5 +- .../inputs/users_emails_input.test.tsx | 2 +- .../widgets/inputs/users_emails_input.tsx | 14 +- .../widgets/links/upgrade_link.test.tsx | 2 +- .../components/widgets/links/upgrade_link.tsx | 11 +- .../widgets/loading/loading_wrapper.test.tsx | 2 +- .../widgets/menu/is_mobile_view_hack.ts | 1 - .../src/components/widgets/menu/menu.test.tsx | 2 +- .../src/components/widgets/menu/menu.tsx | 14 +- .../widgets/menu/menu_group.test.tsx | 2 +- .../menu/menu_items/menu_cloud_trial.test.tsx | 1 - .../menu/menu_items/menu_cloud_trial.tsx | 19 ++- .../menu/menu_items/menu_item.test.tsx | 2 +- .../widgets/menu/menu_items/menu_item.tsx | 2 +- .../menu/menu_items/menu_item_action.test.tsx | 2 +- .../menu_items/menu_item_cloud_limit.test.tsx | 1 - .../menu/menu_items/menu_item_cloud_limit.tsx | 9 +- .../menu_item_external_link.test.tsx | 2 +- .../menu/menu_items/menu_item_link.test.tsx | 2 +- .../menu_item_toggle_modal_redux.test.tsx | 2 +- .../menu_item_toggle_modal_redux.tsx | 3 +- .../menu/menu_items/menu_start_trial.test.tsx | 1 - .../menu/menu_items/menu_start_trial.tsx | 12 +- .../menu/menu_items/restricted_indicator.tsx | 5 +- .../menu/menu_items/submenu_item.test.tsx | 2 +- .../widgets/menu/menu_items/submenu_item.tsx | 15 +- .../widgets/menu/menu_items/useWords.test.tsx | 5 +- .../widgets/menu/menu_items/useWords.tsx | 13 +- .../submenu_modal/submenu_modal.test.tsx | 2 +- .../submenu_modal/submenu_modal.tsx | 8 +- .../widgets/menu/menu_wrapper.test.tsx | 2 +- .../widgets/modals/full_screen_modal.tsx | 4 +- .../src/components/widgets/popover/index.tsx | 3 +- .../widgets/popover/popover.test.tsx | 2 +- .../public-private-selector.tsx | 15 +- .../widgets/separator/basic-separator.tsx | 3 +- .../widgets/separator/separator.test.tsx | 2 +- .../widgets/settings/bool_setting.test.tsx | 2 +- .../widgets/settings/radio_setting.test.tsx | 2 +- .../widgets/settings/text_setting.test.tsx | 2 +- .../widgets/settings/text_setting.tsx | 3 +- .../widgets/simple_tooltip/simple_tooltip.tsx | 3 +- .../components/widgets/tag/beta_tag.test.tsx | 2 +- .../src/components/widgets/tag/beta_tag.tsx | 5 +- .../components/widgets/tag/bot_tag.test.tsx | 2 +- .../src/components/widgets/tag/bot_tag.tsx | 5 +- .../components/widgets/tag/guest_tag.test.tsx | 3 +- .../src/components/widgets/tag/guest_tag.tsx | 11 +- .../src/components/widgets/tag/tag.test.tsx | 3 +- .../src/components/widgets/tag/tag.tsx | 8 +- .../widgets/team_icon/team_icon.tsx | 7 +- .../widgets/users/avatar/avatar.test.tsx | 2 +- .../widgets/users/avatar/avatar.tsx | 8 +- .../widgets/users/avatars/avatars.test.tsx | 9 +- .../widgets/users/avatars/avatars.tsx | 23 ++-- .../WindowSizeObserver.tsx | 9 +- .../src/components/youtube_video/index.ts | 2 +- .../youtube_video/youtube_video.test.tsx | 6 +- .../youtube_video/youtube_video.tsx | 5 +- webapp/channels/src/entry.tsx | 12 +- .../src/action_types/index.ts | 40 +++--- .../src/actions/admin.test.ts | 7 +- .../mattermost-redux/src/actions/admin.ts | 37 +++-- .../mattermost-redux/src/actions/apps.ts | 4 +- .../mattermost-redux/src/actions/boards.ts | 10 +- .../mattermost-redux/src/actions/bots.ts | 8 +- .../src/actions/channel_categories.test.js | 17 +-- .../src/actions/channel_categories.ts | 19 ++- .../src/actions/channels.test.ts | 13 +- .../mattermost-redux/src/actions/channels.ts | 19 +-- .../mattermost-redux/src/actions/cloud.ts | 6 +- .../src/actions/emojis.test.ts | 2 +- .../mattermost-redux/src/actions/emojis.ts | 14 +- .../mattermost-redux/src/actions/errors.ts | 10 +- .../src/actions/files.test.ts | 1 + .../mattermost-redux/src/actions/files.ts | 11 +- .../mattermost-redux/src/actions/general.ts | 9 +- .../src/actions/groups.test.ts | 3 +- .../mattermost-redux/src/actions/groups.ts | 13 +- .../src/actions/helpers.test.ts | 1 + .../mattermost-redux/src/actions/helpers.ts | 8 +- .../mattermost-redux/src/actions/index.ts | 4 +- .../src/actions/integrations.test.ts | 4 +- .../src/actions/integrations.ts | 13 +- .../mattermost-redux/src/actions/jobs.test.ts | 3 +- .../mattermost-redux/src/actions/jobs.ts | 10 +- .../src/actions/posts.test.ts | 22 +-- .../mattermost-redux/src/actions/posts.ts | 53 ++++--- .../src/actions/preferences.test.ts | 6 +- .../src/actions/preferences.ts | 15 +- .../src/actions/roles.test.js | 4 +- .../mattermost-redux/src/actions/roles.ts | 10 +- .../mattermost-redux/src/actions/schemes.ts | 15 +- .../src/actions/search.test.ts | 3 +- .../mattermost-redux/src/actions/search.ts | 19 ++- .../src/actions/teams.test.ts | 10 +- .../mattermost-redux/src/actions/teams.ts | 32 ++--- .../src/actions/threads.test.js | 5 +- .../mattermost-redux/src/actions/threads.ts | 16 +-- .../mattermost-redux/src/actions/timezone.ts | 5 +- .../src/actions/users.test.ts | 12 +- .../mattermost-redux/src/actions/users.ts | 41 +++--- .../src/actions/users_queries.ts | 10 +- .../mattermost-redux/src/actions/websocket.ts | 4 +- .../mattermost-redux/src/client/rudder.ts | 5 +- .../mattermost-redux/src/constants/apps.ts | 2 +- .../src/constants/channel_categories.ts | 2 +- .../mattermost-redux/src/constants/index.ts | 20 +-- .../mattermost-redux/src/constants/posts.ts | 2 +- .../src/constants/preferences.ts | 2 +- .../src/constants/request_status.ts | 2 +- .../src/reducers/entities/admin.test.ts | 6 +- .../src/reducers/entities/admin.ts | 26 ++-- .../src/reducers/entities/apps.test.ts | 2 +- .../src/reducers/entities/apps.ts | 5 +- .../src/reducers/entities/bots.ts | 5 +- .../entities/channel_categories.test.js | 3 +- .../reducers/entities/channel_categories.ts | 11 +- .../src/reducers/entities/channels.test.js | 3 +- .../src/reducers/entities/channels.ts | 21 ++- .../entities/channels/message_counts.test.ts | 2 +- .../entities/channels/message_counts.ts | 17 ++- .../src/reducers/entities/cloud.ts | 7 +- .../src/reducers/entities/emojis.ts | 9 +- .../src/reducers/entities/files.ts | 7 +- .../src/reducers/entities/general.test.ts | 4 +- .../src/reducers/entities/general.ts | 5 +- .../src/reducers/entities/groups.ts | 5 +- .../src/reducers/entities/hosted_customer.ts | 9 +- .../src/reducers/entities/index.ts | 34 ++--- .../src/reducers/entities/integrations.ts | 7 +- .../src/reducers/entities/jobs.ts | 7 +- .../src/reducers/entities/posts.test.ts | 3 +- .../src/reducers/entities/posts.ts | 22 ++- .../src/reducers/entities/preferences.ts | 5 +- .../src/reducers/entities/roles.ts | 5 +- .../src/reducers/entities/schemes.ts | 5 +- .../src/reducers/entities/search.test.ts | 2 +- .../src/reducers/entities/search.ts | 9 +- .../src/reducers/entities/teams.test.ts | 2 +- .../src/reducers/entities/teams.ts | 9 +- .../src/reducers/entities/threads/counts.ts | 12 +- .../src/reducers/entities/threads/index.ts | 16 +-- .../entities/threads/threadsInTeam.test.ts | 2 +- .../entities/threads/threadsInTeam.ts | 5 +- .../src/reducers/entities/threads/types.ts | 2 +- .../src/reducers/entities/typing.test.ts | 3 +- .../src/reducers/entities/typing.ts | 6 +- .../src/reducers/entities/usage.ts | 5 +- .../src/reducers/entities/users.test.ts | 6 +- .../src/reducers/entities/users.ts | 13 +- .../src/reducers/errors/index.ts | 2 +- .../src/reducers/requests/admin.ts | 6 +- .../src/reducers/requests/channels.ts | 4 +- .../src/reducers/requests/files.ts | 6 +- .../src/reducers/requests/general.ts | 6 +- .../src/reducers/requests/helpers.ts | 6 +- .../src/reducers/requests/index.ts | 6 +- .../src/reducers/requests/posts.ts | 6 +- .../src/reducers/requests/roles.ts | 6 +- .../src/reducers/requests/search.ts | 6 +- .../src/reducers/requests/teams.ts | 6 +- .../src/reducers/requests/users.ts | 8 +- .../src/reducers/websocket.ts | 2 +- .../src/selectors/entities/admin.ts | 9 +- .../src/selectors/entities/apps.test.ts | 6 +- .../src/selectors/entities/apps.ts | 8 +- .../src/selectors/entities/bots.test.ts | 2 +- .../src/selectors/entities/bots.ts | 6 +- .../entities/channel_categories.test.ts | 9 +- .../selectors/entities/channel_categories.ts | 17 ++- .../src/selectors/entities/channels.test.ts | 15 +- .../src/selectors/entities/channels.ts | 45 +++--- .../src/selectors/entities/cloud.ts | 4 +- .../src/selectors/entities/common.ts | 10 +- .../src/selectors/entities/emojis.test.ts | 6 +- .../src/selectors/entities/emojis.ts | 9 +- .../src/selectors/entities/files.ts | 7 +- .../src/selectors/entities/general.test.ts | 4 +- .../src/selectors/entities/general.ts | 9 +- .../src/selectors/entities/groups.test.ts | 5 +- .../src/selectors/entities/groups.ts | 9 +- .../src/selectors/entities/hosted_customer.ts | 8 +- .../src/selectors/entities/i18n.test.ts | 6 +- .../src/selectors/entities/i18n.ts | 5 +- .../selectors/entities/integrations.test.ts | 3 +- .../src/selectors/entities/integrations.ts | 8 +- .../src/selectors/entities/jobs.ts | 6 +- .../src/selectors/entities/posts.test.ts | 15 +- .../src/selectors/entities/posts.ts | 51 ++++--- .../selectors/entities/preferences.test.ts | 13 +- .../src/selectors/entities/preferences.ts | 10 +- .../src/selectors/entities/reactions.ts | 4 +- .../src/selectors/entities/roles.test.ts | 16 ++- .../src/selectors/entities/roles.ts | 11 +- .../src/selectors/entities/roles_helpers.ts | 6 +- .../src/selectors/entities/schemes.test.ts | 13 +- .../src/selectors/entities/schemes.ts | 11 +- .../src/selectors/entities/search.test.ts | 8 +- .../src/selectors/entities/search.ts | 11 +- .../src/selectors/entities/teams.test.ts | 13 +- .../src/selectors/entities/teams.ts | 16 +-- .../src/selectors/entities/threads.test.ts | 3 +- .../src/selectors/entities/threads.ts | 15 +- .../src/selectors/entities/timezone.ts | 5 +- .../src/selectors/entities/typing.ts | 11 +- .../src/selectors/entities/usage.ts | 4 +- .../src/selectors/entities/users.test.ts | 16 ++- .../src/selectors/entities/users.ts | 30 ++-- .../src/selectors/entities/utils.test.ts | 6 +- .../src/selectors/entities/utils.ts | 6 +- .../mattermost-redux/src/selectors/errors.ts | 2 +- .../src/store/configureStore.ts | 16 +-- .../mattermost-redux/src/store/helpers.ts | 3 +- .../src/store/initial_state.ts | 2 +- .../src/store/reducer_registry.test.ts | 1 + .../src/store/reducer_registry.ts | 2 +- .../mattermost-redux/src/types/actions.ts | 6 +- .../mattermost-redux/src/utils/apps.test.ts | 2 +- .../mattermost-redux/src/utils/apps.ts | 2 +- .../src/utils/channel_utils.test.ts | 9 +- .../src/utils/channel_utils.ts | 15 +- .../src/utils/emoji_utils.test.ts | 1 + .../mattermost-redux/src/utils/emoji_utils.ts | 3 +- .../src/utils/file_utils.test.ts | 2 +- .../mattermost-redux/src/utils/file_utils.ts | 6 +- .../mattermost-redux/src/utils/group_utils.ts | 5 +- .../src/utils/integration_utils.test.ts | 1 + .../src/utils/integration_utils.ts | 2 +- .../mattermost-redux/src/utils/marketplace.ts | 2 +- .../src/utils/notify_props.test.ts | 3 +- .../src/utils/post_list.test.ts | 10 +- .../mattermost-redux/src/utils/post_list.ts | 13 +- .../src/utils/post_utils.test.ts | 11 +- .../mattermost-redux/src/utils/post_utils.ts | 17 +-- .../src/utils/preference_utils.ts | 2 +- .../mattermost-redux/src/utils/team_utils.ts | 5 +- .../src/utils/theme_utils.test.ts | 1 + .../mattermost-redux/src/utils/theme_utils.ts | 2 +- .../src/utils/timezone_utils.ts | 4 +- .../src/utils/user_utils.test.ts | 2 +- .../mattermost-redux/src/utils/user_utils.ts | 13 +- .../mattermost-redux/test/test_helper.ts | 26 ++-- webapp/channels/src/plugins/actions.js | 3 +- .../src/plugins/call_button/call_button.tsx | 14 +- .../channels/src/plugins/call_button/index.ts | 2 +- .../channel_header_plug.test.tsx | 10 +- .../channel_header_plug.tsx | 19 +-- .../src/plugins/channel_header_plug/index.ts | 14 +- webapp/channels/src/plugins/export.js | 35 ++--- webapp/channels/src/plugins/index.js | 15 +- .../src/plugins/interactive_dialog.js | 6 +- .../mobile_channel_header_plug/index.ts | 17 +-- .../mobile_channel_header_plug.test.tsx | 9 +- .../mobile_channel_header_plug.tsx | 14 +- .../channels/src/plugins/pluggable/index.ts | 2 +- .../src/plugins/pluggable/pluggable.tsx | 10 +- webapp/channels/src/plugins/products.ts | 4 +- webapp/channels/src/plugins/registry.ts | 43 +++--- .../channels/src/plugins/rhs_plugin/index.ts | 6 +- .../src/plugins/test/post_type.test.jsx | 2 +- webapp/channels/src/plugins/textbox/index.tsx | 2 +- .../plugins/useGetPluginsActivationState.ts | 4 +- webapp/channels/src/reducers/index.ts | 2 +- webapp/channels/src/reducers/plugins/index.ts | 10 +- webapp/channels/src/reducers/storage.test.ts | 4 +- webapp/channels/src/reducers/storage.ts | 6 +- .../views/add_channel_cta_dropdown.ts | 2 +- .../reducers/views/add_channel_dropdown.ts | 2 +- .../src/reducers/views/browser.test.js | 1 + webapp/channels/src/reducers/views/browser.ts | 2 +- .../src/reducers/views/channel.test.js | 1 + .../reducers/views/channel_selector_modal.ts | 2 +- .../src/reducers/views/channel_sidebar.ts | 11 +- webapp/channels/src/reducers/views/drafts.ts | 4 +- webapp/channels/src/reducers/views/i18n.ts | 4 +- webapp/channels/src/reducers/views/index.ts | 34 ++--- .../channels/src/reducers/views/lhs.test.ts | 3 +- webapp/channels/src/reducers/views/lhs.ts | 4 +- .../src/reducers/views/marketplace.test.ts | 2 + .../src/reducers/views/marketplace.ts | 3 +- .../src/reducers/views/modals.test.tsx | 2 +- webapp/channels/src/reducers/views/modals.ts | 6 +- .../src/reducers/views/onboarding_tasks.ts | 2 +- .../src/reducers/views/product_menu.ts | 2 +- .../channels/src/reducers/views/rhs.test.js | 1 + webapp/channels/src/reducers/views/rhs.ts | 5 +- .../src/reducers/views/rhs_suppressed.test.ts | 2 +- .../src/reducers/views/rhs_suppressed.ts | 5 +- .../src/reducers/views/search.test.js | 1 + webapp/channels/src/reducers/views/search.ts | 4 +- .../channels/src/reducers/views/settings.ts | 4 +- .../src/reducers/views/status_dropdown.ts | 2 +- .../src/reducers/views/textbox.test.js | 2 +- webapp/channels/src/reducers/views/threads.ts | 9 +- webapp/channels/src/selectors/actions_menu.ts | 6 +- .../channels/src/selectors/admin_console.jsx | 2 +- .../src/selectors/admin_console.test.jsx | 4 +- webapp/channels/src/selectors/calls.ts | 6 +- webapp/channels/src/selectors/cloud.ts | 6 +- webapp/channels/src/selectors/drafts.test.ts | 3 +- webapp/channels/src/selectors/drafts.ts | 9 +- webapp/channels/src/selectors/emojis.ts | 11 +- webapp/channels/src/selectors/i18n.ts | 6 +- webapp/channels/src/selectors/lhs.test.ts | 3 +- webapp/channels/src/selectors/lhs.ts | 12 +- .../channels/src/selectors/local_storage.ts | 4 +- .../channels/src/selectors/onboarding.test.ts | 7 +- webapp/channels/src/selectors/onboarding.ts | 6 +- webapp/channels/src/selectors/plugins.ts | 14 +- webapp/channels/src/selectors/posts.ts | 5 +- webapp/channels/src/selectors/preferences.ts | 3 +- webapp/channels/src/selectors/products.ts | 8 +- webapp/channels/src/selectors/rhs.test.ts | 3 +- webapp/channels/src/selectors/rhs.ts | 16 ++- webapp/channels/src/selectors/storage.test.ts | 6 +- webapp/channels/src/selectors/urls.ts | 10 +- .../selectors/views/add_channel_dropdown.ts | 2 +- .../channels/src/selectors/views/browser.ts | 2 +- .../channels/src/selectors/views/channel.ts | 2 +- .../src/selectors/views/channel_sidebar.ts | 20 +-- .../src/selectors/views/custom_status.test.ts | 9 +- .../src/selectors/views/custom_status.ts | 15 +- .../src/selectors/views/marketplace.test.ts | 5 +- .../src/selectors/views/marketplace.ts | 2 +- .../src/selectors/views/onboarding_tasks.ts | 2 +- .../selectors/views/status_dropdown.test.ts | 2 +- .../src/selectors/views/status_dropdown.ts | 2 +- .../src/selectors/views/threads.test.ts | 2 +- .../channels/src/selectors/views/threads.ts | 19 +-- webapp/channels/src/store/index.js | 3 +- webapp/channels/src/stores/hooks.ts | 2 +- .../src/stores/local_storage_store.ts | 3 +- webapp/channels/src/tests/constants/cloud.ts | 2 +- webapp/channels/src/tests/constants/teams.ts | 3 +- webapp/channels/src/tests/constants/users.ts | 4 +- .../src/tests/helpers/intl-test-helper.tsx | 21 +-- .../tests/helpers/markdown_hotkey_helpers.js | 2 +- .../tests/helpers/themed-intl-test-helper.tsx | 3 +- .../src/tests/react_testing_utils.test.tsx | 6 +- .../src/tests/react_testing_utils.tsx | 7 +- webapp/channels/src/tests/setup.js | 2 +- webapp/channels/src/tests/test_store.tsx | 12 +- webapp/channels/src/types/actions.ts | 2 +- webapp/channels/src/types/apps.ts | 6 +- webapp/channels/src/types/cloud/sku.ts | 2 +- .../src/types/external/react-bootstrap.d.ts | 2 +- webapp/channels/src/types/products.d.ts | 4 +- webapp/channels/src/types/store/draft.ts | 4 +- webapp/channels/src/types/store/index.ts | 6 +- webapp/channels/src/types/store/lhs.ts | 2 +- webapp/channels/src/types/store/plugins.ts | 24 ++-- webapp/channels/src/types/store/rhs.ts | 11 +- webapp/channels/src/types/store/views.ts | 18 +-- .../src/utils/admin_console_index.tsx | 6 +- .../utils/admin_console_plugin_index.test.ts | 2 +- .../src/utils/admin_console_plugin_index.ts | 9 +- webapp/channels/src/utils/apps.ts | 3 +- webapp/channels/src/utils/browser_history.tsx | 8 +- webapp/channels/src/utils/channel_utils.tsx | 19 ++- webapp/channels/src/utils/cloud_utils.ts | 4 +- webapp/channels/src/utils/constants.tsx | 15 +- webapp/channels/src/utils/emoji_map.ts | 2 +- webapp/channels/src/utils/emoji_utils.tsx | 2 +- webapp/channels/src/utils/file_utils.tsx | 3 +- .../channels/src/utils/filter_users.test.ts | 3 +- webapp/channels/src/utils/hosted_customer.ts | 4 +- .../channels/src/utils/license_utils.test.ts | 3 +- webapp/channels/src/utils/license_utils.ts | 4 +- webapp/channels/src/utils/limits.tsx | 4 +- webapp/channels/src/utils/limits_test.tsx | 2 +- webapp/channels/src/utils/markdown/index.ts | 6 +- .../markdown/link_only_renderer.test.tsx | 2 +- .../channels/src/utils/markdown/renderer.tsx | 9 +- .../src/utils/message_html_to_component.jsx | 6 +- .../utils/message_html_to_component.test.jsx | 6 +- .../channels/src/utils/notification_sounds.ts | 9 +- webapp/channels/src/utils/notifications.ts | 4 +- webapp/channels/src/utils/paste.tsx | 4 +- .../src/utils/policy_roles_adapter.test.ts | 3 +- .../src/utils/policy_roles_adapter.ts | 3 +- webapp/channels/src/utils/post_utils.test.tsx | 8 +- webapp/channels/src/utils/post_utils.ts | 37 +++-- webapp/channels/src/utils/products.ts | 10 +- webapp/channels/src/utils/route.test.ts | 8 +- webapp/channels/src/utils/route.tsx | 9 +- webapp/channels/src/utils/storage_utils.ts | 5 +- .../src/utils/syntax_highlighting.test.ts | 2 +- webapp/channels/src/utils/team_utils.test.ts | 5 +- webapp/channels/src/utils/team_utils.tsx | 2 +- webapp/channels/src/utils/test_helper.ts | 39 +++--- .../src/utils/text_formatting.test.ts | 7 +- webapp/channels/src/utils/text_formatting.tsx | 8 +- .../utils/text_formatting_at_mentions.test.ts | 2 +- .../text_formatting_channel_links.test.ts | 4 +- .../src/utils/text_formatting_email.test.ts | 2 +- .../utils/text_formatting_hashtags.test.ts | 2 +- .../src/utils/text_formatting_imgs.test.ts | 2 +- .../src/utils/text_formatting_links.test.ts | 2 +- ...xt_formatting_mention_highlighting.test.ts | 2 +- ...ext_formatting_search_highlighting.test.ts | 2 +- webapp/channels/src/utils/turndown.ts | 2 +- webapp/channels/src/utils/url.tsx | 10 +- .../src/utils/use_websocket/context.ts | 2 +- .../channels/src/utils/use_websocket/hooks.ts | 2 +- webapp/channels/src/utils/utils.test.tsx | 10 +- webapp/channels/src/utils/utils.tsx | 62 ++++----- 2342 files changed, 12353 insertions(+), 11153 deletions(-) create mode 100644 webapp/channels/src/components/user_group_popover/constants.ts diff --git a/webapp/channels/.eslintrc.json b/webapp/channels/.eslintrc.json index 2451b34711..7097986c7e 100644 --- a/webapp/channels/.eslintrc.json +++ b/webapp/channels/.eslintrc.json @@ -37,19 +37,50 @@ "eol-last": ["error", "always"], "import/no-unresolved": 2, "import/order": [ - 0, + 2, { - "newlines-between": "always-and-inside-groups", + "newlines-between": "always", "groups": [ "builtin", "external", - [ - "internal", - "parent" - ], + "internal", "sibling", + "parent", "index" - ] + ], + "pathGroups": [ + { + "pattern": "@mattermost/**", + "group": "external", + "position": "after" + }, + { + "pattern": "mattermost-redux/**", + "group": "external", + "position": "after" + }, + { + "pattern": "@(selectors|actions|stores|store|reducers){,/**}", + "group": "external", + "position": "after" + }, + { + "pattern": "components/**", + "group": "external", + "position": "after" + }, + { + "pattern": "types{,/**}", + "group": "internal", + "position": "after" + } + ], + "alphabetize": { + "order": "asc", + "caseInsensitive": true + }, + "distinctGroup": true, + "pathGroupsExcludedImportTypes": ["builtin"] } ], "no-undefined": 0, @@ -95,7 +126,8 @@ } ], "max-lines": ["warn", {"max": 800, "skipBlankLines": true, "skipComments": true}], - "formatjs/no-multiple-whitespaces": 2 + "formatjs/no-multiple-whitespaces": 2, + "@typescript-eslint/consistent-type-imports": ["error", {"disallowTypeAnnotations": false}] }, "overrides": [ { diff --git a/webapp/channels/src/actions/admin_actions.jsx b/webapp/channels/src/actions/admin_actions.jsx index fc60696af9..8831620e46 100644 --- a/webapp/channels/src/actions/admin_actions.jsx +++ b/webapp/channels/src/actions/admin_actions.jsx @@ -2,16 +2,16 @@ // See LICENSE.txt for license information. import * as AdminActions from 'mattermost-redux/actions/admin'; -import * as UserActions from 'mattermost-redux/actions/users'; -import * as TeamActions from 'mattermost-redux/actions/teams'; -import {Client4} from 'mattermost-redux/client'; import {bindClientFunc} from 'mattermost-redux/actions/helpers'; - -import {trackEvent} from 'actions/telemetry_actions.jsx'; +import * as TeamActions from 'mattermost-redux/actions/teams'; +import * as UserActions from 'mattermost-redux/actions/users'; +import {Client4} from 'mattermost-redux/client'; import {emitUserLoggedOutEvent} from 'actions/global_actions'; +import {trackEvent} from 'actions/telemetry_actions.jsx'; import {getOnNavigationConfirmed} from 'selectors/views/admin'; import store from 'stores/redux_store.jsx'; + import {ActionTypes} from 'utils/constants'; const dispatch = store.dispatch; diff --git a/webapp/channels/src/actions/apps.ts b/webapp/channels/src/actions/apps.ts index ae91dfa102..863b88e01b 100644 --- a/webapp/channels/src/actions/apps.ts +++ b/webapp/channels/src/actions/apps.ts @@ -1,23 +1,23 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import type {AppCallResponse, AppForm, AppCallRequest, AppContext, AppBinding} from '@mattermost/types/apps'; +import type {CommandArgs} from '@mattermost/types/integrations'; +import type {Post} from '@mattermost/types/posts'; + import {Client4} from 'mattermost-redux/client'; -import {Action, ActionFunc, DispatchFunc} from 'mattermost-redux/types/actions'; -import {AppCallResponse, AppForm, AppCallRequest, AppContext, AppBinding} from '@mattermost/types/apps'; import {AppCallResponseTypes} from 'mattermost-redux/constants/apps'; -import {Post} from '@mattermost/types/posts'; -import {CommandArgs} from '@mattermost/types/integrations'; +import type {Action, ActionFunc, DispatchFunc} from 'mattermost-redux/types/actions'; +import {cleanForm} from 'mattermost-redux/utils/apps'; import {openModal} from 'actions/views/modals'; import AppsForm from 'components/apps_form'; +import {createCallRequest, makeCallErrorResponse} from 'utils/apps'; +import {getHistory} from 'utils/browser_history'; import {ModalIdentifiers} from 'utils/constants'; import {getSiteURL, shouldOpenInNewTab} from 'utils/url'; -import {getHistory} from 'utils/browser_history'; -import {createCallRequest, makeCallErrorResponse} from 'utils/apps'; - -import {cleanForm} from 'mattermost-redux/utils/apps'; import {sendEphemeralPost} from './global_actions'; @@ -114,9 +114,7 @@ export function doAppSubmit(inCall: AppCallRequest, intl: any): Act window.open(res.navigate_to_url); return {data: res}; } - const navigateURL = res.navigate_to_url.startsWith(getSiteURL()) ? - res.navigate_to_url.slice(getSiteURL().length) : - res.navigate_to_url; + const navigateURL = res.navigate_to_url.startsWith(getSiteURL()) ? res.navigate_to_url.slice(getSiteURL().length) : res.navigate_to_url; getHistory().push(navigateURL); return {data: res}; } diff --git a/webapp/channels/src/actions/channel_actions.test.ts b/webapp/channels/src/actions/channel_actions.test.ts index aac40512ec..d13d73782b 100644 --- a/webapp/channels/src/actions/channel_actions.test.ts +++ b/webapp/channels/src/actions/channel_actions.test.ts @@ -3,6 +3,13 @@ import nock from 'nock'; +import type {Channel} from '@mattermost/types/channels'; +import type {Role} from '@mattermost/types/roles'; +import type {Team} from '@mattermost/types/teams'; +import type {UserProfile} from '@mattermost/types/users'; + +import {Client4} from 'mattermost-redux/client'; + import { searchMoreChannels, addUsersToChannel, @@ -10,18 +17,12 @@ import { openGroupChannelToUserIds, loadChannelsForCurrentUser, fetchChannelsAndMembers, } from 'actions/channel_actions'; -import {loadProfilesForSidebar} from 'actions/user_actions'; import {CHANNELS_AND_CHANNEL_MEMBERS_PER_PAGE} from 'actions/channel_queries'; +import {loadProfilesForSidebar} from 'actions/user_actions'; +import configureStore from 'store'; -import {Channel} from '@mattermost/types/channels'; -import {Team} from '@mattermost/types/teams'; -import {UserProfile} from '@mattermost/types/users'; -import {Role} from '@mattermost/types/roles'; - -import {Client4} from 'mattermost-redux/client'; import TestHelper from 'packages/mattermost-redux/test/test_helper'; import mockStore from 'tests/test_store'; -import configureStore from 'store'; const initialState = { entities: { diff --git a/webapp/channels/src/actions/channel_actions.ts b/webapp/channels/src/actions/channel_actions.ts index 0add017514..629ea07c8f 100644 --- a/webapp/channels/src/actions/channel_actions.ts +++ b/webapp/channels/src/actions/channel_actions.ts @@ -3,34 +3,35 @@ import {batchActions} from 'redux-batched-actions'; -import {UserProfile} from '@mattermost/types/users'; -import {Channel, ChannelMembership, ServerChannel} from '@mattermost/types/channels'; -import {Team} from '@mattermost/types/teams'; -import {ServerError} from '@mattermost/types/errors'; -import {Role} from '@mattermost/types/roles'; +import type {Channel, ChannelMembership, ServerChannel} from '@mattermost/types/channels'; +import type {ServerError} from '@mattermost/types/errors'; +import type {Role} from '@mattermost/types/roles'; +import type {Team} from '@mattermost/types/teams'; +import type {UserProfile} from '@mattermost/types/users'; -import {Client4} from 'mattermost-redux/client'; import {ChannelTypes, PreferenceTypes, RoleTypes} from 'mattermost-redux/action_types'; import * as ChannelActions from 'mattermost-redux/actions/channels'; -import {savePreferences} from 'mattermost-redux/actions/preferences'; -import {ActionFunc} from 'mattermost-redux/types/actions'; import {logError} from 'mattermost-redux/actions/errors'; -import {getMyChannelMemberships} from 'mattermost-redux/selectors/entities/common'; +import {savePreferences} from 'mattermost-redux/actions/preferences'; +import {Client4} from 'mattermost-redux/client'; import {getChannelByName, getUnreadChannelIds, getChannel} from 'mattermost-redux/selectors/entities/channels'; +import {getMyChannelMemberships} from 'mattermost-redux/selectors/entities/common'; import {getCurrentTeamUrl, getCurrentTeamId} from 'mattermost-redux/selectors/entities/teams'; import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users'; +import type {ActionFunc} from 'mattermost-redux/types/actions'; -import {trackEvent} from 'actions/telemetry_actions.jsx'; -import {loadNewDMIfNeeded, loadNewGMIfNeeded, loadProfilesForSidebar} from 'actions/user_actions'; import { getChannelsAndChannelMembersQueryString, transformToReceivedChannelsReducerPayload, transformToReceivedChannelMembersReducerPayload, - ChannelsAndChannelMembersQueryResponseType, - GraphQLChannel, - GraphQLChannelMember, CHANNELS_AND_CHANNEL_MEMBERS_PER_PAGE, } from 'actions/channel_queries'; +import type { + ChannelsAndChannelMembersQueryResponseType, + GraphQLChannel, + GraphQLChannelMember} from 'actions/channel_queries'; +import {trackEvent} from 'actions/telemetry_actions.jsx'; +import {loadNewDMIfNeeded, loadNewGMIfNeeded, loadProfilesForSidebar} from 'actions/user_actions'; import {getHistory} from 'utils/browser_history'; import {Constants, Preferences, NotificationLevels} from 'utils/constants'; diff --git a/webapp/channels/src/actions/channel_queries.ts b/webapp/channels/src/actions/channel_queries.ts index d3a9d7f1f7..2f6ffcb68c 100644 --- a/webapp/channels/src/actions/channel_queries.ts +++ b/webapp/channels/src/actions/channel_queries.ts @@ -1,10 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {ChannelMembership, ServerChannel, ChannelType} from '@mattermost/types/channels'; -import {Role} from '@mattermost/types/roles'; -import {Team} from '@mattermost/types/teams'; -import {UserProfile} from '@mattermost/types/users'; +import type {ChannelMembership, ServerChannel, ChannelType} from '@mattermost/types/channels'; +import type {Role} from '@mattermost/types/roles'; +import type {Team} from '@mattermost/types/teams'; +import type {UserProfile} from '@mattermost/types/users'; import {convertRolesNamesArrayToString} from 'mattermost-redux/actions/roles'; diff --git a/webapp/channels/src/actions/cloud.tsx b/webapp/channels/src/actions/cloud.tsx index ff9e83f336..6a5d779721 100644 --- a/webapp/channels/src/actions/cloud.tsx +++ b/webapp/channels/src/actions/cloud.tsx @@ -1,22 +1,24 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {Stripe} from '@stripe/stripe-js'; +import type {Stripe} from '@stripe/stripe-js'; import {getCode} from 'country-list'; +import type {Address, Feedback, WorkspaceDeletionRequest} from '@mattermost/types/cloud'; + +import {CloudTypes} from 'mattermost-redux/action_types'; import {getCloudCustomer, getCloudProducts, getCloudSubscription, getInvoices} from 'mattermost-redux/actions/cloud'; import {Client4} from 'mattermost-redux/client'; import {getCloudErrors} from 'mattermost-redux/selectors/entities/cloud'; -import {ActionFunc, DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; - -import {getConfirmCardSetup} from 'components/payment_form/stripe'; +import type {ActionFunc, DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; import {trackEvent} from 'actions/telemetry_actions.jsx'; -import {StripeSetupIntent, BillingDetails} from 'types/cloud/sku'; -import {CloudTypes} from 'mattermost-redux/action_types'; +import {getConfirmCardSetup} from 'components/payment_form/stripe'; + import {getBlankAddressWithCountry} from 'utils/utils'; -import {Address, Feedback, WorkspaceDeletionRequest} from '@mattermost/types/cloud'; + +import type {StripeSetupIntent, BillingDetails} from 'types/cloud/sku'; // Returns true for success, and false for any error export function completeStripeAddPaymentMethod( diff --git a/webapp/channels/src/actions/command.test.js b/webapp/channels/src/actions/command.test.js index de9a9b01be..e35058051a 100644 --- a/webapp/channels/src/actions/command.test.js +++ b/webapp/channels/src/actions/command.test.js @@ -2,23 +2,20 @@ // See LICENSE.txt for license information. import {Client4} from 'mattermost-redux/client'; - +import {Permissions} from 'mattermost-redux/constants'; +import {AppCallResponseTypes} from 'mattermost-redux/constants/apps'; import * as Channels from 'mattermost-redux/selectors/entities/channels'; import * as Teams from 'mattermost-redux/selectors/entities/teams'; -import {Permissions} from 'mattermost-redux/constants'; -import {AppCallResponseTypes} from 'mattermost-redux/constants/apps'; - import * as GlobalActions from 'actions/global_actions'; -import mockStore from 'tests/test_store'; +import UserSettingsModal from 'components/user_settings/modal'; +import mockStore from 'tests/test_store'; import {ActionTypes, Constants, ModalIdentifiers} from 'utils/constants'; import * as UserAgent from 'utils/user_agent'; import * as Utils from 'utils/utils'; -import UserSettingsModal from 'components/user_settings/modal'; - import {executeCommand} from './command'; const currentChannelId = '123'; diff --git a/webapp/channels/src/actions/command.ts b/webapp/channels/src/actions/command.ts index 2825b996ba..c1bd3a5edb 100644 --- a/webapp/channels/src/actions/command.ts +++ b/webapp/channels/src/actions/command.ts @@ -1,43 +1,41 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {Client4} from 'mattermost-redux/client'; -import {unfavoriteChannel} from 'mattermost-redux/actions/channels'; -import {savePreferences} from 'mattermost-redux/actions/preferences'; -import {getCurrentChannel, getRedirectChannelNameForTeam, isFavoriteChannel} from 'mattermost-redux/selectors/entities/channels'; -import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users'; -import {getCurrentRelativeTeamUrl, getCurrentTeamId} from 'mattermost-redux/selectors/entities/teams'; -import {appsEnabled} from 'mattermost-redux/selectors/entities/apps'; -import {IntegrationTypes} from 'mattermost-redux/action_types'; -import {ActionFunc, DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; import type {CommandArgs} from '@mattermost/types/integrations'; +import {IntegrationTypes} from 'mattermost-redux/action_types'; +import {unfavoriteChannel} from 'mattermost-redux/actions/channels'; +import {savePreferences} from 'mattermost-redux/actions/preferences'; +import {Client4} from 'mattermost-redux/client'; +import {Permissions} from 'mattermost-redux/constants'; import {AppCallResponseTypes} from 'mattermost-redux/constants/apps'; +import {appsEnabled} from 'mattermost-redux/selectors/entities/apps'; +import {getCurrentChannel, getRedirectChannelNameForTeam, isFavoriteChannel} from 'mattermost-redux/selectors/entities/channels'; +import {isMarketplaceEnabled} from 'mattermost-redux/selectors/entities/general'; +import {haveICurrentTeamPermission} from 'mattermost-redux/selectors/entities/roles'; +import {getCurrentRelativeTeamUrl, getCurrentTeamId} from 'mattermost-redux/selectors/entities/teams'; +import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users'; +import type {ActionFunc, DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; -import {DoAppCallResult} from 'types/apps'; - -import {openModal} from 'actions/views/modals'; import * as GlobalActions from 'actions/global_actions'; import * as PostActions from 'actions/post_actions'; +import {openModal} from 'actions/views/modals'; -import {isUrlSafe, getSiteURL} from 'utils/url'; -import {localizeMessage, getUserIdFromChannelName} from 'utils/utils'; -import * as UserAgent from 'utils/user_agent'; -import {Constants, ModalIdentifiers} from 'utils/constants'; -import {getHistory} from 'utils/browser_history'; - -import UserSettingsModal from 'components/user_settings/modal'; +import KeyboardShortcutsModal from 'components/keyboard_shortcuts/keyboard_shortcuts_modal/keyboard_shortcuts_modal'; +import LeaveChannelModal from 'components/leave_channel_modal'; +import MarketplaceModal from 'components/plugin_marketplace/marketplace_modal'; import {AppCommandParser} from 'components/suggestion/command_provider/app_command_parser/app_command_parser'; import {intlShim} from 'components/suggestion/command_provider/app_command_parser/app_command_parser_dependencies'; -import LeaveChannelModal from 'components/leave_channel_modal'; -import KeyboardShortcutsModal from 'components/keyboard_shortcuts/keyboard_shortcuts_modal/keyboard_shortcuts_modal'; +import UserSettingsModal from 'components/user_settings/modal'; -import {GlobalState} from 'types/store'; +import {getHistory} from 'utils/browser_history'; +import {Constants, ModalIdentifiers} from 'utils/constants'; +import {isUrlSafe, getSiteURL} from 'utils/url'; +import * as UserAgent from 'utils/user_agent'; +import {localizeMessage, getUserIdFromChannelName} from 'utils/utils'; -import MarketplaceModal from 'components/plugin_marketplace/marketplace_modal'; -import {haveICurrentTeamPermission} from 'mattermost-redux/selectors/entities/roles'; -import {Permissions} from 'mattermost-redux/constants'; -import {isMarketplaceEnabled} from 'mattermost-redux/selectors/entities/general'; +import type {DoAppCallResult} from 'types/apps'; +import type {GlobalState} from 'types/store'; import {doAppSubmit, openAppsModal, postEphemeralCallResponseForCommandArgs} from './apps'; import {trackEvent} from './telemetry_actions'; diff --git a/webapp/channels/src/actions/emoji_actions.js b/webapp/channels/src/actions/emoji_actions.js index f704572b82..0e38996d68 100644 --- a/webapp/channels/src/actions/emoji_actions.js +++ b/webapp/channels/src/actions/emoji_actions.js @@ -2,14 +2,13 @@ // See LICENSE.txt for license information. import * as EmojiActions from 'mattermost-redux/actions/emojis'; +import {savePreferences} from 'mattermost-redux/actions/preferences'; import {getCustomEmojisByName} from 'mattermost-redux/selectors/entities/emojis'; import {getConfig} from 'mattermost-redux/selectors/entities/general'; import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users'; import {getEmojiMap, getRecentEmojisData, getRecentEmojisNames, isCustomEmojiEnabled} from 'selectors/emojis'; import {isCustomStatusEnabled, makeGetCustomStatus} from 'selectors/views/custom_status'; -import {savePreferences} from 'mattermost-redux/actions/preferences'; - import LocalStorageStore from 'stores/local_storage_store'; import Constants, {ActionTypes, Preferences} from 'utils/constants'; diff --git a/webapp/channels/src/actions/emoji_actions.test.js b/webapp/channels/src/actions/emoji_actions.test.js index 741ed3cf45..2406fa5988 100644 --- a/webapp/channels/src/actions/emoji_actions.test.js +++ b/webapp/channels/src/actions/emoji_actions.test.js @@ -1,10 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {getRecentEmojisData, getEmojiMap} from 'selectors/emojis'; -import * as EmojiActions from 'actions/emoji_actions'; import * as PreferenceActions from 'mattermost-redux/actions/preferences'; +import * as EmojiActions from 'actions/emoji_actions'; +import {getRecentEmojisData, getEmojiMap} from 'selectors/emojis'; + import mockStore from 'tests/test_store'; const currentUserId = 'current_user_id'; diff --git a/webapp/channels/src/actions/file_actions.ts b/webapp/channels/src/actions/file_actions.ts index 0804ed3c1d..a9101b232f 100644 --- a/webapp/channels/src/actions/file_actions.ts +++ b/webapp/channels/src/actions/file_actions.ts @@ -3,15 +3,16 @@ import {batchActions} from 'redux-batched-actions'; -import {FileInfo} from '@mattermost/types/files'; -import {ServerError} from '@mattermost/types/errors'; +import type {ServerError} from '@mattermost/types/errors'; +import type {FileInfo} from '@mattermost/types/files'; import {FileTypes} from 'mattermost-redux/action_types'; import {getLogErrorAction} from 'mattermost-redux/actions/errors'; import {forceLogoutIfNecessary} from 'mattermost-redux/actions/helpers'; -import {DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; import {Client4} from 'mattermost-redux/client'; -import {FilePreviewInfo} from 'components/file_preview/file_preview'; +import type {DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; + +import type {FilePreviewInfo} from 'components/file_preview/file_preview'; import {localizeMessage} from 'utils/utils'; @@ -92,8 +93,7 @@ export function uploadFile({file, name, type, rootId, channelId, clientId, onPro try { const errorResponse = JSON.parse(xhr.response); errorMessage = - (errorResponse?.id && errorResponse?.message) ? localizeMessage(errorResponse.id, errorResponse.message) : - localizeMessage('file_upload.generic_error', 'There was a problem uploading your files.'); + (errorResponse?.id && errorResponse?.message) ? localizeMessage(errorResponse.id, errorResponse.message) : localizeMessage('file_upload.generic_error', 'There was a problem uploading your files.'); } catch (e) { errorMessage = localizeMessage('file_upload.generic_error', 'There was a problem uploading your files.'); } @@ -128,9 +128,7 @@ export function uploadFile({file, name, type, rootId, channelId, clientId, onPro dispatch(batchActions([uploadFailureAction, getLogErrorAction(errorResponse)])); onError(errorResponse, clientId, channelId, rootId); } else { - const errorMessage = xhr.status === 0 || !xhr.status ? - localizeMessage('file_upload.generic_error', 'There was a problem uploading your files.') : - localizeMessage('channel_loader.unknown_error', 'We received an unexpected status code from the server.') + ' (' + xhr.status + ')'; + const errorMessage = xhr.status === 0 || !xhr.status ? localizeMessage('file_upload.generic_error', 'There was a problem uploading your files.') : localizeMessage('channel_loader.unknown_error', 'We received an unexpected status code from the server.') + ' (' + xhr.status + ')'; dispatch({ type: FileTypes.UPLOAD_FILES_FAILURE, diff --git a/webapp/channels/src/actions/global_actions.test.ts b/webapp/channels/src/actions/global_actions.test.ts index 962eba9a6e..cc3d2097d1 100644 --- a/webapp/channels/src/actions/global_actions.test.ts +++ b/webapp/channels/src/actions/global_actions.test.ts @@ -1,17 +1,17 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {UserProfile} from '@mattermost/types/users'; -import {Team} from '@mattermost/types/teams'; +import type {Team} from '@mattermost/types/teams'; +import type {UserProfile} from '@mattermost/types/users'; -import {getHistory} from 'utils/browser_history'; -import {closeRightHandSide, closeMenu as closeRhsMenu} from 'actions/views/rhs'; +import {redirectUserToDefaultTeam, toggleSideBarRightMenuAction, getTeamRedirectChannelIfIsAccesible} from 'actions/global_actions'; import {close as closeLhs} from 'actions/views/lhs'; +import {closeRightHandSide, closeMenu as closeRhsMenu} from 'actions/views/rhs'; import LocalStorageStore from 'stores/local_storage_store'; import reduxStore from 'stores/redux_store'; -import {redirectUserToDefaultTeam, toggleSideBarRightMenuAction, getTeamRedirectChannelIfIsAccesible} from 'actions/global_actions'; import mockStore from 'tests/test_store'; +import {getHistory} from 'utils/browser_history'; jest.mock('actions/views/rhs', () => ({ closeMenu: jest.fn(), diff --git a/webapp/channels/src/actions/global_actions.tsx b/webapp/channels/src/actions/global_actions.tsx index 7f05e89177..147629773f 100644 --- a/webapp/channels/src/actions/global_actions.tsx +++ b/webapp/channels/src/actions/global_actions.tsx @@ -3,6 +3,13 @@ import {batchActions} from 'redux-batched-actions'; +import type {Channel, ChannelMembership} from '@mattermost/types/channels'; +import type {Post} from '@mattermost/types/posts'; +import type {Team} from '@mattermost/types/teams'; +import type {UserProfile} from '@mattermost/types/users'; + +import {ChannelTypes} from 'mattermost-redux/action_types'; +import {fetchAppBindings} from 'mattermost-redux/actions/apps'; import { fetchMyChannelsAndMembersREST, getChannelByNameAndTeamName, @@ -11,42 +18,37 @@ import { } from 'mattermost-redux/actions/channels'; import {logout, loadMe, loadMeREST} from 'mattermost-redux/actions/users'; import {Preferences} from 'mattermost-redux/constants'; -import {getConfig, isPerformanceDebuggingEnabled} from 'mattermost-redux/selectors/entities/general'; -import {getCurrentTeamId, getMyTeams, getTeam, getMyTeamMember, getTeamMemberships, getActiveTeamsList} from 'mattermost-redux/selectors/entities/teams'; -import {getBool, getIsOnboardingFlowEnabled, isCollapsedThreadsEnabled, isGraphQLEnabled} from 'mattermost-redux/selectors/entities/preferences'; -import {getCurrentUser, getCurrentUserId, isFirstAdmin} from 'mattermost-redux/selectors/entities/users'; -import {getCurrentChannelStats, getCurrentChannelId, getMyChannelMember, getRedirectChannelNameForTeam, getChannelsNameMapInTeam, getAllDirectChannels, getChannelMessageCount} from 'mattermost-redux/selectors/entities/channels'; import {appsEnabled} from 'mattermost-redux/selectors/entities/apps'; -import {ChannelTypes} from 'mattermost-redux/action_types'; -import {fetchAppBindings} from 'mattermost-redux/actions/apps'; -import {Channel, ChannelMembership} from '@mattermost/types/channels'; -import {UserProfile} from '@mattermost/types/users'; -import {Post} from '@mattermost/types/posts'; -import {ActionFunc, DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; -import {Team} from '@mattermost/types/teams'; +import {getCurrentChannelStats, getCurrentChannelId, getMyChannelMember, getRedirectChannelNameForTeam, getChannelsNameMapInTeam, getAllDirectChannels, getChannelMessageCount} from 'mattermost-redux/selectors/entities/channels'; +import {getConfig, isPerformanceDebuggingEnabled} from 'mattermost-redux/selectors/entities/general'; +import {getBool, getIsOnboardingFlowEnabled, isCollapsedThreadsEnabled, isGraphQLEnabled} from 'mattermost-redux/selectors/entities/preferences'; +import {getCurrentTeamId, getMyTeams, getTeam, getMyTeamMember, getTeamMemberships, getActiveTeamsList} from 'mattermost-redux/selectors/entities/teams'; +import {getCurrentUser, getCurrentUserId, isFirstAdmin} from 'mattermost-redux/selectors/entities/users'; +import type {ActionFunc, DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; import {calculateUnreadCount} from 'mattermost-redux/utils/channel_utils'; -import {getHistory} from 'utils/browser_history'; import {handleNewPost} from 'actions/post_actions'; import {stopPeriodicStatusUpdates} from 'actions/status_actions'; import {loadProfilesForSidebar} from 'actions/user_actions'; -import {closeRightHandSide, closeMenu as closeRhsMenu, updateRhsState} from 'actions/views/rhs'; import {clearUserCookie} from 'actions/views/cookie'; import {close as closeLhs} from 'actions/views/lhs'; +import {closeRightHandSide, closeMenu as closeRhsMenu, updateRhsState} from 'actions/views/rhs'; import * as WebsocketActions from 'actions/websocket_actions.jsx'; import {getCurrentLocale} from 'selectors/i18n'; import {getIsRhsOpen, getPreviousRhsState, getRhsState} from 'selectors/rhs'; import BrowserStore from 'stores/browser_store'; -import store from 'stores/redux_store.jsx'; import LocalStorageStore from 'stores/local_storage_store'; +import store from 'stores/redux_store.jsx'; + +import SubMenuModal from 'components/widgets/menu/menu_modals/submenu_modal/submenu_modal'; + import WebSocketClient from 'client/web_websocket_client.jsx'; - -import {GlobalState} from 'types/store'; - +import {getHistory} from 'utils/browser_history'; import {ActionTypes, PostTypes, RHSStates, ModalIdentifiers, PreviousViewedTypes} from 'utils/constants'; import {filterAndSortTeamsByDisplayName} from 'utils/team_utils'; import * as Utils from 'utils/utils'; -import SubMenuModal from '../components/widgets/menu/menu_modals/submenu_modal/submenu_modal'; + +import type {GlobalState} from 'types/store'; import {openModal} from './views/modals'; diff --git a/webapp/channels/src/actions/hooks.test.js b/webapp/channels/src/actions/hooks.test.js index 125f0349ce..971b8532eb 100644 --- a/webapp/channels/src/actions/hooks.test.js +++ b/webapp/channels/src/actions/hooks.test.js @@ -2,6 +2,7 @@ // See LICENSE.txt for license information. import {General} from 'mattermost-redux/constants'; + import mockStore from 'tests/test_store'; import { diff --git a/webapp/channels/src/actions/hosted_customer.tsx b/webapp/channels/src/actions/hosted_customer.tsx index 4e7d1d6ad8..0a6a3743da 100644 --- a/webapp/channels/src/actions/hosted_customer.tsx +++ b/webapp/channels/src/actions/hosted_customer.tsx @@ -1,22 +1,23 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {Stripe} from '@stripe/stripe-js'; - +import type {Stripe} from '@stripe/stripe-js'; import {getCode} from 'country-list'; -import {CreateSubscriptionRequest} from '@mattermost/types/cloud'; -import {SelfHostedExpansionRequest, SelfHostedSignupProgress} from '@mattermost/types/hosted_customer'; -import {ValueOf} from '@mattermost/types/utilities'; +import type {CreateSubscriptionRequest} from '@mattermost/types/cloud'; +import type {SelfHostedExpansionRequest} from '@mattermost/types/hosted_customer'; +import {SelfHostedSignupProgress} from '@mattermost/types/hosted_customer'; +import type {ValueOf} from '@mattermost/types/utilities'; -import {Client4} from 'mattermost-redux/client'; import {HostedCustomerTypes} from 'mattermost-redux/action_types'; -import {ActionFunc, DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; +import {bindClientFunc} from 'mattermost-redux/actions/helpers'; +import {Client4} from 'mattermost-redux/client'; import {getSelfHostedErrors} from 'mattermost-redux/selectors/entities/hosted_customer'; -import {StripeSetupIntent, BillingDetails} from 'types/cloud/sku'; +import type {ActionFunc, DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; import {getConfirmCardSetup} from 'components/payment_form/stripe'; -import {bindClientFunc} from 'mattermost-redux/actions/helpers'; + +import type {StripeSetupIntent, BillingDetails} from 'types/cloud/sku'; function selfHostedNeedsConfirmation(progress: ValueOf): boolean { switch (progress) { diff --git a/webapp/channels/src/actions/integration_actions.jsx b/webapp/channels/src/actions/integration_actions.jsx index 0d996ee216..d8a4b384cc 100644 --- a/webapp/channels/src/actions/integration_actions.jsx +++ b/webapp/channels/src/actions/integration_actions.jsx @@ -3,8 +3,8 @@ import * as IntegrationActions from 'mattermost-redux/actions/integrations'; import {getProfilesByIds} from 'mattermost-redux/actions/users'; -import {getUser} from 'mattermost-redux/selectors/entities/users'; import {appsEnabled} from 'mattermost-redux/selectors/entities/apps'; +import {getUser} from 'mattermost-redux/selectors/entities/users'; const DEFAULT_PAGE_SIZE = 100; diff --git a/webapp/channels/src/actions/integration_actions.test.js b/webapp/channels/src/actions/integration_actions.test.js index 3b253b044d..be9328ccef 100644 --- a/webapp/channels/src/actions/integration_actions.test.js +++ b/webapp/channels/src/actions/integration_actions.test.js @@ -3,10 +3,10 @@ import {getProfilesByIds} from 'mattermost-redux/actions/users'; -import mockStore from 'tests/test_store'; - import * as Actions from 'actions/integration_actions.jsx'; +import mockStore from 'tests/test_store'; + jest.mock('mattermost-redux/actions/users', () => ({ getProfilesByIds: jest.fn(() => { return {type: ''}; diff --git a/webapp/channels/src/actions/invite_actions.test.ts b/webapp/channels/src/actions/invite_actions.test.ts index e38a9be113..caf7e342b5 100644 --- a/webapp/channels/src/actions/invite_actions.test.ts +++ b/webapp/channels/src/actions/invite_actions.test.ts @@ -1,14 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {Channel} from '@mattermost/types/channels'; -import {UserProfile} from '@mattermost/types/users'; +import type {Channel} from '@mattermost/types/channels'; +import type {UserProfile} from '@mattermost/types/users'; -import {DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; +import type {DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; import {sendMembersInvites, sendGuestsInvites} from 'actions/invite_actions'; + import mockStore from 'tests/test_store'; -import {ConsolePages} from '../utils/constants'; +import {ConsolePages} from 'utils/constants'; jest.mock('actions/team_actions', () => ({ addUsersToTeam: () => ({ // since we are using addUsersToTeamGracefully, this call will always succeed diff --git a/webapp/channels/src/actions/invite_actions.ts b/webapp/channels/src/actions/invite_actions.ts index 5291d03c5a..e31e802040 100644 --- a/webapp/channels/src/actions/invite_actions.ts +++ b/webapp/channels/src/actions/invite_actions.ts @@ -1,23 +1,24 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {RelationOneToOne} from '@mattermost/types/utilities'; -import {UserProfile} from '@mattermost/types/users'; -import {Channel, ChannelMembership} from '@mattermost/types/channels'; -import {TeamMemberWithError, TeamInviteWithError} from '@mattermost/types/teams'; +import type {Channel, ChannelMembership} from '@mattermost/types/channels'; +import type {TeamMemberWithError, TeamInviteWithError} from '@mattermost/types/teams'; +import type {UserProfile} from '@mattermost/types/users'; +import type {RelationOneToOne} from '@mattermost/types/utilities'; -import {ActionFunc, DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; -import * as TeamActions from 'mattermost-redux/actions/teams'; import {joinChannel} from 'mattermost-redux/actions/channels'; -import {getTeamMember} from 'mattermost-redux/selectors/entities/teams'; +import * as TeamActions from 'mattermost-redux/actions/teams'; import {getChannelMembersInChannels} from 'mattermost-redux/selectors/entities/channels'; +import {getTeamMember} from 'mattermost-redux/selectors/entities/teams'; import {isCurrentUserSystemAdmin} from 'mattermost-redux/selectors/entities/users'; +import type {ActionFunc, DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; import {isGuest} from 'mattermost-redux/utils/user_utils'; import {addUsersToTeam} from 'actions/team_actions'; + +import {ConsolePages} from 'utils/constants'; import {t} from 'utils/i18n'; import {localizeMessage} from 'utils/utils'; -import {ConsolePages} from 'utils/constants'; export function sendMembersInvites(teamId: string, users: UserProfile[], emails: string[]): ActionFunc { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { diff --git a/webapp/channels/src/actions/marketplace.ts b/webapp/channels/src/actions/marketplace.ts index f462760c33..0c9cea536b 100644 --- a/webapp/channels/src/actions/marketplace.ts +++ b/webapp/channels/src/actions/marketplace.ts @@ -1,24 +1,25 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {Client4} from 'mattermost-redux/client'; - -import {getCurrentTeamId} from 'mattermost-redux/selectors/entities/teams'; -import {getCurrentChannelId} from 'mattermost-redux/selectors/entities/channels'; -import {appsEnabled} from 'mattermost-redux/selectors/entities/apps'; - -import {ActionFunc, DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; +import type {AppCall, AppExpand, AppFormValues} from '@mattermost/types/apps'; import type {MarketplaceApp, MarketplacePlugin} from '@mattermost/types/marketplace'; -import {GlobalState} from 'types/store'; +import {Client4} from 'mattermost-redux/client'; +import {AppBindingLocations, AppCallResponseTypes} from 'mattermost-redux/constants/apps'; +import {appsEnabled} from 'mattermost-redux/selectors/entities/apps'; +import {getCurrentChannelId} from 'mattermost-redux/selectors/entities/channels'; +import {getCurrentTeamId} from 'mattermost-redux/selectors/entities/teams'; +import type {ActionFunc, DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; import {getFilter, getPlugin} from 'selectors/views/marketplace'; + +import {intlShim} from 'components/suggestion/command_provider/app_command_parser/app_command_parser_dependencies'; +import type {DoAppCallResult} from 'components/suggestion/command_provider/app_command_parser/app_command_parser_dependencies'; + +import {createCallContext, createCallRequest} from 'utils/apps'; import {ActionTypes} from 'utils/constants'; -import {AppBindingLocations, AppCallResponseTypes} from 'mattermost-redux/constants/apps'; -import {AppCall, AppExpand, AppFormValues} from '@mattermost/types/apps'; -import {createCallContext, createCallRequest} from 'utils/apps'; -import {DoAppCallResult, intlShim} from 'components/suggestion/command_provider/app_command_parser/app_command_parser_dependencies'; +import type {GlobalState} from 'types/store'; import {doAppSubmit, openAppsModal, postEphemeralCallResponseForContext} from './apps'; diff --git a/webapp/channels/src/actions/new_post.test.ts b/webapp/channels/src/actions/new_post.test.ts index 6944be7408..9bfb30f69b 100644 --- a/webapp/channels/src/actions/new_post.test.ts +++ b/webapp/channels/src/actions/new_post.test.ts @@ -1,21 +1,18 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -// import thunk from 'redux-thunk'; -// import configureStore from 'redux-mock-store'; - -import {Post} from '@mattermost/types/posts'; +import type {Post} from '@mattermost/types/posts'; +import type {GlobalState} from '@mattermost/types/store'; import {ChannelTypes} from 'mattermost-redux/action_types'; import {receivedNewPost} from 'mattermost-redux/actions/posts'; import {Posts} from 'mattermost-redux/constants'; +import type {GetStateFunc} from 'mattermost-redux/types/actions'; import * as NewPostActions from 'actions/new_post'; + import mockStore from 'tests/test_store'; import {Constants} from 'utils/constants'; -import {GlobalState} from '@mattermost/types/store'; - -import {GetStateFunc} from 'mattermost-redux/types/actions'; jest.mock('mattermost-redux/actions/channels', () => ({ ...jest.requireActual('mattermost-redux/actions/channels'), diff --git a/webapp/channels/src/actions/new_post.ts b/webapp/channels/src/actions/new_post.ts index 8a5fa18b09..7c0186c631 100644 --- a/webapp/channels/src/actions/new_post.ts +++ b/webapp/channels/src/actions/new_post.ts @@ -1,10 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import * as Redux from 'redux'; +import type * as Redux from 'redux'; import {batchActions} from 'redux-batched-actions'; -import {isCollapsedThreadsEnabled} from 'mattermost-redux/selectors/entities/preferences'; +import type {Post} from '@mattermost/types/posts'; import { actionsToMarkChannelAsRead, @@ -12,28 +12,25 @@ import { markChannelAsViewedOnServer, } from 'mattermost-redux/actions/channels'; import * as PostActions from 'mattermost-redux/actions/posts'; - import {getCurrentChannelId, isManuallyUnread} from 'mattermost-redux/selectors/entities/channels'; import * as PostSelectors from 'mattermost-redux/selectors/entities/posts'; -import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users'; +import {isCollapsedThreadsEnabled} from 'mattermost-redux/selectors/entities/preferences'; import {getThread} from 'mattermost-redux/selectors/entities/threads'; - -import {ActionFunc, DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; -import {Post} from '@mattermost/types/posts'; - +import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users'; +import type {ActionFunc, DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; import { isFromWebhook, isSystemMessage, shouldIgnorePost, } from 'mattermost-redux/utils/post_utils'; -import {GlobalState} from 'types/store'; - -import {updateThreadLastOpened} from 'actions/views/threads'; import {sendDesktopNotification} from 'actions/notification_actions.jsx'; +import {updateThreadLastOpened} from 'actions/views/threads'; +import {isThreadOpen, makeGetThreadLastViewedAt} from 'selectors/views/threads'; import {ActionTypes} from 'utils/constants'; -import {isThreadOpen, makeGetThreadLastViewedAt} from 'selectors/views/threads'; + +import type {GlobalState} from 'types/store'; export type NewPostMessageProps = { mentions: string[]; diff --git a/webapp/channels/src/actions/notification_actions.jsx b/webapp/channels/src/actions/notification_actions.jsx index 81dba52c5f..bf0be0dc36 100644 --- a/webapp/channels/src/actions/notification_actions.jsx +++ b/webapp/channels/src/actions/notification_actions.jsx @@ -14,17 +14,18 @@ import {isChannelMuted} from 'mattermost-redux/utils/channel_utils'; import {isSystemMessage, isUserAddedInChannel} from 'mattermost-redux/utils/post_utils'; import {displayUsername} from 'mattermost-redux/utils/user_utils'; -import {isThreadOpen} from 'selectors/views/threads'; import {getChannelURL, getPermalinkURL} from 'selectors/urls'; +import {isThreadOpen} from 'selectors/views/threads'; import {getHistory} from 'utils/browser_history'; import Constants, {NotificationLevels, UserStatuses} from 'utils/constants'; +import {t} from 'utils/i18n'; +import {stripMarkdown} from 'utils/markdown'; import * as NotificationSounds from 'utils/notification_sounds'; import {showNotification} from 'utils/notifications'; import {isDesktopApp, isMobileApp, isWindowsApp} from 'utils/user_agent'; import * as Utils from 'utils/utils'; -import {t} from 'utils/i18n'; -import {stripMarkdown} from 'utils/markdown'; + import {runDesktopNotificationHooks} from './hooks'; const NOTIFY_TEXT_MAX_LENGTH = 50; diff --git a/webapp/channels/src/actions/notification_actions.test.js b/webapp/channels/src/actions/notification_actions.test.js index 873a8e6e10..634da76259 100644 --- a/webapp/channels/src/actions/notification_actions.test.js +++ b/webapp/channels/src/actions/notification_actions.test.js @@ -2,7 +2,6 @@ // See LICENSE.txt for license information. import testConfigureStore from 'tests/test_store'; - import {getHistory} from 'utils/browser_history'; import Constants, {NotificationLevels, UserStatuses} from 'utils/constants'; import * as NotificationSounds from 'utils/notification_sounds'; diff --git a/webapp/channels/src/actions/post_actions.test.ts b/webapp/channels/src/actions/post_actions.test.ts index 7219c4f818..801da3dad8 100644 --- a/webapp/channels/src/actions/post_actions.test.ts +++ b/webapp/channels/src/actions/post_actions.test.ts @@ -1,18 +1,19 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {Post} from '@mattermost/types/posts'; -import {FileInfo} from '@mattermost/types/files'; +import type {FileInfo} from '@mattermost/types/files'; +import type {Post} from '@mattermost/types/posts'; -import {GlobalState} from 'types/store'; import {ChannelTypes, SearchTypes} from 'mattermost-redux/action_types'; import * as PostActions from 'mattermost-redux/actions/posts'; import {Posts} from 'mattermost-redux/constants'; import * as Actions from 'actions/post_actions'; -import {Constants, ActionTypes, RHSStates} from 'utils/constants'; import mockStore from 'tests/test_store'; +import {Constants, ActionTypes, RHSStates} from 'utils/constants'; + +import type {GlobalState} from 'types/store'; jest.mock('mattermost-redux/actions/posts', () => ({ addReaction: (...args: any[]) => ({type: 'MOCK_ADD_REACTION', args}), diff --git a/webapp/channels/src/actions/post_actions.ts b/webapp/channels/src/actions/post_actions.ts index ce234d7b0c..08646bb578 100644 --- a/webapp/channels/src/actions/post_actions.ts +++ b/webapp/channels/src/actions/post_actions.ts @@ -1,32 +1,32 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {Post} from '@mattermost/types/posts'; -import {GroupChannel} from '@mattermost/types/groups'; -import {FileInfo} from '@mattermost/types/files'; +import type {FileInfo} from '@mattermost/types/files'; +import type {GroupChannel} from '@mattermost/types/groups'; +import type {Post} from '@mattermost/types/posts'; import {SearchTypes} from 'mattermost-redux/action_types'; import {getMyChannelMember} from 'mattermost-redux/actions/channels'; -import {getChannel, getMyChannelMember as getMyChannelMemberSelector} from 'mattermost-redux/selectors/entities/channels'; -import {isCollapsedThreadsEnabled} from 'mattermost-redux/selectors/entities/preferences'; -import * as ThreadActions from 'mattermost-redux/actions/threads'; import * as PostActions from 'mattermost-redux/actions/posts'; +import * as ThreadActions from 'mattermost-redux/actions/threads'; +import {getChannel, getMyChannelMember as getMyChannelMemberSelector} from 'mattermost-redux/selectors/entities/channels'; import * as PostSelectors from 'mattermost-redux/selectors/entities/posts'; -import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users'; +import {isCollapsedThreadsEnabled} from 'mattermost-redux/selectors/entities/preferences'; import {getCurrentTeamId} from 'mattermost-redux/selectors/entities/teams'; +import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users'; +import type {DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; import {canEditPost, comparePosts} from 'mattermost-redux/utils/post_utils'; -import {DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; import {addRecentEmoji, addRecentEmojis} from 'actions/emoji_actions'; import * as StorageActions from 'actions/storage'; import {loadNewDMIfNeeded, loadNewGMIfNeeded} from 'actions/user_actions'; +import {removeDraft} from 'actions/views/drafts'; import * as RhsActions from 'actions/views/rhs'; import {manuallyMarkThreadAsUnread} from 'actions/views/threads'; -import {removeDraft} from 'actions/views/drafts'; import {isEmbedVisible, isInlineImageVisible} from 'selectors/posts'; import {getSelectedPostId, getSelectedPostCardId, getRhsState} from 'selectors/rhs'; import {getGlobalItem} from 'selectors/storage'; -import {GlobalState} from 'types/store'; + import { ActionTypes, Constants, @@ -36,7 +36,10 @@ import { import {matchEmoticons} from 'utils/emoticons'; import * as UserAgent from 'utils/user_agent'; -import {completePostReceive, NewPostMessageProps} from './new_post'; +import type {GlobalState} from 'types/store'; + +import {completePostReceive} from './new_post'; +import type {NewPostMessageProps} from './new_post'; export function handleNewPost(post: Post, msg?: {data?: NewPostMessageProps & GroupChannel}) { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { diff --git a/webapp/channels/src/actions/status_actions.test.ts b/webapp/channels/src/actions/status_actions.test.ts index dc78ab16e0..863b4b80c5 100644 --- a/webapp/channels/src/actions/status_actions.test.ts +++ b/webapp/channels/src/actions/status_actions.test.ts @@ -3,16 +3,17 @@ import {cloneDeep} from 'lodash'; -import {UserProfile} from '@mattermost/types/users'; +import type {UserProfile} from '@mattermost/types/users'; -import {Preferences} from 'mattermost-redux/constants'; import {getStatusesByIds} from 'mattermost-redux/actions/users'; +import {Preferences} from 'mattermost-redux/constants'; import * as Actions from 'actions/status_actions'; -import {GlobalState} from 'types/store'; import mockStore from 'tests/test_store'; +import type {GlobalState} from 'types/store'; + jest.mock('mattermost-redux/actions/users', () => ({ getStatusesByIds: jest.fn(() => { return {type: ''}; diff --git a/webapp/channels/src/actions/status_actions.ts b/webapp/channels/src/actions/status_actions.ts index 6bbc55f151..4b35ee0035 100644 --- a/webapp/channels/src/actions/status_actions.ts +++ b/webapp/channels/src/actions/status_actions.ts @@ -1,19 +1,21 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {UserProfile} from '@mattermost/types/users'; +import type {UserProfile} from '@mattermost/types/users'; import {getStatusesByIds} from 'mattermost-redux/actions/users'; import {getCurrentChannelId} from 'mattermost-redux/selectors/entities/channels'; import {getPostsInCurrentChannel} from 'mattermost-redux/selectors/entities/posts'; import {getDirectShowPreferences} from 'mattermost-redux/selectors/entities/preferences'; import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users'; -import {ActionFunc, DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; -import {GlobalState} from 'types/store'; +import type {ActionFunc, DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; import {loadCustomEmojisForCustomStatusesByUserIds} from 'actions/emoji_actions'; + import {Constants} from 'utils/constants'; +import type {GlobalState} from 'types/store'; + export function loadStatusesForChannelAndSidebar(): ActionFunc { return (dispatch: DispatchFunc, getState: GetStateFunc) => { const state = getState(); diff --git a/webapp/channels/src/actions/storage.ts b/webapp/channels/src/actions/storage.ts index c0b7e2a878..928664233b 100644 --- a/webapp/channels/src/actions/storage.ts +++ b/webapp/channels/src/actions/storage.ts @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; +import type {DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; import {StorageTypes} from 'utils/constants'; import {getPrefix} from 'utils/storage_utils'; diff --git a/webapp/channels/src/actions/team_actions.test.ts b/webapp/channels/src/actions/team_actions.test.ts index 55d8078731..cfcede5f65 100644 --- a/webapp/channels/src/actions/team_actions.test.ts +++ b/webapp/channels/src/actions/team_actions.test.ts @@ -1,14 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import * as TeamActions from 'mattermost-redux/actions/teams'; import * as channelActions from 'mattermost-redux/actions/channels'; +import * as TeamActions from 'mattermost-redux/actions/teams'; import * as userActions from 'mattermost-redux/actions/users'; import * as Actions from 'actions/team_actions'; import configureStore from 'tests/test_store'; - import {getHistory} from 'utils/browser_history'; import {TestHelper} from 'utils/test_helper'; diff --git a/webapp/channels/src/actions/team_actions.ts b/webapp/channels/src/actions/team_actions.ts index 90134b137b..307488b669 100644 --- a/webapp/channels/src/actions/team_actions.ts +++ b/webapp/channels/src/actions/team_actions.ts @@ -1,19 +1,19 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {Team} from '@mattermost/types/teams'; -import {ServerError} from '@mattermost/types/errors'; -import {UserProfile} from '@mattermost/types/users'; +import type {ServerError} from '@mattermost/types/errors'; +import type {Team} from '@mattermost/types/teams'; +import type {UserProfile} from '@mattermost/types/users'; import {TeamTypes} from 'mattermost-redux/action_types'; -import {ActionFunc, DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; import {getChannelStats} from 'mattermost-redux/actions/channels'; -import * as TeamActions from 'mattermost-redux/actions/teams'; -import {getUser} from 'mattermost-redux/actions/users'; import {savePreferences} from 'mattermost-redux/actions/preferences'; +import * as TeamActions from 'mattermost-redux/actions/teams'; import {selectTeam} from 'mattermost-redux/actions/teams'; -import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users'; +import {getUser} from 'mattermost-redux/actions/users'; import {getCurrentChannelId} from 'mattermost-redux/selectors/entities/channels'; +import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users'; +import type {ActionFunc, DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; import {getHistory} from 'utils/browser_history'; import {Preferences} from 'utils/constants'; diff --git a/webapp/channels/src/actions/telemetry_actions.jsx b/webapp/channels/src/actions/telemetry_actions.jsx index bd2dbb79ac..665e29e7aa 100644 --- a/webapp/channels/src/actions/telemetry_actions.jsx +++ b/webapp/channels/src/actions/telemetry_actions.jsx @@ -8,7 +8,6 @@ import {getConfig, isPerformanceDebuggingEnabled} from 'mattermost-redux/selecto import {getBool} from 'mattermost-redux/selectors/entities/preferences'; import {isDevModeEnabled} from 'selectors/general'; - import store from 'stores/redux_store.jsx'; const SUPPORTS_CLEAR_MARKS = isSupported([performance.clearMarks]); diff --git a/webapp/channels/src/actions/user_actions.test.ts b/webapp/channels/src/actions/user_actions.test.ts index 928253c627..cf7e257912 100644 --- a/webapp/channels/src/actions/user_actions.test.ts +++ b/webapp/channels/src/actions/user_actions.test.ts @@ -1,10 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {Channel, ChannelMembership, ChannelMessageCount} from '@mattermost/types/channels'; -import {Team, TeamMembership} from '@mattermost/types/teams'; -import {Post} from '@mattermost/types/posts'; -import {UserProfile} from '@mattermost/types/users'; +import type {Channel, ChannelMembership, ChannelMessageCount} from '@mattermost/types/channels'; +import type {Post} from '@mattermost/types/posts'; +import type {Team, TeamMembership} from '@mattermost/types/teams'; +import type {UserProfile} from '@mattermost/types/users'; import {Preferences, General} from 'mattermost-redux/constants'; import {CategoryTypes} from 'mattermost-redux/constants/channel_categories'; @@ -12,12 +12,12 @@ import {getPreferenceKey} from 'mattermost-redux/utils/preference_utils'; import * as UserActions from 'actions/user_actions'; import store from 'stores/redux_store'; + import TestHelper from 'packages/mattermost-redux/test/test_helper'; - -import {GlobalState} from 'types/store'; - import mockStore from 'tests/test_store'; +import type {GlobalState} from 'types/store'; + jest.mock('mattermost-redux/actions/users', () => { const original = jest.requireActual('mattermost-redux/actions/users'); return { diff --git a/webapp/channels/src/actions/user_actions.ts b/webapp/channels/src/actions/user_actions.ts index 0950969b0a..1e6b7b682e 100644 --- a/webapp/channels/src/actions/user_actions.ts +++ b/webapp/channels/src/actions/user_actions.ts @@ -3,10 +3,8 @@ import PQueue from 'p-queue'; -import {UserProfile, UserStatus} from '@mattermost/types/users'; - -import {Channel} from '@mattermost/types/channels'; -import {GlobalState} from 'types/store'; +import type {Channel} from '@mattermost/types/channels'; +import type {UserProfile, UserStatus} from '@mattermost/types/users'; import {getChannelAndMyMember, getChannelMembersByIds} from 'mattermost-redux/actions/channels'; import {savePreferences} from 'mattermost-redux/actions/preferences'; @@ -24,19 +22,18 @@ import { import {getBool, isCollapsedThreadsEnabled} from 'mattermost-redux/selectors/entities/preferences'; import {getCurrentTeamId, getTeamMember} from 'mattermost-redux/selectors/entities/teams'; import * as Selectors from 'mattermost-redux/selectors/entities/users'; -import {ActionResult, DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; - +import type {ActionResult, DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; import {calculateUnreadCount} from 'mattermost-redux/utils/channel_utils'; import {loadCustomEmojisForCustomStatusesByUserIds} from 'actions/emoji_actions'; import {loadStatusesForProfilesList, loadStatusesForProfilesMap} from 'actions/status_actions'; - import {getDisplayedChannels} from 'selectors/views/channel_sidebar'; - import store from 'stores/redux_store.jsx'; -import * as Utils from 'utils/utils'; import {Constants, Preferences, UserStatuses} from 'utils/constants'; +import * as Utils from 'utils/utils'; + +import type {GlobalState} from 'types/store'; export const queue = new PQueue({concurrency: 4}); const dispatch = store.dispatch; diff --git a/webapp/channels/src/actions/views/browser.ts b/webapp/channels/src/actions/views/browser.ts index 50a949d1f3..afb3e8023f 100644 --- a/webapp/channels/src/actions/views/browser.ts +++ b/webapp/channels/src/actions/views/browser.ts @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {GenericAction} from 'mattermost-redux/types/actions'; +import type {GenericAction} from 'mattermost-redux/types/actions'; import {Constants, ActionTypes, WindowSizes} from 'utils/constants'; diff --git a/webapp/channels/src/actions/views/channel.test.js b/webapp/channels/src/actions/views/channel.test.js index 872a1c2d5b..ab17d8444b 100644 --- a/webapp/channels/src/actions/views/channel.test.js +++ b/webapp/channels/src/actions/views/channel.test.js @@ -1,15 +1,16 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {General, Posts, RequestStatus} from 'mattermost-redux/constants'; import {leaveChannel, markChannelAsRead, getChannel} from 'mattermost-redux/actions/channels'; -import * as UserActions from 'mattermost-redux/actions/users'; import * as PostActions from 'mattermost-redux/actions/posts'; +import * as UserActions from 'mattermost-redux/actions/users'; +import {General, Posts, RequestStatus} from 'mattermost-redux/constants'; -import {getHistory} from 'utils/browser_history'; import * as Actions from 'actions/views/channel'; import {closeRightHandSide} from 'actions/views/rhs'; + import mockStore from 'tests/test_store'; +import {getHistory} from 'utils/browser_history'; import {ActionTypes, PostRequestTypes} from 'utils/constants'; jest.mock('utils/channel_utils.tsx', () => { diff --git a/webapp/channels/src/actions/views/channel.ts b/webapp/channels/src/actions/views/channel.ts index 79e6061993..f0783eda35 100644 --- a/webapp/channels/src/actions/views/channel.ts +++ b/webapp/channels/src/actions/views/channel.ts @@ -1,11 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import type {AnyAction} from 'redux'; import {batchActions} from 'redux-batched-actions'; -import {AnyAction} from 'redux'; -import {Channel} from '@mattermost/types/channels'; +import type {Channel} from '@mattermost/types/channels'; +import {TeamTypes} from 'mattermost-redux/action_types'; import { leaveChannel as leaveChannelRedux, joinChannel, @@ -15,12 +16,9 @@ import { getChannel as loadChannel, } from 'mattermost-redux/actions/channels'; import * as PostActions from 'mattermost-redux/actions/posts'; -import {TeamTypes} from 'mattermost-redux/action_types'; -import {DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; -import {autocompleteUsers} from 'mattermost-redux/actions/users'; import {selectTeam} from 'mattermost-redux/actions/teams'; +import {autocompleteUsers} from 'mattermost-redux/actions/users'; import {Posts, RequestStatus} from 'mattermost-redux/constants'; - import { getChannel, getChannelsNameMapInCurrentTeam, @@ -33,6 +31,7 @@ import { isManuallyUnread, getCurrentChannelId, } from 'mattermost-redux/selectors/entities/channels'; +import {getMostRecentPostIdInChannel, getPost} from 'mattermost-redux/selectors/entities/posts'; import { getCurrentRelativeTeamUrl, getCurrentTeam, @@ -41,24 +40,24 @@ import { getTeamsList, } from 'mattermost-redux/selectors/entities/teams'; import {getCurrentUserId, getUserByUsername} from 'mattermost-redux/selectors/entities/users'; -import {getMostRecentPostIdInChannel, getPost} from 'mattermost-redux/selectors/entities/posts'; import {makeAddLastViewAtToProfiles} from 'mattermost-redux/selectors/entities/utils'; - +import type {DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; import {getChannelByName} from 'mattermost-redux/utils/channel_utils'; import EventEmitter from 'mattermost-redux/utils/event_emitter'; -import {closeRightHandSide} from 'actions/views/rhs'; import {openDirectChannelToUserId} from 'actions/channel_actions'; import {loadCustomStatusEmojisForPostList} from 'actions/emoji_actions'; +import {closeRightHandSide} from 'actions/views/rhs'; import {getLastViewedChannelName} from 'selectors/local_storage'; +import {getSelectedPost, getSelectedPostId} from 'selectors/rhs'; import {getLastPostsApiTimeForChannel} from 'selectors/views/channel'; import {getSocketStatus} from 'selectors/views/websocket'; -import {getSelectedPost, getSelectedPostId} from 'selectors/rhs'; +import LocalStorageStore from 'stores/local_storage_store'; import {getHistory} from 'utils/browser_history'; -import {Constants, ActionTypes, EventTypes, PostRequestTypes} from 'utils/constants'; -import LocalStorageStore from 'stores/local_storage_store'; import {isArchivedChannel} from 'utils/channel_utils'; +import {Constants, ActionTypes, EventTypes, PostRequestTypes} from 'utils/constants'; + import type {GlobalState} from 'types/store'; export function goToLastViewedChannel() { diff --git a/webapp/channels/src/actions/views/channel_sidebar.test.ts b/webapp/channels/src/actions/views/channel_sidebar.test.ts index de4c60e4e9..97e357b620 100644 --- a/webapp/channels/src/actions/views/channel_sidebar.test.ts +++ b/webapp/channels/src/actions/views/channel_sidebar.test.ts @@ -2,7 +2,7 @@ // See LICENSE.txt for license information. import {CategorySorting} from '@mattermost/types/channel_categories'; -import {Channel, ChannelMembership} from '@mattermost/types/channels'; +import type {Channel, ChannelMembership} from '@mattermost/types/channels'; import {insertWithoutDuplicates} from 'mattermost-redux/utils/array_utils'; diff --git a/webapp/channels/src/actions/views/channel_sidebar.ts b/webapp/channels/src/actions/views/channel_sidebar.ts index 11f9700dac..b62a6f62b9 100644 --- a/webapp/channels/src/actions/views/channel_sidebar.ts +++ b/webapp/channels/src/actions/views/channel_sidebar.ts @@ -6,13 +6,15 @@ import {General} from 'mattermost-redux/constants'; import {CategoryTypes} from 'mattermost-redux/constants/channel_categories'; import {getCategory, makeGetChannelIdsForCategory} from 'mattermost-redux/selectors/entities/channel_categories'; import {getCurrentChannelId} from 'mattermost-redux/selectors/entities/channels'; -import {DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; +import type {DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; import {insertMultipleWithoutDuplicates} from 'mattermost-redux/utils/array_utils'; import {getCategoriesForCurrentTeam, getChannelsInCategoryOrder, getDisplayedChannels} from 'selectors/views/channel_sidebar'; -import {DraggingState, GlobalState} from 'types/store'; + import {ActionTypes} from 'utils/constants'; +import type {DraggingState, GlobalState} from 'types/store'; + export function setUnreadFilterEnabled(enabled: boolean) { return { type: ActionTypes.SET_UNREAD_FILTER_ENABLED, diff --git a/webapp/channels/src/actions/views/create_comment.test.jsx b/webapp/channels/src/actions/views/create_comment.test.jsx index 1f4ee9cc43..4d18770cc4 100644 --- a/webapp/channels/src/actions/views/create_comment.test.jsx +++ b/webapp/channels/src/actions/views/create_comment.test.jsx @@ -8,6 +8,10 @@ import { } from 'mattermost-redux/actions/posts'; import {Posts} from 'mattermost-redux/constants'; +import {executeCommand} from 'actions/command'; +import * as HookActions from 'actions/hooks'; +import * as PostActions from 'actions/post_actions'; +import {setGlobalItem, actionOnGlobalItemsWithPrefix} from 'actions/storage'; import { clearCommentDraftUploads, updateCommentDraft, @@ -19,13 +23,9 @@ import { makeOnEditLatestPost, } from 'actions/views/create_comment'; import {removeDraft, setGlobalDraftSource} from 'actions/views/drafts'; -import {setGlobalItem, actionOnGlobalItemsWithPrefix} from 'actions/storage'; -import * as PostActions from 'actions/post_actions'; -import {executeCommand} from 'actions/command'; -import * as HookActions from 'actions/hooks'; -import {StoragePrefixes} from 'utils/constants'; import mockStore from 'tests/test_store'; +import {StoragePrefixes} from 'utils/constants'; /* eslint-disable global-require */ diff --git a/webapp/channels/src/actions/views/create_comment.tsx b/webapp/channels/src/actions/views/create_comment.tsx index 39037b215b..3fd7fe681f 100644 --- a/webapp/channels/src/actions/views/create_comment.tsx +++ b/webapp/channels/src/actions/views/create_comment.tsx @@ -1,17 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {Post} from '@mattermost/types/posts'; +import type {Post} from '@mattermost/types/posts'; -import {createSelector} from 'mattermost-redux/selectors/create_selector'; -import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users'; -import {getCurrentTeamId} from 'mattermost-redux/selectors/entities/teams'; -import { - makeGetMessageInHistoryItem, - getPost, - makeGetPostIdsForThread, -} from 'mattermost-redux/selectors/entities/posts'; -import {getCustomEmojisByName} from 'mattermost-redux/selectors/entities/emojis'; import { removeReaction, addMessageIntoHistory, @@ -19,21 +10,31 @@ import { moveHistoryIndexForward, } from 'mattermost-redux/actions/posts'; import {Posts} from 'mattermost-redux/constants'; +import {createSelector} from 'mattermost-redux/selectors/create_selector'; +import {getCustomEmojisByName} from 'mattermost-redux/selectors/entities/emojis'; +import { + makeGetMessageInHistoryItem, + getPost, + makeGetPostIdsForThread, +} from 'mattermost-redux/selectors/entities/posts'; +import {getCurrentTeamId} from 'mattermost-redux/selectors/entities/teams'; +import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users'; +import type {DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; import {isPostPendingOrFailed} from 'mattermost-redux/utils/post_utils'; -import * as PostActions from 'actions/post_actions'; import {executeCommand} from 'actions/command'; import {runMessageWillBePostedHooks, runSlashCommandWillBePostedHooks} from 'actions/hooks'; +import * as PostActions from 'actions/post_actions'; import {actionOnGlobalItemsWithPrefix} from 'actions/storage'; import {updateDraft, removeDraft} from 'actions/views/drafts'; -import EmojiMap from 'utils/emoji_map'; import {getPostDraft} from 'selectors/rhs'; -import * as Utils from 'utils/utils'; import {Constants, StoragePrefixes} from 'utils/constants'; -import type {PostDraft} from 'types/store/draft'; +import EmojiMap from 'utils/emoji_map'; +import * as Utils from 'utils/utils'; + import type {GlobalState} from 'types/store'; -import type {DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; +import type {PostDraft} from 'types/store/draft'; export function clearCommentDraftUploads() { return actionOnGlobalItemsWithPrefix(StoragePrefixes.COMMENT_DRAFT, (_key: string, draft: PostDraft) => { diff --git a/webapp/channels/src/actions/views/drafts.test.ts b/webapp/channels/src/actions/views/drafts.test.ts index eee7e8ccfb..94b1b4f34b 100644 --- a/webapp/channels/src/actions/views/drafts.test.ts +++ b/webapp/channels/src/actions/views/drafts.test.ts @@ -1,17 +1,16 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {setGlobalItem} from 'actions/storage'; -import {PostDraft} from 'types/store/draft'; -import {StoragePrefixes} from 'utils/constants'; - -import mockStore from 'tests/test_store'; - +import {Client4} from 'mattermost-redux/client'; import {Posts, Preferences} from 'mattermost-redux/constants'; - import {getPreferenceKey} from 'mattermost-redux/utils/preference_utils'; -import {Client4} from 'mattermost-redux/client'; +import {setGlobalItem} from 'actions/storage'; + +import mockStore from 'tests/test_store'; +import {StoragePrefixes} from 'utils/constants'; + +import type {PostDraft} from 'types/store/draft'; import {removeDraft, setGlobalDraftSource, updateDraft} from './drafts'; diff --git a/webapp/channels/src/actions/views/drafts.ts b/webapp/channels/src/actions/views/drafts.ts index 7d997f9fd6..67947663b7 100644 --- a/webapp/channels/src/actions/views/drafts.ts +++ b/webapp/channels/src/actions/views/drafts.ts @@ -3,27 +3,28 @@ import {batchActions} from 'redux-batched-actions'; -import {ActionFunc, DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; -import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users'; -import {syncedDraftsAreAllowedAndEnabled} from 'mattermost-redux/selectors/entities/preferences'; +import type {Draft as ServerDraft} from '@mattermost/types/drafts'; +import type {FileInfo} from '@mattermost/types/files'; +import type {PostMetadata, PostPriorityMetadata} from '@mattermost/types/posts'; +import type {PreferenceType} from '@mattermost/types/preferences'; +import type {UserProfile} from '@mattermost/types/users'; + +import {savePreferences} from 'mattermost-redux/actions/preferences'; import {Client4} from 'mattermost-redux/client'; +import Preferences from 'mattermost-redux/constants/preferences'; +import {syncedDraftsAreAllowedAndEnabled} from 'mattermost-redux/selectors/entities/preferences'; +import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users'; +import type {ActionFunc, DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; import {setGlobalItem} from 'actions/storage'; -import {getConnectionId} from 'selectors/general'; -import type {GlobalState} from 'types/store'; -import {PostDraft} from 'types/store/draft'; -import {getGlobalItem} from 'selectors/storage'; import {makeGetDrafts} from 'selectors/drafts'; +import {getConnectionId} from 'selectors/general'; +import {getGlobalItem} from 'selectors/storage'; import {ActionTypes, StoragePrefixes} from 'utils/constants'; -import type {Draft as ServerDraft} from '@mattermost/types/drafts'; -import type {UserProfile} from '@mattermost/types/users'; -import {PostMetadata, PostPriorityMetadata} from '@mattermost/types/posts'; -import {FileInfo} from '@mattermost/types/files'; -import {PreferenceType} from '@mattermost/types/preferences'; -import {savePreferences} from 'mattermost-redux/actions/preferences'; -import Preferences from 'mattermost-redux/constants/preferences'; +import type {GlobalState} from 'types/store'; +import type {PostDraft} from 'types/store/draft'; type Draft = { key: keyof GlobalState['storage']['storage']; diff --git a/webapp/channels/src/actions/views/group.js b/webapp/channels/src/actions/views/group.js index 1819ef54af..1c607b5c4c 100644 --- a/webapp/channels/src/actions/views/group.js +++ b/webapp/channels/src/actions/views/group.js @@ -1,12 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {searchAssociatedGroupsForReferenceLocal} from 'mattermost-redux/selectors/entities/groups'; -import {getConfig} from 'mattermost-redux/selectors/entities/general'; -import {isCustomGroupsEnabled} from 'mattermost-redux/selectors/entities/preferences'; -import {haveIChannelPermission} from 'mattermost-redux/selectors/entities/roles'; import {searchGroups} from 'mattermost-redux/actions/groups'; import Permissions from 'mattermost-redux/constants/permissions'; +import {getConfig} from 'mattermost-redux/selectors/entities/general'; +import {searchAssociatedGroupsForReferenceLocal} from 'mattermost-redux/selectors/entities/groups'; +import {isCustomGroupsEnabled} from 'mattermost-redux/selectors/entities/preferences'; +import {haveIChannelPermission} from 'mattermost-redux/selectors/entities/roles'; export function searchAssociatedGroupsForReference(prefix, teamId, channelId) { return async (dispatch, getState) => { diff --git a/webapp/channels/src/actions/views/lhs.test.ts b/webapp/channels/src/actions/views/lhs.test.ts index f8d0425ada..e50be56bc5 100644 --- a/webapp/channels/src/actions/views/lhs.test.ts +++ b/webapp/channels/src/actions/views/lhs.test.ts @@ -1,15 +1,17 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {MockStoreEnhanced} from 'redux-mock-store'; +import type {MockStoreEnhanced} from 'redux-mock-store'; -import {DispatchFunc} from 'mattermost-redux/types/actions'; +import type {DispatchFunc} from 'mattermost-redux/types/actions'; import {close, open, toggle} from 'actions/views/lhs'; -import {ActionTypes} from 'utils/constants'; -import mockStore from 'tests/test_store'; import configureStore from 'store'; -import {GlobalState} from 'types/store'; + +import mockStore from 'tests/test_store'; +import {ActionTypes} from 'utils/constants'; + +import type {GlobalState} from 'types/store'; import * as Actions from './lhs'; diff --git a/webapp/channels/src/actions/views/lhs.ts b/webapp/channels/src/actions/views/lhs.ts index 78e61c84e7..42e5d2f52d 100644 --- a/webapp/channels/src/actions/views/lhs.ts +++ b/webapp/channels/src/actions/views/lhs.ts @@ -2,15 +2,17 @@ // See LICENSE.txt for license information. import {selectChannel} from 'mattermost-redux/actions/channels'; -import {DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; import {getCurrentRelativeTeamUrl} from 'mattermost-redux/selectors/entities/teams'; +import type {DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; -import {GlobalState} from 'types/store'; -import {LhsItemType} from 'types/store/lhs'; -import Constants, {ActionTypes} from 'utils/constants'; -import {getHistory} from 'utils/browser_history'; import {SidebarSize} from 'components/resizable_sidebar/constants'; +import {getHistory} from 'utils/browser_history'; +import Constants, {ActionTypes} from 'utils/constants'; + +import type {GlobalState} from 'types/store'; +import {LhsItemType} from 'types/store/lhs'; + export const setLhsSize = (sidebarSize?: SidebarSize) => { let newSidebarSize = sidebarSize; if (!sidebarSize) { diff --git a/webapp/channels/src/actions/views/login.test.ts b/webapp/channels/src/actions/views/login.test.ts index 8eed9d4819..da2ea949f9 100644 --- a/webapp/channels/src/actions/views/login.test.ts +++ b/webapp/channels/src/actions/views/login.test.ts @@ -5,14 +5,14 @@ import nock from 'nock'; import {Client4} from 'mattermost-redux/client'; -import TestHelper from 'packages/mattermost-redux/test/test_helper'; - import { login, loginById, } from 'actions/views/login'; import configureStore from 'store'; +import TestHelper from 'packages/mattermost-redux/test/test_helper'; + describe('actions/views/login', () => { describe('login', () => { test('should return successful when login is successful', async () => { diff --git a/webapp/channels/src/actions/views/login.ts b/webapp/channels/src/actions/views/login.ts index 0ff337f198..6330d6c6a6 100644 --- a/webapp/channels/src/actions/views/login.ts +++ b/webapp/channels/src/actions/views/login.ts @@ -3,13 +3,13 @@ import {batchActions} from 'redux-batched-actions'; -import {ServerError} from '@mattermost/types/errors'; +import type {ServerError} from '@mattermost/types/errors'; -import {Client4} from 'mattermost-redux/client'; -import {ActionFunc, DispatchFunc} from 'mattermost-redux/types/actions'; import {UserTypes} from 'mattermost-redux/action_types'; import {logError} from 'mattermost-redux/actions/errors'; import {loadRolesIfNeeded} from 'mattermost-redux/actions/roles'; +import {Client4} from 'mattermost-redux/client'; +import type {ActionFunc, DispatchFunc} from 'mattermost-redux/types/actions'; export function login(loginId: string, password: string, mfaToken = ''): ActionFunc { return async (dispatch: DispatchFunc) => { diff --git a/webapp/channels/src/actions/views/mfa.test.js b/webapp/channels/src/actions/views/mfa.test.js index 350723e76d..85d29844c5 100644 --- a/webapp/channels/src/actions/views/mfa.test.js +++ b/webapp/channels/src/actions/views/mfa.test.js @@ -10,6 +10,7 @@ import { deactivateMfa, generateMfaSecret, } from 'actions/views/mfa'; + import configureStore from 'tests/test_store'; describe('actions/views/mfa', () => { diff --git a/webapp/channels/src/actions/views/modals.test.jsx b/webapp/channels/src/actions/views/modals.test.jsx index e4b89159e9..82207d3f3c 100644 --- a/webapp/channels/src/actions/views/modals.test.jsx +++ b/webapp/channels/src/actions/views/modals.test.jsx @@ -5,9 +5,10 @@ import React from 'react'; import {Modal} from 'react-bootstrap'; import {openModal, closeModal} from 'actions/views/modals'; -import {ActionTypes, ModalIdentifiers} from 'utils/constants'; import mockStore from 'tests/test_store'; +import {ActionTypes, ModalIdentifiers} from 'utils/constants'; + class TestModal extends React.PureComponent { render() { return ( diff --git a/webapp/channels/src/actions/views/modals.ts b/webapp/channels/src/actions/views/modals.ts index 91ef17536c..f2fd2bdde9 100644 --- a/webapp/channels/src/actions/views/modals.ts +++ b/webapp/channels/src/actions/views/modals.ts @@ -1,10 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {ModalData} from 'types/actions'; - import {ActionTypes} from 'utils/constants'; +import type {ModalData} from 'types/actions'; + export function openModal

(modalData: ModalData

) { return { type: ActionTypes.MODAL_OPEN, diff --git a/webapp/channels/src/actions/views/onboarding_tasks.ts b/webapp/channels/src/actions/views/onboarding_tasks.ts index 4120dc158b..e9eabd74b7 100644 --- a/webapp/channels/src/actions/views/onboarding_tasks.ts +++ b/webapp/channels/src/actions/views/onboarding_tasks.ts @@ -1,16 +1,19 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {getCurrentTeamId, getTeam} from 'mattermost-redux/selectors/entities/teams'; import {getCurrentUser, getCurrentUserId} from 'mattermost-redux/selectors/entities/common'; -import {DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; -import {GlobalState} from 'types/store'; -import {getHistory} from 'utils/browser_history'; -import InvitationModal from 'components/invitation_modal'; -import LocalStorageStore from 'stores/local_storage_store'; -import {ActionTypes, Constants, ModalIdentifiers} from 'utils/constants'; +import {getCurrentTeamId, getTeam} from 'mattermost-redux/selectors/entities/teams'; +import type {DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; import {getTeamRedirectChannelIfIsAccesible} from 'actions/global_actions'; +import LocalStorageStore from 'stores/local_storage_store'; + +import InvitationModal from 'components/invitation_modal'; + +import {getHistory} from 'utils/browser_history'; +import {ActionTypes, Constants, ModalIdentifiers} from 'utils/constants'; + +import type {GlobalState} from 'types/store'; import {openModal} from './modals'; diff --git a/webapp/channels/src/actions/views/posts.js b/webapp/channels/src/actions/views/posts.js index 209e509dec..4c35f180e5 100644 --- a/webapp/channels/src/actions/views/posts.js +++ b/webapp/channels/src/actions/views/posts.js @@ -1,22 +1,22 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import * as PostActions from 'mattermost-redux/actions/posts'; - -import {Permissions} from 'mattermost-redux/constants'; import {logError} from 'mattermost-redux/actions/errors'; -import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users'; -import {haveIChannelPermission, haveICurrentChannelPermission} from 'mattermost-redux/selectors/entities/roles'; +import * as PostActions from 'mattermost-redux/actions/posts'; +import {Permissions} from 'mattermost-redux/constants'; import {getLicense} from 'mattermost-redux/selectors/entities/general'; -import {isCustomGroupsEnabled} from 'mattermost-redux/selectors/entities/preferences'; import {getAssociatedGroupsForReferenceByMention} from 'mattermost-redux/selectors/entities/groups'; +import {isCustomGroupsEnabled} from 'mattermost-redux/selectors/entities/preferences'; +import {haveIChannelPermission, haveICurrentChannelPermission} from 'mattermost-redux/selectors/entities/roles'; import {getCurrentTeam} from 'mattermost-redux/selectors/entities/teams'; +import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users'; -import {getTimestamp} from 'utils/utils'; import {getPermalinkURL} from 'selectors/urls'; -import {getSiteURL} from 'utils/url'; -import {containsAtChannel, groupsMentionedInText} from 'utils/post_utils'; + import {ActionTypes, AnnouncementBarTypes} from 'utils/constants'; +import {containsAtChannel, groupsMentionedInText} from 'utils/post_utils'; +import {getSiteURL} from 'utils/url'; +import {getTimestamp} from 'utils/utils'; import {runMessageWillBePostedHooks} from '../hooks'; diff --git a/webapp/channels/src/actions/views/profile_popover.ts b/webapp/channels/src/actions/views/profile_popover.ts index 0aed9fd27b..f6debb6aaf 100644 --- a/webapp/channels/src/actions/views/profile_popover.ts +++ b/webapp/channels/src/actions/views/profile_popover.ts @@ -1,10 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {getTeamMember} from 'mattermost-redux/actions/teams'; import {getChannelMember} from 'mattermost-redux/actions/channels'; - -import {DispatchFunc} from 'mattermost-redux/types/actions'; +import {getTeamMember} from 'mattermost-redux/actions/teams'; +import type {DispatchFunc} from 'mattermost-redux/types/actions'; export function getMembershipForEntities(teamId: string, userId: string, channelId?: string) { return (dispatch: DispatchFunc) => { diff --git a/webapp/channels/src/actions/views/rhs.test.ts b/webapp/channels/src/actions/views/rhs.test.ts index 2d3bf19ef8..92e1b374aa 100644 --- a/webapp/channels/src/actions/views/rhs.test.ts +++ b/webapp/channels/src/actions/views/rhs.test.ts @@ -3,16 +3,18 @@ import {cloneDeep, set} from 'lodash'; import {batchActions} from 'redux-batched-actions'; -import {MockStoreEnhanced} from 'redux-mock-store'; +import type {MockStoreEnhanced} from 'redux-mock-store'; +import type {Post} from '@mattermost/types/posts'; +import type {UserProfile} from '@mattermost/types/users'; +import type {IDMappedObjects} from '@mattermost/types/utilities'; + +import {SearchTypes} from 'mattermost-redux/action_types'; import * as PostActions from 'mattermost-redux/actions/posts'; import * as SearchActions from 'mattermost-redux/actions/search'; -import {SearchTypes} from 'mattermost-redux/action_types'; -import {DispatchFunc} from 'mattermost-redux/types/actions'; -import {Post} from '@mattermost/types/posts'; -import {UserProfile} from '@mattermost/types/users'; -import {IDMappedObjects} from '@mattermost/types/utilities'; +import type {DispatchFunc} from 'mattermost-redux/types/actions'; +import {trackEvent} from 'actions/telemetry_actions.jsx'; import { updateRhsState, selectPostFromRightHandSideSearch, @@ -38,15 +40,15 @@ import { showChannelMembers, openShowEditHistory, } from 'actions/views/rhs'; -import {trackEvent} from 'actions/telemetry_actions.jsx'; + import mockStore from 'tests/test_store'; import {ActionTypes, RHSStates, Constants} from 'utils/constants'; import {TestHelper} from 'utils/test_helper'; import {getBrowserUtcOffset} from 'utils/timezone'; -import {GlobalState} from 'types/store'; -import {ViewsState} from 'types/store/views'; -import {RhsState} from 'types/store/rhs'; +import type {GlobalState} from 'types/store'; +import type {RhsState} from 'types/store/rhs'; +import type {ViewsState} from 'types/store/views'; const currentChannelId = '123'; const currentTeamId = '321'; diff --git a/webapp/channels/src/actions/views/rhs.ts b/webapp/channels/src/actions/views/rhs.ts index 9c78709dde..e95e86400c 100644 --- a/webapp/channels/src/actions/views/rhs.ts +++ b/webapp/channels/src/actions/views/rhs.ts @@ -2,10 +2,15 @@ // See LICENSE.txt for license information. import debounce from 'lodash/debounce'; -import {AnyAction} from 'redux'; +import type {AnyAction} from 'redux'; import {batchActions} from 'redux-batched-actions'; +import type {Post} from '@mattermost/types/posts'; + import {SearchTypes} from 'mattermost-redux/action_types'; +import {getChannel} from 'mattermost-redux/actions/channels'; +import * as PostActions from 'mattermost-redux/actions/posts'; +import {getPostsByIds, getPost as fetchPost} from 'mattermost-redux/actions/posts'; import { clearSearch, getFlaggedPosts, @@ -13,26 +18,24 @@ import { searchPostsWithParams, searchFilesWithParams, } from 'mattermost-redux/actions/search'; -import * as PostActions from 'mattermost-redux/actions/posts'; -import {getCurrentUserMentionKeys} from 'mattermost-redux/selectors/entities/users'; -import {getCurrentTeamId} from 'mattermost-redux/selectors/entities/teams'; -import {getConfig} from 'mattermost-redux/selectors/entities/general'; import {getCurrentChannelId, getCurrentChannelNameForSearchShortcut, getChannel as getChannelSelector} from 'mattermost-redux/selectors/entities/channels'; +import {getConfig} from 'mattermost-redux/selectors/entities/general'; import {getPost} from 'mattermost-redux/selectors/entities/posts'; +import {getCurrentTeamId} from 'mattermost-redux/selectors/entities/teams'; import {getCurrentTimezone} from 'mattermost-redux/selectors/entities/timezone'; -import {Action, ActionResult, DispatchFunc, GenericAction, GetStateFunc} from 'mattermost-redux/types/actions'; -import {Post} from '@mattermost/types/posts'; +import {getCurrentUserMentionKeys} from 'mattermost-redux/selectors/entities/users'; +import type {Action, ActionResult, DispatchFunc, GenericAction, GetStateFunc} from 'mattermost-redux/types/actions'; import {trackEvent} from 'actions/telemetry_actions.jsx'; import {getSearchTerms, getRhsState, getPluggableId, getFilesSearchExtFilter, getPreviousRhsState} from 'selectors/rhs'; + +import {SidebarSize} from 'components/resizable_sidebar/constants'; + import {ActionTypes, RHSStates, Constants} from 'utils/constants'; import {getBrowserUtcOffset, getUtcOffsetForTimeZone} from 'utils/timezone'; -import {RhsState} from 'types/store/rhs'; -import {GlobalState} from 'types/store'; -import {getPostsByIds, getPost as fetchPost} from 'mattermost-redux/actions/posts'; -import {getChannel} from 'mattermost-redux/actions/channels'; -import {SidebarSize} from 'components/resizable_sidebar/constants'; +import type {GlobalState} from 'types/store'; +import type {RhsState} from 'types/store/rhs'; function selectPostFromRightHandSideSearchWithPreviousState(post: Post, previousRhsState?: RhsState) { return async (dispatch: DispatchFunc, getState: GetStateFunc) => { diff --git a/webapp/channels/src/actions/views/root.test.ts b/webapp/channels/src/actions/views/root.test.ts index f22af072e0..54c2b93bd7 100644 --- a/webapp/channels/src/actions/views/root.test.ts +++ b/webapp/channels/src/actions/views/root.test.ts @@ -1,11 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {ActionTypes} from 'utils/constants'; import * as Actions from 'actions/views/root'; import * as i18nSelectors from 'selectors/i18n'; import mockStore from 'tests/test_store'; +import {ActionTypes} from 'utils/constants'; jest.mock('mattermost-redux/actions/general', () => { const original = jest.requireActual('mattermost-redux/actions/general'); diff --git a/webapp/channels/src/actions/views/root.ts b/webapp/channels/src/actions/views/root.ts index 6d3c9ac738..5f863aaf98 100644 --- a/webapp/channels/src/actions/views/root.ts +++ b/webapp/channels/src/actions/views/root.ts @@ -1,16 +1,18 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {Client4} from 'mattermost-redux/client'; import {getClientConfig, getLicenseConfig} from 'mattermost-redux/actions/general'; import {loadMe, loadMeREST} from 'mattermost-redux/actions/users'; -import {DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; -import {GlobalState} from 'types/store'; +import {Client4} from 'mattermost-redux/client'; +import type {DispatchFunc, GetStateFunc} from 'mattermost-redux/types/actions'; import {getCurrentLocale, getTranslations} from 'selectors/i18n'; -import {Translations} from 'types/store/i18n'; -import {ActionTypes} from 'utils/constants'; + import en from 'i18n/en.json'; +import {ActionTypes} from 'utils/constants'; + +import type {GlobalState} from 'types/store'; +import type {Translations} from 'types/store/i18n'; const pluginTranslationSources: Record = {}; diff --git a/webapp/channels/src/actions/views/textbox.js b/webapp/channels/src/actions/views/textbox.js index 07b9254818..49ac36a0f6 100644 --- a/webapp/channels/src/actions/views/textbox.js +++ b/webapp/channels/src/actions/views/textbox.js @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {ActionTypes} from '../../utils/constants'; +import {ActionTypes} from 'utils/constants'; export function setShowPreviewOnCreateComment(showPreview) { return { diff --git a/webapp/channels/src/actions/websocket_actions.jsx b/webapp/channels/src/actions/websocket_actions.jsx index 634533fdcf..73218c6066 100644 --- a/webapp/channels/src/actions/websocket_actions.jsx +++ b/webapp/channels/src/actions/websocket_actions.jsx @@ -21,7 +21,8 @@ import { CloudTypes, HostedCustomerTypes, } from 'mattermost-redux/action_types'; -import {General, Permissions} from 'mattermost-redux/constants'; +import {getStandardAnalytics} from 'mattermost-redux/actions/admin'; +import {fetchAppBindings, fetchRHSAppsBindings} from 'mattermost-redux/actions/apps'; import {addChannelToInitialCategory, fetchMyCategories, receivedCategoryOrder} from 'mattermost-redux/actions/channel_categories'; import { getChannelAndMyMember, @@ -31,11 +32,21 @@ import { getChannelMemberCountsByGroup, } from 'mattermost-redux/actions/channels'; import {getCloudSubscription} from 'mattermost-redux/actions/cloud'; +import {clearErrors, logError} from 'mattermost-redux/actions/errors'; +import {setServerVersion, getClientConfig} from 'mattermost-redux/actions/general'; +import {getGroup as fetchGroup} from 'mattermost-redux/actions/groups'; +import { + getCustomEmojiForReaction, + getPosts, + getPostThread, + getMentionsAndStatusesForPosts, + getThreadsForPosts, + postDeleted, + receivedNewPost, + receivedPost, +} from 'mattermost-redux/actions/posts'; import {loadRolesIfNeeded} from 'mattermost-redux/actions/roles'; - -import {isCollapsedThreadsEnabled} from 'mattermost-redux/selectors/entities/preferences'; -import {getNewestThreadInTeam, getThread, getThreads} from 'mattermost-redux/selectors/entities/threads'; -import {getGroup} from 'mattermost-redux/selectors/entities/groups'; +import * as TeamActions from 'mattermost-redux/actions/teams'; import { getThread as fetchThread, getCountsAndThreadsSince, @@ -47,34 +58,14 @@ import { updateThreadRead, decrementThreadCounts, } from 'mattermost-redux/actions/threads'; - -import {setServerVersion, getClientConfig} from 'mattermost-redux/actions/general'; -import { - getCustomEmojiForReaction, - getPosts, - getPostThread, - getMentionsAndStatusesForPosts, - getThreadsForPosts, - postDeleted, - receivedNewPost, - receivedPost, -} from 'mattermost-redux/actions/posts'; -import {clearErrors, logError} from 'mattermost-redux/actions/errors'; - -import * as TeamActions from 'mattermost-redux/actions/teams'; import { checkForModifiedUsers, getUser as loadUser, } from 'mattermost-redux/actions/users'; -import {getGroup as fetchGroup} from 'mattermost-redux/actions/groups'; import {removeNotVisibleUsers} from 'mattermost-redux/actions/websocket'; -import {setGlobalItem} from 'actions/storage'; -import {setGlobalDraft, transformServerDraft} from 'actions/views/drafts'; - import {Client4} from 'mattermost-redux/client'; -import {getCurrentUser, getCurrentUserId, getUser, getIsManualStatusForUserId, isCurrentUserSystemAdmin} from 'mattermost-redux/selectors/entities/users'; -import {getMyTeams, getCurrentRelativeTeamUrl, getCurrentTeamId, getCurrentTeamUrl, getTeam} from 'mattermost-redux/selectors/entities/teams'; -import {getConfig, getLicense} from 'mattermost-redux/selectors/entities/general'; +import {General, Permissions} from 'mattermost-redux/constants'; +import {appsFeatureFlagEnabled} from 'mattermost-redux/selectors/entities/apps'; import { getChannel, getChannelMembersInChannels, @@ -83,41 +74,45 @@ import { getCurrentChannelId, getRedirectChannelNameForTeam, } from 'mattermost-redux/selectors/entities/channels'; +import {getConfig, getLicense} from 'mattermost-redux/selectors/entities/general'; +import {getGroup} from 'mattermost-redux/selectors/entities/groups'; import {getPost, getMostRecentPostIdInChannel, getTeamIdFromPost} from 'mattermost-redux/selectors/entities/posts'; +import {isCollapsedThreadsEnabled} from 'mattermost-redux/selectors/entities/preferences'; import {haveISystemPermission, haveITeamPermission} from 'mattermost-redux/selectors/entities/roles'; -import {appsFeatureFlagEnabled} from 'mattermost-redux/selectors/entities/apps'; -import {getStandardAnalytics} from 'mattermost-redux/actions/admin'; - -import {fetchAppBindings, fetchRHSAppsBindings} from 'mattermost-redux/actions/apps'; - -import {getSelectedChannelId, getSelectedPost} from 'selectors/rhs'; -import {isThreadOpen, isThreadManuallyUnread} from 'selectors/views/threads'; - -import {openModal} from 'actions/views/modals'; -import {incrementWsErrorCount, resetWsErrorCount} from 'actions/views/system'; -import {closeRightHandSide} from 'actions/views/rhs'; -import {syncPostsInChannel} from 'actions/views/channel'; -import {updateThreadLastOpened} from 'actions/views/threads'; - -import {getHistory} from 'utils/browser_history'; -import {loadChannelsForCurrentUser} from 'actions/channel_actions'; -import {loadCustomEmojisIfNeeded} from 'actions/emoji_actions'; -import {redirectUserToDefaultTeam} from 'actions/global_actions'; -import {handleNewPost} from 'actions/post_actions'; -import * as StatusActions from 'actions/status_actions'; -import {loadProfilesForSidebar} from 'actions/user_actions'; -import {sendDesktopNotification} from 'actions/notification_actions.jsx'; -import store from 'stores/redux_store.jsx'; -import WebSocketClient from 'client/web_websocket_client.jsx'; -import {loadPlugin, loadPluginsIfNecessary, removePlugin} from 'plugins'; -import {ActionTypes, Constants, AnnouncementBarMessages, SocketEvents, UserStatuses, ModalIdentifiers, WarnMetricTypes} from 'utils/constants'; -import {getSiteURL} from 'utils/url'; +import {getMyTeams, getCurrentRelativeTeamUrl, getCurrentTeamId, getCurrentTeamUrl, getTeam} from 'mattermost-redux/selectors/entities/teams'; +import {getNewestThreadInTeam, getThread, getThreads} from 'mattermost-redux/selectors/entities/threads'; +import {getCurrentUser, getCurrentUserId, getUser, getIsManualStatusForUserId, isCurrentUserSystemAdmin} from 'mattermost-redux/selectors/entities/users'; import {isGuest} from 'mattermost-redux/utils/user_utils'; -import RemovedFromChannelModal from 'components/removed_from_channel_modal'; -import InteractiveDialog from 'components/interactive_dialog'; + +import {loadChannelsForCurrentUser} from 'actions/channel_actions'; import { getTeamsUsage, } from 'actions/cloud'; +import {loadCustomEmojisIfNeeded} from 'actions/emoji_actions'; +import {redirectUserToDefaultTeam} from 'actions/global_actions'; +import {sendDesktopNotification} from 'actions/notification_actions.jsx'; +import {handleNewPost} from 'actions/post_actions'; +import * as StatusActions from 'actions/status_actions'; +import {setGlobalItem} from 'actions/storage'; +import {loadProfilesForSidebar} from 'actions/user_actions'; +import {syncPostsInChannel} from 'actions/views/channel'; +import {setGlobalDraft, transformServerDraft} from 'actions/views/drafts'; +import {openModal} from 'actions/views/modals'; +import {closeRightHandSide} from 'actions/views/rhs'; +import {incrementWsErrorCount, resetWsErrorCount} from 'actions/views/system'; +import {updateThreadLastOpened} from 'actions/views/threads'; +import {getSelectedChannelId, getSelectedPost} from 'selectors/rhs'; +import {isThreadOpen, isThreadManuallyUnread} from 'selectors/views/threads'; +import store from 'stores/redux_store.jsx'; + +import InteractiveDialog from 'components/interactive_dialog'; +import RemovedFromChannelModal from 'components/removed_from_channel_modal'; + +import WebSocketClient from 'client/web_websocket_client.jsx'; +import {loadPlugin, loadPluginsIfNecessary, removePlugin} from 'plugins'; +import {getHistory} from 'utils/browser_history'; +import {ActionTypes, Constants, AnnouncementBarMessages, SocketEvents, UserStatuses, ModalIdentifiers, WarnMetricTypes} from 'utils/constants'; +import {getSiteURL} from 'utils/url'; const dispatch = store.dispatch; const getState = store.getState; diff --git a/webapp/channels/src/actions/websocket_actions.test.jsx b/webapp/channels/src/actions/websocket_actions.test.jsx index 0b86ca42dd..16719e81a9 100644 --- a/webapp/channels/src/actions/websocket_actions.test.jsx +++ b/webapp/channels/src/actions/websocket_actions.test.jsx @@ -1,28 +1,25 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {ChannelTypes, UserTypes, CloudTypes} from 'mattermost-redux/action_types'; +import {getGroup} from 'mattermost-redux/actions/groups'; import { getMentionsAndStatusesForPosts, getThreadsForPosts, receivedNewPost, } from 'mattermost-redux/actions/posts'; -import {getGroup} from 'mattermost-redux/actions/groups'; -import {ChannelTypes, UserTypes, CloudTypes} from 'mattermost-redux/action_types'; import {getUser} from 'mattermost-redux/actions/users'; import {handleNewPost} from 'actions/post_actions'; -import {closeRightHandSide} from 'actions/views/rhs'; import {syncPostsInChannel} from 'actions/views/channel'; - +import {closeRightHandSide} from 'actions/views/rhs'; import store from 'stores/redux_store.jsx'; +import mergeObjects from 'packages/mattermost-redux/test/merge_objects'; import configureStore from 'tests/test_store'; - import {getHistory} from 'utils/browser_history'; import Constants, {SocketEvents, UserStatuses, ActionTypes} from 'utils/constants'; -import mergeObjects from 'packages/mattermost-redux/test/merge_objects'; - import { handleChannelUpdatedEvent, handleEvent, diff --git a/webapp/channels/src/components/about_build_modal/about_build_modal.test.tsx b/webapp/channels/src/components/about_build_modal/about_build_modal.test.tsx index 9cf362fe74..83d391ab00 100644 --- a/webapp/channels/src/components/about_build_modal/about_build_modal.test.tsx +++ b/webapp/channels/src/components/about_build_modal/about_build_modal.test.tsx @@ -3,12 +3,11 @@ import React from 'react'; -import {ClientConfig, ClientLicense} from '@mattermost/types/config'; +import type {ClientConfig, ClientLicense} from '@mattermost/types/config'; import AboutBuildModal from 'components/about_build_modal/about_build_modal'; import {renderWithFullContext, screen, userEvent} from 'tests/react_testing_utils'; - import {AboutLinks} from 'utils/constants'; import AboutBuildModalCloud from './about_build_modal_cloud/about_build_modal_cloud'; diff --git a/webapp/channels/src/components/about_build_modal/about_build_modal.tsx b/webapp/channels/src/components/about_build_modal/about_build_modal.tsx index 69ef4a84ea..4fa8feb271 100644 --- a/webapp/channels/src/components/about_build_modal/about_build_modal.tsx +++ b/webapp/channels/src/components/about_build_modal/about_build_modal.tsx @@ -5,14 +5,13 @@ import React from 'react'; import {Modal} from 'react-bootstrap'; import {FormattedMessage} from 'react-intl'; -import {ClientConfig, ClientLicense} from '@mattermost/types/config'; - -import MattermostLogo from 'components/widgets/icons/mattermost_logo'; -import Nbsp from 'components/html_entities/nbsp'; - -import {AboutLinks} from 'utils/constants'; +import type {ClientConfig, ClientLicense} from '@mattermost/types/config'; import ExternalLink from 'components/external_link'; +import Nbsp from 'components/html_entities/nbsp'; +import MattermostLogo from 'components/widgets/icons/mattermost_logo'; + +import {AboutLinks} from 'utils/constants'; import AboutBuildModalCloud from './about_build_modal_cloud/about_build_modal_cloud'; diff --git a/webapp/channels/src/components/about_build_modal/about_build_modal_cloud/about_build_modal_cloud.tsx b/webapp/channels/src/components/about_build_modal/about_build_modal_cloud/about_build_modal_cloud.tsx index 8834a30bd8..5bba99a7f7 100644 --- a/webapp/channels/src/components/about_build_modal/about_build_modal_cloud/about_build_modal_cloud.tsx +++ b/webapp/channels/src/components/about_build_modal/about_build_modal_cloud/about_build_modal_cloud.tsx @@ -1,17 +1,18 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import classNames from 'classnames'; import React from 'react'; import {Modal} from 'react-bootstrap'; import {FormattedMessage} from 'react-intl'; -import classNames from 'classnames'; import {useSelector} from 'react-redux'; +import ExternalLink from 'components/external_link'; import MattermostLogo from 'components/widgets/icons/mattermost_logo'; -import {GlobalState} from 'types/store'; + +import type {GlobalState} from 'types/store'; import './about_build_modal_cloud.scss'; -import ExternalLink from 'components/external_link'; type Props = { onExited: () => void; diff --git a/webapp/channels/src/components/about_build_modal/index.ts b/webapp/channels/src/components/about_build_modal/index.ts index 8e3fdd78f8..71664588cd 100644 --- a/webapp/channels/src/components/about_build_modal/index.ts +++ b/webapp/channels/src/components/about_build_modal/index.ts @@ -5,7 +5,7 @@ import {connect} from 'react-redux'; import {getConfig, getLicense} from 'mattermost-redux/selectors/entities/general'; -import {GlobalState} from 'types/store'; +import type {GlobalState} from 'types/store'; import AboutBuildModal from './about_build_modal'; diff --git a/webapp/channels/src/components/access_history_modal/access_history_modal.test.tsx b/webapp/channels/src/components/access_history_modal/access_history_modal.test.tsx index e433a27d1d..f9ec3be108 100644 --- a/webapp/channels/src/components/access_history_modal/access_history_modal.test.tsx +++ b/webapp/channels/src/components/access_history_modal/access_history_modal.test.tsx @@ -1,14 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; +import {fireEvent, screen, render, waitForElementToBeRemoved, waitFor} from '@testing-library/react'; import {shallow} from 'enzyme'; +import React from 'react'; import AccessHistoryModal from 'components/access_history_modal/access_history_modal'; import AuditTable from 'components/audit_table'; import LoadingScreen from 'components/loading_screen'; + import {withIntl} from 'tests/helpers/intl-test-helper'; -import {fireEvent, screen, render, waitForElementToBeRemoved, waitFor} from '@testing-library/react'; describe('components/AccessHistoryModal', () => { const baseProps = { diff --git a/webapp/channels/src/components/access_history_modal/access_history_modal.tsx b/webapp/channels/src/components/access_history_modal/access_history_modal.tsx index 2dc40074bd..cce49a8b6e 100644 --- a/webapp/channels/src/components/access_history_modal/access_history_modal.tsx +++ b/webapp/channels/src/components/access_history_modal/access_history_modal.tsx @@ -5,9 +5,10 @@ import React, {useCallback, useEffect, useState} from 'react'; import {Modal} from 'react-bootstrap'; import {FormattedMessage} from 'react-intl'; +import type {Audit} from '@mattermost/types/audits'; + import AuditTable from 'components/audit_table'; import LoadingScreen from 'components/loading_screen'; -import {Audit} from '@mattermost/types/audits'; type Props = { onHide: () => void; diff --git a/webapp/channels/src/components/access_history_modal/index.ts b/webapp/channels/src/components/access_history_modal/index.ts index b75800e395..52fb74f6bf 100644 --- a/webapp/channels/src/components/access_history_modal/index.ts +++ b/webapp/channels/src/components/access_history_modal/index.ts @@ -2,13 +2,14 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch} from 'redux'; import {getUserAudits} from 'mattermost-redux/actions/users'; import {getCurrentUserId, getUserAudits as getCurrentUserAudits} from 'mattermost-redux/selectors/entities/users'; -import {GenericAction} from 'mattermost-redux/types/actions'; +import type {GenericAction} from 'mattermost-redux/types/actions'; -import {GlobalState} from 'types/store'; +import type {GlobalState} from 'types/store'; import AccessHistoryModal from './access_history_modal'; diff --git a/webapp/channels/src/components/actions_menu/actions_menu.test.tsx b/webapp/channels/src/components/actions_menu/actions_menu.test.tsx index 03fe1d067e..a011701a7a 100644 --- a/webapp/channels/src/components/actions_menu/actions_menu.test.tsx +++ b/webapp/channels/src/components/actions_menu/actions_menu.test.tsx @@ -3,14 +3,15 @@ import React from 'react'; -import {PostType} from '@mattermost/types/posts'; -import {PluginComponent} from 'types/store/plugins'; +import type {PostType} from '@mattermost/types/posts'; import {shallowWithIntl} from 'tests/helpers/intl-test-helper'; - import {TestHelper} from 'utils/test_helper'; -import ActionsMenu, {PLUGGABLE_COMPONENT, Props} from './actions_menu'; +import type {PluginComponent} from 'types/store/plugins'; + +import ActionsMenu, {PLUGGABLE_COMPONENT} from './actions_menu'; +import type {Props} from './actions_menu'; jest.mock('utils/utils', () => { const original = jest.requireActual('utils/utils'); diff --git a/webapp/channels/src/components/actions_menu/actions_menu.tsx b/webapp/channels/src/components/actions_menu/actions_menu.tsx index cbd8ba2281..74337bcf0f 100644 --- a/webapp/channels/src/components/actions_menu/actions_menu.tsx +++ b/webapp/channels/src/components/actions_menu/actions_menu.tsx @@ -1,33 +1,37 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import classNames from 'classnames'; -import {FormattedMessage, injectIntl, IntlShape} from 'react-intl'; -import './actions_menu.scss'; - +import React from 'react'; import {Tooltip} from 'react-bootstrap'; +import {FormattedMessage, injectIntl} from 'react-intl'; +import type {IntlShape} from 'react-intl'; + +import type {AppBinding} from '@mattermost/types/apps'; +import type {Post} from '@mattermost/types/posts'; + +import {AppCallResponseTypes} from 'mattermost-redux/constants/apps'; +import Permissions from 'mattermost-redux/constants/permissions'; import FormattedMarkdownMessage from 'components/formatted_markdown_message'; - -import {Post} from '@mattermost/types/posts'; -import {AppBinding} from '@mattermost/types/apps'; -import {AppCallResponseTypes} from 'mattermost-redux/constants/apps'; - -import {HandleBindingClick, PostEphemeralCallResponseForPost, OpenAppsModal} from 'types/apps'; -import {Locations, Constants, ModalIdentifiers} from 'utils/constants'; -import Permissions from 'mattermost-redux/constants/permissions'; -import {ModalData} from 'types/actions'; -import MarketplaceModal, {OpenedFromType} from 'components/plugin_marketplace/marketplace_modal'; import OverlayTrigger from 'components/overlay_trigger'; -import * as PostUtils from 'utils/post_utils'; -import * as Utils from 'utils/utils'; import SystemPermissionGate from 'components/permissions_gates/system_permission_gate'; -import Pluggable from 'plugins/pluggable'; +import MarketplaceModal from 'components/plugin_marketplace/marketplace_modal'; +import type {OpenedFromType} from 'components/plugin_marketplace/marketplace_modal'; import Menu from 'components/widgets/menu/menu'; import MenuWrapper from 'components/widgets/menu/menu_wrapper'; -import {PluginComponent} from 'types/store/plugins'; + +import Pluggable from 'plugins/pluggable'; import {createCallContext} from 'utils/apps'; +import {Locations, Constants, ModalIdentifiers} from 'utils/constants'; +import * as PostUtils from 'utils/post_utils'; +import * as Utils from 'utils/utils'; + +import type {ModalData} from 'types/actions'; +import type {HandleBindingClick, PostEphemeralCallResponseForPost, OpenAppsModal} from 'types/apps'; +import type {PluginComponent} from 'types/store/plugins'; + +import './actions_menu.scss'; import {ActionsMenuIcon} from './actions_menu_icon'; diff --git a/webapp/channels/src/components/actions_menu/actions_menu_empty.test.tsx b/webapp/channels/src/components/actions_menu/actions_menu_empty.test.tsx index 5b61b9cf9d..0613ccade0 100644 --- a/webapp/channels/src/components/actions_menu/actions_menu_empty.test.tsx +++ b/webapp/channels/src/components/actions_menu/actions_menu_empty.test.tsx @@ -4,7 +4,9 @@ import {shallow} from 'enzyme'; import React from 'react'; -import ActionsMenu, {Props} from 'components/actions_menu/actions_menu'; +import ActionsMenu from 'components/actions_menu/actions_menu'; +import type {Props} from 'components/actions_menu/actions_menu'; + import {TestHelper} from 'utils/test_helper'; jest.mock('utils/utils', () => { diff --git a/webapp/channels/src/components/actions_menu/actions_menu_mobile.test.tsx b/webapp/channels/src/components/actions_menu/actions_menu_mobile.test.tsx index cdd71a8390..dae362128e 100644 --- a/webapp/channels/src/components/actions_menu/actions_menu_mobile.test.tsx +++ b/webapp/channels/src/components/actions_menu/actions_menu_mobile.test.tsx @@ -4,7 +4,9 @@ import {shallow} from 'enzyme'; import React from 'react'; -import ActionsMenu, {Props} from 'components/actions_menu/actions_menu'; +import ActionsMenu from 'components/actions_menu/actions_menu'; +import type {Props} from 'components/actions_menu/actions_menu'; + import {TestHelper} from 'utils/test_helper'; jest.mock('utils/utils', () => { diff --git a/webapp/channels/src/components/actions_menu/index.ts b/webapp/channels/src/components/actions_menu/index.ts index 21c9c2588b..d6f1e9528b 100644 --- a/webapp/channels/src/components/actions_menu/index.ts +++ b/webapp/channels/src/components/actions_menu/index.ts @@ -1,34 +1,33 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {ComponentProps} from 'react'; +import type {ComponentProps} from 'react'; import {connect} from 'react-redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; -import {getCurrentUser} from 'mattermost-redux/selectors/entities/users'; -import {getCurrentTeamId} from 'mattermost-redux/selectors/entities/teams'; -import {appsEnabled} from 'mattermost-redux/selectors/entities/apps'; - -import {AppBindingLocations} from 'mattermost-redux/constants/apps'; - -import {isSystemAdmin} from 'mattermost-redux/utils/user_utils'; -import {isSystemMessage} from 'mattermost-redux/utils/post_utils'; -import {isCombinedUserActivityPost} from 'mattermost-redux/utils/post_list'; - -import {GenericAction} from 'mattermost-redux/types/actions'; -import {ModalData} from 'types/actions'; -import {getIsMobileView} from 'selectors/views/browser'; -import {AppBinding} from '@mattermost/types/apps'; -import {Post} from '@mattermost/types/posts'; -import {HandleBindingClick, OpenAppsModal, PostEphemeralCallResponseForPost} from 'types/apps'; -import {GlobalState} from 'types/store'; - -import {openModal} from 'actions/views/modals'; -import {makeFetchBindings, postEphemeralCallResponseForPost, handleBindingClick, openAppsModal} from 'actions/apps'; +import type {AppBinding} from '@mattermost/types/apps'; +import type {Post} from '@mattermost/types/posts'; import {Permissions} from 'mattermost-redux/constants'; +import {AppBindingLocations} from 'mattermost-redux/constants/apps'; +import {appsEnabled} from 'mattermost-redux/selectors/entities/apps'; import {isMarketplaceEnabled} from 'mattermost-redux/selectors/entities/general'; import {haveICurrentTeamPermission} from 'mattermost-redux/selectors/entities/roles'; +import {getCurrentTeamId} from 'mattermost-redux/selectors/entities/teams'; +import {getCurrentUser} from 'mattermost-redux/selectors/entities/users'; +import type {GenericAction} from 'mattermost-redux/types/actions'; +import {isCombinedUserActivityPost} from 'mattermost-redux/utils/post_list'; +import {isSystemMessage} from 'mattermost-redux/utils/post_utils'; +import {isSystemAdmin} from 'mattermost-redux/utils/user_utils'; + +import {makeFetchBindings, postEphemeralCallResponseForPost, handleBindingClick, openAppsModal} from 'actions/apps'; +import {openModal} from 'actions/views/modals'; +import {getIsMobileView} from 'selectors/views/browser'; + +import type {ModalData} from 'types/actions'; +import type {HandleBindingClick, OpenAppsModal, PostEphemeralCallResponseForPost} from 'types/apps'; +import type {GlobalState} from 'types/store'; import ActionsMenu from './actions_menu'; import {makeGetPostOptionBinding} from './selectors'; diff --git a/webapp/channels/src/components/actions_menu/selectors.ts b/webapp/channels/src/components/actions_menu/selectors.ts index a9a2606ca7..2dc7be05e9 100644 --- a/webapp/channels/src/components/actions_menu/selectors.ts +++ b/webapp/channels/src/components/actions_menu/selectors.ts @@ -1,15 +1,16 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {AppBinding} from '@mattermost/types/apps'; +import type {AppBinding} from '@mattermost/types/apps'; -import {createSelector} from 'mattermost-redux/selectors/create_selector'; import {AppBindingLocations} from 'mattermost-redux/constants/apps'; +import {createSelector} from 'mattermost-redux/selectors/create_selector'; import {makeAppBindingsSelector, makeRHSAppBindingSelector} from 'mattermost-redux/selectors/entities/apps'; -import {GlobalState} from 'types/store'; import {Locations} from 'utils/constants'; +import type {GlobalState} from 'types/store'; + export function makeGetPostOptionBinding(): (state: GlobalState, location?: string) => AppBinding[] | null { const centerBindingsSelector = makeAppBindingsSelector(AppBindingLocations.POST_MENU_ITEM); const rhsBindingsSelector = makeRHSAppBindingSelector(AppBindingLocations.POST_MENU_ITEM); diff --git a/webapp/channels/src/components/activity_log_modal/activity_log_modal.test.tsx b/webapp/channels/src/components/activity_log_modal/activity_log_modal.test.tsx index bf1b05b8f8..d84e1a84a1 100644 --- a/webapp/channels/src/components/activity_log_modal/activity_log_modal.test.tsx +++ b/webapp/channels/src/components/activity_log_modal/activity_log_modal.test.tsx @@ -1,13 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {MouseEvent} from 'react'; import {shallow} from 'enzyme'; - -import ActivityLogModal from 'components/activity_log_modal/activity_log_modal'; +import React from 'react'; +import type {MouseEvent} from 'react'; import {General} from 'mattermost-redux/constants'; +import ActivityLogModal from 'components/activity_log_modal/activity_log_modal'; + describe('components/ActivityLogModal', () => { const baseProps = { sessions: [], diff --git a/webapp/channels/src/components/activity_log_modal/activity_log_modal.tsx b/webapp/channels/src/components/activity_log_modal/activity_log_modal.tsx index 94ddede970..40e5d4b92b 100644 --- a/webapp/channels/src/components/activity_log_modal/activity_log_modal.tsx +++ b/webapp/channels/src/components/activity_log_modal/activity_log_modal.tsx @@ -5,8 +5,9 @@ import React from 'react'; import {Modal} from 'react-bootstrap'; import {FormattedMessage} from 'react-intl'; -import {Session} from '@mattermost/types/sessions'; -import {ActionFunc} from 'mattermost-redux/types/actions'; +import type {Session} from '@mattermost/types/sessions'; + +import type {ActionFunc} from 'mattermost-redux/types/actions'; import ActivityLog from 'components/activity_log_modal/components/activity_log'; diff --git a/webapp/channels/src/components/activity_log_modal/components/activity_log.test.tsx b/webapp/channels/src/components/activity_log_modal/components/activity_log.test.tsx index 10600eca49..3891a110d3 100644 --- a/webapp/channels/src/components/activity_log_modal/components/activity_log.test.tsx +++ b/webapp/channels/src/components/activity_log_modal/components/activity_log.test.tsx @@ -1,15 +1,16 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import {FormattedMessage} from 'react-intl'; import {General} from 'mattermost-redux/constants'; -import {localizeMessage} from 'utils/utils'; import ActivityLog from 'components/activity_log_modal/components/activity_log'; + import {TestHelper} from 'utils/test_helper'; +import {localizeMessage} from 'utils/utils'; describe('components/activity_log_modal/ActivityLog', () => { const baseProps = { diff --git a/webapp/channels/src/components/activity_log_modal/components/activity_log.tsx b/webapp/channels/src/components/activity_log_modal/components/activity_log.tsx index 2c625e0972..e5cf9cef0f 100644 --- a/webapp/channels/src/components/activity_log_modal/components/activity_log.tsx +++ b/webapp/channels/src/components/activity_log_modal/components/activity_log.tsx @@ -4,11 +4,12 @@ import React from 'react'; import {FormattedDate, FormattedMessage, FormattedTime} from 'react-intl'; -import {General} from 'mattermost-redux/constants'; -import {Session} from '@mattermost/types/sessions'; +import type {Session} from '@mattermost/types/sessions'; + +import {General} from 'mattermost-redux/constants'; -import {localizeMessage} from 'utils/utils'; import {getMonthLong, t} from 'utils/i18n'; +import {localizeMessage} from 'utils/utils'; import MoreInfo from './more_info'; diff --git a/webapp/channels/src/components/activity_log_modal/components/more_info.test.tsx b/webapp/channels/src/components/activity_log_modal/components/more_info.test.tsx index d05bbef7bc..ab762b1eb2 100644 --- a/webapp/channels/src/components/activity_log_modal/components/more_info.test.tsx +++ b/webapp/channels/src/components/activity_log_modal/components/more_info.test.tsx @@ -1,12 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import {General} from 'mattermost-redux/constants'; import MoreInfo from 'components/activity_log_modal/components/more_info'; + import {TestHelper} from 'utils/test_helper'; describe('components/activity_log_modal/MoreInfo', () => { diff --git a/webapp/channels/src/components/activity_log_modal/components/more_info.tsx b/webapp/channels/src/components/activity_log_modal/components/more_info.tsx index 37f72c006f..abc0899776 100644 --- a/webapp/channels/src/components/activity_log_modal/components/more_info.tsx +++ b/webapp/channels/src/components/activity_log_modal/components/more_info.tsx @@ -4,7 +4,7 @@ import React from 'react'; import {FormattedDate, FormattedMessage, FormattedTime} from 'react-intl'; -import {Session} from '@mattermost/types/sessions'; +import type {Session} from '@mattermost/types/sessions'; import {getMonthLong} from 'utils/i18n'; diff --git a/webapp/channels/src/components/activity_log_modal/index.ts b/webapp/channels/src/components/activity_log_modal/index.ts index a7afa0be8c..255443fb33 100644 --- a/webapp/channels/src/components/activity_log_modal/index.ts +++ b/webapp/channels/src/components/activity_log_modal/index.ts @@ -2,16 +2,19 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; import {getSessions, revokeSession} from 'mattermost-redux/actions/users'; import {getCurrentUserId, getUserSessions} from 'mattermost-redux/selectors/entities/users'; -import {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; +import type {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; import {getCurrentLocale} from 'selectors/i18n'; -import {GlobalState} from 'types/store'; -import ActivityLogModal, {Props} from './activity_log_modal'; +import type {GlobalState} from 'types/store'; + +import ActivityLogModal from './activity_log_modal'; +import type {Props} from './activity_log_modal'; function mapStateToProps(state: GlobalState) { return { diff --git a/webapp/channels/src/components/add_groups_to_channel_modal/add_groups_to_channel_modal.test.tsx b/webapp/channels/src/components/add_groups_to_channel_modal/add_groups_to_channel_modal.test.tsx index b2eb486d34..d9b768216b 100644 --- a/webapp/channels/src/components/add_groups_to_channel_modal/add_groups_to_channel_modal.test.tsx +++ b/webapp/channels/src/components/add_groups_to_channel_modal/add_groups_to_channel_modal.test.tsx @@ -1,12 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import {SyncableType} from '@mattermost/types/groups'; -import AddGroupsToChannelModal, {Props} from 'components/add_groups_to_channel_modal/add_groups_to_channel_modal'; +import AddGroupsToChannelModal from 'components/add_groups_to_channel_modal/add_groups_to_channel_modal'; +import type {Props} from 'components/add_groups_to_channel_modal/add_groups_to_channel_modal'; describe('components/AddGroupsToChannelModal', () => { const baseProps: Props = { diff --git a/webapp/channels/src/components/add_groups_to_channel_modal/add_groups_to_channel_modal.tsx b/webapp/channels/src/components/add_groups_to_channel_modal/add_groups_to_channel_modal.tsx index 98db0db487..03d55748aa 100644 --- a/webapp/channels/src/components/add_groups_to_channel_modal/add_groups_to_channel_modal.tsx +++ b/webapp/channels/src/components/add_groups_to_channel_modal/add_groups_to_channel_modal.tsx @@ -5,19 +5,20 @@ import React from 'react'; import {Modal} from 'react-bootstrap'; import {FormattedMessage} from 'react-intl'; -import {Group, SyncablePatch, SyncableType} from '@mattermost/types/groups'; +import type {ServerError} from '@mattermost/types/errors'; +import type {Group, SyncablePatch} from '@mattermost/types/groups'; +import {SyncableType} from '@mattermost/types/groups'; -import {ActionFunc} from 'mattermost-redux/types/actions'; +import type {ActionFunc} from 'mattermost-redux/types/actions'; -import {ServerError} from '@mattermost/types/errors'; +import MultiSelect from 'components/multiselect/multiselect'; +import type {Value} from 'components/multiselect/multiselect'; +import AddIcon from 'components/widgets/icons/fa_add_icon'; +import groupsAvatar from 'images/groups-avatar.png'; import Constants from 'utils/constants'; import {localizeMessage} from 'utils/utils'; -import MultiSelect, {Value} from 'components/multiselect/multiselect'; -import groupsAvatar from 'images/groups-avatar.png'; -import AddIcon from 'components/widgets/icons/fa_add_icon'; - const GROUPS_PER_PAGE = 50; const MAX_SELECTABLE_VALUES = 10; diff --git a/webapp/channels/src/components/add_groups_to_channel_modal/index.ts b/webapp/channels/src/components/add_groups_to_channel_modal/index.ts index 4fb80080a5..3c4e60b5f6 100644 --- a/webapp/channels/src/components/add_groups_to_channel_modal/index.ts +++ b/webapp/channels/src/components/add_groups_to_channel_modal/index.ts @@ -2,21 +2,24 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; + +import type {Channel} from '@mattermost/types/channels'; +import type {Group} from '@mattermost/types/groups'; import {getGroupsNotAssociatedToChannel, linkGroupSyncable, getAllGroupsAssociatedToChannel, getAllGroupsAssociatedToTeam} from 'mattermost-redux/actions/groups'; import {getTeam} from 'mattermost-redux/actions/teams'; -import {getGroupsNotAssociatedToChannel as selectGroupsNotAssociatedToChannel} from 'mattermost-redux/selectors/entities/groups'; import {getCurrentChannel} from 'mattermost-redux/selectors/entities/channels'; +import {getGroupsNotAssociatedToChannel as selectGroupsNotAssociatedToChannel} from 'mattermost-redux/selectors/entities/groups'; +import type {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; -import {Channel} from '@mattermost/types/channels'; -import {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; -import {Group} from '@mattermost/types/groups'; - -import {GlobalState} from 'types/store'; import {setModalSearchTerm} from 'actions/views/search'; -import AddGroupsToChannelModal, {Props} from './add_groups_to_channel_modal'; +import type {GlobalState} from 'types/store'; + +import AddGroupsToChannelModal from './add_groups_to_channel_modal'; +import type {Props} from './add_groups_to_channel_modal'; type OwnProps = { channel: Channel; diff --git a/webapp/channels/src/components/add_groups_to_team_modal/add_groups_to_team_modal.test.tsx b/webapp/channels/src/components/add_groups_to_team_modal/add_groups_to_team_modal.test.tsx index a15e8d2622..e6f03d19fe 100644 --- a/webapp/channels/src/components/add_groups_to_team_modal/add_groups_to_team_modal.test.tsx +++ b/webapp/channels/src/components/add_groups_to_team_modal/add_groups_to_team_modal.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import {SyncableType} from '@mattermost/types/groups'; diff --git a/webapp/channels/src/components/add_groups_to_team_modal/add_groups_to_team_modal.tsx b/webapp/channels/src/components/add_groups_to_team_modal/add_groups_to_team_modal.tsx index 69b03525e7..6b768a1b95 100644 --- a/webapp/channels/src/components/add_groups_to_team_modal/add_groups_to_team_modal.tsx +++ b/webapp/channels/src/components/add_groups_to_team_modal/add_groups_to_team_modal.tsx @@ -1,20 +1,23 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {RefObject} from 'react'; +import React from 'react'; +import type {RefObject} from 'react'; import {Modal} from 'react-bootstrap'; import {FormattedMessage} from 'react-intl'; -import {Group, GroupsWithCount, SyncablePatch, SyncableType} from '@mattermost/types/groups'; +import type {Group, GroupsWithCount, SyncablePatch} from '@mattermost/types/groups'; +import {SyncableType} from '@mattermost/types/groups'; +import Nbsp from 'components/html_entities/nbsp'; +import MultiSelect from 'components/multiselect/multiselect'; +import type {Value} from 'components/multiselect/multiselect'; +import AddIcon from 'components/widgets/icons/fa_add_icon'; + +import groupsAvatar from 'images/groups-avatar.png'; import Constants from 'utils/constants'; import {localizeMessage} from 'utils/utils'; -import MultiSelect, {Value} from 'components/multiselect/multiselect'; -import groupsAvatar from 'images/groups-avatar.png'; -import AddIcon from 'components/widgets/icons/fa_add_icon'; -import Nbsp from 'components/html_entities/nbsp'; - const GROUPS_PER_PAGE = 50; const MAX_SELECTABLE_VALUES = 10; diff --git a/webapp/channels/src/components/add_groups_to_team_modal/index.ts b/webapp/channels/src/components/add_groups_to_team_modal/index.ts index 40db350963..3031a7a761 100644 --- a/webapp/channels/src/components/add_groups_to_team_modal/index.ts +++ b/webapp/channels/src/components/add_groups_to_team_modal/index.ts @@ -2,19 +2,23 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; + +import type {Group} from '@mattermost/types/groups'; +import type {Team} from '@mattermost/types/teams'; import {getGroupsNotAssociatedToTeam, linkGroupSyncable, getAllGroupsAssociatedToTeam} from 'mattermost-redux/actions/groups'; import {getGroupsNotAssociatedToTeam as selectGroupsNotAssociatedToTeam} from 'mattermost-redux/selectors/entities/groups'; import {getCurrentTeam} from 'mattermost-redux/selectors/entities/teams'; -import {Team} from '@mattermost/types/teams'; -import {Group} from '@mattermost/types/groups'; -import {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; +import type {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; import {setModalSearchTerm} from 'actions/views/search'; -import {GlobalState} from '../../types/store'; -import AddGroupsToTeamModal, {Actions} from './add_groups_to_team_modal'; +import type {GlobalState} from 'types/store'; + +import AddGroupsToTeamModal from './add_groups_to_team_modal'; +import type {Actions} from './add_groups_to_team_modal'; type Props = { team?: Team; diff --git a/webapp/channels/src/components/add_user_to_channel_modal/add_user_to_channel_modal.test.tsx b/webapp/channels/src/components/add_user_to_channel_modal/add_user_to_channel_modal.test.tsx index 146eb66eaa..eca7ff3e7e 100644 --- a/webapp/channels/src/components/add_user_to_channel_modal/add_user_to_channel_modal.test.tsx +++ b/webapp/channels/src/components/add_user_to_channel_modal/add_user_to_channel_modal.test.tsx @@ -1,10 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import AddUserToChannelModal from 'components/add_user_to_channel_modal/add_user_to_channel_modal'; + import {TestHelper} from 'utils/test_helper'; describe('components/AddUserToChannelModal', () => { diff --git a/webapp/channels/src/components/add_user_to_channel_modal/add_user_to_channel_modal.tsx b/webapp/channels/src/components/add_user_to_channel_modal/add_user_to_channel_modal.tsx index e90ca0b05e..18f651bc2f 100644 --- a/webapp/channels/src/components/add_user_to_channel_modal/add_user_to_channel_modal.tsx +++ b/webapp/channels/src/components/add_user_to_channel_modal/add_user_to_channel_modal.tsx @@ -1,24 +1,25 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {ChangeEvent, FormEvent} from 'react'; +import React from 'react'; +import type {ChangeEvent, FormEvent} from 'react'; import {Modal} from 'react-bootstrap'; import {FormattedMessage} from 'react-intl'; -import {getFullName} from 'mattermost-redux/utils/user_utils'; -import {ActionResult} from 'mattermost-redux/types/actions'; +import type {Channel, ChannelMembership} from '@mattermost/types/channels'; +import type {UserProfile} from '@mattermost/types/users'; +import type {RelationOneToOne} from '@mattermost/types/utilities'; +import type {ActionResult} from 'mattermost-redux/types/actions'; +import {getFullName} from 'mattermost-redux/utils/user_utils'; + +import ModalSuggestionList from 'components/suggestion/modal_suggestion_list'; import SearchChannelWithPermissionsProvider from 'components/suggestion/search_channel_with_permissions_provider'; import SuggestionBox from 'components/suggestion/suggestion_box'; -import SuggestionBoxComponent from 'components/suggestion/suggestion_box/suggestion_box'; -import ModalSuggestionList from 'components/suggestion/modal_suggestion_list'; +import type SuggestionBoxComponent from 'components/suggestion/suggestion_box/suggestion_box'; import {placeCaretAtEnd} from 'utils/utils'; -import {UserProfile} from '@mattermost/types/users'; -import {Channel, ChannelMembership} from '@mattermost/types/channels'; -import {RelationOneToOne} from '@mattermost/types/utilities'; - export type Props = { /** diff --git a/webapp/channels/src/components/add_user_to_channel_modal/index.ts b/webapp/channels/src/components/add_user_to_channel_modal/index.ts index 9930594cdf..2d7232487f 100644 --- a/webapp/channels/src/components/add_user_to_channel_modal/index.ts +++ b/webapp/channels/src/components/add_user_to_channel_modal/index.ts @@ -2,16 +2,17 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; + +import type {GlobalState} from '@mattermost/types/store'; import {addChannelMember, getChannelMember, autocompleteChannelsForSearch} from 'mattermost-redux/actions/channels'; import {getChannelMembersInChannels} from 'mattermost-redux/selectors/entities/channels'; +import type {ActionFunc} from 'mattermost-redux/types/actions'; -import {GlobalState} from '@mattermost/types/store'; - -import {ActionFunc} from 'mattermost-redux/types/actions'; - -import AddUserToChannelModal, {Props} from './add_user_to_channel_modal'; +import AddUserToChannelModal from './add_user_to_channel_modal'; +import type {Props} from './add_user_to_channel_modal'; function mapStateToProps(state: GlobalState) { const channelMembers = getChannelMembersInChannels(state) || {}; diff --git a/webapp/channels/src/components/add_user_to_group_multiselect/add_user_to_group_multiselect.test.tsx b/webapp/channels/src/components/add_user_to_group_multiselect/add_user_to_group_multiselect.test.tsx index 57ba17fe9e..51c71fef00 100644 --- a/webapp/channels/src/components/add_user_to_group_multiselect/add_user_to_group_multiselect.test.tsx +++ b/webapp/channels/src/components/add_user_to_group_multiselect/add_user_to_group_multiselect.test.tsx @@ -1,14 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {shallow} from 'enzyme'; import React from 'react'; -import {shallow} from 'enzyme'; +import type {UserProfile} from '@mattermost/types/users'; +import type {RelationOneToOne} from '@mattermost/types/utilities'; -import {UserProfile} from '@mattermost/types/users'; - -import {Value} from 'components/multiselect/multiselect'; -import {RelationOneToOne} from '@mattermost/types/utilities'; +import type {Value} from 'components/multiselect/multiselect'; import AddUserToGroupMultiSelect from './add_user_to_group_multiselect'; diff --git a/webapp/channels/src/components/add_user_to_group_multiselect/add_user_to_group_multiselect.tsx b/webapp/channels/src/components/add_user_to_group_multiselect/add_user_to_group_multiselect.tsx index b6e1a3894d..15a85c5ce1 100644 --- a/webapp/channels/src/components/add_user_to_group_multiselect/add_user_to_group_multiselect.tsx +++ b/webapp/channels/src/components/add_user_to_group_multiselect/add_user_to_group_multiselect.tsx @@ -3,15 +3,17 @@ import React from 'react'; -import {RelationOneToOne} from '@mattermost/types/utilities'; -import {ActionResult} from 'mattermost-redux/types/actions'; -import {UserProfile} from '@mattermost/types/users'; +import type {UserProfile} from '@mattermost/types/users'; +import type {RelationOneToOne} from '@mattermost/types/utilities'; +import type {ActionResult} from 'mattermost-redux/types/actions'; import {filterProfilesStartingWithTerm} from 'mattermost-redux/utils/user_utils'; -import {localizeMessage} from 'utils/utils'; -import MultiSelect, {Value} from 'components/multiselect/multiselect'; + +import MultiSelect from 'components/multiselect/multiselect'; +import type {Value} from 'components/multiselect/multiselect'; import Constants from 'utils/constants'; +import {localizeMessage} from 'utils/utils'; import MultiSelectOption from './multiselect_option/multiselect_option'; diff --git a/webapp/channels/src/components/add_user_to_group_multiselect/index.ts b/webapp/channels/src/components/add_user_to_group_multiselect/index.ts index 1271f3f430..a21cff859a 100644 --- a/webapp/channels/src/components/add_user_to_group_multiselect/index.ts +++ b/webapp/channels/src/components/add_user_to_group_multiselect/index.ts @@ -2,18 +2,20 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; + +import type {UserProfile} from '@mattermost/types/users'; import {getProfilesNotInGroup, searchProfiles, getProfiles} from 'mattermost-redux/actions/users'; import {getProfilesNotInCurrentGroup, getUserStatuses, getProfiles as getUsers} from 'mattermost-redux/selectors/entities/users'; -import {Action, ActionResult} from 'mattermost-redux/types/actions'; -import {UserProfile} from '@mattermost/types/users'; - -import {Value} from 'components/multiselect/multiselect'; +import type {Action, ActionResult} from 'mattermost-redux/types/actions'; import {loadStatusesForProfilesList} from 'actions/status_actions'; -import {GlobalState} from 'types/store'; +import type {Value} from 'components/multiselect/multiselect'; + +import type {GlobalState} from 'types/store'; import AddUserToGroupMultiSelect from './add_user_to_group_multiselect'; diff --git a/webapp/channels/src/components/add_user_to_group_multiselect/multiselect_option/multiselect_option.tsx b/webapp/channels/src/components/add_user_to_group_multiselect/multiselect_option/multiselect_option.tsx index f0f8c9685a..778c81160f 100644 --- a/webapp/channels/src/components/add_user_to_group_multiselect/multiselect_option/multiselect_option.tsx +++ b/webapp/channels/src/components/add_user_to_group_multiselect/multiselect_option/multiselect_option.tsx @@ -1,22 +1,22 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import classNames from 'classnames'; +import React from 'react'; -import GuestTag from 'components/widgets/tag/guest_tag'; -import BotTag from 'components/widgets/tag/bot_tag'; +import type {UserProfile} from '@mattermost/types/users'; +import type {RelationOneToOne} from '@mattermost/types/utilities'; import {Client4} from 'mattermost-redux/client'; -import {UserProfile} from '@mattermost/types/users'; -import {RelationOneToOne} from '@mattermost/types/utilities'; - import {isGuest} from 'mattermost-redux/utils/user_utils'; -import {displayEntireNameForUser} from 'utils/utils'; + +import type {Value} from 'components/multiselect/multiselect'; import ProfilePicture from 'components/profile_picture'; import AddIcon from 'components/widgets/icons/fa_add_icon'; +import BotTag from 'components/widgets/tag/bot_tag'; +import GuestTag from 'components/widgets/tag/guest_tag'; -import {Value} from 'components/multiselect/multiselect'; +import {displayEntireNameForUser} from 'utils/utils'; type UserProfileValue = Value & UserProfile; diff --git a/webapp/channels/src/components/add_users_to_group_modal/add_users_to_group_modal.test.tsx b/webapp/channels/src/components/add_users_to_group_modal/add_users_to_group_modal.test.tsx index e397ac3e15..41906bba66 100644 --- a/webapp/channels/src/components/add_users_to_group_modal/add_users_to_group_modal.test.tsx +++ b/webapp/channels/src/components/add_users_to_group_modal/add_users_to_group_modal.test.tsx @@ -1,9 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; - import {shallow} from 'enzyme'; +import React from 'react'; import AddUsersToGroupModal from './add_users_to_group_modal'; diff --git a/webapp/channels/src/components/add_users_to_group_modal/add_users_to_group_modal.tsx b/webapp/channels/src/components/add_users_to_group_modal/add_users_to_group_modal.tsx index 2487aee826..31857df0b3 100644 --- a/webapp/channels/src/components/add_users_to_group_modal/add_users_to_group_modal.tsx +++ b/webapp/channels/src/components/add_users_to_group_modal/add_users_to_group_modal.tsx @@ -2,23 +2,23 @@ // See LICENSE.txt for license information. import React, {useState, useCallback, useMemo} from 'react'; - import {Modal} from 'react-bootstrap'; - import {FormattedMessage} from 'react-intl'; -import {UserProfile} from '@mattermost/types/users'; +import type {Group} from '@mattermost/types/groups'; +import type {UserProfile} from '@mattermost/types/users'; +import type {ActionResult} from 'mattermost-redux/types/actions'; + +import AddUserToGroupMultiSelect from 'components/add_user_to_group_multiselect'; +import LocalizedIcon from 'components/localized_icon'; + +import {t} from 'utils/i18n'; import {localizeMessage} from 'utils/utils'; -import {Group} from '@mattermost/types/groups'; + +import type {ModalData} from 'types/actions'; import 'components/user_groups_modal/user_groups_modal.scss'; -import {ModalData} from 'types/actions'; -import AddUserToGroupMultiSelect from 'components/add_user_to_group_multiselect'; -import {ActionResult} from 'mattermost-redux/types/actions'; - -import LocalizedIcon from 'components/localized_icon'; -import {t} from 'utils/i18n'; export type Props = { onExited: () => void; diff --git a/webapp/channels/src/components/add_users_to_group_modal/index.ts b/webapp/channels/src/components/add_users_to_group_modal/index.ts index 54b4509543..d37daee8b7 100644 --- a/webapp/channels/src/components/add_users_to_group_modal/index.ts +++ b/webapp/channels/src/components/add_users_to_group_modal/index.ts @@ -2,17 +2,18 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; - -import {Action, ActionResult} from 'mattermost-redux/types/actions'; - -import {GlobalState} from 'types/store'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; import {addUsersToGroup} from 'mattermost-redux/actions/groups'; import {getGroup} from 'mattermost-redux/selectors/entities/groups'; -import {ModalData} from 'types/actions'; +import type {Action, ActionResult} from 'mattermost-redux/types/actions'; + import {openModal} from 'actions/views/modals'; +import type {ModalData} from 'types/actions'; +import type {GlobalState} from 'types/store'; + import AddUsersToGroupModal from './add_users_to_group_modal'; type Actions = { diff --git a/webapp/channels/src/components/add_users_to_team_modal/add_users_to_team_modal.test.tsx b/webapp/channels/src/components/add_users_to_team_modal/add_users_to_team_modal.test.tsx index 7e7848e3bb..858f37be85 100644 --- a/webapp/channels/src/components/add_users_to_team_modal/add_users_to_team_modal.test.tsx +++ b/webapp/channels/src/components/add_users_to_team_modal/add_users_to_team_modal.test.tsx @@ -1,11 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; -import {UserProfile} from '@mattermost/types/users'; -import {Team} from '@mattermost/types/teams'; +import type {Team} from '@mattermost/types/teams'; +import type {UserProfile} from '@mattermost/types/users'; import {TestHelper} from 'utils/test_helper'; diff --git a/webapp/channels/src/components/add_users_to_team_modal/add_users_to_team_modal.tsx b/webapp/channels/src/components/add_users_to_team_modal/add_users_to_team_modal.tsx index bd43881448..42eae05cf4 100644 --- a/webapp/channels/src/components/add_users_to_team_modal/add_users_to_team_modal.tsx +++ b/webapp/channels/src/components/add_users_to_team_modal/add_users_to_team_modal.tsx @@ -5,20 +5,20 @@ import React from 'react'; import {Modal} from 'react-bootstrap'; import {FormattedMessage} from 'react-intl'; -import GuestTag from 'components/widgets/tag/guest_tag'; -import BotTag from 'components/widgets/tag/bot_tag'; - -import {UserProfile} from '@mattermost/types/users'; -import {Team} from '@mattermost/types/teams'; +import type {Team} from '@mattermost/types/teams'; +import type {UserProfile} from '@mattermost/types/users'; import {Client4} from 'mattermost-redux/client'; +import {isGuest} from 'mattermost-redux/utils/user_utils'; + +import MultiSelect from 'components/multiselect/multiselect'; +import type {Value} from 'components/multiselect/multiselect'; +import ProfilePicture from 'components/profile_picture'; +import AddIcon from 'components/widgets/icons/fa_add_icon'; +import BotTag from 'components/widgets/tag/bot_tag'; +import GuestTag from 'components/widgets/tag/guest_tag'; import {displayEntireNameForUser, localizeMessage} from 'utils/utils'; -import {isGuest} from 'mattermost-redux/utils/user_utils'; -import ProfilePicture from 'components/profile_picture'; - -import MultiSelect, {Value} from 'components/multiselect/multiselect'; -import AddIcon from 'components/widgets/icons/fa_add_icon'; const USERS_PER_PAGE = 50; const MAX_SELECTABLE_VALUES = 20; diff --git a/webapp/channels/src/components/add_users_to_team_modal/index.ts b/webapp/channels/src/components/add_users_to_team_modal/index.ts index 2a6197884a..dc19090ae7 100644 --- a/webapp/channels/src/components/add_users_to_team_modal/index.ts +++ b/webapp/channels/src/components/add_users_to_team_modal/index.ts @@ -2,16 +2,16 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {bindActionCreators, Dispatch, ActionCreatorsMapObject} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch, ActionCreatorsMapObject} from 'redux'; -import {Team} from '@mattermost/types/teams'; -import {UserProfile} from '@mattermost/types/users'; -import {GlobalState} from '@mattermost/types/store'; -import {GenericAction, ActionFunc} from 'mattermost-redux/types/actions'; +import type {GlobalState} from '@mattermost/types/store'; +import type {Team} from '@mattermost/types/teams'; +import type {UserProfile} from '@mattermost/types/users'; import {getProfilesNotInTeam, searchProfiles} from 'mattermost-redux/actions/users'; - import {getProfilesNotInTeam as selectProfilesNotInTeam} from 'mattermost-redux/selectors/entities/users'; +import type {GenericAction, ActionFunc} from 'mattermost-redux/types/actions'; import AddUsersToTeamModal from './add_users_to_team_modal'; diff --git a/webapp/channels/src/components/admin_console/admin_button_outline/admin_button_outline.test.tsx b/webapp/channels/src/components/admin_console/admin_button_outline/admin_button_outline.test.tsx index 4866c499f0..dd58f6c0e4 100644 --- a/webapp/channels/src/components/admin_console/admin_button_outline/admin_button_outline.test.tsx +++ b/webapp/channels/src/components/admin_console/admin_button_outline/admin_button_outline.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import AdminButtonOutline from './admin_button_outline'; diff --git a/webapp/channels/src/components/admin_console/admin_button_outline/admin_button_outline.tsx b/webapp/channels/src/components/admin_console/admin_button_outline/admin_button_outline.tsx index 254c1cf572..7262cbd2e4 100644 --- a/webapp/channels/src/components/admin_console/admin_button_outline/admin_button_outline.tsx +++ b/webapp/channels/src/components/admin_console/admin_button_outline/admin_button_outline.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import classNames from 'classnames'; +import React from 'react'; import './admin_button_outline.scss'; diff --git a/webapp/channels/src/components/admin_console/admin_console.tsx b/webapp/channels/src/components/admin_console/admin_console.tsx index 194a37926c..9d69a05fd2 100644 --- a/webapp/channels/src/components/admin_console/admin_console.tsx +++ b/webapp/channels/src/components/admin_console/admin_console.tsx @@ -4,23 +4,25 @@ import React from 'react'; import {Route, Switch, Redirect} from 'react-router-dom'; -import {ActionFunc} from 'mattermost-redux/types/actions'; -import type {Theme} from 'mattermost-redux/selectors/entities/preferences'; +import type {CloudState, Product} from '@mattermost/types/cloud'; +import type {AdminConfig, EnvironmentConfig, ClientLicense} from '@mattermost/types/config'; +import type {Role} from '@mattermost/types/roles'; +import type {DeepPartial} from '@mattermost/types/utilities'; + +import type {Theme} from 'mattermost-redux/selectors/entities/preferences'; +import type {ActionFunc} from 'mattermost-redux/types/actions'; -import ModalController from 'components/modal_controller'; import SchemaAdminSettings from 'components/admin_console/schema_admin_settings'; -import DiscardChangesModal from 'components/discard_changes_modal'; +import AnnouncementBarController from 'components/announcement_bar'; import BackstageNavbar from 'components/backstage/components/backstage_navbar'; import DelinquencyModal from 'components/delinquency_modal'; -import AnnouncementBarController from 'components/announcement_bar'; +import DiscardChangesModal from 'components/discard_changes_modal'; +import ModalController from 'components/modal_controller'; import SystemNotice from 'components/system_notice'; -import {LhsItemType} from 'types/store/lhs'; + import {applyTheme, resetTheme} from 'utils/utils'; -import {Role} from '@mattermost/types/roles'; -import {CloudState, Product} from '@mattermost/types/cloud'; -import {DeepPartial} from '@mattermost/types/utilities'; -import {AdminConfig, EnvironmentConfig, ClientLicense} from '@mattermost/types/config'; +import {LhsItemType} from 'types/store/lhs'; import AdminSidebar from './admin_sidebar'; import Highlight from './highlight'; diff --git a/webapp/channels/src/components/admin_console/admin_definition.jsx b/webapp/channels/src/components/admin_console/admin_definition.jsx index ca3de04e91..5de0421d5d 100644 --- a/webapp/channels/src/components/admin_console/admin_definition.jsx +++ b/webapp/channels/src/components/admin_console/admin_definition.jsx @@ -10,11 +10,6 @@ import {AccountMultipleOutlineIcon, ChartBarIcon, CogOutlineIcon, CreditCardOutl import {RESOURCE_KEYS} from 'mattermost-redux/constants/permissions_sysconsole'; -import {Constants, CloudProducts, LicenseSkus, AboutLinks, DocLinks, DeveloperLinks} from 'utils/constants'; -import {isCloudFreePlan} from 'utils/cloud_utils'; -import {isCloudLicense} from 'utils/license_utils'; -import {getSiteURL} from 'utils/url'; -import {t} from 'utils/i18n'; import { ldapTest, invalidateAllCaches, reloadConfig, testS3Connection, removeIdpSamlCertificate, uploadIdpSamlCertificate, @@ -24,57 +19,40 @@ import { removePublicLdapCertificate, uploadPublicLdapCertificate, invalidateAllEmailInvites, testSmtp, testSiteURL, getSamlMetadataFromIdp, setSamlIdpCertificateFromMetadata, } from 'actions/admin_actions'; -import SystemAnalytics from 'components/analytics/system_analytics'; -import TeamAnalytics from 'components/analytics/team_analytics'; -import PluginManagement from 'components/admin_console/plugin_management'; -import CustomPluginSettings from 'components/admin_console/custom_plugin_settings'; -import RestrictedIndicator from 'components/widgets/menu/menu_items/restricted_indicator'; - import {trackEvent} from 'actions/telemetry_actions.jsx'; +import CustomPluginSettings from 'components/admin_console/custom_plugin_settings'; +import PluginManagement from 'components/admin_console/plugin_management'; +import SystemAnalytics from 'components/analytics/system_analytics'; +import TeamAnalytics from 'components/analytics/team_analytics'; import ExternalLink from 'components/external_link'; +import RestrictedIndicator from 'components/widgets/menu/menu_items/restricted_indicator'; -import OpenIdConvert from './openid_convert'; +import {isCloudFreePlan} from 'utils/cloud_utils'; +import {Constants, CloudProducts, LicenseSkus, AboutLinks, DocLinks, DeveloperLinks} from 'utils/constants'; +import {t} from 'utils/i18n'; +import {isCloudLicense} from 'utils/license_utils'; +import {getSiteURL} from 'utils/url'; + +import * as DefinitionConstants from './admin_definition_constants'; import Audits from './audits'; -import CustomURLSchemesSetting from './custom_url_schemes_setting'; -import CustomEnableDisableGuestAccountsSetting from './custom_enable_disable_guest_accounts_setting'; -import LicenseSettings from './license_settings'; -import PermissionSchemesSettings from './permission_schemes_settings'; -import PermissionSystemSchemeSettings from './permission_schemes_settings/permission_system_scheme_settings'; -import PermissionTeamSchemeSettings from './permission_schemes_settings/permission_team_scheme_settings'; -import ValidationResult from './validation'; -import SystemRoles from './system_roles'; -import SystemRole from './system_roles/system_role'; -import SystemUsers from './system_users'; -import SystemUserDetail from './system_user_detail'; -import ServerLogs from './server_logs'; +import BillingHistory from './billing/billing_history'; +import BillingSubscriptions from './billing/billing_subscriptions/index.tsx'; +import CompanyInfo from './billing/company_info'; +import CompanyInfoEdit from './billing/company_info_edit'; +import PaymentInfo from './billing/payment_info'; +import PaymentInfoEdit from './billing/payment_info_edit'; +import BleveSettings from './bleve_settings'; import BrandImageSetting from './brand_image_setting/brand_image_setting'; -import GroupSettings from './group_settings/group_settings'; -import GroupDetails from './group_settings/group_details'; -import TeamSettings from './team_channel_settings/team'; -import TeamDetails from './team_channel_settings/team/details'; -import ChannelSettings from './team_channel_settings/channel'; -import ChannelDetails from './team_channel_settings/channel/details'; -import PasswordSettings from './password_settings'; -import PushNotificationsSettings from './push_settings'; +import ClusterSettings from './cluster_settings.jsx'; +import CustomEnableDisableGuestAccountsSetting from './custom_enable_disable_guest_accounts_setting'; +import CustomTermsOfServiceSettings from './custom_terms_of_service_settings'; +import CustomURLSchemesSetting from './custom_url_schemes_setting'; import DataRetentionSettings from './data_retention_settings'; -import GlobalDataRetentionForm from './data_retention_settings/global_policy_form'; import CustomDataRetentionForm from './data_retention_settings/custom_policy_form'; -import MessageExportSettings from './message_export_settings.jsx'; +import GlobalDataRetentionForm from './data_retention_settings/global_policy_form'; import DatabaseSettings from './database_settings.jsx'; import ElasticSearchSettings from './elasticsearch_settings'; -import BleveSettings from './bleve_settings'; -import FeatureFlags from './feature_flags.tsx'; -import ClusterSettings from './cluster_settings.jsx'; -import CustomTermsOfServiceSettings from './custom_terms_of_service_settings'; -import SessionLengthSettings from './session_length_settings'; -import BillingSubscriptions from './billing/billing_subscriptions/index.tsx'; -import BillingHistory from './billing/billing_history'; -import CompanyInfo from './billing/company_info'; -import PaymentInfo from './billing/payment_info'; -import CompanyInfoEdit from './billing/company_info_edit'; -import PaymentInfoEdit from './billing/payment_info_edit'; -import WorkspaceOptimizationDashboard from './workspace-optimization/dashboard'; import { LDAPFeatureDiscovery, SAMLFeatureDiscovery, @@ -88,8 +66,29 @@ import { SystemRolesFeatureDiscovery, GroupsFeatureDiscovery, } from './feature_discovery/features'; - -import * as DefinitionConstants from './admin_definition_constants'; +import FeatureFlags from './feature_flags.tsx'; +import GroupDetails from './group_settings/group_details'; +import GroupSettings from './group_settings/group_settings'; +import LicenseSettings from './license_settings'; +import MessageExportSettings from './message_export_settings.jsx'; +import OpenIdConvert from './openid_convert'; +import PasswordSettings from './password_settings'; +import PermissionSchemesSettings from './permission_schemes_settings'; +import PermissionSystemSchemeSettings from './permission_schemes_settings/permission_system_scheme_settings'; +import PermissionTeamSchemeSettings from './permission_schemes_settings/permission_team_scheme_settings'; +import PushNotificationsSettings from './push_settings'; +import ServerLogs from './server_logs'; +import SessionLengthSettings from './session_length_settings'; +import SystemRoles from './system_roles'; +import SystemRole from './system_roles/system_role'; +import SystemUserDetail from './system_user_detail'; +import SystemUsers from './system_users'; +import ChannelSettings from './team_channel_settings/channel'; +import ChannelDetails from './team_channel_settings/channel/details'; +import TeamSettings from './team_channel_settings/team'; +import TeamDetails from './team_channel_settings/team/details'; +import ValidationResult from './validation'; +import WorkspaceOptimizationDashboard from './workspace-optimization/dashboard'; const FILE_STORAGE_DRIVER_LOCAL = 'local'; const FILE_STORAGE_DRIVER_S3 = 'amazons3'; diff --git a/webapp/channels/src/components/admin_console/admin_definition.test.jsx b/webapp/channels/src/components/admin_console/admin_definition.test.jsx index cc292c6603..6ca4887aad 100644 --- a/webapp/channels/src/components/admin_console/admin_definition.test.jsx +++ b/webapp/channels/src/components/admin_console/admin_definition.test.jsx @@ -4,6 +4,7 @@ import * as yup from 'yup'; import adminDefinition from 'components/admin_console/admin_definition.jsx'; + import {Constants} from 'utils/constants'; const baseShape = { diff --git a/webapp/channels/src/components/admin_console/admin_navbar_dropdown/admin_navbar_dropdown.tsx b/webapp/channels/src/components/admin_console/admin_navbar_dropdown/admin_navbar_dropdown.tsx index 630bc9b93b..1d45d8ebf7 100644 --- a/webapp/channels/src/components/admin_console/admin_navbar_dropdown/admin_navbar_dropdown.tsx +++ b/webapp/channels/src/components/admin_console/admin_navbar_dropdown/admin_navbar_dropdown.tsx @@ -2,23 +2,23 @@ // See LICENSE.txt for license information. import React from 'react'; -import {injectIntl, IntlShape} from 'react-intl'; +import {injectIntl} from 'react-intl'; +import type {IntlShape} from 'react-intl'; -import {Team} from '@mattermost/types/teams'; +import type {Team} from '@mattermost/types/teams'; import * as GlobalActions from 'actions/global_actions'; import {trackEvent} from 'actions/telemetry_actions.jsx'; -import {filterAndSortTeamsByDisplayName} from 'utils/team_utils'; -import {ModalIdentifiers} from 'utils/constants'; -import {t} from 'utils/i18n'; - import AboutBuildModal from 'components/about_build_modal'; import CommercialSupportModal from 'components/commercial_support_modal'; import LocalizedIcon from 'components/localized_icon'; - import Menu from 'components/widgets/menu/menu'; +import {ModalIdentifiers} from 'utils/constants'; +import {t} from 'utils/i18n'; +import {filterAndSortTeamsByDisplayName} from 'utils/team_utils'; + import MenuItemBlockableLink from './menu_item_blockable_link'; type Props = { diff --git a/webapp/channels/src/components/admin_console/admin_navbar_dropdown/index.ts b/webapp/channels/src/components/admin_console/admin_navbar_dropdown/index.ts index 77c938c67b..52a6732df0 100644 --- a/webapp/channels/src/components/admin_console/admin_navbar_dropdown/index.ts +++ b/webapp/channels/src/components/admin_console/admin_navbar_dropdown/index.ts @@ -2,17 +2,18 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch} from 'redux'; -import {getMyTeams} from 'mattermost-redux/selectors/entities/teams'; import {getConfig, getLicense} from 'mattermost-redux/selectors/entities/general'; -import {GenericAction} from 'mattermost-redux/types/actions'; +import {getMyTeams} from 'mattermost-redux/selectors/entities/teams'; +import type {GenericAction} from 'mattermost-redux/types/actions'; import {deferNavigation} from 'actions/admin_actions.jsx'; import {getCurrentLocale} from 'selectors/i18n'; import {getNavigationBlocked} from 'selectors/views/admin'; -import {GlobalState} from 'types/store'; +import type {GlobalState} from 'types/store'; import AdminNavbarDropdown from './admin_navbar_dropdown'; diff --git a/webapp/channels/src/components/admin_console/admin_settings.tsx b/webapp/channels/src/components/admin_console/admin_settings.tsx index c92c258974..033684afe7 100644 --- a/webapp/channels/src/components/admin_console/admin_settings.tsx +++ b/webapp/channels/src/components/admin_console/admin_settings.tsx @@ -4,16 +4,16 @@ import React from 'react'; import {Overlay} from 'react-bootstrap'; -import {AdminConfig, EnvironmentConfig} from '@mattermost/types/config'; -import {DeepPartial} from '@mattermost/types/utilities'; - -import {localizeMessage} from 'utils/utils'; +import type {AdminConfig, EnvironmentConfig} from '@mattermost/types/config'; +import type {DeepPartial} from '@mattermost/types/utilities'; +import FormError from 'components/form_error'; import SaveButton from 'components/save_button'; import Tooltip from 'components/tooltip'; -import FormError from 'components/form_error'; import AdminHeader from 'components/widgets/admin_console/admin_header'; +import {localizeMessage} from 'utils/utils'; + export type BaseProps = { config?: DeepPartial; environmentConfig?: EnvironmentConfig; diff --git a/webapp/channels/src/components/admin_console/admin_sidebar/admin_sidebar.test.tsx b/webapp/channels/src/components/admin_console/admin_sidebar/admin_sidebar.test.tsx index 79072382b9..7308f00570 100644 --- a/webapp/channels/src/components/admin_console/admin_sidebar/admin_sidebar.test.tsx +++ b/webapp/channels/src/components/admin_console/admin_sidebar/admin_sidebar.test.tsx @@ -2,22 +2,21 @@ // See LICENSE.txt for license information. import React from 'react'; -import {IntlShape} from 'react-intl'; +import type {IntlShape} from 'react-intl'; -import {ExperimentalSettings, PluginSettings, SSOSettings, Office365Settings} from '@mattermost/types/config'; import {SelfHostedSignupProgress} from '@mattermost/types/cloud'; +import type {ExperimentalSettings, PluginSettings, SSOSettings, Office365Settings} from '@mattermost/types/config'; import {RESOURCE_KEYS} from 'mattermost-redux/constants/permissions_sysconsole'; +import AdminDefinition from 'components/admin_console/admin_definition'; +import AdminSidebar from 'components/admin_console/admin_sidebar/admin_sidebar'; +import type {Props} from 'components/admin_console/admin_sidebar/admin_sidebar'; + import {samplePlugin1} from 'tests/helpers/admin_console_plugin_index_sample_pluings'; import {shallowWithIntl} from 'tests/helpers/intl-test-helper'; - -import AdminSidebar from 'components/admin_console/admin_sidebar/admin_sidebar'; -import AdminDefinition from 'components/admin_console/admin_definition'; import {generateIndex} from 'utils/admin_console_index'; -import type {Props} from 'components/admin_console/admin_sidebar/admin_sidebar'; - jest.mock('utils/utils', () => { const original = jest.requireActual('utils/utils'); return { diff --git a/webapp/channels/src/components/admin_console/admin_sidebar/admin_sidebar.tsx b/webapp/channels/src/components/admin_console/admin_sidebar/admin_sidebar.tsx index c29a0ed061..cf32ed4292 100644 --- a/webapp/channels/src/components/admin_console/admin_sidebar/admin_sidebar.tsx +++ b/webapp/channels/src/components/admin_console/admin_sidebar/admin_sidebar.tsx @@ -1,26 +1,28 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; -import {FormattedMessage, injectIntl, IntlShape} from 'react-intl'; -import Scrollbars from 'react-custom-scrollbars'; -import isEqual from 'lodash/isEqual'; import classNames from 'classnames'; +import isEqual from 'lodash/isEqual'; +import React from 'react'; +import Scrollbars from 'react-custom-scrollbars'; +import {FormattedMessage, injectIntl} from 'react-intl'; +import type {IntlShape} from 'react-intl'; -import {PluginRedux} from '@mattermost/types/plugins'; +import type {PluginRedux} from '@mattermost/types/plugins'; -import {generateIndex, Index} from 'utils/admin_console_index'; +import AdminSidebarCategory from 'components/admin_console/admin_sidebar/admin_sidebar_category'; +import AdminSidebarSection from 'components/admin_console/admin_sidebar/admin_sidebar_section'; +import AdminSidebarHeader from 'components/admin_console/admin_sidebar_header'; +import Highlight from 'components/admin_console/highlight'; +import QuickInput from 'components/quick_input'; +import SearchIcon from 'components/widgets/icons/search_icon'; + +import {generateIndex} from 'utils/admin_console_index'; +import type {Index} from 'utils/admin_console_index'; import {getHistory} from 'utils/browser_history'; import {localizeMessage} from 'utils/utils'; -import AdminSidebarCategory from 'components/admin_console/admin_sidebar/admin_sidebar_category'; -import AdminSidebarHeader from 'components/admin_console/admin_sidebar_header'; -import AdminSidebarSection from 'components/admin_console/admin_sidebar/admin_sidebar_section'; -import Highlight from 'components/admin_console/highlight'; -import SearchIcon from 'components/widgets/icons/search_icon'; -import QuickInput from 'components/quick_input'; - -import AdminDefinition from '../admin_definition'; +import type AdminDefinition from '../admin_definition'; import type {PropsFromRedux} from './index'; diff --git a/webapp/channels/src/components/admin_console/admin_sidebar/admin_sidebar_category.tsx b/webapp/channels/src/components/admin_console/admin_sidebar/admin_sidebar_category.tsx index 1af2264589..0b1d75888a 100644 --- a/webapp/channels/src/components/admin_console/admin_sidebar/admin_sidebar_category.tsx +++ b/webapp/channels/src/components/admin_console/admin_sidebar/admin_sidebar_category.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {isValidElement} from 'react'; import classNames from 'classnames'; +import React, {isValidElement} from 'react'; import {NavLink, Route} from 'react-router-dom'; type Props = { diff --git a/webapp/channels/src/components/admin_console/admin_sidebar/admin_sidebar_section.tsx b/webapp/channels/src/components/admin_console/admin_sidebar/admin_sidebar_section.tsx index 9826e01bd9..184a65cef5 100644 --- a/webapp/channels/src/components/admin_console/admin_sidebar/admin_sidebar_section.tsx +++ b/webapp/channels/src/components/admin_console/admin_sidebar/admin_sidebar_section.tsx @@ -1,15 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import classNames from 'classnames'; - -import {createSafeId} from 'utils/utils'; +import React from 'react'; import {trackEvent} from 'actions/telemetry_actions.jsx'; import BlockableLink from 'components/admin_console/blockable_link'; +import {createSafeId} from 'utils/utils'; + type Props = { name: string; title: string | JSX.Element; diff --git a/webapp/channels/src/components/admin_console/admin_sidebar/index.ts b/webapp/channels/src/components/admin_console/admin_sidebar/index.ts index dd3c2997da..d35ffc9087 100644 --- a/webapp/channels/src/components/admin_console/admin_sidebar/index.ts +++ b/webapp/channels/src/components/admin_console/admin_sidebar/index.ts @@ -1,19 +1,19 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {connect, ConnectedProps} from 'react-redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; +import {connect} from 'react-redux'; +import type {ConnectedProps} from 'react-redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; -import {PluginsResponse} from '@mattermost/types/plugins'; +import type {PluginsResponse} from '@mattermost/types/plugins'; import {getPlugins} from 'mattermost-redux/actions/admin'; import {getSubscriptionProduct} from 'mattermost-redux/selectors/entities/cloud'; import {getConfig, getLicense} from 'mattermost-redux/selectors/entities/general'; -import {isFirstAdmin} from 'mattermost-redux/selectors/entities/users'; import {getBool} from 'mattermost-redux/selectors/entities/preferences'; -import {ActionFunc} from 'mattermost-redux/types/actions'; - -import {GlobalState} from 'types/store'; +import {isFirstAdmin} from 'mattermost-redux/selectors/entities/users'; +import type {ActionFunc} from 'mattermost-redux/types/actions'; import {getAdminDefinition, getConsoleAccess} from 'selectors/admin_console'; import {getNavigationBlocked} from 'selectors/views/admin'; @@ -21,6 +21,8 @@ import {getIsMobileView} from 'selectors/views/browser'; import {OnboardingTaskCategory, OnboardingTaskList} from 'components/onboarding_tasks'; +import type {GlobalState} from 'types/store'; + import AdminSidebar from './admin_sidebar'; function mapStateToProps(state: GlobalState) { diff --git a/webapp/channels/src/components/admin_console/admin_sidebar_header/admin_sidebar_header.tsx b/webapp/channels/src/components/admin_console/admin_sidebar_header/admin_sidebar_header.tsx index 8c545754ee..43c984207b 100644 --- a/webapp/channels/src/components/admin_console/admin_sidebar_header/admin_sidebar_header.tsx +++ b/webapp/channels/src/components/admin_console/admin_sidebar_header/admin_sidebar_header.tsx @@ -4,17 +4,16 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; +import type {UserProfile} from '@mattermost/types/users'; + import {Client4} from 'mattermost-redux/client'; -import {UserProfile} from '@mattermost/types/users'; - -import * as Utils from 'utils/utils'; +import AdminNavbarDropdown from 'components/admin_console/admin_navbar_dropdown'; import MenuIcon from 'components/widgets/icons/menu_icon'; - import MenuWrapper from 'components/widgets/menu/menu_wrapper'; import Avatar from 'components/widgets/users/avatar'; -import AdminNavbarDropdown from 'components/admin_console/admin_navbar_dropdown'; +import * as Utils from 'utils/utils'; type Props = { currentUser: UserProfile; diff --git a/webapp/channels/src/components/admin_console/admin_sidebar_header/index.ts b/webapp/channels/src/components/admin_console/admin_sidebar_header/index.ts index b2b34821ed..b23277ac79 100644 --- a/webapp/channels/src/components/admin_console/admin_sidebar_header/index.ts +++ b/webapp/channels/src/components/admin_console/admin_sidebar_header/index.ts @@ -5,7 +5,7 @@ import {connect} from 'react-redux'; import {getCurrentUser} from 'mattermost-redux/selectors/entities/users'; -import {GlobalState} from 'types/store'; +import type {GlobalState} from 'types/store'; import AdminSidebarHeader from './admin_sidebar_header'; diff --git a/webapp/channels/src/components/admin_console/admin_user_card/admin_user_card.test.tsx b/webapp/channels/src/components/admin_console/admin_user_card/admin_user_card.test.tsx index c12001977d..feb18aee00 100644 --- a/webapp/channels/src/components/admin_console/admin_user_card/admin_user_card.test.tsx +++ b/webapp/channels/src/components/admin_console/admin_user_card/admin_user_card.test.tsx @@ -4,7 +4,6 @@ import React from 'react'; import {renderWithIntl, screen} from 'tests/react_testing_utils'; - import {TestHelper} from 'utils/test_helper'; import AdminUserCard from './admin_user_card'; diff --git a/webapp/channels/src/components/admin_console/admin_user_card/admin_user_card.tsx b/webapp/channels/src/components/admin_console/admin_user_card/admin_user_card.tsx index c009440c78..e2e8cfedfa 100644 --- a/webapp/channels/src/components/admin_console/admin_user_card/admin_user_card.tsx +++ b/webapp/channels/src/components/admin_console/admin_user_card/admin_user_card.tsx @@ -3,11 +3,14 @@ import React from 'react'; +import type {UserProfile} from '@mattermost/types/users'; + import {Client4} from 'mattermost-redux/client'; import ProfilePicture from 'components/profile_picture'; + import * as Utils from 'utils/utils'; -import {UserProfile} from '@mattermost/types/users'; + import './admin_user_card.scss'; type BulletProps = { diff --git a/webapp/channels/src/components/admin_console/audits/audits.tsx b/webapp/channels/src/components/admin_console/audits/audits.tsx index c98502ee3c..e3c54d19c1 100644 --- a/webapp/channels/src/components/admin_console/audits/audits.tsx +++ b/webapp/channels/src/components/admin_console/audits/audits.tsx @@ -1,15 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {CSSProperties} from 'react'; +import React from 'react'; +import type {CSSProperties} from 'react'; import {FormattedMessage} from 'react-intl'; -import {Audit} from '@mattermost/types/audits'; +import type {Audit} from '@mattermost/types/audits'; import ComplianceReports from 'components/admin_console/compliance_reports'; import AuditTable from 'components/audit_table'; import LoadingScreen from 'components/loading_screen'; - import ReloadIcon from 'components/widgets/icons/fa_reload_icon'; type Props = { diff --git a/webapp/channels/src/components/admin_console/audits/index.ts b/webapp/channels/src/components/admin_console/audits/index.ts index dbac767f11..44094a216b 100644 --- a/webapp/channels/src/components/admin_console/audits/index.ts +++ b/webapp/channels/src/components/admin_console/audits/index.ts @@ -2,15 +2,17 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {bindActionCreators, Dispatch, ActionCreatorsMapObject} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch, ActionCreatorsMapObject} from 'redux'; + +import type {Audit} from '@mattermost/types/audits'; -import {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; -import {Audit} from '@mattermost/types/audits'; import {getAudits} from 'mattermost-redux/actions/admin'; import * as Selectors from 'mattermost-redux/selectors/entities/admin'; import {getLicense} from 'mattermost-redux/selectors/entities/general'; +import type {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; -import {GlobalState} from 'types/store'; +import type {GlobalState} from 'types/store'; import Audits from './audits'; diff --git a/webapp/channels/src/components/admin_console/billing/billing_history.test.tsx b/webapp/channels/src/components/admin_console/billing/billing_history.test.tsx index 27beb71710..7d243f9748 100644 --- a/webapp/channels/src/components/admin_console/billing/billing_history.test.tsx +++ b/webapp/channels/src/components/admin_console/billing/billing_history.test.tsx @@ -2,13 +2,12 @@ // See LICENSE.txt for license information. import React from 'react'; - import {Provider} from 'react-redux'; import {renderWithIntl, renderWithIntlAndStore, screen} from 'tests/react_testing_utils'; import mockStore from 'tests/test_store'; - import {CloudLinks, HostedCustomerLinks} from 'utils/constants'; + import BillingHistory, {NoBillingHistorySection} from './billing_history'; const NO_INVOICES_LEGEND = 'All of your invoices will be shown here'; diff --git a/webapp/channels/src/components/admin_console/billing/billing_history.tsx b/webapp/channels/src/components/admin_console/billing/billing_history.tsx index ce024c9d64..1d691f44d5 100644 --- a/webapp/channels/src/components/admin_console/billing/billing_history.tsx +++ b/webapp/channels/src/components/admin_console/billing/billing_history.tsx @@ -6,18 +6,19 @@ import {FormattedMessage} from 'react-intl'; import {useDispatch, useSelector} from 'react-redux'; import {getInvoices} from 'mattermost-redux/actions/cloud'; -import {getSelfHostedInvoices as getSelfHostedInvoicesAction} from 'actions/hosted_customer'; import {getCloudErrors, getCloudInvoices, isCurrentLicenseCloud} from 'mattermost-redux/selectors/entities/cloud'; import {getSelfHostedErrors, getSelfHostedInvoices} from 'mattermost-redux/selectors/entities/hosted_customer'; + +import {getSelfHostedInvoices as getSelfHostedInvoicesAction} from 'actions/hosted_customer'; import {pageVisited, trackEvent} from 'actions/telemetry_actions'; import CloudFetchError from 'components/cloud_fetch_error'; -import LoadingSpinner from 'components/widgets/loading/loading_spinner'; import EmptyBillingHistorySvg from 'components/common/svg_images_components/empty_billing_history_svg'; +import ExternalLink from 'components/external_link'; import AdminHeader from 'components/widgets/admin_console/admin_header'; +import LoadingSpinner from 'components/widgets/loading/loading_spinner'; import {CloudLinks, HostedCustomerLinks} from 'utils/constants'; -import ExternalLink from 'components/external_link'; import BillingHistoryTable from './billing_history_table'; diff --git a/webapp/channels/src/components/admin_console/billing/billing_history_modal.tsx b/webapp/channels/src/components/admin_console/billing/billing_history_modal.tsx index 925c1e0a6e..c43870afa0 100644 --- a/webapp/channels/src/components/admin_console/billing/billing_history_modal.tsx +++ b/webapp/channels/src/components/admin_console/billing/billing_history_modal.tsx @@ -2,21 +2,22 @@ // See LICENSE.txt for license information. import React from 'react'; -import {useDispatch, useSelector} from 'react-redux'; - import {Modal} from 'react-bootstrap'; import {useIntl} from 'react-intl'; +import {useDispatch, useSelector} from 'react-redux'; + +import type {Invoice} from '@mattermost/types/cloud'; -import {isModalOpen} from 'selectors/views/modals'; -import {ModalIdentifiers} from 'utils/constants'; -import {Invoice} from '@mattermost/types/cloud'; import {closeModal} from 'actions/views/modals'; -import {GlobalState} from 'types/store'; +import {isModalOpen} from 'selectors/views/modals'; -import './billing_history_modal.scss'; +import {ModalIdentifiers} from 'utils/constants'; + +import type {GlobalState} from 'types/store'; import BillingHistoryTable from './billing_history_table'; +import './billing_history_modal.scss'; import './billing_history.scss'; type BillingHistoryModalProps = { diff --git a/webapp/channels/src/components/admin_console/billing/billing_history_table.tsx b/webapp/channels/src/components/admin_console/billing/billing_history_table.tsx index 03bbd4c3f7..319a10dce4 100644 --- a/webapp/channels/src/components/admin_console/billing/billing_history_table.tsx +++ b/webapp/channels/src/components/admin_console/billing/billing_history_table.tsx @@ -3,14 +3,17 @@ import React, {useState, useEffect} from 'react'; import {FormattedDate, FormattedMessage, FormattedNumber} from 'react-intl'; - import {useSelector, useDispatch} from 'react-redux'; -import {Invoice} from '@mattermost/types/cloud'; +import type {Invoice} from '@mattermost/types/cloud'; + import {Client4} from 'mattermost-redux/client'; import {isCurrentLicenseCloud} from 'mattermost-redux/selectors/entities/cloud'; + import {openModal} from 'actions/views/modals'; + import CloudInvoicePreview from 'components/cloud_invoice_preview'; + import {ModalIdentifiers} from 'utils/constants'; import InvoiceUserCount from './invoice_user_count'; diff --git a/webapp/channels/src/components/admin_console/billing/billing_subscriptions/cancel_subscription.tsx b/webapp/channels/src/components/admin_console/billing/billing_subscriptions/cancel_subscription.tsx index cf8560ed3b..3c7a4d44f7 100644 --- a/webapp/channels/src/components/admin_console/billing/billing_subscriptions/cancel_subscription.tsx +++ b/webapp/channels/src/components/admin_console/billing/billing_subscriptions/cancel_subscription.tsx @@ -5,6 +5,7 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; import {trackEvent} from 'actions/telemetry_actions'; + import {useOpenCloudZendeskSupportForm} from 'components/common/hooks/useOpenZendeskForm'; import ExternalLink from 'components/external_link'; diff --git a/webapp/channels/src/components/admin_console/billing/billing_subscriptions/cloud_trial_banner.test.tsx b/webapp/channels/src/components/admin_console/billing/billing_subscriptions/cloud_trial_banner.test.tsx index 78b1d76614..9a0d26bb04 100644 --- a/webapp/channels/src/components/admin_console/billing/billing_subscriptions/cloud_trial_banner.test.tsx +++ b/webapp/channels/src/components/admin_console/billing/billing_subscriptions/cloud_trial_banner.test.tsx @@ -1,14 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import {Provider} from 'react-redux'; -import mockStore from 'tests/test_store'; - import {getPreferenceKey} from 'mattermost-redux/utils/preference_utils'; +import mockStore from 'tests/test_store'; import {CloudBanners, Preferences} from 'utils/constants'; import CloudTrialBanner from './cloud_trial_banner'; diff --git a/webapp/channels/src/components/admin_console/billing/billing_subscriptions/cloud_trial_banner.tsx b/webapp/channels/src/components/admin_console/billing/billing_subscriptions/cloud_trial_banner.tsx index a62edc1e54..9ca6f70782 100644 --- a/webapp/channels/src/components/admin_console/billing/billing_subscriptions/cloud_trial_banner.tsx +++ b/webapp/channels/src/components/admin_console/billing/billing_subscriptions/cloud_trial_banner.tsx @@ -1,28 +1,25 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import isEmpty from 'lodash/isEmpty'; +import moment from 'moment'; import React, {useState} from 'react'; +import {FormattedMessage, useIntl} from 'react-intl'; import {useDispatch, useSelector} from 'react-redux'; -import {FormattedMessage, useIntl} from 'react-intl'; - -import moment from 'moment'; -import isEmpty from 'lodash/isEmpty'; - -import {GlobalState} from '@mattermost/types/store'; +import type {GlobalState} from '@mattermost/types/store'; +import {savePreferences} from 'mattermost-redux/actions/preferences'; import {getCurrentUser} from 'mattermost-redux/selectors/entities/common'; import {get as getPreference} from 'mattermost-redux/selectors/entities/preferences'; -import {savePreferences} from 'mattermost-redux/actions/preferences'; - -import {getBrowserTimezone} from 'utils/timezone'; -import {CloudBanners, Preferences} from 'utils/constants'; - -import useOpenSalesLink from 'components/common/hooks/useOpenSalesLink'; import AlertBanner from 'components/alert_banner'; +import useOpenSalesLink from 'components/common/hooks/useOpenSalesLink'; import UpgradeLink from 'components/widgets/links/upgrade_link'; +import {CloudBanners, Preferences} from 'utils/constants'; +import {getBrowserTimezone} from 'utils/timezone'; + import './cloud_trial_banner.scss'; export interface Props { diff --git a/webapp/channels/src/components/admin_console/billing/billing_subscriptions/contact_sales_card.tsx b/webapp/channels/src/components/admin_console/billing/billing_subscriptions/contact_sales_card.tsx index fd42f863a1..b51f490041 100644 --- a/webapp/channels/src/components/admin_console/billing/billing_subscriptions/contact_sales_card.tsx +++ b/webapp/channels/src/components/admin_console/billing/billing_subscriptions/contact_sales_card.tsx @@ -6,13 +6,14 @@ import {FormattedMessage} from 'react-intl'; import {trackEvent} from 'actions/telemetry_actions'; -import {CloudLinks, CloudProducts} from 'utils/constants'; -import PrivateCloudSvg from 'components/common/svg_images_components/private_cloud_svg'; -import CloudTrialSvg from 'components/common/svg_images_components/cloud_trial_svg'; -import {TelemetryProps} from 'components/common/hooks/useOpenPricingModal'; +import type {TelemetryProps} from 'components/common/hooks/useOpenPricingModal'; import useOpenSalesLink from 'components/common/hooks/useOpenSalesLink'; +import CloudTrialSvg from 'components/common/svg_images_components/cloud_trial_svg'; +import PrivateCloudSvg from 'components/common/svg_images_components/private_cloud_svg'; import ExternalLink from 'components/external_link'; +import {CloudLinks, CloudProducts} from 'utils/constants'; + type Props = { isFreeTrial: boolean; subscriptionPlan: string | undefined; diff --git a/webapp/channels/src/components/admin_console/billing/billing_subscriptions/index.tsx b/webapp/channels/src/components/admin_console/billing/billing_subscriptions/index.tsx index 20d095cdd3..0b3cd9079d 100644 --- a/webapp/channels/src/components/admin_console/billing/billing_subscriptions/index.tsx +++ b/webapp/channels/src/components/admin_console/billing/billing_subscriptions/index.tsx @@ -2,52 +2,53 @@ // See LICENSE.txt for license information. import React, {useEffect, useState} from 'react'; -import {useDispatch, useSelector} from 'react-redux'; import {FormattedMessage} from 'react-intl'; +import {useDispatch, useSelector} from 'react-redux'; -import {GlobalState} from '@mattermost/types/store'; +import type {GlobalState} from '@mattermost/types/store'; import {getCloudSubscription, getCloudProducts, getCloudCustomer} from 'mattermost-redux/actions/cloud'; -import {DispatchFunc} from 'mattermost-redux/types/actions'; import { getSubscriptionProduct, getCloudSubscription as selectCloudSubscription, getCloudCustomer as selectCloudCustomer, getCloudErrors, } from 'mattermost-redux/selectors/entities/cloud'; +import type {DispatchFunc} from 'mattermost-redux/types/actions'; import {pageVisited} from 'actions/telemetry_actions'; +import DeleteWorkspaceCTA from 'components/admin_console/billing//delete_workspace/delete_workspace_cta'; +import CloudTrialBanner from 'components/admin_console/billing/billing_subscriptions/cloud_trial_banner'; +import CloudFetchError from 'components/cloud_fetch_error'; +import useGetLimits from 'components/common/hooks/useGetLimits'; +import useOpenCloudPurchaseModal from 'components/common/hooks/useOpenCloudPurchaseModal'; +import useOpenPricingModal from 'components/common/hooks/useOpenPricingModal'; +import AdminHeader from 'components/widgets/admin_console/admin_header'; + +import {isCustomerCardExpired} from 'utils/cloud_utils'; import { CloudProducts, RecurringIntervals, TrialPeriodDays, } from 'utils/constants'; -import {isCustomerCardExpired} from 'utils/cloud_utils'; +import {useQuery} from 'utils/http_utils'; import {hasSomeLimits} from 'utils/limits'; import {getRemainingDaysFromFutureTimestamp} from 'utils/utils'; -import {useQuery} from 'utils/http_utils'; -import CloudTrialBanner from 'components/admin_console/billing/billing_subscriptions/cloud_trial_banner'; -import CloudFetchError from 'components/cloud_fetch_error'; -import useOpenPricingModal from 'components/common/hooks/useOpenPricingModal'; -import useOpenCloudPurchaseModal from 'components/common/hooks/useOpenCloudPurchaseModal'; -import useGetLimits from 'components/common/hooks/useGetLimits'; -import DeleteWorkspaceCTA from 'components/admin_console/billing//delete_workspace/delete_workspace_cta'; -import AdminHeader from 'components/widgets/admin_console/admin_header'; - -import PlanDetails from '../plan_details'; -import BillingSummary from '../billing_summary'; -import ContactSalesCard from './contact_sales_card'; -import Limits from './limits'; import { creditCardExpiredBanner, paymentFailedBanner, } from './billing_subscriptions'; -import LimitReachedBanner from './limit_reached_banner'; import CancelSubscription from './cancel_subscription'; -import {ToYearlyNudgeBanner} from './to_yearly_nudge_banner'; +import ContactSalesCard from './contact_sales_card'; +import LimitReachedBanner from './limit_reached_banner'; +import Limits from './limits'; import {ToPaidNudgeBanner} from './to_paid_plan_nudge_banner'; +import {ToYearlyNudgeBanner} from './to_yearly_nudge_banner'; + +import BillingSummary from '../billing_summary'; +import PlanDetails from '../plan_details'; import './billing_subscriptions.scss'; diff --git a/webapp/channels/src/components/admin_console/billing/billing_subscriptions/limit_reached_banner.test.tsx b/webapp/channels/src/components/admin_console/billing/billing_subscriptions/limit_reached_banner.test.tsx index 165df1a7ea..10c8ad42b2 100644 --- a/webapp/channels/src/components/admin_console/billing/billing_subscriptions/limit_reached_banner.test.tsx +++ b/webapp/channels/src/components/admin_console/billing/billing_subscriptions/limit_reached_banner.test.tsx @@ -3,20 +3,19 @@ import React from 'react'; -import {GlobalState} from '@mattermost/types/store'; -import {UserProfile, UsersState} from '@mattermost/types/users'; +import type {GlobalState} from '@mattermost/types/store'; +import type {UserProfile, UsersState} from '@mattermost/types/users'; -import {getPreferenceKey} from 'mattermost-redux/utils/preference_utils'; import {Preferences} from 'mattermost-redux/constants'; +import {getPreferenceKey} from 'mattermost-redux/utils/preference_utils'; -import * as useOpenSalesLink from 'components/common/hooks/useOpenSalesLink'; import * as useGetUsageDeltas from 'components/common/hooks/useGetUsageDeltas'; import * as useOpenCloudPurchaseModal from 'components/common/hooks/useOpenCloudPurchaseModal'; import * as useOpenPricingModal from 'components/common/hooks/useOpenPricingModal'; +import * as useOpenSalesLink from 'components/common/hooks/useOpenSalesLink'; import * as useSaveBool from 'components/common/hooks/useSavePreferences'; import {fireEvent, renderWithFullContext, screen} from 'tests/react_testing_utils'; - import {CloudProducts} from 'utils/constants'; import LimitReachedBanner from './limit_reached_banner'; diff --git a/webapp/channels/src/components/admin_console/billing/billing_subscriptions/limit_reached_banner.tsx b/webapp/channels/src/components/admin_console/billing/billing_subscriptions/limit_reached_banner.tsx index 666adc3bd0..572a1cb7c5 100644 --- a/webapp/channels/src/components/admin_console/billing/billing_subscriptions/limit_reached_banner.tsx +++ b/webapp/channels/src/components/admin_console/billing/billing_subscriptions/limit_reached_banner.tsx @@ -5,19 +5,19 @@ import React from 'react'; import {useIntl, FormattedMessage} from 'react-intl'; import {useSelector} from 'react-redux'; -import {CloudProducts} from 'utils/constants'; -import {anyUsageDeltaExceededLimit} from 'utils/limits'; +import type {Product} from '@mattermost/types/cloud'; -import {getHasDismissedSystemConsoleLimitReached} from 'mattermost-redux/selectors/entities/preferences'; import {Preferences} from 'mattermost-redux/constants'; +import {getHasDismissedSystemConsoleLimitReached} from 'mattermost-redux/selectors/entities/preferences'; -import useOpenSalesLink from 'components/common/hooks/useOpenSalesLink'; +import AlertBanner from 'components/alert_banner'; import useGetUsageDeltas from 'components/common/hooks/useGetUsageDeltas'; import useOpenPricingModal from 'components/common/hooks/useOpenPricingModal'; +import useOpenSalesLink from 'components/common/hooks/useOpenSalesLink'; import {useSaveBool} from 'components/common/hooks/useSavePreferences'; -import AlertBanner from 'components/alert_banner'; -import {Product} from '@mattermost/types/cloud'; +import {CloudProducts} from 'utils/constants'; +import {anyUsageDeltaExceededLimit} from 'utils/limits'; import './limit_reached_banner.scss'; diff --git a/webapp/channels/src/components/admin_console/billing/billing_subscriptions/limits.test.tsx b/webapp/channels/src/components/admin_console/billing/billing_subscriptions/limits.test.tsx index 9689bfaa5d..1a2e6af03d 100644 --- a/webapp/channels/src/components/admin_console/billing/billing_subscriptions/limits.test.tsx +++ b/webapp/channels/src/components/admin_console/billing/billing_subscriptions/limits.test.tsx @@ -2,22 +2,19 @@ // See LICENSE.txt for license information. import React from 'react'; - import * as redux from 'react-redux'; import {Provider} from 'react-redux'; -import {renderWithIntl, screen} from 'tests/react_testing_utils'; -import mockStore from 'tests/test_store'; +import type {Subscription, Product} from '@mattermost/types/cloud'; +import type {GlobalState} from '@mattermost/types/store'; +import type {UserProfile, UsersState} from '@mattermost/types/users'; import * as cloudActions from 'actions/cloud'; -import {FileSizes} from 'utils/file_utils'; +import {renderWithIntl, screen} from 'tests/react_testing_utils'; +import mockStore from 'tests/test_store'; import {Constants, CloudProducts} from 'utils/constants'; - -import {UserProfile, UsersState} from '@mattermost/types/users'; -import {GlobalState} from '@mattermost/types/store'; - -import {Subscription, Product} from '@mattermost/types/cloud'; +import {FileSizes} from 'utils/file_utils'; import Limits from './limits'; diff --git a/webapp/channels/src/components/admin_console/billing/billing_subscriptions/limits.tsx b/webapp/channels/src/components/admin_console/billing/billing_subscriptions/limits.tsx index 3457fbd201..9fde2adedc 100644 --- a/webapp/channels/src/components/admin_console/billing/billing_subscriptions/limits.tsx +++ b/webapp/channels/src/components/admin_console/billing/billing_subscriptions/limits.tsx @@ -11,13 +11,13 @@ import { getSubscriptionProduct, } from 'mattermost-redux/selectors/entities/cloud'; -import {CloudProducts} from 'utils/constants'; -import {asGBString, fallbackStarterLimits, hasSomeLimits} from 'utils/limits'; - import useGetLimits from 'components/common/hooks/useGetLimits'; import useGetUsage from 'components/common/hooks/useGetUsage'; -import useOpenSalesLink from 'components/common/hooks/useOpenSalesLink'; import useOpenPricingModal from 'components/common/hooks/useOpenPricingModal'; +import useOpenSalesLink from 'components/common/hooks/useOpenSalesLink'; + +import {CloudProducts} from 'utils/constants'; +import {asGBString, fallbackStarterLimits, hasSomeLimits} from 'utils/limits'; import LimitCard from './limit_card'; diff --git a/webapp/channels/src/components/admin_console/billing/billing_subscriptions/to_paid_plan_nudge_banner.tsx b/webapp/channels/src/components/admin_console/billing/billing_subscriptions/to_paid_plan_nudge_banner.tsx index 06fda8eb9a..ba6eac9f15 100644 --- a/webapp/channels/src/components/admin_console/billing/billing_subscriptions/to_paid_plan_nudge_banner.tsx +++ b/webapp/channels/src/components/admin_console/billing/billing_subscriptions/to_paid_plan_nudge_banner.tsx @@ -1,27 +1,27 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {useEffect} from 'react'; -import {useDispatch, useSelector} from 'react-redux'; -import {useIntl, FormattedMessage} from 'react-intl'; import moment from 'moment'; +import React, {useEffect} from 'react'; +import {useIntl, FormattedMessage} from 'react-intl'; +import {useDispatch, useSelector} from 'react-redux'; + +import type {GlobalState} from '@mattermost/types/store'; + +import {savePreferences} from 'mattermost-redux/actions/preferences'; +import {getSubscriptionProduct as selectSubscriptionProduct} from 'mattermost-redux/selectors/entities/cloud'; +import {deprecateCloudFree, get as getPreference} from 'mattermost-redux/selectors/entities/preferences'; +import {getCurrentUser, isCurrentUserSystemAdmin} from 'mattermost-redux/selectors/entities/users'; import AlertBanner from 'components/alert_banner'; -import useOpenPricingModal from 'components/common/hooks/useOpenPricingModal'; -import useOpenCloudPurchaseModal from 'components/common/hooks/useOpenCloudPurchaseModal'; -import useOpenSalesLink from 'components/common/hooks/useOpenSalesLink'; import AnnouncementBar from 'components/announcement_bar/default_announcement_bar'; - -import {getSubscriptionProduct as selectSubscriptionProduct} from 'mattermost-redux/selectors/entities/cloud'; -import {getCurrentUser, isCurrentUserSystemAdmin} from 'mattermost-redux/selectors/entities/users'; -import {savePreferences} from 'mattermost-redux/actions/preferences'; -import {deprecateCloudFree, get as getPreference} from 'mattermost-redux/selectors/entities/preferences'; +import useOpenCloudPurchaseModal from 'components/common/hooks/useOpenCloudPurchaseModal'; +import useOpenPricingModal from 'components/common/hooks/useOpenPricingModal'; +import useOpenSalesLink from 'components/common/hooks/useOpenSalesLink'; import {AnnouncementBarTypes, CloudBanners, CloudProducts, Preferences} from 'utils/constants'; import {t} from 'utils/i18n'; -import {GlobalState} from '@mattermost/types/store'; - import './to_paid_plan_nudge_banner.scss'; enum DismissShowRange { diff --git a/webapp/channels/src/components/admin_console/billing/billing_subscriptions/to_yearly_nudge_banner.tsx b/webapp/channels/src/components/admin_console/billing/billing_subscriptions/to_yearly_nudge_banner.tsx index cdfb950a63..ef91b85539 100644 --- a/webapp/channels/src/components/admin_console/billing/billing_subscriptions/to_yearly_nudge_banner.tsx +++ b/webapp/channels/src/components/admin_console/billing/billing_subscriptions/to_yearly_nudge_banner.tsx @@ -1,26 +1,26 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {useEffect} from 'react'; -import {useDispatch, useSelector} from 'react-redux'; -import {useIntl, FormattedMessage} from 'react-intl'; import moment from 'moment'; +import React, {useEffect} from 'react'; +import {useIntl, FormattedMessage} from 'react-intl'; +import {useDispatch, useSelector} from 'react-redux'; + +import type {GlobalState} from '@mattermost/types/store'; + +import {savePreferences} from 'mattermost-redux/actions/preferences'; +import {getSubscriptionProduct as selectSubscriptionProduct, getCloudSubscription as selectCloudSubscription} from 'mattermost-redux/selectors/entities/cloud'; +import {get as getPreference} from 'mattermost-redux/selectors/entities/preferences'; +import {getCurrentUser, isCurrentUserSystemAdmin} from 'mattermost-redux/selectors/entities/users'; import AlertBanner from 'components/alert_banner'; +import AnnouncementBar from 'components/announcement_bar/default_announcement_bar'; import useOpenCloudPurchaseModal from 'components/common/hooks/useOpenCloudPurchaseModal'; import useOpenSalesLink from 'components/common/hooks/useOpenSalesLink'; -import AnnouncementBar from 'components/announcement_bar/default_announcement_bar'; - -import {getSubscriptionProduct as selectSubscriptionProduct, getCloudSubscription as selectCloudSubscription} from 'mattermost-redux/selectors/entities/cloud'; -import {getCurrentUser, isCurrentUserSystemAdmin} from 'mattermost-redux/selectors/entities/users'; -import {savePreferences} from 'mattermost-redux/actions/preferences'; -import {get as getPreference} from 'mattermost-redux/selectors/entities/preferences'; import {AnnouncementBarTypes, CloudBanners, CloudProducts, Preferences, RecurringIntervals, CloudBillingTypes} from 'utils/constants'; import {t} from 'utils/i18n'; -import {GlobalState} from '@mattermost/types/store'; - import './to_yearly_nudge_banner.scss'; enum DismissShowRange { diff --git a/webapp/channels/src/components/admin_console/billing/billing_summary/billing_summary.tsx b/webapp/channels/src/components/admin_console/billing/billing_summary/billing_summary.tsx index a8e6b6ccbd..d7163ca915 100644 --- a/webapp/channels/src/components/admin_console/billing/billing_summary/billing_summary.tsx +++ b/webapp/channels/src/components/admin_console/billing/billing_summary/billing_summary.tsx @@ -3,25 +3,25 @@ import React from 'react'; import {FormattedDate, FormattedMessage, FormattedNumber} from 'react-intl'; - import {useDispatch} from 'react-redux'; + import {CheckCircleOutlineIcon} from '@mattermost/compass-icons/components'; - -import {BillingSchemes, CloudLinks, TrialPeriodDays, ModalIdentifiers} from 'utils/constants'; - -import BlockableLink from 'components/admin_console/blockable_link'; -import OverlayTrigger from 'components/overlay_trigger'; -import Tooltip from 'components/tooltip'; -import UpgradeSvg from 'components/common/svg_images_components/upgrade_svg'; -import EmptyBillingHistorySvg from 'components/common/svg_images_components/empty_billing_history_svg'; - -import {trackEvent} from 'actions/telemetry_actions'; +import type {Invoice, InvoiceLineItem, Product} from '@mattermost/types/cloud'; import {Client4} from 'mattermost-redux/client'; -import {Invoice, InvoiceLineItem, Product} from '@mattermost/types/cloud'; + +import {trackEvent} from 'actions/telemetry_actions'; import {openModal} from 'actions/views/modals'; + +import BlockableLink from 'components/admin_console/blockable_link'; import CloudInvoicePreview from 'components/cloud_invoice_preview'; +import EmptyBillingHistorySvg from 'components/common/svg_images_components/empty_billing_history_svg'; +import UpgradeSvg from 'components/common/svg_images_components/upgrade_svg'; import ExternalLink from 'components/external_link'; +import OverlayTrigger from 'components/overlay_trigger'; +import Tooltip from 'components/tooltip'; + +import {BillingSchemes, CloudLinks, TrialPeriodDays, ModalIdentifiers} from 'utils/constants'; export const noBillingHistory = (

diff --git a/webapp/channels/src/components/admin_console/billing/billing_summary/index.tsx b/webapp/channels/src/components/admin_console/billing/billing_summary/index.tsx index e4e3e1a2ce..18b214397b 100644 --- a/webapp/channels/src/components/admin_console/billing/billing_summary/index.tsx +++ b/webapp/channels/src/components/admin_console/billing/billing_summary/index.tsx @@ -14,7 +14,6 @@ import { InvoiceInfo, freeTrial, } from './billing_summary'; - import {tryEnterpriseCard, UpgradeToProfessionalCard} from './upsell_card'; import './billing_summary.scss'; diff --git a/webapp/channels/src/components/admin_console/billing/billing_summary/upsell_card.tsx b/webapp/channels/src/components/admin_console/billing/billing_summary/upsell_card.tsx index a1d3819689..a5ba8db050 100644 --- a/webapp/channels/src/components/admin_console/billing/billing_summary/upsell_card.tsx +++ b/webapp/channels/src/components/admin_console/billing/billing_summary/upsell_card.tsx @@ -1,20 +1,18 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; - -import {useIntl} from 'react-intl'; - import classNames from 'classnames'; - -import WomanUpArrowsAndCloudsSvg from 'components/common/svg_images_components/woman_up_arrows_and_clouds_svg'; -import StartTrialCaution from 'components/pricing_modal/start_trial_caution'; - -import {Message, t} from 'utils/i18n'; -import {openExternalPricingLink, FREEMIUM_TO_ENTERPRISE_TRIAL_LENGTH_DAYS} from 'utils/cloud_utils'; +import React from 'react'; +import {useIntl} from 'react-intl'; import CloudStartTrialButton from 'components/cloud_start_trial/cloud_start_trial_btn'; import useOpenCloudPurchaseModal from 'components/common/hooks/useOpenCloudPurchaseModal'; +import WomanUpArrowsAndCloudsSvg from 'components/common/svg_images_components/woman_up_arrows_and_clouds_svg'; +import StartTrialCaution from 'components/pricing_modal/start_trial_caution'; + +import {openExternalPricingLink, FREEMIUM_TO_ENTERPRISE_TRIAL_LENGTH_DAYS} from 'utils/cloud_utils'; +import {t} from 'utils/i18n'; +import type {Message} from 'utils/i18n'; import './upsell_card.scss'; diff --git a/webapp/channels/src/components/admin_console/billing/company_info.tsx b/webapp/channels/src/components/admin_console/billing/company_info.tsx index c1f20b0f03..ced1df332d 100644 --- a/webapp/channels/src/components/admin_console/billing/company_info.tsx +++ b/webapp/channels/src/components/admin_console/billing/company_info.tsx @@ -2,12 +2,12 @@ // See LICENSE.txt for license information. import React, {useEffect} from 'react'; -import {useDispatch, useSelector} from 'react-redux'; import {FormattedMessage} from 'react-intl'; +import {useDispatch, useSelector} from 'react-redux'; -import {DispatchFunc} from 'mattermost-redux/types/actions'; import {getCloudCustomer} from 'mattermost-redux/actions/cloud'; import {getCloudErrors} from 'mattermost-redux/selectors/entities/cloud'; +import type {DispatchFunc} from 'mattermost-redux/types/actions'; import {pageVisited} from 'actions/telemetry_actions'; diff --git a/webapp/channels/src/components/admin_console/billing/company_info_display.tsx b/webapp/channels/src/components/admin_console/billing/company_info_display.tsx index 3d6c20823a..e148bafd4f 100644 --- a/webapp/channels/src/components/admin_console/billing/company_info_display.tsx +++ b/webapp/channels/src/components/admin_console/billing/company_info_display.tsx @@ -6,11 +6,12 @@ import {FormattedMessage} from 'react-intl'; import {useSelector} from 'react-redux'; import {trackEvent} from 'actions/telemetry_actions'; -import BlockableLink from 'components/admin_console/blockable_link'; -import FormattedMarkdownMessage from 'components/formatted_markdown_message'; -import CompanySvg from 'components/common/svg_images_components/company_svg'; -import {GlobalState} from 'types/store'; +import BlockableLink from 'components/admin_console/blockable_link'; +import CompanySvg from 'components/common/svg_images_components/company_svg'; +import FormattedMarkdownMessage from 'components/formatted_markdown_message'; + +import type {GlobalState} from 'types/store'; import './company_info_display.scss'; diff --git a/webapp/channels/src/components/admin_console/billing/company_info_edit.tsx b/webapp/channels/src/components/admin_console/billing/company_info_edit.tsx index c2445fa428..1628352c65 100644 --- a/webapp/channels/src/components/admin_console/billing/company_info_edit.tsx +++ b/webapp/channels/src/components/admin_console/billing/company_info_edit.tsx @@ -9,19 +9,19 @@ import {useHistory} from 'react-router-dom'; import {getCloudCustomer, updateCloudCustomer, updateCloudCustomerAddress} from 'mattermost-redux/actions/cloud'; -import {GlobalState} from 'types/store'; - -import {COUNTRIES} from 'utils/countries'; -import * as Utils from 'utils/utils'; +import {setNavigationBlocked} from 'actions/admin_actions.jsx'; import BlockableLink from 'components/admin_console/blockable_link'; import DropdownInput from 'components/dropdown_input'; import StateSelector from 'components/payment_form/state_selector'; -import Input from 'components/widgets/inputs/input/input'; import SaveButton from 'components/save_button'; import AdminHeader from 'components/widgets/admin_console/admin_header'; +import Input from 'components/widgets/inputs/input/input'; -import {setNavigationBlocked} from 'actions/admin_actions.jsx'; +import {COUNTRIES} from 'utils/countries'; +import * as Utils from 'utils/utils'; + +import type {GlobalState} from 'types/store'; import './company_info_edit.scss'; diff --git a/webapp/channels/src/components/admin_console/billing/delete_workspace/delete_feedback.tsx b/webapp/channels/src/components/admin_console/billing/delete_workspace/delete_feedback.tsx index 25c73d3b73..c6a28fb4d5 100644 --- a/webapp/channels/src/components/admin_console/billing/delete_workspace/delete_feedback.tsx +++ b/webapp/channels/src/components/admin_console/billing/delete_workspace/delete_feedback.tsx @@ -2,11 +2,13 @@ // See LICENSE.txt for license information. import React from 'react'; +import {injectIntl} from 'react-intl'; +import type {WrappedComponentProps} from 'react-intl'; -import {injectIntl, WrappedComponentProps} from 'react-intl'; +import type {Feedback} from '@mattermost/types/cloud'; -import {Feedback} from '@mattermost/types/cloud'; -import FeedbackModal, {FeedbackOption} from 'components/feedback_modal/feedback'; +import FeedbackModal from 'components/feedback_modal/feedback'; +import type {FeedbackOption} from 'components/feedback_modal/feedback'; type Props = { onSubmit: (deleteFeedback: Feedback) => void; diff --git a/webapp/channels/src/components/admin_console/billing/delete_workspace/delete_workspace_cta.tsx b/webapp/channels/src/components/admin_console/billing/delete_workspace/delete_workspace_cta.tsx index ccdf364756..9f094b5416 100644 --- a/webapp/channels/src/components/admin_console/billing/delete_workspace/delete_workspace_cta.tsx +++ b/webapp/channels/src/components/admin_console/billing/delete_workspace/delete_workspace_cta.tsx @@ -3,18 +3,17 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; - import {useDispatch, useSelector} from 'react-redux'; +import {getCloudSubscription, getSubscriptionProduct} from 'mattermost-redux/selectors/entities/cloud'; +import {getLicense} from 'mattermost-redux/selectors/entities/general'; + import {trackEvent} from 'actions/telemetry_actions'; -import {CloudProducts, ModalIdentifiers} from 'utils/constants'; import {openModal} from 'actions/views/modals'; -import {getLicense} from 'mattermost-redux/selectors/entities/general'; +import {CloudProducts, ModalIdentifiers} from 'utils/constants'; import {isCloudLicense} from 'utils/license_utils'; -import {getCloudSubscription, getSubscriptionProduct} from 'mattermost-redux/selectors/entities/cloud'; - import DeleteWorkspaceModal from './delete_workspace_modal'; export default function DeleteWorkspaceCTA() { diff --git a/webapp/channels/src/components/admin_console/billing/delete_workspace/delete_workspace_modal.tsx b/webapp/channels/src/components/admin_console/billing/delete_workspace/delete_workspace_modal.tsx index 485dfad01d..88f6299482 100644 --- a/webapp/channels/src/components/admin_console/billing/delete_workspace/delete_workspace_modal.tsx +++ b/webapp/channels/src/components/admin_console/billing/delete_workspace/delete_workspace_modal.tsx @@ -2,37 +2,39 @@ // See LICENSE.txt for license information. import React from 'react'; - import {FormattedMessage} from 'react-intl'; - import {useDispatch, useSelector} from 'react-redux'; import {GenericModal} from '@mattermost/components'; +import type {Feedback} from '@mattermost/types/cloud'; -import LaptopAlertSVG from 'components/common/svg_images_components/laptop_alert_svg'; +import {getSubscriptionProduct} from 'mattermost-redux/selectors/entities/cloud'; +import {getLicense} from 'mattermost-redux/selectors/entities/general'; +import type {DispatchFunc} from 'mattermost-redux/types/actions'; + +import {subscribeCloudSubscription, deleteWorkspace as deleteWorkspaceRequest} from 'actions/cloud'; import {closeModal, openModal} from 'actions/views/modals'; -import './delete_workspace_modal.scss'; -import {CloudProducts, ModalIdentifiers, StatTypes} from 'utils/constants'; import DeleteFeedbackModal from 'components/admin_console/billing/delete_workspace/delete_feedback'; -import DowngradeFeedbackModal from 'components/feedback_modal/downgrade_feedback'; -import {Feedback} from '@mattermost/types/cloud'; -import {GlobalState} from 'types/store'; -import useGetUsage from 'components/common/hooks/useGetUsage'; -import {fileSizeToString} from 'utils/utils'; -import useOpenDowngradeModal from 'components/common/hooks/useOpenDowngradeModal'; -import {subscribeCloudSubscription, deleteWorkspace as deleteWorkspaceRequest} from 'actions/cloud'; -import ErrorModal from 'components/cloud_subscribe_result_modal/error'; import DeleteWorkspaceProgressModal from 'components/admin_console/billing/delete_workspace/progress_modal'; +import ErrorModal from 'components/cloud_subscribe_result_modal/error'; import SuccessModal from 'components/cloud_subscribe_result_modal/success'; -import {getSubscriptionProduct} from 'mattermost-redux/selectors/entities/cloud'; -import {isCloudLicense} from 'utils/license_utils'; -import {getLicense} from 'mattermost-redux/selectors/entities/general'; -import {DispatchFunc} from 'mattermost-redux/types/actions'; import useGetSubscription from 'components/common/hooks/useGetSubscription'; +import useGetUsage from 'components/common/hooks/useGetUsage'; +import useOpenDowngradeModal from 'components/common/hooks/useOpenDowngradeModal'; +import LaptopAlertSVG from 'components/common/svg_images_components/laptop_alert_svg'; +import DowngradeFeedbackModal from 'components/feedback_modal/downgrade_feedback'; + +import {CloudProducts, ModalIdentifiers, StatTypes} from 'utils/constants'; +import {isCloudLicense} from 'utils/license_utils'; +import {fileSizeToString} from 'utils/utils'; + +import type {GlobalState} from 'types/store'; -import DeleteWorkspaceSuccessModal from './success_modal'; import DeleteWorkspaceFailureModal from './failure_modal'; +import DeleteWorkspaceSuccessModal from './success_modal'; + +import './delete_workspace_modal.scss'; type Props = { callerCTA: string; diff --git a/webapp/channels/src/components/admin_console/billing/delete_workspace/failure_modal.tsx b/webapp/channels/src/components/admin_console/billing/delete_workspace/failure_modal.tsx index f1179108af..3d7a6d884a 100644 --- a/webapp/channels/src/components/admin_console/billing/delete_workspace/failure_modal.tsx +++ b/webapp/channels/src/components/admin_console/billing/delete_workspace/failure_modal.tsx @@ -6,7 +6,9 @@ import {FormattedMessage} from 'react-intl'; import {useDispatch} from 'react-redux'; import {closeModal, openModal} from 'actions/views/modals'; + import PaymentFailedSvg from 'components/common/svg_images_components/payment_failed_svg'; + import {ModalIdentifiers} from 'utils/constants'; import DeleteWorkspaceModal from './delete_workspace_modal'; diff --git a/webapp/channels/src/components/admin_console/billing/delete_workspace/progress_modal.tsx b/webapp/channels/src/components/admin_console/billing/delete_workspace/progress_modal.tsx index 1f52a4224d..bacaf50e8e 100644 --- a/webapp/channels/src/components/admin_console/billing/delete_workspace/progress_modal.tsx +++ b/webapp/channels/src/components/admin_console/billing/delete_workspace/progress_modal.tsx @@ -2,18 +2,19 @@ // See LICENSE.txt for license information. import React, {useEffect, useRef, useState} from 'react'; -import {injectIntl, WrappedComponentProps} from 'react-intl'; +import {injectIntl} from 'react-intl'; +import type {WrappedComponentProps} from 'react-intl'; import {useDispatch} from 'react-redux'; +import {closeModal} from 'actions/views/modals'; + +import BackgroundSvg from 'components/common/svg_images_components/background_svg'; +import CreditCardSvg from 'components/common/svg_images_components/credit_card_svg'; +import IconMessage from 'components/purchase_modal/icon_message'; import RootPortal from 'components/root_portal'; import FullScreenModal from 'components/widgets/modals/full_screen_modal'; -import BackgroundSvg from 'components/common/svg_images_components/background_svg'; -import IconMessage from 'components/purchase_modal/icon_message'; - -import {closeModal} from 'actions/views/modals'; import {ModalIdentifiers} from 'utils/constants'; -import CreditCardSvg from 'components/common/svg_images_components/credit_card_svg'; import './progress_modal.scss'; const MIN_PROCESSING_MILLISECONDS = 5000; diff --git a/webapp/channels/src/components/admin_console/billing/delete_workspace/result_modal.tsx b/webapp/channels/src/components/admin_console/billing/delete_workspace/result_modal.tsx index 6e9948756a..5140c62e23 100644 --- a/webapp/channels/src/components/admin_console/billing/delete_workspace/result_modal.tsx +++ b/webapp/channels/src/components/admin_console/billing/delete_workspace/result_modal.tsx @@ -2,17 +2,18 @@ // See LICENSE.txt for license information. import React from 'react'; +import {Modal} from 'react-bootstrap'; import {FormattedMessage} from 'react-intl'; import {useDispatch, useSelector} from 'react-redux'; -import IconMessage from 'components/purchase_modal/icon_message'; -import FullScreenModal from 'components/widgets/modals/full_screen_modal'; -import {useOpenCloudZendeskSupportForm} from 'components/common/hooks/useOpenZendeskForm'; - import {closeModal} from 'actions/views/modals'; import {isModalOpen} from 'selectors/views/modals'; -import {GlobalState} from 'types/store'; -import {Modal} from 'react-bootstrap'; + +import {useOpenCloudZendeskSupportForm} from 'components/common/hooks/useOpenZendeskForm'; +import IconMessage from 'components/purchase_modal/icon_message'; +import FullScreenModal from 'components/widgets/modals/full_screen_modal'; + +import type {GlobalState} from 'types/store'; import './result_modal.scss'; @@ -63,12 +64,12 @@ export default function ResultModal({type, icon, title, subtitle, primaryButtonT buttonHandler={primaryButtonHandler} className={'success'} formattedTertiaryButonText={ - contactSupportButtonVisible ? + contactSupportButtonVisible ? ( : - undefined + /> + ) : undefined } tertiaryButtonHandler={contactSupportButtonVisible ? openContactSupport : undefined} /> diff --git a/webapp/channels/src/components/admin_console/billing/invoice_user_count.test.tsx b/webapp/channels/src/components/admin_console/billing/invoice_user_count.test.tsx index e4f6e098f4..c2cace1244 100644 --- a/webapp/channels/src/components/admin_console/billing/invoice_user_count.test.tsx +++ b/webapp/channels/src/components/admin_console/billing/invoice_user_count.test.tsx @@ -3,9 +3,10 @@ import React from 'react'; -import {mountWithIntl} from '../../../tests/helpers/intl-test-helper'; +import {InvoiceLineItemType} from '@mattermost/types/cloud'; +import type {Invoice} from '@mattermost/types/cloud'; -import {Invoice, InvoiceLineItemType} from '@mattermost/types/cloud'; +import {mountWithIntl} from 'tests/helpers/intl-test-helper'; import InvoiceUserCount from './invoice_user_count'; diff --git a/webapp/channels/src/components/admin_console/billing/invoice_user_count.tsx b/webapp/channels/src/components/admin_console/billing/invoice_user_count.tsx index c93be8af8e..eec0fae05f 100644 --- a/webapp/channels/src/components/admin_console/billing/invoice_user_count.tsx +++ b/webapp/channels/src/components/admin_console/billing/invoice_user_count.tsx @@ -4,7 +4,8 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {Invoice, InvoiceLineItemType} from '@mattermost/types/cloud'; +import {InvoiceLineItemType} from '@mattermost/types/cloud'; +import type {Invoice} from '@mattermost/types/cloud'; import {numberToFixedDynamic} from 'utils/utils'; diff --git a/webapp/channels/src/components/admin_console/billing/payment_details.tsx b/webapp/channels/src/components/admin_console/billing/payment_details.tsx index 50940d38ec..85db5604ad 100644 --- a/webapp/channels/src/components/admin_console/billing/payment_details.tsx +++ b/webapp/channels/src/components/admin_console/billing/payment_details.tsx @@ -7,7 +7,8 @@ import {useSelector} from 'react-redux'; import FormattedMarkdownMessage from 'components/formatted_markdown_message'; import CardImage from 'components/payment_form/card_image'; -import {GlobalState} from 'types/store'; + +import type {GlobalState} from 'types/store'; export interface PaymentDetailsProps { children?: React.ReactNode; diff --git a/webapp/channels/src/components/admin_console/billing/payment_info.tsx b/webapp/channels/src/components/admin_console/billing/payment_info.tsx index 8f78418b53..20da0b9725 100644 --- a/webapp/channels/src/components/admin_console/billing/payment_info.tsx +++ b/webapp/channels/src/components/admin_console/billing/payment_info.tsx @@ -2,14 +2,14 @@ // See LICENSE.txt for license information. import React, {useEffect, useState} from 'react'; -import {useDispatch, useSelector} from 'react-redux'; import {FormattedMessage} from 'react-intl'; +import {useDispatch, useSelector} from 'react-redux'; -import {GlobalState} from '@mattermost/types/store'; +import type {GlobalState} from '@mattermost/types/store'; -import {DispatchFunc} from 'mattermost-redux/types/actions'; import {getCloudCustomer} from 'mattermost-redux/actions/cloud'; import {getCloudErrors} from 'mattermost-redux/selectors/entities/cloud'; +import type {DispatchFunc} from 'mattermost-redux/types/actions'; import {pageVisited} from 'actions/telemetry_actions'; diff --git a/webapp/channels/src/components/admin_console/billing/payment_info_display.tsx b/webapp/channels/src/components/admin_console/billing/payment_info_display.tsx index 42e8f77ef4..155fbf8b91 100644 --- a/webapp/channels/src/components/admin_console/billing/payment_info_display.tsx +++ b/webapp/channels/src/components/admin_console/billing/payment_info_display.tsx @@ -6,17 +6,18 @@ import {FormattedMessage} from 'react-intl'; import {useSelector} from 'react-redux'; import {trackEvent} from 'actions/telemetry_actions'; + import BlockableLink from 'components/admin_console/blockable_link'; -import CreditCardSvg from 'components/common/svg_images_components/credit_card_svg'; - -import {GlobalState} from 'types/store'; - -import './payment_info_display.scss'; import useGetSubscription from 'components/common/hooks/useGetSubscription'; import useOpenCloudPurchaseModal from 'components/common/hooks/useOpenCloudPurchaseModal'; +import CreditCardSvg from 'components/common/svg_images_components/credit_card_svg'; + +import type {GlobalState} from 'types/store'; import PaymentDetails from './payment_details'; +import './payment_info_display.scss'; + const addInfoButton = (
- - , - ) : - shallow( - - - , - ); + const wrapper = deep ? mountWithIntl( + + + , + ) : shallow( + + + , + ); return wrapper; } diff --git a/webapp/channels/src/components/admin_console/billing/plan_details/feature_list.tsx b/webapp/channels/src/components/admin_console/billing/plan_details/feature_list.tsx index 81ba9632bf..13073a96d9 100644 --- a/webapp/channels/src/components/admin_console/billing/plan_details/feature_list.tsx +++ b/webapp/channels/src/components/admin_console/billing/plan_details/feature_list.tsx @@ -4,9 +4,10 @@ import React from 'react'; import {useIntl} from 'react-intl'; -import {fallbackStarterLimits, asGBString, hasSomeLimits} from 'utils/limits'; import useGetLimits from 'components/common/hooks/useGetLimits'; + import {CloudProducts} from 'utils/constants'; +import {fallbackStarterLimits, asGBString, hasSomeLimits} from 'utils/limits'; import './feature_list.scss'; diff --git a/webapp/channels/src/components/admin_console/billing/plan_details/index.tsx b/webapp/channels/src/components/admin_console/billing/plan_details/index.tsx index 6030123ed8..2e25978da8 100644 --- a/webapp/channels/src/components/admin_console/billing/plan_details/index.tsx +++ b/webapp/channels/src/components/admin_console/billing/plan_details/index.tsx @@ -9,14 +9,14 @@ import {getSubscriptionProduct, getCloudSubscription} from 'mattermost-redux/sel import useGetTotalUsersNoBots from 'components/common/hooks/useGetTotalUsersNoBots'; -import {getRemainingDaysFromFutureTimestamp} from 'utils/utils'; import {TrialPeriodDays} from 'utils/constants'; +import {getRemainingDaysFromFutureTimestamp} from 'utils/utils'; +import FeatureList from './feature_list'; import { PlanDetailsTopElements, currentPlanText, } from './plan_details'; -import FeatureList from './feature_list'; import PlanPricing from './plan_pricing'; import './plan_details.scss'; diff --git a/webapp/channels/src/components/admin_console/billing/plan_details/plan_details.tsx b/webapp/channels/src/components/admin_console/billing/plan_details/plan_details.tsx index c185921d2c..f1cec30fd1 100644 --- a/webapp/channels/src/components/admin_console/billing/plan_details/plan_details.tsx +++ b/webapp/channels/src/components/admin_console/billing/plan_details/plan_details.tsx @@ -4,10 +4,10 @@ import React from 'react'; import {FormattedMessage, useIntl} from 'react-intl'; -import {CloudProducts} from 'utils/constants'; - -import Tag from 'components/widgets/tag/tag'; import useOpenPricingModal from 'components/common/hooks/useOpenPricingModal'; +import Tag from 'components/widgets/tag/tag'; + +import {CloudProducts} from 'utils/constants'; import './plan_details.scss'; diff --git a/webapp/channels/src/components/admin_console/billing/plan_details/plan_pricing.tsx b/webapp/channels/src/components/admin_console/billing/plan_details/plan_pricing.tsx index 4b9bf97997..51486fd978 100644 --- a/webapp/channels/src/components/admin_console/billing/plan_details/plan_pricing.tsx +++ b/webapp/channels/src/components/admin_console/billing/plan_details/plan_pricing.tsx @@ -4,12 +4,15 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; +import type {Product} from '@mattermost/types/cloud'; + import {trackEvent} from 'actions/telemetry_actions'; + +import ExternalLink from 'components/external_link'; + import {BillingSchemes, CloudProducts, CloudLinks, RecurringIntervals} from 'utils/constants'; -import {Product} from '@mattermost/types/cloud'; import './plan_pricing.scss'; -import ExternalLink from 'components/external_link'; interface Props { product: Product; diff --git a/webapp/channels/src/components/admin_console/bleve_settings.test.tsx b/webapp/channels/src/components/admin_console/bleve_settings.test.tsx index 34f0828705..2240084fd3 100644 --- a/webapp/channels/src/components/admin_console/bleve_settings.test.tsx +++ b/webapp/channels/src/components/admin_console/bleve_settings.test.tsx @@ -1,10 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; -import {AdminConfig} from '@mattermost/types/config'; +import type {AdminConfig} from '@mattermost/types/config'; import BleveSettings from 'components/admin_console/bleve_settings'; diff --git a/webapp/channels/src/components/admin_console/bleve_settings.tsx b/webapp/channels/src/components/admin_console/bleve_settings.tsx index 5fc8cc364d..33949d4b19 100644 --- a/webapp/channels/src/components/admin_console/bleve_settings.tsx +++ b/webapp/channels/src/components/admin_console/bleve_settings.tsx @@ -4,21 +4,23 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {AdminConfig} from '@mattermost/types/config'; -import {Job} from '@mattermost/types/jobs'; +import type {AdminConfig} from '@mattermost/types/config'; +import type {Job} from '@mattermost/types/jobs'; import {blevePurgeIndexes} from 'actions/admin_actions.jsx'; -import {JobStatuses, JobTypes} from 'utils/constants'; -import {t} from 'utils/i18n'; import ExternalLink from 'components/external_link'; -import AdminSettings, {BaseProps, BaseState} from './admin_settings'; +import {JobStatuses, JobTypes} from 'utils/constants'; +import {t} from 'utils/i18n'; + +import AdminSettings from './admin_settings'; +import type {BaseProps, BaseState} from './admin_settings'; import BooleanSetting from './boolean_setting'; -import TextSetting from './text_setting'; import JobsTable from './jobs'; import RequestButton from './request_button/request_button'; import SettingsGroup from './settings_group'; +import TextSetting from './text_setting'; type Props = BaseProps & { config: AdminConfig; diff --git a/webapp/channels/src/components/admin_console/blockable_link/index.ts b/webapp/channels/src/components/admin_console/blockable_link/index.ts index 285155cc30..e844909996 100644 --- a/webapp/channels/src/components/admin_console/blockable_link/index.ts +++ b/webapp/channels/src/components/admin_console/blockable_link/index.ts @@ -2,11 +2,13 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch} from 'redux'; import {deferNavigation} from 'actions/admin_actions'; import {getNavigationBlocked} from 'selectors/views/admin'; -import {GlobalState} from 'types/store'; + +import type {GlobalState} from 'types/store'; import BlockableLink from './blockable_link'; diff --git a/webapp/channels/src/components/admin_console/brand_image_setting/brand_image_setting.test.tsx b/webapp/channels/src/components/admin_console/brand_image_setting/brand_image_setting.test.tsx index 6d89e18f89..14145e821f 100644 --- a/webapp/channels/src/components/admin_console/brand_image_setting/brand_image_setting.test.tsx +++ b/webapp/channels/src/components/admin_console/brand_image_setting/brand_image_setting.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import {Client4} from 'mattermost-redux/client'; diff --git a/webapp/channels/src/components/admin_console/brand_image_setting/brand_image_setting.tsx b/webapp/channels/src/components/admin_console/brand_image_setting/brand_image_setting.tsx index 9f7f508480..8f795156a2 100644 --- a/webapp/channels/src/components/admin_console/brand_image_setting/brand_image_setting.tsx +++ b/webapp/channels/src/components/admin_console/brand_image_setting/brand_image_setting.tsx @@ -7,11 +7,13 @@ import {FormattedMessage} from 'react-intl'; import {Client4} from 'mattermost-redux/client'; import {uploadBrandImage, deleteBrandImage} from 'actions/admin_actions.jsx'; -import {Constants} from 'utils/constants'; + import FormError from 'components/form_error'; import OverlayTrigger from 'components/overlay_trigger'; import Tooltip from 'components/tooltip'; +import {Constants} from 'utils/constants'; + const HTTP_STATUS_OK = 200; type Props = { @@ -96,9 +98,7 @@ export default class BrandImageSetting extends React.PureComponent const img = this.imageRef.current; reader.onload = (e) => { const src = - e.target?.result instanceof ArrayBuffer ? - e.target?.result.toString() : - e.target?.result; + e.target?.result instanceof ArrayBuffer ? e.target?.result.toString() : e.target?.result; if (src) { img.setAttribute('src', src); diff --git a/webapp/channels/src/components/admin_console/cluster_settings.jsx b/webapp/channels/src/components/admin_console/cluster_settings.jsx index c01208fc1b..d65a1794d9 100644 --- a/webapp/channels/src/components/admin_console/cluster_settings.jsx +++ b/webapp/channels/src/components/admin_console/cluster_settings.jsx @@ -6,18 +6,17 @@ import {FormattedMessage} from 'react-intl'; import {Client4} from 'mattermost-redux/client'; -import * as Utils from 'utils/utils'; - +import ExternalLink from 'components/external_link'; import WarningIcon from 'components/widgets/icons/fa_warning_icon'; -import ExternalLink from 'components/external_link'; +import DocLinks from 'utils/constants'; +import * as Utils from 'utils/utils'; import AdminSettings from './admin_settings'; import BooleanSetting from './boolean_setting'; import ClusterTableContainer from './cluster_table_container'; import SettingsGroup from './settings_group'; import TextSetting from './text_setting'; -import DocLinks from 'utils/constants'; export default class ClusterSettings extends AdminSettings { getConfigFromState = (config) => { diff --git a/webapp/channels/src/components/admin_console/cluster_settings.test.jsx b/webapp/channels/src/components/admin_console/cluster_settings.test.jsx index 161ae82bc0..28ec7beb61 100644 --- a/webapp/channels/src/components/admin_console/cluster_settings.test.jsx +++ b/webapp/channels/src/components/admin_console/cluster_settings.test.jsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import ClusterSettings from 'components/admin_console/cluster_settings.jsx'; diff --git a/webapp/channels/src/components/admin_console/cluster_table.tsx b/webapp/channels/src/components/admin_console/cluster_table.tsx index 96367e6953..d119689cfa 100644 --- a/webapp/channels/src/components/admin_console/cluster_table.tsx +++ b/webapp/channels/src/components/admin_console/cluster_table.tsx @@ -1,14 +1,17 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {CSSProperties, MouseEvent, PureComponent} from 'react'; +import React, {PureComponent} from 'react'; +import type {CSSProperties, MouseEvent} from 'react'; import {FormattedMessage} from 'react-intl'; -import * as Utils from 'utils/utils'; -import statusGreen from 'images/status_green.png'; -import statusYellow from 'images/status_yellow.png'; + import ReloadIcon from 'components/widgets/icons/fa_reload_icon'; import WarningIcon from 'components/widgets/icons/fa_warning_icon'; +import statusGreen from 'images/status_green.png'; +import statusYellow from 'images/status_yellow.png'; +import * as Utils from 'utils/utils'; + type Props = { clusterInfos: Array<{ version: string; diff --git a/webapp/channels/src/components/admin_console/cluster_table_container.tsx b/webapp/channels/src/components/admin_console/cluster_table_container.tsx index efd7f4fc5c..16fb9e69b3 100644 --- a/webapp/channels/src/components/admin_console/cluster_table_container.tsx +++ b/webapp/channels/src/components/admin_console/cluster_table_container.tsx @@ -1,14 +1,17 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {MouseEvent, PureComponent} from 'react'; +import React, {PureComponent} from 'react'; +import type {MouseEvent} from 'react'; + +import type {ClusterInfo} from '@mattermost/types/admin'; -import {ClusterInfo} from '@mattermost/types/admin'; import {getClusterStatus} from 'actions/admin_actions.jsx'; -import LoadingScreen from '../loading_screen'; import ClusterTable from './cluster_table'; +import LoadingScreen from '../loading_screen'; + interface State { clusterInfos: ClusterInfo[] | null; } diff --git a/webapp/channels/src/components/admin_console/compliance_reports/compliance_reports.tsx b/webapp/channels/src/components/admin_console/compliance_reports/compliance_reports.tsx index e85e387664..4afb09027f 100644 --- a/webapp/channels/src/components/admin_console/compliance_reports/compliance_reports.tsx +++ b/webapp/channels/src/components/admin_console/compliance_reports/compliance_reports.tsx @@ -4,13 +4,15 @@ import React from 'react'; import {FormattedDate, FormattedMessage, FormattedTime} from 'react-intl'; +import type {Compliance} from '@mattermost/types/compliance'; +import type {UserProfile} from '@mattermost/types/users'; + import {Client4} from 'mattermost-redux/client'; -import {Compliance} from '@mattermost/types/compliance'; -import {UserProfile} from '@mattermost/types/users'; import LoadingScreen from 'components/loading_screen'; -import ReloadIcon from 'components/widgets/icons/fa_reload_icon'; import LocalizedInput from 'components/localized_input/localized_input'; +import ReloadIcon from 'components/widgets/icons/fa_reload_icon'; + import {t} from 'utils/i18n'; type Props = { diff --git a/webapp/channels/src/components/admin_console/compliance_reports/index.ts b/webapp/channels/src/components/admin_console/compliance_reports/index.ts index 778b1a18df..143a6e1ec1 100644 --- a/webapp/channels/src/components/admin_console/compliance_reports/index.ts +++ b/webapp/channels/src/components/admin_console/compliance_reports/index.ts @@ -2,17 +2,18 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; + +import type {Compliance} from '@mattermost/types/compliance'; +import type {GlobalState} from '@mattermost/types/store'; +import type {UserProfile} from '@mattermost/types/users'; import {createComplianceReport, getComplianceReports} from 'mattermost-redux/actions/admin'; import {createSelector} from 'mattermost-redux/selectors/create_selector'; import {getComplianceReports as selectComplianceReports, getConfig} from 'mattermost-redux/selectors/entities/admin'; import {getLicense} from 'mattermost-redux/selectors/entities/general'; - -import {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; -import {Compliance} from '@mattermost/types/compliance'; -import {GlobalState} from '@mattermost/types/store'; -import {UserProfile} from '@mattermost/types/users'; +import type {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; import ComplianceReports from './compliance_reports'; diff --git a/webapp/channels/src/components/admin_console/custom_enable_disable_guest_accounts_setting.test.tsx b/webapp/channels/src/components/admin_console/custom_enable_disable_guest_accounts_setting.test.tsx index 56152ba9ed..aa78b476af 100644 --- a/webapp/channels/src/components/admin_console/custom_enable_disable_guest_accounts_setting.test.tsx +++ b/webapp/channels/src/components/admin_console/custom_enable_disable_guest_accounts_setting.test.tsx @@ -1,9 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; - +import React from 'react'; import {FormattedMessage} from 'react-intl'; import CustomEnableDisableGuestAccountsSetting from './custom_enable_disable_guest_accounts_setting'; diff --git a/webapp/channels/src/components/admin_console/custom_enable_disable_guest_accounts_setting.tsx b/webapp/channels/src/components/admin_console/custom_enable_disable_guest_accounts_setting.tsx index 6aac7ed390..e77edf7e93 100644 --- a/webapp/channels/src/components/admin_console/custom_enable_disable_guest_accounts_setting.tsx +++ b/webapp/channels/src/components/admin_console/custom_enable_disable_guest_accounts_setting.tsx @@ -4,9 +4,8 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import FormattedMarkdownMessage from 'components/formatted_markdown_message'; - import ConfirmModal from 'components/confirm_modal'; +import FormattedMarkdownMessage from 'components/formatted_markdown_message'; import BooleanSetting from './boolean_setting'; diff --git a/webapp/channels/src/components/admin_console/custom_plugin_settings/custom_plugin_settings.test.tsx b/webapp/channels/src/components/admin_console/custom_plugin_settings/custom_plugin_settings.test.tsx index 587c26d948..04ce46bd82 100644 --- a/webapp/channels/src/components/admin_console/custom_plugin_settings/custom_plugin_settings.test.tsx +++ b/webapp/channels/src/components/admin_console/custom_plugin_settings/custom_plugin_settings.test.tsx @@ -1,15 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; + +import type {PluginSettings} from '@mattermost/types/config'; +import type {PluginRedux} from '@mattermost/types/plugins'; import CustomPluginSettings from 'components/admin_console/custom_plugin_settings/custom_plugin_settings'; import SchemaAdminSettings from 'components/admin_console/schema_admin_settings'; -import {PluginSettings} from '@mattermost/types/config'; -import {PluginRedux} from '@mattermost/types/plugins'; - describe('components/admin_console/CustomPluginSettings', () => { let plugin: PluginRedux = {} as PluginRedux; let config: {PluginSettings: Partial} = {PluginSettings: {}}; diff --git a/webapp/channels/src/components/admin_console/custom_plugin_settings/enable_plugin_setting.ts b/webapp/channels/src/components/admin_console/custom_plugin_settings/enable_plugin_setting.ts index 876a871730..bb8bf9bdcd 100644 --- a/webapp/channels/src/components/admin_console/custom_plugin_settings/enable_plugin_setting.ts +++ b/webapp/channels/src/components/admin_console/custom_plugin_settings/enable_plugin_setting.ts @@ -1,10 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {Constants} from '../../../utils/constants'; -import {t} from '../../../utils/i18n'; +import type {PluginRedux} from '@mattermost/types/plugins'; + +import {Constants} from 'utils/constants'; +import {t} from 'utils/i18n'; + import SchemaAdminSettings from '../schema_admin_settings'; -import {PluginRedux} from '@mattermost/types/plugins'; export type EnabledPluginSetting = { type: string; diff --git a/webapp/channels/src/components/admin_console/custom_plugin_settings/index.ts b/webapp/channels/src/components/admin_console/custom_plugin_settings/index.ts index c08da3d9a2..c98446f3e7 100644 --- a/webapp/channels/src/components/admin_console/custom_plugin_settings/index.ts +++ b/webapp/channels/src/components/admin_console/custom_plugin_settings/index.ts @@ -3,27 +3,28 @@ import {connect} from 'react-redux'; +import type {PluginRedux} from '@mattermost/types/plugins'; +import type {GlobalState} from '@mattermost/types/store'; + import {createSelector} from 'mattermost-redux/selectors/create_selector'; -import {getRoles} from 'mattermost-redux/selectors/entities/roles'; import {appsFeatureFlagEnabled} from 'mattermost-redux/selectors/entities/apps'; import {isCurrentLicenseCloud} from 'mattermost-redux/selectors/entities/cloud'; -import {GlobalState} from '@mattermost/types/store'; -import {PluginRedux} from '@mattermost/types/plugins'; +import {getRoles} from 'mattermost-redux/selectors/entities/roles'; +import {getAdminConsoleCustomComponents} from 'selectors/admin_console'; + +import {appsPluginID} from 'utils/apps'; import {Constants} from 'utils/constants'; import {localizeMessage} from 'utils/utils'; -import {getAdminConsoleCustomComponents} from 'selectors/admin_console'; -import SchemaAdminSettings from '../schema_admin_settings'; -import {it} from '../admin_definition'; - -import {appsPluginID} from 'utils/apps'; - -import {AdminConsolePluginComponent} from 'types/store/plugins'; +import type {AdminConsolePluginComponent} from 'types/store/plugins'; import CustomPluginSettings from './custom_plugin_settings'; import getEnablePluginSetting from './enable_plugin_setting'; +import {it} from '../admin_definition'; +import SchemaAdminSettings from '../schema_admin_settings'; + type OwnProps = { match: { params: { plugin_id: string } } } function makeGetPluginSchema() { diff --git a/webapp/channels/src/components/admin_console/custom_terms_of_service_settings/custom_terms_of_service_settings.test.tsx b/webapp/channels/src/components/admin_console/custom_terms_of_service_settings/custom_terms_of_service_settings.test.tsx index ad6c4799e8..84cb48b369 100644 --- a/webapp/channels/src/components/admin_console/custom_terms_of_service_settings/custom_terms_of_service_settings.test.tsx +++ b/webapp/channels/src/components/admin_console/custom_terms_of_service_settings/custom_terms_of_service_settings.test.tsx @@ -1,10 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; -import {AdminConfig} from '@mattermost/types/config'; +import type {AdminConfig} from '@mattermost/types/config'; import CustomTermsOfServiceSettings from 'components/admin_console/custom_terms_of_service_settings/custom_terms_of_service_settings'; diff --git a/webapp/channels/src/components/admin_console/custom_terms_of_service_settings/custom_terms_of_service_settings.tsx b/webapp/channels/src/components/admin_console/custom_terms_of_service_settings/custom_terms_of_service_settings.tsx index 34502615d6..8d666c7448 100644 --- a/webapp/channels/src/components/admin_console/custom_terms_of_service_settings/custom_terms_of_service_settings.tsx +++ b/webapp/channels/src/components/admin_console/custom_terms_of_service_settings/custom_terms_of_service_settings.tsx @@ -4,12 +4,13 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {AdminConfig, ClientLicense} from '@mattermost/types/config'; -import {TermsOfService} from '@mattermost/types/terms_of_service'; +import type {AdminConfig, ClientLicense} from '@mattermost/types/config'; +import type {TermsOfService} from '@mattermost/types/terms_of_service'; -import AdminSettings, {BaseProps, BaseState} from 'components/admin_console/admin_settings'; -import SettingsGroup from 'components/admin_console/settings_group'; +import AdminSettings from 'components/admin_console/admin_settings'; +import type {BaseProps, BaseState} from 'components/admin_console/admin_settings'; import BooleanSetting from 'components/admin_console/boolean_setting'; +import SettingsGroup from 'components/admin_console/settings_group'; import TextSetting from 'components/admin_console/text_setting'; import FormattedMarkdownMessage from 'components/formatted_markdown_message'; import LoadingScreen from 'components/loading_screen'; diff --git a/webapp/channels/src/components/admin_console/custom_terms_of_service_settings/index.ts b/webapp/channels/src/components/admin_console/custom_terms_of_service_settings/index.ts index 62e064ef76..1d04fe1130 100644 --- a/webapp/channels/src/components/admin_console/custom_terms_of_service_settings/index.ts +++ b/webapp/channels/src/components/admin_console/custom_terms_of_service_settings/index.ts @@ -2,11 +2,13 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; + +import type {TermsOfService} from '@mattermost/types/terms_of_service'; -import {GenericAction, ActionFunc} from 'mattermost-redux/types/actions'; -import {TermsOfService} from '@mattermost/types/terms_of_service'; import {getTermsOfService, createTermsOfService} from 'mattermost-redux/actions/users'; +import type {GenericAction, ActionFunc} from 'mattermost-redux/types/actions'; import CustomTermsOfServiceSettings from './custom_terms_of_service_settings'; diff --git a/webapp/channels/src/components/admin_console/custom_url_schemes_setting.test.tsx b/webapp/channels/src/components/admin_console/custom_url_schemes_setting.test.tsx index e3f9a89b05..de0c9f09c9 100644 --- a/webapp/channels/src/components/admin_console/custom_url_schemes_setting.test.tsx +++ b/webapp/channels/src/components/admin_console/custom_url_schemes_setting.test.tsx @@ -1,11 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; -import LocalizedInput from 'components/localized_input/localized_input'; import CustomURLSchemesSetting from 'components/admin_console/custom_url_schemes_setting'; +import LocalizedInput from 'components/localized_input/localized_input'; describe('components/AdminConsole/CustomUrlSchemeSetting', () => { const baseProps = { diff --git a/webapp/channels/src/components/admin_console/custom_url_schemes_setting.tsx b/webapp/channels/src/components/admin_console/custom_url_schemes_setting.tsx index 5bc5eee0ef..1908569885 100644 --- a/webapp/channels/src/components/admin_console/custom_url_schemes_setting.tsx +++ b/webapp/channels/src/components/admin_console/custom_url_schemes_setting.tsx @@ -2,13 +2,14 @@ // See LICENSE.txt for license information. import PropTypes from 'prop-types'; -import React, {ChangeEvent, PureComponent} from 'react'; - -import * as Utils from 'utils/utils'; -import {t} from 'utils/i18n'; +import React, {PureComponent} from 'react'; +import type {ChangeEvent} from 'react'; import LocalizedInput from 'components/localized_input/localized_input'; +import {t} from 'utils/i18n'; +import * as Utils from 'utils/utils'; + import Setting from './setting'; type Props = { diff --git a/webapp/channels/src/components/admin_console/data_grid/data_grid.test.tsx b/webapp/channels/src/components/admin_console/data_grid/data_grid.test.tsx index 4c842c5ec5..87ab03efe1 100644 --- a/webapp/channels/src/components/admin_console/data_grid/data_grid.test.tsx +++ b/webapp/channels/src/components/admin_console/data_grid/data_grid.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import DataGrid from './data_grid'; diff --git a/webapp/channels/src/components/admin_console/data_grid/data_grid.tsx b/webapp/channels/src/components/admin_console/data_grid/data_grid.tsx index 37c4665c05..530a6f303b 100644 --- a/webapp/channels/src/components/admin_console/data_grid/data_grid.tsx +++ b/webapp/channels/src/components/admin_console/data_grid/data_grid.tsx @@ -1,14 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {CSSProperties} from 'react'; -import {FormattedMessage} from 'react-intl'; import classNames from 'classnames'; +import React from 'react'; +import type {CSSProperties} from 'react'; +import {FormattedMessage} from 'react-intl'; +import type {FilterOptions} from 'components/admin_console/filter/filter'; import NextIcon from 'components/widgets/icons/fa_next_icon'; import PreviousIcon from 'components/widgets/icons/fa_previous_icon'; import LoadingSpinner from 'components/widgets/loading/loading_spinner'; -import {FilterOptions} from 'components/admin_console/filter/filter'; import DataGridHeader from './data_grid_header'; import DataGridRow from './data_grid_row'; diff --git a/webapp/channels/src/components/admin_console/data_grid/data_grid_header.tsx b/webapp/channels/src/components/admin_console/data_grid/data_grid_header.tsx index c21e0a53b0..690c4f20ff 100644 --- a/webapp/channels/src/components/admin_console/data_grid/data_grid_header.tsx +++ b/webapp/channels/src/components/admin_console/data_grid/data_grid_header.tsx @@ -1,12 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {CSSProperties} from 'react'; +import React from 'react'; +import type {CSSProperties} from 'react'; + +import type {Column} from './data_grid'; import './data_grid.scss'; -import {Column} from './data_grid'; - export type Props = { columns: Column[]; } diff --git a/webapp/channels/src/components/admin_console/data_grid/data_grid_row.tsx b/webapp/channels/src/components/admin_console/data_grid/data_grid_row.tsx index ea2e3d7815..18335ef99a 100644 --- a/webapp/channels/src/components/admin_console/data_grid/data_grid_row.tsx +++ b/webapp/channels/src/components/admin_console/data_grid/data_grid_row.tsx @@ -1,10 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {CSSProperties} from 'react'; import classNames from 'classnames'; +import React from 'react'; +import type {CSSProperties} from 'react'; -import {Row, Column} from './data_grid'; +import type {Row, Column} from './data_grid'; import './data_grid.scss'; diff --git a/webapp/channels/src/components/admin_console/data_grid/data_grid_search.tsx b/webapp/channels/src/components/admin_console/data_grid/data_grid_search.tsx index 9b514c0a6b..d2378a4ad9 100644 --- a/webapp/channels/src/components/admin_console/data_grid/data_grid_search.tsx +++ b/webapp/channels/src/components/admin_console/data_grid/data_grid_search.tsx @@ -3,12 +3,12 @@ import React from 'react'; +import Filter from 'components/admin_console/filter/filter'; +import type {FilterOptions} from 'components/admin_console/filter/filter'; import FaSearchIcon from 'components/widgets/icons/fa_search_icon'; import * as Utils from 'utils/utils'; -import Filter, {FilterOptions} from 'components/admin_console/filter/filter'; - import './data_grid.scss'; type Props = { diff --git a/webapp/channels/src/components/admin_console/data_retention_settings/channel_list/channel_list.test.tsx b/webapp/channels/src/components/admin_console/data_retention_settings/channel_list/channel_list.test.tsx index 51f1c3195c..b6fa2a3406 100644 --- a/webapp/channels/src/components/admin_console/data_retention_settings/channel_list/channel_list.test.tsx +++ b/webapp/channels/src/components/admin_console/data_retention_settings/channel_list/channel_list.test.tsx @@ -1,11 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; + +import type {Channel} from '@mattermost/types/channels'; import ChannelList from 'components/admin_console/data_retention_settings/channel_list/channel_list'; -import {Channel} from '@mattermost/types/channels'; + import {TestHelper} from 'utils/test_helper'; describe('components/admin_console/data_retention_settings/channel_list', () => { diff --git a/webapp/channels/src/components/admin_console/data_retention_settings/channel_list/channel_list.tsx b/webapp/channels/src/components/admin_console/data_retention_settings/channel_list/channel_list.tsx index 0e5711134e..37c0851831 100644 --- a/webapp/channels/src/components/admin_console/data_retention_settings/channel_list/channel_list.tsx +++ b/webapp/channels/src/components/admin_console/data_retention_settings/channel_list/channel_list.tsx @@ -1,24 +1,26 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {debounce, isEqual} from 'lodash'; import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {debounce, isEqual} from 'lodash'; -import {Constants} from 'utils/constants'; +import type {ChannelSearchOpts, ChannelWithTeamData} from '@mattermost/types/channels'; -import DataGrid, {Column, Row} from 'components/admin_console/data_grid/data_grid'; +import type {ActionResult} from 'mattermost-redux/types/actions'; + +import DataGrid from 'components/admin_console/data_grid/data_grid'; +import type {Column, Row} from 'components/admin_console/data_grid/data_grid'; +import type {FilterOptions} from 'components/admin_console/filter/filter'; import TeamFilterDropdown from 'components/admin_console/filter/team_filter_dropdown'; - -import './channel_list.scss'; -import {FilterOptions} from 'components/admin_console/filter/filter'; +import ArchiveIcon from 'components/widgets/icons/archive_icon'; import GlobeIcon from 'components/widgets/icons/globe_icon'; import LockIcon from 'components/widgets/icons/lock_icon'; -import ArchiveIcon from 'components/widgets/icons/archive_icon'; -import {isArchivedChannel} from 'utils/channel_utils'; -import {ActionResult} from 'mattermost-redux/types/actions'; -import {ChannelSearchOpts, ChannelWithTeamData} from '@mattermost/types/channels'; +import {isArchivedChannel} from 'utils/channel_utils'; +import {Constants} from 'utils/constants'; + +import './channel_list.scss'; type Props = { channels: ChannelWithTeamData[]; diff --git a/webapp/channels/src/components/admin_console/data_retention_settings/channel_list/index.ts b/webapp/channels/src/components/admin_console/data_retention_settings/channel_list/index.ts index 908ee49b56..4cfef835c2 100644 --- a/webapp/channels/src/components/admin_console/data_retention_settings/channel_list/index.ts +++ b/webapp/channels/src/components/admin_console/data_retention_settings/channel_list/index.ts @@ -2,21 +2,21 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; + +import type {Channel, ChannelSearchOpts, ChannelWithTeamData} from '@mattermost/types/channels'; +import type {DataRetentionCustomPolicy} from '@mattermost/types/data_retention'; import {getDataRetentionCustomPolicyChannels, searchDataRetentionCustomPolicyChannels as searchChannels} from 'mattermost-redux/actions/admin'; -import {filterChannelList, getChannelsInPolicy, searchChannelsInPolicy} from 'mattermost-redux/selectors/entities/channels'; import {getDataRetentionCustomPolicy} from 'mattermost-redux/selectors/entities/admin'; +import {filterChannelList, getChannelsInPolicy, searchChannelsInPolicy} from 'mattermost-redux/selectors/entities/channels'; +import type {ActionFunc, ActionResult, GenericAction} from 'mattermost-redux/types/actions'; import {filterChannelsMatchingTerm, channelListToMap} from 'mattermost-redux/utils/channel_utils'; -import {ActionFunc, ActionResult, GenericAction} from 'mattermost-redux/types/actions'; - -import {Channel, ChannelSearchOpts, ChannelWithTeamData} from '@mattermost/types/channels'; - -import {GlobalState} from 'types/store'; - import {setChannelListSearch, setChannelListFilters} from 'actions/views/search'; -import {DataRetentionCustomPolicy} from '@mattermost/types/data_retention'; + +import type {GlobalState} from 'types/store'; import ChannelList from './channel_list'; diff --git a/webapp/channels/src/components/admin_console/data_retention_settings/custom_policy_form/custom_policy_form.test.tsx b/webapp/channels/src/components/admin_console/data_retention_settings/custom_policy_form/custom_policy_form.test.tsx index 3b53bf7271..57e90c0667 100644 --- a/webapp/channels/src/components/admin_console/data_retention_settings/custom_policy_form/custom_policy_form.test.tsx +++ b/webapp/channels/src/components/admin_console/data_retention_settings/custom_policy_form/custom_policy_form.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import CustomPolicyForm from 'components/admin_console/data_retention_settings/custom_policy_form/custom_policy_form'; diff --git a/webapp/channels/src/components/admin_console/data_retention_settings/custom_policy_form/custom_policy_form.tsx b/webapp/channels/src/components/admin_console/data_retention_settings/custom_policy_form/custom_policy_form.tsx index 3c29c1bef3..7c09043b8b 100644 --- a/webapp/channels/src/components/admin_console/data_retention_settings/custom_policy_form/custom_policy_form.tsx +++ b/webapp/channels/src/components/admin_console/data_retention_settings/custom_policy_form/custom_policy_form.tsx @@ -4,31 +4,31 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import { +import type {ChannelWithTeamData} from '@mattermost/types/channels'; +import type { DataRetentionCustomPolicy, CreateDataRetentionCustomPolicy, PatchDataRetentionCustomPolicy, } from '@mattermost/types/data_retention'; -import {Team} from '@mattermost/types/teams'; -import {IDMappedObjects} from '@mattermost/types/utilities'; -import {ChannelWithTeamData} from '@mattermost/types/channels'; +import type {Team} from '@mattermost/types/teams'; +import type {IDMappedObjects} from '@mattermost/types/utilities'; -import * as Utils from 'utils/utils'; -import {getHistory} from 'utils/browser_history'; -import {ItemStatus} from 'utils/constants'; - -import TitleAndButtonCardHeader from 'components/card/title_and_button_card_header/title_and_button_card_header'; -import Card from 'components/card/card'; import BlockableLink from 'components/admin_console/blockable_link'; -import Input from 'components/widgets/inputs/input/input'; -import TeamSelectorModal from 'components/team_selector_modal'; -import ChannelSelectorModal from 'components/channel_selector_modal'; -import DropdownInputHybrid from 'components/widgets/inputs/dropdown_input_hybrid'; -import SaveButton from 'components/save_button'; -import TeamList from 'components/admin_console/data_retention_settings/team_list'; import ChannelList from 'components/admin_console/data_retention_settings/channel_list'; import {keepForeverOption, yearsOption, daysOption, FOREVER, YEARS} from 'components/admin_console/data_retention_settings/dropdown_options/dropdown_options'; +import TeamList from 'components/admin_console/data_retention_settings/team_list'; +import Card from 'components/card/card'; +import TitleAndButtonCardHeader from 'components/card/title_and_button_card_header/title_and_button_card_header'; +import ChannelSelectorModal from 'components/channel_selector_modal'; +import SaveButton from 'components/save_button'; +import TeamSelectorModal from 'components/team_selector_modal'; import AdminHeader from 'components/widgets/admin_console/admin_header'; +import DropdownInputHybrid from 'components/widgets/inputs/dropdown_input_hybrid'; +import Input from 'components/widgets/inputs/input/input'; + +import {getHistory} from 'utils/browser_history'; +import {ItemStatus} from 'utils/constants'; +import * as Utils from 'utils/utils'; import './custom_policy_form.scss'; diff --git a/webapp/channels/src/components/admin_console/data_retention_settings/custom_policy_form/index.ts b/webapp/channels/src/components/admin_console/data_retention_settings/custom_policy_form/index.ts index f38beebb37..a89944697c 100644 --- a/webapp/channels/src/components/admin_console/data_retention_settings/custom_policy_form/index.ts +++ b/webapp/channels/src/components/admin_console/data_retention_settings/custom_policy_form/index.ts @@ -2,8 +2,15 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch, ActionCreatorsMapObject} from 'redux'; -import {bindActionCreators, Dispatch, ActionCreatorsMapObject} from 'redux'; +import type { + DataRetentionCustomPolicy, + CreateDataRetentionCustomPolicy, + PatchDataRetentionCustomPolicy, +} from '@mattermost/types/data_retention'; +import type {Team} from '@mattermost/types/teams'; import { getDataRetentionCustomPolicy as fetchPolicy, @@ -16,19 +23,12 @@ import { removeDataRetentionCustomPolicyChannels, } from 'mattermost-redux/actions/admin'; import {getDataRetentionCustomPolicy} from 'mattermost-redux/selectors/entities/admin'; -import {GenericAction, ActionFunc} from 'mattermost-redux/types/actions'; -import { - DataRetentionCustomPolicy, - CreateDataRetentionCustomPolicy, - PatchDataRetentionCustomPolicy, -} from '@mattermost/types/data_retention'; -import {Team} from '@mattermost/types/teams'; - -import {GlobalState} from 'types/store'; +import {getTeamsInPolicy} from 'mattermost-redux/selectors/entities/teams'; +import type {GenericAction, ActionFunc} from 'mattermost-redux/types/actions'; import {setNavigationBlocked} from 'actions/admin_actions.jsx'; -import {getTeamsInPolicy} from 'mattermost-redux/selectors/entities/teams'; +import type {GlobalState} from 'types/store'; import CustomPolicyForm from './custom_policy_form'; diff --git a/webapp/channels/src/components/admin_console/data_retention_settings/data_retention_settings.test.tsx b/webapp/channels/src/components/admin_console/data_retention_settings/data_retention_settings.test.tsx index 9453f7799a..f528c28389 100644 --- a/webapp/channels/src/components/admin_console/data_retention_settings/data_retention_settings.test.tsx +++ b/webapp/channels/src/components/admin_console/data_retention_settings/data_retention_settings.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import DataRetentionSettings from './data_retention_settings'; diff --git a/webapp/channels/src/components/admin_console/data_retention_settings/data_retention_settings.tsx b/webapp/channels/src/components/admin_console/data_retention_settings/data_retention_settings.tsx index 7fe33176dd..760caca2c7 100644 --- a/webapp/channels/src/components/admin_console/data_retention_settings/data_retention_settings.tsx +++ b/webapp/channels/src/components/admin_console/data_retention_settings/data_retention_settings.tsx @@ -1,28 +1,30 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {createRef, RefObject} from 'react'; +import React, {createRef} from 'react'; +import type {RefObject} from 'react'; import {FormattedMessage} from 'react-intl'; import ReactSelect from 'react-select'; -import {AdminConfig} from '@mattermost/types/config'; -import {DataRetentionCustomPolicies, DataRetentionCustomPolicy} from '@mattermost/types/data_retention'; -import {DeepPartial} from '@mattermost/types/utilities'; -import {JobTypeBase, JobType} from '@mattermost/types/jobs'; +import type {AdminConfig} from '@mattermost/types/config'; +import type {DataRetentionCustomPolicies, DataRetentionCustomPolicy} from '@mattermost/types/data_retention'; +import type {JobTypeBase, JobType} from '@mattermost/types/jobs'; +import type {DeepPartial} from '@mattermost/types/utilities'; -import {ActionResult} from 'mattermost-redux/types/actions'; +import type {ActionResult} from 'mattermost-redux/types/actions'; -import {JobTypes} from 'utils/constants'; -import * as Utils from 'utils/utils'; -import {getHistory} from 'utils/browser_history'; - -import DataGrid, {Row, Column} from 'components/admin_console/data_grid/data_grid'; +import DataGrid from 'components/admin_console/data_grid/data_grid'; +import type {Row, Column} from 'components/admin_console/data_grid/data_grid'; +import JobsTable from 'components/admin_console/jobs'; import Card from 'components/card/card'; import TitleAndButtonCardHeader from 'components/card/title_and_button_card_header/title_and_button_card_header'; import AdminHeader from 'components/widgets/admin_console/admin_header'; -import JobsTable from 'components/admin_console/jobs'; -import MenuWrapper from 'components/widgets/menu/menu_wrapper'; import Menu from 'components/widgets/menu/menu'; +import MenuWrapper from 'components/widgets/menu/menu_wrapper'; + +import {getHistory} from 'utils/browser_history'; +import {JobTypes} from 'utils/constants'; +import * as Utils from 'utils/utils'; import './data_retention_settings.scss'; @@ -580,7 +582,7 @@ export default class DataRetentionSettings extends React.PureComponent - {this.state.showEditJobTime ? + {this.state.showEditJobTime ? ( : + /> + ) : ( {this.getJobStartTime()} - } + )} this.showEditJobTime(true)} diff --git a/webapp/channels/src/components/admin_console/data_retention_settings/global_policy_form/global_policy_form.test.tsx b/webapp/channels/src/components/admin_console/data_retention_settings/global_policy_form/global_policy_form.test.tsx index ea6dd11c23..efb01c6519 100644 --- a/webapp/channels/src/components/admin_console/data_retention_settings/global_policy_form/global_policy_form.test.tsx +++ b/webapp/channels/src/components/admin_console/data_retention_settings/global_policy_form/global_policy_form.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import GlobalPolicyForm from 'components/admin_console/data_retention_settings/global_policy_form/global_policy_form'; diff --git a/webapp/channels/src/components/admin_console/data_retention_settings/global_policy_form/global_policy_form.tsx b/webapp/channels/src/components/admin_console/data_retention_settings/global_policy_form/global_policy_form.tsx index aa521591b1..acd005f84b 100644 --- a/webapp/channels/src/components/admin_console/data_retention_settings/global_policy_form/global_policy_form.tsx +++ b/webapp/channels/src/components/admin_console/data_retention_settings/global_policy_form/global_policy_form.tsx @@ -4,19 +4,19 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {AdminConfig} from '@mattermost/types/config'; -import {DeepPartial} from '@mattermost/types/utilities'; -import {ServerError} from '@mattermost/types/errors'; +import type {AdminConfig} from '@mattermost/types/config'; +import type {ServerError} from '@mattermost/types/errors'; +import type {DeepPartial} from '@mattermost/types/utilities'; -import * as Utils from 'utils/utils'; -import {getHistory} from 'utils/browser_history'; - -import Card from 'components/card/card'; import BlockableLink from 'components/admin_console/blockable_link'; -import DropdownInputHybrid from 'components/widgets/inputs/dropdown_input_hybrid'; import {keepForeverOption, yearsOption, daysOption, FOREVER, YEARS, DAYS} from 'components/admin_console/data_retention_settings/dropdown_options/dropdown_options'; +import Card from 'components/card/card'; import SaveButton from 'components/save_button'; import AdminHeader from 'components/widgets/admin_console/admin_header'; +import DropdownInputHybrid from 'components/widgets/inputs/dropdown_input_hybrid'; + +import {getHistory} from 'utils/browser_history'; +import * as Utils from 'utils/utils'; import './global_policy_form.scss'; diff --git a/webapp/channels/src/components/admin_console/data_retention_settings/global_policy_form/index.ts b/webapp/channels/src/components/admin_console/data_retention_settings/global_policy_form/index.ts index 6ce9131afa..d24dc54c34 100644 --- a/webapp/channels/src/components/admin_console/data_retention_settings/global_policy_form/index.ts +++ b/webapp/channels/src/components/admin_console/data_retention_settings/global_policy_form/index.ts @@ -2,19 +2,19 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch, ActionCreatorsMapObject} from 'redux'; -import {bindActionCreators, Dispatch, ActionCreatorsMapObject} from 'redux'; +import type {AdminConfig} from '@mattermost/types/config'; +import type {ServerError} from '@mattermost/types/errors'; import { updateConfig, } from 'mattermost-redux/actions/admin'; -import {GenericAction, ActionFunc} from 'mattermost-redux/types/actions'; +import type {GenericAction, ActionFunc} from 'mattermost-redux/types/actions'; import {setNavigationBlocked} from 'actions/admin_actions.jsx'; -import {AdminConfig} from '@mattermost/types/config'; -import {ServerError} from '@mattermost/types/errors'; - import GlobalPolicyForm from './global_policy_form'; type Actions = { diff --git a/webapp/channels/src/components/admin_console/data_retention_settings/index.ts b/webapp/channels/src/components/admin_console/data_retention_settings/index.ts index 8f83081d71..bb1db0e66f 100644 --- a/webapp/channels/src/components/admin_console/data_retention_settings/index.ts +++ b/webapp/channels/src/components/admin_console/data_retention_settings/index.ts @@ -2,18 +2,18 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch, ActionCreatorsMapObject} from 'redux'; -import {bindActionCreators, Dispatch, ActionCreatorsMapObject} from 'redux'; +import type {DataRetentionCustomPolicies} from '@mattermost/types/data_retention'; +import type {JobTypeBase, JobType} from '@mattermost/types/jobs'; import {getDataRetentionCustomPolicies as fetchDataRetentionCustomPolicies, deleteDataRetentionCustomPolicy, updateConfig} from 'mattermost-redux/actions/admin'; -import {getDataRetentionCustomPolicies, getDataRetentionCustomPoliciesCount} from 'mattermost-redux/selectors/entities/admin'; -import {GenericAction, ActionFunc, ActionResult} from 'mattermost-redux/types/actions'; -import {DataRetentionCustomPolicies} from '@mattermost/types/data_retention'; import {createJob, getJobsByType} from 'mattermost-redux/actions/jobs'; +import {getDataRetentionCustomPolicies, getDataRetentionCustomPoliciesCount} from 'mattermost-redux/selectors/entities/admin'; +import type {GenericAction, ActionFunc, ActionResult} from 'mattermost-redux/types/actions'; -import {GlobalState} from 'types/store'; - -import {JobTypeBase, JobType} from '@mattermost/types/jobs'; +import type {GlobalState} from 'types/store'; import DataRetentionSettings from './data_retention_settings'; diff --git a/webapp/channels/src/components/admin_console/data_retention_settings/team_list/index.ts b/webapp/channels/src/components/admin_console/data_retention_settings/team_list/index.ts index 7fec4247b4..332e392fbc 100644 --- a/webapp/channels/src/components/admin_console/data_retention_settings/team_list/index.ts +++ b/webapp/channels/src/components/admin_console/data_retention_settings/team_list/index.ts @@ -2,21 +2,21 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; + +import type {DataRetentionCustomPolicy} from '@mattermost/types/data_retention'; +import type {Team, TeamSearchOpts} from '@mattermost/types/teams'; import {getDataRetentionCustomPolicyTeams, searchDataRetentionCustomPolicyTeams as searchTeams} from 'mattermost-redux/actions/admin'; -import {getTeamsInPolicy, searchTeamsInPolicy} from 'mattermost-redux/selectors/entities/teams'; import {getDataRetentionCustomPolicy} from 'mattermost-redux/selectors/entities/admin'; +import {getTeamsInPolicy, searchTeamsInPolicy} from 'mattermost-redux/selectors/entities/teams'; +import type {ActionFunc, ActionResult, GenericAction} from 'mattermost-redux/types/actions'; import {teamListToMap, filterTeamsStartingWithTerm} from 'mattermost-redux/utils/team_utils'; -import {ActionFunc, ActionResult, GenericAction} from 'mattermost-redux/types/actions'; - -import {Team, TeamSearchOpts} from '@mattermost/types/teams'; - -import {GlobalState} from 'types/store'; import {setTeamListSearch} from 'actions/views/search'; -import {DataRetentionCustomPolicy} from '@mattermost/types/data_retention'; +import type {GlobalState} from 'types/store'; import TeamList from './team_list'; diff --git a/webapp/channels/src/components/admin_console/data_retention_settings/team_list/team_list.test.tsx b/webapp/channels/src/components/admin_console/data_retention_settings/team_list/team_list.test.tsx index 30ad78da6d..f8fd178310 100644 --- a/webapp/channels/src/components/admin_console/data_retention_settings/team_list/team_list.test.tsx +++ b/webapp/channels/src/components/admin_console/data_retention_settings/team_list/team_list.test.tsx @@ -1,12 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; + +import type {Team} from '@mattermost/types/teams'; import TeamList from 'components/admin_console/data_retention_settings/team_list/team_list'; + import {TestHelper} from 'utils/test_helper'; -import {Team} from '@mattermost/types/teams'; describe('components/admin_console/data_retention_settings/team_list', () => { const team: Team = Object.assign(TestHelper.getTeamMock({id: 'team-1'})); diff --git a/webapp/channels/src/components/admin_console/data_retention_settings/team_list/team_list.tsx b/webapp/channels/src/components/admin_console/data_retention_settings/team_list/team_list.tsx index da7902860d..26e9da75c2 100644 --- a/webapp/channels/src/components/admin_console/data_retention_settings/team_list/team_list.tsx +++ b/webapp/channels/src/components/admin_console/data_retention_settings/team_list/team_list.tsx @@ -1,19 +1,21 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {debounce} from 'lodash'; import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {debounce} from 'lodash'; + +import type {Team, TeamSearchOpts} from '@mattermost/types/teams'; + +import type {ActionResult} from 'mattermost-redux/types/actions'; + +import DataGrid from 'components/admin_console/data_grid/data_grid'; +import type {Column, Row} from 'components/admin_console/data_grid/data_grid'; +import TeamIcon from 'components/widgets/team_icon/team_icon'; import Constants from 'utils/constants'; -import {ActionResult} from 'mattermost-redux/types/actions'; -import {Team, TeamSearchOpts} from '@mattermost/types/teams'; - import * as Utils from 'utils/utils'; -import DataGrid, {Column, Row} from 'components/admin_console/data_grid/data_grid'; -import TeamIcon from 'components/widgets/team_icon/team_icon'; - import './team_list.scss'; type Props = { diff --git a/webapp/channels/src/components/admin_console/database/index.tsx b/webapp/channels/src/components/admin_console/database/index.tsx index d0b223b0d1..1a0ff8aedc 100644 --- a/webapp/channels/src/components/admin_console/database/index.tsx +++ b/webapp/channels/src/components/admin_console/database/index.tsx @@ -2,12 +2,11 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; - -import {bindActionCreators, Dispatch, ActionCreatorsMapObject} from 'redux'; - -import {ActionFunc, ActionResult, GenericAction} from 'mattermost-redux/types/actions'; +import {bindActionCreators} from 'redux'; +import type {Dispatch, ActionCreatorsMapObject} from 'redux'; import {getAppliedSchemaMigrations} from 'mattermost-redux/actions/admin'; +import type {ActionFunc, ActionResult, GenericAction} from 'mattermost-redux/types/actions'; import MigrationsTable from './migrations_table'; diff --git a/webapp/channels/src/components/admin_console/database/migrations_table.tsx b/webapp/channels/src/components/admin_console/database/migrations_table.tsx index 9f3e3f587e..8c2dac0e1b 100644 --- a/webapp/channels/src/components/admin_console/database/migrations_table.tsx +++ b/webapp/channels/src/components/admin_console/database/migrations_table.tsx @@ -1,17 +1,16 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import classNames from 'classnames'; - +import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {SchemaMigration} from '@mattermost/types/admin'; +import type {SchemaMigration} from '@mattermost/types/admin'; + +import type {ActionResult} from 'mattermost-redux/types/actions'; import './migrations_table.scss'; -import {ActionResult} from 'mattermost-redux/types/actions'; - export type Props = { createHelpText: React.ReactElement; className?: string; diff --git a/webapp/channels/src/components/admin_console/database_settings.jsx b/webapp/channels/src/components/admin_console/database_settings.jsx index 9eaa58fe4b..4e19fcc8e3 100644 --- a/webapp/channels/src/components/admin_console/database_settings.jsx +++ b/webapp/channels/src/components/admin_console/database_settings.jsx @@ -5,20 +5,20 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; import {recycleDatabaseConnection, ping} from 'actions/admin_actions'; -import * as Utils from 'utils/utils'; -import {t} from 'utils/i18n'; import ExternalLink from 'components/external_link'; +import {DocLinks} from 'utils/constants'; +import {t} from 'utils/i18n'; +import * as Utils from 'utils/utils'; + import AdminSettings from './admin_settings'; import BooleanSetting from './boolean_setting'; +import MigrationsTable from './database'; import RequestButton from './request_button/request_button'; import SettingsGroup from './settings_group'; import TextSetting from './text_setting'; -import MigrationsTable from './database'; -import {DocLinks} from 'utils/constants'; - export default class DatabaseSettings extends AdminSettings { constructor(props) { super(props); diff --git a/webapp/channels/src/components/admin_console/database_settings.test.jsx b/webapp/channels/src/components/admin_console/database_settings.test.jsx index 936ee41d13..5c7375e878 100644 --- a/webapp/channels/src/components/admin_console/database_settings.test.jsx +++ b/webapp/channels/src/components/admin_console/database_settings.test.jsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import DatabaseSettings from 'components/admin_console/database_settings.jsx'; diff --git a/webapp/channels/src/components/admin_console/dropdown_setting.tsx b/webapp/channels/src/components/admin_console/dropdown_setting.tsx index b8c0ac6850..ada42e9b75 100644 --- a/webapp/channels/src/components/admin_console/dropdown_setting.tsx +++ b/webapp/channels/src/components/admin_console/dropdown_setting.tsx @@ -2,10 +2,12 @@ // See LICENSE.txt for license information. import PropTypes from 'prop-types'; -import React, {PureComponent, ReactNode, ChangeEvent} from 'react'; +import React, {PureComponent} from 'react'; +import type {ReactNode, ChangeEvent} from 'react'; + +import type {EmailSettings} from '@mattermost/types/config'; import Setting from './setting'; -import {EmailSettings} from '@mattermost/types/config'; type Props = { id: string; diff --git a/webapp/channels/src/components/admin_console/elasticsearch_settings.test.jsx b/webapp/channels/src/components/admin_console/elasticsearch_settings.test.jsx index 47443e43bd..8f4903ae5c 100644 --- a/webapp/channels/src/components/admin_console/elasticsearch_settings.test.jsx +++ b/webapp/channels/src/components/admin_console/elasticsearch_settings.test.jsx @@ -1,11 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; -import SaveButton from 'components/save_button'; import ElasticSearchSettings from 'components/admin_console/elasticsearch_settings'; +import SaveButton from 'components/save_button'; jest.mock('actions/admin_actions.jsx', () => { return { diff --git a/webapp/channels/src/components/admin_console/elasticsearch_settings.tsx b/webapp/channels/src/components/admin_console/elasticsearch_settings.tsx index 3313d40400..713b18ea05 100644 --- a/webapp/channels/src/components/admin_console/elasticsearch_settings.tsx +++ b/webapp/channels/src/components/admin_console/elasticsearch_settings.tsx @@ -4,21 +4,24 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; +import type {AdminConfig} from '@mattermost/types/config'; +import type {Job, JobType} from '@mattermost/types/jobs'; + import {elasticsearchPurgeIndexes, elasticsearchTest} from 'actions/admin_actions.jsx'; -import {DocLinks, JobStatuses, JobTypes} from 'utils/constants'; -import * as Utils from 'utils/utils'; -import {t} from 'utils/i18n'; import ExternalLink from 'components/external_link'; -import AdminSettings, {BaseProps, BaseState} from './admin_settings'; +import {DocLinks, JobStatuses, JobTypes} from 'utils/constants'; +import {t} from 'utils/i18n'; +import * as Utils from 'utils/utils'; + +import AdminSettings from './admin_settings'; +import type {BaseProps, BaseState} from './admin_settings'; import BooleanSetting from './boolean_setting'; import JobsTable from './jobs'; import RequestButton from './request_button/request_button'; import SettingsGroup from './settings_group'; import TextSetting from './text_setting'; -import {AdminConfig} from '@mattermost/types/config'; -import {Job, JobType} from '@mattermost/types/jobs'; interface State extends BaseState { connectionUrl: string; diff --git a/webapp/channels/src/components/admin_console/feature_discovery/feature_discovery.test.tsx b/webapp/channels/src/components/admin_console/feature_discovery/feature_discovery.test.tsx index f1a87400e0..8c2ba993e5 100644 --- a/webapp/channels/src/components/admin_console/feature_discovery/feature_discovery.test.tsx +++ b/webapp/channels/src/components/admin_console/feature_discovery/feature_discovery.test.tsx @@ -4,17 +4,16 @@ import React from 'react'; import {Provider as ReduxProvider} from 'react-redux'; -import FeatureDiscovery from 'components/admin_console/feature_discovery/feature_discovery'; - import store from 'stores/redux_store'; +import FeatureDiscovery from 'components/admin_console/feature_discovery/feature_discovery'; + import { renderWithIntl, screen, userEvent, waitFor, } from 'tests/react_testing_utils'; - import {AboutLinks, LicenseSkus} from 'utils/constants'; import SamlSVG from './features/images/saml_svg'; diff --git a/webapp/channels/src/components/admin_console/feature_discovery/feature_discovery.tsx b/webapp/channels/src/components/admin_console/feature_discovery/feature_discovery.tsx index 9d757b205d..10fc72cf99 100644 --- a/webapp/channels/src/components/admin_console/feature_discovery/feature_discovery.tsx +++ b/webapp/channels/src/components/admin_console/feature_discovery/feature_discovery.tsx @@ -4,30 +4,29 @@ import React from 'react'; import {FormattedMessage, useIntl} from 'react-intl'; -import FormattedMarkdownMessage from 'components/formatted_markdown_message'; - -import {EmbargoedEntityTrialError} from 'components/admin_console/license_settings/trial_banner/trial_banner'; -import AlertBanner from 'components/alert_banner'; -import LoadingSpinner from 'components/widgets/loading/loading_spinner'; -import StartTrialBtn from 'components/learn_more_trial_modal/start_trial_btn'; -import PurchaseLink from 'components/announcement_bar/purchase_link/purchase_link'; -import ContactUsButton from 'components/announcement_bar/contact_sales/contact_us'; -import PurchaseModal from 'components/purchase_modal'; -import CloudStartTrialButton from 'components/cloud_start_trial/cloud_start_trial_btn'; -import ExternalLink from 'components/external_link'; - -import {ModalIdentifiers, TELEMETRY_CATEGORIES, AboutLinks, LicenseLinks, LicenseSkus} from 'utils/constants'; -import {FREEMIUM_TO_ENTERPRISE_TRIAL_LENGTH_DAYS} from 'utils/cloud_utils'; -import * as Utils from 'utils/utils'; -import {goToMattermostContactSalesForm} from 'utils/contact_support_sales'; +import type {AnalyticsRow} from '@mattermost/types/admin'; +import type {CloudCustomer} from '@mattermost/types/cloud'; +import type {ClientLicense} from '@mattermost/types/config'; import {trackEvent} from 'actions/telemetry_actions'; -import {ModalData} from 'types/actions'; +import {EmbargoedEntityTrialError} from 'components/admin_console/license_settings/trial_banner/trial_banner'; +import AlertBanner from 'components/alert_banner'; +import ContactUsButton from 'components/announcement_bar/contact_sales/contact_us'; +import PurchaseLink from 'components/announcement_bar/purchase_link/purchase_link'; +import CloudStartTrialButton from 'components/cloud_start_trial/cloud_start_trial_btn'; +import ExternalLink from 'components/external_link'; +import FormattedMarkdownMessage from 'components/formatted_markdown_message'; +import StartTrialBtn from 'components/learn_more_trial_modal/start_trial_btn'; +import PurchaseModal from 'components/purchase_modal'; +import LoadingSpinner from 'components/widgets/loading/loading_spinner'; -import {ClientLicense} from '@mattermost/types/config'; -import {AnalyticsRow} from '@mattermost/types/admin'; -import {CloudCustomer} from '@mattermost/types/cloud'; +import {FREEMIUM_TO_ENTERPRISE_TRIAL_LENGTH_DAYS} from 'utils/cloud_utils'; +import {ModalIdentifiers, TELEMETRY_CATEGORIES, AboutLinks, LicenseLinks, LicenseSkus} from 'utils/constants'; +import {goToMattermostContactSalesForm} from 'utils/contact_support_sales'; +import * as Utils from 'utils/utils'; + +import type {ModalData} from 'types/actions'; import './feature_discovery.scss'; diff --git a/webapp/channels/src/components/admin_console/feature_discovery/features/announcement_banner.tsx b/webapp/channels/src/components/admin_console/feature_discovery/features/announcement_banner.tsx index 08d0173878..64ef43b41d 100644 --- a/webapp/channels/src/components/admin_console/feature_discovery/features/announcement_banner.tsx +++ b/webapp/channels/src/components/admin_console/feature_discovery/features/announcement_banner.tsx @@ -3,13 +3,13 @@ import React from 'react'; -import {t} from 'utils/i18n'; import {LicenseSkus} from 'utils/constants'; - -import FeatureDiscovery from '../index'; +import {t} from 'utils/i18n'; import AnnouncementBannerSVG from './images/announcement_banner_svg'; +import FeatureDiscovery from '../index'; + const AnnouncementBannerFeatureDiscovery: React.FC = () => { return ( { return ( { return ( { return ( { return ( { return ( { return ( { return ( { return ( { return ( { return ( defaultMessage='Log Event' /> - {this.state.copySuccess ? + {this.state.copySuccess ? ( : + /> + ) : ( - } + )} {this.renderContents()} @@ -127,17 +128,19 @@ export default class FullLogEventModal extends React.PureComponent defaultMessage='Cancel' /> - {this.state.exportSuccess ? + {this.state.exportSuccess ? ( : + /> + ) : ( } + + )} ); diff --git a/webapp/channels/src/components/admin_console/generated_setting.tsx b/webapp/channels/src/components/admin_console/generated_setting.tsx index 4665443779..a0af7a8fe7 100644 --- a/webapp/channels/src/components/admin_console/generated_setting.tsx +++ b/webapp/channels/src/components/admin_console/generated_setting.tsx @@ -2,7 +2,6 @@ // See LICENSE.txt for license information. import crypto from 'crypto'; - import React from 'react'; import {FormattedMessage} from 'react-intl'; diff --git a/webapp/channels/src/components/admin_console/group_settings/group_details/group_details.test.tsx b/webapp/channels/src/components/admin_console/group_settings/group_details/group_details.test.tsx index 1eef1424c2..18ca02c802 100644 --- a/webapp/channels/src/components/admin_console/group_settings/group_details/group_details.test.tsx +++ b/webapp/channels/src/components/admin_console/group_settings/group_details/group_details.test.tsx @@ -2,14 +2,14 @@ // See LICENSE.txt for license information. import {shallow} from 'enzyme'; - import React from 'react'; +import type {ChannelWithTeamData} from '@mattermost/types/channels'; +import type {Group, GroupChannel, GroupTeam} from '@mattermost/types/groups'; +import type {Team} from '@mattermost/types/teams'; +import type {UserProfile} from '@mattermost/types/users'; + import GroupDetails from 'components/admin_console/group_settings/group_details/group_details'; -import {ChannelWithTeamData} from '@mattermost/types/channels'; -import {Group, GroupChannel, GroupTeam} from '@mattermost/types/groups'; -import {Team} from '@mattermost/types/teams'; -import {UserProfile} from '@mattermost/types/users'; describe('components/admin_console/group_settings/group_details/GroupDetails', () => { const defaultProps = { diff --git a/webapp/channels/src/components/admin_console/group_settings/group_details/group_details.tsx b/webapp/channels/src/components/admin_console/group_settings/group_details/group_details.tsx index 0160a23ea9..3a5abe8c12 100644 --- a/webapp/channels/src/components/admin_console/group_settings/group_details/group_details.tsx +++ b/webapp/channels/src/components/admin_console/group_settings/group_details/group_details.tsx @@ -4,22 +4,22 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {ChannelWithTeamData} from '@mattermost/types/channels'; +import type {ChannelWithTeamData} from '@mattermost/types/channels'; import { + SyncableType, +} from '@mattermost/types/groups'; +import type { Group, GroupChannel, GroupPatch, GroupTeam, - SyncablePatch, - SyncableType, -} from '@mattermost/types/groups'; -import {Team} from '@mattermost/types/teams'; -import {UserProfile} from '@mattermost/types/users'; + SyncablePatch} from '@mattermost/types/groups'; +import type {Team} from '@mattermost/types/teams'; +import type {UserProfile} from '@mattermost/types/users'; + +import type {ActionResult} from 'mattermost-redux/types/actions'; + import BlockableLink from 'components/admin_console/blockable_link'; - -import {t} from 'utils/i18n'; -import {localizeMessage} from 'utils/utils'; - import {GroupProfileAndSettings} from 'components/admin_console/group_settings/group_details/group_profile_and_settings'; import GroupTeamsAndChannels from 'components/admin_console/group_settings/group_details/group_teams_and_channels'; import GroupUsers from 'components/admin_console/group_settings/group_details/group_users'; @@ -27,11 +27,13 @@ import SaveChangesPanel from 'components/admin_console/team_channel_settings/sav import ChannelSelectorModal from 'components/channel_selector_modal'; import FormError from 'components/form_error'; import TeamSelectorModal from 'components/team_selector_modal'; +import AdminHeader from 'components/widgets/admin_console/admin_header'; import AdminPanel from 'components/widgets/admin_console/admin_panel'; import Menu from 'components/widgets/menu/menu'; import MenuWrapper from 'components/widgets/menu/menu_wrapper'; -import {ActionResult} from 'mattermost-redux/types/actions'; -import AdminHeader from 'components/widgets/admin_console/admin_header'; + +import {t} from 'utils/i18n'; +import {localizeMessage} from 'utils/utils'; export type Props = { groupID: string; @@ -509,12 +511,8 @@ export default class GroupDetails extends React.PureComponent { allowReference, groupMentionName: lcGroupMentionName, serverError, - hasAllowReferenceChanged: result.error ? - hasAllowReferenceChanged : - false, - hasGroupMentionNameChanged: result.error ? - hasGroupMentionNameChanged : - false, + hasAllowReferenceChanged: result.error ? hasAllowReferenceChanged : false, + hasGroupMentionNameChanged: result.error ? hasGroupMentionNameChanged : false, }); } diff --git a/webapp/channels/src/components/admin_console/group_settings/group_details/group_profile_and_settings.tsx b/webapp/channels/src/components/admin_console/group_settings/group_details/group_profile_and_settings.tsx index 00b8c15cf6..59aa8b7a81 100644 --- a/webapp/channels/src/components/admin_console/group_settings/group_details/group_profile_and_settings.tsx +++ b/webapp/channels/src/components/admin_console/group_settings/group_details/group_profile_and_settings.tsx @@ -2,7 +2,6 @@ // See LICENSE.txt for license information. import React from 'react'; - import {FormattedMessage} from 'react-intl'; import GroupProfile from 'components/admin_console/group_settings/group_details/group_profile'; diff --git a/webapp/channels/src/components/admin_console/group_settings/group_details/group_teams_and_channels.tsx b/webapp/channels/src/components/admin_console/group_settings/group_details/group_teams_and_channels.tsx index e09b4c27a6..eb06c8d20b 100644 --- a/webapp/channels/src/components/admin_console/group_settings/group_details/group_teams_and_channels.tsx +++ b/webapp/channels/src/components/admin_console/group_settings/group_details/group_teams_and_channels.tsx @@ -2,11 +2,11 @@ // See LICENSE.txt for license information. import React from 'react'; - import {FormattedMessage} from 'react-intl'; +import type {GroupChannel, GroupTeam} from '@mattermost/types/groups'; + import GroupTeamsAndChannelsRow from 'components/admin_console/group_settings/group_details/group_teams_and_channels_row'; -import {GroupChannel, GroupTeam} from '@mattermost/types/groups'; export type Props = { id: string; @@ -85,9 +85,7 @@ State channelEntriesByTeam[channel.team_id] || []; channelEntriesByTeam[channel.team_id].push({ type: - channel.channel_type === 'O' ? - 'public-channel' : - 'private-channel', + channel.channel_type === 'O' ? 'public-channel' : 'private-channel', name: channel.channel_display_name, id: channel.channel_id, schemeAdmin: channel.scheme_admin, @@ -97,9 +95,7 @@ State existingTeams.add(channel.team_id); teamEntries.push({ type: - channel.team_type === 'O' ? - 'public-team' : - 'private-team', + channel.team_type === 'O' ? 'public-team' : 'private-team', hasChildren: true, name: channel.team_display_name, collapsed: this.state.collapsed[channel.team_id], diff --git a/webapp/channels/src/components/admin_console/group_settings/group_details/group_teams_and_channels_row.tsx b/webapp/channels/src/components/admin_console/group_settings/group_details/group_teams_and_channels_row.tsx index 6561a9fa2f..183dc6c65c 100644 --- a/webapp/channels/src/components/admin_console/group_settings/group_details/group_teams_and_channels_row.tsx +++ b/webapp/channels/src/components/admin_console/group_settings/group_details/group_teams_and_channels_row.tsx @@ -2,11 +2,8 @@ // See LICENSE.txt for license information. import classNames from 'classnames'; - import {isNil} from 'lodash'; - import React from 'react'; - import {FormattedMessage} from 'react-intl'; import ConfirmModal from 'components/confirm_modal'; @@ -85,13 +82,9 @@ State let dropDown = null; if (!isNil(schemeAdmin)) { let currentRole = member; - let roleToBe = this.props.type.includes('team') ? - teamAdmin : - channelAdmin; + let roleToBe = this.props.type.includes('team') ? teamAdmin : channelAdmin; if (schemeAdmin) { - currentRole = this.props.type.includes('team') ? - teamAdmin : - channelAdmin; + currentRole = this.props.type.includes('team') ? teamAdmin : channelAdmin; roleToBe = member; } dropDown = ( @@ -134,9 +127,7 @@ State diff --git a/webapp/channels/src/components/admin_console/group_settings/group_details/group_users.test.tsx b/webapp/channels/src/components/admin_console/group_settings/group_details/group_users.test.tsx index 2b364a9804..e954eb7f74 100644 --- a/webapp/channels/src/components/admin_console/group_settings/group_details/group_users.test.tsx +++ b/webapp/channels/src/components/admin_console/group_settings/group_details/group_users.test.tsx @@ -5,8 +5,9 @@ import {shallow} from 'enzyme'; import {range} from 'lodash'; import React from 'react'; +import type {UserProfile} from '@mattermost/types/users'; + import GroupUsers from 'components/admin_console/group_settings/group_details/group_users'; -import {UserProfile} from '@mattermost/types/users'; describe('components/admin_console/group_settings/group_details/GroupUsers', () => { const members = range(0, 55).map((i) => ({ diff --git a/webapp/channels/src/components/admin_console/group_settings/group_details/group_users.tsx b/webapp/channels/src/components/admin_console/group_settings/group_details/group_users.tsx index d27b24c89c..b2234763b8 100644 --- a/webapp/channels/src/components/admin_console/group_settings/group_details/group_users.tsx +++ b/webapp/channels/src/components/admin_console/group_settings/group_details/group_users.tsx @@ -2,15 +2,16 @@ // See LICENSE.txt for license information. import React from 'react'; - import {FormattedMessage} from 'react-intl'; +import type {UserProfile} from '@mattermost/types/users'; + +import type {ActionResult} from 'mattermost-redux/types/actions'; + import GroupUsersRow from 'components/admin_console/group_settings/group_details/group_users_row'; import FormattedMarkdownMessage from 'components/formatted_markdown_message'; import NextIcon from 'components/widgets/icons/fa_next_icon'; import PreviousIcon from 'components/widgets/icons/fa_previous_icon'; -import {ActionResult} from 'mattermost-redux/types/actions'; -import {UserProfile} from '@mattermost/types/users'; import {getSiteURL} from 'utils/url'; @@ -57,17 +58,13 @@ export default class GroupUsers extends React.PureComponent { nextPage = async () => { const {total, members, groupID, getMembers} = this.props; const page = - (this.state.page + 1) * GROUP_MEMBERS_PAGE_SIZE >= total ? - this.state.page : - this.state.page + 1; + (this.state.page + 1) * GROUP_MEMBERS_PAGE_SIZE >= total ? this.state.page : this.state.page + 1; if (page === this.state.page) { return; } const numberOfMembersToLoad = - (page + 1) * GROUP_MEMBERS_PAGE_SIZE >= total ? - total : - (page + 1) * GROUP_MEMBERS_PAGE_SIZE; + (page + 1) * GROUP_MEMBERS_PAGE_SIZE >= total ? total : (page + 1) * GROUP_MEMBERS_PAGE_SIZE; if (members.length >= numberOfMembersToLoad) { this.setState({page}); return; diff --git a/webapp/channels/src/components/admin_console/group_settings/group_details/group_users_row.tsx b/webapp/channels/src/components/admin_console/group_settings/group_details/group_users_row.tsx index 00abd4a3fe..e86bc5f397 100644 --- a/webapp/channels/src/components/admin_console/group_settings/group_details/group_users_row.tsx +++ b/webapp/channels/src/components/admin_console/group_settings/group_details/group_users_row.tsx @@ -5,6 +5,7 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; import {Client4} from 'mattermost-redux/client'; + import Avatar from 'components/widgets/users/avatar'; type Props = { diff --git a/webapp/channels/src/components/admin_console/group_settings/group_details/index.ts b/webapp/channels/src/components/admin_console/group_settings/group_details/index.ts index b1b6cd8a55..00547a186b 100644 --- a/webapp/channels/src/components/admin_console/group_settings/group_details/index.ts +++ b/webapp/channels/src/components/admin_console/group_settings/group_details/index.ts @@ -2,10 +2,11 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; +import type {GlobalState} from '@mattermost/types/store'; -import {setNavigationBlocked} from 'actions/admin_actions'; import { getGroup as fetchGroup, getGroupStats, @@ -23,10 +24,12 @@ import { getGroupTeams, } from 'mattermost-redux/selectors/entities/groups'; import {getProfilesInGroup as selectProfilesInGroup} from 'mattermost-redux/selectors/entities/users'; -import {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; -import {GlobalState} from '@mattermost/types/store'; +import type {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; -import GroupDetails, {Props} from './group_details'; +import {setNavigationBlocked} from 'actions/admin_actions'; + +import GroupDetails from './group_details'; +import type {Props} from './group_details'; type OwnProps = { match: { diff --git a/webapp/channels/src/components/admin_console/group_settings/group_row.test.tsx b/webapp/channels/src/components/admin_console/group_settings/group_row.test.tsx index a1f4464873..e5dc24c2e1 100644 --- a/webapp/channels/src/components/admin_console/group_settings/group_row.test.tsx +++ b/webapp/channels/src/components/admin_console/group_settings/group_row.test.tsx @@ -1,11 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import GroupRow from 'components/admin_console/group_settings/group_row'; -import LoadingSpinner from '../../widgets/loading/loading_spinner'; +import LoadingSpinner from 'components/widgets/loading/loading_spinner'; describe('components/admin_console/group_settings/GroupRow', () => { test('should match snapshot, on linked and configured row', () => { diff --git a/webapp/channels/src/components/admin_console/group_settings/group_row.tsx b/webapp/channels/src/components/admin_console/group_settings/group_row.tsx index d7274e9932..d4dbefa6b2 100644 --- a/webapp/channels/src/components/admin_console/group_settings/group_row.tsx +++ b/webapp/channels/src/components/admin_console/group_settings/group_row.tsx @@ -2,8 +2,8 @@ // See LICENSE.txt for license information. import React, {useState} from 'react'; -import {Link} from 'react-router-dom'; import {FormattedMessage, useIntl} from 'react-intl'; +import {Link} from 'react-router-dom'; import CheckboxCheckedIcon from 'components/widgets/icons/checkbox_checked_icon'; import LoadingSpinner from 'components/widgets/loading/loading_spinner'; @@ -91,9 +91,7 @@ const GroupRow = (props: Props) => { return ( ); diff --git a/webapp/channels/src/components/admin_console/group_settings/group_settings.test.tsx b/webapp/channels/src/components/admin_console/group_settings/group_settings.test.tsx index 10e9da5021..14f8d2b34b 100644 --- a/webapp/channels/src/components/admin_console/group_settings/group_settings.test.tsx +++ b/webapp/channels/src/components/admin_console/group_settings/group_settings.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import GroupSettings from 'components/admin_console/group_settings/group_settings'; diff --git a/webapp/channels/src/components/admin_console/group_settings/group_settings.tsx b/webapp/channels/src/components/admin_console/group_settings/group_settings.tsx index b6470070de..0506109275 100644 --- a/webapp/channels/src/components/admin_console/group_settings/group_settings.tsx +++ b/webapp/channels/src/components/admin_console/group_settings/group_settings.tsx @@ -4,14 +4,14 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {t} from 'utils/i18n'; -import {getSiteURL} from 'utils/url'; - import GroupsList from 'components/admin_console/group_settings/groups_list'; -import AdminPanel from 'components/widgets/admin_console/admin_panel'; import ExternalLink from 'components/external_link'; import AdminHeader from 'components/widgets/admin_console/admin_header'; +import AdminPanel from 'components/widgets/admin_console/admin_panel'; + import {DocLinks} from 'utils/constants'; +import {t} from 'utils/i18n'; +import {getSiteURL} from 'utils/url'; type Props = { isDisabled?: boolean; diff --git a/webapp/channels/src/components/admin_console/group_settings/groups_list/groups_list.test.tsx b/webapp/channels/src/components/admin_console/group_settings/groups_list/groups_list.test.tsx index 5fe2fa3487..2993eccbbc 100644 --- a/webapp/channels/src/components/admin_console/group_settings/groups_list/groups_list.test.tsx +++ b/webapp/channels/src/components/admin_console/group_settings/groups_list/groups_list.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import GroupsList from 'components/admin_console/group_settings/groups_list/groups_list'; diff --git a/webapp/channels/src/components/admin_console/group_settings/groups_list/groups_list.tsx b/webapp/channels/src/components/admin_console/group_settings/groups_list/groups_list.tsx index 9c99c2e861..47042c0e77 100644 --- a/webapp/channels/src/components/admin_console/group_settings/groups_list/groups_list.tsx +++ b/webapp/channels/src/components/admin_console/group_settings/groups_list/groups_list.tsx @@ -4,16 +4,16 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {GroupSearchOpts, MixedUnlinkedGroupRedux} from '@mattermost/types/groups'; - -import * as Utils from 'utils/utils'; +import type {GroupSearchOpts, MixedUnlinkedGroupRedux} from '@mattermost/types/groups'; import GroupRow from 'components/admin_console/group_settings/group_row'; +import CheckboxCheckedIcon from 'components/widgets/icons/checkbox_checked_icon'; import NextIcon from 'components/widgets/icons/fa_next_icon'; import PreviousIcon from 'components/widgets/icons/fa_previous_icon'; import SearchIcon from 'components/widgets/icons/search_icon'; -import CheckboxCheckedIcon from 'components/widgets/icons/checkbox_checked_icon'; + import {Constants} from 'utils/constants'; +import * as Utils from 'utils/utils'; const LDAP_GROUPS_PAGE_SIZE = 200; diff --git a/webapp/channels/src/components/admin_console/group_settings/groups_list/index.ts b/webapp/channels/src/components/admin_console/group_settings/groups_list/index.ts index babc2a82a0..d331e164f3 100644 --- a/webapp/channels/src/components/admin_console/group_settings/groups_list/index.ts +++ b/webapp/channels/src/components/admin_console/group_settings/groups_list/index.ts @@ -2,14 +2,15 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {bindActionCreators, Dispatch, ActionCreatorsMapObject} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch, ActionCreatorsMapObject} from 'redux'; -import {GlobalState} from '@mattermost/types/store'; +import type {GlobalState} from '@mattermost/types/store'; import {linkLdapGroup, unlinkLdapGroup, getLdapGroups as fetchLdapGroups} from 'mattermost-redux/actions/admin'; import {createSelector} from 'mattermost-redux/selectors/create_selector'; import {getLdapGroups, getLdapGroupsCount} from 'mattermost-redux/selectors/entities/admin'; -import {ActionFunc} from 'mattermost-redux/types/actions'; +import type {ActionFunc} from 'mattermost-redux/types/actions'; import GroupsList from './groups_list'; diff --git a/webapp/channels/src/components/admin_console/highlight.tsx b/webapp/channels/src/components/admin_console/highlight.tsx index 0005b22904..e2b3a90f33 100644 --- a/webapp/channels/src/components/admin_console/highlight.tsx +++ b/webapp/channels/src/components/admin_console/highlight.tsx @@ -1,9 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; -import Mark from 'mark.js'; import debounce from 'lodash/debounce'; +import Mark from 'mark.js'; +import React from 'react'; type Props = { filter: string; diff --git a/webapp/channels/src/components/admin_console/index.ts b/webapp/channels/src/components/admin_console/index.ts index 50c60f8d73..ad142a2043 100644 --- a/webapp/channels/src/components/admin_console/index.ts +++ b/webapp/channels/src/components/admin_console/index.ts @@ -1,35 +1,35 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {connect, ConnectedProps} from 'react-redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; +import {connect} from 'react-redux'; +import type {ConnectedProps} from 'react-redux'; import {withRouter} from 'react-router-dom'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; -import {Role} from '@mattermost/types/roles'; -import {AdminConfig} from '@mattermost/types/config'; +import type {AdminConfig} from '@mattermost/types/config'; +import type {Role} from '@mattermost/types/roles'; -import {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; import {getConfig, getEnvironmentConfig, updateConfig} from 'mattermost-redux/actions/admin'; import {loadRolesIfNeeded, editRole} from 'mattermost-redux/actions/roles'; +import {selectTeam} from 'mattermost-redux/actions/teams'; +import {General} from 'mattermost-redux/constants'; import * as Selectors from 'mattermost-redux/selectors/entities/admin'; import {getConfig as getGeneralConfig, getLicense} from 'mattermost-redux/selectors/entities/general'; -import {getRoles} from 'mattermost-redux/selectors/entities/roles'; -import {selectTeam} from 'mattermost-redux/actions/teams'; -import {isCurrentUserSystemAdmin, currentUserHasAnAdminRole, getCurrentUserId} from 'mattermost-redux/selectors/entities/users'; -import {getTeam} from 'mattermost-redux/selectors/entities/teams'; import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; - -import {General} from 'mattermost-redux/constants'; +import {getRoles} from 'mattermost-redux/selectors/entities/roles'; +import {getTeam} from 'mattermost-redux/selectors/entities/teams'; +import {isCurrentUserSystemAdmin, currentUserHasAnAdminRole, getCurrentUserId} from 'mattermost-redux/selectors/entities/users'; +import type {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; import {setNavigationBlocked, deferNavigation, cancelNavigation, confirmNavigation} from 'actions/admin_actions.jsx'; import {selectLhsItem} from 'actions/views/lhs'; -import {showNavigationPrompt} from 'selectors/views/admin'; import {getAdminDefinition, getConsoleAccess} from 'selectors/admin_console'; - +import {showNavigationPrompt} from 'selectors/views/admin'; import LocalStorageStore from 'stores/local_storage_store'; -import {GlobalState} from 'types/store'; -import {LhsItemType} from 'types/store/lhs'; +import type {GlobalState} from 'types/store'; +import type {LhsItemType} from 'types/store/lhs'; import AdminConsole from './admin_console'; diff --git a/webapp/channels/src/components/admin_console/jobs/index.tsx b/webapp/channels/src/components/admin_console/jobs/index.tsx index 856eada9af..44c8cf8f73 100644 --- a/webapp/channels/src/components/admin_console/jobs/index.tsx +++ b/webapp/channels/src/components/admin_console/jobs/index.tsx @@ -2,17 +2,20 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {bindActionCreators, Dispatch, ActionCreatorsMapObject} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch, ActionCreatorsMapObject} from 'redux'; + +import type {JobType} from '@mattermost/types/jobs'; import {getJobsByType, createJob, cancelJob} from 'mattermost-redux/actions/jobs'; import {getConfig} from 'mattermost-redux/selectors/entities/admin'; import {makeGetJobsByType} from 'mattermost-redux/selectors/entities/jobs'; -import {GenericAction, ActionFunc, ActionResult} from 'mattermost-redux/types/actions'; -import {JobType} from '@mattermost/types/jobs'; +import type {GenericAction, ActionFunc, ActionResult} from 'mattermost-redux/types/actions'; -import {GlobalState} from 'types/store'; +import type {GlobalState} from 'types/store'; -import Table, {Props} from './table'; +import Table from './table'; +import type {Props} from './table'; type OwnProps = Omit; diff --git a/webapp/channels/src/components/admin_console/jobs/job_cancel_button.tsx b/webapp/channels/src/components/admin_console/jobs/job_cancel_button.tsx index 23f17c5642..ad4d365ba8 100644 --- a/webapp/channels/src/components/admin_console/jobs/job_cancel_button.tsx +++ b/webapp/channels/src/components/admin_console/jobs/job_cancel_button.tsx @@ -2,10 +2,9 @@ // See LICENSE.txt for license information. import React, {useCallback} from 'react'; - import {useIntl} from 'react-intl'; -import {Job} from '@mattermost/types/jobs'; +import type {Job} from '@mattermost/types/jobs'; import {JobStatuses} from 'utils/constants'; diff --git a/webapp/channels/src/components/admin_console/jobs/job_download_link.tsx b/webapp/channels/src/components/admin_console/jobs/job_download_link.tsx index 6687bb8db3..4e4c07d1d9 100644 --- a/webapp/channels/src/components/admin_console/jobs/job_download_link.tsx +++ b/webapp/channels/src/components/admin_console/jobs/job_download_link.tsx @@ -4,11 +4,13 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; +import type {Job} from '@mattermost/types/jobs'; + import {Client4} from 'mattermost-redux/client'; -import {Job} from '@mattermost/types/jobs'; + +import ExternalLink from 'components/external_link'; import {exportFormats} from 'utils/constants'; -import ExternalLink from 'components/external_link'; const JobDownloadLink = React.memo(({job}: {job: Job}): JSX.Element => { if (job.data?.is_downloadable === 'true' && parseInt(job.data?.messages_exported, 10) > 0 && job.data?.export_type !== exportFormats.EXPORT_FORMAT_GLOBALRELAY) { diff --git a/webapp/channels/src/components/admin_console/jobs/job_finish_at.tsx b/webapp/channels/src/components/admin_console/jobs/job_finish_at.tsx index ccbce86e01..962b5cc4a0 100644 --- a/webapp/channels/src/components/admin_console/jobs/job_finish_at.tsx +++ b/webapp/channels/src/components/admin_console/jobs/job_finish_at.tsx @@ -4,7 +4,7 @@ import React from 'react'; import {FormattedTime, FormattedDate} from 'react-intl'; -import {JobStatus} from '@mattermost/types/jobs'; +import type {JobStatus} from '@mattermost/types/jobs'; import {JobStatuses} from 'utils/constants'; diff --git a/webapp/channels/src/components/admin_console/jobs/job_run_length.tsx b/webapp/channels/src/components/admin_console/jobs/job_run_length.tsx index 220f87d46d..5dc48d3999 100644 --- a/webapp/channels/src/components/admin_console/jobs/job_run_length.tsx +++ b/webapp/channels/src/components/admin_console/jobs/job_run_length.tsx @@ -4,7 +4,7 @@ import React from 'react'; import {useIntl} from 'react-intl'; -import {Job} from '@mattermost/types/jobs'; +import type {Job} from '@mattermost/types/jobs'; import {JobStatuses} from 'utils/constants'; diff --git a/webapp/channels/src/components/admin_console/jobs/job_status.tsx b/webapp/channels/src/components/admin_console/jobs/job_status.tsx index 4c945367ec..0c7d015e32 100644 --- a/webapp/channels/src/components/admin_console/jobs/job_status.tsx +++ b/webapp/channels/src/components/admin_console/jobs/job_status.tsx @@ -4,7 +4,7 @@ import React from 'react'; import {FormattedMessage, useIntl} from 'react-intl'; -import {Job} from '@mattermost/types/jobs'; +import type {Job} from '@mattermost/types/jobs'; import {JobStatuses} from 'utils/constants'; diff --git a/webapp/channels/src/components/admin_console/jobs/table.test.tsx b/webapp/channels/src/components/admin_console/jobs/table.test.tsx index 14af7caa2a..591d268424 100644 --- a/webapp/channels/src/components/admin_console/jobs/table.test.tsx +++ b/webapp/channels/src/components/admin_console/jobs/table.test.tsx @@ -1,12 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {shallow} from 'enzyme'; import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {shallow} from 'enzyme'; -import JobTable, {Props} from './table'; import JobCancelButton from './job_cancel_button'; +import JobTable from './table'; +import type {Props} from './table'; describe('components/admin_console/jobs/table', () => { const createJobButtonText = ( diff --git a/webapp/channels/src/components/admin_console/jobs/table.tsx b/webapp/channels/src/components/admin_console/jobs/table.tsx index 17db88a5f2..34681ea986 100644 --- a/webapp/channels/src/components/admin_console/jobs/table.tsx +++ b/webapp/channels/src/components/admin_console/jobs/table.tsx @@ -1,21 +1,21 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import classNames from 'classnames'; - +import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {Job, JobType} from '@mattermost/types/jobs'; -import {ActionResult} from 'mattermost-redux/types/actions'; +import type {Job, JobType} from '@mattermost/types/jobs'; + +import type {ActionResult} from 'mattermost-redux/types/actions'; import {JobTypes} from 'utils/constants'; -import JobDownloadLink from './job_download_link'; -import JobStatus from './job_status'; -import JobRunLength from './job_run_length'; import JobCancelButton from './job_cancel_button'; +import JobDownloadLink from './job_download_link'; import JobFinishAt from './job_finish_at'; +import JobRunLength from './job_run_length'; +import JobStatus from './job_status'; import './table.scss'; diff --git a/webapp/channels/src/components/admin_console/license_settings/enterprise_edition/enterprise_edition_left_panel.test.tsx b/webapp/channels/src/components/admin_console/license_settings/enterprise_edition/enterprise_edition_left_panel.test.tsx index 986410c9e7..5a3541c9cc 100644 --- a/webapp/channels/src/components/admin_console/license_settings/enterprise_edition/enterprise_edition_left_panel.test.tsx +++ b/webapp/channels/src/components/admin_console/license_settings/enterprise_edition/enterprise_edition_left_panel.test.tsx @@ -1,25 +1,25 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import moment from 'moment-timezone'; import React from 'react'; - import {Provider} from 'react-redux'; -import moment from 'moment-timezone'; - -import {mountWithIntl} from 'tests/helpers/intl-test-helper'; -import {renderWithIntl, screen} from 'tests/react_testing_utils'; -import {OverActiveUserLimits, SelfHostedProducts} from 'utils/constants'; -import {TestHelper} from 'utils/test_helper'; +import type {GlobalState} from '@mattermost/types/store'; +import type {DeepPartial} from '@mattermost/types/utilities'; import {General} from 'mattermost-redux/constants'; -import {DeepPartial} from '@mattermost/types/utilities'; -import {GlobalState} from '@mattermost/types/store'; -import mockStore from 'tests/test_store'; import * as useCanSelfHostedExpand from 'components/common/hooks/useCanSelfHostedExpand'; -import EnterpriseEditionLeftPanel, {EnterpriseEditionProps} from './enterprise_edition_left_panel'; +import {mountWithIntl} from 'tests/helpers/intl-test-helper'; +import {renderWithIntl, screen} from 'tests/react_testing_utils'; +import mockStore from 'tests/test_store'; +import {OverActiveUserLimits, SelfHostedProducts} from 'utils/constants'; +import {TestHelper} from 'utils/test_helper'; + +import EnterpriseEditionLeftPanel from './enterprise_edition_left_panel'; +import type {EnterpriseEditionProps} from './enterprise_edition_left_panel'; jest.mock('react-router-dom', () => ({ ...jest.requireActual('react-router-dom') as typeof import('react-router-dom'), diff --git a/webapp/channels/src/components/admin_console/license_settings/enterprise_edition/enterprise_edition_left_panel.tsx b/webapp/channels/src/components/admin_console/license_settings/enterprise_edition/enterprise_edition_left_panel.tsx index e3fee21900..beb60f49f0 100644 --- a/webapp/channels/src/components/admin_console/license_settings/enterprise_edition/enterprise_edition_left_panel.tsx +++ b/webapp/channels/src/components/admin_console/license_settings/enterprise_edition/enterprise_edition_left_panel.tsx @@ -1,30 +1,32 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {RefObject, useEffect, useState} from 'react'; import classNames from 'classnames'; +import React, {useEffect, useState} from 'react'; +import type {RefObject} from 'react'; import {FormattedDate, FormattedMessage, FormattedNumber, FormattedTime, useIntl} from 'react-intl'; import {useSelector} from 'react-redux'; -import Tag from 'components/widgets/tag/tag'; - -import {ClientLicense} from '@mattermost/types/config'; +import type {ClientLicense} from '@mattermost/types/config'; import {Client4} from 'mattermost-redux/client'; - -import {getRemainingDaysFromFutureTimestamp, toTitleCase} from 'utils/utils'; -import {FileTypes, TELEMETRY_CATEGORIES} from 'utils/constants'; -import {getSkuDisplayName} from 'utils/subscription'; -import {calculateOverageUserActivated} from 'utils/overage_team'; import {getConfig} from 'mattermost-redux/selectors/entities/admin'; -import './enterprise_edition.scss'; -import useOpenPricingModal from 'components/common/hooks/useOpenPricingModal'; -import useCanSelfHostedExpand from 'components/common/hooks/useCanSelfHostedExpand'; -import {getExpandSeatsLink} from 'selectors/cloud'; -import useControlSelfHostedExpansionModal from 'components/common/hooks/useControlSelfHostedExpansionModal'; -import {useQuery} from 'utils/http_utils'; import {trackEvent} from 'actions/telemetry_actions'; +import {getExpandSeatsLink} from 'selectors/cloud'; + +import useCanSelfHostedExpand from 'components/common/hooks/useCanSelfHostedExpand'; +import useControlSelfHostedExpansionModal from 'components/common/hooks/useControlSelfHostedExpansionModal'; +import useOpenPricingModal from 'components/common/hooks/useOpenPricingModal'; +import Tag from 'components/widgets/tag/tag'; + +import {FileTypes, TELEMETRY_CATEGORIES} from 'utils/constants'; +import {useQuery} from 'utils/http_utils'; +import {calculateOverageUserActivated} from 'utils/overage_team'; +import {getSkuDisplayName} from 'utils/subscription'; +import {getRemainingDaysFromFutureTimestamp, toTitleCase} from 'utils/utils'; + +import './enterprise_edition.scss'; const DAYS_UNTIL_EXPIRY_WARNING_DISPLAY_THRESHOLD = 30; const DAYS_UNTIL_EXPIRY_DANGER_DISPLAY_THRESHOLD = 5; diff --git a/webapp/channels/src/components/admin_console/license_settings/enterprise_edition/enterprise_edition_right_panel.test.tsx b/webapp/channels/src/components/admin_console/license_settings/enterprise_edition/enterprise_edition_right_panel.test.tsx index 8245dacbbe..7789ab615e 100644 --- a/webapp/channels/src/components/admin_console/license_settings/enterprise_edition/enterprise_edition_right_panel.test.tsx +++ b/webapp/channels/src/components/admin_console/license_settings/enterprise_edition/enterprise_edition_right_panel.test.tsx @@ -4,12 +4,12 @@ import React from 'react'; import {Provider} from 'react-redux'; -import {LicenseSkus} from 'utils/constants'; - import {mountWithIntl} from 'tests/helpers/intl-test-helper'; import mockStore from 'tests/test_store'; +import {LicenseSkus} from 'utils/constants'; -import EnterpriseEditionRightPanel, {EnterpriseEditionProps} from './enterprise_edition_right_panel'; +import EnterpriseEditionRightPanel from './enterprise_edition_right_panel'; +import type {EnterpriseEditionProps} from './enterprise_edition_right_panel'; const initialState = { views: { diff --git a/webapp/channels/src/components/admin_console/license_settings/enterprise_edition/enterprise_edition_right_panel.tsx b/webapp/channels/src/components/admin_console/license_settings/enterprise_edition/enterprise_edition_right_panel.tsx index 6e9fd250d1..93e8a9cbcf 100644 --- a/webapp/channels/src/components/admin_console/license_settings/enterprise_edition/enterprise_edition_right_panel.tsx +++ b/webapp/channels/src/components/admin_console/license_settings/enterprise_edition/enterprise_edition_right_panel.tsx @@ -4,13 +4,14 @@ import React, {memo} from 'react'; import {FormattedMessage} from 'react-intl'; -import {ClientLicense} from '@mattermost/types/config'; +import type {ClientLicense} from '@mattermost/types/config'; + +import ContactUsButton from 'components/announcement_bar/contact_sales/contact_us'; +import TwoPeopleChattingSvg from 'components/common/svg_images_components/two_people_chatting_svg'; +import WomanUpArrowsAndCloudsSvg from 'components/common/svg_images_components/woman_up_arrows_and_clouds_svg'; +import WomanWithCardSvg from 'components/common/svg_images_components/woman_with_card_svg'; import {isEnterpriseOrE20License} from 'utils/license_utils'; -import WomanUpArrowsAndCloudsSvg from 'components/common/svg_images_components/woman_up_arrows_and_clouds_svg'; -import ContactUsButton from 'components/announcement_bar/contact_sales/contact_us'; -import WomanWithCardSvg from 'components/common/svg_images_components/woman_with_card_svg'; -import TwoPeopleChattingSvg from 'components/common/svg_images_components/two_people_chatting_svg'; export interface EnterpriseEditionProps { isTrialLicense: boolean; diff --git a/webapp/channels/src/components/admin_console/license_settings/index.ts b/webapp/channels/src/components/admin_console/license_settings/index.ts index 10f3f3a89f..d8918f141b 100644 --- a/webapp/channels/src/components/admin_console/license_settings/index.ts +++ b/webapp/channels/src/components/admin_console/license_settings/index.ts @@ -2,26 +2,25 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; +import type {StatusOK} from '@mattermost/types/client4'; +import type {ServerError} from '@mattermost/types/errors'; +import type {GetFilteredUsersStatsOpts, UsersStats} from '@mattermost/types/users'; + +import {uploadLicense, removeLicense, getPrevTrialLicense} from 'mattermost-redux/actions/admin'; import {getLicenseConfig} from 'mattermost-redux/actions/general'; import {getFilteredUsersStats} from 'mattermost-redux/actions/users'; -import {uploadLicense, removeLicense, getPrevTrialLicense} from 'mattermost-redux/actions/admin'; - -import {StatusOK} from '@mattermost/types/client4'; -import {GetFilteredUsersStatsOpts, UsersStats} from '@mattermost/types/users'; -import {ServerError} from '@mattermost/types/errors'; - -import {Action, ActionResult, GenericAction} from 'mattermost-redux/types/actions'; import {getConfig} from 'mattermost-redux/selectors/entities/general'; import {getFilteredUsersStats as selectFilteredUserStats} from 'mattermost-redux/selectors/entities/users'; - -import {GlobalState} from 'types/store'; -import {ModalData} from 'types/actions'; - -import {openModal} from 'actions/views/modals'; +import type {Action, ActionResult, GenericAction} from 'mattermost-redux/types/actions'; import {requestTrialLicense, upgradeToE0Status, upgradeToE0, restartServer, ping} from 'actions/admin_actions'; +import {openModal} from 'actions/views/modals'; + +import type {ModalData} from 'types/actions'; +import type {GlobalState} from 'types/store'; import LicenseSettings from './license_settings'; diff --git a/webapp/channels/src/components/admin_console/license_settings/license_settings.test.tsx b/webapp/channels/src/components/admin_console/license_settings/license_settings.test.tsx index 1273ac3f77..e9247f1313 100644 --- a/webapp/channels/src/components/admin_console/license_settings/license_settings.test.tsx +++ b/webapp/channels/src/components/admin_console/license_settings/license_settings.test.tsx @@ -1,13 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {ComponentProps} from 'react'; import {shallow} from 'enzyme'; import expect from 'expect'; import moment from 'moment'; +import React from 'react'; +import type {ComponentProps} from 'react'; import {fakeDate} from 'tests/helpers/date'; - import {LicenseSkus} from 'utils/constants'; import LicenseSettings from './license_settings'; diff --git a/webapp/channels/src/components/admin_console/license_settings/license_settings.tsx b/webapp/channels/src/components/admin_console/license_settings/license_settings.tsx index b6bbf59b12..68cb0003cf 100644 --- a/webapp/channels/src/components/admin_console/license_settings/license_settings.tsx +++ b/webapp/channels/src/components/admin_console/license_settings/license_settings.tsx @@ -4,35 +4,35 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {ActionResult} from 'mattermost-redux/types/actions'; +import type {StatusOK} from '@mattermost/types/client4'; +import type {ClientLicense} from '@mattermost/types/config'; +import type {ServerError} from '@mattermost/types/errors'; +import type {GetFilteredUsersStatsOpts, UsersStats} from '@mattermost/types/users'; -import {ClientLicense} from '@mattermost/types/config'; -import {StatusOK} from '@mattermost/types/client4'; -import {GetFilteredUsersStatsOpts, UsersStats} from '@mattermost/types/users'; -import {ServerError} from '@mattermost/types/errors'; - -import {isLicenseExpired, isLicenseExpiring, isTrialLicense, isEnterpriseOrE20License, licenseSKUWithFirstLetterCapitalized} from 'utils/license_utils'; -import {AboutLinks, CloudLinks, ModalIdentifiers} from 'utils/constants'; - -import {ModalData} from 'types/actions'; +import type {ActionResult} from 'mattermost-redux/types/actions'; import {trackEvent} from 'actions/telemetry_actions'; import ExternalLink from 'components/external_link'; import AdminHeader from 'components/widgets/admin_console/admin_header'; -import RenewLinkCard from './renew_license_card/renew_license_card'; -import TrialLicenseCard from './trial_license_card/trial_license_card'; -import TeamEditionLeftPanel from './team_edition/team_edition_left_panel'; -import TeamEditionRightPanel from './team_edition/team_edition_right_panel'; -import StarterLeftPanel from './starter_edition/starter_left_panel'; -import StarterRightPanel from './starter_edition/starter_right_panel'; +import {AboutLinks, CloudLinks, ModalIdentifiers} from 'utils/constants'; +import {isLicenseExpired, isLicenseExpiring, isTrialLicense, isEnterpriseOrE20License, licenseSKUWithFirstLetterCapitalized} from 'utils/license_utils'; + +import type {ModalData} from 'types/actions'; + import EnterpriseEditionLeftPanel from './enterprise_edition/enterprise_edition_left_panel'; import EnterpriseEditionRightPanel from './enterprise_edition/enterprise_edition_right_panel'; -import TrialBanner from './trial_banner/trial_banner'; +import ConfirmLicenseRemovalModal from './modals/confirm_license_removal_modal'; import EELicenseModal from './modals/ee_license_modal'; import UploadLicenseModal from './modals/upload_license_modal'; -import ConfirmLicenseRemovalModal from './modals/confirm_license_removal_modal'; +import RenewLinkCard from './renew_license_card/renew_license_card'; +import StarterLeftPanel from './starter_edition/starter_left_panel'; +import StarterRightPanel from './starter_edition/starter_right_panel'; +import TeamEditionLeftPanel from './team_edition/team_edition_left_panel'; +import TeamEditionRightPanel from './team_edition/team_edition_right_panel'; +import TrialBanner from './trial_banner/trial_banner'; +import TrialLicenseCard from './trial_license_card/trial_license_card'; import './license_settings.scss'; diff --git a/webapp/channels/src/components/admin_console/license_settings/modals/confirm_license_removal_modal.test.tsx b/webapp/channels/src/components/admin_console/license_settings/modals/confirm_license_removal_modal.test.tsx index de56ee340f..a5b106d253 100644 --- a/webapp/channels/src/components/admin_console/license_settings/modals/confirm_license_removal_modal.test.tsx +++ b/webapp/channels/src/components/admin_console/license_settings/modals/confirm_license_removal_modal.test.tsx @@ -1,11 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; - -import {Provider} from 'react-redux'; - import {shallow} from 'enzyme'; +import React from 'react'; +import {Provider} from 'react-redux'; import {mountWithIntl} from 'tests/helpers/intl-test-helper'; import mockStore from 'tests/test_store'; diff --git a/webapp/channels/src/components/admin_console/license_settings/modals/confirm_license_removal_modal.tsx b/webapp/channels/src/components/admin_console/license_settings/modals/confirm_license_removal_modal.tsx index 4240bcfaa9..20ccd49ee6 100644 --- a/webapp/channels/src/components/admin_console/license_settings/modals/confirm_license_removal_modal.tsx +++ b/webapp/channels/src/components/admin_console/license_settings/modals/confirm_license_removal_modal.tsx @@ -2,21 +2,21 @@ // See LICENSE.txt for license information. import React from 'react'; +import {FormattedMessage} from 'react-intl'; import {useSelector, useDispatch} from 'react-redux'; -import {FormattedMessage} from 'react-intl'; +import {GenericModal} from '@mattermost/components'; -import {DispatchFunc} from 'mattermost-redux/types/actions'; -import {GlobalState} from 'types/store'; +import type {DispatchFunc} from 'mattermost-redux/types/actions'; +import {closeModal} from 'actions/views/modals'; import {isModalOpen} from 'selectors/views/modals'; -import {GenericModal} from '@mattermost/components'; import AlertSvg from 'components/common/svg_images_components/alert_svg'; import {ModalIdentifiers} from 'utils/constants'; -import {closeModal} from 'actions/views/modals'; +import type {GlobalState} from 'types/store'; import './confirm_license_removal_modal.scss'; diff --git a/webapp/channels/src/components/admin_console/license_settings/modals/ee_license_modal.tsx b/webapp/channels/src/components/admin_console/license_settings/modals/ee_license_modal.tsx index da5a171844..19ea24599d 100644 --- a/webapp/channels/src/components/admin_console/license_settings/modals/ee_license_modal.tsx +++ b/webapp/channels/src/components/admin_console/license_settings/modals/ee_license_modal.tsx @@ -4,17 +4,16 @@ import React from 'react'; import {useSelector, useDispatch} from 'react-redux'; -import {DispatchFunc} from 'mattermost-redux/types/actions'; - -import {GlobalState} from 'types/store'; - -import {isModalOpen} from 'selectors/views/modals'; - import {GenericModal} from '@mattermost/components'; +import type {DispatchFunc} from 'mattermost-redux/types/actions'; + +import {closeModal} from 'actions/views/modals'; +import {isModalOpen} from 'selectors/views/modals'; + import {ModalIdentifiers} from 'utils/constants'; -import {closeModal} from 'actions/views/modals'; +import type {GlobalState} from 'types/store'; import './ee_license_modal.scss'; diff --git a/webapp/channels/src/components/admin_console/license_settings/modals/upload_license_modal.test.tsx b/webapp/channels/src/components/admin_console/license_settings/modals/upload_license_modal.test.tsx index b6030c82e8..ce61c92a97 100644 --- a/webapp/channels/src/components/admin_console/license_settings/modals/upload_license_modal.test.tsx +++ b/webapp/channels/src/components/admin_console/license_settings/modals/upload_license_modal.test.tsx @@ -1,20 +1,18 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; - -import * as reactRedux from 'react-redux'; -import {act} from 'react-dom/test-utils'; - import {shallow} from 'enzyme'; - -import {mountWithIntl} from 'tests/helpers/intl-test-helper'; -import mockStore from 'tests/test_store'; +import React from 'react'; +import {act} from 'react-dom/test-utils'; +import * as reactRedux from 'react-redux'; import {General} from 'mattermost-redux/constants'; import * as i18Selectors from 'selectors/i18n'; +import {mountWithIntl} from 'tests/helpers/intl-test-helper'; +import mockStore from 'tests/test_store'; + import UploadLicenseModal from './upload_license_modal'; jest.mock('selectors/i18n'); diff --git a/webapp/channels/src/components/admin_console/license_settings/modals/upload_license_modal.tsx b/webapp/channels/src/components/admin_console/license_settings/modals/upload_license_modal.tsx index c9ea665d17..97fd61f87f 100644 --- a/webapp/channels/src/components/admin_console/license_settings/modals/upload_license_modal.tsx +++ b/webapp/channels/src/components/admin_console/license_settings/modals/upload_license_modal.tsx @@ -1,37 +1,34 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import marked from 'marked'; import React, {useRef} from 'react'; +import {FormattedDate, FormattedMessage} from 'react-intl'; import {useSelector, useDispatch} from 'react-redux'; -import {FormattedDate, FormattedMessage} from 'react-intl'; +import {GenericModal} from '@mattermost/components'; +import type {ClientLicense} from '@mattermost/types/config'; -import marked from 'marked'; - -import {DispatchFunc} from 'mattermost-redux/types/actions'; import {uploadLicense} from 'mattermost-redux/actions/admin'; import {getLicenseConfig} from 'mattermost-redux/actions/general'; import {getLicense} from 'mattermost-redux/selectors/entities/general'; -import {ClientLicense} from '@mattermost/types/config'; -import {getCurrentLocale} from 'selectors/i18n'; - -import {GlobalState} from 'types/store'; - -import {isModalOpen} from 'selectors/views/modals'; - -import {GenericModal} from '@mattermost/components'; -import WomanArmOnTable from 'components/common/svg_images_components/woman_arm_on_table_svg'; -import HandsSvg from 'components/common/svg_images_components/hands_svg'; -import FileSvg from 'components/common/svg_images_components/file_svg'; -import LoadingWrapper from 'components/widgets/loading/loading_wrapper'; -import {getSkuDisplayName} from 'utils/subscription'; - -import {FileTypes, ModalIdentifiers} from 'utils/constants'; +import type {DispatchFunc} from 'mattermost-redux/types/actions'; import {closeModal} from 'actions/views/modals'; +import {getCurrentLocale} from 'selectors/i18n'; +import {isModalOpen} from 'selectors/views/modals'; -import {fileSizeToString, localizeMessage} from 'utils/utils'; +import FileSvg from 'components/common/svg_images_components/file_svg'; +import HandsSvg from 'components/common/svg_images_components/hands_svg'; +import WomanArmOnTable from 'components/common/svg_images_components/woman_arm_on_table_svg'; +import LoadingWrapper from 'components/widgets/loading/loading_wrapper'; + +import {FileTypes, ModalIdentifiers} from 'utils/constants'; import {getMonthLong} from 'utils/i18n'; +import {getSkuDisplayName} from 'utils/subscription'; +import {fileSizeToString, localizeMessage} from 'utils/utils'; + +import type {GlobalState} from 'types/store'; import './upload_license_modal.scss'; diff --git a/webapp/channels/src/components/admin_console/license_settings/renew_license_card/renew_license_card.test.tsx b/webapp/channels/src/components/admin_console/license_settings/renew_license_card/renew_license_card.test.tsx index c52e8272d7..13b4ac67a5 100644 --- a/webapp/channels/src/components/admin_console/license_settings/renew_license_card/renew_license_card.test.tsx +++ b/webapp/channels/src/components/admin_console/license_settings/renew_license_card/renew_license_card.test.tsx @@ -1,12 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import type {ReactWrapper} from 'enzyme'; import React from 'react'; -import {ReactWrapper} from 'enzyme'; import {act} from 'react-dom/test-utils'; import {Provider} from 'react-redux'; import {Client4} from 'mattermost-redux/client'; + import {mountWithIntl} from 'tests/helpers/intl-test-helper'; import mockStore from 'tests/test_store'; diff --git a/webapp/channels/src/components/admin_console/license_settings/renew_license_card/renew_license_card.tsx b/webapp/channels/src/components/admin_console/license_settings/renew_license_card/renew_license_card.tsx index a1645a3daf..7d956740a2 100644 --- a/webapp/channels/src/components/admin_console/license_settings/renew_license_card/renew_license_card.tsx +++ b/webapp/channels/src/components/admin_console/license_settings/renew_license_card/renew_license_card.tsx @@ -1,21 +1,21 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import moment from 'moment'; import React, {useEffect, useState} from 'react'; import {FormattedMessage} from 'react-intl'; -import moment from 'moment'; -import {ClientLicense} from '@mattermost/types/config'; +import type {ClientLicense} from '@mattermost/types/config'; + import {Client4} from 'mattermost-redux/client'; -import {getRemainingDaysFromFutureTimestamp} from 'utils/utils'; -import RenewalLink from 'components/announcement_bar/renewal_link/'; -import {getSkuDisplayName} from 'utils/subscription'; - -import FormattedMarkdownMessage from 'components/formatted_markdown_message'; - import AlertBanner from 'components/alert_banner'; import ContactUsButton from 'components/announcement_bar/contact_sales/contact_us'; +import RenewalLink from 'components/announcement_bar/renewal_link/'; +import FormattedMarkdownMessage from 'components/formatted_markdown_message'; + +import {getSkuDisplayName} from 'utils/subscription'; +import {getRemainingDaysFromFutureTimestamp} from 'utils/utils'; import './renew_license_card.scss'; diff --git a/webapp/channels/src/components/admin_console/license_settings/starter_edition/starter_left_panel.tsx b/webapp/channels/src/components/admin_console/license_settings/starter_edition/starter_left_panel.tsx index 92c46163bd..c38455caa4 100644 --- a/webapp/channels/src/components/admin_console/license_settings/starter_edition/starter_left_panel.tsx +++ b/webapp/channels/src/components/admin_console/license_settings/starter_edition/starter_left_panel.tsx @@ -1,7 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {RefObject} from 'react'; +import React from 'react'; +import type {RefObject} from 'react'; import {FormattedMessage, useIntl} from 'react-intl'; import useOpenPricingModal from 'components/common/hooks/useOpenPricingModal'; diff --git a/webapp/channels/src/components/admin_console/license_settings/starter_edition/starter_right_panel.tsx b/webapp/channels/src/components/admin_console/license_settings/starter_edition/starter_right_panel.tsx index 6011923beb..9ab8e2f85f 100644 --- a/webapp/channels/src/components/admin_console/license_settings/starter_edition/starter_right_panel.tsx +++ b/webapp/channels/src/components/admin_console/license_settings/starter_edition/starter_right_panel.tsx @@ -4,9 +4,9 @@ import React, {memo} from 'react'; import {FormattedMessage} from 'react-intl'; -import WomanUpArrowsAndCloudsSvg from 'components/common/svg_images_components/woman_up_arrows_and_clouds_svg'; -import PurchaseLink from 'components/announcement_bar/purchase_link/purchase_link'; import ContactUsButton from 'components/announcement_bar/contact_sales/contact_us'; +import PurchaseLink from 'components/announcement_bar/purchase_link/purchase_link'; +import WomanUpArrowsAndCloudsSvg from 'components/common/svg_images_components/woman_up_arrows_and_clouds_svg'; const StarterRightPanel = () => { const upgradeAdvantages = [ diff --git a/webapp/channels/src/components/admin_console/license_settings/team_edition/team_edition_right_panel.tsx b/webapp/channels/src/components/admin_console/license_settings/team_edition/team_edition_right_panel.tsx index e59d8ae680..49b45436c3 100644 --- a/webapp/channels/src/components/admin_console/license_settings/team_edition/team_edition_right_panel.tsx +++ b/webapp/channels/src/components/admin_console/license_settings/team_edition/team_edition_right_panel.tsx @@ -4,12 +4,12 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import LoadingWrapper from 'components/widgets/loading/loading_wrapper'; -import FormattedMarkdownMessage from 'components/formatted_markdown_message'; - -import {localizeMessage} from 'utils/utils'; -import {format} from 'utils/markdown'; import WomanUpArrowsAndCloudsSvg from 'components/common/svg_images_components/woman_up_arrows_and_clouds_svg'; +import FormattedMarkdownMessage from 'components/formatted_markdown_message'; +import LoadingWrapper from 'components/widgets/loading/loading_wrapper'; + +import {format} from 'utils/markdown'; +import {localizeMessage} from 'utils/utils'; interface TeamEditionRightPanelProps { upgradingPercentage: number; diff --git a/webapp/channels/src/components/admin_console/license_settings/trial_banner/trial_banner.tsx b/webapp/channels/src/components/admin_console/license_settings/trial_banner/trial_banner.tsx index 17f13e3861..cc54554050 100644 --- a/webapp/channels/src/components/admin_console/license_settings/trial_banner/trial_banner.tsx +++ b/webapp/channels/src/components/admin_console/license_settings/trial_banner/trial_banner.tsx @@ -1,28 +1,30 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {useEffect, useState, ReactNode} from 'react'; +import React, {useEffect, useState} from 'react'; +import type {ReactNode} from 'react'; import {FormattedMessage, useIntl} from 'react-intl'; import {useDispatch, useSelector} from 'react-redux'; +import type {PreferenceType} from '@mattermost/types/preferences'; + import {savePreferences} from 'mattermost-redux/actions/preferences'; -import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users'; -import {PreferenceType} from '@mattermost/types/preferences'; import {makeGetCategory} from 'mattermost-redux/selectors/entities/preferences'; +import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users'; + +import store from 'stores/redux_store.jsx'; import AlertBanner from 'components/alert_banner'; -import LoadingWrapper from 'components/widgets/loading/loading_wrapper'; -import FormattedMarkdownMessage from 'components/formatted_markdown_message'; import withOpenStartTrialFormModal from 'components/common/hocs/cloud/with_open_start_trial_form_modal'; -import {TelemetryProps} from 'components/common/hooks/useOpenPricingModal'; - -import {format} from 'utils/markdown'; +import type {TelemetryProps} from 'components/common/hooks/useOpenPricingModal'; +import ExternalLink from 'components/external_link'; +import FormattedMarkdownMessage from 'components/formatted_markdown_message'; +import LoadingWrapper from 'components/widgets/loading/loading_wrapper'; import {AboutLinks, LicenseLinks, Preferences, Unique} from 'utils/constants'; +import {format} from 'utils/markdown'; -import {GlobalState} from 'types/store'; -import store from 'stores/redux_store.jsx'; -import ExternalLink from 'components/external_link'; +import type {GlobalState} from 'types/store'; interface TrialBannerProps { isDisabled: boolean; diff --git a/webapp/channels/src/components/admin_console/license_settings/trial_license_card/trial_license_card.tsx b/webapp/channels/src/components/admin_console/license_settings/trial_license_card/trial_license_card.tsx index e619045e14..109387131b 100644 --- a/webapp/channels/src/components/admin_console/license_settings/trial_license_card/trial_license_card.tsx +++ b/webapp/channels/src/components/admin_console/license_settings/trial_license_card/trial_license_card.tsx @@ -1,20 +1,20 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import moment from 'moment'; import React from 'react'; import {FormattedMessage} from 'react-intl'; -import moment from 'moment'; -import {ClientLicense} from '@mattermost/types/config'; +import type {ClientLicense} from '@mattermost/types/config'; + +import AlertBanner from 'components/alert_banner'; +import ContactUsButton from 'components/announcement_bar/contact_sales/contact_us'; +import PurchaseLink from 'components/announcement_bar/purchase_link/purchase_link'; +import FormattedMarkdownMessage from 'components/formatted_markdown_message'; import {daysToLicenseExpire} from 'utils/license_utils'; import {getBrowserTimezone} from 'utils/timezone'; -import FormattedMarkdownMessage from 'components/formatted_markdown_message'; -import PurchaseLink from 'components/announcement_bar/purchase_link/purchase_link'; -import ContactUsButton from 'components/announcement_bar/contact_sales/contact_us'; -import AlertBanner from 'components/alert_banner'; - import './trial_license_card.scss'; export interface Props { diff --git a/webapp/channels/src/components/admin_console/manage_roles_modal/index.ts b/webapp/channels/src/components/admin_console/manage_roles_modal/index.ts index 43097a8556..832e8dc6cd 100644 --- a/webapp/channels/src/components/admin_console/manage_roles_modal/index.ts +++ b/webapp/channels/src/components/admin_console/manage_roles_modal/index.ts @@ -2,15 +2,16 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {bindActionCreators, Dispatch, ActionCreatorsMapObject} from 'redux'; - -import {GenericAction, ActionFunc} from 'mattermost-redux/types/actions'; +import {bindActionCreators} from 'redux'; +import type {Dispatch, ActionCreatorsMapObject} from 'redux'; import {updateUserRoles} from 'mattermost-redux/actions/users'; +import type {GenericAction, ActionFunc} from 'mattermost-redux/types/actions'; -import {GlobalState} from 'types/store'; +import type {GlobalState} from 'types/store'; -import ManageRolesModal, {Props} from './manage_roles_modal'; +import ManageRolesModal from './manage_roles_modal'; +import type {Props} from './manage_roles_modal'; function mapStateToProps(state: GlobalState) { return { diff --git a/webapp/channels/src/components/admin_console/manage_roles_modal/manage_roles_modal.tsx b/webapp/channels/src/components/admin_console/manage_roles_modal/manage_roles_modal.tsx index 1e43555f93..ff7e257930 100644 --- a/webapp/channels/src/components/admin_console/manage_roles_modal/manage_roles_modal.tsx +++ b/webapp/channels/src/components/admin_console/manage_roles_modal/manage_roles_modal.tsx @@ -5,21 +5,23 @@ import React from 'react'; import {Modal} from 'react-bootstrap'; import {FormattedMessage} from 'react-intl'; -import BotTag from 'components/widgets/tag/bot_tag'; +import type {UserProfile} from '@mattermost/types/users'; import {Client4} from 'mattermost-redux/client'; import {General} from 'mattermost-redux/constants'; -import {ActionResult} from 'mattermost-redux/types/actions'; -import {UserProfile} from '@mattermost/types/users'; +import type {ActionResult} from 'mattermost-redux/types/actions'; import * as UserUtils from 'mattermost-redux/utils/user_utils'; import {trackEvent} from 'actions/telemetry_actions.jsx'; -import Avatar from 'components/widgets/users/avatar'; -import {isSuccess} from 'types/actions'; import ExternalLink from 'components/external_link'; +import BotTag from 'components/widgets/tag/bot_tag'; +import Avatar from 'components/widgets/users/avatar'; + import {DeveloperLinks} from 'utils/constants'; +import {isSuccess} from 'types/actions'; + export type Props = { show: boolean; user?: UserProfile; diff --git a/webapp/channels/src/components/admin_console/manage_teams_modal/index.tsx b/webapp/channels/src/components/admin_console/manage_teams_modal/index.tsx index 09d3eca311..d14495b549 100644 --- a/webapp/channels/src/components/admin_console/manage_teams_modal/index.tsx +++ b/webapp/channels/src/components/admin_console/manage_teams_modal/index.tsx @@ -2,15 +2,18 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; + +import {updateTeamMemberSchemeRoles, getTeamMembersForUser, getTeamsForUser, removeUserFromTeam} from 'mattermost-redux/actions/teams'; +import type {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; import {getCurrentLocale} from 'selectors/i18n'; -import {updateTeamMemberSchemeRoles, getTeamMembersForUser, getTeamsForUser, removeUserFromTeam} from 'mattermost-redux/actions/teams'; -import {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; -import {GlobalState} from 'types/store'; +import type {GlobalState} from 'types/store'; -import ManageTeamsModal, {Props} from './manage_teams_modal'; +import ManageTeamsModal from './manage_teams_modal'; +import type {Props} from './manage_teams_modal'; function mapStateToProps(state: GlobalState) { return { diff --git a/webapp/channels/src/components/admin_console/manage_teams_modal/manage_teams_dropdown.test.tsx b/webapp/channels/src/components/admin_console/manage_teams_modal/manage_teams_dropdown.test.tsx index cca2c93005..0721f62420 100644 --- a/webapp/channels/src/components/admin_console/manage_teams_modal/manage_teams_dropdown.test.tsx +++ b/webapp/channels/src/components/admin_console/manage_teams_modal/manage_teams_dropdown.test.tsx @@ -1,10 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import ManageTeamsDropdown from 'components/admin_console/manage_teams_modal/manage_teams_dropdown'; + import {TestHelper} from 'utils/test_helper'; describe('ManageTeamsDropdown', () => { diff --git a/webapp/channels/src/components/admin_console/manage_teams_modal/manage_teams_dropdown.tsx b/webapp/channels/src/components/admin_console/manage_teams_modal/manage_teams_dropdown.tsx index d97434725f..7aba33d2fa 100644 --- a/webapp/channels/src/components/admin_console/manage_teams_modal/manage_teams_dropdown.tsx +++ b/webapp/channels/src/components/admin_console/manage_teams_modal/manage_teams_dropdown.tsx @@ -2,19 +2,19 @@ // See LICENSE.txt for license information. import React from 'react'; - import {FormattedMessage} from 'react-intl'; +import type {Team, TeamMembership} from '@mattermost/types/teams'; +import type {UserProfile} from '@mattermost/types/users'; + +import type {ActionResult} from 'mattermost-redux/types/actions'; import {isAdmin, isSystemAdmin, isGuest} from 'mattermost-redux/utils/user_utils'; -import {UserProfile} from '@mattermost/types/users'; -import {Team, TeamMembership} from '@mattermost/types/teams'; -import {ActionResult} from 'mattermost-redux/types/actions'; + +import Menu from 'components/widgets/menu/menu'; +import MenuWrapper from 'components/widgets/menu/menu_wrapper'; import {localizeMessage} from 'utils/utils'; -import MenuWrapper from 'components/widgets/menu/menu_wrapper'; -import Menu from 'components/widgets/menu/menu'; - type Props = { team: Team; user: UserProfile; diff --git a/webapp/channels/src/components/admin_console/manage_teams_modal/manage_teams_modal.test.tsx b/webapp/channels/src/components/admin_console/manage_teams_modal/manage_teams_modal.test.tsx index 7b2397c50f..27ee0c0310 100644 --- a/webapp/channels/src/components/admin_console/manage_teams_modal/manage_teams_modal.test.tsx +++ b/webapp/channels/src/components/admin_console/manage_teams_modal/manage_teams_modal.test.tsx @@ -1,12 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import type {ReactWrapper} from 'enzyme'; +import {mount, shallow} from 'enzyme'; import React from 'react'; -import {mount, ReactWrapper, shallow} from 'enzyme'; - -import {IntlProvider} from 'react-intl'; - import {act} from 'react-dom/test-utils'; +import {IntlProvider} from 'react-intl'; import {General} from 'mattermost-redux/constants'; diff --git a/webapp/channels/src/components/admin_console/manage_teams_modal/manage_teams_modal.tsx b/webapp/channels/src/components/admin_console/manage_teams_modal/manage_teams_modal.tsx index 54f78aaf19..565fc111e8 100644 --- a/webapp/channels/src/components/admin_console/manage_teams_modal/manage_teams_modal.tsx +++ b/webapp/channels/src/components/admin_console/manage_teams_modal/manage_teams_modal.tsx @@ -5,20 +5,21 @@ import React, {useEffect} from 'react'; import {Modal} from 'react-bootstrap'; import {FormattedMessage} from 'react-intl'; -import {filterAndSortTeamsByDisplayName} from 'utils/team_utils'; -import * as Utils from 'utils/utils'; +import type {Team, TeamMembership} from '@mattermost/types/teams'; +import type {UserProfile} from '@mattermost/types/users'; + +import {Client4} from 'mattermost-redux/client'; +import type {ActionResult} from 'mattermost-redux/types/actions'; +import {isAdmin} from 'mattermost-redux/utils/user_utils'; import LoadingScreen from 'components/loading_screen'; import Avatar from 'components/widgets/users/avatar'; -import {Client4} from 'mattermost-redux/client'; -import {isAdmin} from 'mattermost-redux/utils/user_utils'; -import {UserProfile} from '@mattermost/types/users'; -import {ActionResult} from 'mattermost-redux/types/actions'; -import {Team, TeamMembership} from '@mattermost/types/teams'; +import {filterAndSortTeamsByDisplayName} from 'utils/team_utils'; +import * as Utils from 'utils/utils'; -import RemoveFromTeamButton from './remove_from_team_button'; import ManageTeamsDropdown from './manage_teams_dropdown'; +import RemoveFromTeamButton from './remove_from_team_button'; export type Props = { locale: string; diff --git a/webapp/channels/src/components/admin_console/manage_teams_modal/remove_from_team_button.test.tsx b/webapp/channels/src/components/admin_console/manage_teams_modal/remove_from_team_button.test.tsx index f258511146..ff8bae21b8 100644 --- a/webapp/channels/src/components/admin_console/manage_teams_modal/remove_from_team_button.test.tsx +++ b/webapp/channels/src/components/admin_console/manage_teams_modal/remove_from_team_button.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import RemoveFromTeamButton from 'components/admin_console/manage_teams_modal/remove_from_team_button'; diff --git a/webapp/channels/src/components/admin_console/manage_tokens_modal/index.ts b/webapp/channels/src/components/admin_console/manage_tokens_modal/index.ts index f9a397f066..a6f01bb203 100644 --- a/webapp/channels/src/components/admin_console/manage_tokens_modal/index.ts +++ b/webapp/channels/src/components/admin_console/manage_tokens_modal/index.ts @@ -2,14 +2,16 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; import {getUserAccessTokensForUser} from 'mattermost-redux/actions/users'; -import {ActionFunc} from 'mattermost-redux/types/actions'; +import type {ActionFunc} from 'mattermost-redux/types/actions'; -import {GlobalState} from 'types/store'; +import type {GlobalState} from 'types/store'; -import ManageTokensModal, {Props} from './manage_tokens_modal'; +import ManageTokensModal from './manage_tokens_modal'; +import type {Props} from './manage_tokens_modal'; function mapStateToProps(state: GlobalState, ownProps: Props) { const userId = ownProps.user ? ownProps.user.id : ''; diff --git a/webapp/channels/src/components/admin_console/manage_tokens_modal/manage_tokens_modal.test.tsx b/webapp/channels/src/components/admin_console/manage_tokens_modal/manage_tokens_modal.test.tsx index dca3fe6d04..3465c05206 100644 --- a/webapp/channels/src/components/admin_console/manage_tokens_modal/manage_tokens_modal.test.tsx +++ b/webapp/channels/src/components/admin_console/manage_tokens_modal/manage_tokens_modal.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import {TestHelper} from 'utils/test_helper'; diff --git a/webapp/channels/src/components/admin_console/manage_tokens_modal/manage_tokens_modal.tsx b/webapp/channels/src/components/admin_console/manage_tokens_modal/manage_tokens_modal.tsx index 2f0b01c2a8..66c283461d 100644 --- a/webapp/channels/src/components/admin_console/manage_tokens_modal/manage_tokens_modal.tsx +++ b/webapp/channels/src/components/admin_console/manage_tokens_modal/manage_tokens_modal.tsx @@ -5,15 +5,17 @@ import React from 'react'; import {Modal} from 'react-bootstrap'; import {FormattedMessage} from 'react-intl'; +import type {UserAccessToken, UserProfile} from '@mattermost/types/users'; + import {Client4} from 'mattermost-redux/client'; -import {UserAccessToken, UserProfile} from '@mattermost/types/users'; -import {ActionFunc} from 'mattermost-redux/types/actions'; +import type {ActionFunc} from 'mattermost-redux/types/actions'; import * as UserUtils from 'mattermost-redux/utils/user_utils'; import RevokeTokenButton from 'components/admin_console/revoke_token_button'; +import ExternalLink from 'components/external_link'; import LoadingScreen from 'components/loading_screen'; import Avatar from 'components/widgets/users/avatar'; -import ExternalLink from 'components/external_link'; + import {DeveloperLinks} from 'utils/constants'; export type Props = { diff --git a/webapp/channels/src/components/admin_console/member_list_group/index.ts b/webapp/channels/src/components/admin_console/member_list_group/index.ts index 159b9bbd05..00d2132d30 100644 --- a/webapp/channels/src/components/admin_console/member_list_group/index.ts +++ b/webapp/channels/src/components/admin_console/member_list_group/index.ts @@ -2,21 +2,21 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {bindActionCreators, Dispatch, ActionCreatorsMapObject} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch, ActionCreatorsMapObject} from 'redux'; import {getGroupStats} from 'mattermost-redux/actions/groups'; import {searchProfiles, getProfilesInGroup} from 'mattermost-redux/actions/users'; - import {getGroupMemberCount} from 'mattermost-redux/selectors/entities/groups'; import {getProfilesInGroup as selectProfiles, searchProfilesInGroup} from 'mattermost-redux/selectors/entities/users'; - -import {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; +import type {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; import {setModalSearchTerm} from 'actions/views/search'; -import {GlobalState} from 'types/store'; +import type {GlobalState} from 'types/store'; -import MemberListGroup, {Props as MemberListGroupProps} from './member_list_group'; +import MemberListGroup from './member_list_group'; +import type {Props as MemberListGroupProps} from './member_list_group'; type Props = { groupID: string; diff --git a/webapp/channels/src/components/admin_console/member_list_group/member_list_group.test.tsx b/webapp/channels/src/components/admin_console/member_list_group/member_list_group.test.tsx index 4f27bbe7b9..c2d859d7c2 100644 --- a/webapp/channels/src/components/admin_console/member_list_group/member_list_group.test.tsx +++ b/webapp/channels/src/components/admin_console/member_list_group/member_list_group.test.tsx @@ -1,11 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; import {range} from 'lodash'; +import React from 'react'; -import {TestHelper} from '../../../utils/test_helper'; +import {TestHelper} from 'utils/test_helper'; import MemberListGroup from './member_list_group'; diff --git a/webapp/channels/src/components/admin_console/member_list_group/member_list_group.tsx b/webapp/channels/src/components/admin_console/member_list_group/member_list_group.tsx index 96c8fb06fc..26c6737536 100644 --- a/webapp/channels/src/components/admin_console/member_list_group/member_list_group.tsx +++ b/webapp/channels/src/components/admin_console/member_list_group/member_list_group.tsx @@ -4,12 +4,14 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {UserProfile} from '@mattermost/types/users'; -import {GroupStats} from '@mattermost/types/groups'; +import type {GroupStats} from '@mattermost/types/groups'; +import type {UserProfile} from '@mattermost/types/users'; + +import DataGrid from 'components/admin_console/data_grid/data_grid'; +import type {Row, Column} from 'components/admin_console/data_grid/data_grid'; +import UserGridName from 'components/admin_console/user_grid/user_grid_name'; import Constants from 'utils/constants'; -import UserGridName from 'components/admin_console/user_grid/user_grid_name'; -import DataGrid, {Row, Column} from 'components/admin_console/data_grid/data_grid'; const USERS_PER_PAGE = 10; diff --git a/webapp/channels/src/components/admin_console/message_export_settings.jsx b/webapp/channels/src/components/admin_console/message_export_settings.jsx index 15b89f4cea..3caba72f09 100644 --- a/webapp/channels/src/components/admin_console/message_export_settings.jsx +++ b/webapp/channels/src/components/admin_console/message_export_settings.jsx @@ -4,21 +4,20 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; +import ExternalLink from 'components/external_link'; import FormattedMarkdownMessage from 'components/formatted_markdown_message'; import {DocLinks, JobTypes, exportFormats} from 'utils/constants'; -import * as Utils from 'utils/utils'; import {getSiteURL} from 'utils/url'; - -import ExternalLink from 'components/external_link'; +import * as Utils from 'utils/utils'; import AdminSettings from './admin_settings'; import BooleanSetting from './boolean_setting'; import DropdownSetting from './dropdown_setting'; import JobsTable from './jobs'; +import RadioSetting from './radio_setting'; import SettingsGroup from './settings_group'; import TextSetting from './text_setting'; -import RadioSetting from './radio_setting'; export default class MessageExportSettings extends AdminSettings { getConfigFromState = (config) => { diff --git a/webapp/channels/src/components/admin_console/message_export_settings.test.jsx b/webapp/channels/src/components/admin_console/message_export_settings.test.jsx index a2ffc3c9a5..d9a5a38ac9 100644 --- a/webapp/channels/src/components/admin_console/message_export_settings.test.jsx +++ b/webapp/channels/src/components/admin_console/message_export_settings.test.jsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import MessageExportSettings from 'components/admin_console/message_export_settings.jsx'; diff --git a/webapp/channels/src/components/admin_console/multiselect_settings.tsx b/webapp/channels/src/components/admin_console/multiselect_settings.tsx index 74d17edffd..b058256de2 100644 --- a/webapp/channels/src/components/admin_console/multiselect_settings.tsx +++ b/webapp/channels/src/components/admin_console/multiselect_settings.tsx @@ -2,7 +2,8 @@ // See LICENSE.txt for license information. import React from 'react'; -import ReactSelect, {ValueType} from 'react-select'; +import ReactSelect from 'react-select'; +import type {ValueType} from 'react-select'; import FormError from 'components/form_error'; diff --git a/webapp/channels/src/components/admin_console/openid_convert/index.ts b/webapp/channels/src/components/admin_console/openid_convert/index.ts index 52147433d8..04e5a5d2f1 100644 --- a/webapp/channels/src/components/admin_console/openid_convert/index.ts +++ b/webapp/channels/src/components/admin_console/openid_convert/index.ts @@ -2,11 +2,13 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {bindActionCreators, Dispatch, ActionCreatorsMapObject} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch, ActionCreatorsMapObject} from 'redux'; + +import type {AdminConfig} from '@mattermost/types/config'; import {updateConfig} from 'mattermost-redux/actions/admin'; -import {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; -import {AdminConfig} from '@mattermost/types/config'; +import type {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; import OpenIdConvert from './openid_convert'; diff --git a/webapp/channels/src/components/admin_console/openid_convert/openid_convert.test.tsx b/webapp/channels/src/components/admin_console/openid_convert/openid_convert.test.tsx index d04a1ccbeb..91f2ba3258 100644 --- a/webapp/channels/src/components/admin_console/openid_convert/openid_convert.test.tsx +++ b/webapp/channels/src/components/admin_console/openid_convert/openid_convert.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import OpenIdConvert from 'components/admin_console/openid_convert/openid_convert'; diff --git a/webapp/channels/src/components/admin_console/openid_convert/openid_convert.tsx b/webapp/channels/src/components/admin_console/openid_convert/openid_convert.tsx index 3cba4ddb41..93969ddc2f 100644 --- a/webapp/channels/src/components/admin_console/openid_convert/openid_convert.tsx +++ b/webapp/channels/src/components/admin_console/openid_convert/openid_convert.tsx @@ -2,24 +2,21 @@ // See LICENSE.txt for license information. import React from 'react'; - import {FormattedMessage} from 'react-intl'; -import {ActionFunc} from 'mattermost-redux/types/actions'; +import type {AdminConfig} from '@mattermost/types/config'; -import {AdminConfig} from '@mattermost/types/config'; - -import {BaseProps} from 'components/admin_console/admin_settings'; - -import {getHistory} from 'utils/browser_history'; -import {Constants} from 'utils/constants'; +import type {ActionFunc} from 'mattermost-redux/types/actions'; +import type {BaseProps} from 'components/admin_console/admin_settings'; +import ExternalLink from 'components/external_link'; import FormError from 'components/form_error'; import imagePath from 'images/openid-convert/emoticon-outline.svg'; +import {getHistory} from 'utils/browser_history'; +import {Constants} from 'utils/constants'; import './openid_convert.scss'; -import ExternalLink from 'components/external_link'; type Props = BaseProps & { disabled?: boolean; diff --git a/webapp/channels/src/components/admin_console/password_settings.tsx b/webapp/channels/src/components/admin_console/password_settings.tsx index 5b7e7c5bd1..b3389c375c 100644 --- a/webapp/channels/src/components/admin_console/password_settings.tsx +++ b/webapp/channels/src/components/admin_console/password_settings.tsx @@ -4,19 +4,20 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {AdminConfig} from '@mattermost/types/config'; -import {DeepPartial} from '@mattermost/types/utilities'; +import type {AdminConfig} from '@mattermost/types/config'; +import type {DeepPartial} from '@mattermost/types/utilities'; import Constants from 'utils/constants'; -import * as Utils from 'utils/utils'; import {t} from 'utils/i18n'; +import * as Utils from 'utils/utils'; -import AdminSettings, {BaseProps, BaseState} from './admin_settings'; +import AdminSettings from './admin_settings'; +import type {BaseProps, BaseState} from './admin_settings'; +import BlockableLink from './blockable_link'; import BooleanSetting from './boolean_setting'; import Setting from './setting'; import SettingsGroup from './settings_group'; import TextSetting from './text_setting'; -import BlockableLink from './blockable_link'; type Props = BaseProps & { config: AdminConfig; diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/edit_post_time_limit_button/index.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/edit_post_time_limit_button/index.tsx index 997bd7754e..4e1a33dc14 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/edit_post_time_limit_button/index.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/edit_post_time_limit_button/index.tsx @@ -5,10 +5,10 @@ import {connect} from 'react-redux'; import {getConfig} from 'mattermost-redux/selectors/entities/general'; -import {GlobalState} from 'types/store'; - import {Constants} from 'utils/constants'; +import type {GlobalState} from 'types/store'; + import EditPostTimeLimitButton from './edit_post_time_limit_button'; function mapStateToProps(state: GlobalState) { diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/edit_post_time_limit_modal/edit_post_time_limit_modal.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/edit_post_time_limit_modal/edit_post_time_limit_modal.tsx index 2a43671e41..28f0e8aa77 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/edit_post_time_limit_modal/edit_post_time_limit_modal.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/edit_post_time_limit_modal/edit_post_time_limit_modal.tsx @@ -2,16 +2,18 @@ // See LICENSE.txt for license information. import React, {useState} from 'react'; -import {FormattedMessage} from 'react-intl'; import {Modal} from 'react-bootstrap'; +import {FormattedMessage} from 'react-intl'; -import {AdminConfig} from '@mattermost/types/config'; -import {ActionFunc} from 'mattermost-redux/types/actions'; +import type {AdminConfig} from '@mattermost/types/config'; + +import type {ActionFunc} from 'mattermost-redux/types/actions'; import FormattedMarkdownMessage from 'components/formatted_markdown_message'; + import {Constants} from 'utils/constants'; -import {localizeMessage} from 'utils/utils'; import {t} from 'utils/i18n'; +import {localizeMessage} from 'utils/utils'; const INT32_MAX = 2147483647; diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/edit_post_time_limit_modal/index.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/edit_post_time_limit_modal/index.tsx index 6fa16121ec..34a1b76b0a 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/edit_post_time_limit_modal/index.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/edit_post_time_limit_modal/index.tsx @@ -2,14 +2,16 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; + +import type {AdminConfig} from '@mattermost/types/config'; import {updateConfig} from 'mattermost-redux/actions/admin'; import {getConfig} from 'mattermost-redux/selectors/entities/admin'; -import {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; -import {AdminConfig} from '@mattermost/types/config'; +import type {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; -import {GlobalState} from 'types/store'; +import type {GlobalState} from 'types/store'; import EditPostTimeLimitModal from './edit_post_time_limit_modal'; diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/guest_permissions_tree/guest_permissions_tree.test.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/guest_permissions_tree/guest_permissions_tree.test.tsx index 26e738e84a..a59067507d 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/guest_permissions_tree/guest_permissions_tree.test.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/guest_permissions_tree/guest_permissions_tree.test.tsx @@ -1,12 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; - -import PermissionGroup from 'components/admin_console/permission_schemes_settings/permission_group'; +import React from 'react'; import GuestPermissionsTree from 'components/admin_console/permission_schemes_settings/guest_permissions_tree/guest_permissions_tree'; +import PermissionGroup from 'components/admin_console/permission_schemes_settings/permission_group'; import {TestHelper} from 'utils/test_helper'; diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/guest_permissions_tree/guest_permissions_tree.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/guest_permissions_tree/guest_permissions_tree.tsx index ad538302ca..6fa2c52ecd 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/guest_permissions_tree/guest_permissions_tree.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/guest_permissions_tree/guest_permissions_tree.tsx @@ -4,14 +4,15 @@ import React, {useCallback, useMemo} from 'react'; import {FormattedMessage} from 'react-intl'; -import Permissions from 'mattermost-redux/constants/permissions'; -import {Role} from '@mattermost/types/roles'; -import {ClientLicense} from '@mattermost/types/config'; -import {Permissions as PermissionsType} from '../permissions_tree/types'; +import type {ClientLicense} from '@mattermost/types/config'; +import type {Role} from '@mattermost/types/roles'; + +import Permissions from 'mattermost-redux/constants/permissions'; -import PermissionGroup from '../permission_group'; import EditPostTimeLimitButton from '../edit_post_time_limit_button'; import EditPostTimeLimitModal from '../edit_post_time_limit_modal'; +import PermissionGroup from '../permission_group'; +import type {Permissions as PermissionsType} from '../permissions_tree/types'; type Props = { license: ClientLicense; diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/guest_permissions_tree/index.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/guest_permissions_tree/index.tsx index 79f79eb537..04b7cbae20 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/guest_permissions_tree/index.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/guest_permissions_tree/index.tsx @@ -3,11 +3,10 @@ import {connect} from 'react-redux'; +import Permissions from 'mattermost-redux/constants/permissions'; import {getLicense} from 'mattermost-redux/selectors/entities/general'; -import {GlobalState} from 'types/store'; - -import Permissions from 'mattermost-redux/constants/permissions'; +import type {GlobalState} from 'types/store'; import GuestPermissionsTree from './guest_permissions_tree'; diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/index.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/index.tsx index 65a86c9c4d..0200602dab 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/index.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/index.tsx @@ -2,17 +2,18 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; import {getSchemeTeams as loadSchemeTeams, getSchemes as loadSchemes} from 'mattermost-redux/actions/schemes'; -import {getSchemes} from 'mattermost-redux/selectors/entities/schemes'; import {getConfig} from 'mattermost-redux/selectors/entities/general'; +import {getSchemes} from 'mattermost-redux/selectors/entities/schemes'; +import type {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; -import {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; +import type {GlobalState} from 'types/store'; -import {GlobalState} from 'types/store'; - -import PermissionSchemesSettings, {Props} from './permission_schemes_settings'; +import PermissionSchemesSettings from './permission_schemes_settings'; +import type {Props} from './permission_schemes_settings'; function mapStateToProps(state: GlobalState) { const schemes = getSchemes(state); diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_checkbox.test.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_checkbox.test.tsx index a1a2b64946..7500c13694 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_checkbox.test.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_checkbox.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import PermissionCheckbox from 'components/admin_console/permission_schemes_settings/permission_checkbox'; diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_description.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_description.tsx index 4ba4eefec9..d9ca0f13b2 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_description.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_description.tsx @@ -1,18 +1,19 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {useState, useRef, MouseEvent} from 'react'; -import {FormattedMessage, useIntl} from 'react-intl'; +import React, {useState, useRef} from 'react'; +import type {MouseEvent} from 'react'; import {Overlay} from 'react-bootstrap'; +import {FormattedMessage, useIntl} from 'react-intl'; + +import type {Role} from '@mattermost/types/roles'; import FormattedMarkdownMessage from 'components/formatted_markdown_message'; import Tooltip from 'components/tooltip'; import {generateId} from 'utils/utils'; -import {Role} from '@mattermost/types/roles'; - -import {AdditionalValues} from './permissions_tree/types'; +import type {AdditionalValues} from './permissions_tree/types'; type Props = { id: string; diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_group.test.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_group.test.tsx index 9f3e9f63f0..a32393ebc9 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_group.test.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_group.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import PermissionGroup from 'components/admin_console/permission_schemes_settings/permission_group'; diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_group.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_group.tsx index 135ce5c53c..61023a4b94 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_group.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_group.tsx @@ -1,17 +1,18 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {MouseEvent} from 'react'; +import React from 'react'; +import type {MouseEvent} from 'react'; import {FormattedMessage} from 'react-intl'; +import type {Role} from '@mattermost/types/roles'; + import {PermissionsScope} from 'utils/constants'; -import {Role} from '@mattermost/types/roles'; - import PermissionCheckbox from './permission_checkbox'; -import PermissionRow from './permission_row'; import PermissionDescription from './permission_description'; -import {AdditionalValues, Permission, Permissions} from './permissions_tree/types'; +import PermissionRow from './permission_row'; +import type {AdditionalValues, Permission, Permissions} from './permissions_tree/types'; type Props = { id: string; diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_row.test.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_row.test.tsx index c07f46f66e..6eeeb5c013 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_row.test.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_row.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import PermissionRow from 'components/admin_console/permission_schemes_settings/permission_row'; diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_row.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_row.tsx index f465377806..53c1104167 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_row.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_row.tsx @@ -4,11 +4,11 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {Role} from '@mattermost/types/roles'; +import type {Role} from '@mattermost/types/roles'; import PermissionCheckbox from './permission_checkbox'; import PermissionDescription from './permission_description'; -import {AdditionalValues} from './permissions_tree/types'; +import type {AdditionalValues} from './permissions_tree/types'; type Props = { id: string; diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_schemes_settings.test.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_schemes_settings.test.tsx index 91dec8390b..1c0fa48d26 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_schemes_settings.test.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_schemes_settings.test.tsx @@ -1,13 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {ComponentProps} from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; +import type {ComponentProps} from 'react'; +import type {RouteComponentProps} from 'react-router-dom'; -import {RouteComponentProps} from 'react-router-dom'; +import type {Scheme} from '@mattermost/types/schemes'; import PermissionSchemesSettings from 'components/admin_console/permission_schemes_settings/permission_schemes_settings'; -import {Scheme} from '@mattermost/types/schemes'; describe('components/admin_console/permission_schemes_settings/permission_schemes_settings', () => { const defaultProps: ComponentProps = { diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_schemes_settings.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_schemes_settings.tsx index 760490c356..9f9b3776e4 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_schemes_settings.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_schemes_settings.tsx @@ -3,20 +3,20 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {RouteComponentProps} from 'react-router-dom'; +import type {RouteComponentProps} from 'react-router-dom'; -import {Scheme, SchemeScope, SchemesState} from '@mattermost/types/schemes'; +import type {Scheme, SchemeScope, SchemesState} from '@mattermost/types/schemes'; -import {ActionResult} from 'mattermost-redux/types/actions'; +import type {ActionResult} from 'mattermost-redux/types/actions'; -import LoadingScreen from 'components/loading_screen'; -import LoadingWrapper from 'components/widgets/loading/loading_wrapper'; -import AdminPanelWithLink from 'components/widgets/admin_console/admin_panel_with_link'; import ExternalLink from 'components/external_link'; +import LoadingScreen from 'components/loading_screen'; import AdminHeader from 'components/widgets/admin_console/admin_header'; +import AdminPanelWithLink from 'components/widgets/admin_console/admin_panel_with_link'; +import LoadingWrapper from 'components/widgets/loading/loading_wrapper'; -import {t} from 'utils/i18n'; import {DocLinks, LicenseSkus} from 'utils/constants'; +import {t} from 'utils/i18n'; import * as Utils from 'utils/utils'; import PermissionsSchemeSummary from './permissions_scheme_summary'; diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_system_scheme_settings/index.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_system_scheme_settings/index.tsx index 34ad8979f9..908a450a0d 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_system_scheme_settings/index.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_system_scheme_settings/index.tsx @@ -2,15 +2,16 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; -import {GlobalState} from '@mattermost/types/store'; -import {ActionFunc, ActionResult, GenericAction} from 'mattermost-redux/types/actions.js'; -import {Role} from '@mattermost/types/roles'; +import type {Role} from '@mattermost/types/roles'; +import type {GlobalState} from '@mattermost/types/store'; import {loadRolesIfNeeded, editRole} from 'mattermost-redux/actions/roles'; -import {getRoles} from 'mattermost-redux/selectors/entities/roles'; import {getLicense, getConfig} from 'mattermost-redux/selectors/entities/general'; +import {getRoles} from 'mattermost-redux/selectors/entities/roles'; +import type {ActionFunc, ActionResult, GenericAction} from 'mattermost-redux/types/actions.js'; import {setNavigationBlocked} from 'actions/admin_actions.jsx'; diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_system_scheme_settings/permission_system_scheme_settings.test.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_system_scheme_settings/permission_system_scheme_settings.test.tsx index 54a8c23ea7..499c304e3d 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_system_scheme_settings/permission_system_scheme_settings.test.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_system_scheme_settings/permission_system_scheme_settings.test.tsx @@ -1,10 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; -import {Role} from '@mattermost/types/roles'; +import type {Role} from '@mattermost/types/roles'; import PermissionSystemSchemeSettings from 'components/admin_console/permission_schemes_settings/permission_system_scheme_settings/permission_system_scheme_settings'; diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_system_scheme_settings/permission_system_scheme_settings.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_system_scheme_settings/permission_system_scheme_settings.tsx index 1b5a21dcee..2e3992b7d9 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_system_scheme_settings/permission_system_scheme_settings.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_system_scheme_settings/permission_system_scheme_settings.tsx @@ -4,27 +4,27 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {ClientConfig, ClientLicense} from '@mattermost/types/config'; -import {Role} from '@mattermost/types/roles'; +import type {ClientConfig, ClientLicense} from '@mattermost/types/config'; +import type {Role} from '@mattermost/types/roles'; import GeneralConstants from 'mattermost-redux/constants/general'; -import {ActionResult} from 'mattermost-redux/types/actions'; +import type {ActionResult} from 'mattermost-redux/types/actions'; + +import BlockableLink from 'components/admin_console/blockable_link'; +import ConfirmModal from 'components/confirm_modal'; +import ExternalLink from 'components/external_link'; +import FormError from 'components/form_error'; +import LoadingScreen from 'components/loading_screen'; +import SaveButton from 'components/save_button'; +import AdminHeader from 'components/widgets/admin_console/admin_header'; +import AdminPanelTogglable from 'components/widgets/admin_console/admin_panel_togglable'; import {PermissionsScope, DefaultRolePermissions, DocLinks} from 'utils/constants'; -import {localizeMessage} from 'utils/utils'; import {t} from 'utils/i18n'; +import {localizeMessage} from 'utils/utils'; -import ConfirmModal from 'components/confirm_modal'; -import SaveButton from 'components/save_button'; -import LoadingScreen from 'components/loading_screen'; -import FormError from 'components/form_error'; -import BlockableLink from 'components/admin_console/blockable_link'; -import AdminPanelTogglable from 'components/widgets/admin_console/admin_panel_togglable'; -import ExternalLink from 'components/external_link'; -import AdminHeader from 'components/widgets/admin_console/admin_header'; - -import PermissionsTree, {EXCLUDED_PERMISSIONS} from '../permissions_tree'; import GuestPermissionsTree, {GUEST_INCLUDED_PERMISSIONS} from '../guest_permissions_tree'; +import PermissionsTree, {EXCLUDED_PERMISSIONS} from '../permissions_tree'; import PermissionsTreePlaybooks from '../permissions_tree_playbooks'; type Props = { diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_team_scheme_settings/index.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_team_scheme_settings/index.tsx index d2a1f2585e..f61a9fe00b 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_team_scheme_settings/index.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_team_scheme_settings/index.tsx @@ -2,27 +2,26 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; + +import type {ServerError} from '@mattermost/types/errors'; +import type {Role} from '@mattermost/types/roles'; +import type {Scheme, SchemePatch} from '@mattermost/types/schemes'; +import type {GlobalState} from '@mattermost/types/store'; import {loadRolesIfNeeded, editRole} from 'mattermost-redux/actions/roles'; - -import {getRoles} from 'mattermost-redux/selectors/entities/roles'; -import {getLicense, getConfig} from 'mattermost-redux/selectors/entities/general'; -import {getScheme, makeGetSchemeTeams} from 'mattermost-redux/selectors/entities/schemes'; - import {getScheme as loadScheme, patchScheme, createScheme, getSchemeTeams as loadSchemeTeams} from 'mattermost-redux/actions/schemes'; - import {updateTeamScheme} from 'mattermost-redux/actions/teams'; +import {getLicense, getConfig} from 'mattermost-redux/selectors/entities/general'; +import {getRoles} from 'mattermost-redux/selectors/entities/roles'; +import {getScheme, makeGetSchemeTeams} from 'mattermost-redux/selectors/entities/schemes'; +import type {ActionFunc, ActionResult, GenericAction} from 'mattermost-redux/types/actions'; import {setNavigationBlocked} from 'actions/admin_actions'; -import {ActionFunc, ActionResult, GenericAction} from 'mattermost-redux/types/actions'; -import {Role} from '@mattermost/types/roles'; -import {Scheme, SchemePatch} from '@mattermost/types/schemes'; -import {GlobalState} from '@mattermost/types/store'; -import {ServerError} from '@mattermost/types/errors'; - -import PermissionTeamSchemeSettings, {Props} from './permission_team_scheme_settings'; +import PermissionTeamSchemeSettings from './permission_team_scheme_settings'; +import type {Props} from './permission_team_scheme_settings'; type OwnProps = { match: { diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_team_scheme_settings/permission_team_scheme_settings.test.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_team_scheme_settings/permission_team_scheme_settings.test.tsx index 81d351c2eb..be20f1f7e4 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_team_scheme_settings/permission_team_scheme_settings.test.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_team_scheme_settings/permission_team_scheme_settings.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import PermissionTeamSchemeSettings from 'components/admin_console/permission_schemes_settings/permission_team_scheme_settings/permission_team_scheme_settings'; diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_team_scheme_settings/permission_team_scheme_settings.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_team_scheme_settings/permission_team_scheme_settings.tsx index d6c6c4a127..f9762c7ad6 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_team_scheme_settings/permission_team_scheme_settings.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_team_scheme_settings/permission_team_scheme_settings.tsx @@ -3,38 +3,39 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {RouteComponentProps} from 'react-router-dom'; +import type {RouteComponentProps} from 'react-router-dom'; -import {Scheme, SchemePatch} from '@mattermost/types/schemes'; -import {Role} from '@mattermost/types/roles'; -import {ClientConfig, ClientLicense} from '@mattermost/types/config'; -import {Team} from '@mattermost/types/teams'; -import {ServerError} from '@mattermost/types/errors'; +import type {ClientConfig, ClientLicense} from '@mattermost/types/config'; +import type {ServerError} from '@mattermost/types/errors'; +import type {Role} from '@mattermost/types/roles'; +import type {Scheme, SchemePatch} from '@mattermost/types/schemes'; +import type {Team} from '@mattermost/types/teams'; -import {ActionFunc, ActionResult} from 'mattermost-redux/types/actions'; import GeneralConstants from 'mattermost-redux/constants/general'; +import type {ActionFunc, ActionResult} from 'mattermost-redux/types/actions'; -import {PermissionsScope, ModalIdentifiers, DocLinks} from 'utils/constants'; -import {localizeMessage} from 'utils/utils'; -import {t} from 'utils/i18n'; - -import SaveButton from 'components/save_button'; -import LoadingScreen from 'components/loading_screen'; -import FormError from 'components/form_error'; -import TeamSelectorModal from 'components/team_selector_modal'; import BlockableLink from 'components/admin_console/blockable_link'; +import ExternalLink from 'components/external_link'; +import FormError from 'components/form_error'; +import LoadingScreen from 'components/loading_screen'; +import LocalizedInput from 'components/localized_input/localized_input'; +import SaveButton from 'components/save_button'; +import TeamSelectorModal from 'components/team_selector_modal'; +import AdminHeader from 'components/widgets/admin_console/admin_header'; import AdminPanel from 'components/widgets/admin_console/admin_panel'; import AdminPanelTogglable from 'components/widgets/admin_console/admin_panel_togglable'; import AdminPanelWithButton from 'components/widgets/admin_console/admin_panel_with_button'; -import LocalizedInput from 'components/localized_input/localized_input'; -import ExternalLink from 'components/external_link'; -import AdminHeader from 'components/widgets/admin_console/admin_header'; -import PermissionsTree, {EXCLUDED_PERMISSIONS} from '../permissions_tree'; -import GuestPermissionsTree, {GUEST_INCLUDED_PERMISSIONS} from '../guest_permissions_tree'; -import PermissionsTreePlaybooks from '../permissions_tree_playbooks'; +import {PermissionsScope, ModalIdentifiers, DocLinks} from 'utils/constants'; +import {t} from 'utils/i18n'; +import {localizeMessage} from 'utils/utils'; + import TeamInList from './team_in_list'; +import GuestPermissionsTree, {GUEST_INCLUDED_PERMISSIONS} from '../guest_permissions_tree'; +import PermissionsTree, {EXCLUDED_PERMISSIONS} from '../permissions_tree'; +import PermissionsTreePlaybooks from '../permissions_tree_playbooks'; + type RolesMap = { [x: string]: Role; }; diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_team_scheme_settings/team_in_list/index.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_team_scheme_settings/team_in_list/index.tsx index 49c809d0df..348d35f7ac 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_team_scheme_settings/team_in_list/index.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_team_scheme_settings/team_in_list/index.tsx @@ -2,14 +2,14 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch} from 'redux'; + +import type {GlobalState} from '@mattermost/types/store'; import {getTeamStats as loadTeamStats} from 'mattermost-redux/actions/teams'; - import {getTeamStats} from 'mattermost-redux/selectors/entities/teams'; - -import {GlobalState} from '@mattermost/types/store'; -import {GenericAction} from 'mattermost-redux/types/actions'; +import type {GenericAction} from 'mattermost-redux/types/actions'; import TeamInList from './team_in_list'; diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_team_scheme_settings/team_in_list/team_in_list.test.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_team_scheme_settings/team_in_list/team_in_list.test.tsx index d52f9a3f08..d00d7a7d41 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_team_scheme_settings/team_in_list/team_in_list.test.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_team_scheme_settings/team_in_list/team_in_list.test.tsx @@ -1,12 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; + +import type {TeamType} from '@mattermost/types/teams'; import TeamInList from 'components/admin_console/permission_schemes_settings/permission_team_scheme_settings/team_in_list/team_in_list'; -import {TeamType} from '@mattermost/types/teams'; describe('components/admin_console/permission_schemes_settings/permission_team_scheme_settings/team_in_list/team_in_list', () => { test('should match snapshot with team', () => { diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_team_scheme_settings/team_in_list/team_in_list.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_team_scheme_settings/team_in_list/team_in_list.tsx index 729153659d..d845659d67 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_team_scheme_settings/team_in_list/team_in_list.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/permission_team_scheme_settings/team_in_list/team_in_list.tsx @@ -4,10 +4,11 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; +import type {Team} from '@mattermost/types/teams'; + import TeamIcon from 'components/widgets/team_icon/team_icon'; import {imageURLForTeam} from 'utils/utils'; -import {Team} from '@mattermost/types/teams'; type Props = { team: Team; diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_scheme_summary/index.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_scheme_summary/index.tsx index dbe87f75e2..c47ce68dc4 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_scheme_summary/index.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_scheme_summary/index.tsx @@ -2,18 +2,18 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; +import type {RouteComponentProps} from 'react-router-dom'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; -import {RouteComponentProps} from 'react-router-dom'; +import type {GlobalState} from '@mattermost/types/store'; import {deleteScheme} from 'mattermost-redux/actions/schemes'; - import {makeGetSchemeTeams} from 'mattermost-redux/selectors/entities/schemes'; +import type {ActionFunc, ActionResult, GenericAction} from 'mattermost-redux/types/actions'; -import {ActionFunc, ActionResult, GenericAction} from 'mattermost-redux/types/actions'; -import {GlobalState} from '@mattermost/types/store'; - -import PermissionsSchemeSummary, {Props} from './permissions_scheme_summary'; +import PermissionsSchemeSummary from './permissions_scheme_summary'; +import type {Props} from './permissions_scheme_summary'; function makeMapStateToProps() { const getSchemeTeams = makeGetSchemeTeams(); diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_scheme_summary/permissions_scheme_summary.test.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_scheme_summary/permissions_scheme_summary.test.tsx index ccbd40dfc7..6c86091999 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_scheme_summary/permissions_scheme_summary.test.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_scheme_summary/permissions_scheme_summary.test.tsx @@ -1,11 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; -import ConfirmModal from 'components/confirm_modal'; import PermissionsSchemeSummary from 'components/admin_console/permission_schemes_settings/permissions_scheme_summary/permissions_scheme_summary'; +import ConfirmModal from 'components/confirm_modal'; describe('components/admin_console/permission_schemes_settings/permissions_scheme_summary', () => { const defaultProps = { diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_scheme_summary/permissions_scheme_summary.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_scheme_summary/permissions_scheme_summary.tsx index b09f1fc243..c2da47c5a2 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_scheme_summary/permissions_scheme_summary.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_scheme_summary/permissions_scheme_summary.tsx @@ -2,19 +2,22 @@ // See LICENSE.txt for license information. import React from 'react'; -import {Link, RouteComponentProps} from 'react-router-dom'; import {FormattedMessage} from 'react-intl'; +import {Link} from 'react-router-dom'; +import type {RouteComponentProps} from 'react-router-dom'; + +import type {Scheme} from '@mattermost/types/schemes'; +import type {Team} from '@mattermost/types/teams'; + +import type {ActionResult} from 'mattermost-redux/types/actions'; import ConfirmModal from 'components/confirm_modal'; import OverlayTrigger from 'components/overlay_trigger'; import Tooltip from 'components/tooltip'; import LoadingWrapper from 'components/widgets/loading/loading_wrapper'; -import * as Utils from 'utils/utils'; import Constants from 'utils/constants'; -import {Scheme} from '@mattermost/types/schemes'; -import {ActionResult} from 'mattermost-redux/types/actions'; -import {Team} from '@mattermost/types/teams'; +import * as Utils from 'utils/utils'; const MAX_TEAMS_PER_SCHEME_SUMMARY = 8; diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_tree/index.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_tree/index.tsx index 638c845fe6..04d6f8a0ba 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_tree/index.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_tree/index.tsx @@ -3,12 +3,11 @@ import {connect} from 'react-redux'; +import Permissions from 'mattermost-redux/constants/permissions'; import {getConfig, getLicense} from 'mattermost-redux/selectors/entities/general'; import {isCustomGroupsEnabled} from 'mattermost-redux/selectors/entities/preferences'; -import Permissions from 'mattermost-redux/constants/permissions'; - -import {GlobalState} from 'types/store'; +import type {GlobalState} from 'types/store'; import PermissionsTree from './permissions_tree'; diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_tree/permissions_tree.test.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_tree/permissions_tree.test.tsx index dbe1d550b4..600b1b2bca 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_tree/permissions_tree.test.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_tree/permissions_tree.test.tsx @@ -1,15 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; + +import PermissionGroup from 'components/admin_console/permission_schemes_settings/permission_group'; +import PermissionsTree from 'components/admin_console/permission_schemes_settings/permissions_tree/permissions_tree'; import {LicenseSkus} from 'utils/constants'; -import PermissionsTree from 'components/admin_console/permission_schemes_settings/permissions_tree/permissions_tree'; -import PermissionGroup from 'components/admin_console/permission_schemes_settings/permission_group'; - -import {Group, Permission} from './types'; +import type {Group, Permission} from './types'; describe('components/admin_console/permission_schemes_settings/permission_tree', () => { const defaultProps = { diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_tree/permissions_tree.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_tree/permissions_tree.tsx index 32cf4dd1dd..b74c1f5bb5 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_tree/permissions_tree.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_tree/permissions_tree.tsx @@ -4,18 +4,18 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {ClientConfig, ClientLicense} from '@mattermost/types/config'; -import {Role} from '@mattermost/types/roles'; +import type {ClientConfig, ClientLicense} from '@mattermost/types/config'; +import type {Role} from '@mattermost/types/roles'; import Permissions from 'mattermost-redux/constants/permissions'; import {isEnterpriseLicense, isNonEnterpriseLicense} from 'utils/license_utils'; -import PermissionGroup from '../permission_group'; +import type {AdditionalValues, Group} from './types'; + import EditPostTimeLimitButton from '../edit_post_time_limit_button'; import EditPostTimeLimitModal from '../edit_post_time_limit_modal'; - -import {AdditionalValues, Group} from './types'; +import PermissionGroup from '../permission_group'; type Props = { scope: string; diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_tree/types.ts b/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_tree/types.ts index 0f7a765ff8..1b59575f4b 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_tree/types.ts +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_tree/types.ts @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {ClientLicense} from '@mattermost/types/config'; +import type {ClientLicense} from '@mattermost/types/config'; export type Permissions = Array; diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_tree_playbooks.test.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_tree_playbooks.test.tsx index c533365b3e..a3036e2f73 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_tree_playbooks.test.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_tree_playbooks.test.tsx @@ -1,15 +1,16 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {ComponentProps} from 'react'; import {shallow} from 'enzyme'; - -import {LicenseSkus} from 'utils/constants'; +import React from 'react'; +import type {ComponentProps} from 'react'; import PermissionGroup from 'components/admin_console/permission_schemes_settings/permission_group'; import PermissionsTreePlaybooks from 'components/admin_console/permission_schemes_settings/permissions_tree_playbooks'; -import {Group, Permission} from './permissions_tree/types'; +import {LicenseSkus} from 'utils/constants'; + +import type {Group, Permission} from './permissions_tree/types'; describe('components/admin_console/permission_schemes_settings/permissions_tree_playbooks', () => { const defaultProps: ComponentProps = { diff --git a/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_tree_playbooks.tsx b/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_tree_playbooks.tsx index e8ad989944..3a79213324 100644 --- a/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_tree_playbooks.tsx +++ b/webapp/channels/src/components/admin_console/permission_schemes_settings/permissions_tree_playbooks.tsx @@ -4,8 +4,8 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {ClientLicense} from '@mattermost/types/config'; -import {Role} from '@mattermost/types/roles'; +import type {ClientLicense} from '@mattermost/types/config'; +import type {Role} from '@mattermost/types/roles'; import Permissions from 'mattermost-redux/constants/permissions'; diff --git a/webapp/channels/src/components/admin_console/plugin_management/index.ts b/webapp/channels/src/components/admin_console/plugin_management/index.ts index 77e0cbb347..6c43d2de98 100644 --- a/webapp/channels/src/components/admin_console/plugin_management/index.ts +++ b/webapp/channels/src/components/admin_console/plugin_management/index.ts @@ -2,7 +2,8 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch} from 'redux'; import { getPlugins, @@ -13,12 +14,11 @@ import { enablePlugin, disablePlugin, } from 'mattermost-redux/actions/admin'; - -import {GenericAction} from 'mattermost-redux/types/actions'; import {appsFeatureFlagEnabled} from 'mattermost-redux/selectors/entities/apps'; +import {streamlinedMarketplaceEnabled} from 'mattermost-redux/selectors/entities/preferences'; +import type {GenericAction} from 'mattermost-redux/types/actions'; import PluginManagement from './plugin_management'; -import {streamlinedMarketplaceEnabled} from 'mattermost-redux/selectors/entities/preferences'; function mapStateToProps(state: any) { return { diff --git a/webapp/channels/src/components/admin_console/plugin_management/plugin_management.test.tsx b/webapp/channels/src/components/admin_console/plugin_management/plugin_management.test.tsx index 673594b208..8832c59c7a 100644 --- a/webapp/channels/src/components/admin_console/plugin_management/plugin_management.test.tsx +++ b/webapp/channels/src/components/admin_console/plugin_management/plugin_management.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import PluginState from 'mattermost-redux/constants/plugins'; diff --git a/webapp/channels/src/components/admin_console/plugin_management/plugin_management.tsx b/webapp/channels/src/components/admin_console/plugin_management/plugin_management.tsx index a0e7340f8a..e1e653ec84 100644 --- a/webapp/channels/src/components/admin_console/plugin_management/plugin_management.tsx +++ b/webapp/channels/src/components/admin_console/plugin_management/plugin_management.tsx @@ -1,27 +1,30 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import classNames from 'classnames'; import React from 'react'; import {FormattedMessage} from 'react-intl'; import {Link} from 'react-router-dom'; -import classNames from 'classnames'; + +import type {AdminConfig} from '@mattermost/types/config'; +import type {DeepPartial} from '@mattermost/types/utilities'; import PluginState from 'mattermost-redux/constants/plugins'; -import {AdminConfig} from '@mattermost/types/config'; -import {DeepPartial} from '@mattermost/types/utilities'; -import * as Utils from 'utils/utils'; -import LoadingScreen from 'components/loading_screen'; -import FormattedMarkdownMessage from 'components/formatted_markdown_message'; import ConfirmModal from 'components/confirm_modal'; +import ExternalLink from 'components/external_link'; +import FormattedMarkdownMessage from 'components/formatted_markdown_message'; +import LoadingScreen from 'components/loading_screen'; -import AdminSettings, {BaseProps, BaseState} from '../admin_settings'; +import {appsPluginID} from 'utils/apps'; +import {DeveloperLinks} from 'utils/constants'; +import * as Utils from 'utils/utils'; + +import AdminSettings from '../admin_settings'; +import type {BaseProps, BaseState} from '../admin_settings'; import BooleanSetting from '../boolean_setting'; import SettingsGroup from '../settings_group'; import TextSetting from '../text_setting'; -import {appsPluginID} from 'utils/apps'; -import ExternalLink from 'components/external_link'; -import {DeveloperLinks} from 'utils/constants'; const PluginItemState = ({state}: {state: number}) => { switch (state) { diff --git a/webapp/channels/src/components/admin_console/push_settings.test.tsx b/webapp/channels/src/components/admin_console/push_settings.test.tsx index 00531d9c45..c513c9eb16 100644 --- a/webapp/channels/src/components/admin_console/push_settings.test.tsx +++ b/webapp/channels/src/components/admin_console/push_settings.test.tsx @@ -1,11 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; + +import type {AdminConfig} from '@mattermost/types/config'; import PushSettings from 'components/admin_console/push_settings'; -import {AdminConfig} from '@mattermost/types/config'; describe('components/PushSettings', () => { test('should match snapshot, licensed', () => { diff --git a/webapp/channels/src/components/admin_console/push_settings.tsx b/webapp/channels/src/components/admin_console/push_settings.tsx index 6a64219579..8a72c63c85 100644 --- a/webapp/channels/src/components/admin_console/push_settings.tsx +++ b/webapp/channels/src/components/admin_console/push_settings.tsx @@ -4,16 +4,18 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; +import type {AdminConfig, ClientLicense, EmailSettings} from '@mattermost/types/config'; + import ExternalLink from 'components/external_link'; import {Constants, DocLinks} from 'utils/constants'; import * as Utils from 'utils/utils'; -import AdminSettings, {BaseProps, BaseState} from './admin_settings'; +import AdminSettings from './admin_settings'; +import type {BaseProps, BaseState} from './admin_settings'; import DropdownSetting from './dropdown_setting'; import SettingsGroup from './settings_group'; import TextSetting from './text_setting'; -import {AdminConfig, ClientLicense, EmailSettings} from '@mattermost/types/config'; type Props = BaseProps & { config: AdminConfig; diff --git a/webapp/channels/src/components/admin_console/radio_setting.test.tsx b/webapp/channels/src/components/admin_console/radio_setting.test.tsx index a9268f8865..ff01e0757b 100644 --- a/webapp/channels/src/components/admin_console/radio_setting.test.tsx +++ b/webapp/channels/src/components/admin_console/radio_setting.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import RadioSetting from './radio_setting'; diff --git a/webapp/channels/src/components/admin_console/remove_file_setting.tsx b/webapp/channels/src/components/admin_console/remove_file_setting.tsx index 9b2c8c150c..4115ff2878 100644 --- a/webapp/channels/src/components/admin_console/remove_file_setting.tsx +++ b/webapp/channels/src/components/admin_console/remove_file_setting.tsx @@ -1,9 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {PureComponent, MouseEvent} from 'react'; +import React, {PureComponent} from 'react'; +import type {MouseEvent} from 'react'; -import Setting, {Props as SettingsProps} from './setting'; +import Setting from './setting'; +import type {Props as SettingsProps} from './setting'; type Props = SettingsProps & { id: string; diff --git a/webapp/channels/src/components/admin_console/request_button/request_button.test.tsx b/webapp/channels/src/components/admin_console/request_button/request_button.test.tsx index 176669253f..90c5d72365 100644 --- a/webapp/channels/src/components/admin_console/request_button/request_button.test.tsx +++ b/webapp/channels/src/components/admin_console/request_button/request_button.test.tsx @@ -1,9 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {shallow} from 'enzyme'; import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {shallow} from 'enzyme'; import RequestButton from 'components/admin_console/request_button/request_button'; diff --git a/webapp/channels/src/components/admin_console/request_button/request_button.tsx b/webapp/channels/src/components/admin_console/request_button/request_button.tsx index 3d3ee2949a..46bbce556e 100644 --- a/webapp/channels/src/components/admin_console/request_button/request_button.tsx +++ b/webapp/channels/src/components/admin_console/request_button/request_button.tsx @@ -4,11 +4,12 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import * as Utils from 'utils/utils'; -import {t} from 'utils/i18n'; -import LoadingWrapper from 'components/widgets/loading/loading_wrapper'; import SuccessIcon from 'components/widgets/icons/fa_success_icon'; import WarningIcon from 'components/widgets/icons/fa_warning_icon'; +import LoadingWrapper from 'components/widgets/loading/loading_wrapper'; + +import {t} from 'utils/i18n'; +import * as Utils from 'utils/utils'; /** * A button which, when clicked, performs an action and displays diff --git a/webapp/channels/src/components/admin_console/reset_email_modal/index.ts b/webapp/channels/src/components/admin_console/reset_email_modal/index.ts index c7de830f3d..c17ed6d691 100644 --- a/webapp/channels/src/components/admin_console/reset_email_modal/index.ts +++ b/webapp/channels/src/components/admin_console/reset_email_modal/index.ts @@ -2,15 +2,16 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {bindActionCreators, Dispatch, ActionCreatorsMapObject} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch, ActionCreatorsMapObject} from 'redux'; -import {UserProfile} from '@mattermost/types/users'; +import type {UserProfile} from '@mattermost/types/users'; import {patchUser} from 'mattermost-redux/actions/users'; import {getCurrentUserId} from 'mattermost-redux/selectors/entities/common'; -import {ActionFunc, ActionResult} from 'mattermost-redux/types/actions'; +import type {ActionFunc, ActionResult} from 'mattermost-redux/types/actions'; -import {GlobalState} from 'types/store'; +import type {GlobalState} from 'types/store'; import ResetEmailModal from './reset_email_modal'; diff --git a/webapp/channels/src/components/admin_console/reset_email_modal/reset_email_modal.test.tsx b/webapp/channels/src/components/admin_console/reset_email_modal/reset_email_modal.test.tsx index f102a3d065..c31ab1288c 100644 --- a/webapp/channels/src/components/admin_console/reset_email_modal/reset_email_modal.test.tsx +++ b/webapp/channels/src/components/admin_console/reset_email_modal/reset_email_modal.test.tsx @@ -1,15 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {shallow} from 'enzyme'; import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {shallow} from 'enzyme'; + +import type {UserProfile} from '@mattermost/types/users'; import {mountWithIntl} from 'tests/helpers/intl-test-helper'; import {TestHelper} from 'utils/test_helper'; -import {UserProfile} from '@mattermost/types/users'; - import ResetEmailModal from './reset_email_modal'; describe('components/admin_console/reset_email_modal/reset_email_modal.tsx', () => { diff --git a/webapp/channels/src/components/admin_console/reset_email_modal/reset_email_modal.tsx b/webapp/channels/src/components/admin_console/reset_email_modal/reset_email_modal.tsx index dde3f723e8..4441fde506 100644 --- a/webapp/channels/src/components/admin_console/reset_email_modal/reset_email_modal.tsx +++ b/webapp/channels/src/components/admin_console/reset_email_modal/reset_email_modal.tsx @@ -5,9 +5,9 @@ import React from 'react'; import {Modal} from 'react-bootstrap'; import {FormattedMessage} from 'react-intl'; -import {UserProfile} from '@mattermost/types/users'; -import {ActionResult} from 'mattermost-redux/types/actions'; +import type {UserProfile} from '@mattermost/types/users'; +import type {ActionResult} from 'mattermost-redux/types/actions'; import {isEmail} from 'mattermost-redux/utils/helpers'; type State = { diff --git a/webapp/channels/src/components/admin_console/reset_password_modal/index.ts b/webapp/channels/src/components/admin_console/reset_password_modal/index.ts index 725153d023..0be8be05b7 100644 --- a/webapp/channels/src/components/admin_console/reset_password_modal/index.ts +++ b/webapp/channels/src/components/admin_console/reset_password_modal/index.ts @@ -2,17 +2,18 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {bindActionCreators, Dispatch, ActionCreatorsMapObject} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch, ActionCreatorsMapObject} from 'redux'; import {updateUserPassword} from 'mattermost-redux/actions/users'; import {getConfig} from 'mattermost-redux/selectors/entities/general'; import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users'; -import {ActionFunc, ActionResult} from 'mattermost-redux/types/actions'; - -import {GlobalState} from 'types/store'; +import type {ActionFunc, ActionResult} from 'mattermost-redux/types/actions'; import {getPasswordConfig} from 'utils/utils'; +import type {GlobalState} from 'types/store'; + import ResetPasswordModal from './reset_password_modal'; type Actions = { diff --git a/webapp/channels/src/components/admin_console/reset_password_modal/reset_password_modal.test.tsx b/webapp/channels/src/components/admin_console/reset_password_modal/reset_password_modal.test.tsx index c4359cce6c..c779132c5a 100644 --- a/webapp/channels/src/components/admin_console/reset_password_modal/reset_password_modal.test.tsx +++ b/webapp/channels/src/components/admin_console/reset_password_modal/reset_password_modal.test.tsx @@ -1,12 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {shallow} from 'enzyme'; import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {shallow} from 'enzyme'; -import {UserNotifyProps, UserProfile} from '@mattermost/types/users'; -import {ActionResult} from 'mattermost-redux/types/actions'; +import type {UserNotifyProps, UserProfile} from '@mattermost/types/users'; + +import type {ActionResult} from 'mattermost-redux/types/actions'; import {mountWithIntl} from 'tests/helpers/intl-test-helper'; import {TestHelper} from 'utils/test_helper'; diff --git a/webapp/channels/src/components/admin_console/reset_password_modal/reset_password_modal.tsx b/webapp/channels/src/components/admin_console/reset_password_modal/reset_password_modal.tsx index 566fb1fed5..dd32400fb5 100644 --- a/webapp/channels/src/components/admin_console/reset_password_modal/reset_password_modal.tsx +++ b/webapp/channels/src/components/admin_console/reset_password_modal/reset_password_modal.tsx @@ -5,8 +5,9 @@ import React from 'react'; import {Modal} from 'react-bootstrap'; import {FormattedMessage} from 'react-intl'; -import {UserProfile} from '@mattermost/types/users'; -import {ActionResult} from 'mattermost-redux/types/actions'; +import type {UserProfile} from '@mattermost/types/users'; + +import type {ActionResult} from 'mattermost-redux/types/actions'; import * as Utils from 'utils/utils'; diff --git a/webapp/channels/src/components/admin_console/revoke_token_button/index.ts b/webapp/channels/src/components/admin_console/revoke_token_button/index.ts index a6e9426c8c..b4c908053a 100644 --- a/webapp/channels/src/components/admin_console/revoke_token_button/index.ts +++ b/webapp/channels/src/components/admin_console/revoke_token_button/index.ts @@ -2,10 +2,11 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch} from 'redux'; import {revokeUserAccessToken} from 'mattermost-redux/actions/users'; -import {GenericAction} from 'mattermost-redux/types/actions'; +import type {GenericAction} from 'mattermost-redux/types/actions'; import RevokeTokenButton from './revoke_token_button'; diff --git a/webapp/channels/src/components/admin_console/revoke_token_button/revoke_token_button.tsx b/webapp/channels/src/components/admin_console/revoke_token_button/revoke_token_button.tsx index 3409113484..576029dd06 100644 --- a/webapp/channels/src/components/admin_console/revoke_token_button/revoke_token_button.tsx +++ b/webapp/channels/src/components/admin_console/revoke_token_button/revoke_token_button.tsx @@ -4,9 +4,10 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {ActionFunc, ActionResult} from 'mattermost-redux/types/actions'; +import type {ActionFunc, ActionResult} from 'mattermost-redux/types/actions'; import {trackEvent} from 'actions/telemetry_actions.jsx'; + interface RevokeTokenButtonProps { actions: { revokeUserAccessToken: (tokenId: string) => Promise | ActionFunc | ActionResult; diff --git a/webapp/channels/src/components/admin_console/schema_admin_settings.jsx b/webapp/channels/src/components/admin_console/schema_admin_settings.jsx index 23ea2ea71d..56dd2b6cf3 100644 --- a/webapp/channels/src/components/admin_console/schema_admin_settings.jsx +++ b/webapp/channels/src/components/admin_console/schema_admin_settings.jsx @@ -1,39 +1,38 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import PropTypes from 'prop-types'; -import {FormattedMessage} from 'react-intl'; +import React from 'react'; import {Overlay} from 'react-bootstrap'; +import {FormattedMessage} from 'react-intl'; import {Link} from 'react-router-dom'; -import * as I18n from 'i18n/i18n.jsx'; +import BooleanSetting from 'components/admin_console/boolean_setting'; +import ColorSetting from 'components/admin_console/color_setting'; +import DropdownSetting from 'components/admin_console/dropdown_setting'; +import FileUploadSetting from 'components/admin_console/file_upload_setting.jsx'; +import GeneratedSetting from 'components/admin_console/generated_setting'; +import JobsTable from 'components/admin_console/jobs'; +import MultiSelectSetting from 'components/admin_console/multiselect_settings'; +import RadioSetting from 'components/admin_console/radio_setting'; +import RemoveFileSetting from 'components/admin_console/remove_file_setting'; +import RequestButton from 'components/admin_console/request_button/request_button'; +import SchemaText from 'components/admin_console/schema_text'; +import SettingsGroup from 'components/admin_console/settings_group'; +import TextSetting from 'components/admin_console/text_setting'; +import UserAutocompleteSetting from 'components/admin_console/user_autocomplete_setting'; +import FormError from 'components/form_error'; +import FormattedMarkdownMessage from 'components/formatted_markdown_message'; +import SaveButton from 'components/save_button'; +import Tooltip from 'components/tooltip'; +import AdminHeader from 'components/widgets/admin_console/admin_header'; +import WarningIcon from 'components/widgets/icons/fa_warning_icon'; +import * as I18n from 'i18n/i18n.jsx'; import Constants from 'utils/constants'; import {rolesFromMapping, mappingValueFromRoles} from 'utils/policy_roles_adapter'; import * as Utils from 'utils/utils'; -import RequestButton from 'components/admin_console/request_button/request_button'; -import BooleanSetting from 'components/admin_console/boolean_setting'; -import TextSetting from 'components/admin_console/text_setting'; -import DropdownSetting from 'components/admin_console/dropdown_setting'; -import MultiSelectSetting from 'components/admin_console/multiselect_settings'; -import RadioSetting from 'components/admin_console/radio_setting'; -import ColorSetting from 'components/admin_console/color_setting'; -import GeneratedSetting from 'components/admin_console/generated_setting'; -import UserAutocompleteSetting from 'components/admin_console/user_autocomplete_setting'; -import SettingsGroup from 'components/admin_console/settings_group'; -import JobsTable from 'components/admin_console/jobs'; -import FileUploadSetting from 'components/admin_console/file_upload_setting.jsx'; -import RemoveFileSetting from 'components/admin_console/remove_file_setting'; -import SchemaText from 'components/admin_console/schema_text'; -import SaveButton from 'components/save_button'; -import FormError from 'components/form_error'; -import Tooltip from 'components/tooltip'; -import WarningIcon from 'components/widgets/icons/fa_warning_icon'; -import FormattedMarkdownMessage from 'components/formatted_markdown_message'; -import AdminHeader from 'components/widgets/admin_console/admin_header'; - import Setting from './setting'; import './schema_admin_settings.scss'; diff --git a/webapp/channels/src/components/admin_console/schema_admin_settings.test.jsx b/webapp/channels/src/components/admin_console/schema_admin_settings.test.jsx index cb4c3c52f4..2826882dce 100644 --- a/webapp/channels/src/components/admin_console/schema_admin_settings.test.jsx +++ b/webapp/channels/src/components/admin_console/schema_admin_settings.test.jsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import {FormattedMessage} from 'react-intl'; import SchemaText from 'components/admin_console/schema_text'; diff --git a/webapp/channels/src/components/admin_console/server_logs/index.ts b/webapp/channels/src/components/admin_console/server_logs/index.ts index c00088a22d..45ee600eb5 100644 --- a/webapp/channels/src/components/admin_console/server_logs/index.ts +++ b/webapp/channels/src/components/admin_console/server_logs/index.ts @@ -2,15 +2,14 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch} from 'redux'; import {getLogs, getPlainLogs} from 'mattermost-redux/actions/admin'; - import * as Selectors from 'mattermost-redux/selectors/entities/admin'; +import type {GenericAction} from 'mattermost-redux/types/actions'; -import {GenericAction} from 'mattermost-redux/types/actions'; - -import {GlobalState} from 'types/store'; +import type {GlobalState} from 'types/store'; import Logs from './logs'; diff --git a/webapp/channels/src/components/admin_console/server_logs/log_list.tsx b/webapp/channels/src/components/admin_console/server_logs/log_list.tsx index fc72032db9..b38373b016 100644 --- a/webapp/channels/src/components/admin_console/server_logs/log_list.tsx +++ b/webapp/channels/src/components/admin_console/server_logs/log_list.tsx @@ -5,15 +5,17 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; import {ArrowDownIcon, ArrowUpIcon} from '@mattermost/compass-icons/components'; +import type {LogFilter, LogLevelEnum, LogObject} from '@mattermost/types/admin'; +import type {ChannelSearchOpts} from '@mattermost/types/channels'; -import DataGrid, {Row, Column} from 'components/admin_console/data_grid/data_grid'; -import {FilterOptions} from 'components/admin_console/filter/filter'; +import DataGrid from 'components/admin_console/data_grid/data_grid'; +import type {Row, Column} from 'components/admin_console/data_grid/data_grid'; +import type {FilterOptions} from 'components/admin_console/filter/filter'; -import {LogFilter, LogLevelEnum, LogObject} from '@mattermost/types/admin'; -import {ChannelSearchOpts} from '@mattermost/types/channels'; -import './log_list.scss'; import FullLogEventModal from '../full_log_event_modal'; +import './log_list.scss'; + type Props = { loading: boolean; logs: LogObject[]; diff --git a/webapp/channels/src/components/admin_console/server_logs/logs.tsx b/webapp/channels/src/components/admin_console/server_logs/logs.tsx index 4641a392cb..de02cfc51e 100644 --- a/webapp/channels/src/components/admin_console/server_logs/logs.tsx +++ b/webapp/channels/src/components/admin_console/server_logs/logs.tsx @@ -1,19 +1,19 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {debounce} from 'lodash'; import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {debounce} from 'lodash'; -import {ActionFunc} from 'mattermost-redux/types/actions'; - -import { +import type { LogFilter, LogLevels, LogObject, LogServerNames, } from '@mattermost/types/admin'; +import type {ActionFunc} from 'mattermost-redux/types/actions'; + import AdminHeader from 'components/widgets/admin_console/admin_header'; import LogList from './log_list'; diff --git a/webapp/channels/src/components/admin_console/session_length_settings.tsx b/webapp/channels/src/components/admin_console/session_length_settings.tsx index 8ddd1ab8be..f54d13d8f5 100644 --- a/webapp/channels/src/components/admin_console/session_length_settings.tsx +++ b/webapp/channels/src/components/admin_console/session_length_settings.tsx @@ -4,12 +4,14 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {AdminConfig, ClientLicense, ServiceSettings} from '@mattermost/types/config'; +import type {AdminConfig, ClientLicense, ServiceSettings} from '@mattermost/types/config'; import FormattedMarkdownMessage from 'components/formatted_markdown_message'; + import * as Utils from 'utils/utils'; -import AdminSettings, {BaseState, BaseProps} from './admin_settings'; +import AdminSettings from './admin_settings'; +import type {BaseState, BaseProps} from './admin_settings'; import BooleanSetting from './boolean_setting'; import SettingsGroup from './settings_group'; import TextSetting from './text_setting'; diff --git a/webapp/channels/src/components/admin_console/system_roles/index.tsx b/webapp/channels/src/components/admin_console/system_roles/index.tsx index 5d61143ccf..ee2dd078a8 100644 --- a/webapp/channels/src/components/admin_console/system_roles/index.tsx +++ b/webapp/channels/src/components/admin_console/system_roles/index.tsx @@ -5,7 +5,7 @@ import {connect} from 'react-redux'; import {getRoles} from 'mattermost-redux/selectors/entities/roles_helpers'; -import {GlobalState} from 'types/store'; +import type {GlobalState} from 'types/store'; import SystemRoles from './system_roles'; diff --git a/webapp/channels/src/components/admin_console/system_roles/system_role/add_users_to_role_modal/add_users_to_role_modal.test.tsx b/webapp/channels/src/components/admin_console/system_roles/system_role/add_users_to_role_modal/add_users_to_role_modal.test.tsx index 5f6f839da4..bbccad71fc 100644 --- a/webapp/channels/src/components/admin_console/system_roles/system_role/add_users_to_role_modal/add_users_to_role_modal.test.tsx +++ b/webapp/channels/src/components/admin_console/system_roles/system_role/add_users_to_role_modal/add_users_to_role_modal.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import {TestHelper} from 'utils/test_helper'; diff --git a/webapp/channels/src/components/admin_console/system_roles/system_role/add_users_to_role_modal/add_users_to_role_modal.tsx b/webapp/channels/src/components/admin_console/system_roles/system_role/add_users_to_role_modal/add_users_to_role_modal.tsx index f285736bf1..b7bdcbd6a2 100644 --- a/webapp/channels/src/components/admin_console/system_roles/system_role/add_users_to_role_modal/add_users_to_role_modal.tsx +++ b/webapp/channels/src/components/admin_console/system_roles/system_role/add_users_to_role_modal/add_users_to_role_modal.tsx @@ -5,23 +5,21 @@ import React from 'react'; import {Modal} from 'react-bootstrap'; import {FormattedMessage} from 'react-intl'; -import GuestTag from 'components/widgets/tag/guest_tag'; - -import BotTag from 'components/widgets/tag/bot_tag'; - -import {UserProfile} from '@mattermost/types/users'; -import {Role} from '@mattermost/types/roles'; - -import {filterProfilesStartingWithTerm, profileListToMap, isGuest} from 'mattermost-redux/utils/user_utils'; -import {filterProfiles} from 'mattermost-redux/selectors/entities/users'; +import type {Role} from '@mattermost/types/roles'; +import type {UserProfile} from '@mattermost/types/users'; import {Client4} from 'mattermost-redux/client'; +import {filterProfiles} from 'mattermost-redux/selectors/entities/users'; +import {filterProfilesStartingWithTerm, profileListToMap, isGuest} from 'mattermost-redux/utils/user_utils'; + +import MultiSelect from 'components/multiselect/multiselect'; +import type {Value} from 'components/multiselect/multiselect'; +import ProfilePicture from 'components/profile_picture'; +import AddIcon from 'components/widgets/icons/fa_add_icon'; +import BotTag from 'components/widgets/tag/bot_tag'; +import GuestTag from 'components/widgets/tag/guest_tag'; import {displayEntireNameForUser, localizeMessage} from 'utils/utils'; -import ProfilePicture from 'components/profile_picture'; - -import MultiSelect, {Value} from 'components/multiselect/multiselect'; -import AddIcon from 'components/widgets/icons/fa_add_icon'; const USERS_PER_PAGE = 50; const MAX_SELECTABLE_VALUES = 20; diff --git a/webapp/channels/src/components/admin_console/system_roles/system_role/add_users_to_role_modal/index.tsx b/webapp/channels/src/components/admin_console/system_roles/system_role/add_users_to_role_modal/index.tsx index f5396a90e4..85c9413025 100644 --- a/webapp/channels/src/components/admin_console/system_roles/system_role/add_users_to_role_modal/index.tsx +++ b/webapp/channels/src/components/admin_console/system_roles/system_role/add_users_to_role_modal/index.tsx @@ -2,17 +2,18 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {bindActionCreators, Dispatch, ActionCreatorsMapObject} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch, ActionCreatorsMapObject} from 'redux'; -import {UserProfile} from '@mattermost/types/users'; -import {GlobalState} from '@mattermost/types/store'; -import {GenericAction, ActionFunc} from 'mattermost-redux/types/actions'; +import type {GlobalState} from '@mattermost/types/store'; +import type {UserProfile} from '@mattermost/types/users'; import {getProfiles, searchProfiles} from 'mattermost-redux/actions/users'; - import {getProfiles as selectProfiles} from 'mattermost-redux/selectors/entities/users'; +import type {GenericAction, ActionFunc} from 'mattermost-redux/types/actions'; -import AddUsersToRoleModal, {Props} from './add_users_to_role_modal'; +import AddUsersToRoleModal from './add_users_to_role_modal'; +import type {Props} from './add_users_to_role_modal'; function mapStateToProps(state: GlobalState, props: Props) { const filterOptions: {[key: string]: any} = {active: true, exclude_roles: [props.role.name]}; diff --git a/webapp/channels/src/components/admin_console/system_roles/system_role/index.tsx b/webapp/channels/src/components/admin_console/system_roles/system_role/index.tsx index 07cc1a0007..0a8c224e9a 100644 --- a/webapp/channels/src/components/admin_console/system_roles/system_role/index.tsx +++ b/webapp/channels/src/components/admin_console/system_roles/system_role/index.tsx @@ -2,18 +2,21 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {bindActionCreators, Dispatch, ActionCreatorsMapObject} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch, ActionCreatorsMapObject} from 'redux'; + +import type {Role} from '@mattermost/types/roles'; -import {GenericAction, ActionFunc, ActionResult} from 'mattermost-redux/types/actions'; -import {Role} from '@mattermost/types/roles'; -import {updateUserRoles} from 'mattermost-redux/actions/users'; import {editRole} from 'mattermost-redux/actions/roles'; -import {getRolesById} from 'mattermost-redux/selectors/entities/roles'; +import {updateUserRoles} from 'mattermost-redux/actions/users'; import {getLicense} from 'mattermost-redux/selectors/entities/general'; +import {getRolesById} from 'mattermost-redux/selectors/entities/roles'; +import type {GenericAction, ActionFunc, ActionResult} from 'mattermost-redux/types/actions'; -import {GlobalState} from 'types/store'; import {setNavigationBlocked} from 'actions/admin_actions.jsx'; +import type {GlobalState} from 'types/store'; + import SystemRole from './system_role'; type Props = { diff --git a/webapp/channels/src/components/admin_console/system_roles/system_role/system_role.test.tsx b/webapp/channels/src/components/admin_console/system_roles/system_role/system_role.test.tsx index a86de98784..d8b296ca97 100644 --- a/webapp/channels/src/components/admin_console/system_roles/system_role/system_role.test.tsx +++ b/webapp/channels/src/components/admin_console/system_roles/system_role/system_role.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import {TestHelper} from 'utils/test_helper'; diff --git a/webapp/channels/src/components/admin_console/system_roles/system_role/system_role.tsx b/webapp/channels/src/components/admin_console/system_roles/system_role/system_role.tsx index 955ed17fcf..5507be1244 100644 --- a/webapp/channels/src/components/admin_console/system_roles/system_role/system_role.tsx +++ b/webapp/channels/src/components/admin_console/system_roles/system_role/system_role.tsx @@ -1,30 +1,31 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {uniq, difference} from 'lodash'; import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {uniq, difference} from 'lodash'; -import {Role} from '@mattermost/types/roles'; -import {UserProfile} from '@mattermost/types/users'; +import type {Role} from '@mattermost/types/roles'; +import type {UserProfile} from '@mattermost/types/users'; import {Client4} from 'mattermost-redux/client'; -import {ActionResult} from 'mattermost-redux/types/actions'; import Permissions from 'mattermost-redux/constants/permissions'; +import type {ActionResult} from 'mattermost-redux/types/actions'; + +import BlockableLink from 'components/admin_console/blockable_link'; +import SaveChangesPanel from 'components/admin_console/team_channel_settings/save_changes_panel'; +import FormError from 'components/form_error'; +import AdminHeader from 'components/widgets/admin_console/admin_header'; + +import {getHistory} from 'utils/browser_history'; +import Constants from 'utils/constants'; import {isError} from 'types/actions'; -import Constants from 'utils/constants'; -import {getHistory} from 'utils/browser_history'; - -import FormError from 'components/form_error'; -import BlockableLink from 'components/admin_console/blockable_link'; -import SaveChangesPanel from 'components/admin_console/team_channel_settings/save_changes_panel'; -import AdminHeader from 'components/widgets/admin_console/admin_header'; - -import SystemRoleUsers from './system_role_users'; import SystemRolePermissions from './system_role_permissions'; -import {PermissionToUpdate, PermissionsToUpdate, writeAccess} from './types'; +import SystemRoleUsers from './system_role_users'; +import {writeAccess} from './types'; +import type {PermissionToUpdate, PermissionsToUpdate} from './types'; type Props = { role: Role; diff --git a/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_permission.test.tsx b/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_permission.test.tsx index ae9b40ac17..d6cba13367 100644 --- a/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_permission.test.tsx +++ b/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_permission.test.tsx @@ -1,14 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import {TestHelper} from 'utils/test_helper'; -import {readAccess} from './types'; - import SystemRolePermission from './system_role_permission'; +import {readAccess} from './types'; describe('admin_console/system_role_permission', () => { test('should match snapshot', () => { diff --git a/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_permission.tsx b/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_permission.tsx index 1a47ca4a4b..997a0834c1 100644 --- a/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_permission.tsx +++ b/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_permission.tsx @@ -7,7 +7,8 @@ import {FormattedMessage} from 'react-intl'; import Permissions from 'mattermost-redux/constants/permissions'; import SystemRolePermissionDropdown from './system_role_permission_dropdown'; -import {PermissionsToUpdate, PermissionToUpdate, SystemSection, noAccess, PermissionAccess, writeAccess, readAccess, mixedAccess} from './types'; +import {noAccess, writeAccess, readAccess, mixedAccess} from './types'; +import type {PermissionsToUpdate, PermissionToUpdate, SystemSection, PermissionAccess} from './types'; import './system_role_permissions.scss'; diff --git a/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_permission_dropdown.test.tsx b/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_permission_dropdown.test.tsx index 2f1a3d76bb..583bc4e4a8 100644 --- a/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_permission_dropdown.test.tsx +++ b/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_permission_dropdown.test.tsx @@ -1,12 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; - -import {readAccess} from './types'; +import React from 'react'; import SystemRolePermissionDropdown from './system_role_permission_dropdown'; +import {readAccess} from './types'; describe('admin_console/system_role_permission_dropdown', () => { const props = { diff --git a/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_permission_dropdown.tsx b/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_permission_dropdown.tsx index 614d5d050e..9247d4e020 100644 --- a/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_permission_dropdown.tsx +++ b/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_permission_dropdown.tsx @@ -2,17 +2,16 @@ // See LICENSE.txt for license information. import React from 'react'; - import {FormattedMessage} from 'react-intl'; -import * as Utils from 'utils/utils'; - +import DropdownIcon from 'components/widgets/icons/fa_dropdown_icon'; import Menu from 'components/widgets/menu/menu'; import MenuWrapper from 'components/widgets/menu/menu_wrapper'; -import DropdownIcon from 'components/widgets/icons/fa_dropdown_icon'; +import * as Utils from 'utils/utils'; -import {noAccess, PermissionAccess, writeAccess, readAccess, PermissionToUpdate, SystemSection, mixedAccess, WriteAccess, NoAccess, ReadAccess, MixedAccess} from './types'; +import {noAccess, writeAccess, readAccess, mixedAccess} from './types'; +import type {PermissionAccess, PermissionToUpdate, SystemSection, WriteAccess, NoAccess, ReadAccess, MixedAccess} from './types'; import './system_role_permissions.scss'; diff --git a/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_permissions.test.tsx b/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_permissions.test.tsx index 0cccce43e5..020d4d9d57 100644 --- a/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_permissions.test.tsx +++ b/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_permissions.test.tsx @@ -1,15 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import {TestHelper} from 'utils/test_helper'; -import {readAccess, writeAccess} from './types'; - -import SystemRolePermissions from './system_role_permissions'; import SystemRolePermission from './system_role_permission'; +import SystemRolePermissions from './system_role_permissions'; +import {readAccess, writeAccess} from './types'; describe('admin_console/system_role_permissions', () => { const props = { diff --git a/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_permissions.tsx b/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_permissions.tsx index 54a3d93c7c..4f37e35484 100644 --- a/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_permissions.tsx +++ b/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_permissions.tsx @@ -3,17 +3,18 @@ import React from 'react'; -import {memoizeResult} from 'mattermost-redux/utils/helpers'; -import {Role} from '@mattermost/types/roles'; +import type {Role} from '@mattermost/types/roles'; +import {memoizeResult} from 'mattermost-redux/utils/helpers'; + +import FormattedMarkdownMessage from 'components/formatted_markdown_message'; +import AdminPanel from 'components/widgets/admin_console/admin_panel'; + +import Constants from 'utils/constants'; import {t} from 'utils/i18n'; -import AdminPanel from 'components/widgets/admin_console/admin_panel'; -import Constants from 'utils/constants'; -import FormattedMarkdownMessage from '../../../formatted_markdown_message'; - import SystemRolePermission from './system_role_permission'; -import {PermissionsToUpdate, PermissionToUpdate, SystemSection} from './types'; +import type {PermissionsToUpdate, PermissionToUpdate, SystemSection} from './types'; import './system_role_permissions.scss'; diff --git a/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_users/index.tsx b/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_users/index.tsx index 6ceaf74ded..47de118fc4 100644 --- a/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_users/index.tsx +++ b/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_users/index.tsx @@ -2,23 +2,23 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch, ActionCreatorsMapObject} from 'redux'; -import {bindActionCreators, Dispatch, ActionCreatorsMapObject} from 'redux'; - -import {UserProfile} from '@mattermost/types/users'; -import {GenericAction, ActionFunc} from 'mattermost-redux/types/actions'; - -import {filterProfilesStartingWithTerm, profileListToMap} from 'mattermost-redux/utils/user_utils'; +import type {UserProfile} from '@mattermost/types/users'; import {getFilteredUsersStats, getProfiles, searchProfiles} from 'mattermost-redux/actions/users'; - import {getRoles} from 'mattermost-redux/selectors/entities/roles_helpers'; import {getProfiles as selectProfiles, getFilteredUsersStats as selectFilteredUserStats, makeSearchProfilesStartingWithTerm, filterProfiles} from 'mattermost-redux/selectors/entities/users'; +import type {GenericAction, ActionFunc} from 'mattermost-redux/types/actions'; +import {filterProfilesStartingWithTerm, profileListToMap} from 'mattermost-redux/utils/user_utils'; import {setUserGridSearch} from 'actions/views/search'; -import {GlobalState} from 'types/store'; -import SystemRoleUsers, {Props} from './system_role_users'; +import type {GlobalState} from 'types/store'; + +import SystemRoleUsers from './system_role_users'; +import type {Props} from './system_role_users'; type OwnProps = { roleName: string; diff --git a/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_users/system_role_users.test.tsx b/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_users/system_role_users.test.tsx index 8543854973..b70503aee4 100644 --- a/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_users/system_role_users.test.tsx +++ b/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_users/system_role_users.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import {TestHelper} from 'utils/test_helper'; diff --git a/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_users/system_role_users.tsx b/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_users/system_role_users.tsx index 64fdcfd20e..71b9809172 100644 --- a/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_users/system_role_users.tsx +++ b/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_users/system_role_users.tsx @@ -4,20 +4,20 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import Tag from 'components/widgets/tag/tag'; +import type {ServerError} from '@mattermost/types/errors'; +import type {Role} from '@mattermost/types/roles'; +import type {UserProfile, UsersStats, GetFilteredUsersStatsOpts} from '@mattermost/types/users'; -import {Role} from '@mattermost/types/roles'; -import {ServerError} from '@mattermost/types/errors'; -import {UserProfile, UsersStats, GetFilteredUsersStatsOpts} from '@mattermost/types/users'; +import DataGrid from 'components/admin_console/data_grid/data_grid'; +import UserGridName from 'components/admin_console/user_grid/user_grid_name'; +import UserGridRemove from 'components/admin_console/user_grid/user_grid_remove'; +import ToggleModalButton from 'components/toggle_modal_button'; +import AdminPanel from 'components/widgets/admin_console/admin_panel'; +import Tag from 'components/widgets/tag/tag'; import Constants, {ModalIdentifiers} from 'utils/constants'; import {t} from 'utils/i18n'; -import AdminPanel from 'components/widgets/admin_console/admin_panel'; -import ToggleModalButton from 'components/toggle_modal_button'; -import DataGrid from 'components/admin_console/data_grid/data_grid'; -import UserGridName from 'components/admin_console/user_grid/user_grid_name'; -import UserGridRemove from 'components/admin_console/user_grid/user_grid_remove'; import AddUsersToRoleModal from '../add_users_to_role_modal'; export type Props = { diff --git a/webapp/channels/src/components/admin_console/system_roles/system_roles.test.tsx b/webapp/channels/src/components/admin_console/system_roles/system_roles.test.tsx index 880daf5a79..0120fd296d 100644 --- a/webapp/channels/src/components/admin_console/system_roles/system_roles.test.tsx +++ b/webapp/channels/src/components/admin_console/system_roles/system_roles.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import {TestHelper} from 'utils/test_helper'; diff --git a/webapp/channels/src/components/admin_console/system_roles/system_roles.tsx b/webapp/channels/src/components/admin_console/system_roles/system_roles.tsx index 0b9d483cfc..32610079ac 100644 --- a/webapp/channels/src/components/admin_console/system_roles/system_roles.tsx +++ b/webapp/channels/src/components/admin_console/system_roles/system_roles.tsx @@ -5,14 +5,15 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; import {Link} from 'react-router-dom'; -import {Role} from '@mattermost/types/roles'; +import type {Role} from '@mattermost/types/roles'; -import {t} from 'utils/i18n'; -import {getHistory} from 'utils/browser_history'; - -import AdminPanel from 'components/widgets/admin_console/admin_panel'; -import DataGrid, {Row, Column} from 'components/admin_console/data_grid/data_grid'; +import DataGrid from 'components/admin_console/data_grid/data_grid'; +import type {Row, Column} from 'components/admin_console/data_grid/data_grid'; import AdminHeader from 'components/widgets/admin_console/admin_header'; +import AdminPanel from 'components/widgets/admin_console/admin_panel'; + +import {getHistory} from 'utils/browser_history'; +import {t} from 'utils/i18n'; import './system_roles.scss'; diff --git a/webapp/channels/src/components/admin_console/system_user_detail/index.ts b/webapp/channels/src/components/admin_console/system_user_detail/index.ts index 380580b8c7..18667b477b 100644 --- a/webapp/channels/src/components/admin_console/system_user_detail/index.ts +++ b/webapp/channels/src/components/admin_console/system_user_detail/index.ts @@ -2,20 +2,18 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; -import {getUser} from 'mattermost-redux/selectors/entities/users'; +import type {ServerError} from '@mattermost/types/errors'; +import type {GlobalState} from '@mattermost/types/store'; +import type {TeamMembership} from '@mattermost/types/teams'; + +import {addUserToTeam} from 'mattermost-redux/actions/teams'; import {updateUserActive} from 'mattermost-redux/actions/users'; import {getConfig} from 'mattermost-redux/selectors/entities/general'; -import {addUserToTeam} from 'mattermost-redux/actions/teams'; - -import {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; - -import {GlobalState} from '@mattermost/types/store'; - -import {ServerError} from '@mattermost/types/errors'; - -import {TeamMembership} from '@mattermost/types/teams'; +import {getUser} from 'mattermost-redux/selectors/entities/users'; +import type {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; import {setNavigationBlocked} from 'actions/admin_actions.jsx'; diff --git a/webapp/channels/src/components/admin_console/system_user_detail/system_user_detail.test.tsx b/webapp/channels/src/components/admin_console/system_user_detail/system_user_detail.test.tsx index 2eb962e51e..1b7cb5818a 100644 --- a/webapp/channels/src/components/admin_console/system_user_detail/system_user_detail.test.tsx +++ b/webapp/channels/src/components/admin_console/system_user_detail/system_user_detail.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import SystemUserDetail from 'components/admin_console/system_user_detail/system_user_detail'; diff --git a/webapp/channels/src/components/admin_console/system_user_detail/system_user_detail.tsx b/webapp/channels/src/components/admin_console/system_user_detail/system_user_detail.tsx index d87225f3d3..e6f1e027bd 100644 --- a/webapp/channels/src/components/admin_console/system_user_detail/system_user_detail.tsx +++ b/webapp/channels/src/components/admin_console/system_user_detail/system_user_detail.tsx @@ -2,37 +2,38 @@ // See LICENSE.txt for license information. import React from 'react'; -import {Redirect, RouteComponentProps} from 'react-router-dom'; -import {FormattedMessage} from 'react-intl'; import {Overlay} from 'react-bootstrap'; +import {FormattedMessage} from 'react-intl'; +import {Redirect} from 'react-router-dom'; +import type {RouteComponentProps} from 'react-router-dom'; + +import type {ServerError} from '@mattermost/types/errors'; +import type {Team, TeamMembership} from '@mattermost/types/teams'; +import type {UserProfile} from '@mattermost/types/users'; import {isEmail} from 'mattermost-redux/utils/helpers'; -import {Team, TeamMembership} from '@mattermost/types/teams'; -import {UserProfile} from '@mattermost/types/users'; -import {ServerError} from '@mattermost/types/errors'; - import {adminResetMfa, adminResetEmail} from 'actions/admin_actions.jsx'; -import {Constants} from 'utils/constants'; -import * as Utils from 'utils/utils'; -import {t} from 'utils/i18n'; - -import BlockableLink from 'components/admin_console/blockable_link'; -import ResetPasswordModal from 'components/admin_console/reset_password_modal'; import AdminButtonOutline from 'components/admin_console/admin_button_outline/admin_button_outline'; import AdminUserCard from 'components/admin_console/admin_user_card/admin_user_card'; -import AdminPanel from 'components/widgets/admin_console/admin_panel'; +import BlockableLink from 'components/admin_console/blockable_link'; +import ResetPasswordModal from 'components/admin_console/reset_password_modal'; +import TeamList from 'components/admin_console/system_user_detail/team_list'; import ConfirmModal from 'components/confirm_modal'; -import SaveButton from 'components/save_button'; import FormError from 'components/form_error'; +import SaveButton from 'components/save_button'; import TeamSelectorModal from 'components/team_selector_modal'; import Tooltip from 'components/tooltip'; -import TeamList from 'components/admin_console/system_user_detail/team_list'; -import EmailIcon from 'components/widgets/icons/email_icon'; -import AtIcon from 'components/widgets/icons/at_icon'; -import SheidOutlineIcon from 'components/widgets/icons/shield_outline_icon'; import AdminHeader from 'components/widgets/admin_console/admin_header'; +import AdminPanel from 'components/widgets/admin_console/admin_panel'; +import AtIcon from 'components/widgets/icons/at_icon'; +import EmailIcon from 'components/widgets/icons/email_icon'; +import SheidOutlineIcon from 'components/widgets/icons/shield_outline_icon'; + +import {Constants} from 'utils/constants'; +import {t} from 'utils/i18n'; +import * as Utils from 'utils/utils'; import './system_user_detail.scss'; diff --git a/webapp/channels/src/components/admin_console/system_user_detail/team_list/abstract_list.test.tsx b/webapp/channels/src/components/admin_console/system_user_detail/team_list/abstract_list.test.tsx index dab3384124..4db463daad 100644 --- a/webapp/channels/src/components/admin_console/system_user_detail/team_list/abstract_list.test.tsx +++ b/webapp/channels/src/components/admin_console/system_user_detail/team_list/abstract_list.test.tsx @@ -1,12 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import AbstractList from './abstract_list'; import TeamRow from './team_row'; -import {TeamWithMembership} from './types'; +import type {TeamWithMembership} from './types'; describe('admin_console/system_user_detail/team_list/AbstractList', () => { const renderRow = jest.fn((item) => { diff --git a/webapp/channels/src/components/admin_console/system_user_detail/team_list/abstract_list.tsx b/webapp/channels/src/components/admin_console/system_user_detail/team_list/abstract_list.tsx index a5a8daf436..50f714f9bf 100644 --- a/webapp/channels/src/components/admin_console/system_user_detail/team_list/abstract_list.tsx +++ b/webapp/channels/src/components/admin_console/system_user_detail/team_list/abstract_list.tsx @@ -4,12 +4,12 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {Team} from '@mattermost/types/teams'; +import type {Team} from '@mattermost/types/teams'; import NextIcon from 'components/widgets/icons/fa_next_icon'; import PreviousIcon from 'components/widgets/icons/fa_previous_icon'; -import {TeamWithMembership} from './types'; +import type {TeamWithMembership} from './types'; import './abstract_list.scss'; diff --git a/webapp/channels/src/components/admin_console/system_user_detail/team_list/index.ts b/webapp/channels/src/components/admin_console/system_user_detail/team_list/index.ts index 3e83dee1e6..9140aa2335 100644 --- a/webapp/channels/src/components/admin_console/system_user_detail/team_list/index.ts +++ b/webapp/channels/src/components/admin_console/system_user_detail/team_list/index.ts @@ -2,7 +2,10 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; + +import type {Team, TeamMembership} from '@mattermost/types/teams'; import { getTeamsForUser, @@ -10,13 +13,11 @@ import { removeUserFromTeam, updateTeamMemberSchemeRoles, } from 'mattermost-redux/actions/teams'; - -import {ActionFunc, ActionResult, GenericAction} from 'mattermost-redux/types/actions'; -import {Team, TeamMembership} from '@mattermost/types/teams'; +import type {ActionFunc, ActionResult, GenericAction} from 'mattermost-redux/types/actions'; import {getCurrentLocale} from 'selectors/i18n'; -import {GlobalState} from 'types/store'; +import type {GlobalState} from 'types/store'; import TeamList from './team_list'; diff --git a/webapp/channels/src/components/admin_console/system_user_detail/team_list/team_list.test.tsx b/webapp/channels/src/components/admin_console/system_user_detail/team_list/team_list.test.tsx index c5eba46906..c305ab1b3c 100644 --- a/webapp/channels/src/components/admin_console/system_user_detail/team_list/team_list.test.tsx +++ b/webapp/channels/src/components/admin_console/system_user_detail/team_list/team_list.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import TeamList from './team_list'; diff --git a/webapp/channels/src/components/admin_console/system_user_detail/team_list/team_list.tsx b/webapp/channels/src/components/admin_console/system_user_detail/team_list/team_list.tsx index 0d3987bd74..29f0211cf9 100644 --- a/webapp/channels/src/components/admin_console/system_user_detail/team_list/team_list.tsx +++ b/webapp/channels/src/components/admin_console/system_user_detail/team_list/team_list.tsx @@ -3,16 +3,16 @@ import React from 'react'; -import {ActionResult} from 'mattermost-redux/types/actions'; +import type {Team, TeamMembership} from '@mattermost/types/teams'; -import {Team, TeamMembership} from '@mattermost/types/teams'; +import type {ActionResult} from 'mattermost-redux/types/actions'; -import {filterAndSortTeamsByDisplayName} from 'utils/team_utils'; import {t} from 'utils/i18n'; +import {filterAndSortTeamsByDisplayName} from 'utils/team_utils'; import AbstractList from './abstract_list'; import TeamRow from './team_row'; -import {TeamWithMembership} from './types'; +import type {TeamWithMembership} from './types'; const headerLabels = [ { diff --git a/webapp/channels/src/components/admin_console/system_user_detail/team_list/team_list_dropdown.tsx b/webapp/channels/src/components/admin_console/system_user_detail/team_list/team_list_dropdown.tsx index 1459f9ed7a..bdfa48180c 100644 --- a/webapp/channels/src/components/admin_console/system_user_detail/team_list/team_list_dropdown.tsx +++ b/webapp/channels/src/components/admin_console/system_user_detail/team_list/team_list_dropdown.tsx @@ -3,13 +3,13 @@ import React from 'react'; -import {localizeMessage} from 'utils/utils'; import EllipsisHorizontalIcon from 'components/widgets/icons/ellipsis_h_icon'; - import Menu from 'components/widgets/menu/menu'; import MenuWrapper from 'components/widgets/menu/menu_wrapper'; -import {TeamWithMembership} from './types'; +import {localizeMessage} from 'utils/utils'; + +import type {TeamWithMembership} from './types'; type Props = { team: TeamWithMembership; diff --git a/webapp/channels/src/components/admin_console/system_user_detail/team_list/team_row.tsx b/webapp/channels/src/components/admin_console/system_user_detail/team_list/team_row.tsx index d9915692e4..ad3756f373 100644 --- a/webapp/channels/src/components/admin_console/system_user_detail/team_list/team_row.tsx +++ b/webapp/channels/src/components/admin_console/system_user_detail/team_list/team_row.tsx @@ -4,14 +4,16 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {Team} from '@mattermost/types/teams'; +import type {Team} from '@mattermost/types/teams'; -import * as Utils from 'utils/utils'; import TeamIcon from 'components/widgets/team_icon/team_icon'; -import './team_row.scss'; +import * as Utils from 'utils/utils'; + import TeamListDropdown from './team_list_dropdown'; -import {TeamWithMembership} from './types'; +import type {TeamWithMembership} from './types'; + +import './team_row.scss'; type Props = { team: TeamWithMembership; diff --git a/webapp/channels/src/components/admin_console/system_user_detail/team_list/types.ts b/webapp/channels/src/components/admin_console/system_user_detail/team_list/types.ts index bacc192bbd..b830329c4a 100644 --- a/webapp/channels/src/components/admin_console/system_user_detail/team_list/types.ts +++ b/webapp/channels/src/components/admin_console/system_user_detail/team_list/types.ts @@ -1,6 +1,6 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {Team, TeamMembership} from '@mattermost/types/teams'; +import type {Team, TeamMembership} from '@mattermost/types/teams'; export type TeamWithMembership = Team & TeamMembership; diff --git a/webapp/channels/src/components/admin_console/system_users/index.ts b/webapp/channels/src/components/admin_console/system_users/index.ts index 38511e359b..f6012933bc 100644 --- a/webapp/channels/src/components/admin_console/system_users/index.ts +++ b/webapp/channels/src/components/admin_console/system_users/index.ts @@ -2,8 +2,14 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; +import type {StatusOK} from '@mattermost/types/client4'; +import type {ServerError} from '@mattermost/types/errors'; +import type {GetFilteredUsersStatsOpts, UsersStats} from '@mattermost/types/users'; + +import {logError} from 'mattermost-redux/actions/errors'; import {getTeams, getTeamStats} from 'mattermost-redux/actions/teams'; import { getUser, @@ -13,23 +19,18 @@ import { revokeSessionsForAllUsers, getFilteredUsersStats, } from 'mattermost-redux/actions/users'; -import {logError} from 'mattermost-redux/actions/errors'; -import {getTeamsList} from 'mattermost-redux/selectors/entities/teams'; import {getConfig} from 'mattermost-redux/selectors/entities/general'; +import {getTeamsList} from 'mattermost-redux/selectors/entities/teams'; import {getFilteredUsersStats as selectFilteredUserStats, getUsers} from 'mattermost-redux/selectors/entities/users'; - -import {Action, ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; -import {GetFilteredUsersStatsOpts, UsersStats} from '@mattermost/types/users'; -import {ServerError} from '@mattermost/types/errors'; -import {StatusOK} from '@mattermost/types/client4'; - -import {GlobalState} from 'types/store'; +import type {Action, ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; import {loadProfilesAndTeamMembers, loadProfilesWithoutTeam} from 'actions/user_actions'; - import {setSystemUsersSearch} from 'actions/views/search'; + import {SearchUserTeamFilter} from 'utils/constants'; +import type {GlobalState} from 'types/store'; + import SystemUsers from './system_users'; function mapStateToProps(state: GlobalState) { diff --git a/webapp/channels/src/components/admin_console/system_users/list/index.ts b/webapp/channels/src/components/admin_console/system_users/list/index.ts index 9a65e2f59f..44d0711825 100644 --- a/webapp/channels/src/components/admin_console/system_users/list/index.ts +++ b/webapp/channels/src/components/admin_console/system_users/list/index.ts @@ -2,15 +2,17 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; + +import type {GlobalState} from '@mattermost/types/store'; +import type {UserProfile} from '@mattermost/types/users'; import {getUser} from 'mattermost-redux/actions/users'; -import {UserProfile} from '@mattermost/types/users'; -import {GenericAction, ActionFunc} from 'mattermost-redux/types/actions'; -import {GlobalState} from '@mattermost/types/store'; +import type {GenericAction, ActionFunc} from 'mattermost-redux/types/actions'; -import SystemUsersList from './system_users_list'; import {getNonBotUsers} from './selectors'; +import SystemUsersList from './system_users_list'; type Actions = { getUser: (id: string) => UserProfile; diff --git a/webapp/channels/src/components/admin_console/system_users/list/selectors.test.tsx b/webapp/channels/src/components/admin_console/system_users/list/selectors.test.tsx index cfa3897eff..c97d596867 100644 --- a/webapp/channels/src/components/admin_console/system_users/list/selectors.test.tsx +++ b/webapp/channels/src/components/admin_console/system_users/list/selectors.test.tsx @@ -1,10 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import * as users from 'mattermost-redux/selectors/entities/users'; +import type {GlobalState} from '@mattermost/types/store'; +import type {UserProfile} from '@mattermost/types/users'; -import {GlobalState} from '@mattermost/types/store'; -import {UserProfile} from '@mattermost/types/users'; +import * as users from 'mattermost-redux/selectors/entities/users'; import {getUsers} from 'components/admin_console/system_users/list/selectors'; diff --git a/webapp/channels/src/components/admin_console/system_users/list/selectors.tsx b/webapp/channels/src/components/admin_console/system_users/list/selectors.tsx index 9fd930a0f1..4d2c1bf5ac 100644 --- a/webapp/channels/src/components/admin_console/system_users/list/selectors.tsx +++ b/webapp/channels/src/components/admin_console/system_users/list/selectors.tsx @@ -1,9 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import type {GlobalState} from '@mattermost/types/store'; +import type {UserProfile} from '@mattermost/types/users'; + import {getUser, getProfiles, getProfilesInTeam, getProfilesWithoutTeam, makeSearchProfilesStartingWithTerm, searchProfilesInTeam} from 'mattermost-redux/selectors/entities/users'; -import {GlobalState} from '@mattermost/types/store'; -import {UserProfile} from '@mattermost/types/users'; import {userSelectorOptionsFromFilter} from 'utils/filter_users'; diff --git a/webapp/channels/src/components/admin_console/system_users/list/system_users_list.test.tsx b/webapp/channels/src/components/admin_console/system_users/list/system_users_list.test.tsx index a59cb77825..f14bb50dc2 100644 --- a/webapp/channels/src/components/admin_console/system_users/list/system_users_list.test.tsx +++ b/webapp/channels/src/components/admin_console/system_users/list/system_users_list.test.tsx @@ -1,13 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; -import {UserProfile} from '@mattermost/types/users'; +import type {UserProfile} from '@mattermost/types/users'; + +import SystemUsersList from 'components/admin_console/system_users/list/system_users_list'; import {Constants} from 'utils/constants'; -import SystemUsersList from 'components/admin_console/system_users/list/system_users_list'; describe('components/admin_console/system_users/list', () => { const defaultProps = { diff --git a/webapp/channels/src/components/admin_console/system_users/list/system_users_list.tsx b/webapp/channels/src/components/admin_console/system_users/list/system_users_list.tsx index 4bd0fbeb02..7ffaa12739 100644 --- a/webapp/channels/src/components/admin_console/system_users/list/system_users_list.tsx +++ b/webapp/channels/src/components/admin_console/system_users/list/system_users_list.tsx @@ -4,21 +4,22 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {UserProfile} from '@mattermost/types/users'; +import type {Team} from '@mattermost/types/teams'; +import type {UserProfile} from '@mattermost/types/users'; + import {getUserAccessTokensForUser} from 'mattermost-redux/actions/users'; -import {Team} from '@mattermost/types/teams'; - -import {Constants} from 'utils/constants'; -import * as Utils from 'utils/utils'; import ManageRolesModal from 'components/admin_console/manage_roles_modal'; import ManageTeamsModal from 'components/admin_console/manage_teams_modal'; import ManageTokensModal from 'components/admin_console/manage_tokens_modal'; -import ResetPasswordModal from 'components/admin_console/reset_password_modal'; import ResetEmailModal from 'components/admin_console/reset_email_modal'; +import ResetPasswordModal from 'components/admin_console/reset_password_modal'; +import FormattedMarkdownMessage from 'components/formatted_markdown_message'; import SearchableUserList from 'components/searchable_user_list/searchable_user_list'; import UserListRowWithError from 'components/user_list_row_with_error'; -import FormattedMarkdownMessage from 'components/formatted_markdown_message'; + +import {Constants} from 'utils/constants'; +import * as Utils from 'utils/utils'; import SystemUsersDropdown from '../system_users_dropdown'; diff --git a/webapp/channels/src/components/admin_console/system_users/system_users.test.tsx b/webapp/channels/src/components/admin_console/system_users/system_users.test.tsx index 22cf2c1381..22a27940ca 100644 --- a/webapp/channels/src/components/admin_console/system_users/system_users.test.tsx +++ b/webapp/channels/src/components/admin_console/system_users/system_users.test.tsx @@ -1,10 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import SystemUsers from 'components/admin_console/system_users/system_users'; + import {Constants, SearchUserTeamFilter, UserFilters} from 'utils/constants'; jest.mock('actions/admin_actions'); diff --git a/webapp/channels/src/components/admin_console/system_users/system_users.tsx b/webapp/channels/src/components/admin_console/system_users/system_users.tsx index a80472501e..d350ef2faa 100644 --- a/webapp/channels/src/components/admin_console/system_users/system_users.tsx +++ b/webapp/channels/src/components/admin_console/system_users/system_users.tsx @@ -1,30 +1,31 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {ChangeEvent} from 'react'; +import React from 'react'; +import type {ChangeEvent} from 'react'; import {FormattedMessage} from 'react-intl'; +import type {ServerError} from '@mattermost/types/errors'; +import type {Team} from '@mattermost/types/teams'; +import type {GetFilteredUsersStatsOpts, UserProfile, UsersStats} from '@mattermost/types/users'; + import {debounce} from 'mattermost-redux/actions/helpers'; import {Permissions} from 'mattermost-redux/constants'; -import {ActionFunc} from 'mattermost-redux/types/actions'; - -import {ServerError} from '@mattermost/types/errors'; -import {Team} from '@mattermost/types/teams'; -import {GetFilteredUsersStatsOpts, UserProfile, UsersStats} from '@mattermost/types/users'; +import type {ActionFunc} from 'mattermost-redux/types/actions'; import {emitUserLoggedOutEvent} from 'actions/global_actions'; -import {Constants, UserSearchOptions, SearchUserTeamFilter, UserFilters} from 'utils/constants'; -import * as Utils from 'utils/utils'; -import {t} from 'utils/i18n'; -import {getUserOptionsFromFilter, searchUserOptionsFromFilter} from 'utils/filter_users'; - -import LocalizedInput from 'components/localized_input/localized_input'; -import FormattedMarkdownMessage from 'components/formatted_markdown_message'; -import SystemPermissionGate from 'components/permissions_gates/system_permission_gate'; import ConfirmModal from 'components/confirm_modal'; +import FormattedMarkdownMessage from 'components/formatted_markdown_message'; +import LocalizedInput from 'components/localized_input/localized_input'; +import SystemPermissionGate from 'components/permissions_gates/system_permission_gate'; import AdminHeader from 'components/widgets/admin_console/admin_header'; +import {Constants, UserSearchOptions, SearchUserTeamFilter, UserFilters} from 'utils/constants'; +import {getUserOptionsFromFilter, searchUserOptionsFromFilter} from 'utils/filter_users'; +import {t} from 'utils/i18n'; +import * as Utils from 'utils/utils'; + import SystemUsersList from './list'; const USER_ID_LENGTH = 26; diff --git a/webapp/channels/src/components/admin_console/system_users/system_users_dropdown/index.ts b/webapp/channels/src/components/admin_console/system_users/system_users_dropdown/index.ts index 8f3ea87085..b30f43632e 100644 --- a/webapp/channels/src/components/admin_console/system_users/system_users_dropdown/index.ts +++ b/webapp/channels/src/components/admin_console/system_users/system_users_dropdown/index.ts @@ -2,23 +2,22 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {bindActionCreators, Dispatch, ActionCreatorsMapObject} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch, ActionCreatorsMapObject} from 'redux'; -import {ActionFunc} from 'mattermost-redux/types/actions'; - -import {updateUserActive, revokeAllSessionsForUser, promoteGuestToUser, demoteUserToGuest} from 'mattermost-redux/actions/users'; -import {getCurrentUser} from 'mattermost-redux/selectors/entities/users'; -import {getExternalBotAccounts} from 'mattermost-redux/selectors/entities/bots'; import {loadBots} from 'mattermost-redux/actions/bots'; import {createGroupTeamsAndChannels} from 'mattermost-redux/actions/groups'; - -import {getLicense} from 'mattermost-redux/selectors/entities/general'; - +import {updateUserActive, revokeAllSessionsForUser, promoteGuestToUser, demoteUserToGuest} from 'mattermost-redux/actions/users'; import * as Selectors from 'mattermost-redux/selectors/entities/admin'; +import {getExternalBotAccounts} from 'mattermost-redux/selectors/entities/bots'; +import {getLicense} from 'mattermost-redux/selectors/entities/general'; +import {getCurrentUser} from 'mattermost-redux/selectors/entities/users'; +import type {ActionFunc} from 'mattermost-redux/types/actions'; -import {GlobalState} from 'types/store'; +import type {GlobalState} from 'types/store'; -import SystemUsersDropdown, {Props} from './system_users_dropdown'; +import SystemUsersDropdown from './system_users_dropdown'; +import type {Props} from './system_users_dropdown'; function mapStateToProps(state: GlobalState) { const bots = getExternalBotAccounts(state); diff --git a/webapp/channels/src/components/admin_console/system_users/system_users_dropdown/system_users_dropdown.test.tsx b/webapp/channels/src/components/admin_console/system_users/system_users_dropdown/system_users_dropdown.test.tsx index 1718cd03ae..ddea9d226e 100644 --- a/webapp/channels/src/components/admin_console/system_users/system_users_dropdown/system_users_dropdown.test.tsx +++ b/webapp/channels/src/components/admin_console/system_users/system_users_dropdown/system_users_dropdown.test.tsx @@ -1,16 +1,17 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; -import {UserProfile} from '@mattermost/types/users'; - -import {TestHelper} from '../../../../utils/test_helper'; +import type {UserProfile} from '@mattermost/types/users'; import Menu from 'components/widgets/menu/menu'; -import SystemUsersDropdown, {Props} from './system_users_dropdown'; +import {TestHelper} from 'utils/test_helper'; + +import SystemUsersDropdown from './system_users_dropdown'; +import type {Props} from './system_users_dropdown'; describe('components/admin_console/system_users/system_users_dropdown/system_users_dropdown', () => { const user: UserProfile & {mfa_active: boolean} = Object.assign(TestHelper.getUserMock(), {mfa_active: true}); diff --git a/webapp/channels/src/components/admin_console/system_users/system_users_dropdown/system_users_dropdown.tsx b/webapp/channels/src/components/admin_console/system_users/system_users_dropdown/system_users_dropdown.tsx index 59a4084955..d6f7a11a7a 100644 --- a/webapp/channels/src/components/admin_console/system_users/system_users_dropdown/system_users_dropdown.tsx +++ b/webapp/channels/src/components/admin_console/system_users/system_users_dropdown/system_users_dropdown.tsx @@ -4,27 +4,29 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import * as UserUtils from 'mattermost-redux/utils/user_utils'; +import type {Bot} from '@mattermost/types/bots'; +import type {AdminConfig} from '@mattermost/types/config'; +import type {ServerError} from '@mattermost/types/errors'; +import type {UserProfile} from '@mattermost/types/users'; +import type {DeepPartial} from '@mattermost/types/utilities'; + import {Permissions} from 'mattermost-redux/constants'; -import {AdminConfig} from '@mattermost/types/config'; -import {UserProfile} from '@mattermost/types/users'; -import {ServerError} from '@mattermost/types/errors'; -import {Bot} from '@mattermost/types/bots'; -import {DeepPartial} from '@mattermost/types/utilities'; +import * as UserUtils from 'mattermost-redux/utils/user_utils'; import {adminResetMfa} from 'actions/admin_actions.jsx'; +import {emitUserLoggedOutEvent} from 'actions/global_actions'; + +import ConfirmModal from 'components/confirm_modal'; +import ExternalLink from 'components/external_link'; import FormattedMarkdownMessage from 'components/formatted_markdown_message'; +import SystemPermissionGate from 'components/permissions_gates/system_permission_gate'; +import Menu from 'components/widgets/menu/menu'; +import MenuWrapper from 'components/widgets/menu/menu_wrapper'; + import {Constants} from 'utils/constants'; -import * as Utils from 'utils/utils'; import {t} from 'utils/i18n'; import {getSiteURL} from 'utils/url'; -import {emitUserLoggedOutEvent} from 'actions/global_actions'; -import ConfirmModal from 'components/confirm_modal'; -import SystemPermissionGate from 'components/permissions_gates/system_permission_gate'; - -import MenuWrapper from 'components/widgets/menu/menu_wrapper'; -import Menu from 'components/widgets/menu/menu'; -import ExternalLink from 'components/external_link'; +import * as Utils from 'utils/utils'; const ROWS_FROM_BOTTOM_TO_OPEN_UP = 3; const TOTAL_USERS_TO_OPEN_UP = 5; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/abstract_list.test.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/abstract_list.test.tsx index e63a5a6418..08fe82c2f5 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/abstract_list.test.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/abstract_list.test.tsx @@ -1,18 +1,18 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {shallow} from 'enzyme'; import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {shallow} from 'enzyme'; -import {Channel} from '@mattermost/types/channels'; +import type {Channel} from '@mattermost/types/channels'; import {TestHelper} from 'utils/test_helper'; -import {TeamWithMembership} from '../system_user_detail/team_list/types'; - -import GroupRow from './group/group_row'; import AbstractList from './abstract_list'; +import GroupRow from './group/group_row'; + +import type {TeamWithMembership} from '../system_user_detail/team_list/types'; describe('admin_console/team_channel_settings/AbstractList', () => { const header = ( diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/abstract_list.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/abstract_list.tsx index fb10bb6e43..1690ee53f0 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/abstract_list.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/abstract_list.tsx @@ -1,16 +1,18 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {MouseEvent} from 'react'; -import {FormattedMessage} from 'react-intl'; import classNames from 'classnames'; +import React from 'react'; +import type {MouseEvent} from 'react'; +import {FormattedMessage} from 'react-intl'; -import {Group} from '@mattermost/types/groups'; -import {Team} from '@mattermost/types/teams'; +import type {Group} from '@mattermost/types/groups'; +import type {Team} from '@mattermost/types/teams'; import NextIcon from 'components/widgets/icons/fa_next_icon'; import PreviousIcon from 'components/widgets/icons/fa_previous_icon'; -import {TeamWithMembership} from '../system_user_detail/team_list/types'; + +import type {TeamWithMembership} from '../system_user_detail/team_list/types'; export const PAGE_SIZE = 10; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/channel/channel_settings.test.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/channel/channel_settings.test.tsx index 2dfaa2fb7e..73e98d3f8e 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/channel/channel_settings.test.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/channel/channel_settings.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import {ChannelsSettings} from './channel_settings'; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/channel/channel_settings.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/channel/channel_settings.tsx index 34b714ae0f..894a9afedc 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/channel/channel_settings.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/channel/channel_settings.tsx @@ -4,10 +4,11 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {t} from 'utils/i18n'; import ChannelsList from 'components/admin_console/team_channel_settings/channel/list'; -import AdminPanel from 'components/widgets/admin_console/admin_panel'; import AdminHeader from 'components/widgets/admin_console/admin_header'; +import AdminPanel from 'components/widgets/admin_console/admin_panel'; + +import {t} from 'utils/i18n'; interface Props { siteName?: string; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_details.test.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_details.test.tsx index b5c34c175c..a342f954dd 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_details.test.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_details.test.tsx @@ -1,13 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; -import {Group} from '@mattermost/types/groups'; -import {Channel} from '@mattermost/types/channels'; -import {Team} from '@mattermost/types/teams'; -import {Scheme} from '@mattermost/types/schemes'; +import type {Channel} from '@mattermost/types/channels'; +import type {Group} from '@mattermost/types/groups'; +import type {Scheme} from '@mattermost/types/schemes'; +import type {Team} from '@mattermost/types/teams'; import ChannelDetails from './channel_details'; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_details.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_details.tsx index b07880f8a3..283eb848a1 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_details.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_details.tsx @@ -1,43 +1,43 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {cloneDeep} from 'lodash'; import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {cloneDeep} from 'lodash'; + +import type {Channel, ChannelModeration as ChannelPermissions, ChannelModerationPatch} from '@mattermost/types/channels'; +import type {ServerError} from '@mattermost/types/errors'; +import {SyncableType} from '@mattermost/types/groups'; +import type {SyncablePatch, Group} from '@mattermost/types/groups'; +import type {Scheme} from '@mattermost/types/schemes'; +import type {Team} from '@mattermost/types/teams'; +import type {UserProfile} from '@mattermost/types/users'; import {Permissions} from 'mattermost-redux/constants'; -import {ActionFunc, ActionResult} from 'mattermost-redux/types/actions'; - -import {UserProfile} from '@mattermost/types/users'; -import {Scheme} from '@mattermost/types/schemes'; -import {SyncablePatch, Group, SyncableType} from '@mattermost/types/groups'; -import {Channel, ChannelModeration as ChannelPermissions, ChannelModerationPatch} from '@mattermost/types/channels'; -import {Team} from '@mattermost/types/teams'; -import {ServerError} from '@mattermost/types/errors'; +import type {ActionFunc, ActionResult} from 'mattermost-redux/types/actions'; import {trackEvent} from 'actions/telemetry_actions.jsx'; -import ConfirmModal from 'components/confirm_modal'; import BlockableLink from 'components/admin_console/blockable_link'; +import ConfirmModal from 'components/confirm_modal'; import FormError from 'components/form_error'; import AdminHeader from 'components/widgets/admin_console/admin_header'; -import Constants from 'utils/constants'; import {getHistory} from 'utils/browser_history'; +import Constants from 'utils/constants'; -import {NeedGroupsError, UsersWillBeRemovedError} from '../../errors'; -import ConvertConfirmModal from '../../convert_confirm_modal'; -import RemoveConfirmModal from '../../remove_confirm_modal'; -import ConvertAndRemoveConfirmModal from '../../convert_and_remove_confirm_modal'; -import SaveChangesPanel from '../../save_changes_panel'; - -import {ChannelModes} from './channel_modes'; import {ChannelGroups} from './channel_groups'; -import {ChannelProfile} from './channel_profile'; import ChannelMembers from './channel_members'; import ChannelModeration from './channel_moderation'; +import {ChannelModes} from './channel_modes'; +import {ChannelProfile} from './channel_profile'; +import type {ChannelModerationRoles} from './types'; -import {ChannelModerationRoles} from './types'; +import ConvertAndRemoveConfirmModal from '../../convert_and_remove_confirm_modal'; +import ConvertConfirmModal from '../../convert_confirm_modal'; +import {NeedGroupsError, UsersWillBeRemovedError} from '../../errors'; +import RemoveConfirmModal from '../../remove_confirm_modal'; +import SaveChangesPanel from '../../save_changes_panel'; export interface ChannelDetailsProps { channelID: string; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_groups.test.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_groups.test.tsx index 7e67fd4d32..06d82e325d 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_groups.test.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_groups.test.tsx @@ -1,11 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; -import {Group} from '@mattermost/types/groups'; -import {Channel} from '@mattermost/types/channels'; +import type {Channel} from '@mattermost/types/channels'; +import type {Group} from '@mattermost/types/groups'; import {ChannelGroups} from './channel_groups'; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_groups.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_groups.tsx index 22d8592791..a64d70c1a5 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_groups.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_groups.tsx @@ -4,8 +4,8 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {Channel} from '@mattermost/types/channels'; -import {Group} from '@mattermost/types/groups'; +import type {Channel} from '@mattermost/types/channels'; +import type {Group} from '@mattermost/types/groups'; import AddGroupsToChannelModal from 'components/add_groups_to_channel_modal'; import ToggleModalButton from 'components/toggle_modal_button'; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_members/channel_members.test.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_members/channel_members.test.tsx index 1390eea8d6..da14f9566c 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_members/channel_members.test.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_members/channel_members.test.tsx @@ -1,13 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; -import {Channel, ChannelMembership} from '@mattermost/types/channels'; -import {UserProfile} from '@mattermost/types/users'; +import type {Channel, ChannelMembership} from '@mattermost/types/channels'; +import type {UserProfile} from '@mattermost/types/users'; -import {TestHelper} from '../../../../../../utils/test_helper'; +import {TestHelper} from 'utils/test_helper'; import ChannelMembers from './channel_members'; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_members/channel_members.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_members/channel_members.tsx index 57958b9c65..7ad70e6990 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_members/channel_members.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_members/channel_members.tsx @@ -4,22 +4,24 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {ActionResult} from 'mattermost-redux/types/actions'; -import {ServerError} from '@mattermost/types/errors'; -import {UserProfile, UsersStats, GetFilteredUsersStatsOpts} from '@mattermost/types/users'; -import {Channel, ChannelMembership} from '@mattermost/types/channels'; -import GeneralConstants from 'mattermost-redux/constants/general'; +import type {Channel, ChannelMembership} from '@mattermost/types/channels'; +import type {ServerError} from '@mattermost/types/errors'; +import type {UserProfile, UsersStats, GetFilteredUsersStatsOpts} from '@mattermost/types/users'; + +import GeneralConstants from 'mattermost-redux/constants/general'; +import type {ActionResult} from 'mattermost-redux/types/actions'; -import {t} from 'utils/i18n'; -import Constants, {ModalIdentifiers} from 'utils/constants'; import {trackEvent} from 'actions/telemetry_actions.jsx'; -import AdminPanel from 'components/widgets/admin_console/admin_panel'; +import type {FilterOptions} from 'components/admin_console/filter/filter'; import UserGrid from 'components/admin_console/user_grid/user_grid'; -import {BaseMembership} from 'components/admin_console/user_grid/user_grid_role_dropdown'; +import type {BaseMembership} from 'components/admin_console/user_grid/user_grid_role_dropdown'; import ChannelInviteModal from 'components/channel_invite_modal'; import ToggleModalButton from 'components/toggle_modal_button'; -import {FilterOptions} from 'components/admin_console/filter/filter'; +import AdminPanel from 'components/widgets/admin_console/admin_panel'; + +import Constants, {ModalIdentifiers} from 'utils/constants'; +import {t} from 'utils/i18n'; type Props = { channelId: string; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_members/index.ts b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_members/index.ts index 9ed0898555..41cdd16c4b 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_members/index.ts +++ b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_members/index.ts @@ -2,24 +2,26 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {bindActionCreators, Dispatch, ActionCreatorsMapObject} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch, ActionCreatorsMapObject} from 'redux'; -import {ServerError} from '@mattermost/types/errors'; -import {UserProfile, UsersStats, GetFilteredUsersStatsOpts} from '@mattermost/types/users'; -import {ChannelStats} from '@mattermost/types/channels'; +import type {ChannelStats} from '@mattermost/types/channels'; +import type {ServerError} from '@mattermost/types/errors'; +import type {UserProfile, UsersStats, GetFilteredUsersStatsOpts} from '@mattermost/types/users'; -import {filterProfilesStartingWithTerm, profileListToMap} from 'mattermost-redux/utils/user_utils'; -import {ActionResult, ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; import {getChannelStats} from 'mattermost-redux/actions/channels'; import {getFilteredUsersStats} from 'mattermost-redux/actions/users'; import {createSelector} from 'mattermost-redux/selectors/create_selector'; import {getChannelMembersInChannels, getAllChannelStats, getChannel} from 'mattermost-redux/selectors/entities/channels'; -import {makeGetProfilesInChannel, makeSearchProfilesInChannel, filterProfiles, getFilteredUsersStats as selectFilteredUsersStats} from 'mattermost-redux/selectors/entities/users'; import {getConfig} from 'mattermost-redux/selectors/entities/general'; +import {makeGetProfilesInChannel, makeSearchProfilesInChannel, filterProfiles, getFilteredUsersStats as selectFilteredUsersStats} from 'mattermost-redux/selectors/entities/users'; +import type {ActionResult, ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; +import {filterProfilesStartingWithTerm, profileListToMap} from 'mattermost-redux/utils/user_utils'; import {loadProfilesAndReloadChannelMembers, searchProfilesAndChannelMembers} from 'actions/user_actions'; import {setUserGridSearch, setUserGridFilters} from 'actions/views/search'; -import {GlobalState} from 'types/store'; + +import type {GlobalState} from 'types/store'; import ChannelMembers from './channel_members'; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_moderation.test.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_moderation.test.tsx index 117fd7e0e8..4c965c3acd 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_moderation.test.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_moderation.test.tsx @@ -1,10 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; -import {ChannelModeration as ChannelPermissions} from '@mattermost/types/channels'; +import type {ChannelModeration as ChannelPermissions} from '@mattermost/types/channels'; import ChannelModeration, {ChannelModerationTableRow} from './channel_moderation'; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_moderation.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_moderation.tsx index 57608195b7..6ab67d37c5 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_moderation.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_moderation.tsx @@ -1,12 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; -import {FormattedMessage, MessageDescriptor, defineMessages} from 'react-intl'; -import {isNil} from 'lodash'; import classNames from 'classnames'; +import {isNil} from 'lodash'; +import React from 'react'; +import {FormattedMessage, defineMessages} from 'react-intl'; +import type {MessageDescriptor} from 'react-intl'; -import {ChannelModeration as ChannelPermissions} from '@mattermost/types/channels'; +import type {ChannelModeration as ChannelPermissions} from '@mattermost/types/channels'; import {Permissions, Roles} from 'mattermost-redux/constants'; @@ -14,7 +15,7 @@ import FormattedMarkdownMessage from 'components/formatted_markdown_message'; import AdminPanel from 'components/widgets/admin_console/admin_panel'; import CheckboxCheckedIcon from 'components/widgets/icons/checkbox_checked_icon'; -import {ChannelModerationRoles} from './types'; +import type {ChannelModerationRoles} from './types'; const PERIOD_TO_SLASH_REGEX = /\./g; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_modes.test.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_modes.test.tsx index 749ee85a21..f4a88ec49a 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_modes.test.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_modes.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import {ChannelModes} from './channel_modes'; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_modes.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_modes.tsx index 7a2eac86c6..f4a5a9d0ea 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_modes.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_modes.tsx @@ -4,11 +4,12 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; +import ExternalLink from 'components/external_link'; +import AdminPanel from 'components/widgets/admin_console/admin_panel'; + import {t} from 'utils/i18n'; -import AdminPanel from 'components/widgets/admin_console/admin_panel'; import LineSwitch from '../../line_switch'; -import ExternalLink from 'components/external_link'; interface Props { isPublic: boolean; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_profile.test.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_profile.test.tsx index 2c06039733..1fada8bf44 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_profile.test.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_profile.test.tsx @@ -1,11 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; -import {Team} from '@mattermost/types/teams'; -import {Channel} from '@mattermost/types/channels'; +import type {Channel} from '@mattermost/types/channels'; +import type {Team} from '@mattermost/types/teams'; import {ChannelProfile} from './channel_profile'; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_profile.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_profile.tsx index 5608617b30..717f525b9b 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_profile.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_profile.tsx @@ -1,22 +1,20 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import classNames from 'classnames'; import React from 'react'; - import {FormattedMessage} from 'react-intl'; -import classNames from 'classnames'; +import type {Channel} from '@mattermost/types/channels'; +import type {Team} from '@mattermost/types/teams'; -import {Channel} from '@mattermost/types/channels'; -import {Team} from '@mattermost/types/teams'; - -import {t} from 'utils/i18n'; - -import AdminPanel from 'components/widgets/admin_console/admin_panel'; import FormattedMarkdownMessage from 'components/formatted_markdown_message'; +import SharedChannelIndicator from 'components/shared_channel_indicator'; +import AdminPanel from 'components/widgets/admin_console/admin_panel'; import ArchiveIcon from 'components/widgets/icons/archive_icon'; import UnarchiveIcon from 'components/widgets/icons/unarchive_icon'; -import SharedChannelIndicator from 'components/shared_channel_indicator'; + +import {t} from 'utils/i18n'; import './channel_profile.scss'; interface ChannelProfileProps { @@ -105,9 +103,7 @@ export const ChannelProfile: React.SFC = (props: ChannelPro } onClick={props.onToggleArchive} > - {isArchived ? - : - } + {isArchived ? : } Promise<{ data: any }>; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/channel/list/index.ts b/webapp/channels/src/components/admin_console/team_channel_settings/channel/list/index.ts index e60800c4b7..eedb8908d0 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/channel/list/index.ts +++ b/webapp/channels/src/components/admin_console/team_channel_settings/channel/list/index.ts @@ -2,18 +2,20 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {bindActionCreators, Dispatch, ActionCreatorsMapObject} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch, ActionCreatorsMapObject} from 'redux'; -import {ChannelWithTeamData, ChannelSearchOpts} from '@mattermost/types/channels'; +import type {ChannelWithTeamData, ChannelSearchOpts} from '@mattermost/types/channels'; import {getAllChannelsWithCount as getData, searchAllChannels} from 'mattermost-redux/actions/channels'; import {createSelector} from 'mattermost-redux/selectors/create_selector'; import {getAllChannels} from 'mattermost-redux/selectors/entities/channels'; -import {GenericAction, ActionFunc, ActionResult} from 'mattermost-redux/types/actions'; +import type {GenericAction, ActionFunc, ActionResult} from 'mattermost-redux/types/actions'; -import {GlobalState} from 'types/store'; import {Constants} from 'utils/constants'; +import type {GlobalState} from 'types/store'; + import List from './channel_list'; const compareByDisplayName = (a: {display_name: string}, b: {display_name: string}) => a.display_name.localeCompare(b.display_name); diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/convert_and_remove_confirm_modal.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/convert_and_remove_confirm_modal.tsx index 5d8487adca..bc0bdadac1 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/convert_and_remove_confirm_modal.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/convert_and_remove_confirm_modal.tsx @@ -4,9 +4,10 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {t} from 'utils/i18n'; -import FormattedMarkdownMessage from 'components/formatted_markdown_message'; import ConfirmModal from 'components/confirm_modal'; +import FormattedMarkdownMessage from 'components/formatted_markdown_message'; + +import {t} from 'utils/i18n'; type Props = { diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/convert_confirm_modal.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/convert_confirm_modal.tsx index 4398310dfe..e65a622322 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/convert_confirm_modal.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/convert_confirm_modal.tsx @@ -4,10 +4,10 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {t} from 'utils/i18n'; - -import FormattedMarkdownMessage from 'components/formatted_markdown_message'; import ConfirmModal from 'components/confirm_modal'; +import FormattedMarkdownMessage from 'components/formatted_markdown_message'; + +import {t} from 'utils/i18n'; type Props = { @@ -40,18 +40,15 @@ type Props = { const ConvertConfirmModal = ({show, onConfirm, onCancel, displayName, toPublic}: Props) => { const toPublicMsg = 'When you convert **{displayName}** to a public channel, history and membership are preserved. Public channels are discoverable and can by joined by users on the system without invitation. \n \nAre you sure you want to convert **{displayName}** to a public channel?'; const toPrivateMsg = 'When you convert **{displayName}** to a private channel, history and membership are preserved. Publicly shared files remain accessible to anyone with the link. Membership in a private channel is by invitation only. \n \nAre you sure you want to convert **{displayName}** to a private channel?'; - const messageId = toPublic ? t('admin.team_channel_settings.convertConfirmModal.toPublicMessage') : - t('admin.team_channel_settings.convertConfirmModal.toPrivateMessage'); + const messageId = toPublic ? t('admin.team_channel_settings.convertConfirmModal.toPublicMessage') : t('admin.team_channel_settings.convertConfirmModal.toPrivateMessage'); const toPublicTitle = 'Convert {displayName} to a public channel?'; const toPrivateTitle = 'Convert {displayName} to a private channel?'; - const titleId = toPublic ? t('admin.team_channel_settings.convertConfirmModal.toPublicTitle') : - t('admin.team_channel_settings.convertConfirmModal.toPrivateTitle'); + const titleId = toPublic ? t('admin.team_channel_settings.convertConfirmModal.toPublicTitle') : t('admin.team_channel_settings.convertConfirmModal.toPrivateTitle'); const toPublicConfirmMsg = 'Yes, convert to public channel'; const toPrivateConfirmMsg = 'Yes, convert to private channel'; - const confirmMsgId = toPublic ? t('admin.team_channel_settings.convertConfirmModal.toPublicConfirm') : - t('admin.team_channel_settings.convertConfirmModal.toPrivateConfirm'); + const confirmMsgId = toPublic ? t('admin.team_channel_settings.convertConfirmModal.toPublicConfirm') : t('admin.team_channel_settings.convertConfirmModal.toPrivateConfirm'); const title = ( >; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/remove_confirm_modal.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/remove_confirm_modal.tsx index 69a15fa559..4847685e07 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/remove_confirm_modal.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/remove_confirm_modal.tsx @@ -4,9 +4,10 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {t} from 'utils/i18n'; import ConfirmModal from 'components/confirm_modal'; +import {t} from 'utils/i18n'; + type Props = { /* diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/save_changes_panel.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/save_changes_panel.tsx index ad8b60bbcc..b1dd93d6c6 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/save_changes_panel.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/save_changes_panel.tsx @@ -2,12 +2,12 @@ // See LICENSE.txt for license information. import React from 'react'; - import {FormattedMessage} from 'react-intl'; -import SaveButton from 'components/save_button'; -import {localizeMessage} from 'utils/utils'; import BlockableLink from 'components/admin_console/blockable_link'; +import SaveButton from 'components/save_button'; + +import {localizeMessage} from 'utils/utils'; type Props = { saving: boolean; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/index.ts b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/index.ts index 91a1300e20..77f7364d59 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/index.ts +++ b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/index.ts @@ -1,26 +1,28 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {ActionCreatorsMapObject, Dispatch, bindActionCreators} from 'redux'; -import {RouteComponentProps} from 'react-router-dom'; import {connect} from 'react-redux'; +import type {RouteComponentProps} from 'react-router-dom'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; -import {GlobalState} from 'types/store'; - -import {getTeam} from 'mattermost-redux/selectors/entities/teams'; -import {getTeam as fetchTeam, membersMinusGroupMembers, patchTeam, removeUserFromTeam, updateTeamMemberSchemeRoles, addUserToTeam, deleteTeam, unarchiveTeam} from 'mattermost-redux/actions/teams'; -import {getAllGroups, getGroupsAssociatedToTeam} from 'mattermost-redux/selectors/entities/groups'; import { getGroupsAssociatedToTeam as fetchAssociatedGroups, linkGroupSyncable, unlinkGroupSyncable, patchGroupSyncable, } from 'mattermost-redux/actions/groups'; -import {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; +import {getTeam as fetchTeam, membersMinusGroupMembers, patchTeam, removeUserFromTeam, updateTeamMemberSchemeRoles, addUserToTeam, deleteTeam, unarchiveTeam} from 'mattermost-redux/actions/teams'; +import {getAllGroups, getGroupsAssociatedToTeam} from 'mattermost-redux/selectors/entities/groups'; +import {getTeam} from 'mattermost-redux/selectors/entities/teams'; +import type {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; import {setNavigationBlocked} from 'actions/admin_actions'; -import TeamDetails, {Props} from './team_details'; +import type {GlobalState} from 'types/store'; + +import TeamDetails from './team_details'; +import type {Props} from './team_details'; type Params = { team_id: string; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_details.test.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_details.test.tsx index 0941308e83..7c42aaecc8 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_details.test.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_details.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import {TestHelper} from 'utils/test_helper'; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_details.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_details.tsx index a913f19a5c..649a2a83f3 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_details.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_details.tsx @@ -1,17 +1,16 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {cloneDeep} from 'lodash'; import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {cloneDeep} from 'lodash'; -import {Team} from '@mattermost/types/teams'; -import {UserProfile} from '@mattermost/types/users'; -import {Group, SyncablePatch, SyncableType} from '@mattermost/types/groups'; +import {SyncableType} from '@mattermost/types/groups'; +import type {Group, SyncablePatch} from '@mattermost/types/groups'; +import type {Team} from '@mattermost/types/teams'; +import type {UserProfile} from '@mattermost/types/users'; -import {ActionResult} from 'mattermost-redux/types/actions'; - -import {getHistory} from 'utils/browser_history'; +import type {ActionResult} from 'mattermost-redux/types/actions'; import {trackEvent} from 'actions/telemetry_actions.jsx'; @@ -20,14 +19,16 @@ import ConfirmModal from 'components/confirm_modal'; import FormError from 'components/form_error'; import AdminHeader from 'components/widgets/admin_console/admin_header'; -import RemoveConfirmModal from '../../remove_confirm_modal'; -import {NeedDomainsError, NeedGroupsError, UsersWillBeRemovedError} from '../../errors'; -import SaveChangesPanel from '../../save_changes_panel'; +import {getHistory} from 'utils/browser_history'; -import {TeamProfile} from './team_profile'; -import {TeamModes} from './team_modes'; import {TeamGroups} from './team_groups'; import TeamMembers from './team_members/index'; +import {TeamModes} from './team_modes'; +import {TeamProfile} from './team_profile'; + +import {NeedDomainsError, NeedGroupsError, UsersWillBeRemovedError} from '../../errors'; +import RemoveConfirmModal from '../../remove_confirm_modal'; +import SaveChangesPanel from '../../save_changes_panel'; export type Props = { teamID: string; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_groups.test.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_groups.test.tsx index 41b7737567..80dca9908f 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_groups.test.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_groups.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import {TestHelper} from 'utils/test_helper'; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_groups.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_groups.tsx index 61232c63a3..a4a4a71d89 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_groups.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_groups.tsx @@ -4,8 +4,8 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {Team} from '@mattermost/types/teams'; -import {Group} from '@mattermost/types/groups'; +import type {Group} from '@mattermost/types/groups'; +import type {Team} from '@mattermost/types/teams'; import AddGroupsToTeamModal from 'components/add_groups_to_team_modal'; import ToggleModalButton from 'components/toggle_modal_button'; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_members/index.ts b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_members/index.ts index b5b37f7df1..8e7162523c 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_members/index.ts +++ b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_members/index.ts @@ -2,25 +2,25 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {bindActionCreators, Dispatch, ActionCreatorsMapObject} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch, ActionCreatorsMapObject} from 'redux'; -import {ServerError} from '@mattermost/types/errors'; -import {UserProfile, UsersStats, GetFilteredUsersStatsOpts} from '@mattermost/types/users'; -import {GenericAction, ActionFunc, ActionResult} from 'mattermost-redux/types/actions'; - -import {filterProfilesStartingWithTerm, profileListToMap} from 'mattermost-redux/utils/user_utils'; +import type {ServerError} from '@mattermost/types/errors'; +import type {UserProfile, UsersStats, GetFilteredUsersStatsOpts} from '@mattermost/types/users'; import {getTeamStats as loadTeamStats} from 'mattermost-redux/actions/teams'; import {getFilteredUsersStats} from 'mattermost-redux/actions/users'; - +import {getConfig} from 'mattermost-redux/selectors/entities/general'; import {getMembersInTeams, getTeamStats, getTeam} from 'mattermost-redux/selectors/entities/teams'; import {getProfilesInTeam, searchProfilesInTeam, filterProfiles, getFilteredUsersStats as selectFilteredUsersStats} from 'mattermost-redux/selectors/entities/users'; -import {getConfig} from 'mattermost-redux/selectors/entities/general'; +import type {GenericAction, ActionFunc, ActionResult} from 'mattermost-redux/types/actions'; +import {filterProfilesStartingWithTerm, profileListToMap} from 'mattermost-redux/utils/user_utils'; -import {GlobalState} from 'types/store'; import {loadProfilesAndReloadTeamMembers, searchProfilesAndTeamMembers} from 'actions/user_actions'; import {setUserGridSearch, setUserGridFilters} from 'actions/views/search'; +import type {GlobalState} from 'types/store'; + import TeamMembers from './team_members'; type Props = { diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_members/team_members.test.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_members/team_members.test.tsx index b57e892243..c93a56a1db 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_members/team_members.test.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_members/team_members.test.tsx @@ -1,13 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; -import {Team, TeamMembership} from '@mattermost/types/teams'; -import {UserProfile} from '@mattermost/types/users'; +import type {Team, TeamMembership} from '@mattermost/types/teams'; +import type {UserProfile} from '@mattermost/types/users'; -import {TestHelper} from '../../../../../../utils/test_helper'; +import {TestHelper} from 'utils/test_helper'; import TeamMembers from './team_members'; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_members/team_members.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_members/team_members.tsx index eff236e3d3..fa52337c5a 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_members/team_members.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_members/team_members.tsx @@ -4,22 +4,24 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {ServerError} from '@mattermost/types/errors'; -import {ActionResult} from 'mattermost-redux/types/actions'; -import {UserProfile, UsersStats, GetFilteredUsersStatsOpts} from '@mattermost/types/users'; -import {TeamMembership, Team} from '@mattermost/types/teams'; -import GeneralConstants from 'mattermost-redux/constants/general'; +import type {ServerError} from '@mattermost/types/errors'; +import type {TeamMembership, Team} from '@mattermost/types/teams'; +import type {UserProfile, UsersStats, GetFilteredUsersStatsOpts} from '@mattermost/types/users'; + +import GeneralConstants from 'mattermost-redux/constants/general'; +import type {ActionResult} from 'mattermost-redux/types/actions'; -import {t} from 'utils/i18n'; -import Constants, {ModalIdentifiers} from 'utils/constants'; import {trackEvent} from 'actions/telemetry_actions.jsx'; -import AdminPanel from 'components/widgets/admin_console/admin_panel'; -import UserGrid from 'components/admin_console/user_grid/user_grid'; -import {BaseMembership} from 'components/admin_console/user_grid/user_grid_role_dropdown'; import AddUsersToTeamModal from 'components/add_users_to_team_modal'; +import type {FilterOptions} from 'components/admin_console/filter/filter'; +import UserGrid from 'components/admin_console/user_grid/user_grid'; +import type {BaseMembership} from 'components/admin_console/user_grid/user_grid_role_dropdown'; import ToggleModalButton from 'components/toggle_modal_button'; -import {FilterOptions} from 'components/admin_console/filter/filter'; +import AdminPanel from 'components/widgets/admin_console/admin_panel'; + +import Constants, {ModalIdentifiers} from 'utils/constants'; +import {t} from 'utils/i18n'; type Props = { teamId: string; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_modes.test.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_modes.test.tsx index 84387b1a47..3c5c5f9d40 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_modes.test.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_modes.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import {TeamModes} from './team_modes'; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_modes.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_modes.tsx index d07796dbcf..dd9e2fa68c 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_modes.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_modes.tsx @@ -4,11 +4,12 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {t} from 'utils/i18n'; +import ExternalLink from 'components/external_link'; import AdminPanel from 'components/widgets/admin_console/admin_panel'; +import {t} from 'utils/i18n'; + import LineSwitch from '../../line_switch'; -import ExternalLink from 'components/external_link'; type Props = { syncChecked: boolean; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_profile.test.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_profile.test.tsx index 0a0649799b..a6d2d4310a 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_profile.test.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_profile.test.tsx @@ -1,16 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {shallow} from 'enzyme'; import React from 'react'; import * as reactRedux from 'react-redux'; -import {shallow} from 'enzyme'; import {mountWithIntl} from 'tests/helpers/intl-test-helper'; -import {TestHelper} from 'utils/test_helper'; import mockStore from 'tests/test_store'; - import {CloudProducts} from 'utils/constants'; import {FileSizes} from 'utils/file_utils'; +import {TestHelper} from 'utils/test_helper'; import {TeamProfile} from './team_profile'; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_profile.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_profile.tsx index 65f010ae5e..fa9046ca62 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_profile.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_profile.tsx @@ -1,31 +1,33 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import classNames from 'classnames'; +import {noop} from 'lodash'; import React, {useEffect, useState} from 'react'; import {FormattedMessage} from 'react-intl'; -import classNames from 'classnames'; import {useDispatch, useSelector} from 'react-redux'; -import {noop} from 'lodash'; + +import type {Team} from '@mattermost/types/teams'; + +import {getLicense} from 'mattermost-redux/selectors/entities/general'; + +import {openModal} from 'actions/views/modals'; + +import useGetUsage from 'components/common/hooks/useGetUsage'; +import useGetUsageDeltas from 'components/common/hooks/useGetUsageDeltas'; +import FormattedMarkdownMessage from 'components/formatted_markdown_message'; +import OverlayTrigger from 'components/overlay_trigger'; +import PricingModal from 'components/pricing_modal'; +import Tooltip from 'components/tooltip'; +import AdminPanel from 'components/widgets/admin_console/admin_panel'; +import ArchiveIcon from 'components/widgets/icons/archive_icon'; +import UnarchiveIcon from 'components/widgets/icons/unarchive_icon'; +import TeamIcon from 'components/widgets/team_icon/team_icon'; import {ModalIdentifiers} from 'utils/constants'; import {t} from 'utils/i18n'; import {imageURLForTeam, localizeMessage} from 'utils/utils'; -import {Team} from '@mattermost/types/teams'; -import {getLicense} from 'mattermost-redux/selectors/entities/general'; -import {openModal} from 'actions/views/modals'; - -import useGetUsage from 'components/common/hooks/useGetUsage'; -import PricingModal from 'components/pricing_modal'; -import Tooltip from 'components/tooltip'; -import OverlayTrigger from 'components/overlay_trigger'; -import useGetUsageDeltas from 'components/common/hooks/useGetUsageDeltas'; -import AdminPanel from 'components/widgets/admin_console/admin_panel'; -import FormattedMarkdownMessage from 'components/formatted_markdown_message'; -import ArchiveIcon from 'components/widgets/icons/archive_icon'; -import UnarchiveIcon from 'components/widgets/icons/unarchive_icon'; -import TeamIcon from 'components/widgets/team_icon/team_icon'; - import './team_profile.scss'; type Props = { diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/team/index.ts b/webapp/channels/src/components/admin_console/team_channel_settings/team/index.ts index 7a853f615d..95e2cf975e 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/team/index.ts +++ b/webapp/channels/src/components/admin_console/team_channel_settings/team/index.ts @@ -3,8 +3,9 @@ import {connect} from 'react-redux'; +import type {GlobalState} from '@mattermost/types/store'; + import {getConfig} from 'mattermost-redux/selectors/entities/general'; -import {GlobalState} from '@mattermost/types/store'; import {TeamsSettings} from './team_settings'; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/team/list/index.ts b/webapp/channels/src/components/admin_console/team_channel_settings/team/list/index.ts index f54bc10915..22ef409019 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/team/list/index.ts +++ b/webapp/channels/src/components/admin_console/team_channel_settings/team/list/index.ts @@ -2,17 +2,17 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; + +import type {TeamSearchOpts, TeamsWithCount} from '@mattermost/types/teams'; import {getTeams as fetchTeams, searchTeams} from 'mattermost-redux/actions/teams'; -import {getTeams} from 'mattermost-redux/selectors/entities/teams'; import {createSelector} from 'mattermost-redux/selectors/create_selector'; +import {getTeams} from 'mattermost-redux/selectors/entities/teams'; +import type {ActionFunc} from 'mattermost-redux/types/actions'; -import {ActionFunc} from 'mattermost-redux/types/actions'; - -import {TeamSearchOpts, TeamsWithCount} from '@mattermost/types/teams'; - -import {GlobalState} from 'types/store'; +import type {GlobalState} from 'types/store'; import TeamList from './team_list'; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/team/list/team_list.test.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/team/list/team_list.test.tsx index 8f12f30eb2..ef3a617f2d 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/team/list/team_list.test.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/team/list/team_list.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import {TestHelper} from 'utils/test_helper'; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/team/list/team_list.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/team/list/team_list.tsx index 459c173ceb..1ab281094f 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/team/list/team_list.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/team/list/team_list.tsx @@ -5,20 +5,20 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; import {Link} from 'react-router-dom'; +import type {Team, TeamSearchOpts, TeamsWithCount} from '@mattermost/types/teams'; + import {debounce} from 'mattermost-redux/actions/helpers'; -import {Team, TeamSearchOpts, TeamsWithCount} from '@mattermost/types/teams'; - -import {getHistory} from 'utils/browser_history'; - -import * as Utils from 'utils/utils'; - -import DataGrid, {Column} from 'components/admin_console/data_grid/data_grid'; +import DataGrid from 'components/admin_console/data_grid/data_grid'; +import type {Column} from 'components/admin_console/data_grid/data_grid'; +import type {FilterOptions} from 'components/admin_console/filter/filter'; import {PAGE_SIZE} from 'components/admin_console/team_channel_settings/abstract_list'; import TeamIcon from 'components/widgets/team_icon/team_icon'; +import {getHistory} from 'utils/browser_history'; +import * as Utils from 'utils/utils'; + import './team_list.scss'; -import {FilterOptions} from 'components/admin_console/filter/filter'; const ROW_HEIGHT = 80; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/team/team_settings.test.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/team/team_settings.test.tsx index bbfc090ca0..a4c45071dc 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/team/team_settings.test.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/team/team_settings.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import {TeamsSettings} from './team_settings'; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/team/team_settings.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/team/team_settings.tsx index 6dad191d4e..52cffd5ac2 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/team/team_settings.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/team/team_settings.tsx @@ -4,10 +4,11 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {t} from 'utils/i18n'; import TeamList from 'components/admin_console/team_channel_settings/team/list'; -import AdminPanel from 'components/widgets/admin_console/admin_panel'; import AdminHeader from 'components/widgets/admin_console/admin_header'; +import AdminPanel from 'components/widgets/admin_console/admin_panel'; + +import {t} from 'utils/i18n'; type Props = { siteName: string; diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/users_to_be_removed_modal.tsx b/webapp/channels/src/components/admin_console/team_channel_settings/users_to_be_removed_modal.tsx index 76e18c5ae6..1811711efe 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/users_to_be_removed_modal.tsx +++ b/webapp/channels/src/components/admin_console/team_channel_settings/users_to_be_removed_modal.tsx @@ -2,10 +2,10 @@ // See LICENSE.txt for license information. import React, {useCallback, useState} from 'react'; -import {FormattedMessage} from 'react-intl'; import {Modal} from 'react-bootstrap'; +import {FormattedMessage} from 'react-intl'; -import {UserProfile} from '@mattermost/types/users'; +import type {UserProfile} from '@mattermost/types/users'; import FormattedMarkdownMessage from 'components/formatted_markdown_message'; diff --git a/webapp/channels/src/components/admin_console/text_setting.tsx b/webapp/channels/src/components/admin_console/text_setting.tsx index f83c85aece..8da7671ba6 100644 --- a/webapp/channels/src/components/admin_console/text_setting.tsx +++ b/webapp/channels/src/components/admin_console/text_setting.tsx @@ -3,7 +3,8 @@ import React from 'react'; -import TextSetting, {Props as WidgetTextSettingProps} from 'components/widgets/settings/text_setting'; +import TextSetting from 'components/widgets/settings/text_setting'; +import type {Props as WidgetTextSettingProps} from 'components/widgets/settings/text_setting'; import SetByEnv from './set_by_env'; diff --git a/webapp/channels/src/components/admin_console/user_autocomplete_setting/index.tsx b/webapp/channels/src/components/admin_console/user_autocomplete_setting/index.tsx index 32df56dbd4..072c2290af 100644 --- a/webapp/channels/src/components/admin_console/user_autocomplete_setting/index.tsx +++ b/webapp/channels/src/components/admin_console/user_autocomplete_setting/index.tsx @@ -2,14 +2,15 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; +import type {ActionFunc} from 'mattermost-redux/types/actions'; import {autocompleteUsers} from 'actions/user_actions'; -import {ActionFunc} from 'mattermost-redux/types/actions'; - -import UserAutocompleteSetting, {Props} from './user_autocomplete_setting'; +import UserAutocompleteSetting from './user_autocomplete_setting'; +import type {Props} from './user_autocomplete_setting'; function mapDispatchToProps(dispatch: Dispatch) { return { diff --git a/webapp/channels/src/components/admin_console/user_autocomplete_setting/user_autocomplete_setting.tsx b/webapp/channels/src/components/admin_console/user_autocomplete_setting/user_autocomplete_setting.tsx index 9ce123e69a..67d114a468 100644 --- a/webapp/channels/src/components/admin_console/user_autocomplete_setting/user_autocomplete_setting.tsx +++ b/webapp/channels/src/components/admin_console/user_autocomplete_setting/user_autocomplete_setting.tsx @@ -3,11 +3,11 @@ import React, {useCallback, useRef} from 'react'; -import {UserProfile} from '@mattermost/types/users'; -import {UserAutocomplete} from '@mattermost/types/autocomplete'; +import type {UserAutocomplete} from '@mattermost/types/autocomplete'; +import type {UserProfile} from '@mattermost/types/users'; -import GenericUserProvider from 'components/suggestion/generic_user_provider'; import Setting from 'components/admin_console/setting'; +import GenericUserProvider from 'components/suggestion/generic_user_provider'; import SuggestionBox from 'components/suggestion/suggestion_box'; import SuggestionList from 'components/suggestion/suggestion_list'; diff --git a/webapp/channels/src/components/admin_console/user_grid/user_grid.test.tsx b/webapp/channels/src/components/admin_console/user_grid/user_grid.test.tsx index 1ae44938d8..96563557db 100644 --- a/webapp/channels/src/components/admin_console/user_grid/user_grid.test.tsx +++ b/webapp/channels/src/components/admin_console/user_grid/user_grid.test.tsx @@ -1,11 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; -import {UserProfile} from '@mattermost/types/users'; -import {TeamMembership} from '@mattermost/types/teams'; +import type {TeamMembership} from '@mattermost/types/teams'; +import type {UserProfile} from '@mattermost/types/users'; import {TestHelper} from 'utils/test_helper'; diff --git a/webapp/channels/src/components/admin_console/user_grid/user_grid.tsx b/webapp/channels/src/components/admin_console/user_grid/user_grid.tsx index 7abe32ff04..08f451eb5b 100644 --- a/webapp/channels/src/components/admin_console/user_grid/user_grid.tsx +++ b/webapp/channels/src/components/admin_console/user_grid/user_grid.tsx @@ -4,18 +4,19 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; +import type {ChannelMembership} from '@mattermost/types/channels'; +import type {TeamMembership} from '@mattermost/types/teams'; +import type {UserProfile} from '@mattermost/types/users'; + +import DataGrid from 'components/admin_console/data_grid/data_grid'; +import type {Row, Column} from 'components/admin_console/data_grid/data_grid'; +import type {FilterOptions} from 'components/admin_console/filter/filter'; import Tag from 'components/widgets/tag/tag'; -import {FilterOptions} from 'components/admin_console/filter/filter'; -import DataGrid, {Row, Column} from 'components/admin_console/data_grid/data_grid'; - -import {UserProfile} from '@mattermost/types/users'; -import {TeamMembership} from '@mattermost/types/teams'; -import {ChannelMembership} from '@mattermost/types/channels'; - import UserGridName from './user_grid_name'; import UserGridRemove from './user_grid_remove'; -import UserGridRoleDropdown, {BaseMembership} from './user_grid_role_dropdown'; +import UserGridRoleDropdown from './user_grid_role_dropdown'; +import type {BaseMembership} from './user_grid_role_dropdown'; import './user_grid.scss'; diff --git a/webapp/channels/src/components/admin_console/user_grid/user_grid_name.tsx b/webapp/channels/src/components/admin_console/user_grid/user_grid_name.tsx index e7ae48653a..57ba1cbf97 100644 --- a/webapp/channels/src/components/admin_console/user_grid/user_grid_name.tsx +++ b/webapp/channels/src/components/admin_console/user_grid/user_grid_name.tsx @@ -3,8 +3,9 @@ import React from 'react'; +import type {UserProfile} from '@mattermost/types/users'; + import {Client4} from 'mattermost-redux/client'; -import {UserProfile} from '@mattermost/types/users'; import ProfilePicture from 'components/profile_picture'; diff --git a/webapp/channels/src/components/admin_console/user_grid/user_grid_remove.tsx b/webapp/channels/src/components/admin_console/user_grid/user_grid_remove.tsx index 68eb2883e2..db3ef022a9 100644 --- a/webapp/channels/src/components/admin_console/user_grid/user_grid_remove.tsx +++ b/webapp/channels/src/components/admin_console/user_grid/user_grid_remove.tsx @@ -2,10 +2,9 @@ // See LICENSE.txt for license information. import React from 'react'; - import {FormattedMessage} from 'react-intl'; -import {UserProfile} from '@mattermost/types/users'; +import type {UserProfile} from '@mattermost/types/users'; type Props = { user: UserProfile; diff --git a/webapp/channels/src/components/admin_console/user_grid/user_grid_role_dropdown.tsx b/webapp/channels/src/components/admin_console/user_grid/user_grid_role_dropdown.tsx index 5f9b3dbcbd..f39e13acfc 100644 --- a/webapp/channels/src/components/admin_console/user_grid/user_grid_role_dropdown.tsx +++ b/webapp/channels/src/components/admin_console/user_grid/user_grid_role_dropdown.tsx @@ -4,20 +4,19 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {UserProfile} from '@mattermost/types/users'; -import {TeamMembership} from '@mattermost/types/teams'; -import {ChannelMembership} from '@mattermost/types/channels'; +import type {ChannelMembership} from '@mattermost/types/channels'; +import type {TeamMembership} from '@mattermost/types/teams'; +import type {UserProfile} from '@mattermost/types/users'; + +import OverlayTrigger from 'components/overlay_trigger'; +import Tooltip from 'components/tooltip'; +import DropdownIcon from 'components/widgets/icons/fa_dropdown_icon'; +import Menu from 'components/widgets/menu/menu'; +import MenuWrapper from 'components/widgets/menu/menu_wrapper'; import {Constants} from 'utils/constants'; import * as Utils from 'utils/utils'; -import Menu from 'components/widgets/menu/menu'; -import MenuWrapper from 'components/widgets/menu/menu_wrapper'; -import OverlayTrigger from 'components/overlay_trigger'; -import Tooltip from 'components/tooltip'; - -import DropdownIcon from 'components/widgets/icons/fa_dropdown_icon'; - export type BaseMembership = { user_id: string; scheme_user: boolean; diff --git a/webapp/channels/src/components/admin_console/workspace-optimization/chips_list.test.tsx b/webapp/channels/src/components/admin_console/workspace-optimization/chips_list.test.tsx index 514597a354..d7a472a6ff 100644 --- a/webapp/channels/src/components/admin_console/workspace-optimization/chips_list.test.tsx +++ b/webapp/channels/src/components/admin_console/workspace-optimization/chips_list.test.tsx @@ -1,10 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; -import ChipsList, {ChipsInfoType} from 'components/admin_console/workspace-optimization/chips_list'; +import ChipsList from 'components/admin_console/workspace-optimization/chips_list'; +import type {ChipsInfoType} from 'components/admin_console/workspace-optimization/chips_list'; import {ItemStatus} from './dashboard.type'; diff --git a/webapp/channels/src/components/admin_console/workspace-optimization/cta_buttons.test.tsx b/webapp/channels/src/components/admin_console/workspace-optimization/cta_buttons.test.tsx index d0e2505bab..d2f79940f9 100644 --- a/webapp/channels/src/components/admin_console/workspace-optimization/cta_buttons.test.tsx +++ b/webapp/channels/src/components/admin_console/workspace-optimization/cta_buttons.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import CtaButtons from 'components/admin_console/workspace-optimization/cta_buttons'; diff --git a/webapp/channels/src/components/admin_console/workspace-optimization/dashboard.data.tsx b/webapp/channels/src/components/admin_console/workspace-optimization/dashboard.data.tsx index 93bfad13b8..b0b6aabd04 100644 --- a/webapp/channels/src/components/admin_console/workspace-optimization/dashboard.data.tsx +++ b/webapp/channels/src/components/admin_console/workspace-optimization/dashboard.data.tsx @@ -13,23 +13,26 @@ import { LockOutlineIcon, AccountMultipleOutlineIcon, } from '@mattermost/compass-icons/components'; +import type {AdminConfig} from '@mattermost/types/config'; +import type {GlobalState} from '@mattermost/types/store'; import {getLicense, getServerVersion} from 'mattermost-redux/selectors/entities/general'; -import {GlobalState} from '@mattermost/types/store'; +import useOpenSalesLink from 'components/common/hooks/useOpenSalesLink'; import {ConsolePages} from 'utils/constants'; -import {daysToLicenseExpire, isEnterpriseOrE20License, getIsStarterLicense} from '../../../utils/license_utils'; -import useOpenSalesLink from 'components/common/hooks/useOpenSalesLink'; -import {AdminConfig} from '@mattermost/types/config'; -import {runConfigChecks} from './dashboard_checks/config'; -import {DataModel, ItemStatus, Options} from './dashboard.type'; + +import {ItemStatus} from './dashboard.type'; +import type {DataModel, Options} from './dashboard.type'; import {runAccessChecks} from './dashboard_checks/access'; +import {runConfigChecks} from './dashboard_checks/config'; import {runDataPrivacyChecks} from './dashboard_checks/data_privacy'; -import {runPerformanceChecks} from './dashboard_checks/performance'; import {runEaseOfUseChecks} from './dashboard_checks/easy_management'; +import {runPerformanceChecks} from './dashboard_checks/performance'; import {runUpdateChecks} from './dashboard_checks/updates'; +import {daysToLicenseExpire, isEnterpriseOrE20License, getIsStarterLicense} from '../../../utils/license_utils'; + export const impactModifiers: Record = { [ItemStatus.NONE]: 1, [ItemStatus.OK]: 1, diff --git a/webapp/channels/src/components/admin_console/workspace-optimization/dashboard.tsx b/webapp/channels/src/components/admin_console/workspace-optimization/dashboard.tsx index 339540a66c..8dfa9479c9 100644 --- a/webapp/channels/src/components/admin_console/workspace-optimization/dashboard.tsx +++ b/webapp/channels/src/components/admin_console/workspace-optimization/dashboard.tsx @@ -1,27 +1,28 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; -import styled from 'styled-components'; import classNames from 'classnames'; +import React from 'react'; import {FormattedMessage} from 'react-intl'; +import styled from 'styled-components'; import {CheckIcon} from '@mattermost/compass-icons/components'; -import Accordion, {AccordionItemType} from 'components/common/accordion/accordion'; +import Accordion from 'components/common/accordion/accordion'; +import type {AccordionItemType} from 'components/common/accordion/accordion'; +import LoadingScreen from 'components/loading_screen'; import AdminHeader from 'components/widgets/admin_console/admin_header'; -import LoadingScreen from '../../loading_screen'; +import ChipsList from './chips_list'; +import type {ChipsInfoType} from './chips_list'; +import CtaButtons from './cta_buttons'; +import useMetricsData from './dashboard.data'; +import {ItemStatus} from './dashboard.type'; +import OverallScore from './overall-score'; + import type {Props} from '../admin_console'; -import ChipsList, {ChipsInfoType} from './chips_list'; -import CtaButtons from './cta_buttons'; - -import useMetricsData from './dashboard.data'; - import './dashboard.scss'; -import OverallScore from './overall-score'; -import {ItemStatus} from './dashboard.type'; const AccordionItem = styled.div` padding: 12px; diff --git a/webapp/channels/src/components/admin_console/workspace-optimization/dashboard_checks/access.ts b/webapp/channels/src/components/admin_console/workspace-optimization/dashboard_checks/access.ts index e8f37024bb..482aac6629 100644 --- a/webapp/channels/src/components/admin_console/workspace-optimization/dashboard_checks/access.ts +++ b/webapp/channels/src/components/admin_console/workspace-optimization/dashboard_checks/access.ts @@ -1,13 +1,18 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {useIntl} from 'react-intl'; -import {ItemModel, ItemStatus} from '../dashboard.type'; -import {ConsolePages, DocLinks} from 'utils/constants'; -import {impactModifiers} from '../dashboard.data'; -import {AdminConfig} from '@mattermost/types/config'; +import type {useIntl} from 'react-intl'; + +import type {AdminConfig} from '@mattermost/types/config'; + import {testSiteURL} from 'actions/admin_actions'; +import {ConsolePages, DocLinks} from 'utils/constants'; + +import {impactModifiers} from '../dashboard.data'; +import {ItemStatus} from '../dashboard.type'; +import type {ItemModel} from '../dashboard.type'; + /** * * @description Checking to see if the siteURL is configured correctly by running it through the same "check siteURL" button that exists on the webserver page. diff --git a/webapp/channels/src/components/admin_console/workspace-optimization/dashboard_checks/config.ts b/webapp/channels/src/components/admin_console/workspace-optimization/dashboard_checks/config.ts index 3cc59e7939..921addae37 100644 --- a/webapp/channels/src/components/admin_console/workspace-optimization/dashboard_checks/config.ts +++ b/webapp/channels/src/components/admin_console/workspace-optimization/dashboard_checks/config.ts @@ -3,11 +3,15 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import {AdminConfig} from '@mattermost/types/config'; -import {useIntl} from 'react-intl'; +import type {useIntl} from 'react-intl'; + +import type {AdminConfig} from '@mattermost/types/config'; + import {ConsolePages, DocLinks} from 'utils/constants'; -import {ItemModel, ItemStatus, Options} from '../dashboard.type'; + import {impactModifiers} from '../dashboard.data'; +import {ItemStatus} from '../dashboard.type'; +import type {ItemModel, Options} from '../dashboard.type'; /** * diff --git a/webapp/channels/src/components/admin_console/workspace-optimization/dashboard_checks/data_privacy.ts b/webapp/channels/src/components/admin_console/workspace-optimization/dashboard_checks/data_privacy.ts index 049f90015c..dacaf7f6a0 100644 --- a/webapp/channels/src/components/admin_console/workspace-optimization/dashboard_checks/data_privacy.ts +++ b/webapp/channels/src/components/admin_console/workspace-optimization/dashboard_checks/data_privacy.ts @@ -1,12 +1,17 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {useIntl} from 'react-intl'; -import {impactModifiers} from '../dashboard.data'; -import {ConsolePages, DocLinks} from 'utils/constants'; +import type {useIntl} from 'react-intl'; + +import type {AdminConfig} from '@mattermost/types/config'; + import {Client4} from 'mattermost-redux/client'; -import {ItemStatus, Options} from '../dashboard.type'; -import {AdminConfig} from '@mattermost/types/config'; + +import {ConsolePages, DocLinks} from 'utils/constants'; + +import {impactModifiers} from '../dashboard.data'; +import {ItemStatus} from '../dashboard.type'; +import type {Options} from '../dashboard.type'; /** * diff --git a/webapp/channels/src/components/admin_console/workspace-optimization/dashboard_checks/easy_management.ts b/webapp/channels/src/components/admin_console/workspace-optimization/dashboard_checks/easy_management.ts index 1dc19cc909..51fde21671 100644 --- a/webapp/channels/src/components/admin_console/workspace-optimization/dashboard_checks/easy_management.ts +++ b/webapp/channels/src/components/admin_console/workspace-optimization/dashboard_checks/easy_management.ts @@ -1,15 +1,20 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {AdminConfig} from '@mattermost/types/config'; -import {useIntl} from 'react-intl'; -import {ItemModel, ItemStatus, Options} from '../dashboard.type'; +import type {useIntl} from 'react-intl'; + +import type {AdminConfig} from '@mattermost/types/config'; + +import {ldapTest} from 'actions/admin_actions'; + import {ConsolePages, DocLinks} from 'utils/constants'; + import {impactModifiers} from '../dashboard.data'; +import {ItemStatus} from '../dashboard.type'; +import type {ItemModel, Options} from '../dashboard.type'; // import {Client4} from 'mattermost-redux/client'; // import {AnalyticsRow} from '@mattermost/types/admin'; -import {ldapTest} from 'actions/admin_actions'; const usesLDAP = async ( config: Partial, diff --git a/webapp/channels/src/components/admin_console/workspace-optimization/dashboard_checks/performance.ts b/webapp/channels/src/components/admin_console/workspace-optimization/dashboard_checks/performance.ts index 50d7f6f662..25573ff28c 100644 --- a/webapp/channels/src/components/admin_console/workspace-optimization/dashboard_checks/performance.ts +++ b/webapp/channels/src/components/admin_console/workspace-optimization/dashboard_checks/performance.ts @@ -1,12 +1,17 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {AdminConfig} from '@mattermost/types/config'; -import {ItemModel, ItemStatus, Options} from '../dashboard.type'; +import type {useIntl} from 'react-intl'; + +import type {AdminConfig} from '@mattermost/types/config'; + import {elasticsearchTest} from 'actions/admin_actions'; -import {useIntl} from 'react-intl'; + import {ConsolePages, DocLinks} from 'utils/constants'; + import {impactModifiers} from '../dashboard.data'; +import {ItemStatus} from '../dashboard.type'; +import type {ItemModel, Options} from '../dashboard.type'; const search = async ( config: Partial, diff --git a/webapp/channels/src/components/admin_console/workspace-optimization/dashboard_checks/updates.ts b/webapp/channels/src/components/admin_console/workspace-optimization/dashboard_checks/updates.ts index 438e358f6d..3a0d4f6a8f 100644 --- a/webapp/channels/src/components/admin_console/workspace-optimization/dashboard_checks/updates.ts +++ b/webapp/channels/src/components/admin_console/workspace-optimization/dashboard_checks/updates.ts @@ -1,12 +1,17 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import type {useIntl} from 'react-intl'; + +import type {AdminConfig} from '@mattermost/types/config'; + import {Client4} from 'mattermost-redux/client'; -import {ItemStatus, Options} from '../dashboard.type'; -import {useIntl} from 'react-intl'; -import {AdminConfig} from '@mattermost/types/config'; + import {CloudLinks, DocLinks} from 'utils/constants'; + import {impactModifiers} from '../dashboard.data'; +import {ItemStatus} from '../dashboard.type'; +import type {Options} from '../dashboard.type'; const testServerVersion = async ( config: Partial, diff --git a/webapp/channels/src/components/advanced_create_comment/advanced_create_comment.test.tsx b/webapp/channels/src/components/advanced_create_comment/advanced_create_comment.test.tsx index 3eb5e72f5e..127f87b675 100644 --- a/webapp/channels/src/components/advanced_create_comment/advanced_create_comment.test.tsx +++ b/webapp/channels/src/components/advanced_create_comment/advanced_create_comment.test.tsx @@ -1,22 +1,26 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; + +import type {ServerError} from '@mattermost/types/errors'; +import type {FileInfo} from '@mattermost/types/files'; + +import type {ActionResult} from 'mattermost-redux/types/actions'; + +import type {Props} from 'components/advanced_create_comment/advanced_create_comment'; +import AdvancedCreateComment from 'components/advanced_create_comment/advanced_create_comment'; +import AdvanceTextEditor from 'components/advanced_text_editor/advanced_text_editor'; import {testComponentForLineBreak} from 'tests/helpers/line_break_helpers'; import {testComponentForMarkdownHotkeys} from 'tests/helpers/markdown_hotkey_helpers.js'; - import Constants, {ModalIdentifiers} from 'utils/constants'; import {execCommandInsertText} from 'utils/exec_commands'; - -import AdvancedCreateComment, {Props} from 'components/advanced_create_comment/advanced_create_comment'; -import AdvanceTextEditor from 'components/advanced_text_editor/advanced_text_editor'; -import {ActionResult} from 'mattermost-redux/types/actions'; -import {PostDraft} from 'types/store/draft'; -import {ServerError} from '@mattermost/types/errors'; import {TestHelper} from 'utils/test_helper'; -import {FileInfo} from '@mattermost/types/files'; + +import type {PostDraft} from 'types/store/draft'; + jest.mock('utils/exec_commands', () => ({ execCommandInsertText: jest.fn(), })); diff --git a/webapp/channels/src/components/advanced_create_comment/advanced_create_comment.tsx b/webapp/channels/src/components/advanced_create_comment/advanced_create_comment.tsx index a04bc9d297..dfd7e5d992 100644 --- a/webapp/channels/src/components/advanced_create_comment/advanced_create_comment.tsx +++ b/webapp/channels/src/components/advanced_create_comment/advanced_create_comment.tsx @@ -3,38 +3,38 @@ /* eslint-disable max-lines */ -import React from 'react'; import {isNil} from 'lodash'; +import React from 'react'; -import {PreferenceType} from '@mattermost/types/preferences'; -import {Group, GroupSource} from '@mattermost/types/groups'; -import {ChannelMemberCountsByGroup} from '@mattermost/types/channels'; -import {Emoji} from '@mattermost/types/emojis'; -import {ServerError} from '@mattermost/types/errors'; -import {FileInfo} from '@mattermost/types/files'; +import type {ChannelMemberCountsByGroup} from '@mattermost/types/channels'; +import type {Emoji} from '@mattermost/types/emojis'; +import type {ServerError} from '@mattermost/types/errors'; +import type {FileInfo} from '@mattermost/types/files'; +import {GroupSource} from '@mattermost/types/groups'; +import type {Group} from '@mattermost/types/groups'; +import type {PreferenceType} from '@mattermost/types/preferences'; -import {ActionResult} from 'mattermost-redux/types/actions'; +import type {ActionResult} from 'mattermost-redux/types/actions'; import {sortFileInfos} from 'mattermost-redux/utils/file_utils'; import * as GlobalActions from 'actions/global_actions'; -import {PostDraft} from 'types/store/draft'; -import {PluginComponent} from 'types/store/plugins'; -import {ModalData} from 'types/actions'; +import AdvancedTextEditor from 'components/advanced_text_editor/advanced_text_editor'; +import FileLimitStickyBanner from 'components/file_limit_sticky_banner'; +import type {FilePreviewInfo} from 'components/file_preview/file_preview'; +import type {FileUpload as FileUploadClass} from 'components/file_upload/file_upload'; +import NotifyConfirmModal from 'components/notify_confirm_modal'; +import PostDeletedModal from 'components/post_deleted_modal'; +import type {TextboxClass, TextboxElement} from 'components/textbox'; import Constants, {AdvancedTextEditor as AdvancedTextEditorConst, Locations, ModalIdentifiers, Preferences} from 'utils/constants'; +import {execCommandInsertText} from 'utils/exec_commands'; import * as Keyboard from 'utils/keyboard'; -import * as UserAgent from 'utils/user_agent'; -import * as Utils from 'utils/utils'; import { - specialMentionsInText, - postMessageOnKeyPress, - shouldFocusMainTextbox, - isErrorInvalidSlashCommand, - splitMessageBasedOnCaretPosition, - groupsMentionedInText, - mentionsMinusSpecialMentionsInText, -} from 'utils/post_utils'; + applyMarkdown, +} from 'utils/markdown/apply_markdown'; +import type { + ApplyMarkdownOptions} from 'utils/markdown/apply_markdown'; import { getHtmlTable, hasHtmlLink, @@ -45,18 +45,20 @@ import { formatMarkdownLinkMessage, } from 'utils/paste'; import { - applyMarkdown, - ApplyMarkdownOptions, -} from 'utils/markdown/apply_markdown'; -import {execCommandInsertText} from 'utils/exec_commands'; + specialMentionsInText, + postMessageOnKeyPress, + shouldFocusMainTextbox, + isErrorInvalidSlashCommand, + splitMessageBasedOnCaretPosition, + groupsMentionedInText, + mentionsMinusSpecialMentionsInText, +} from 'utils/post_utils'; +import * as UserAgent from 'utils/user_agent'; +import * as Utils from 'utils/utils'; -import NotifyConfirmModal from 'components/notify_confirm_modal'; -import {FileUpload as FileUploadClass} from 'components/file_upload/file_upload'; -import PostDeletedModal from 'components/post_deleted_modal'; -import {FilePreviewInfo} from 'components/file_preview/file_preview'; -import AdvancedTextEditor from 'components/advanced_text_editor/advanced_text_editor'; -import {TextboxClass, TextboxElement} from 'components/textbox'; -import FileLimitStickyBanner from 'components/file_limit_sticky_banner'; +import type {ModalData} from 'types/actions'; +import type {PostDraft} from 'types/store/draft'; +import type {PluginComponent} from 'types/store/plugins'; const KeyCodes = Constants.KeyCodes; diff --git a/webapp/channels/src/components/advanced_create_comment/index.ts b/webapp/channels/src/components/advanced_create_comment/index.ts index 7400a056ec..e581ffded2 100644 --- a/webapp/channels/src/components/advanced_create_comment/index.ts +++ b/webapp/channels/src/components/advanced_create_comment/index.ts @@ -2,36 +2,26 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; -import {GlobalState} from 'types/store/index.js'; +import type {PreferenceType} from '@mattermost/types/preferences'; -import {ModalData} from 'types/actions.js'; - -import {ActionFunc, ActionResult, DispatchFunc} from 'mattermost-redux/types/actions.js'; - -import {PostDraft} from 'types/store/draft'; - -import {getCurrentUserId} from 'mattermost-redux/selectors/entities/common'; - -import {getConfig, getLicense} from 'mattermost-redux/selectors/entities/general'; -import {haveIChannelPermission} from 'mattermost-redux/selectors/entities/roles'; -import {getBool, isCustomGroupsEnabled} from 'mattermost-redux/selectors/entities/preferences'; -import {getAllChannelStats, getChannelMemberCountsByGroup as selectChannelMemberCountsByGroup} from 'mattermost-redux/selectors/entities/channels'; -import {makeGetMessageInHistoryItem} from 'mattermost-redux/selectors/entities/posts'; -import {resetCreatePostRequest, resetHistoryIndex} from 'mattermost-redux/actions/posts'; import {getChannelTimezones, getChannelMemberCountsByGroup} from 'mattermost-redux/actions/channels'; -import {Permissions, Preferences, Posts} from 'mattermost-redux/constants'; -import {getAssociatedGroupsForReferenceByMention} from 'mattermost-redux/selectors/entities/groups'; -import {getCurrentTeamId} from 'mattermost-redux/selectors/entities/teams'; -import {PreferenceType} from '@mattermost/types/preferences'; +import {resetCreatePostRequest, resetHistoryIndex} from 'mattermost-redux/actions/posts'; import {savePreferences} from 'mattermost-redux/actions/preferences'; +import {Permissions, Preferences, Posts} from 'mattermost-redux/constants'; +import {getAllChannelStats, getChannelMemberCountsByGroup as selectChannelMemberCountsByGroup} from 'mattermost-redux/selectors/entities/channels'; +import {getCurrentUserId} from 'mattermost-redux/selectors/entities/common'; +import {getConfig, getLicense} from 'mattermost-redux/selectors/entities/general'; +import {getAssociatedGroupsForReferenceByMention} from 'mattermost-redux/selectors/entities/groups'; +import {makeGetMessageInHistoryItem} from 'mattermost-redux/selectors/entities/posts'; +import {getBool, isCustomGroupsEnabled} from 'mattermost-redux/selectors/entities/preferences'; +import {haveIChannelPermission} from 'mattermost-redux/selectors/entities/roles'; +import {getCurrentTeamId} from 'mattermost-redux/selectors/entities/teams'; +import type {ActionFunc, ActionResult, DispatchFunc} from 'mattermost-redux/types/actions.js'; -import {connectionErrorCount} from 'selectors/views/system'; - -import {AdvancedTextEditor, Constants, StoragePrefixes} from 'utils/constants'; -import {getCurrentLocale} from 'selectors/i18n'; - +import {emitShortcutReactToLastPostFrom} from 'actions/post_actions'; import { clearCommentDraftUploads, updateCommentDraft, @@ -39,15 +29,21 @@ import { makeOnSubmit, makeOnEditLatestPost, } from 'actions/views/create_comment'; -import {emitShortcutReactToLastPostFrom} from 'actions/post_actions'; -import {getPostDraft, getIsRhsExpanded, getSelectedPostFocussedAt} from 'selectors/rhs'; -import {showPreviewOnCreateComment} from 'selectors/views/textbox'; -import {setShowPreviewOnCreateComment} from 'actions/views/textbox'; -import {openModal} from 'actions/views/modals'; import {searchAssociatedGroupsForReference} from 'actions/views/group'; +import {openModal} from 'actions/views/modals'; +import {setShowPreviewOnCreateComment} from 'actions/views/textbox'; +import {getCurrentLocale} from 'selectors/i18n'; +import {getPostDraft, getIsRhsExpanded, getSelectedPostFocussedAt} from 'selectors/rhs'; +import {connectionErrorCount} from 'selectors/views/system'; +import {showPreviewOnCreateComment} from 'selectors/views/textbox'; +import {AdvancedTextEditor, Constants, StoragePrefixes} from 'utils/constants'; import {canUploadFiles} from 'utils/file_utils'; +import type {ModalData} from 'types/actions.js'; +import type {PostDraft} from 'types/store/draft'; +import type {GlobalState} from 'types/store/index.js'; + import AdvancedCreateComment from './advanced_create_comment'; type OwnProps = { diff --git a/webapp/channels/src/components/advanced_create_post/advanced_create_post.test.jsx b/webapp/channels/src/components/advanced_create_post/advanced_create_post.test.jsx index dda6dc8e3b..9840c546ae 100644 --- a/webapp/channels/src/components/advanced_create_post/advanced_create_post.test.jsx +++ b/webapp/channels/src/components/advanced_create_post/advanced_create_post.test.jsx @@ -1,24 +1,23 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import {Posts} from 'mattermost-redux/constants'; -import {testComponentForLineBreak} from 'tests/helpers/line_break_helpers'; -import {testComponentForMarkdownHotkeys} from 'tests/helpers/markdown_hotkey_helpers.js'; - import * as GlobalActions from 'actions/global_actions'; -import EmojiMap from 'utils/emoji_map'; -import Constants, {StoragePrefixes, ModalIdentifiers} from 'utils/constants'; -import * as Utils from 'utils/utils'; -import {execCommandInsertText} from 'utils/exec_commands'; - import AdvancedCreatePost from 'components/advanced_create_post/advanced_create_post'; import AdvanceTextEditor from 'components/advanced_text_editor/advanced_text_editor'; +import {testComponentForLineBreak} from 'tests/helpers/line_break_helpers'; +import {testComponentForMarkdownHotkeys} from 'tests/helpers/markdown_hotkey_helpers.js'; +import Constants, {StoragePrefixes, ModalIdentifiers} from 'utils/constants'; +import EmojiMap from 'utils/emoji_map'; +import {execCommandInsertText} from 'utils/exec_commands'; +import * as Utils from 'utils/utils'; + jest.mock('actions/global_actions', () => ({ emitLocalUserTypingEvent: jest.fn(), emitUserPostedEvent: jest.fn(), diff --git a/webapp/channels/src/components/advanced_create_post/advanced_create_post.tsx b/webapp/channels/src/components/advanced_create_post/advanced_create_post.tsx index a795c30b63..89a600ff6d 100644 --- a/webapp/channels/src/components/advanced_create_post/advanced_create_post.tsx +++ b/webapp/channels/src/components/advanced_create_post/advanced_create_post.tsx @@ -3,24 +3,38 @@ /* eslint-disable max-lines */ -import React from 'react'; import {isNil} from 'lodash'; +import React from 'react'; + +import type {Channel, ChannelMemberCountsByGroup} from '@mattermost/types/channels'; +import type {Emoji} from '@mattermost/types/emojis'; +import type {ServerError} from '@mattermost/types/errors'; +import type {FileInfo} from '@mattermost/types/files'; +import {GroupSource} from '@mattermost/types/groups'; +import type {Group} from '@mattermost/types/groups'; +import type {CommandArgs} from '@mattermost/types/integrations'; +import {PostPriority} from '@mattermost/types/posts'; +import type {Post, PostMetadata, PostPriorityMetadata} from '@mattermost/types/posts'; +import type {PreferenceType} from '@mattermost/types/preferences'; import {Posts} from 'mattermost-redux/constants'; +import type {ActionResult} from 'mattermost-redux/types/actions'; import {sortFileInfos} from 'mattermost-redux/utils/file_utils'; -import {ActionResult} from 'mattermost-redux/types/actions'; - -import {Channel, ChannelMemberCountsByGroup} from '@mattermost/types/channels'; -import {Post, PostMetadata, PostPriority, PostPriorityMetadata} from '@mattermost/types/posts'; -import {PreferenceType} from '@mattermost/types/preferences'; -import {ServerError} from '@mattermost/types/errors'; -import {CommandArgs} from '@mattermost/types/integrations'; -import {Group, GroupSource} from '@mattermost/types/groups'; -import {FileInfo} from '@mattermost/types/files'; -import {Emoji} from '@mattermost/types/emojis'; -import {PluginComponent} from 'types/store/plugins'; import * as GlobalActions from 'actions/global_actions'; + +import AdvancedTextEditor from 'components/advanced_text_editor/advanced_text_editor'; +import EditChannelHeaderModal from 'components/edit_channel_header_modal'; +import EditChannelPurposeModal from 'components/edit_channel_purpose_modal'; +import FileLimitStickyBanner from 'components/file_limit_sticky_banner'; +import type {FilePreviewInfo} from 'components/file_preview/file_preview'; +import type {FileUpload as FileUploadClass} from 'components/file_upload/file_upload'; +import NotifyConfirmModal from 'components/notify_confirm_modal'; +import PersistNotificationConfirmModal from 'components/persist_notification_confirm_modal'; +import PostPriorityPickerOverlay from 'components/post_priority/post_priority_picker_overlay'; +import ResetStatusModal from 'components/reset_status_modal'; +import type TextboxClass from 'components/textbox/textbox'; + import Constants, { StoragePrefixes, ModalIdentifiers, @@ -29,7 +43,20 @@ import Constants, { Preferences, AdvancedTextEditor as AdvancedTextEditorConst, } from 'utils/constants'; +import type EmojiMap from 'utils/emoji_map'; +import {execCommandInsertText} from 'utils/exec_commands'; import * as Keyboard from 'utils/keyboard'; +import {applyMarkdown} from 'utils/markdown/apply_markdown'; +import type {ApplyMarkdownOptions} from 'utils/markdown/apply_markdown'; +import { + getHtmlTable, + hasHtmlLink, + formatMarkdownMessage, + formatGithubCodePaste, + isGitHubCodeBlock, + formatMarkdownLinkMessage, + isTextUrl, +} from 'utils/paste'; import { containsAtChannel, specialMentionsInText, @@ -41,36 +68,13 @@ import { mentionsMinusSpecialMentionsInText, hasRequestedPersistentNotifications, } from 'utils/post_utils'; -import { - getHtmlTable, - hasHtmlLink, - formatMarkdownMessage, - formatGithubCodePaste, - isGitHubCodeBlock, - formatMarkdownLinkMessage, - isTextUrl, -} from 'utils/paste'; import * as UserAgent from 'utils/user_agent'; import * as Utils from 'utils/utils'; -import EmojiMap from 'utils/emoji_map'; -import {applyMarkdown, ApplyMarkdownOptions} from 'utils/markdown/apply_markdown'; -import {execCommandInsertText} from 'utils/exec_commands'; -import NotifyConfirmModal from 'components/notify_confirm_modal'; -import EditChannelHeaderModal from 'components/edit_channel_header_modal'; -import EditChannelPurposeModal from 'components/edit_channel_purpose_modal'; -import {FileUpload as FileUploadClass} from 'components/file_upload/file_upload'; -import ResetStatusModal from 'components/reset_status_modal'; -import TextboxClass from 'components/textbox/textbox'; -import PostPriorityPickerOverlay from 'components/post_priority/post_priority_picker_overlay'; -import PersistNotificationConfirmModal from 'components/persist_notification_confirm_modal'; +import type {ModalData} from 'types/actions'; +import type {PostDraft} from 'types/store/draft'; +import type {PluginComponent} from 'types/store/plugins'; -import {PostDraft} from 'types/store/draft'; -import {ModalData} from 'types/actions'; - -import AdvancedTextEditor from '../advanced_text_editor/advanced_text_editor'; -import FileLimitStickyBanner from '../file_limit_sticky_banner'; -import {FilePreviewInfo} from '../file_preview/file_preview'; import PriorityLabels from './priority_labels'; const KeyCodes = Constants.KeyCodes; diff --git a/webapp/channels/src/components/advanced_create_post/index.ts b/webapp/channels/src/components/advanced_create_post/index.ts index 815f727312..47904c6101 100644 --- a/webapp/channels/src/components/advanced_create_post/index.ts +++ b/webapp/channels/src/components/advanced_create_post/index.ts @@ -2,68 +2,62 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; -import {GlobalState} from 'types/store/index.js'; +import type {FileInfo} from '@mattermost/types/files'; +import type {CommandArgs} from '@mattermost/types/integrations'; +import type {Post} from '@mattermost/types/posts'; +import type {PreferenceType} from '@mattermost/types/preferences'; -import {Post} from '@mattermost/types/posts'; - -import {FileInfo} from '@mattermost/types/files'; - -import {ActionResult, GetStateFunc, DispatchFunc} from 'mattermost-redux/types/actions.js'; - -import {CommandArgs} from '@mattermost/types/integrations'; - -import {ModalData} from 'types/actions.js'; - -import {PostDraft} from 'types/store/draft'; - -import {getConfig, getLicense} from 'mattermost-redux/selectors/entities/general'; -import {getCurrentTeamId} from 'mattermost-redux/selectors/entities/teams'; - -import {getCurrentChannelId, getCurrentChannel, getCurrentChannelStats, getChannelMemberCountsByGroup as selectChannelMemberCountsByGroup} from 'mattermost-redux/selectors/entities/channels'; -import {getCurrentUserId, getStatusForUserId, getUser, isCurrentUserGuestUser} from 'mattermost-redux/selectors/entities/users'; -import {haveICurrentChannelPermission} from 'mattermost-redux/selectors/entities/roles'; import {getChannelTimezones, getChannelMemberCountsByGroup} from 'mattermost-redux/actions/channels'; -import {get, getInt, getBool, isCustomGroupsEnabled} from 'mattermost-redux/selectors/entities/preferences'; - -import {savePreferences} from 'mattermost-redux/actions/preferences'; -import { - getCurrentUsersLatestPost, - getLatestReplyablePostId, - makeGetMessageInHistoryItem, - isPostPriorityEnabled, -} from 'mattermost-redux/selectors/entities/posts'; -import {getAssociatedGroupsForReferenceByMention} from 'mattermost-redux/selectors/entities/groups'; import { addMessageIntoHistory, moveHistoryIndexBack, moveHistoryIndexForward, removeReaction, } from 'mattermost-redux/actions/posts'; +import {savePreferences} from 'mattermost-redux/actions/preferences'; import {Permissions, Posts, Preferences as PreferencesRedux} from 'mattermost-redux/constants'; +import {getCurrentChannelId, getCurrentChannel, getCurrentChannelStats, getChannelMemberCountsByGroup as selectChannelMemberCountsByGroup} from 'mattermost-redux/selectors/entities/channels'; +import {getConfig, getLicense} from 'mattermost-redux/selectors/entities/general'; +import {getAssociatedGroupsForReferenceByMention} from 'mattermost-redux/selectors/entities/groups'; +import { + getCurrentUsersLatestPost, + getLatestReplyablePostId, + makeGetMessageInHistoryItem, + isPostPriorityEnabled, +} from 'mattermost-redux/selectors/entities/posts'; +import {get, getInt, getBool, isCustomGroupsEnabled} from 'mattermost-redux/selectors/entities/preferences'; +import {haveICurrentChannelPermission} from 'mattermost-redux/selectors/entities/roles'; +import {getCurrentTeamId} from 'mattermost-redux/selectors/entities/teams'; +import {getCurrentUserId, getStatusForUserId, getUser, isCurrentUserGuestUser} from 'mattermost-redux/selectors/entities/users'; +import type {ActionResult, GetStateFunc, DispatchFunc} from 'mattermost-redux/types/actions.js'; -import {connectionErrorCount} from 'selectors/views/system'; - -import {addReaction, createPost, setEditingPost, emitShortcutReactToLastPostFrom} from 'actions/post_actions'; -import {searchAssociatedGroupsForReference} from 'actions/views/group'; -import {scrollPostListToBottom} from 'actions/views/channel'; -import {selectPostFromRightHandSideSearchByPostId} from 'actions/views/rhs'; -import {setShowPreviewOnCreatePost} from 'actions/views/textbox'; import {executeCommand} from 'actions/command'; import {runMessageWillBePostedHooks, runSlashCommandWillBePostedHooks} from 'actions/hooks'; -import {makeGetChannelDraft, getIsRhsExpanded, getIsRhsOpen} from 'selectors/rhs'; -import {showPreviewOnCreatePost} from 'selectors/views/textbox'; -import {getCurrentLocale} from 'selectors/i18n'; -import {getEmojiMap, getShortcutReactToLastPostEmittedFrom} from 'selectors/emojis'; +import {addReaction, createPost, setEditingPost, emitShortcutReactToLastPostFrom} from 'actions/post_actions'; import {actionOnGlobalItemsWithPrefix} from 'actions/storage'; +import {scrollPostListToBottom} from 'actions/views/channel'; import {removeDraft, updateDraft} from 'actions/views/drafts'; +import {searchAssociatedGroupsForReference} from 'actions/views/group'; import {openModal} from 'actions/views/modals'; -import {AdvancedTextEditor, Constants, Preferences, StoragePrefixes, UserStatuses} from 'utils/constants'; -import {canUploadFiles} from 'utils/file_utils'; +import {selectPostFromRightHandSideSearchByPostId} from 'actions/views/rhs'; +import {setShowPreviewOnCreatePost} from 'actions/views/textbox'; +import {getEmojiMap, getShortcutReactToLastPostEmittedFrom} from 'selectors/emojis'; +import {getCurrentLocale} from 'selectors/i18n'; +import {makeGetChannelDraft, getIsRhsExpanded, getIsRhsOpen} from 'selectors/rhs'; +import {connectionErrorCount} from 'selectors/views/system'; +import {showPreviewOnCreatePost} from 'selectors/views/textbox'; + import {OnboardingTourSteps, TutorialTourName, OnboardingTourStepsForGuestUsers} from 'components/tours'; -import {PreferenceType} from '@mattermost/types/preferences'; +import {AdvancedTextEditor, Constants, Preferences, StoragePrefixes, UserStatuses} from 'utils/constants'; +import {canUploadFiles} from 'utils/file_utils'; + +import type {ModalData} from 'types/actions.js'; +import type {PostDraft} from 'types/store/draft'; +import type {GlobalState} from 'types/store/index.js'; import AdvancedCreatePost from './advanced_create_post'; diff --git a/webapp/channels/src/components/advanced_create_post/prewritten_chips.tsx b/webapp/channels/src/components/advanced_create_post/prewritten_chips.tsx index 7afc349859..28a00492d9 100644 --- a/webapp/channels/src/components/advanced_create_post/prewritten_chips.tsx +++ b/webapp/channels/src/components/advanced_create_post/prewritten_chips.tsx @@ -5,14 +5,14 @@ import React, {useMemo, memo} from 'react'; import {useIntl} from 'react-intl'; import styled from 'styled-components'; +import type {Channel} from '@mattermost/types/channels'; + import {trackEvent} from 'actions/telemetry_actions'; -import {Channel} from '@mattermost/types/channels'; +import Chip from 'components/common/chip/chip'; import {t} from 'utils/i18n'; -import Chip from '../common/chip/chip'; - type Props = { prefillMessage: (msg: string, shouldFocus: boolean) => void; currentChannel: Channel; diff --git a/webapp/channels/src/components/advanced_create_post/priority_labels.tsx b/webapp/channels/src/components/advanced_create_post/priority_labels.tsx index 09c1caeff6..a0c9c176c9 100644 --- a/webapp/channels/src/components/advanced_create_post/priority_labels.tsx +++ b/webapp/channels/src/components/advanced_create_post/priority_labels.tsx @@ -1,21 +1,21 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {memo, CSSProperties} from 'react'; +import React, {memo} from 'react'; +import type {CSSProperties} from 'react'; import {FormattedMessage} from 'react-intl'; import styled from 'styled-components'; import {CheckCircleOutlineIcon, BellRingOutlineIcon} from '@mattermost/compass-icons/components'; +import type {PostPriorityMetadata} from '@mattermost/types/posts'; import OverlayTrigger from 'components/overlay_trigger'; -import Tooltip from 'components/tooltip'; -import PriorityLabel from 'components/post_priority/post_priority_label'; import {HasNoMentions, HasSpecialMentions} from 'components/post_priority/error_messages'; +import PriorityLabel from 'components/post_priority/post_priority_label'; +import Tooltip from 'components/tooltip'; import Constants from 'utils/constants'; -import {PostPriorityMetadata} from '@mattermost/types/posts'; - type Props = { canRemove: boolean; hasError: boolean; diff --git a/webapp/channels/src/components/advanced_text_editor/advanced_text_editor.tsx b/webapp/channels/src/components/advanced_text_editor/advanced_text_editor.tsx index f4c0055853..63aaf8db70 100644 --- a/webapp/channels/src/components/advanced_text_editor/advanced_text_editor.tsx +++ b/webapp/channels/src/components/advanced_text_editor/advanced_text_editor.tsx @@ -1,48 +1,48 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {useCallback, useEffect, useRef, useState} from 'react'; import classNames from 'classnames'; +import React, {useCallback, useEffect, useRef, useState} from 'react'; import {FormattedMessage, useIntl} from 'react-intl'; + import {EmoticonHappyOutlineIcon} from '@mattermost/compass-icons/components'; +import type {Channel} from '@mattermost/types/channels'; +import type {Emoji} from '@mattermost/types/emojis'; +import type {ServerError} from '@mattermost/types/errors'; +import type {FileInfo} from '@mattermost/types/files'; -import {PostDraft} from 'types/store/draft'; - +import AutoHeightSwitcher from 'components/common/auto_height_switcher'; import EmojiPickerOverlay from 'components/emoji_picker/emoji_picker_overlay'; import FilePreview from 'components/file_preview'; +import type {FilePreviewInfo} from 'components/file_preview/file_preview'; import FileUpload from 'components/file_upload'; -import MsgTyping from 'components/msg_typing'; -import Textbox, {TextboxElement} from 'components/textbox'; -import TextboxClass from 'components/textbox/textbox'; -import MessageSubmitError from 'components/message_submit_error'; -import {FilePreviewInfo} from 'components/file_preview/file_preview'; -import {SendMessageTour} from 'components/tours/onboarding_tour'; -import {FileUpload as FileUploadClass} from 'components/file_upload/file_upload'; -import OverlayTrigger from 'components/overlay_trigger'; +import type {FileUpload as FileUploadClass} from 'components/file_upload/file_upload'; import KeyboardShortcutSequence, {KEYBOARD_SHORTCUTS} from 'components/keyboard_shortcuts/keyboard_shortcuts_sequence'; +import MessageSubmitError from 'components/message_submit_error'; +import MsgTyping from 'components/msg_typing'; +import OverlayTrigger from 'components/overlay_trigger'; +import RhsSuggestionList from 'components/suggestion/rhs_suggestion_list'; +import Textbox from 'components/textbox'; +import type {TextboxElement} from 'components/textbox'; +import type TextboxClass from 'components/textbox/textbox'; +import Tooltip from 'components/tooltip'; +import {SendMessageTour} from 'components/tours/onboarding_tour'; -import * as Utils from 'utils/utils'; -import {ApplyMarkdownOptions} from 'utils/markdown/apply_markdown'; import Constants, {Locations} from 'utils/constants'; +import type {ApplyMarkdownOptions} from 'utils/markdown/apply_markdown'; +import * as Utils from 'utils/utils'; -import {Channel} from '@mattermost/types/channels'; -import {ServerError} from '@mattermost/types/errors'; -import {FileInfo} from '@mattermost/types/files'; -import {Emoji} from '@mattermost/types/emojis'; -import AutoHeightSwitcher from '../common/auto_height_switcher'; -import RhsSuggestionList from '../suggestion/rhs_suggestion_list'; -import Tooltip from '../tooltip'; +import type {PostDraft} from 'types/store/draft'; -import {FormattingBarSpacer, Separator} from './formatting_bar/formatting_bar'; - -import TexteditorActions from './texteditor_actions'; import FormattingBar from './formatting_bar'; -import ShowFormat from './show_formatting'; -import SendButton from './send_button'; +import {FormattingBarSpacer, Separator} from './formatting_bar/formatting_bar'; import {IconContainer} from './formatting_bar/formatting_icon'; +import SendButton from './send_button'; +import ShowFormat from './show_formatting'; +import TexteditorActions from './texteditor_actions'; +import ToggleFormattingBar from './toggle_formatting_bar'; import './advanced_text_editor.scss'; -import ToggleFormattingBar from './toggle_formatting_bar'; type Props = { diff --git a/webapp/channels/src/components/advanced_text_editor/formatting_bar/formatting_bar.tsx b/webapp/channels/src/components/advanced_text_editor/formatting_bar/formatting_bar.tsx index 0cf56ef967..2152832ed7 100644 --- a/webapp/channels/src/components/advanced_text_editor/formatting_bar/formatting_bar.tsx +++ b/webapp/channels/src/components/advanced_text_editor/formatting_bar/formatting_bar.tsx @@ -1,18 +1,18 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {useFloating, offset} from '@floating-ui/react-dom'; import classNames from 'classnames'; import React, {memo, useCallback, useEffect, useRef, useState} from 'react'; import {useIntl} from 'react-intl'; -import styled from 'styled-components'; -import {useFloating, offset} from '@floating-ui/react-dom'; import {CSSTransition} from 'react-transition-group'; +import styled from 'styled-components'; + import {DotsHorizontalIcon} from '@mattermost/compass-icons/components'; -import {ApplyMarkdownOptions} from 'utils/markdown/apply_markdown'; +import type {ApplyMarkdownOptions} from 'utils/markdown/apply_markdown'; import FormattingIcon, {IconContainer} from './formatting_icon'; - import {useFormattingBarControls, useGetLatest} from './hooks'; export const Separator = styled.div` diff --git a/webapp/channels/src/components/advanced_text_editor/formatting_bar/formatting_icon.tsx b/webapp/channels/src/components/advanced_text_editor/formatting_bar/formatting_icon.tsx index d74168bf2a..757b2b8ff9 100644 --- a/webapp/channels/src/components/advanced_text_editor/formatting_bar/formatting_icon.tsx +++ b/webapp/channels/src/components/advanced_text_editor/formatting_bar/formatting_icon.tsx @@ -2,8 +2,10 @@ // See LICENSE.txt for license information. import React, {memo} from 'react'; -import {MessageDescriptor, useIntl} from 'react-intl'; +import {useIntl} from 'react-intl'; +import type {MessageDescriptor} from 'react-intl'; import styled from 'styled-components'; + import { FormatBoldIcon, FormatItalicIcon, @@ -15,18 +17,19 @@ import { FormatListBulletedIcon, FormatListNumberedIcon, } from '@mattermost/compass-icons/components'; -import IconProps from '@mattermost/compass-icons/components/props'; +import type IconProps from '@mattermost/compass-icons/components/props'; import KeyboardShortcutSequence, { - KeyboardShortcutDescriptor, KEYBOARD_SHORTCUTS, } from 'components/keyboard_shortcuts/keyboard_shortcuts_sequence'; +import type { + KeyboardShortcutDescriptor} from 'components/keyboard_shortcuts/keyboard_shortcuts_sequence'; import OverlayTrigger from 'components/overlay_trigger'; import Tooltip from 'components/tooltip'; -import {MarkdownMode} from 'utils/markdown/apply_markdown'; import Constants from 'utils/constants'; import {t} from 'utils/i18n'; +import type {MarkdownMode} from 'utils/markdown/apply_markdown'; export const IconContainer = styled.button` display: flex; diff --git a/webapp/channels/src/components/advanced_text_editor/formatting_bar/hooks.tsx b/webapp/channels/src/components/advanced_text_editor/formatting_bar/hooks.tsx index d29d2f78c5..448070c2cc 100644 --- a/webapp/channels/src/components/advanced_text_editor/formatting_bar/hooks.tsx +++ b/webapp/channels/src/components/advanced_text_editor/formatting_bar/hooks.tsx @@ -1,12 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {useCallback, useEffect, useLayoutEffect, useState} from 'react'; -import {Instance} from '@popperjs/core'; - +import type {Instance} from '@popperjs/core'; import {debounce} from 'lodash'; +import React, {useCallback, useEffect, useLayoutEffect, useState} from 'react'; -import {MarkdownMode} from 'utils/markdown/apply_markdown'; +import type {MarkdownMode} from 'utils/markdown/apply_markdown'; type WideMode = 'wide' | 'normal' | 'narrow' | 'min'; diff --git a/webapp/channels/src/components/advanced_text_editor/send_button/send_button.tsx b/webapp/channels/src/components/advanced_text_editor/send_button/send_button.tsx index 357bb2612e..c933381eb2 100644 --- a/webapp/channels/src/components/advanced_text_editor/send_button/send_button.tsx +++ b/webapp/channels/src/components/advanced_text_editor/send_button/send_button.tsx @@ -4,6 +4,7 @@ import React, {FormEvent, memo} from 'react'; import {useIntl} from 'react-intl'; import styled from 'styled-components'; + import {SendIcon} from '@mattermost/compass-icons/components'; import {t} from 'utils/i18n'; diff --git a/webapp/channels/src/components/advanced_text_editor/show_formatting/show_formatting.tsx b/webapp/channels/src/components/advanced_text_editor/show_formatting/show_formatting.tsx index 404c496a90..2f165c85a6 100644 --- a/webapp/channels/src/components/advanced_text_editor/show_formatting/show_formatting.tsx +++ b/webapp/channels/src/components/advanced_text_editor/show_formatting/show_formatting.tsx @@ -1,14 +1,16 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {memo} from 'react'; import classNames from 'classnames'; +import React, {memo} from 'react'; import {useIntl} from 'react-intl'; + import {EyeOutlineIcon} from '@mattermost/compass-icons/components'; +import KeyboardShortcutSequence, {KEYBOARD_SHORTCUTS} from 'components/keyboard_shortcuts/keyboard_shortcuts_sequence'; import OverlayTrigger from 'components/overlay_trigger'; import Tooltip from 'components/tooltip'; -import KeyboardShortcutSequence, {KEYBOARD_SHORTCUTS} from 'components/keyboard_shortcuts/keyboard_shortcuts_sequence'; + import Constants from 'utils/constants'; import {IconContainer} from '../formatting_bar/formatting_icon'; diff --git a/webapp/channels/src/components/advanced_text_editor/toggle_formatting_bar.tsx b/webapp/channels/src/components/advanced_text_editor/toggle_formatting_bar.tsx index 1ead879392..5e31527993 100644 --- a/webapp/channels/src/components/advanced_text_editor/toggle_formatting_bar.tsx +++ b/webapp/channels/src/components/advanced_text_editor/toggle_formatting_bar.tsx @@ -2,12 +2,14 @@ // See LICENSE.txt for license information. import React, {memo} from 'react'; -import {ChevronDownIcon, ChevronUpIcon, FormatLetterCaseIcon} from '@mattermost/compass-icons/components'; import {useIntl} from 'react-intl'; +import {ChevronDownIcon, ChevronUpIcon, FormatLetterCaseIcon} from '@mattermost/compass-icons/components'; + import KeyboardShortcutSequence, {KEYBOARD_SHORTCUTS} from 'components/keyboard_shortcuts/keyboard_shortcuts_sequence'; import OverlayTrigger from 'components/overlay_trigger'; import Tooltip from 'components/tooltip'; + import Constants from 'utils/constants'; import {IconContainer} from './formatting_bar/formatting_icon'; diff --git a/webapp/channels/src/components/air_gapped_self_hosted_purchase_modal/index.tsx b/webapp/channels/src/components/air_gapped_self_hosted_purchase_modal/index.tsx index 530902c3bb..4f95572b01 100644 --- a/webapp/channels/src/components/air_gapped_self_hosted_purchase_modal/index.tsx +++ b/webapp/channels/src/components/air_gapped_self_hosted_purchase_modal/index.tsx @@ -5,9 +5,11 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; import {GenericModal} from '@mattermost/components'; -import {CloudLinks} from 'utils/constants'; -import CreditCardSvg from 'components/common/svg_images_components/credit_card_svg'; + import {useControlAirGappedSelfHostedPurchaseModal} from 'components/common/hooks/useControlModal'; +import CreditCardSvg from 'components/common/svg_images_components/credit_card_svg'; + +import {CloudLinks} from 'utils/constants'; import './content.scss'; diff --git a/webapp/channels/src/components/alert_banner.test.tsx b/webapp/channels/src/components/alert_banner.test.tsx index b74ad584b5..654a009173 100644 --- a/webapp/channels/src/components/alert_banner.test.tsx +++ b/webapp/channels/src/components/alert_banner.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import AlertBanner from './alert_banner'; diff --git a/webapp/channels/src/components/alert_banner.tsx b/webapp/channels/src/components/alert_banner.tsx index 9c67b3b4ac..ec0e9692f9 100644 --- a/webapp/channels/src/components/alert_banner.tsx +++ b/webapp/channels/src/components/alert_banner.tsx @@ -1,10 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {useCallback, useState} from 'react'; import classNames from 'classnames'; - +import React, {useCallback, useState} from 'react'; import {useIntl} from 'react-intl'; + import { AlertOutlineIcon, CheckIcon, @@ -14,6 +14,7 @@ import { import OverlayTrigger from 'components/overlay_trigger'; import Tooltip from 'components/tooltip'; + import Constants from 'utils/constants'; import './alert_banner.scss'; diff --git a/webapp/channels/src/components/analytics/activated_users_card/index.tsx b/webapp/channels/src/components/analytics/activated_users_card/index.tsx index cce7ac420c..30dadb60e0 100644 --- a/webapp/channels/src/components/analytics/activated_users_card/index.tsx +++ b/webapp/channels/src/components/analytics/activated_users_card/index.tsx @@ -1,9 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import classNames from 'classnames'; import React from 'react'; import {FormattedMessage} from 'react-intl'; -import classNames from 'classnames'; import {AlertOutlineIcon} from '@mattermost/compass-icons/components'; diff --git a/webapp/channels/src/components/analytics/doughnut_chart.test.tsx b/webapp/channels/src/components/analytics/doughnut_chart.test.tsx index ebe2f917ea..51a1adbd47 100644 --- a/webapp/channels/src/components/analytics/doughnut_chart.test.tsx +++ b/webapp/channels/src/components/analytics/doughnut_chart.test.tsx @@ -1,14 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; +import type {Chart, ChartData} from 'chart.js'; import {shallow, mount} from 'enzyme'; -import {Chart, ChartData} from 'chart.js'; - -import {mountWithIntl} from 'tests/helpers/intl-test-helper'; +import React from 'react'; import DoughnutChart from 'components/analytics/doughnut_chart'; +import {mountWithIntl} from 'tests/helpers/intl-test-helper'; + jest.mock('chart.js'); describe('components/analytics/doughnut_chart.tsx', () => { diff --git a/webapp/channels/src/components/analytics/doughnut_chart.tsx b/webapp/channels/src/components/analytics/doughnut_chart.tsx index 9366f5d4a5..486bec1e28 100644 --- a/webapp/channels/src/components/analytics/doughnut_chart.tsx +++ b/webapp/channels/src/components/analytics/doughnut_chart.tsx @@ -1,11 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import type {ChartData} from 'chart.js'; +import Chart from 'chart.js/auto'; import deepEqual from 'fast-deep-equal'; import React from 'react'; import {FormattedMessage} from 'react-intl'; -import Chart from 'chart.js/auto'; -import {ChartData} from 'chart.js'; type Props = { title: React.ReactNode; diff --git a/webapp/channels/src/components/analytics/line_chart.test.tsx b/webapp/channels/src/components/analytics/line_chart.test.tsx index c5054e3c72..f3ffbfa4e2 100644 --- a/webapp/channels/src/components/analytics/line_chart.test.tsx +++ b/webapp/channels/src/components/analytics/line_chart.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import LineChart from 'components/analytics/line_chart'; diff --git a/webapp/channels/src/components/analytics/line_chart.tsx b/webapp/channels/src/components/analytics/line_chart.tsx index 8207177b64..a05e2ff968 100644 --- a/webapp/channels/src/components/analytics/line_chart.tsx +++ b/webapp/channels/src/components/analytics/line_chart.tsx @@ -1,12 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import type {ChartOptions} from 'chart.js'; +import Chart from 'chart.js/auto'; import deepEqual from 'fast-deep-equal'; import PropTypes from 'prop-types'; import React from 'react'; import {FormattedMessage} from 'react-intl'; -import Chart from 'chart.js/auto'; -import {ChartOptions} from 'chart.js'; type Props = { title: React.ReactNode; diff --git a/webapp/channels/src/components/analytics/statistic_count.test.tsx b/webapp/channels/src/components/analytics/statistic_count.test.tsx index a439756407..eb023736ba 100644 --- a/webapp/channels/src/components/analytics/statistic_count.test.tsx +++ b/webapp/channels/src/components/analytics/statistic_count.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import StatisticCount from 'components/analytics/statistic_count'; diff --git a/webapp/channels/src/components/analytics/statistic_count.tsx b/webapp/channels/src/components/analytics/statistic_count.tsx index ffc7295a36..75fb6885df 100644 --- a/webapp/channels/src/components/analytics/statistic_count.tsx +++ b/webapp/channels/src/components/analytics/statistic_count.tsx @@ -2,7 +2,8 @@ // See LICENSE.txt for license information. import classNames from 'classnames'; -import React, {ReactNode} from 'react'; +import React from 'react'; +import type {ReactNode} from 'react'; import {FormattedMessage} from 'react-intl'; type Props = { diff --git a/webapp/channels/src/components/analytics/system_analytics/index.ts b/webapp/channels/src/components/analytics/system_analytics/index.ts index ea7215eb5e..1b1479e54e 100644 --- a/webapp/channels/src/components/analytics/system_analytics/index.ts +++ b/webapp/channels/src/components/analytics/system_analytics/index.ts @@ -5,7 +5,7 @@ import {connect} from 'react-redux'; import {getLicense} from 'mattermost-redux/selectors/entities/general'; -import {GlobalState} from 'types/store'; +import type {GlobalState} from 'types/store'; import SystemAnalytics from './system_analytics'; diff --git a/webapp/channels/src/components/analytics/system_analytics/system_analytics.tsx b/webapp/channels/src/components/analytics/system_analytics/system_analytics.tsx index 1e5ee8505f..57e728d4ea 100644 --- a/webapp/channels/src/components/analytics/system_analytics/system_analytics.tsx +++ b/webapp/channels/src/components/analytics/system_analytics/system_analytics.tsx @@ -4,24 +4,21 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {AnalyticsRow, PluginAnalyticsRow, IndexedPluginAnalyticsRow} from '@mattermost/types/admin'; -import {ClientLicense} from '@mattermost/types/config'; +import type {AnalyticsRow, PluginAnalyticsRow, IndexedPluginAnalyticsRow} from '@mattermost/types/admin'; +import type {ClientLicense} from '@mattermost/types/config'; import * as AdminActions from 'actions/admin_actions.jsx'; -import Constants from 'utils/constants'; - import {ActivatedUserCard} from 'components/analytics/activated_users_card'; import TrueUpReview from 'components/analytics/true_up_review'; import ExternalLink from 'components/external_link'; import AdminHeader from 'components/widgets/admin_console/admin_header'; -import {GlobalState} from 'types/store'; +import Constants from 'utils/constants'; + +import type {GlobalState} from 'types/store'; import DoughnutChart from '../doughnut_chart'; -import LineChart from '../line_chart'; -import StatisticCount from '../statistic_count'; - import { formatPostsPerDayData, formatUsersWithPostsPerDayData, @@ -29,6 +26,8 @@ import { formatPostDoughtnutData, synchronizeChartLabels, } from '../format'; +import LineChart from '../line_chart'; +import StatisticCount from '../statistic_count'; const StatTypes = Constants.StatTypes; diff --git a/webapp/channels/src/components/analytics/table_chart.test.tsx b/webapp/channels/src/components/analytics/table_chart.test.tsx index 4102de6147..247cc8aba9 100644 --- a/webapp/channels/src/components/analytics/table_chart.test.tsx +++ b/webapp/channels/src/components/analytics/table_chart.test.tsx @@ -1,10 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; -import TableChart, {TableItem} from 'components/analytics/table_chart'; +import TableChart from 'components/analytics/table_chart'; +import type {TableItem} from 'components/analytics/table_chart'; describe('components/analytics/table_chart.tsx', () => { test('should match snapshot, loaded without data', () => { diff --git a/webapp/channels/src/components/analytics/team_analytics/index.ts b/webapp/channels/src/components/analytics/team_analytics/index.ts index 527d666f02..f8ca225cbd 100644 --- a/webapp/channels/src/components/analytics/team_analytics/index.ts +++ b/webapp/channels/src/components/analytics/team_analytics/index.ts @@ -2,21 +2,20 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; - -import {Action, ActionResult, GenericAction} from 'mattermost-redux/types/actions'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; import {getTeams} from 'mattermost-redux/actions/teams'; import {getProfilesInTeam} from 'mattermost-redux/actions/users'; import {getTeamsList} from 'mattermost-redux/selectors/entities/teams'; - -import {GlobalState} from 'types/store'; - -import {getCurrentLocale} from 'selectors/i18n'; +import type {Action, ActionResult, GenericAction} from 'mattermost-redux/types/actions'; import {setGlobalItem} from 'actions/storage'; +import {getCurrentLocale} from 'selectors/i18n'; import {makeGetGlobalItem} from 'selectors/storage'; +import type {GlobalState} from 'types/store'; + import TeamAnalytics from './team_analytics'; const LAST_ANALYTICS_TEAM = 'last_analytics_team'; diff --git a/webapp/channels/src/components/analytics/team_analytics/team_analytics.tsx b/webapp/channels/src/components/analytics/team_analytics/team_analytics.tsx index fa43e0581b..6eccfc7719 100644 --- a/webapp/channels/src/components/analytics/team_analytics/team_analytics.tsx +++ b/webapp/channels/src/components/analytics/team_analytics/team_analytics.tsx @@ -4,26 +4,28 @@ import React from 'react'; import {FormattedDate, FormattedMessage} from 'react-intl'; -import {AnalyticsRow} from '@mattermost/types/admin'; -import {RelationOneToOne} from '@mattermost/types/utilities'; -import {General} from 'mattermost-redux/constants'; -import {Team} from '@mattermost/types/teams'; -import {UserProfile} from '@mattermost/types/users'; -import {ClientLicense} from '@mattermost/types/config'; +import type {AnalyticsRow} from '@mattermost/types/admin'; +import type {ClientLicense} from '@mattermost/types/config'; +import type {Team} from '@mattermost/types/teams'; +import type {UserProfile} from '@mattermost/types/users'; +import type {RelationOneToOne} from '@mattermost/types/utilities'; + +import {General} from 'mattermost-redux/constants'; -import LoadingScreen from 'components/loading_screen'; -import FormattedMarkdownMessage from 'components/formatted_markdown_message'; import * as AdminActions from 'actions/admin_actions'; -import {StatTypes} from 'utils/constants'; + import Banner from 'components/admin_console/banner'; +import {ActivatedUserCard} from 'components/analytics/activated_users_card'; import LineChart from 'components/analytics/line_chart'; import StatisticCount from 'components/analytics/statistic_count'; import TableChart from 'components/analytics/table_chart'; -import {ActivatedUserCard} from 'components/analytics/activated_users_card'; import TrueUpReview from 'components/analytics/true_up_review'; import ExternalLink from 'components/external_link'; +import FormattedMarkdownMessage from 'components/formatted_markdown_message'; +import LoadingScreen from 'components/loading_screen'; import AdminHeader from 'components/widgets/admin_console/admin_header'; +import {StatTypes} from 'utils/constants'; import {getMonthLong} from 'utils/i18n'; import {formatPostsPerDayData, formatUsersWithPostsPerDayData, synchronizeChartLabels} from '../format'; diff --git a/webapp/channels/src/components/analytics/true_up_review.test.tsx b/webapp/channels/src/components/analytics/true_up_review.test.tsx index 033d3a5bc0..c211736bc2 100644 --- a/webapp/channels/src/components/analytics/true_up_review.test.tsx +++ b/webapp/channels/src/components/analytics/true_up_review.test.tsx @@ -3,13 +3,13 @@ import React from 'react'; -import {GlobalState} from '@mattermost/types/store'; -import {DeepPartial} from '@mattermost/types/utilities'; +import type {GlobalState} from '@mattermost/types/store'; +import type {DeepPartial} from '@mattermost/types/utilities'; + +import * as useCWSAvailabilityCheckAll from 'components/common/hooks/useCWSAvailabilityCheck'; import {renderWithIntlAndStore, screen} from 'tests/react_testing_utils'; -import * as useCWSAvailabilityCheckAll from 'components/common/hooks/useCWSAvailabilityCheck'; import {LicenseSkus} from 'utils/constants'; - import {TestHelper as TH} from 'utils/test_helper'; import TrueUpReview from './true_up_review'; diff --git a/webapp/channels/src/components/analytics/true_up_review.tsx b/webapp/channels/src/components/analytics/true_up_review.tsx index 5098999d63..f950d0a747 100644 --- a/webapp/channels/src/components/analytics/true_up_review.tsx +++ b/webapp/channels/src/components/analytics/true_up_review.tsx @@ -1,39 +1,35 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import classNames from 'classnames'; +import moment from 'moment'; import React, {useEffect} from 'react'; import {FormattedMessage} from 'react-intl'; - import {useDispatch, useSelector} from 'react-redux'; -import moment from 'moment'; - -import classNames from 'classnames'; - -import {submitTrueUpReview, getTrueUpReviewStatus} from 'actions/hosted_customer'; -import { - isCurrentLicenseCloud, -} from 'mattermost-redux/selectors/entities/cloud'; +import type {GlobalState} from '@mattermost/types/store'; +import {isCurrentLicenseCloud} from 'mattermost-redux/selectors/entities/cloud'; +import {getConfig, getLicense} from 'mattermost-redux/selectors/entities/general'; import { getSelfHostedErrors, getTrueUpReviewProfile as trueUpReviewProfileSelector, getTrueUpReviewStatus as trueUpReviewStatusSelector, } from 'mattermost-redux/selectors/entities/hosted_customer'; +import {isCurrentUserSystemAdmin} from 'mattermost-redux/selectors/entities/users'; + +import {submitTrueUpReview, getTrueUpReviewStatus} from 'actions/hosted_customer'; +import {pageVisited} from 'actions/telemetry_actions'; import useCWSAvailabilityCheck from 'components/common/hooks/useCWSAvailabilityCheck'; +import ExternalLink from 'components/external_link'; import CheckMarkSvg from 'components/widgets/icons/check_mark_icon'; +import WarningIcon from 'components/widgets/icons/fa_warning_icon'; + +import {DocLinks, TELEMETRY_CATEGORIES} from 'utils/constants'; +import {getIsStarterLicense, getIsGovSku} from 'utils/license_utils'; import './true_up_review.scss'; -import {GlobalState} from '@mattermost/types/store'; -import WarningIcon from 'components/widgets/icons/fa_warning_icon'; -import {isCurrentUserSystemAdmin} from 'mattermost-redux/selectors/entities/users'; -import {getConfig, getLicense} from 'mattermost-redux/selectors/entities/general'; -import {pageVisited} from 'actions/telemetry_actions'; -import {DocLinks, TELEMETRY_CATEGORIES} from 'utils/constants'; - -import ExternalLink from 'components/external_link'; -import {getIsStarterLicense, getIsGovSku} from 'utils/license_utils'; const TrueUpReview: React.FC = () => { const dispatch = useDispatch(); @@ -124,16 +120,17 @@ const TrueUpReview: React.FC = () => { className={classNames('btn btn-primary TrueUpReview__submit', {'TrueUpReview__submit--error': trueUpReviewError})} onClick={handleSubmitReview} > - {isAirGapped ? + {isAirGapped ? ( : + /> + ) : ( - } + )} ); diff --git a/webapp/channels/src/components/announcement_bar/announcement_bar.test.tsx b/webapp/channels/src/components/announcement_bar/announcement_bar.test.tsx index 77985ff898..b923db99a5 100644 --- a/webapp/channels/src/components/announcement_bar/announcement_bar.test.tsx +++ b/webapp/channels/src/components/announcement_bar/announcement_bar.test.tsx @@ -1,8 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; + import 'tests/helpers/localstorage.jsx'; import AnnouncementBar from 'components/announcement_bar/default_announcement_bar/announcement_bar'; diff --git a/webapp/channels/src/components/announcement_bar/announcement_bar_controller.tsx b/webapp/channels/src/components/announcement_bar/announcement_bar_controller.tsx index ea14eaa5b1..9eacc76f99 100644 --- a/webapp/channels/src/components/announcement_bar/announcement_bar_controller.tsx +++ b/webapp/channels/src/components/announcement_bar/announcement_bar_controller.tsx @@ -3,25 +3,24 @@ import React from 'react'; -import {ToYearlyNudgeBannerDismissable} from 'components/admin_console/billing/billing_subscriptions/to_yearly_nudge_banner'; +import type {ClientLicense, ClientConfig, WarnMetricStatus} from '@mattermost/types/config'; + import {ToPaidPlanBannerDismissable} from 'components/admin_console/billing/billing_subscriptions/to_paid_plan_nudge_banner'; +import {ToYearlyNudgeBannerDismissable} from 'components/admin_console/billing/billing_subscriptions/to_yearly_nudge_banner'; +import withGetCloudSubscription from 'components/common/hocs/cloud/with_get_cloud_subscription'; -import {ClientLicense, ClientConfig, WarnMetricStatus} from '@mattermost/types/config'; -import withGetCloudSubscription from '../common/hocs/cloud/with_get_cloud_subscription'; - -import ConfigurationAnnouncementBar from './configuration_bar'; -import VersionBar from './version_bar'; -import TextDismissableBar from './text_dismissable_bar'; -import AnnouncementBar from './default_announcement_bar'; - -import PaymentAnnouncementBar from './payment_announcement_bar'; +import CloudDelinquencyAnnouncementBar from './cloud_delinquency'; import CloudTrialAnnouncementBar from './cloud_trial_announcement_bar'; import CloudTrialEndAnnouncementBar from './cloud_trial_ended_announcement_bar'; -import AutoStartTrialModal from './show_start_trial_modal/show_start_trial_modal'; -import CloudDelinquencyAnnouncementBar from './cloud_delinquency'; -import ShowThreeDaysLeftTrialModal from './show_tree_days_left_trial_modal/show_three_days_left_trial_modal'; +import ConfigurationAnnouncementBar from './configuration_bar'; +import AnnouncementBar from './default_announcement_bar'; import NotifyAdminDowngradeDelinquencyBar from './notify_admin_downgrade_delinquency_bar'; import OverageUsersBanner from './overage_users_banner'; +import PaymentAnnouncementBar from './payment_announcement_bar'; +import AutoStartTrialModal from './show_start_trial_modal/show_start_trial_modal'; +import ShowThreeDaysLeftTrialModal from './show_tree_days_left_trial_modal/show_three_days_left_trial_modal'; +import TextDismissableBar from './text_dismissable_bar'; +import VersionBar from './version_bar'; type Props = { license?: ClientLicense; diff --git a/webapp/channels/src/components/announcement_bar/cloud_delinquency/cloud_delinquency_announcement_bar.test.tsx b/webapp/channels/src/components/announcement_bar/cloud_delinquency/cloud_delinquency_announcement_bar.test.tsx index 82d95e1e38..834ec5c661 100644 --- a/webapp/channels/src/components/announcement_bar/cloud_delinquency/cloud_delinquency_announcement_bar.test.tsx +++ b/webapp/channels/src/components/announcement_bar/cloud_delinquency/cloud_delinquency_announcement_bar.test.tsx @@ -4,9 +4,9 @@ import React from 'react'; import * as reactRedux from 'react-redux'; -import {CloudProducts} from 'utils/constants'; import {mountWithIntl} from 'tests/helpers/intl-test-helper'; import mockStore from 'tests/test_store'; +import {CloudProducts} from 'utils/constants'; import CloudDelinquencyAnnouncementBar from './index'; diff --git a/webapp/channels/src/components/announcement_bar/cloud_delinquency/index.tsx b/webapp/channels/src/components/announcement_bar/cloud_delinquency/index.tsx index 95fa06f2ac..7208449524 100644 --- a/webapp/channels/src/components/announcement_bar/cloud_delinquency/index.tsx +++ b/webapp/channels/src/components/announcement_bar/cloud_delinquency/index.tsx @@ -2,23 +2,26 @@ // See LICENSE.txt for license information. import React from 'react'; +import {FormattedMessage} from 'react-intl'; import {useSelector} from 'react-redux'; -import {FormattedMessage} from 'react-intl'; +import {getCurrentUser} from 'mattermost-redux/selectors/entities/users'; +import {isSystemAdmin} from 'mattermost-redux/utils/user_utils'; + +import {trackEvent} from 'actions/telemetry_actions'; + +import {useDelinquencySubscription} from 'components/common/hooks/useDelinquencySubscription'; +import useGetSubscription from 'components/common/hooks/useGetSubscription'; +import useOpenCloudPurchaseModal from 'components/common/hooks/useOpenCloudPurchaseModal'; -import {t} from 'utils/i18n'; import { AnnouncementBarTypes, TELEMETRY_CATEGORIES, } from 'utils/constants'; +import {t} from 'utils/i18n'; + +import type {GlobalState} from 'types/store'; import AnnouncementBar from '../default_announcement_bar'; -import useGetSubscription from 'components/common/hooks/useGetSubscription'; -import useOpenCloudPurchaseModal from 'components/common/hooks/useOpenCloudPurchaseModal'; -import {trackEvent} from 'actions/telemetry_actions'; -import {useDelinquencySubscription} from 'components/common/hooks/useDelinquencySubscription'; -import {GlobalState} from 'types/store'; -import {getCurrentUser} from 'mattermost-redux/selectors/entities/users'; -import {isSystemAdmin} from 'mattermost-redux/utils/user_utils'; const CloudDelinquencyAnnouncementBar = () => { const subscription = useGetSubscription(); diff --git a/webapp/channels/src/components/announcement_bar/cloud_trial_announcement_bar/cloud_trial_announcement_bar.tsx b/webapp/channels/src/components/announcement_bar/cloud_trial_announcement_bar/cloud_trial_announcement_bar.tsx index f03effb517..71280c92b4 100644 --- a/webapp/channels/src/components/announcement_bar/cloud_trial_announcement_bar/cloud_trial_announcement_bar.tsx +++ b/webapp/channels/src/components/announcement_bar/cloud_trial_announcement_bar/cloud_trial_announcement_bar.tsx @@ -1,25 +1,19 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; - import {isEmpty} from 'lodash'; - +import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {PreferenceType} from '@mattermost/types/preferences'; -import {UserProfile} from '@mattermost/types/users'; -import {Subscription} from '@mattermost/types/cloud'; +import {AlertCircleOutlineIcon, AlertOutlineIcon} from '@mattermost/compass-icons/components'; +import type {Subscription} from '@mattermost/types/cloud'; +import type {PreferenceType} from '@mattermost/types/preferences'; +import type {UserProfile} from '@mattermost/types/users'; import {trackEvent} from 'actions/telemetry_actions'; -import {t} from 'utils/i18n'; import PricingModal from 'components/pricing_modal'; -import {ModalData} from 'types/actions'; - -import {AlertCircleOutlineIcon, AlertOutlineIcon} from '@mattermost/compass-icons/components'; - import { Preferences, CloudBanners, @@ -28,8 +22,11 @@ import { TELEMETRY_CATEGORIES, TrialPeriodDays, } from 'utils/constants'; +import {t} from 'utils/i18n'; import {getLocaleDateFromUTC} from 'utils/utils'; +import type {ModalData} from 'types/actions'; + import AnnouncementBar from '../default_announcement_bar'; type Props = { diff --git a/webapp/channels/src/components/announcement_bar/cloud_trial_announcement_bar/index.ts b/webapp/channels/src/components/announcement_bar/cloud_trial_announcement_bar/index.ts index 3d7e4fd871..a2e873d6d9 100644 --- a/webapp/channels/src/components/announcement_bar/cloud_trial_announcement_bar/index.ts +++ b/webapp/channels/src/components/announcement_bar/cloud_trial_announcement_bar/index.ts @@ -2,26 +2,25 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch} from 'redux'; -import {savePreferences} from 'mattermost-redux/actions/preferences'; -import {getLicense} from 'mattermost-redux/selectors/entities/general'; -import {GenericAction} from 'mattermost-redux/types/actions'; -import {makeGetCategory} from 'mattermost-redux/selectors/entities/preferences'; import {getCloudSubscription} from 'mattermost-redux/actions/cloud'; - +import {savePreferences} from 'mattermost-redux/actions/preferences'; +import {getConfig} from 'mattermost-redux/selectors/entities/admin'; +import {getLicense} from 'mattermost-redux/selectors/entities/general'; +import {makeGetCategory} from 'mattermost-redux/selectors/entities/preferences'; import {getCurrentUser, isCurrentUserSystemAdmin} from 'mattermost-redux/selectors/entities/users'; +import type {GenericAction} from 'mattermost-redux/types/actions'; import {openModal} from 'actions/views/modals'; -import {GlobalState} from 'types/store'; - import {Preferences, TrialPeriodDays} from 'utils/constants'; - import {getRemainingDaysFromFutureTimestamp} from 'utils/utils'; +import type {GlobalState} from 'types/store'; + import CloudTrialAnnouncementBar from './cloud_trial_announcement_bar'; -import {getConfig} from 'mattermost-redux/selectors/entities/admin'; function mapStateToProps(state: GlobalState) { const getCategory = makeGetCategory(); diff --git a/webapp/channels/src/components/announcement_bar/cloud_trial_ended_announcement_bar/cloud_trial_ended_announcement_bar.test.tsx b/webapp/channels/src/components/announcement_bar/cloud_trial_ended_announcement_bar/cloud_trial_ended_announcement_bar.test.tsx index c319499d7d..7794acd1aa 100644 --- a/webapp/channels/src/components/announcement_bar/cloud_trial_ended_announcement_bar/cloud_trial_ended_announcement_bar.test.tsx +++ b/webapp/channels/src/components/announcement_bar/cloud_trial_ended_announcement_bar/cloud_trial_ended_announcement_bar.test.tsx @@ -4,11 +4,12 @@ import React from 'react'; import * as reactRedux from 'react-redux'; -import {FileSizes} from 'utils/file_utils'; -import {CloudProducts, Preferences, CloudBanners} from 'utils/constants'; +import {getPreferenceKey} from 'mattermost-redux/utils/preference_utils'; + import {mountWithIntl} from 'tests/helpers/intl-test-helper'; import mockStore from 'tests/test_store'; -import {getPreferenceKey} from 'mattermost-redux/utils/preference_utils'; +import {CloudProducts, Preferences, CloudBanners} from 'utils/constants'; +import {FileSizes} from 'utils/file_utils'; import CloudTrialEndAnnouncementBar from './index'; diff --git a/webapp/channels/src/components/announcement_bar/cloud_trial_ended_announcement_bar/index.tsx b/webapp/channels/src/components/announcement_bar/cloud_trial_ended_announcement_bar/index.tsx index f3769451ae..8d285fbaa5 100644 --- a/webapp/channels/src/components/announcement_bar/cloud_trial_ended_announcement_bar/index.tsx +++ b/webapp/channels/src/components/announcement_bar/cloud_trial_ended_announcement_bar/index.tsx @@ -2,32 +2,34 @@ // See LICENSE.txt for license information. import React from 'react'; - import {FormattedMessage} from 'react-intl'; import {useSelector, useDispatch} from 'react-redux'; -import {t} from 'utils/i18n'; +import {savePreferences} from 'mattermost-redux/actions/preferences'; +import { + getSubscriptionProduct, +} from 'mattermost-redux/selectors/entities/cloud'; +import {makeGetCategory} from 'mattermost-redux/selectors/entities/preferences'; +import { + getCurrentUser, +} from 'mattermost-redux/selectors/entities/users'; +import {isSystemAdmin} from 'mattermost-redux/utils/user_utils'; + +import useGetLimits from 'components/common/hooks/useGetLimits'; +import useGetSubscription from 'components/common/hooks/useGetSubscription'; +import useOpenPricingModal from 'components/common/hooks/useOpenPricingModal'; -import AnnouncementBar from '../default_announcement_bar'; import { AnnouncementBarTypes, Preferences, CloudBanners, CloudProducts, } from 'utils/constants'; -import {GlobalState} from 'types/store'; -import useGetLimits from 'components/common/hooks/useGetLimits'; -import useGetSubscription from 'components/common/hooks/useGetSubscription'; -import useOpenPricingModal from 'components/common/hooks/useOpenPricingModal'; -import {isSystemAdmin} from 'mattermost-redux/utils/user_utils'; -import {makeGetCategory} from 'mattermost-redux/selectors/entities/preferences'; -import {savePreferences} from 'mattermost-redux/actions/preferences'; -import { - getCurrentUser, -} from 'mattermost-redux/selectors/entities/users'; -import { - getSubscriptionProduct, -} from 'mattermost-redux/selectors/entities/cloud'; +import {t} from 'utils/i18n'; + +import type {GlobalState} from 'types/store'; + +import AnnouncementBar from '../default_announcement_bar'; const CloudTrialEndAnnouncementBar: React.FC = () => { const limits = useGetLimits(); diff --git a/webapp/channels/src/components/announcement_bar/configuration_bar/configuration_bar.test.tsx b/webapp/channels/src/components/announcement_bar/configuration_bar/configuration_bar.test.tsx index 5afe462d2c..e991aa2382 100644 --- a/webapp/channels/src/components/announcement_bar/configuration_bar/configuration_bar.test.tsx +++ b/webapp/channels/src/components/announcement_bar/configuration_bar/configuration_bar.test.tsx @@ -3,9 +3,10 @@ import React from 'react'; -import {shallowWithIntl} from 'tests/helpers/intl-test-helper'; import ConfigurationBar from 'components/announcement_bar/configuration_bar/configuration_bar'; +import {shallowWithIntl} from 'tests/helpers/intl-test-helper'; + describe('components/ConfigurationBar', () => { const millisPerDay = 24 * 60 * 60 * 1000; diff --git a/webapp/channels/src/components/announcement_bar/configuration_bar/configuration_bar.tsx b/webapp/channels/src/components/announcement_bar/configuration_bar/configuration_bar.tsx index 5c8ef4c5f1..aa77ff1100 100644 --- a/webapp/channels/src/components/announcement_bar/configuration_bar/configuration_bar.tsx +++ b/webapp/channels/src/components/announcement_bar/configuration_bar/configuration_bar.tsx @@ -1,34 +1,34 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {ReactNode} from 'react'; -import {FormattedMessage, injectIntl, IntlShape} from 'react-intl'; +import React from 'react'; +import type {ReactNode} from 'react'; +import {FormattedMessage, injectIntl} from 'react-intl'; +import type {IntlShape} from 'react-intl'; import {Link} from 'react-router-dom'; -import {daysToLicenseExpire, isLicenseExpired, isLicenseExpiring, isLicensePastGracePeriod, isTrialLicense} from 'utils/license_utils'; -import {AnnouncementBarTypes, AnnouncementBarMessages, WarnMetricTypes, Preferences, ConfigurationBanners, Constants, TELEMETRY_CATEGORIES} from 'utils/constants'; -import {t} from 'utils/i18n'; +import type {ClientConfig, WarnMetricStatus} from '@mattermost/types/config'; +import type {PreferenceType} from '@mattermost/types/preferences'; -import PurchaseLink from 'components/announcement_bar/purchase_link/purchase_link'; -import {getSkuDisplayName} from 'utils/subscription'; -import {getViewportSize} from 'utils/utils'; - -import ackIcon from 'images/icons/check-circle-outline.svg'; -import alertIcon from 'images/icons/round-white-info-icon.svg'; - -import warningIcon from 'images/icons/warning-icon.svg'; +import type {DispatchFunc} from 'mattermost-redux/types/actions'; import {trackEvent} from 'actions/telemetry_actions'; -import {DispatchFunc} from 'mattermost-redux/types/actions'; +import PurchaseLink from 'components/announcement_bar/purchase_link/purchase_link'; +import ExternalLink from 'components/external_link'; -import {ClientConfig, WarnMetricStatus} from '@mattermost/types/config'; -import {PreferenceType} from '@mattermost/types/preferences'; +import ackIcon from 'images/icons/check-circle-outline.svg'; +import alertIcon from 'images/icons/round-white-info-icon.svg'; +import warningIcon from 'images/icons/warning-icon.svg'; +import {AnnouncementBarTypes, AnnouncementBarMessages, WarnMetricTypes, Preferences, ConfigurationBanners, Constants, TELEMETRY_CATEGORIES} from 'utils/constants'; +import {t} from 'utils/i18n'; +import {daysToLicenseExpire, isLicenseExpired, isLicenseExpiring, isLicensePastGracePeriod, isTrialLicense} from 'utils/license_utils'; +import {getSkuDisplayName} from 'utils/subscription'; +import {getViewportSize} from 'utils/utils'; import AnnouncementBar from '../default_announcement_bar'; -import TextDismissableBar from '../text_dismissable_bar'; import RenewalLink from '../renewal_link/'; -import ExternalLink from 'components/external_link'; +import TextDismissableBar from '../text_dismissable_bar'; type Props = { config?: Partial; diff --git a/webapp/channels/src/components/announcement_bar/configuration_bar/index.ts b/webapp/channels/src/components/announcement_bar/configuration_bar/index.ts index e054cb0b24..14cda6d404 100644 --- a/webapp/channels/src/components/announcement_bar/configuration_bar/index.ts +++ b/webapp/channels/src/components/announcement_bar/configuration_bar/index.ts @@ -2,19 +2,21 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch} from 'redux'; -import {GenericAction} from 'mattermost-redux/types/actions'; -import {get as getPreference} from 'mattermost-redux/selectors/entities/preferences'; import {savePreferences} from 'mattermost-redux/actions/preferences'; +import {get as getPreference} from 'mattermost-redux/selectors/entities/preferences'; import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users'; +import type {GenericAction} from 'mattermost-redux/types/actions'; -import {GlobalState} from 'types/store'; +import {dismissNotice} from 'actions/views/notice'; import {AnnouncementBarMessages, ConfigurationBanners, Preferences} from 'utils/constants'; -import {dismissNotice} from 'actions/views/notice'; import {getSiteURL} from 'utils/url'; +import type {GlobalState} from 'types/store'; + import ConfigurationBar from './configuration_bar'; function mapStateToProps(state: GlobalState) { diff --git a/webapp/channels/src/components/announcement_bar/contact_sales/contact_us.tsx b/webapp/channels/src/components/announcement_bar/contact_sales/contact_us.tsx index 74b576192d..e9f3e37121 100644 --- a/webapp/channels/src/components/announcement_bar/contact_sales/contact_us.tsx +++ b/webapp/channels/src/components/announcement_bar/contact_sales/contact_us.tsx @@ -2,10 +2,10 @@ // See LICENSE.txt for license information. import React from 'react'; - import {FormattedMessage} from 'react-intl'; import {trackEvent} from 'actions/telemetry_actions'; + import useOpenSalesLink from 'components/common/hooks/useOpenSalesLink'; import './contact_us.scss'; diff --git a/webapp/channels/src/components/announcement_bar/default_announcement_bar/announcement_bar.tsx b/webapp/channels/src/components/announcement_bar/default_announcement_bar/announcement_bar.tsx index f93791291a..12aaef1a41 100644 --- a/webapp/channels/src/components/announcement_bar/default_announcement_bar/announcement_bar.tsx +++ b/webapp/channels/src/components/announcement_bar/default_announcement_bar/announcement_bar.tsx @@ -2,21 +2,20 @@ // See LICENSE.txt for license information. import React from 'react'; - import {FormattedMessage} from 'react-intl'; -import {WarnMetricStatus} from '@mattermost/types/config'; +import type {WarnMetricStatus} from '@mattermost/types/config'; -import {Constants, AnnouncementBarTypes, ModalIdentifiers} from 'utils/constants'; -import {isStringContainingUrl} from 'utils/url'; +import {trackEvent} from 'actions/telemetry_actions.jsx'; import FormattedMarkdownMessage from 'components/formatted_markdown_message'; import OverlayTrigger from 'components/overlay_trigger'; +import ToggleModalButton from 'components/toggle_modal_button'; import Tooltip from 'components/tooltip'; import WarnMetricAckModal from 'components/warn_metric_ack_modal'; -import ToggleModalButton from 'components/toggle_modal_button'; -import {trackEvent} from 'actions/telemetry_actions.jsx'; +import {Constants, AnnouncementBarTypes, ModalIdentifiers} from 'utils/constants'; +import {isStringContainingUrl} from 'utils/url'; type Props = { id?: string; diff --git a/webapp/channels/src/components/announcement_bar/default_announcement_bar/index.ts b/webapp/channels/src/components/announcement_bar/default_announcement_bar/index.ts index d9b7dbdbb3..55787cab16 100644 --- a/webapp/channels/src/components/announcement_bar/default_announcement_bar/index.ts +++ b/webapp/channels/src/components/announcement_bar/default_announcement_bar/index.ts @@ -2,13 +2,15 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch} from 'redux'; -import {GenericAction} from 'mattermost-redux/types/actions'; +import type {GenericAction} from 'mattermost-redux/types/actions'; import {incrementAnnouncementBarCount, decrementAnnouncementBarCount} from 'actions/views/announcement_bar'; import {getAnnouncementBarCount} from 'selectors/views/announcement_bar'; -import {GlobalState} from 'types/store'; + +import type {GlobalState} from 'types/store'; import AnnouncementBar from './announcement_bar'; diff --git a/webapp/channels/src/components/announcement_bar/index.ts b/webapp/channels/src/components/announcement_bar/index.ts index 36e96111ab..fd6f1ddb8f 100644 --- a/webapp/channels/src/components/announcement_bar/index.ts +++ b/webapp/channels/src/components/announcement_bar/index.ts @@ -2,20 +2,22 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch} from 'redux'; -import {Permissions} from 'mattermost-redux/constants'; -import {haveISystemPermission} from 'mattermost-redux/selectors/entities/roles'; -import {getConfig, getLicense, warnMetricsStatus as getWarnMetricsStatus} from 'mattermost-redux/selectors/entities/general'; -import {getDisplayableErrors} from 'mattermost-redux/selectors/errors'; -import {dismissError} from 'mattermost-redux/actions/errors'; import {getStandardAnalytics} from 'mattermost-redux/actions/admin'; -import {GenericAction} from 'mattermost-redux/types/actions'; import {getCloudSubscription, getCloudCustomer} from 'mattermost-redux/actions/cloud'; +import {dismissError} from 'mattermost-redux/actions/errors'; +import {Permissions} from 'mattermost-redux/constants'; +import {getConfig, getLicense, warnMetricsStatus as getWarnMetricsStatus} from 'mattermost-redux/selectors/entities/general'; +import {haveISystemPermission} from 'mattermost-redux/selectors/entities/roles'; import {isCurrentUserSystemAdmin} from 'mattermost-redux/selectors/entities/users'; +import {getDisplayableErrors} from 'mattermost-redux/selectors/errors'; +import type {GenericAction} from 'mattermost-redux/types/actions'; import {dismissNotice} from 'actions/views/notice'; -import {GlobalState} from 'types/store'; + +import type {GlobalState} from 'types/store'; import AnnouncementBarController from './announcement_bar_controller'; diff --git a/webapp/channels/src/components/announcement_bar/no_internet_connection/no_internet_connection.tsx b/webapp/channels/src/components/announcement_bar/no_internet_connection/no_internet_connection.tsx index fa3a1900e2..8a20657c11 100644 --- a/webapp/channels/src/components/announcement_bar/no_internet_connection/no_internet_connection.tsx +++ b/webapp/channels/src/components/announcement_bar/no_internet_connection/no_internet_connection.tsx @@ -4,10 +4,10 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import FormattedMarkdownMessage from 'components/formatted_markdown_message'; - import {GenericModal} from '@mattermost/components'; +import FormattedMarkdownMessage from 'components/formatted_markdown_message'; + import './no_internet_connection.scss'; import NoInternetConnectionSvg from './no-internet-connection-svg'; diff --git a/webapp/channels/src/components/announcement_bar/notify_admin_downgrade_delinquency_bar/index.tsx b/webapp/channels/src/components/announcement_bar/notify_admin_downgrade_delinquency_bar/index.tsx index 53707a5177..2e760dc24d 100644 --- a/webapp/channels/src/components/announcement_bar/notify_admin_downgrade_delinquency_bar/index.tsx +++ b/webapp/channels/src/components/announcement_bar/notify_admin_downgrade_delinquency_bar/index.tsx @@ -2,26 +2,28 @@ // See LICENSE.txt for license information. import React, {useEffect} from 'react'; - import {FormattedMessage} from 'react-intl'; import {useSelector, useDispatch} from 'react-redux'; -import {t} from 'utils/i18n'; +import {savePreferences} from 'mattermost-redux/actions/preferences'; +import {getSubscriptionProduct} from 'mattermost-redux/selectors/entities/cloud'; +import {makeGetCategory} from 'mattermost-redux/selectors/entities/preferences'; +import {getCurrentUser} from 'mattermost-redux/selectors/entities/users'; +import {isSystemAdmin} from 'mattermost-redux/utils/user_utils'; + +import {trackEvent} from 'actions/telemetry_actions'; + +import {useDelinquencySubscription} from 'components/common/hooks/useDelinquencySubscription'; +import {NotifyStatus, useGetNotifyAdmin} from 'components/common/hooks/useGetNotifyAdmin'; + import { AnnouncementBarTypes, CloudProducts, CloudProductToSku, MattermostFeatures, Preferences, TELEMETRY_CATEGORIES, } from 'utils/constants'; +import {t} from 'utils/i18n'; -import {GlobalState} from 'types/store'; -import {makeGetCategory} from 'mattermost-redux/selectors/entities/preferences'; -import {getCurrentUser} from 'mattermost-redux/selectors/entities/users'; -import {trackEvent} from 'actions/telemetry_actions'; -import {getSubscriptionProduct} from 'mattermost-redux/selectors/entities/cloud'; -import {NotifyStatus, useGetNotifyAdmin} from 'components/common/hooks/useGetNotifyAdmin'; -import {savePreferences} from 'mattermost-redux/actions/preferences'; -import {isSystemAdmin} from 'mattermost-redux/utils/user_utils'; +import type {GlobalState} from 'types/store'; import AnnouncementBar from '../default_announcement_bar'; -import {useDelinquencySubscription} from 'components/common/hooks/useDelinquencySubscription'; export const BannerPreferenceName = 'notify_upgrade_workspace_banner'; diff --git a/webapp/channels/src/components/announcement_bar/notify_admin_downgrade_delinquency_bar/notify_admin_downgrade_delinquency_bar.test.tsx b/webapp/channels/src/components/announcement_bar/notify_admin_downgrade_delinquency_bar/notify_admin_downgrade_delinquency_bar.test.tsx index 052fe6beaf..5e9586df45 100644 --- a/webapp/channels/src/components/announcement_bar/notify_admin_downgrade_delinquency_bar/notify_admin_downgrade_delinquency_bar.test.tsx +++ b/webapp/channels/src/components/announcement_bar/notify_admin_downgrade_delinquency_bar/notify_admin_downgrade_delinquency_bar.test.tsx @@ -1,10 +1,16 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {ComponentProps} from 'react'; +import React from 'react'; +import type {ComponentProps} from 'react'; import * as reactRedux from 'react-redux'; +import {savePreferences} from 'mattermost-redux/actions/preferences'; +import {Client4} from 'mattermost-redux/client'; + +import {trackEvent} from 'actions/telemetry_actions'; import configureStore from 'store'; + import { fireEvent, renderWithIntl, @@ -12,9 +18,6 @@ import { waitFor, } from 'tests/react_testing_utils'; import {CloudProducts, Preferences, TELEMETRY_CATEGORIES} from 'utils/constants'; -import {savePreferences} from 'mattermost-redux/actions/preferences'; -import {Client4} from 'mattermost-redux/client'; -import {trackEvent} from 'actions/telemetry_actions'; import {TestHelper} from 'utils/test_helper'; import NotifyAdminDowngradeDeliquencyBar, {BannerPreferenceName} from './index'; diff --git a/webapp/channels/src/components/announcement_bar/overage_users_banner/index.tsx b/webapp/channels/src/components/announcement_bar/overage_users_banner/index.tsx index bd57fedf66..f837e001a6 100644 --- a/webapp/channels/src/components/announcement_bar/overage_users_banner/index.tsx +++ b/webapp/channels/src/components/announcement_bar/overage_users_banner/index.tsx @@ -5,23 +5,27 @@ import React, {useMemo} from 'react'; import {FormattedMessage} from 'react-intl'; import {useDispatch, useSelector} from 'react-redux'; -import {getCurrentUser, isCurrentUserSystemAdmin} from 'mattermost-redux/selectors/entities/users'; -import {GlobalState} from 'types/store'; -import {getLicense} from 'mattermost-redux/selectors/entities/general'; -import AnnouncementBar from 'components/announcement_bar/default_announcement_bar'; -import {calculateOverageUserActivated} from 'utils/overage_team'; -import {isCurrentLicenseCloud} from 'mattermost-redux/selectors/entities/cloud'; +import type {PreferenceType} from '@mattermost/types/preferences'; + import {savePreferences} from 'mattermost-redux/actions/preferences'; +import {getConfig} from 'mattermost-redux/selectors/entities/admin'; +import {isCurrentLicenseCloud} from 'mattermost-redux/selectors/entities/cloud'; +import {getLicense} from 'mattermost-redux/selectors/entities/general'; import {makeGetCategory} from 'mattermost-redux/selectors/entities/preferences'; -import {PreferenceType} from '@mattermost/types/preferences'; +import {getCurrentUser, isCurrentUserSystemAdmin} from 'mattermost-redux/selectors/entities/users'; + +import AnnouncementBar from 'components/announcement_bar/default_announcement_bar'; +import useCanSelfHostedExpand from 'components/common/hooks/useCanSelfHostedExpand'; import {useExpandOverageUsersCheck} from 'components/common/hooks/useExpandOverageUsersCheck'; import useOpenSalesLink from 'components/common/hooks/useOpenSalesLink'; + import {StatTypes, Preferences, AnnouncementBarTypes, ConsolePages} from 'utils/constants'; +import {calculateOverageUserActivated} from 'utils/overage_team'; +import {getSiteURL} from 'utils/url'; + +import type {GlobalState} from 'types/store'; import './overage_users_banner.scss'; -import {getSiteURL} from 'utils/url'; -import useCanSelfHostedExpand from 'components/common/hooks/useCanSelfHostedExpand'; -import {getConfig} from 'mattermost-redux/selectors/entities/admin'; type AdminHasDismissedItArgs = { preferenceName: string; diff --git a/webapp/channels/src/components/announcement_bar/overage_users_banner/overage_users_banner.test.tsx b/webapp/channels/src/components/announcement_bar/overage_users_banner/overage_users_banner.test.tsx index e89433f856..5a9feb3812 100644 --- a/webapp/channels/src/components/announcement_bar/overage_users_banner/overage_users_banner.test.tsx +++ b/webapp/channels/src/components/announcement_bar/overage_users_banner/overage_users_banner.test.tsx @@ -3,17 +3,21 @@ import React from 'react'; -import {DeepPartial} from '@mattermost/types/utilities'; -import {GlobalState} from 'types/store'; -import {General} from 'mattermost-redux/constants'; -import {OverActiveUserLimits, Preferences, SelfHostedProducts, StatTypes} from 'utils/constants'; -import {fireEvent, renderWithIntlAndStore, screen} from 'tests/react_testing_utils'; -import {savePreferences} from 'mattermost-redux/actions/preferences'; -import {trackEvent} from 'actions/telemetry_actions'; +import type {DeepPartial} from '@mattermost/types/utilities'; + import {getLicenseSelfServeStatus} from 'mattermost-redux/actions/cloud'; +import {savePreferences} from 'mattermost-redux/actions/preferences'; +import {General} from 'mattermost-redux/constants'; + +import {trackEvent} from 'actions/telemetry_actions'; + +import {fireEvent, renderWithIntlAndStore, screen} from 'tests/react_testing_utils'; +import {OverActiveUserLimits, Preferences, SelfHostedProducts, StatTypes} from 'utils/constants'; import {TestHelper} from 'utils/test_helper'; import {generateId} from 'utils/utils'; +import type {GlobalState} from 'types/store'; + import OverageUsersBanner from './index'; type ComponentProps = React.ComponentProps; diff --git a/webapp/channels/src/components/announcement_bar/payment_announcement_bar/index.test.tsx b/webapp/channels/src/components/announcement_bar/payment_announcement_bar/index.test.tsx index eeca7495c1..0332b89820 100644 --- a/webapp/channels/src/components/announcement_bar/payment_announcement_bar/index.test.tsx +++ b/webapp/channels/src/components/announcement_bar/payment_announcement_bar/index.test.tsx @@ -2,9 +2,10 @@ // See LICENSE.txt for license information. import React from 'react'; -import {renderWithIntlAndStore, screen} from 'tests/react_testing_utils'; + import * as cloudActions from 'mattermost-redux/actions/cloud'; +import {renderWithIntlAndStore, screen} from 'tests/react_testing_utils'; import {CloudProducts} from 'utils/constants'; import PaymentAnnouncementBar from './'; diff --git a/webapp/channels/src/components/announcement_bar/payment_announcement_bar/index.tsx b/webapp/channels/src/components/announcement_bar/payment_announcement_bar/index.tsx index f14153ad8e..e274f91b5d 100644 --- a/webapp/channels/src/components/announcement_bar/payment_announcement_bar/index.tsx +++ b/webapp/channels/src/components/announcement_bar/payment_announcement_bar/index.tsx @@ -1,20 +1,20 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {isEmpty} from 'lodash'; import React, {useEffect, useState} from 'react'; import {FormattedMessage} from 'react-intl'; import {useSelector, useDispatch} from 'react-redux'; -import {isEmpty} from 'lodash'; -import {DispatchFunc} from 'mattermost-redux/types/actions'; import {getCloudCustomer} from 'mattermost-redux/actions/cloud'; -import {getLicense} from 'mattermost-redux/selectors/entities/general'; import { getCloudSubscription as selectCloudSubscription, getCloudCustomer as selectCloudCustomer, getSubscriptionProduct, } from 'mattermost-redux/selectors/entities/cloud'; +import {getLicense} from 'mattermost-redux/selectors/entities/general'; import {isCurrentUserSystemAdmin} from 'mattermost-redux/selectors/entities/users'; +import type {DispatchFunc} from 'mattermost-redux/types/actions'; import {getHistory} from 'utils/browser_history'; import {isCustomerCardExpired} from 'utils/cloud_utils'; diff --git a/webapp/channels/src/components/announcement_bar/purchase_link/purchase_link.tsx b/webapp/channels/src/components/announcement_bar/purchase_link/purchase_link.tsx index 5e6b39f7a9..73e214e927 100644 --- a/webapp/channels/src/components/announcement_bar/purchase_link/purchase_link.tsx +++ b/webapp/channels/src/components/announcement_bar/purchase_link/purchase_link.tsx @@ -8,16 +8,16 @@ import {getConfig} from 'mattermost-redux/selectors/entities/admin'; import {trackEvent} from 'actions/telemetry_actions'; -import {CloudLinks, SelfHostedProducts} from 'utils/constants'; -import {findSelfHostedProductBySku} from 'utils/hosted_customer'; - -import useControlSelfHostedPurchaseModal from 'components/common/hooks/useControlSelfHostedPurchaseModal'; -import useGetSelfHostedProducts from 'components/common/hooks/useGetSelfHostedProducts'; import useCanSelfHostedSignup from 'components/common/hooks/useCanSelfHostedSignup'; import { useControlAirGappedSelfHostedPurchaseModal, useControlScreeningInProgressModal, } from 'components/common/hooks/useControlModal'; +import useControlSelfHostedPurchaseModal from 'components/common/hooks/useControlSelfHostedPurchaseModal'; +import useGetSelfHostedProducts from 'components/common/hooks/useGetSelfHostedProducts'; + +import {CloudLinks, SelfHostedProducts} from 'utils/constants'; +import {findSelfHostedProductBySku} from 'utils/hosted_customer'; import './purchase_link.scss'; diff --git a/webapp/channels/src/components/announcement_bar/renewal_link/index.ts b/webapp/channels/src/components/announcement_bar/renewal_link/index.ts index d6ef94196f..905488563f 100644 --- a/webapp/channels/src/components/announcement_bar/renewal_link/index.ts +++ b/webapp/channels/src/components/announcement_bar/renewal_link/index.ts @@ -2,9 +2,10 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch} from 'redux'; -import {GenericAction} from 'mattermost-redux/types/actions'; +import type {GenericAction} from 'mattermost-redux/types/actions'; import {openModal} from 'actions/views/modals'; diff --git a/webapp/channels/src/components/announcement_bar/renewal_link/renewal_link.test.tsx b/webapp/channels/src/components/announcement_bar/renewal_link/renewal_link.test.tsx index 9dae6a38d0..b314531be1 100644 --- a/webapp/channels/src/components/announcement_bar/renewal_link/renewal_link.test.tsx +++ b/webapp/channels/src/components/announcement_bar/renewal_link/renewal_link.test.tsx @@ -1,12 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import type {ReactWrapper} from 'enzyme'; import React from 'react'; -import {ReactWrapper} from 'enzyme'; -import {Provider} from 'react-redux'; import {act} from 'react-dom/test-utils'; +import {Provider} from 'react-redux'; import {Client4} from 'mattermost-redux/client'; + import {mountWithIntl} from 'tests/helpers/intl-test-helper'; import mockStore from 'tests/test_store'; diff --git a/webapp/channels/src/components/announcement_bar/renewal_link/renewal_link.tsx b/webapp/channels/src/components/announcement_bar/renewal_link/renewal_link.tsx index dfae9f3ea1..d2f4d3e1a8 100644 --- a/webapp/channels/src/components/announcement_bar/renewal_link/renewal_link.tsx +++ b/webapp/channels/src/components/announcement_bar/renewal_link/renewal_link.tsx @@ -8,12 +8,13 @@ import {Client4} from 'mattermost-redux/client'; import {trackEvent} from 'actions/telemetry_actions'; -import {ModalData} from 'types/actions'; +import useOpenSalesLink from 'components/common/hooks/useOpenSalesLink'; import { ModalIdentifiers, } from 'utils/constants'; -import useOpenSalesLink from 'components/common/hooks/useOpenSalesLink'; + +import type {ModalData} from 'types/actions'; import NoInternetConnection from '../no_internet_connection/no_internet_connection'; diff --git a/webapp/channels/src/components/announcement_bar/show_start_trial_modal/show_start_trial_modal.test.tsx b/webapp/channels/src/components/announcement_bar/show_start_trial_modal/show_start_trial_modal.test.tsx index 95a805c04a..f3960cfbd7 100644 --- a/webapp/channels/src/components/announcement_bar/show_start_trial_modal/show_start_trial_modal.test.tsx +++ b/webapp/channels/src/components/announcement_bar/show_start_trial_modal/show_start_trial_modal.test.tsx @@ -1,13 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {mount, shallow} from 'enzyme'; import React from 'react'; -import {mount, shallow} from 'enzyme'; - -import * as getTotalUsersHook from 'components/common/hooks/useGetTotalUsersNoBots'; - import ShowStartTrialModal from 'components/announcement_bar/show_start_trial_modal/show_start_trial_modal'; +import * as getTotalUsersHook from 'components/common/hooks/useGetTotalUsersNoBots'; let mockState: any; const mockDispatch = jest.fn(); diff --git a/webapp/channels/src/components/announcement_bar/show_start_trial_modal/show_start_trial_modal.tsx b/webapp/channels/src/components/announcement_bar/show_start_trial_modal/show_start_trial_modal.tsx index 4393ea478d..3f0847054b 100644 --- a/webapp/channels/src/components/announcement_bar/show_start_trial_modal/show_start_trial_modal.tsx +++ b/webapp/channels/src/components/announcement_bar/show_start_trial_modal/show_start_trial_modal.tsx @@ -4,18 +4,19 @@ import {useEffect} from 'react'; import {useSelector, useDispatch} from 'react-redux'; -import {DispatchFunc} from 'mattermost-redux/types/actions'; -import {PreferenceType} from '@mattermost/types/preferences'; - -import useGetTotalUsersNoBots from 'components/common/hooks/useGetTotalUsersNoBots'; +import type {PreferenceType} from '@mattermost/types/preferences'; +import {savePreferences} from 'mattermost-redux/actions/preferences'; import {getConfig, getLicense} from 'mattermost-redux/selectors/entities/general'; import {makeGetCategory} from 'mattermost-redux/selectors/entities/preferences'; import {getCurrentUser, isCurrentUserSystemAdmin} from 'mattermost-redux/selectors/entities/users'; -import {savePreferences} from 'mattermost-redux/actions/preferences'; -import useOpenStartTrialFormModal from 'components/common/hooks/useOpenStartTrialFormModal'; +import type {DispatchFunc} from 'mattermost-redux/types/actions'; -import {GlobalState} from 'types/store'; +import {trackEvent} from 'actions/telemetry_actions'; +import {isModalOpen} from 'selectors/views/modals'; + +import useGetTotalUsersNoBots from 'components/common/hooks/useGetTotalUsersNoBots'; +import useOpenStartTrialFormModal from 'components/common/hooks/useOpenStartTrialFormModal'; import { Preferences, @@ -24,8 +25,7 @@ import { ModalIdentifiers, } from 'utils/constants'; -import {trackEvent} from 'actions/telemetry_actions'; -import {isModalOpen} from 'selectors/views/modals'; +import type {GlobalState} from 'types/store'; const ShowStartTrialModal = () => { const isUserAdmin = useSelector((state: GlobalState) => isCurrentUserSystemAdmin(state)); diff --git a/webapp/channels/src/components/announcement_bar/show_tree_days_left_trial_modal/show_three_days_left_trial_modal.test.tsx b/webapp/channels/src/components/announcement_bar/show_tree_days_left_trial_modal/show_three_days_left_trial_modal.test.tsx index c11fd133a1..1493b7d29c 100644 --- a/webapp/channels/src/components/announcement_bar/show_tree_days_left_trial_modal/show_three_days_left_trial_modal.test.tsx +++ b/webapp/channels/src/components/announcement_bar/show_tree_days_left_trial_modal/show_three_days_left_trial_modal.test.tsx @@ -1,14 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {mount} from 'enzyme'; import React from 'react'; -import {mount} from 'enzyme'; - -import {FileSizes} from 'utils/file_utils'; - import ShowThreeDaysLeftTrialModal from 'components/announcement_bar/show_tree_days_left_trial_modal/show_three_days_left_trial_modal'; + import {CloudProducts} from 'utils/constants'; +import {FileSizes} from 'utils/file_utils'; let mockState: any; const mockDispatch = jest.fn(); diff --git a/webapp/channels/src/components/announcement_bar/show_tree_days_left_trial_modal/show_three_days_left_trial_modal.tsx b/webapp/channels/src/components/announcement_bar/show_tree_days_left_trial_modal/show_three_days_left_trial_modal.tsx index aeac875c79..a23acc8c02 100644 --- a/webapp/channels/src/components/announcement_bar/show_tree_days_left_trial_modal/show_three_days_left_trial_modal.tsx +++ b/webapp/channels/src/components/announcement_bar/show_tree_days_left_trial_modal/show_three_days_left_trial_modal.tsx @@ -1,25 +1,25 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import moment from 'moment'; import {useEffect} from 'react'; import {useSelector, useDispatch} from 'react-redux'; -import moment from 'moment'; - -import {DispatchFunc} from 'mattermost-redux/types/actions'; - +import {savePreferences} from 'mattermost-redux/actions/preferences'; +import {getCloudSubscription} from 'mattermost-redux/selectors/entities/cloud'; +import {getCurrentUserId} from 'mattermost-redux/selectors/entities/common'; +import {getLicense} from 'mattermost-redux/selectors/entities/general'; import {get as getPreference} from 'mattermost-redux/selectors/entities/preferences'; import {isCurrentUserSystemAdmin} from 'mattermost-redux/selectors/entities/users'; -import {getCloudSubscription} from 'mattermost-redux/selectors/entities/cloud'; -import {getLicense} from 'mattermost-redux/selectors/entities/general'; -import {getCurrentUserId} from 'mattermost-redux/selectors/entities/common'; -import {savePreferences} from 'mattermost-redux/actions/preferences'; - -import useGetHighestThresholdCloudLimit from 'components/common/hooks/useGetHighestThresholdCloudLimit'; +import type {DispatchFunc} from 'mattermost-redux/types/actions'; +import {trackEvent} from 'actions/telemetry_actions'; import {openModal, closeModal} from 'actions/views/modals'; -import {GlobalState} from 'types/store'; +import useGetHighestThresholdCloudLimit from 'components/common/hooks/useGetHighestThresholdCloudLimit'; +import useGetLimits from 'components/common/hooks/useGetLimits'; +import useGetUsage from 'components/common/hooks/useGetUsage'; +import ThreeDaysLeftTrialModal from 'components/three_days_left_trial_modal/three_days_left_trial_modal'; import { Preferences, @@ -28,11 +28,7 @@ import { CloudBanners, } from 'utils/constants'; -import ThreeDaysLeftTrialModal from 'components/three_days_left_trial_modal/three_days_left_trial_modal'; -import useGetLimits from 'components/common/hooks/useGetLimits'; -import useGetUsage from 'components/common/hooks/useGetUsage'; - -import {trackEvent} from 'actions/telemetry_actions'; +import type {GlobalState} from 'types/store'; const ShowThreeDaysLeftTrialModal = () => { const license = useSelector(getLicense); diff --git a/webapp/channels/src/components/announcement_bar/text_dismissable_bar.test.tsx b/webapp/channels/src/components/announcement_bar/text_dismissable_bar.test.tsx index d3941d6b26..979afdc410 100644 --- a/webapp/channels/src/components/announcement_bar/text_dismissable_bar.test.tsx +++ b/webapp/channels/src/components/announcement_bar/text_dismissable_bar.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import TextDismissableBar from 'components/announcement_bar/text_dismissable_bar'; diff --git a/webapp/channels/src/components/announcement_bar/text_dismissable_bar.tsx b/webapp/channels/src/components/announcement_bar/text_dismissable_bar.tsx index 5895aa0c1d..832421a6ec 100644 --- a/webapp/channels/src/components/announcement_bar/text_dismissable_bar.tsx +++ b/webapp/channels/src/components/announcement_bar/text_dismissable_bar.tsx @@ -4,6 +4,7 @@ import React from 'react'; import {trackEvent} from 'actions/telemetry_actions.jsx'; + import Markdown from 'components/markdown'; import alertIcon from 'images/icons/round-white-info-icon.svg'; diff --git a/webapp/channels/src/components/announcement_bar/version_bar/index.ts b/webapp/channels/src/components/announcement_bar/version_bar/index.ts index d0769c2137..02568c6d93 100644 --- a/webapp/channels/src/components/announcement_bar/version_bar/index.ts +++ b/webapp/channels/src/components/announcement_bar/version_bar/index.ts @@ -3,7 +3,7 @@ import {connect} from 'react-redux'; -import {GlobalState} from '@mattermost/types/store'; +import type {GlobalState} from '@mattermost/types/store'; import VersionBar from './version_bar'; diff --git a/webapp/channels/src/components/announcement_bar/version_bar/version_bar.test.tsx b/webapp/channels/src/components/announcement_bar/version_bar/version_bar.test.tsx index b8ac306644..1262cb0486 100644 --- a/webapp/channels/src/components/announcement_bar/version_bar/version_bar.test.tsx +++ b/webapp/channels/src/components/announcement_bar/version_bar/version_bar.test.tsx @@ -1,11 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; -import VersionBar from 'components/announcement_bar/version_bar/version_bar'; import AnnouncementBar from 'components/announcement_bar/default_announcement_bar'; +import VersionBar from 'components/announcement_bar/version_bar/version_bar'; describe('components/VersionBar', () => { test('should match snapshot - bar rendered after build hash change', () => { diff --git a/webapp/channels/src/components/announcement_bar/version_bar/version_bar.tsx b/webapp/channels/src/components/announcement_bar/version_bar/version_bar.tsx index 2228348787..e18df6f57a 100644 --- a/webapp/channels/src/components/announcement_bar/version_bar/version_bar.tsx +++ b/webapp/channels/src/components/announcement_bar/version_bar/version_bar.tsx @@ -2,7 +2,6 @@ // See LICENSE.txt for license information. import React from 'react'; - import {FormattedMessage} from 'react-intl'; import {AnnouncementBarTypes} from 'utils/constants'; diff --git a/webapp/channels/src/components/app.tsx b/webapp/channels/src/components/app.tsx index 84f0468bb3..ebec589169 100644 --- a/webapp/channels/src/components/app.tsx +++ b/webapp/channels/src/components/app.tsx @@ -1,17 +1,17 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {hot} from 'react-hot-loader/root'; import React from 'react'; +import {hot} from 'react-hot-loader/root'; import {Provider} from 'react-redux'; import {Router, Route} from 'react-router-dom'; -import {getHistory} from 'utils/browser_history'; import store from 'stores/redux_store.jsx'; import {makeAsyncComponent} from 'components/async_load'; - import CRTPostsChannelResetWatcher from 'components/threading/channel_threads/posts_channel_reset_watcher'; + +import {getHistory} from 'utils/browser_history'; const LazyRoot = React.lazy(() => import('components/root')); const Root = makeAsyncComponent('Root', LazyRoot); diff --git a/webapp/channels/src/components/app_bar/app_bar.test.tsx b/webapp/channels/src/components/app_bar/app_bar.test.tsx index b0e1e7b9d2..012f5a5298 100644 --- a/webapp/channels/src/components/app_bar/app_bar.test.tsx +++ b/webapp/channels/src/components/app_bar/app_bar.test.tsx @@ -1,20 +1,21 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {mount, shallow} from 'enzyme'; -import 'jest-styled-components'; +import React from 'react'; -import {AppBinding} from '@mattermost/types/apps'; - -import {PluginComponent} from 'types/store/plugins'; -import {GlobalState} from 'types/store'; +import type {AppBinding} from '@mattermost/types/apps'; import {Permissions} from 'mattermost-redux/constants'; import {AppBindingLocations} from 'mattermost-redux/constants/apps'; +import type {GlobalState} from 'types/store'; +import type {PluginComponent} from 'types/store/plugins'; + import AppBar from './app_bar'; +import 'jest-styled-components'; + const mockDispatch = jest.fn(); let mockState: GlobalState; diff --git a/webapp/channels/src/components/app_bar/app_bar.tsx b/webapp/channels/src/components/app_bar/app_bar.tsx index 931b739277..efd7c01628 100644 --- a/webapp/channels/src/components/app_bar/app_bar.tsx +++ b/webapp/channels/src/components/app_bar/app_bar.tsx @@ -1,26 +1,26 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {ReactNode} from 'react'; +import {partition} from 'lodash'; +import React from 'react'; +import type {ReactNode} from 'react'; import {useSelector} from 'react-redux'; -import {partition} from 'lodash'; - -import {useCurrentProduct, useCurrentProductId, inScope} from 'utils/products'; - -import {getAppBarAppBindings} from 'mattermost-redux/selectors/entities/apps'; -import {getAppBarPluginComponents, getChannelHeaderPluginComponents, shouldShowAppBar} from 'selectors/plugins'; -import {suitePluginIds} from 'utils/constants'; +import type {GlobalState} from '@mattermost/types/store'; import {Permissions} from 'mattermost-redux/constants'; +import {getAppBarAppBindings} from 'mattermost-redux/selectors/entities/apps'; import {isMarketplaceEnabled} from 'mattermost-redux/selectors/entities/general'; import {haveICurrentTeamPermission} from 'mattermost-redux/selectors/entities/roles'; -import {GlobalState} from '@mattermost/types/store'; +import {getAppBarPluginComponents, getChannelHeaderPluginComponents, shouldShowAppBar} from 'selectors/plugins'; + +import {suitePluginIds} from 'utils/constants'; +import {useCurrentProduct, useCurrentProductId, inScope} from 'utils/products'; -import AppBarPluginComponent, {isAppBarPluginComponent} from './app_bar_plugin_component'; import AppBarBinding, {isAppBinding} from './app_bar_binding'; import AppBarMarketplace from './app_bar_marketplace'; +import AppBarPluginComponent, {isAppBarPluginComponent} from './app_bar_plugin_component'; import './app_bar.scss'; diff --git a/webapp/channels/src/components/app_bar/app_bar_binding.tsx b/webapp/channels/src/components/app_bar/app_bar_binding.tsx index a5a6c4135c..21df0231ea 100644 --- a/webapp/channels/src/components/app_bar/app_bar_binding.tsx +++ b/webapp/channels/src/components/app_bar/app_bar_binding.tsx @@ -2,22 +2,24 @@ // See LICENSE.txt for license information. import React from 'react'; -import {useDispatch, useSelector} from 'react-redux'; -import {useIntl} from 'react-intl'; import {Tooltip} from 'react-bootstrap'; +import {useIntl} from 'react-intl'; +import {useDispatch, useSelector} from 'react-redux'; + +import type {AppBinding, AppCallResponse} from '@mattermost/types/apps'; import {AppCallResponseTypes} from 'mattermost-redux/constants/apps'; import {getCurrentChannelId} from 'mattermost-redux/selectors/entities/common'; import {getCurrentTeamId} from 'mattermost-redux/selectors/entities/teams'; -import {AppBinding, AppCallResponse} from '@mattermost/types/apps'; import {handleBindingClick, openAppsModal, postEphemeralCallResponseForContext} from 'actions/apps'; +import OverlayTrigger from 'components/overlay_trigger'; + import {createCallContext} from 'utils/apps'; import Constants from 'utils/constants'; -import {DoAppCallResult} from 'types/apps'; -import OverlayTrigger from 'components/overlay_trigger'; +import type {DoAppCallResult} from 'types/apps'; export const isAppBinding = (x: Record | undefined): x is AppBinding => { return Boolean(x?.app_id); diff --git a/webapp/channels/src/components/app_bar/app_bar_marketplace.tsx b/webapp/channels/src/components/app_bar/app_bar_marketplace.tsx index 1bbfe5cafe..bce6c31fd6 100644 --- a/webapp/channels/src/components/app_bar/app_bar_marketplace.tsx +++ b/webapp/channels/src/components/app_bar/app_bar_marketplace.tsx @@ -2,16 +2,18 @@ // See LICENSE.txt for license information. import React, {useCallback} from 'react'; -import {useDispatch} from 'react-redux'; -import {useIntl} from 'react-intl'; import {Tooltip} from 'react-bootstrap'; +import {useIntl} from 'react-intl'; +import {useDispatch} from 'react-redux'; + +import {ViewGridPlusOutlineIcon} from '@mattermost/compass-icons/components'; + import {openModal} from 'actions/views/modals'; -import MarketplaceModal from 'components/plugin_marketplace/marketplace_modal'; import OverlayTrigger from 'components/overlay_trigger'; +import MarketplaceModal from 'components/plugin_marketplace/marketplace_modal'; import {Constants, ModalIdentifiers} from 'utils/constants'; -import {ViewGridPlusOutlineIcon} from '@mattermost/compass-icons/components'; const AppBarMarketplace = () => { const {formatMessage} = useIntl(); diff --git a/webapp/channels/src/components/app_bar/app_bar_plugin_component.tsx b/webapp/channels/src/components/app_bar/app_bar_plugin_component.tsx index 5cc14588dc..d8170237d7 100644 --- a/webapp/channels/src/components/app_bar/app_bar_plugin_component.tsx +++ b/webapp/channels/src/components/app_bar/app_bar_plugin_component.tsx @@ -1,22 +1,22 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {useState, useEffect} from 'react'; -import {useSelector} from 'react-redux'; import classNames from 'classnames'; - +import React, {useState, useEffect} from 'react'; import {Tooltip} from 'react-bootstrap'; +import {useSelector} from 'react-redux'; import {getCurrentChannel, getMyCurrentChannelMembership} from 'mattermost-redux/selectors/entities/channels'; import {getActiveRhsComponent} from 'selectors/rhs'; -import {PluginComponent, AppBarComponent} from 'types/store/plugins'; -import Constants, {suitePluginIds} from 'utils/constants'; - import OverlayTrigger from 'components/overlay_trigger'; import PluginIcon from 'components/widgets/icons/plugin_icon'; +import Constants, {suitePluginIds} from 'utils/constants'; + +import type {PluginComponent, AppBarComponent} from 'types/store/plugins'; + import NewChannelWithBoardTourTip from './new_channel_with_board_tour_tip'; type PluginComponentProps = { diff --git a/webapp/channels/src/components/app_bar/new_channel_with_board_tour_tip.tsx b/webapp/channels/src/components/app_bar/new_channel_with_board_tour_tip.tsx index 77944d2fd4..253448291e 100644 --- a/webapp/channels/src/components/app_bar/new_channel_with_board_tour_tip.tsx +++ b/webapp/channels/src/components/app_bar/new_channel_with_board_tour_tip.tsx @@ -4,16 +4,15 @@ import React, {useCallback, useState} from 'react'; import {FormattedMessage} from 'react-intl'; import {useDispatch, useSelector} from 'react-redux'; +import type {Placement} from 'tippy.js'; -import {Placement} from 'tippy.js'; +import {TourTip, useMeasurePunchouts} from '@mattermost/components'; import {setNewChannelWithBoardPreference} from 'mattermost-redux/actions/boards'; import {Preferences} from 'mattermost-redux/constants'; import {showNewChannelWithBoardPulsatingDot} from 'selectors/plugins'; -import {TourTip, useMeasurePunchouts} from '@mattermost/components'; - type Props = { pulsatingDotPlacement?: Omit; pulsatingDotTranslate?: {x: number; y: number}; diff --git a/webapp/channels/src/components/apps_form/apps_form_component.test.tsx b/webapp/channels/src/components/apps_form/apps_form_component.test.tsx index 3445628dcc..95bba93b64 100644 --- a/webapp/channels/src/components/apps_form/apps_form_component.test.tsx +++ b/webapp/channels/src/components/apps_form/apps_form_component.test.tsx @@ -1,20 +1,20 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; -import {Provider} from 'react-redux'; import {shallow} from 'enzyme'; - +import React from 'react'; import {Modal} from 'react-bootstrap'; - -import {mountWithIntl} from 'tests/helpers/intl-test-helper'; -import mockStore from 'tests/test_store'; +import {Provider} from 'react-redux'; import {AppCallResponseTypes} from 'mattermost-redux/constants/apps'; import Markdown from 'components/markdown'; -import {AppsForm, Props} from './apps_form_component'; +import {mountWithIntl} from 'tests/helpers/intl-test-helper'; +import mockStore from 'tests/test_store'; + +import {AppsForm} from './apps_form_component'; +import type {Props} from './apps_form_component'; describe('AppsFormComponent', () => { const baseProps: Props = { diff --git a/webapp/channels/src/components/apps_form/apps_form_component.tsx b/webapp/channels/src/components/apps_form/apps_form_component.tsx index f682058ece..c02ce6aeb2 100644 --- a/webapp/channels/src/components/apps_form/apps_form_component.tsx +++ b/webapp/channels/src/components/apps_form/apps_form_component.tsx @@ -3,26 +3,27 @@ import React from 'react'; import {Modal, Fade} from 'react-bootstrap'; -import {FormattedMessage, injectIntl, WrappedComponentProps} from 'react-intl'; +import {FormattedMessage, injectIntl} from 'react-intl'; +import type {WrappedComponentProps} from 'react-intl'; +import type {AppCallResponse, AppField, AppForm, AppFormValues, AppSelectOption, FormResponseData, AppLookupResponse, AppFormValue} from '@mattermost/types/apps'; +import type {DialogElement} from '@mattermost/types/integrations'; + +import {AppCallResponseTypes, AppFieldTypes} from 'mattermost-redux/constants/apps'; import { checkDialogElementForError, checkIfErrorsMatchElements, } from 'mattermost-redux/utils/integration_utils'; -import {AppCallResponse, AppField, AppForm, AppFormValues, AppSelectOption, FormResponseData, AppLookupResponse, AppFormValue} from '@mattermost/types/apps'; -import {DialogElement} from '@mattermost/types/integrations'; -import {AppCallResponseTypes, AppFieldTypes} from 'mattermost-redux/constants/apps'; - -import {DoAppCallResult} from 'types/apps'; +import Markdown from 'components/markdown'; import SpinnerButton from 'components/spinner_button'; -import LoadingSpinner from 'components/widgets/loading/loading_spinner'; -import SuggestionList from 'components/suggestion/suggestion_list'; import ModalSuggestionList from 'components/suggestion/modal_suggestion_list'; - -import {localizeMessage} from 'utils/utils'; +import SuggestionList from 'components/suggestion/suggestion_list'; +import LoadingSpinner from 'components/widgets/loading/loading_spinner'; import {filterEmptyOptions} from 'utils/apps'; -import Markdown from 'components/markdown'; +import {localizeMessage} from 'utils/utils'; + +import type {DoAppCallResult} from 'types/apps'; import AppsFormField from './apps_form_field'; import AppsFormHeader from './apps_form_header'; diff --git a/webapp/channels/src/components/apps_form/apps_form_container.test.tsx b/webapp/channels/src/components/apps_form/apps_form_container.test.tsx index 1a65d400cf..6a4b0408c0 100644 --- a/webapp/channels/src/components/apps_form/apps_form_container.test.tsx +++ b/webapp/channels/src/components/apps_form/apps_form_container.test.tsx @@ -1,9 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; - import {shallow} from 'enzyme'; +import React from 'react'; import {AppCallResponseTypes} from 'mattermost-redux/constants/apps'; diff --git a/webapp/channels/src/components/apps_form/apps_form_container.tsx b/webapp/channels/src/components/apps_form/apps_form_container.tsx index 3e018f2e81..d263e02f1a 100644 --- a/webapp/channels/src/components/apps_form/apps_form_container.tsx +++ b/webapp/channels/src/components/apps_form/apps_form_container.tsx @@ -2,15 +2,17 @@ // See LICENSE.txt for license information. import React from 'react'; +import {injectIntl} from 'react-intl'; +import type {IntlShape} from 'react-intl'; -import {injectIntl, IntlShape} from 'react-intl'; +import type {AppContext, AppField, AppForm, AppFormValues, FormResponseData, AppLookupResponse} from '@mattermost/types/apps'; -import {AppContext, AppField, AppForm, AppFormValues, FormResponseData, AppLookupResponse} from '@mattermost/types/apps'; import {AppCallResponseTypes} from 'mattermost-redux/constants/apps'; -import {DoAppSubmit, DoAppFetchForm, DoAppLookup, DoAppCallResult, PostEphemeralCallResponseForContext} from 'types/apps'; import {createCallRequest, makeCallErrorResponse} from 'utils/apps'; +import type {DoAppSubmit, DoAppFetchForm, DoAppLookup, DoAppCallResult, PostEphemeralCallResponseForContext} from 'types/apps'; + import AppsForm from './apps_form_component'; type Props = { diff --git a/webapp/channels/src/components/apps_form/apps_form_field/apps_form_field.test.tsx b/webapp/channels/src/components/apps_form/apps_form_field/apps_form_field.test.tsx index 8bb10fb750..dd96579a4e 100644 --- a/webapp/channels/src/components/apps_form/apps_form_field/apps_form_field.test.tsx +++ b/webapp/channels/src/components/apps_form/apps_form_field/apps_form_field.test.tsx @@ -1,14 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; -import {AppField} from '@mattermost/types/apps'; +import type {AppField} from '@mattermost/types/apps'; import TextSetting from 'components/widgets/settings/text_setting'; -import AppsFormField, {Props} from './apps_form_field'; +import AppsFormField from './apps_form_field'; +import type {Props} from './apps_form_field'; import AppsFormSelectField from './apps_form_select_field'; describe('components/apps_form/apps_form_field/AppsFormField', () => { diff --git a/webapp/channels/src/components/apps_form/apps_form_field/apps_form_field.tsx b/webapp/channels/src/components/apps_form/apps_form_field/apps_form_field.tsx index f55c098707..8f0bfe9c61 100644 --- a/webapp/channels/src/components/apps_form/apps_form_field/apps_form_field.tsx +++ b/webapp/channels/src/components/apps_form/apps_form_field/apps_form_field.tsx @@ -3,18 +3,18 @@ import React from 'react'; -import {AppField, AppSelectOption} from '@mattermost/types/apps'; -import {Channel} from '@mattermost/types/channels'; -import {UserAutocomplete} from '@mattermost/types/autocomplete'; +import type {AppField, AppSelectOption} from '@mattermost/types/apps'; +import type {UserAutocomplete} from '@mattermost/types/autocomplete'; +import type {Channel} from '@mattermost/types/channels'; import {AppFieldTypes} from 'mattermost-redux/constants/apps'; -import TextSetting, {InputTypes} from 'components/widgets/settings/text_setting'; -import AutocompleteSelector from 'components/autocomplete_selector'; +import type AutocompleteSelector from 'components/autocomplete_selector'; +import Markdown from 'components/markdown'; import ModalSuggestionList from 'components/suggestion/modal_suggestion_list'; import BoolSetting from 'components/widgets/settings/bool_setting'; - -import Markdown from 'components/markdown'; +import TextSetting from 'components/widgets/settings/text_setting'; +import type {InputTypes} from 'components/widgets/settings/text_setting'; import AppsFormSelectField from './apps_form_select_field'; diff --git a/webapp/channels/src/components/apps_form/apps_form_field/apps_form_select_field.tsx b/webapp/channels/src/components/apps_form/apps_form_field/apps_form_select_field.tsx index 7ff560353d..111b735c98 100644 --- a/webapp/channels/src/components/apps_form/apps_form_field/apps_form_select_field.tsx +++ b/webapp/channels/src/components/apps_form/apps_form_field/apps_form_select_field.tsx @@ -5,17 +5,17 @@ import React from 'react'; import ReactSelect from 'react-select'; import AsyncSelect from 'react-select/async'; -import {AppField, AppSelectOption} from '@mattermost/types/apps'; -import {AppFieldTypes} from 'mattermost-redux/constants/apps'; +import type {AppField, AppSelectOption} from '@mattermost/types/apps'; +import type {UserAutocomplete} from '@mattermost/types/autocomplete'; +import type {Channel} from '@mattermost/types/channels'; -import {Channel} from '@mattermost/types/channels'; -import {UserAutocomplete} from '@mattermost/types/autocomplete'; +import {AppFieldTypes} from 'mattermost-redux/constants/apps'; import {displayUsername} from 'mattermost-redux/utils/user_utils'; import {imageURLForUser} from 'utils/utils'; -import {SelectUserOption} from './select_user_option'; import {SelectChannelOption} from './select_channel_option'; +import {SelectUserOption} from './select_user_option'; export type Props = { field: AppField; diff --git a/webapp/channels/src/components/apps_form/apps_form_field/index.ts b/webapp/channels/src/components/apps_form/apps_form_field/index.ts index 9f4cbf1196..96059c7dca 100644 --- a/webapp/channels/src/components/apps_form/apps_form_field/index.ts +++ b/webapp/channels/src/components/apps_form/apps_form_field/index.ts @@ -2,18 +2,19 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; -import {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; +import type {GlobalState} from '@mattermost/types/store'; import {getTeammateNameDisplaySetting} from 'mattermost-redux/selectors/entities/preferences'; - -import {GlobalState} from '@mattermost/types/store'; +import type {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; import {autocompleteChannels} from 'actions/channel_actions'; import {autocompleteUsers} from 'actions/user_actions'; -import AppsFormField, {Props} from './apps_form_field'; +import AppsFormField from './apps_form_field'; +import type {Props} from './apps_form_field'; function mapStateToProps(state: GlobalState) { return { diff --git a/webapp/channels/src/components/apps_form/apps_form_field/select_channel_option.tsx b/webapp/channels/src/components/apps_form/apps_form_field/select_channel_option.tsx index de7872d207..b7213273b0 100644 --- a/webapp/channels/src/components/apps_form/apps_form_field/select_channel_option.tsx +++ b/webapp/channels/src/components/apps_form/apps_form_field/select_channel_option.tsx @@ -2,9 +2,10 @@ // See LICENSE.txt for license information. import React from 'react'; -import {components, OptionProps} from 'react-select'; +import {components} from 'react-select'; +import type {OptionProps} from 'react-select'; -import {AppSelectOption} from '@mattermost/types/apps'; +import type {AppSelectOption} from '@mattermost/types/apps'; const {Option} = components; export const SelectChannelOption = (props: OptionProps) => { diff --git a/webapp/channels/src/components/apps_form/apps_form_field/select_user_option.tsx b/webapp/channels/src/components/apps_form/apps_form_field/select_user_option.tsx index 98530bf890..bc9e029e1c 100644 --- a/webapp/channels/src/components/apps_form/apps_form_field/select_user_option.tsx +++ b/webapp/channels/src/components/apps_form/apps_form_field/select_user_option.tsx @@ -2,20 +2,21 @@ // See LICENSE.txt for license information. import React from 'react'; +import {components} from 'react-select'; +import type {OptionProps} from 'react-select'; -import {components, OptionProps} from 'react-select'; +import type {AppSelectOption} from '@mattermost/types/apps'; +import type {UserProfile} from '@mattermost/types/users'; +import {isGuest} from 'mattermost-redux/utils/user_utils'; + +import BotTag from 'components/widgets/tag/bot_tag'; +import GuestTag from 'components/widgets/tag/guest_tag'; import Avatar from 'components/widgets/users/avatar/avatar'; import * as Utils from 'utils/utils'; -import BotTag from 'components/widgets/tag/bot_tag'; -import GuestTag from 'components/widgets/tag/guest_tag'; -import {isGuest} from 'mattermost-redux/utils/user_utils'; import {imageURLForUser} from 'utils/utils'; -import {AppSelectOption} from '@mattermost/types/apps'; -import {UserProfile} from '@mattermost/types/users'; - const getDescription = (data: UserProfile): string => { if ((data.first_name || data.last_name) && data.nickname) { return ` - ${Utils.getFullName(data)} (${data.nickname})`; diff --git a/webapp/channels/src/components/apps_form/apps_form_header.test.tsx b/webapp/channels/src/components/apps_form/apps_form_header.test.tsx index 34af4f2afd..c8a7c8f60e 100644 --- a/webapp/channels/src/components/apps_form/apps_form_header.test.tsx +++ b/webapp/channels/src/components/apps_form/apps_form_header.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import AppsFormHeader from './apps_form_header'; diff --git a/webapp/channels/src/components/apps_form/index.ts b/webapp/channels/src/components/apps_form/index.ts index 4991487e36..13ac2ca645 100644 --- a/webapp/channels/src/components/apps_form/index.ts +++ b/webapp/channels/src/components/apps_form/index.ts @@ -2,13 +2,15 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; -import {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; -import {DoAppSubmit, DoAppFetchForm, DoAppLookup, PostEphemeralCallResponseForContext} from 'types/apps'; +import type {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; import {doAppSubmit, doAppFetchForm, doAppLookup, postEphemeralCallResponseForContext} from 'actions/apps'; +import type {DoAppSubmit, DoAppFetchForm, DoAppLookup, PostEphemeralCallResponseForContext} from 'types/apps'; + import AppsFormContainer from './apps_form_container'; type Actions = { diff --git a/webapp/channels/src/components/archived_preview.tsx b/webapp/channels/src/components/archived_preview.tsx index 206a2dfade..48da51479d 100644 --- a/webapp/channels/src/components/archived_preview.tsx +++ b/webapp/channels/src/components/archived_preview.tsx @@ -5,8 +5,7 @@ import React from 'react'; import {useIntl} from 'react-intl'; import {ArchiveOutlineIcon} from '@mattermost/compass-icons/components'; - -import {FileInfo} from '@mattermost/types/files'; +import type {FileInfo} from '@mattermost/types/files'; interface Props { fileInfo: FileInfo; diff --git a/webapp/channels/src/components/at_mention/at_mention.test.tsx b/webapp/channels/src/components/at_mention/at_mention.test.tsx index 495b56dae5..6e1f99961f 100644 --- a/webapp/channels/src/components/at_mention/at_mention.test.tsx +++ b/webapp/channels/src/components/at_mention/at_mention.test.tsx @@ -1,13 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {RefObject} from 'react'; import {shallow} from 'enzyme'; - -import AtMention from 'components/at_mention/at_mention'; +import React from 'react'; +import type {RefObject} from 'react'; import {General} from 'mattermost-redux/constants'; +import AtMention from 'components/at_mention/at_mention'; + import {TestHelper} from 'utils/test_helper'; /* eslint-disable global-require */ diff --git a/webapp/channels/src/components/at_mention/at_mention.tsx b/webapp/channels/src/components/at_mention/at_mention.tsx index 3ea505c576..56361eaca4 100644 --- a/webapp/channels/src/components/at_mention/at_mention.tsx +++ b/webapp/channels/src/components/at_mention/at_mention.tsx @@ -4,20 +4,20 @@ import React from 'react'; import {Overlay} from 'react-bootstrap'; +import type {Group} from '@mattermost/types/groups'; +import type {UserProfile} from '@mattermost/types/users'; + import {Client4} from 'mattermost-redux/client'; import {displayUsername} from 'mattermost-redux/utils/user_utils'; -import {UserProfile} from '@mattermost/types/users'; -import {Group} from '@mattermost/types/groups'; - -import ProfilePopover from 'components/profile_popover'; - -import {popOverOverlayPosition} from 'utils/position_utils'; -import {isKeyPressed} from 'utils/keyboard'; -import {getUserOrGroupFromMentionName} from 'utils/post_utils'; -import Constants from 'utils/constants'; -import {getViewportSize} from 'utils/utils'; import AtMentionGroup from 'components/at_mention/at_mention_group'; +import ProfilePopover from 'components/profile_popover'; + +import Constants from 'utils/constants'; +import {isKeyPressed} from 'utils/keyboard'; +import {popOverOverlayPosition} from 'utils/position_utils'; +import {getUserOrGroupFromMentionName} from 'utils/post_utils'; +import {getViewportSize} from 'utils/utils'; type Props = { currentUserId: string; diff --git a/webapp/channels/src/components/at_mention/at_mention_group.tsx b/webapp/channels/src/components/at_mention/at_mention_group.tsx index c51ca2006a..984f646a94 100644 --- a/webapp/channels/src/components/at_mention/at_mention_group.tsx +++ b/webapp/channels/src/components/at_mention/at_mention_group.tsx @@ -4,20 +4,21 @@ import React, {useRef, useState} from 'react'; import {Overlay} from 'react-bootstrap'; +import type {Group} from '@mattermost/types/groups'; +import type {UserProfile} from '@mattermost/types/users'; + import {Client4} from 'mattermost-redux/client'; -import {UserProfile} from '@mattermost/types/users'; -import {Group} from '@mattermost/types/groups'; import ProfilePopover from 'components/profile_popover'; import UserGroupPopover from 'components/user_group_popover'; +import {MAX_LIST_HEIGHT, getListHeight, VIEWPORT_SCALE_FACTOR} from 'components/user_group_popover/group_member_list/group_member_list'; -import Constants, {A11yCustomEventTypes, A11yFocusEventDetail} from 'utils/constants'; +import Constants, {A11yCustomEventTypes} from 'utils/constants'; +import type {A11yFocusEventDetail} from 'utils/constants'; import {isKeyPressed} from 'utils/keyboard'; import {popOverOverlayPosition} from 'utils/position_utils'; import {getViewportSize} from 'utils/utils'; -import {MAX_LIST_HEIGHT, getListHeight, VIEWPORT_SCALE_FACTOR} from 'components/user_group_popover/group_member_list/group_member_list'; - const HEADER_HEIGHT_ESTIMATE = 130; type Props = { diff --git a/webapp/channels/src/components/at_mention/index.tsx b/webapp/channels/src/components/at_mention/index.tsx index 58afe4a05c..ad8bb5808d 100644 --- a/webapp/channels/src/components/at_mention/index.tsx +++ b/webapp/channels/src/components/at_mention/index.tsx @@ -3,11 +3,11 @@ import {connect} from 'react-redux'; +import {getAllGroupsForReferenceByName} from 'mattermost-redux/selectors/entities/groups'; import {getTeammateNameDisplaySetting} from 'mattermost-redux/selectors/entities/preferences'; import {getCurrentUserId, getUsersByUsername} from 'mattermost-redux/selectors/entities/users'; -import {getAllGroupsForReferenceByName} from 'mattermost-redux/selectors/entities/groups'; -import {GlobalState} from 'types/store'; +import type {GlobalState} from 'types/store'; import AtMention from './at_mention'; diff --git a/webapp/channels/src/components/at_plan_mention/at_plan_mention.test.tsx b/webapp/channels/src/components/at_plan_mention/at_plan_mention.test.tsx index 3aeed3d385..271a4d4dca 100644 --- a/webapp/channels/src/components/at_plan_mention/at_plan_mention.test.tsx +++ b/webapp/channels/src/components/at_plan_mention/at_plan_mention.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import * as useOpenPricingModal from 'components/common/hooks/useOpenPricingModal'; diff --git a/webapp/channels/src/components/at_sum_members_mention/index.tsx b/webapp/channels/src/components/at_sum_members_mention/index.tsx index 80e43525fc..75b8b80586 100644 --- a/webapp/channels/src/components/at_sum_members_mention/index.tsx +++ b/webapp/channels/src/components/at_sum_members_mention/index.tsx @@ -5,6 +5,7 @@ import React from 'react'; import {useDispatch} from 'react-redux'; import {openModal} from 'actions/views/modals'; + import {ModalIdentifiers} from 'utils/constants'; import NotificationFromMembersModal from './notification_from_members_modal'; diff --git a/webapp/channels/src/components/at_sum_members_mention/notification_from_members_modal.tsx b/webapp/channels/src/components/at_sum_members_mention/notification_from_members_modal.tsx index d93491e8f8..ae3e069e4c 100644 --- a/webapp/channels/src/components/at_sum_members_mention/notification_from_members_modal.tsx +++ b/webapp/channels/src/components/at_sum_members_mention/notification_from_members_modal.tsx @@ -2,34 +2,33 @@ // See LICENSE.txt for license information. import React, {useCallback, useEffect} from 'react'; -import {useDispatch, useSelector} from 'react-redux'; import {useIntl} from 'react-intl'; +import {useDispatch, useSelector} from 'react-redux'; import {useHistory} from 'react-router-dom'; - import styled from 'styled-components'; -import {getCurrentChannel} from 'mattermost-redux/selectors/entities/channels'; +import {GenericModal} from '@mattermost/components'; +import type {ChannelMembership} from '@mattermost/types/channels'; +import type {UserProfile} from '@mattermost/types/users'; -import {getUsers, getUserStatuses} from 'mattermost-redux/selectors/entities/users'; -import {displayUsername} from 'mattermost-redux/utils/user_utils'; +import {getMissingProfilesByIds} from 'mattermost-redux/actions/users'; +import {getCurrentChannel} from 'mattermost-redux/selectors/entities/channels'; import {getTeammateNameDisplaySetting} from 'mattermost-redux/selectors/entities/preferences'; import {getCurrentRelativeTeamUrl} from 'mattermost-redux/selectors/entities/teams'; +import {getUsers, getUserStatuses} from 'mattermost-redux/selectors/entities/users'; +import {displayUsername} from 'mattermost-redux/utils/user_utils'; + import {openDirectChannelToUserId} from 'actions/channel_actions'; -import {isModalOpen} from 'selectors/views/modals'; import {closeModal} from 'actions/views/modals'; -import {getMissingProfilesByIds} from 'mattermost-redux/actions/users'; - -import {GlobalState} from 'types/store'; - -import {mapFeatureIdToTranslation} from 'utils/notify_admin_utils'; -import {ModalIdentifiers} from 'utils/constants'; +import {isModalOpen} from 'selectors/views/modals'; import {ListItemType} from 'components/channel_members_rhs/channel_members_rhs'; -import {GenericModal} from '@mattermost/components'; +import MemberList from 'components/channel_members_rhs/member_list'; -import MemberList from '../channel_members_rhs/member_list'; -import {ChannelMembership} from '@mattermost/types/channels'; -import {UserProfile} from '@mattermost/types/users'; +import {ModalIdentifiers} from 'utils/constants'; +import {mapFeatureIdToTranslation} from 'utils/notify_admin_utils'; + +import type {GlobalState} from 'types/store'; import './notification_from_members_modal.scss'; diff --git a/webapp/channels/src/components/audio_video_preview/audio_video_preview.tsx b/webapp/channels/src/components/audio_video_preview/audio_video_preview.tsx index 3200a0c535..3997bb691c 100644 --- a/webapp/channels/src/components/audio_video_preview/audio_video_preview.tsx +++ b/webapp/channels/src/components/audio_video_preview/audio_video_preview.tsx @@ -3,7 +3,7 @@ import React from 'react'; -import {FileInfo} from '@mattermost/types/files'; +import type {FileInfo} from '@mattermost/types/files'; import FileInfoPreview from 'components/file_info_preview'; diff --git a/webapp/channels/src/components/audio_video_preview/index.ts b/webapp/channels/src/components/audio_video_preview/index.ts index 3d0190af7c..473c9c8743 100644 --- a/webapp/channels/src/components/audio_video_preview/index.ts +++ b/webapp/channels/src/components/audio_video_preview/index.ts @@ -5,7 +5,7 @@ import {connect} from 'react-redux'; import {getIsMobileView} from 'selectors/views/browser'; -import {GlobalState} from 'types/store'; +import type {GlobalState} from 'types/store'; import AudioVideoPreview from './audio_video_preview'; diff --git a/webapp/channels/src/components/audit_table/audit_row/audit_row.test.tsx b/webapp/channels/src/components/audit_table/audit_row/audit_row.test.tsx index ca078bdfe8..9632487964 100644 --- a/webapp/channels/src/components/audit_table/audit_row/audit_row.test.tsx +++ b/webapp/channels/src/components/audit_table/audit_row/audit_row.test.tsx @@ -2,15 +2,15 @@ // See LICENSE.txt for license information. import React from 'react'; - import {Provider} from 'react-redux'; -import {mountWithIntl} from 'tests/helpers/intl-test-helper'; +import type {Audit} from '@mattermost/types/audits'; -import {Audit} from '@mattermost/types/audits'; +import {mountWithIntl} from 'tests/helpers/intl-test-helper'; import mockStore from 'tests/test_store'; -import AuditRow, {Props} from './audit_row'; +import AuditRow from './audit_row'; +import type {Props} from './audit_row'; describe('components/audit_table/audit_row/AuditRow', () => { const audit: Audit = { diff --git a/webapp/channels/src/components/audit_table/audit_row/audit_row.tsx b/webapp/channels/src/components/audit_table/audit_row/audit_row.tsx index 6b5450a827..d3c49bfccf 100644 --- a/webapp/channels/src/components/audit_table/audit_row/audit_row.tsx +++ b/webapp/channels/src/components/audit_table/audit_row/audit_row.tsx @@ -3,15 +3,16 @@ import React from 'react'; import {FormattedDate, FormattedTime, useIntl} from 'react-intl'; - import {useSelector} from 'react-redux'; -import {Audit} from '@mattermost/types/audits'; +import type {Audit} from '@mattermost/types/audits'; +import type {GlobalState} from '@mattermost/types/store'; + +import {getUser} from 'mattermost-redux/selectors/entities/users'; + +import {toTitleCase} from 'utils/utils'; import holders from '../holders'; -import {toTitleCase} from 'utils/utils'; -import {getUser} from 'mattermost-redux/selectors/entities/users'; -import {GlobalState} from '@mattermost/types/store'; export type Props = { audit: Audit; diff --git a/webapp/channels/src/components/audit_table/audit_table.test.tsx b/webapp/channels/src/components/audit_table/audit_table.test.tsx index 39edebbdec..0f6ba16b59 100644 --- a/webapp/channels/src/components/audit_table/audit_table.test.tsx +++ b/webapp/channels/src/components/audit_table/audit_table.test.tsx @@ -3,8 +3,9 @@ import React from 'react'; -import {shallowWithIntl} from 'tests/helpers/intl-test-helper'; import AuditTable from 'components/audit_table/audit_table'; + +import {shallowWithIntl} from 'tests/helpers/intl-test-helper'; import {TestHelper} from 'utils/test_helper'; describe('components/audit_table/AuditTable', () => { diff --git a/webapp/channels/src/components/audit_table/audit_table.tsx b/webapp/channels/src/components/audit_table/audit_table.tsx index d9e26b7e7d..fa44a5f624 100644 --- a/webapp/channels/src/components/audit_table/audit_table.tsx +++ b/webapp/channels/src/components/audit_table/audit_table.tsx @@ -2,11 +2,13 @@ // See LICENSE.txt for license information. import React from 'react'; -import {FormattedMessage, injectIntl, IntlShape} from 'react-intl'; +import {FormattedMessage, injectIntl} from 'react-intl'; +import type {IntlShape} from 'react-intl'; -import {UserProfile} from '@mattermost/types/users'; -import {ActionFunc} from 'mattermost-redux/types/actions'; -import {Audit} from '@mattermost/types/audits'; +import type {Audit} from '@mattermost/types/audits'; +import type {UserProfile} from '@mattermost/types/users'; + +import type {ActionFunc} from 'mattermost-redux/types/actions'; import FormatAudit from './format_audit'; diff --git a/webapp/channels/src/components/audit_table/channel_row/channel_create_direct_row.tsx b/webapp/channels/src/components/audit_table/channel_row/channel_create_direct_row.tsx index b778794518..d140b3e562 100644 --- a/webapp/channels/src/components/audit_table/channel_row/channel_create_direct_row.tsx +++ b/webapp/channels/src/components/audit_table/channel_row/channel_create_direct_row.tsx @@ -2,16 +2,16 @@ // See LICENSE.txt for license information. import React from 'react'; - import {useIntl} from 'react-intl'; - import {useSelector} from 'react-redux'; -import {Audit} from '@mattermost/types/audits'; -import {Channel} from '@mattermost/types/channels'; +import type {Audit} from '@mattermost/types/audits'; +import type {Channel} from '@mattermost/types/channels'; + import {getDirectTeammate} from 'mattermost-redux/selectors/entities/channels'; -import {GlobalState} from 'types/store'; +import type {GlobalState} from 'types/store'; + import AuditRow from '../audit_row/audit_row'; import holders from '../holders'; diff --git a/webapp/channels/src/components/audit_table/channel_row/channel_default_row.tsx b/webapp/channels/src/components/audit_table/channel_row/channel_default_row.tsx index 65c79cb735..5f6360baf6 100644 --- a/webapp/channels/src/components/audit_table/channel_row/channel_default_row.tsx +++ b/webapp/channels/src/components/audit_table/channel_row/channel_default_row.tsx @@ -2,13 +2,12 @@ // See LICENSE.txt for license information. import React from 'react'; - import {useIntl} from 'react-intl'; - import {useSelector} from 'react-redux'; -import {Audit} from '@mattermost/types/audits'; -import {GlobalState} from '@mattermost/types/store'; +import type {Audit} from '@mattermost/types/audits'; +import type {GlobalState} from '@mattermost/types/store'; + import {getUser} from 'mattermost-redux/selectors/entities/users'; import AuditRow from '../audit_row/audit_row'; diff --git a/webapp/channels/src/components/audit_table/channel_row/channel_row.tsx b/webapp/channels/src/components/audit_table/channel_row/channel_row.tsx index dc12686f3f..904234ea22 100644 --- a/webapp/channels/src/components/audit_table/channel_row/channel_row.tsx +++ b/webapp/channels/src/components/audit_table/channel_row/channel_row.tsx @@ -3,18 +3,18 @@ import React from 'react'; import {useIntl} from 'react-intl'; - import {useSelector} from 'react-redux'; -import {Audit} from '@mattermost/types/audits'; +import type {Audit} from '@mattermost/types/audits'; +import type {GlobalState} from '@mattermost/types/store'; -import holders from '../holders'; -import AuditRow from '../audit_row/audit_row'; import {getChannelByName} from 'mattermost-redux/selectors/entities/channels'; -import {GlobalState} from '@mattermost/types/store'; -import ChannelDefaultRow from './channel_default_row'; import ChannelCreateDirectRow from './channel_create_direct_row'; +import ChannelDefaultRow from './channel_default_row'; + +import AuditRow from '../audit_row/audit_row'; +import holders from '../holders'; type Props = { audit: Audit; diff --git a/webapp/channels/src/components/audit_table/format_audit.test.tsx b/webapp/channels/src/components/audit_table/format_audit.test.tsx index 3ea175c94c..abfaaedf93 100644 --- a/webapp/channels/src/components/audit_table/format_audit.test.tsx +++ b/webapp/channels/src/components/audit_table/format_audit.test.tsx @@ -2,15 +2,15 @@ // See LICENSE.txt for license information. import React from 'react'; - import {Provider} from 'react-redux'; -import {mountWithIntl} from 'tests/helpers/intl-test-helper'; +import type {Audit} from '@mattermost/types/audits'; -import {Audit} from '@mattermost/types/audits'; +import {mountWithIntl} from 'tests/helpers/intl-test-helper'; import mockStore from 'tests/test_store'; -import FormatAudit, {Props} from './format_audit'; +import FormatAudit from './format_audit'; +import type {Props} from './format_audit'; describe('components/audit_table/audit_row/AuditRow', () => { const baseProps = { diff --git a/webapp/channels/src/components/audit_table/format_audit.tsx b/webapp/channels/src/components/audit_table/format_audit.tsx index 810c262aa3..819fda0437 100644 --- a/webapp/channels/src/components/audit_table/format_audit.tsx +++ b/webapp/channels/src/components/audit_table/format_audit.tsx @@ -2,17 +2,16 @@ // See LICENSE.txt for license information. import React from 'react'; - import {useIntl} from 'react-intl'; -import {Audit} from '@mattermost/types/audits'; +import type {Audit} from '@mattermost/types/audits'; import {toTitleCase} from 'utils/utils'; -import ChannelRow from './channel_row/channel_row'; -import UserRow from './user_row/user_row'; -import holders from './holders'; import AuditRow from './audit_row/audit_row'; +import ChannelRow from './channel_row/channel_row'; +import holders from './holders'; +import UserRow from './user_row/user_row'; export type Props = { audit: Audit; diff --git a/webapp/channels/src/components/audit_table/index.ts b/webapp/channels/src/components/audit_table/index.ts index 86d8f4083a..fe749d4c47 100644 --- a/webapp/channels/src/components/audit_table/index.ts +++ b/webapp/channels/src/components/audit_table/index.ts @@ -2,13 +2,14 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch} from 'redux'; import {getMissingProfilesByIds} from 'mattermost-redux/actions/users'; import {getCurrentUser} from 'mattermost-redux/selectors/entities/users'; -import {GenericAction} from 'mattermost-redux/types/actions'; +import type {GenericAction} from 'mattermost-redux/types/actions'; -import {GlobalState} from 'types/store'; +import type {GlobalState} from 'types/store'; import AuditTable from './audit_table'; diff --git a/webapp/channels/src/components/audit_table/user_row/user_row.tsx b/webapp/channels/src/components/audit_table/user_row/user_row.tsx index e234976950..4b1b335efd 100644 --- a/webapp/channels/src/components/audit_table/user_row/user_row.tsx +++ b/webapp/channels/src/components/audit_table/user_row/user_row.tsx @@ -4,13 +4,13 @@ import React from 'react'; import {useIntl} from 'react-intl'; -import {Audit} from '@mattermost/types/audits'; - -import holders from '../holders'; -import AuditRow from '../audit_row/audit_row'; +import type {Audit} from '@mattermost/types/audits'; import UserUpdateActiveSessionRow from './user_update_active_session_row'; +import AuditRow from '../audit_row/audit_row'; +import holders from '../holders'; + type Props = { audit: Audit; actionURL: string; diff --git a/webapp/channels/src/components/audit_table/user_row/user_update_active_session_row.tsx b/webapp/channels/src/components/audit_table/user_row/user_update_active_session_row.tsx index 80cae8f45b..71ff233b2a 100644 --- a/webapp/channels/src/components/audit_table/user_row/user_update_active_session_row.tsx +++ b/webapp/channels/src/components/audit_table/user_row/user_update_active_session_row.tsx @@ -2,13 +2,12 @@ // See LICENSE.txt for license information. import React from 'react'; - import {useIntl} from 'react-intl'; - import {useSelector} from 'react-redux'; -import {Audit} from '@mattermost/types/audits'; -import {GlobalState} from '@mattermost/types/store'; +import type {Audit} from '@mattermost/types/audits'; +import type {GlobalState} from '@mattermost/types/store'; + import {getCurrentUser, getUser} from 'mattermost-redux/selectors/entities/users'; import {isSystemAdmin} from 'mattermost-redux/utils/user_utils'; diff --git a/webapp/channels/src/components/authorize/authorize.test.tsx b/webapp/channels/src/components/authorize/authorize.test.tsx index 24503d8332..422a8e57e3 100644 --- a/webapp/channels/src/components/authorize/authorize.test.tsx +++ b/webapp/channels/src/components/authorize/authorize.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import Authorize from './authorize'; diff --git a/webapp/channels/src/components/authorize/authorize.tsx b/webapp/channels/src/components/authorize/authorize.tsx index 0f36351340..272f2049fd 100644 --- a/webapp/channels/src/components/authorize/authorize.tsx +++ b/webapp/channels/src/components/authorize/authorize.tsx @@ -1,15 +1,17 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {ReactNode} from 'react'; +import React from 'react'; +import type {ReactNode} from 'react'; import {FormattedMessage} from 'react-intl'; -import {OAuthApp} from '@mattermost/types/integrations'; +import type {OAuthApp} from '@mattermost/types/integrations'; + +import FormError from 'components/form_error'; +import FormattedMarkdownMessage from 'components/formatted_markdown_message'; import icon50 from 'images/icon50x50.png'; -import FormError from 'components/form_error'; import {getHistory} from 'utils/browser_history'; -import FormattedMarkdownMessage from 'components/formatted_markdown_message'; export type Params = { responseType: string | null; diff --git a/webapp/channels/src/components/authorize/index.ts b/webapp/channels/src/components/authorize/index.ts index f9c7765bf5..a76f2dd572 100644 --- a/webapp/channels/src/components/authorize/index.ts +++ b/webapp/channels/src/components/authorize/index.ts @@ -2,14 +2,17 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {bindActionCreators, Dispatch, ActionCreatorsMapObject} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch, ActionCreatorsMapObject} from 'redux'; -import {GenericAction, ActionFunc} from 'mattermost-redux/types/actions'; -import {OAuthApp} from '@mattermost/types/integrations'; +import type {OAuthApp} from '@mattermost/types/integrations'; + +import type {GenericAction, ActionFunc} from 'mattermost-redux/types/actions'; import {allowOAuth2, getOAuthAppInfo} from 'actions/admin_actions.jsx'; -import Authorize, {Params} from './authorize'; +import Authorize from './authorize'; +import type {Params} from './authorize'; type Actions = { getOAuthAppInfo: (clientId: string | null) => Promise<{data: OAuthApp; error?: Error}>; diff --git a/webapp/channels/src/components/autocomplete_selector.test.jsx b/webapp/channels/src/components/autocomplete_selector.test.jsx index 9f119921c8..564a02c930 100644 --- a/webapp/channels/src/components/autocomplete_selector.test.jsx +++ b/webapp/channels/src/components/autocomplete_selector.test.jsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import AutocompleteSelector from './autocomplete_selector'; diff --git a/webapp/channels/src/components/autosize_textarea.test.tsx b/webapp/channels/src/components/autosize_textarea.test.tsx index 94abb66c44..8976ee40c7 100644 --- a/webapp/channels/src/components/autosize_textarea.test.tsx +++ b/webapp/channels/src/components/autosize_textarea.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import {AutosizeTextarea} from 'components/autosize_textarea'; diff --git a/webapp/channels/src/components/autosize_textarea.tsx b/webapp/channels/src/components/autosize_textarea.tsx index d9df0e5ef3..36d89c97e8 100644 --- a/webapp/channels/src/components/autosize_textarea.tsx +++ b/webapp/channels/src/components/autosize_textarea.tsx @@ -1,7 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {ChangeEvent, FormEvent, CSSProperties} from 'react'; +import React from 'react'; +import type {ChangeEvent, FormEvent, CSSProperties} from 'react'; type Props = { id?: string; diff --git a/webapp/channels/src/components/backstage/backstage_controller.tsx b/webapp/channels/src/components/backstage/backstage_controller.tsx index c55bee0ff0..cc270bcefb 100644 --- a/webapp/channels/src/components/backstage/backstage_controller.tsx +++ b/webapp/channels/src/components/backstage/backstage_controller.tsx @@ -1,35 +1,36 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {ComponentType, useRef} from 'react'; -import {match, Route, Switch} from 'react-router-dom'; +import React, {useRef} from 'react'; +import type {ComponentType} from 'react'; +import {Route, Switch} from 'react-router-dom'; +import type {match} from 'react-router-dom'; import {createGlobalStyle} from 'styled-components'; -import {UserProfile} from '@mattermost/types/users'; +import type {Team} from '@mattermost/types/teams'; +import type {UserProfile} from '@mattermost/types/users'; -import {Team} from '@mattermost/types/teams'; - -import Bots from 'components/integrations/bots'; -import AddBot from 'components/integrations/bots/add_bot'; -import Integrations from 'components/integrations'; import Emoji from 'components/emoji'; import AddEmoji from 'components/emoji/add_emoji'; -import InstalledIncomingWebhooks from 'components/integrations/installed_incoming_webhooks'; +import Integrations from 'components/integrations'; import AddIncomingWehook from 'components/integrations/add_incoming_webhook'; -import EditIncomingWebhook from 'components/integrations/edit_incoming_webhook'; -import InstalledOutgoingWebhooks from 'components/integrations/installed_outgoing_webhooks'; -import AddOutgoingWebhook from 'components/integrations/add_outgoing_webhook'; -import EditOutgoingWebhook from 'components/integrations/edit_outgoing_webhook'; -import InstalledOauthApps from 'components/integrations/installed_oauth_apps'; import AddOauthApp from 'components/integrations/add_oauth_app'; -import EditOauthApp from 'components/integrations/edit_oauth_app'; +import AddOutgoingWebhook from 'components/integrations/add_outgoing_webhook'; +import Bots from 'components/integrations/bots'; +import AddBot from 'components/integrations/bots/add_bot'; import CommandsContainer from 'components/integrations/commands_container'; import ConfirmIntegration from 'components/integrations/confirm_integration'; +import EditIncomingWebhook from 'components/integrations/edit_incoming_webhook'; +import EditOauthApp from 'components/integrations/edit_oauth_app'; +import EditOutgoingWebhook from 'components/integrations/edit_outgoing_webhook'; +import InstalledIncomingWebhooks from 'components/integrations/installed_incoming_webhooks'; +import InstalledOauthApps from 'components/integrations/installed_oauth_apps'; +import InstalledOutgoingWebhooks from 'components/integrations/installed_outgoing_webhooks'; import Pluggable from 'plugins/pluggable'; -import BackstageSidebar from './components/backstage_sidebar'; import BackstageNavbar from './components/backstage_navbar'; +import BackstageSidebar from './components/backstage_sidebar'; type ExtraProps = Pick & {scrollToTop: () => void} diff --git a/webapp/channels/src/components/backstage/components/backstage_category.tsx b/webapp/channels/src/components/backstage/components/backstage_category.tsx index b508819d5b..5be66e62fb 100644 --- a/webapp/channels/src/components/backstage/components/backstage_category.tsx +++ b/webapp/channels/src/components/backstage/components/backstage_category.tsx @@ -1,9 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {ReactNode} from 'react'; -import {Route, NavLink} from 'react-router-dom'; import classNames from 'classnames'; +import React from 'react'; +import type {ReactNode} from 'react'; +import {Route, NavLink} from 'react-router-dom'; type Props = { name: string; diff --git a/webapp/channels/src/components/backstage/components/backstage_header.tsx b/webapp/channels/src/components/backstage/components/backstage_header.tsx index eed723e8e3..0a10ee5013 100644 --- a/webapp/channels/src/components/backstage/components/backstage_header.tsx +++ b/webapp/channels/src/components/backstage/components/backstage_header.tsx @@ -1,7 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {ReactNode} from 'react'; +import React from 'react'; +import type {ReactNode} from 'react'; import LocalizedIcon from 'components/localized_icon'; diff --git a/webapp/channels/src/components/backstage/components/backstage_list.tsx b/webapp/channels/src/components/backstage/components/backstage_list.tsx index 4dcfb8ce71..b6280f7670 100644 --- a/webapp/channels/src/components/backstage/components/backstage_list.tsx +++ b/webapp/channels/src/components/backstage/components/backstage_list.tsx @@ -1,14 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {ChangeEvent, ReactNode, useState} from 'react'; +import React, {useState} from 'react'; +import type {ChangeEvent, ReactNode} from 'react'; import {Link} from 'react-router-dom'; -import {localizeMessage} from 'utils/utils'; - import LoadingScreen from 'components/loading_screen'; import SearchIcon from 'components/widgets/icons/fa_search_icon'; +import {localizeMessage} from 'utils/utils'; + type Props = { children?: ReactNode | ((filter: string) => void); header: ReactNode; diff --git a/webapp/channels/src/components/backstage/components/backstage_navbar.tsx b/webapp/channels/src/components/backstage/components/backstage_navbar.tsx index e939402f08..e41d082e2b 100644 --- a/webapp/channels/src/components/backstage/components/backstage_navbar.tsx +++ b/webapp/channels/src/components/backstage/components/backstage_navbar.tsx @@ -5,7 +5,7 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; import {Link} from 'react-router-dom'; -import {Team} from '@mattermost/types/teams'; +import type {Team} from '@mattermost/types/teams'; import BackIcon from 'components/widgets/icons/fa_back_icon'; diff --git a/webapp/channels/src/components/backstage/components/backstage_section.tsx b/webapp/channels/src/components/backstage/components/backstage_section.tsx index 6bfce5bdce..6dfcea3917 100644 --- a/webapp/channels/src/components/backstage/components/backstage_section.tsx +++ b/webapp/channels/src/components/backstage/components/backstage_section.tsx @@ -1,7 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {ReactNode} from 'react'; +import React from 'react'; +import type {ReactNode} from 'react'; import {NavLink} from 'react-router-dom'; type Props = { diff --git a/webapp/channels/src/components/backstage/components/backstage_sidebar.test.tsx b/webapp/channels/src/components/backstage/components/backstage_sidebar.test.tsx index e60ea4a191..55ba2ab014 100644 --- a/webapp/channels/src/components/backstage/components/backstage_sidebar.test.tsx +++ b/webapp/channels/src/components/backstage/components/backstage_sidebar.test.tsx @@ -2,12 +2,13 @@ // See LICENSE.txt for license information. import {shallow} from 'enzyme'; -import React, {ComponentProps} from 'react'; +import React from 'react'; +import type {ComponentProps} from 'react'; import {TestHelper} from 'utils/test_helper'; -import BackstageSidebar from './backstage_sidebar'; import BackstageCategory from './backstage_category'; +import BackstageSidebar from './backstage_sidebar'; describe('components/backstage/components/BackstageSidebar', () => { const defaultProps: ComponentProps = { diff --git a/webapp/channels/src/components/backstage/components/backstage_sidebar.tsx b/webapp/channels/src/components/backstage/components/backstage_sidebar.tsx index edcdc266c7..7f290af5f7 100644 --- a/webapp/channels/src/components/backstage/components/backstage_sidebar.tsx +++ b/webapp/channels/src/components/backstage/components/backstage_sidebar.tsx @@ -4,10 +4,10 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {Permissions} from 'mattermost-redux/constants'; +import type {Team} from '@mattermost/types/teams'; +import type {UserProfile} from '@mattermost/types/users'; -import {Team} from '@mattermost/types/teams'; -import {UserProfile} from '@mattermost/types/users'; +import {Permissions} from 'mattermost-redux/constants'; import SystemPermissionGate from 'components/permissions_gates/system_permission_gate'; import TeamPermissionGate from 'components/permissions_gates/team_permission_gate'; diff --git a/webapp/channels/src/components/backstage/index.ts b/webapp/channels/src/components/backstage/index.ts index 1c54a3e9fd..68600146dd 100644 --- a/webapp/channels/src/components/backstage/index.ts +++ b/webapp/channels/src/components/backstage/index.ts @@ -4,13 +4,13 @@ import {connect} from 'react-redux'; import {withRouter} from 'react-router-dom'; -import {getCurrentUser} from 'mattermost-redux/selectors/entities/users'; -import {getMyTeams, getCurrentTeam} from 'mattermost-redux/selectors/entities/teams'; +import {Permissions} from 'mattermost-redux/constants'; import {getConfig} from 'mattermost-redux/selectors/entities/general'; import {haveITeamPermission, haveISystemPermission} from 'mattermost-redux/selectors/entities/roles'; -import {Permissions} from 'mattermost-redux/constants'; +import {getMyTeams, getCurrentTeam} from 'mattermost-redux/selectors/entities/teams'; +import {getCurrentUser} from 'mattermost-redux/selectors/entities/users'; -import {GlobalState} from 'types/store'; +import type {GlobalState} from 'types/store'; import BackstageController from './backstage_controller'; diff --git a/webapp/channels/src/components/browse_channels/browse_channels.test.tsx b/webapp/channels/src/components/browse_channels/browse_channels.test.tsx index 3b99469274..136e801a39 100644 --- a/webapp/channels/src/components/browse_channels/browse_channels.test.tsx +++ b/webapp/channels/src/components/browse_channels/browse_channels.test.tsx @@ -1,13 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; -import {ActionResult} from 'mattermost-redux/types/actions'; -import {Channel} from '@mattermost/types/channels'; +import type {Channel} from '@mattermost/types/channels'; -import BrowseChannels, {Filter, Props} from 'components/browse_channels/browse_channels'; +import type {ActionResult} from 'mattermost-redux/types/actions'; + +import type {Props} from 'components/browse_channels/browse_channels'; +import BrowseChannels, {Filter} from 'components/browse_channels/browse_channels'; import SearchableChannelList from 'components/searchable_channel_list'; import {getHistory} from 'utils/browser_history'; diff --git a/webapp/channels/src/components/browse_channels/browse_channels.tsx b/webapp/channels/src/components/browse_channels/browse_channels.tsx index ee3e30dbd2..f26a42e198 100644 --- a/webapp/channels/src/components/browse_channels/browse_channels.tsx +++ b/webapp/channels/src/components/browse_channels/browse_channels.tsx @@ -1,30 +1,30 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import classNames from 'classnames'; import React from 'react'; import {FormattedMessage} from 'react-intl'; -import Permissions from 'mattermost-redux/constants/permissions'; -import {ActionResult} from 'mattermost-redux/types/actions'; -import {RelationOneToOne} from '@mattermost/types/utilities'; -import {Channel, ChannelMembership, ChannelSearchOpts} from '@mattermost/types/channels'; import {GenericModal} from '@mattermost/components'; +import type {Channel, ChannelMembership, ChannelSearchOpts} from '@mattermost/types/channels'; +import type {RelationOneToOne} from '@mattermost/types/utilities'; -import classNames from 'classnames'; +import Permissions from 'mattermost-redux/constants/permissions'; +import type {ActionResult} from 'mattermost-redux/types/actions'; -import NewChannelModal from 'components/new_channel_modal/new_channel_modal'; -import SearchableChannelList from 'components/searchable_channel_list'; -import TeamPermissionGate from 'components/permissions_gates/team_permission_gate'; import LoadingScreen from 'components/loading_screen'; - -import {ModalData} from 'types/actions'; -import {RhsState} from 'types/store/rhs'; +import NewChannelModal from 'components/new_channel_modal/new_channel_modal'; +import TeamPermissionGate from 'components/permissions_gates/team_permission_gate'; +import SearchableChannelList from 'components/searchable_channel_list'; import {getHistory} from 'utils/browser_history'; import Constants, {ModalIdentifiers, RHSStates, StoragePrefixes} from 'utils/constants'; import {getRelativeChannelURL} from 'utils/url'; import {localizeMessage} from 'utils/utils'; +import type {ModalData} from 'types/actions'; +import type {RhsState} from 'types/store/rhs'; + import './browse_channels.scss'; const CHANNELS_CHUNK_SIZE = 50; diff --git a/webapp/channels/src/components/browse_channels/index.ts b/webapp/channels/src/components/browse_channels/index.ts index ae8be55ee2..45111c2b38 100644 --- a/webapp/channels/src/components/browse_channels/index.ts +++ b/webapp/channels/src/components/browse_channels/index.ts @@ -2,30 +2,32 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; -import {createSelector} from 'mattermost-redux/selectors/create_selector'; +import type {Channel, ChannelSearchOpts} from '@mattermost/types/channels'; + +import {getChannels, getArchivedChannels, joinChannel, getChannelsMemberCount, searchAllChannels} from 'mattermost-redux/actions/channels'; import {RequestStatus} from 'mattermost-redux/constants'; -import {Channel, ChannelSearchOpts} from '@mattermost/types/channels'; +import {createSelector} from 'mattermost-redux/selectors/create_selector'; +import {getChannelsInCurrentTeam, getMyChannelMemberships, getChannelsMemberCount as getChannelsMemberCountSelector} from 'mattermost-redux/selectors/entities/channels'; import {getConfig} from 'mattermost-redux/selectors/entities/general'; -import {Action, ActionResult} from 'mattermost-redux/types/actions'; import {getCurrentTeam} from 'mattermost-redux/selectors/entities/teams'; import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users'; -import {getChannels, getArchivedChannels, joinChannel, getChannelsMemberCount, searchAllChannels} from 'mattermost-redux/actions/channels'; -import {getChannelsInCurrentTeam, getMyChannelMemberships, getChannelsMemberCount as getChannelsMemberCountSelector} from 'mattermost-redux/selectors/entities/channels'; +import type {Action, ActionResult} from 'mattermost-redux/types/actions'; +import {setGlobalItem} from 'actions/storage'; import {openModal, closeModal} from 'actions/views/modals'; import {closeRightHandSide} from 'actions/views/rhs'; - import {getIsRhsOpen, getRhsState} from 'selectors/rhs'; +import {makeGetGlobalItem} from 'selectors/storage'; -import {ModalData} from 'types/actions'; -import {GlobalState} from 'types/store'; +import Constants, {StoragePrefixes} from 'utils/constants'; + +import type {ModalData} from 'types/actions'; +import type {GlobalState} from 'types/store'; import BrowseChannels from './browse_channels'; -import {makeGetGlobalItem} from 'selectors/storage'; -import Constants, {StoragePrefixes} from 'utils/constants'; -import {setGlobalItem} from 'actions/storage'; const getChannelsWithoutArchived = createSelector( 'getChannelsWithoutArchived', diff --git a/webapp/channels/src/components/card/card.test.tsx b/webapp/channels/src/components/card/card.test.tsx index b1c7c88a91..c175ba35d0 100644 --- a/webapp/channels/src/components/card/card.test.tsx +++ b/webapp/channels/src/components/card/card.test.tsx @@ -1,9 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {mount, shallow} from 'enzyme'; import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {mount, shallow} from 'enzyme'; import Card from './card'; import TitleAndButtonCardHeader from './title_and_button_card_header/title_and_button_card_header'; diff --git a/webapp/channels/src/components/card/card.tsx b/webapp/channels/src/components/card/card.tsx index 6aa2d38f17..1260c60900 100644 --- a/webapp/channels/src/components/card/card.tsx +++ b/webapp/channels/src/components/card/card.tsx @@ -1,11 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {Children, isValidElement, cloneElement} from 'react'; import classNames from 'classnames'; +import React, {Children, isValidElement, cloneElement} from 'react'; -import CardHeader from './card_header'; import CardBody from './card_body'; +import CardHeader from './card_header'; import './card.scss'; diff --git a/webapp/channels/src/components/card/card_body.tsx b/webapp/channels/src/components/card/card_body.tsx index 79f3c87294..90f4e12e29 100644 --- a/webapp/channels/src/components/card/card_body.tsx +++ b/webapp/channels/src/components/card/card_body.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {useState, useEffect} from 'react'; import classNames from 'classnames'; +import React, {useState, useEffect} from 'react'; import './card.scss'; diff --git a/webapp/channels/src/components/card/card_header.tsx b/webapp/channels/src/components/card/card_header.tsx index 77c461f40c..8d4b892708 100644 --- a/webapp/channels/src/components/card/card_header.tsx +++ b/webapp/channels/src/components/card/card_header.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import classNames from 'classnames'; +import React from 'react'; type Props = { children: React.ReactNode; diff --git a/webapp/channels/src/components/center_message_lock/index.test.tsx b/webapp/channels/src/components/center_message_lock/index.test.tsx index 0adf035d00..e730186cdb 100644 --- a/webapp/channels/src/components/center_message_lock/index.test.tsx +++ b/webapp/channels/src/components/center_message_lock/index.test.tsx @@ -4,13 +4,13 @@ import React from 'react'; import {Provider} from 'react-redux'; -import {makeEmptyUsage} from 'utils/limits_test'; +import {emptyLimits} from 'tests/constants/cloud'; +import {emptyTeams} from 'tests/constants/teams'; +import {adminUsersState, endUsersState} from 'tests/constants/users'; import {renderWithIntl, screen} from 'tests/react_testing_utils'; import testConfigureStore from 'tests/test_store'; -import {adminUsersState, endUsersState} from 'tests/constants/users'; -import {emptyLimits} from 'tests/constants/cloud'; +import {makeEmptyUsage} from 'utils/limits_test'; import {TestHelper} from 'utils/test_helper'; -import {emptyTeams} from 'tests/constants/teams'; import CenterMessageLock from './'; diff --git a/webapp/channels/src/components/center_message_lock/index.tsx b/webapp/channels/src/components/center_message_lock/index.tsx index 3d296475de..49c4729a06 100644 --- a/webapp/channels/src/components/center_message_lock/index.tsx +++ b/webapp/channels/src/components/center_message_lock/index.tsx @@ -2,26 +2,25 @@ // See LICENSE.txt for license information. import React from 'react'; -import {useIntl, FormatDateOptions} from 'react-intl'; +import {useIntl} from 'react-intl'; +import type {FormatDateOptions} from 'react-intl'; import {useSelector} from 'react-redux'; import {EyeOffOutlineIcon} from '@mattermost/compass-icons/components'; - -import {isAdmin} from 'mattermost-redux/utils/user_utils'; -import {getCurrentUser} from 'mattermost-redux/selectors/entities/users'; -import {getCurrentTeam} from 'mattermost-redux/selectors/entities/teams'; +import type {GlobalState} from '@mattermost/types/store'; import {getOldestPostTimeInChannel} from 'mattermost-redux/selectors/entities/posts'; +import {getCurrentTeam} from 'mattermost-redux/selectors/entities/teams'; +import {getCurrentUser} from 'mattermost-redux/selectors/entities/users'; +import {isAdmin} from 'mattermost-redux/utils/user_utils'; -import useOpenPricingModal from 'components/common/hooks/useOpenPricingModal'; import useGetLimits from 'components/common/hooks/useGetLimits'; import {NotifyStatus} from 'components/common/hooks/useGetNotifyAdmin'; +import useOpenPricingModal from 'components/common/hooks/useOpenPricingModal'; import {useNotifyAdmin} from 'components/notify_admin_cta/notify_admin_cta'; import {LicenseSkus, MattermostFeatures} from 'utils/constants'; -import {GlobalState} from '@mattermost/types/store'; - import './index.scss'; const ONE_DAY_MS = 1000 * 60 * 60 * 24; diff --git a/webapp/channels/src/components/channel_groups_manage_modal/channel_groups_manage_modal.tsx b/webapp/channels/src/components/channel_groups_manage_modal/channel_groups_manage_modal.tsx index 5bcec33c60..149f45ff61 100644 --- a/webapp/channels/src/components/channel_groups_manage_modal/channel_groups_manage_modal.tsx +++ b/webapp/channels/src/components/channel_groups_manage_modal/channel_groups_manage_modal.tsx @@ -2,29 +2,25 @@ // See LICENSE.txt for license information. import React from 'react'; -import {FormattedMessage, injectIntl, IntlShape} from 'react-intl'; +import {FormattedMessage, injectIntl} from 'react-intl'; +import type {IntlShape} from 'react-intl'; -import {Group, SyncableType} from '@mattermost/types/groups'; - -import {Channel} from '@mattermost/types/channels'; +import type {Channel} from '@mattermost/types/channels'; +import {SyncableType} from '@mattermost/types/groups'; +import type {Group} from '@mattermost/types/groups'; import AddGroupsToChannelModal from 'components/add_groups_to_channel_modal'; - -import {ModalIdentifiers} from 'utils/constants'; - import ListModal, {DEFAULT_NUM_PER_PAGE} from 'components/list_modal'; - import DropdownIcon from 'components/widgets/icons/fa_dropdown_icon'; +import Menu from 'components/widgets/menu/menu'; +import MenuWrapper from 'components/widgets/menu/menu_wrapper'; import groupsAvatar from 'images/groups-avatar.png'; - -import MenuWrapper from 'components/widgets/menu/menu_wrapper'; -import Menu from 'components/widgets/menu/menu'; - -import {ModalData} from 'types/actions'; - +import {ModalIdentifiers} from 'utils/constants'; import * as Utils from 'utils/utils'; +import type {ModalData} from 'types/actions'; + type Props = { channel: Channel; intl: IntlShape; diff --git a/webapp/channels/src/components/channel_groups_manage_modal/index.ts b/webapp/channels/src/components/channel_groups_manage_modal/index.ts index f688a5fe7d..42b01e5848 100644 --- a/webapp/channels/src/components/channel_groups_manage_modal/index.ts +++ b/webapp/channels/src/components/channel_groups_manage_modal/index.ts @@ -1,17 +1,19 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators, Dispatch, ActionCreatorsMapObject} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch, ActionCreatorsMapObject} from 'redux'; + +import type {GlobalState} from '@mattermost/types/store'; -import {getGroupsAssociatedToChannel, unlinkGroupSyncable, patchGroupSyncable} from 'mattermost-redux/actions/groups'; import {getMyChannelMember} from 'mattermost-redux/actions/channels'; -import {GlobalState} from '@mattermost/types/store'; -import {Action} from 'mattermost-redux/types/actions'; +import {getGroupsAssociatedToChannel, unlinkGroupSyncable, patchGroupSyncable} from 'mattermost-redux/actions/groups'; +import type {Action} from 'mattermost-redux/types/actions'; import {closeModal, openModal} from 'actions/views/modals'; -import {ModalData} from 'types/actions'; +import type {ModalData} from 'types/actions'; import ChannelGroupsManageModal from './channel_groups_manage_modal'; diff --git a/webapp/channels/src/components/channel_header/channel_header.test.tsx b/webapp/channels/src/components/channel_header/channel_header.test.tsx index 49c3fe55be..2a575421eb 100644 --- a/webapp/channels/src/components/channel_header/channel_header.test.tsx +++ b/webapp/channels/src/components/channel_header/channel_header.test.tsx @@ -1,18 +1,20 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {ComponentProps} from 'react'; +import React from 'react'; +import type {ComponentProps} from 'react'; -import GuestTag from 'components/widgets/tag/guest_tag'; +import type {ChannelType} from '@mattermost/types/channels'; +import type {UserCustomStatus} from '@mattermost/types/users'; -import {shallowWithIntl} from 'tests/helpers/intl-test-helper'; import ChannelHeader from 'components/channel_header/channel_header'; import ChannelInfoButton from 'components/channel_header/channel_info_button'; import Markdown from 'components/markdown'; +import GuestTag from 'components/widgets/tag/guest_tag'; + +import {shallowWithIntl} from 'tests/helpers/intl-test-helper'; import Constants, {RHSStates} from 'utils/constants'; -import {TestHelper} from '../../utils/test_helper'; -import {ChannelType} from '@mattermost/types/channels'; -import {UserCustomStatus} from '@mattermost/types/users'; +import {TestHelper} from 'utils/test_helper'; describe('components/ChannelHeader', () => { const baseProps: ComponentProps = { diff --git a/webapp/channels/src/components/channel_header/channel_header.tsx b/webapp/channels/src/components/channel_header/channel_header.tsx index 44144444d7..bc9727460a 100644 --- a/webapp/channels/src/components/channel_header/channel_header.tsx +++ b/webapp/channels/src/components/channel_header/channel_header.tsx @@ -1,52 +1,52 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {MouseEvent, ReactNode, RefObject} from 'react'; -import {Overlay} from 'react-bootstrap'; -import {FormattedMessage, injectIntl, IntlShape} from 'react-intl'; import classNames from 'classnames'; +import React from 'react'; +import type {MouseEvent, ReactNode, RefObject} from 'react'; +import {Overlay} from 'react-bootstrap'; +import {FormattedMessage, injectIntl} from 'react-intl'; +import type {IntlShape} from 'react-intl'; -import GuestTag from 'components/widgets/tag/guest_tag'; -import BotTag from 'components/widgets/tag/bot_tag'; +import type {Channel, ChannelMembership, ChannelNotifyProps} from '@mattermost/types/channels'; +import type {UserCustomStatus, UserProfile} from '@mattermost/types/users'; import {Permissions} from 'mattermost-redux/constants'; import {memoizeResult} from 'mattermost-redux/utils/helpers'; import {displayUsername, isGuest} from 'mattermost-redux/utils/user_utils'; -import EditChannelHeaderModal from 'components/edit_channel_header_modal'; -import Markdown from 'components/markdown'; -import OverlayTrigger, {BaseOverlayTrigger} from 'components/overlay_trigger'; -import Tooltip from 'components/tooltip'; -import StatusIcon from 'components/status_icon'; -import ArchiveIcon from 'components/widgets/icons/archive_icon'; -import SharedChannelIndicator from 'components/shared_channel_indicator'; -import ChannelPermissionGate from 'components/permissions_gates/channel_permission_gate'; import {ChannelHeaderDropdown} from 'components/channel_header_dropdown'; -import MenuWrapper from 'components/widgets/menu/menu_wrapper'; - -import Popover from 'components/widgets/popover'; -import CallButton from 'plugins/call_button'; import CustomStatusEmoji from 'components/custom_status/custom_status_emoji'; import CustomStatusText from 'components/custom_status/custom_status_text'; +import EditChannelHeaderModal from 'components/edit_channel_header_modal'; +import LocalizedIcon from 'components/localized_icon'; +import Markdown from 'components/markdown'; +import OverlayTrigger from 'components/overlay_trigger'; +import type {BaseOverlayTrigger} from 'components/overlay_trigger'; +import ChannelPermissionGate from 'components/permissions_gates/channel_permission_gate'; +import SharedChannelIndicator from 'components/shared_channel_indicator'; +import StatusIcon from 'components/status_icon'; import Timestamp from 'components/timestamp'; -import ChannelHeaderPlug from 'plugins/channel_header_plug'; +import Tooltip from 'components/tooltip'; +import ArchiveIcon from 'components/widgets/icons/archive_icon'; +import MenuWrapper from 'components/widgets/menu/menu_wrapper'; +import Popover from 'components/widgets/popover'; +import BotTag from 'components/widgets/tag/bot_tag'; +import GuestTag from 'components/widgets/tag/guest_tag'; +import CallButton from 'plugins/call_button'; +import ChannelHeaderPlug from 'plugins/channel_header_plug'; import { Constants, ModalIdentifiers, NotificationLevels, RHSStates, } from 'utils/constants'; -import {handleFormattedTextClick, localizeMessage, isEmptyObject, toTitleCase} from 'utils/utils'; import {t} from 'utils/i18n'; +import {handleFormattedTextClick, localizeMessage, isEmptyObject, toTitleCase} from 'utils/utils'; -import {UserCustomStatus, UserProfile} from '@mattermost/types/users'; -import {Channel, ChannelMembership, ChannelNotifyProps} from '@mattermost/types/channels'; -import {RhsState} from 'types/store/rhs'; - -import {ModalData} from 'types/actions'; - -import LocalizedIcon from 'components/localized_icon'; +import type {ModalData} from 'types/actions'; +import type {RhsState} from 'types/store/rhs'; import ChannelInfoButton from './channel_info_button'; import HeaderIconWrapper from './components/header_icon_wrapper'; diff --git a/webapp/channels/src/components/channel_header/channel_info_button.tsx b/webapp/channels/src/components/channel_header/channel_info_button.tsx index 992f7092c2..7de1039b3d 100644 --- a/webapp/channels/src/components/channel_header/channel_info_button.tsx +++ b/webapp/channels/src/components/channel_header/channel_info_button.tsx @@ -2,18 +2,17 @@ // See LICENSE.txt for license information. import React, {useCallback} from 'react'; - import {useDispatch, useSelector} from 'react-redux'; - import styled from 'styled-components'; -import {Channel} from '@mattermost/types/channels'; -import {getIsRhsOpen, getRhsState} from 'selectors/rhs'; +import type {Channel} from '@mattermost/types/channels'; import {closeRightHandSide, showChannelInfo} from 'actions/views/rhs'; +import {getIsRhsOpen, getRhsState} from 'selectors/rhs'; import {RHSStates} from 'utils/constants'; -import {RhsState} from 'types/store/rhs'; + +import type {RhsState} from 'types/store/rhs'; import HeaderIconWrapper from './components/header_icon_wrapper'; diff --git a/webapp/channels/src/components/channel_header/components/header_icon_wrapper.test.tsx b/webapp/channels/src/components/channel_header/components/header_icon_wrapper.test.tsx index 90ae5f5b18..e98f299226 100644 --- a/webapp/channels/src/components/channel_header/components/header_icon_wrapper.test.tsx +++ b/webapp/channels/src/components/channel_header/components/header_icon_wrapper.test.tsx @@ -1,16 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; +import HeaderIconWrapper from 'components/channel_header/components/header_icon_wrapper'; import FlagIcon from 'components/widgets/icons/flag_icon'; import MentionsIcon from 'components/widgets/icons/mentions_icon'; import PinIcon from 'components/widgets/icons/pin_icon'; import SearchIcon from 'components/widgets/icons/search_icon'; -import HeaderIconWrapper from 'components/channel_header/components/header_icon_wrapper'; - describe('components/channel_header/components/HeaderIconWrapper', () => { function emptyFunction() {} //eslint-disable-line no-empty-function const mentionsIcon = ( diff --git a/webapp/channels/src/components/channel_header/components/header_icon_wrapper.tsx b/webapp/channels/src/components/channel_header/components/header_icon_wrapper.tsx index 3fac00a5b3..d216a3eb8d 100644 --- a/webapp/channels/src/components/channel_header/components/header_icon_wrapper.tsx +++ b/webapp/channels/src/components/channel_header/components/header_icon_wrapper.tsx @@ -4,17 +4,18 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import OverlayTrigger from 'components/overlay_trigger'; -import Tooltip from 'components/tooltip'; import NewChannelWithBoardTourTip from 'components/app_bar/new_channel_with_board_tour_tip'; import KeyboardShortcutSequence, { KEYBOARD_SHORTCUTS, - KeyboardShortcutDescriptor, } from 'components/keyboard_shortcuts/keyboard_shortcuts_sequence'; +import type { + KeyboardShortcutDescriptor} from 'components/keyboard_shortcuts/keyboard_shortcuts_sequence'; +import OverlayTrigger from 'components/overlay_trigger'; +import Tooltip from 'components/tooltip'; -import {localizeMessage} from 'utils/utils'; import {Constants, suitePluginIds} from 'utils/constants'; import {t} from 'utils/i18n'; +import {localizeMessage} from 'utils/utils'; type Props = { ariaLabel?: boolean; diff --git a/webapp/channels/src/components/channel_header/index.ts b/webapp/channels/src/components/channel_header/index.ts index deab495ec3..2254e3756c 100644 --- a/webapp/channels/src/components/channel_header/index.ts +++ b/webapp/channels/src/components/channel_header/index.ts @@ -1,9 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; import {connect} from 'react-redux'; import {withRouter} from 'react-router-dom'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; import { favoriteChannel, @@ -30,6 +31,7 @@ import { getUser, makeGetProfilesInChannel, } from 'mattermost-redux/selectors/entities/users'; +import type {Action} from 'mattermost-redux/types/actions'; import {getUserIdFromChannelName} from 'mattermost-redux/utils/channel_utils'; import {goToLastViewedChannel} from 'actions/views/channel'; @@ -40,18 +42,18 @@ import { closeRightHandSide, showChannelMembers, } from 'actions/views/rhs'; -import {makeGetCustomStatus, isCustomStatusEnabled, isCustomStatusExpired} from 'selectors/views/custom_status'; import {getIsRhsOpen, getRhsState} from 'selectors/rhs'; -import {isModalOpen} from 'selectors/views/modals'; import {getAnnouncementBarCount} from 'selectors/views/announcement_bar'; +import {makeGetCustomStatus, isCustomStatusEnabled, isCustomStatusExpired} from 'selectors/views/custom_status'; +import {isModalOpen} from 'selectors/views/modals'; + import {ModalIdentifiers} from 'utils/constants'; import {isFileAttachmentsEnabled} from 'utils/file_utils'; -import {GlobalState} from 'types/store'; +import type {GlobalState} from 'types/store'; -import {Action} from 'mattermost-redux/types/actions'; - -import ChannelHeader, {Props} from './channel_header'; +import ChannelHeader from './channel_header'; +import type {Props} from './channel_header'; const EMPTY_CHANNEL = {}; const EMPTY_CHANNEL_STATS = {member_count: 0, guest_count: 0, pinnedpost_count: 0, files_count: 0}; diff --git a/webapp/channels/src/components/channel_header_dropdown/channel_header_dropdown.test.tsx b/webapp/channels/src/components/channel_header_dropdown/channel_header_dropdown.test.tsx index 5f6ac325bb..29a2c503dd 100644 --- a/webapp/channels/src/components/channel_header_dropdown/channel_header_dropdown.test.tsx +++ b/webapp/channels/src/components/channel_header_dropdown/channel_header_dropdown.test.tsx @@ -2,12 +2,12 @@ // See LICENSE.txt for license information. import {shallow} from 'enzyme'; - import React from 'react'; import {TestHelper} from 'utils/test_helper'; -import ChannelHeaderDropdown, {Props} from './channel_header_dropdown_items'; +import ChannelHeaderDropdown from './channel_header_dropdown_items'; +import type {Props} from './channel_header_dropdown_items'; describe('components/ChannelHeaderDropdown', () => { const defaultProps = { diff --git a/webapp/channels/src/components/channel_header_dropdown/channel_header_dropdown.tsx b/webapp/channels/src/components/channel_header_dropdown/channel_header_dropdown.tsx index c4890a8e70..d1f61dfc8e 100644 --- a/webapp/channels/src/components/channel_header_dropdown/channel_header_dropdown.tsx +++ b/webapp/channels/src/components/channel_header_dropdown/channel_header_dropdown.tsx @@ -3,10 +3,11 @@ import React from 'react'; -import {localizeMessage} from 'utils/utils'; import {ChannelHeaderDropdownItems} from 'components/channel_header_dropdown'; import Menu from 'components/widgets/menu/menu'; +import {localizeMessage} from 'utils/utils'; + export default class ChannelHeaderDropdown extends React.PureComponent { render() { return ( diff --git a/webapp/channels/src/components/channel_header_dropdown/channel_header_dropdown_items.tsx b/webapp/channels/src/components/channel_header_dropdown/channel_header_dropdown_items.tsx index c12d504fe1..fa8886b880 100644 --- a/webapp/channels/src/components/channel_header_dropdown/channel_header_dropdown_items.tsx +++ b/webapp/channels/src/components/channel_header_dropdown/channel_header_dropdown_items.tsx @@ -3,44 +3,41 @@ import React from 'react'; -import {Permissions} from 'mattermost-redux/constants'; +import type {Channel} from '@mattermost/types/channels'; +import type {UserProfile} from '@mattermost/types/users'; -import {Constants, ModalIdentifiers} from 'utils/constants'; -import {localizeMessage} from 'utils/utils'; +import {Permissions} from 'mattermost-redux/constants'; import {isGuest} from 'mattermost-redux/utils/user_utils'; -import MobileChannelHeaderPlug from 'plugins/mobile_channel_header_plug'; - -import ChannelMoveToSubMenuOld from 'components/channel_move_to_sub_menu_old'; -import ChannelNotificationsModal from 'components/channel_notifications_modal'; -import ChannelInviteModal from 'components/channel_invite_modal'; -import EditChannelHeaderModal from 'components/edit_channel_header_modal'; -import EditChannelPurposeModal from 'components/edit_channel_purpose_modal'; -import RenameChannelModal from 'components/rename_channel_modal'; -import ConvertChannelModal from 'components/convert_channel_modal'; -import DeleteChannelModal from 'components/delete_channel_modal'; -import UnarchiveChannelModal from 'components/unarchive_channel_modal'; -import MoreDirectChannels from 'components/more_direct_channels'; import AddGroupsToChannelModal from 'components/add_groups_to_channel_modal'; import ChannelGroupsManageModal from 'components/channel_groups_manage_modal'; - +import ChannelInviteModal from 'components/channel_invite_modal'; +import ChannelMoveToSubMenuOld from 'components/channel_move_to_sub_menu_old'; +import ChannelNotificationsModal from 'components/channel_notifications_modal'; +import ConvertChannelModal from 'components/convert_channel_modal'; +import DeleteChannelModal from 'components/delete_channel_modal'; +import EditChannelHeaderModal from 'components/edit_channel_header_modal'; +import EditChannelPurposeModal from 'components/edit_channel_purpose_modal'; +import MoreDirectChannels from 'components/more_direct_channels'; import ChannelPermissionGate from 'components/permissions_gates/channel_permission_gate'; - +import RenameChannelModal from 'components/rename_channel_modal'; +import UnarchiveChannelModal from 'components/unarchive_channel_modal'; import Menu from 'components/widgets/menu/menu'; -import {PluginComponent} from 'types/store/plugins'; +import MobileChannelHeaderPlug from 'plugins/mobile_channel_header_plug'; +import {Constants, ModalIdentifiers} from 'utils/constants'; +import {localizeMessage} from 'utils/utils'; -import {UserProfile} from '@mattermost/types/users'; -import {Channel} from '@mattermost/types/channels'; +import type {PluginComponent} from 'types/store/plugins'; -import MenuItemLeaveChannel from './menu_items/leave_channel'; import MenuItemCloseChannel from './menu_items/close_channel'; import MenuItemCloseMessage from './menu_items/close_message'; -import MenuItemToggleMuteChannel from './menu_items/toggle_mute_channel'; -import MenuItemToggleFavoriteChannel from './menu_items/toggle_favorite_channel'; -import MenuItemViewPinnedPosts from './menu_items/view_pinned_posts'; -import MenuItemToggleInfo from './menu_items/toggle_info'; +import MenuItemLeaveChannel from './menu_items/leave_channel'; import MenuItemOpenMembersRHS from './menu_items/open_members_rhs'; +import MenuItemToggleFavoriteChannel from './menu_items/toggle_favorite_channel'; +import MenuItemToggleInfo from './menu_items/toggle_info'; +import MenuItemToggleMuteChannel from './menu_items/toggle_mute_channel'; +import MenuItemViewPinnedPosts from './menu_items/view_pinned_posts'; export type Props = { user: UserProfile; diff --git a/webapp/channels/src/components/channel_header_dropdown/index.ts b/webapp/channels/src/components/channel_header_dropdown/index.ts index c3c903c2e9..a264f08778 100644 --- a/webapp/channels/src/components/channel_header_dropdown/index.ts +++ b/webapp/channels/src/components/channel_header_dropdown/index.ts @@ -4,14 +4,6 @@ import {connect} from 'react-redux'; import {createSelector} from 'mattermost-redux/selectors/create_selector'; - -import { - getUser, - getCurrentUser, - getUserStatuses, - getCurrentUserId, -} from 'mattermost-redux/selectors/entities/users'; -import {getCurrentTeamId} from 'mattermost-redux/selectors/entities/teams'; import { getCurrentChannel, isCurrentChannelDefault, @@ -20,15 +12,21 @@ import { isCurrentChannelArchived, getRedirectChannelNameForTeam, } from 'mattermost-redux/selectors/entities/channels'; +import {getCurrentTeamId} from 'mattermost-redux/selectors/entities/teams'; +import { + getUser, + getCurrentUser, + getUserStatuses, + getCurrentUserId, +} from 'mattermost-redux/selectors/entities/users'; import {getPenultimateViewedChannelName} from 'selectors/local_storage'; +import {getChannelHeaderMenuPluginComponents} from 'selectors/plugins'; import {Constants} from 'utils/constants'; import * as Utils from 'utils/utils'; -import {getChannelHeaderMenuPluginComponents} from 'selectors/plugins'; - -import {GlobalState} from 'types/store'; +import type {GlobalState} from 'types/store'; import Desktop from './channel_header_dropdown'; import Items from './channel_header_dropdown_items'; diff --git a/webapp/channels/src/components/channel_header_dropdown/menu_items/close_channel/close_channel.test.tsx b/webapp/channels/src/components/channel_header_dropdown/menu_items/close_channel/close_channel.test.tsx index 33b0a44182..034295e4c4 100644 --- a/webapp/channels/src/components/channel_header_dropdown/menu_items/close_channel/close_channel.test.tsx +++ b/webapp/channels/src/components/channel_header_dropdown/menu_items/close_channel/close_channel.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import Menu from 'components/widgets/menu/menu'; diff --git a/webapp/channels/src/components/channel_header_dropdown/menu_items/close_channel/close_channel.tsx b/webapp/channels/src/components/channel_header_dropdown/menu_items/close_channel/close_channel.tsx index 1ab246786b..331c47c670 100644 --- a/webapp/channels/src/components/channel_header_dropdown/menu_items/close_channel/close_channel.tsx +++ b/webapp/channels/src/components/channel_header_dropdown/menu_items/close_channel/close_channel.tsx @@ -3,10 +3,10 @@ import React from 'react'; -import {localizeMessage} from 'utils/utils'; - import Menu from 'components/widgets/menu/menu'; +import {localizeMessage} from 'utils/utils'; + type Props = { isArchived: boolean; actions: { diff --git a/webapp/channels/src/components/channel_header_dropdown/menu_items/close_channel/index.ts b/webapp/channels/src/components/channel_header_dropdown/menu_items/close_channel/index.ts index 682ee91b15..5a7e9c55b8 100644 --- a/webapp/channels/src/components/channel_header_dropdown/menu_items/close_channel/index.ts +++ b/webapp/channels/src/components/channel_header_dropdown/menu_items/close_channel/index.ts @@ -1,10 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators, Dispatch} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch} from 'redux'; -import {GenericAction} from 'mattermost-redux/types/actions'; +import type {GenericAction} from 'mattermost-redux/types/actions'; import {goToLastViewedChannel} from 'actions/views/channel'; diff --git a/webapp/channels/src/components/channel_header_dropdown/menu_items/close_message/close_message.test.tsx b/webapp/channels/src/components/channel_header_dropdown/menu_items/close_message/close_message.test.tsx index 3b5dc5bed1..0b88febb21 100644 --- a/webapp/channels/src/components/channel_header_dropdown/menu_items/close_message/close_message.test.tsx +++ b/webapp/channels/src/components/channel_header_dropdown/menu_items/close_message/close_message.test.tsx @@ -1,13 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; -import {TeamType} from '@mattermost/types/teams'; -import {ChannelType} from '@mattermost/types/channels'; +import type {ChannelType} from '@mattermost/types/channels'; +import type {TeamType} from '@mattermost/types/teams'; import Menu from 'components/widgets/menu/menu'; + import {Constants} from 'utils/constants'; import {TestHelper} from 'utils/test_helper'; diff --git a/webapp/channels/src/components/channel_header_dropdown/menu_items/close_message/close_message.tsx b/webapp/channels/src/components/channel_header_dropdown/menu_items/close_message/close_message.tsx index 609140a559..2bb056eb39 100644 --- a/webapp/channels/src/components/channel_header_dropdown/menu_items/close_message/close_message.tsx +++ b/webapp/channels/src/components/channel_header_dropdown/menu_items/close_message/close_message.tsx @@ -3,16 +3,17 @@ import React from 'react'; -import {UserProfile} from '@mattermost/types/users'; -import {Team} from '@mattermost/types/teams'; -import {Channel} from '@mattermost/types/channels'; -import {PreferenceType} from '@mattermost/types/preferences'; +import type {Channel} from '@mattermost/types/channels'; +import type {PreferenceType} from '@mattermost/types/preferences'; +import type {Team} from '@mattermost/types/teams'; +import type {UserProfile} from '@mattermost/types/users'; -import {localizeMessage} from 'utils/utils'; -import {Constants} from 'utils/constants'; -import {getHistory} from 'utils/browser_history'; import Menu from 'components/widgets/menu/menu'; +import {getHistory} from 'utils/browser_history'; +import {Constants} from 'utils/constants'; +import {localizeMessage} from 'utils/utils'; + type Props = { /** diff --git a/webapp/channels/src/components/channel_header_dropdown/menu_items/close_message/index.ts b/webapp/channels/src/components/channel_header_dropdown/menu_items/close_message/index.ts index b47fa3c041..d5b89cb70d 100644 --- a/webapp/channels/src/components/channel_header_dropdown/menu_items/close_message/index.ts +++ b/webapp/channels/src/components/channel_header_dropdown/menu_items/close_message/index.ts @@ -1,15 +1,17 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators, Dispatch} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch} from 'redux'; import {savePreferences} from 'mattermost-redux/actions/preferences'; -import {getCurrentTeam, getCurrentTeamId} from 'mattermost-redux/selectors/entities/teams'; import {getRedirectChannelNameForTeam} from 'mattermost-redux/selectors/entities/channels'; +import {getCurrentTeam, getCurrentTeamId} from 'mattermost-redux/selectors/entities/teams'; import {leaveDirectChannel} from 'actions/views/channel'; -import {GlobalState} from 'types/store'; + +import type {GlobalState} from 'types/store'; import CloseMessage from './close_message'; diff --git a/webapp/channels/src/components/channel_header_dropdown/menu_items/leave_channel/index.ts b/webapp/channels/src/components/channel_header_dropdown/menu_items/leave_channel/index.ts index 7b677890c7..7d7303187c 100644 --- a/webapp/channels/src/components/channel_header_dropdown/menu_items/leave_channel/index.ts +++ b/webapp/channels/src/components/channel_header_dropdown/menu_items/leave_channel/index.ts @@ -1,10 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators, Dispatch} from 'redux'; -import {connect, ConnectedProps} from 'react-redux'; +import {connect} from 'react-redux'; +import type {ConnectedProps} from 'react-redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch} from 'redux'; -import {GenericAction} from 'mattermost-redux/types/actions'; +import type {GenericAction} from 'mattermost-redux/types/actions'; import {leaveChannel} from 'actions/views/channel'; import {openModal} from 'actions/views/modals'; diff --git a/webapp/channels/src/components/channel_header_dropdown/menu_items/leave_channel/leave_channel.test.tsx b/webapp/channels/src/components/channel_header_dropdown/menu_items/leave_channel/leave_channel.test.tsx index d1f806dc85..4b6a5f18d2 100644 --- a/webapp/channels/src/components/channel_header_dropdown/menu_items/leave_channel/leave_channel.test.tsx +++ b/webapp/channels/src/components/channel_header_dropdown/menu_items/leave_channel/leave_channel.test.tsx @@ -1,13 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import Menu from 'components/widgets/menu/menu'; -import {TestHelper} from 'utils/test_helper'; import {ModalIdentifiers} from 'utils/constants'; +import {TestHelper} from 'utils/test_helper'; import LeaveChannel from './leave_channel'; diff --git a/webapp/channels/src/components/channel_header_dropdown/menu_items/leave_channel/leave_channel.tsx b/webapp/channels/src/components/channel_header_dropdown/menu_items/leave_channel/leave_channel.tsx index b251c242f4..4d0d0a0be9 100644 --- a/webapp/channels/src/components/channel_header_dropdown/menu_items/leave_channel/leave_channel.tsx +++ b/webapp/channels/src/components/channel_header_dropdown/menu_items/leave_channel/leave_channel.tsx @@ -3,14 +3,14 @@ import React from 'react'; -import {Channel} from '@mattermost/types/channels'; +import type {Channel} from '@mattermost/types/channels'; + +import LeaveChannelModal from 'components/leave_channel_modal'; +import Menu from 'components/widgets/menu/menu'; import {Constants, ModalIdentifiers} from 'utils/constants'; import {localizeMessage} from 'utils/utils'; -import Menu from 'components/widgets/menu/menu'; -import LeaveChannelModal from 'components/leave_channel_modal'; - import type {PropsFromRedux} from './index'; interface Props extends PropsFromRedux { diff --git a/webapp/channels/src/components/channel_header_dropdown/menu_items/open_members_rhs/index.ts b/webapp/channels/src/components/channel_header_dropdown/menu_items/open_members_rhs/index.ts index 727baba2af..f8ea00fe54 100644 --- a/webapp/channels/src/components/channel_header_dropdown/menu_items/open_members_rhs/index.ts +++ b/webapp/channels/src/components/channel_header_dropdown/menu_items/open_members_rhs/index.ts @@ -1,15 +1,19 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators, Dispatch} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch} from 'redux'; + +import type {GenericAction} from 'mattermost-redux/types/actions'; import {showChannelMembers} from 'actions/views/rhs'; -import {GenericAction} from 'mattermost-redux/types/actions'; import {getIsRhsOpen, getRhsState} from 'selectors/rhs'; -import {GlobalState} from 'types/store'; + import {RHSStates} from 'utils/constants'; +import type {GlobalState} from 'types/store'; + import OpenChannelMembersRHS from './open_members_rhs'; const mapStateToProps = (state: GlobalState) => ({ diff --git a/webapp/channels/src/components/channel_header_dropdown/menu_items/open_members_rhs/open_members_rhs.tsx b/webapp/channels/src/components/channel_header_dropdown/menu_items/open_members_rhs/open_members_rhs.tsx index e28849470f..8d15373a3c 100644 --- a/webapp/channels/src/components/channel_header_dropdown/menu_items/open_members_rhs/open_members_rhs.tsx +++ b/webapp/channels/src/components/channel_header_dropdown/menu_items/open_members_rhs/open_members_rhs.tsx @@ -3,7 +3,8 @@ import React from 'react'; -import {Channel} from '@mattermost/types/channels'; +import type {Channel} from '@mattermost/types/channels'; + import Menu from 'components/widgets/menu/menu'; type Action = { diff --git a/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_favorite_channel/index.ts b/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_favorite_channel/index.ts index d237ad6c8a..c0741332fb 100644 --- a/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_favorite_channel/index.ts +++ b/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_favorite_channel/index.ts @@ -1,11 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators, Dispatch} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch} from 'redux'; import {favoriteChannel, unfavoriteChannel} from 'mattermost-redux/actions/channels'; -import {GenericAction} from 'mattermost-redux/types/actions'; +import type {GenericAction} from 'mattermost-redux/types/actions'; import ToggleFavoriteChannel from './toggle_favorite_channel'; diff --git a/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_favorite_channel/toggle_favorite_channel.test.tsx b/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_favorite_channel/toggle_favorite_channel.test.tsx index dd89fbc8c3..1abf295e32 100644 --- a/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_favorite_channel/toggle_favorite_channel.test.tsx +++ b/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_favorite_channel/toggle_favorite_channel.test.tsx @@ -1,10 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; -import {ChannelType} from '@mattermost/types/channels'; +import type {ChannelType} from '@mattermost/types/channels'; import Menu from 'components/widgets/menu/menu'; diff --git a/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_favorite_channel/toggle_favorite_channel.tsx b/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_favorite_channel/toggle_favorite_channel.tsx index ebca3142d7..3c6734abf1 100644 --- a/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_favorite_channel/toggle_favorite_channel.tsx +++ b/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_favorite_channel/toggle_favorite_channel.tsx @@ -3,12 +3,12 @@ import React from 'react'; -import {Channel} from '@mattermost/types/channels'; - -import {localizeMessage} from 'utils/utils'; +import type {Channel} from '@mattermost/types/channels'; import Menu from 'components/widgets/menu/menu'; +import {localizeMessage} from 'utils/utils'; + type Action = { favoriteChannel: (channelId: string) => void; unfavoriteChannel: (channelId: string) => void; diff --git a/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_info/index.ts b/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_info/index.ts index 51266e49af..b4b64c1407 100644 --- a/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_info/index.ts +++ b/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_info/index.ts @@ -1,15 +1,19 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators, Dispatch} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch} from 'redux'; + +import type {GenericAction} from 'mattermost-redux/types/actions'; import {closeRightHandSide, showChannelInfo} from 'actions/views/rhs'; -import {GenericAction} from 'mattermost-redux/types/actions'; import {getIsRhsOpen, getRhsState} from 'selectors/rhs'; -import {GlobalState} from 'types/store'; + import {RHSStates} from 'utils/constants'; +import type {GlobalState} from 'types/store'; + import ToggleInfo from './toggle_info'; const mapStateToProps = (state: GlobalState) => ({ diff --git a/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_info/toggle_info.tsx b/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_info/toggle_info.tsx index fc8421ec5b..34bbb7f149 100644 --- a/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_info/toggle_info.tsx +++ b/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_info/toggle_info.tsx @@ -3,10 +3,12 @@ import React from 'react'; -import {Channel} from '@mattermost/types/channels'; -import {localizeMessage} from 'utils/utils'; +import type {Channel} from '@mattermost/types/channels'; + import Menu from 'components/widgets/menu/menu'; +import {localizeMessage} from 'utils/utils'; + type Action = { closeRightHandSide: () => void; showChannelInfo: (channelId: string) => void; diff --git a/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_mute_channel/index.ts b/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_mute_channel/index.ts index 51cc04f0f4..403683a1dc 100644 --- a/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_mute_channel/index.ts +++ b/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_mute_channel/index.ts @@ -1,13 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; import {updateChannelNotifyProps} from 'mattermost-redux/actions/channels'; -import {ActionFunc} from 'mattermost-redux/types/actions'; +import type {ActionFunc} from 'mattermost-redux/types/actions'; -import MenuItemToggleMuteChannel, {Actions} from './toggle_mute_channel'; +import MenuItemToggleMuteChannel from './toggle_mute_channel'; +import type {Actions} from './toggle_mute_channel'; const mapDispatchToProps = (dispatch: Dispatch) => ({ actions: bindActionCreators, Actions>({ diff --git a/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_mute_channel/toggle_mute_channel.test.tsx b/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_mute_channel/toggle_mute_channel.test.tsx index 89adb7d172..08555fc2a9 100644 --- a/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_mute_channel/toggle_mute_channel.test.tsx +++ b/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_mute_channel/toggle_mute_channel.test.tsx @@ -1,17 +1,17 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; -import {Channel} from '@mattermost/types/channels'; -import {UserProfile} from '@mattermost/types/users'; - -import {Constants, NotificationLevels} from 'utils/constants'; +import type {Channel} from '@mattermost/types/channels'; +import type {UserProfile} from '@mattermost/types/users'; import Menu from 'components/widgets/menu/menu'; import MenuItemAction from 'components/widgets/menu/menu_items/menu_item_action'; +import {Constants, NotificationLevels} from 'utils/constants'; + import MenuItemToggleMuteChannel from './toggle_mute_channel'; describe('components/ChannelHeaderDropdown/MenuItemToggleMuteChannel', () => { diff --git a/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_mute_channel/toggle_mute_channel.tsx b/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_mute_channel/toggle_mute_channel.tsx index 4a33da1b15..2fd75c1b79 100644 --- a/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_mute_channel/toggle_mute_channel.tsx +++ b/webapp/channels/src/components/channel_header_dropdown/menu_items/toggle_mute_channel/toggle_mute_channel.tsx @@ -3,15 +3,16 @@ import React from 'react'; -import {UserProfile} from '@mattermost/types/users'; -import {Channel, ChannelNotifyProps} from '@mattermost/types/channels'; -import {ActionFunc} from 'mattermost-redux/types/actions'; +import type {Channel, ChannelNotifyProps} from '@mattermost/types/channels'; +import type {UserProfile} from '@mattermost/types/users'; + +import type {ActionFunc} from 'mattermost-redux/types/actions'; + +import Menu from 'components/widgets/menu/menu'; import {Constants, NotificationLevels} from 'utils/constants'; import {localizeMessage} from 'utils/utils'; -import Menu from 'components/widgets/menu/menu'; - export type Actions = { updateChannelNotifyProps(userId: string, channelId: string, props: Partial): ActionFunc; }; @@ -69,11 +70,9 @@ export default class MenuItemToggleMuteChannel extends React.PureComponent ({ diff --git a/webapp/channels/src/components/channel_header_dropdown/menu_items/view_pinned_posts/view_pinned_posts.test.tsx b/webapp/channels/src/components/channel_header_dropdown/menu_items/view_pinned_posts/view_pinned_posts.test.tsx index 9c7f8c8d32..d3652e797e 100644 --- a/webapp/channels/src/components/channel_header_dropdown/menu_items/view_pinned_posts/view_pinned_posts.test.tsx +++ b/webapp/channels/src/components/channel_header_dropdown/menu_items/view_pinned_posts/view_pinned_posts.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import Menu from 'components/widgets/menu/menu'; diff --git a/webapp/channels/src/components/channel_header_dropdown/menu_items/view_pinned_posts/view_pinned_posts.tsx b/webapp/channels/src/components/channel_header_dropdown/menu_items/view_pinned_posts/view_pinned_posts.tsx index 0f7c169a15..769ae9cd7a 100644 --- a/webapp/channels/src/components/channel_header_dropdown/menu_items/view_pinned_posts/view_pinned_posts.tsx +++ b/webapp/channels/src/components/channel_header_dropdown/menu_items/view_pinned_posts/view_pinned_posts.tsx @@ -3,12 +3,12 @@ import React from 'react'; -import {GetStateFunc, DispatchFunc} from 'mattermost-redux/types/actions'; - -import {localizeMessage} from 'utils/utils'; +import type {GetStateFunc, DispatchFunc} from 'mattermost-redux/types/actions'; import Menu from 'components/widgets/menu/menu'; +import {localizeMessage} from 'utils/utils'; + type Props = { show?: boolean; channel: any; diff --git a/webapp/channels/src/components/channel_header_dropdown/mobile_channel_header_dropdown.tsx b/webapp/channels/src/components/channel_header_dropdown/mobile_channel_header_dropdown.tsx index c2d4b8ef73..0addea3e7a 100644 --- a/webapp/channels/src/components/channel_header_dropdown/mobile_channel_header_dropdown.tsx +++ b/webapp/channels/src/components/channel_header_dropdown/mobile_channel_header_dropdown.tsx @@ -2,20 +2,19 @@ // See LICENSE.txt for license information. import React from 'react'; -import {FormattedMessage, injectIntl, IntlShape} from 'react-intl'; +import {FormattedMessage, injectIntl} from 'react-intl'; +import type {IntlShape} from 'react-intl'; -import {UserProfile} from '@mattermost/types/users'; -import {Channel} from '@mattermost/types/channels'; - -import StatusIcon from 'components/status_icon'; - -import {Constants} from 'utils/constants'; +import type {Channel} from '@mattermost/types/channels'; +import type {UserProfile} from '@mattermost/types/users'; import {ChannelHeaderDropdownItems} from 'components/channel_header_dropdown'; - +import StatusIcon from 'components/status_icon'; import Menu from 'components/widgets/menu/menu'; import MenuWrapper from 'components/widgets/menu/menu_wrapper'; +import {Constants} from 'utils/constants'; + import MobileChannelHeaderDropdownAnimation from './mobile_channel_header_dropdown_animation'; type Props = { diff --git a/webapp/channels/src/components/channel_header_dropdown/mobile_channel_header_dropdown_animation.tsx b/webapp/channels/src/components/channel_header_dropdown/mobile_channel_header_dropdown_animation.tsx index 82d2664c1c..77d22b76b2 100644 --- a/webapp/channels/src/components/channel_header_dropdown/mobile_channel_header_dropdown_animation.tsx +++ b/webapp/channels/src/components/channel_header_dropdown/mobile_channel_header_dropdown_animation.tsx @@ -1,7 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {ReactNode} from 'react'; +import React from 'react'; +import type {ReactNode} from 'react'; import {CSSTransition} from 'react-transition-group'; const ANIMATION_DURATION = 350; diff --git a/webapp/channels/src/components/channel_header_mobile/channel_header_mobile.tsx b/webapp/channels/src/components/channel_header_mobile/channel_header_mobile.tsx index 47c6e4c345..a52da2531e 100644 --- a/webapp/channels/src/components/channel_header_mobile/channel_header_mobile.tsx +++ b/webapp/channels/src/components/channel_header_mobile/channel_header_mobile.tsx @@ -3,18 +3,18 @@ import classNames from 'classnames'; import React from 'react'; - import {FormattedMessage} from 'react-intl'; -import {Channel} from '@mattermost/types/channels'; -import {UserProfile} from '@mattermost/types/users'; +import type {Channel} from '@mattermost/types/channels'; +import type {UserProfile} from '@mattermost/types/users'; import {MobileChannelHeaderDropdown} from 'components/channel_header_dropdown'; + import MobileChannelHeaderPlug from 'plugins/mobile_channel_header_plug'; +import ChannelInfoButton from './channel_info_button'; import CollapseLhsButton from './collapse_lhs_button'; import CollapseRhsButton from './collapse_rhs_button'; -import ChannelInfoButton from './channel_info_button'; import ShowSearchButton from './show_search_button'; import UnmuteChannelButton from './unmute_channel_button'; diff --git a/webapp/channels/src/components/channel_header_mobile/channel_info_button/channel_info_button.tsx b/webapp/channels/src/components/channel_header_mobile/channel_info_button/channel_info_button.tsx index 842eb793c9..a8cadaf8fa 100644 --- a/webapp/channels/src/components/channel_header_mobile/channel_info_button/channel_info_button.tsx +++ b/webapp/channels/src/components/channel_header_mobile/channel_info_button/channel_info_button.tsx @@ -3,10 +3,11 @@ import React from 'react'; -import {localizeMessage} from 'utils/utils'; +import type {Channel} from '@mattermost/types/channels'; import InfoIcon from 'components/widgets/icons/info_icon'; -import {Channel} from '@mattermost/types/channels'; + +import {localizeMessage} from 'utils/utils'; type Props = { channel: Channel; diff --git a/webapp/channels/src/components/channel_header_mobile/channel_info_button/index.ts b/webapp/channels/src/components/channel_header_mobile/channel_info_button/index.ts index f1aaabefd4..abaa7871a5 100644 --- a/webapp/channels/src/components/channel_header_mobile/channel_info_button/index.ts +++ b/webapp/channels/src/components/channel_header_mobile/channel_info_button/index.ts @@ -2,7 +2,8 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch} from 'redux'; import {showChannelInfo} from 'actions/views/rhs'; diff --git a/webapp/channels/src/components/channel_header_mobile/collapse_lhs_button/index.ts b/webapp/channels/src/components/channel_header_mobile/collapse_lhs_button/index.ts index f32b45ba0c..7b391d29c2 100644 --- a/webapp/channels/src/components/channel_header_mobile/collapse_lhs_button/index.ts +++ b/webapp/channels/src/components/channel_header_mobile/collapse_lhs_button/index.ts @@ -1,10 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators, Dispatch} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch} from 'redux'; -import {GenericAction} from 'mattermost-redux/types/actions'; +import type {GenericAction} from 'mattermost-redux/types/actions'; import {toggle as toggleLhs} from 'actions/views/lhs'; diff --git a/webapp/channels/src/components/channel_header_mobile/collapse_rhs_button/index.ts b/webapp/channels/src/components/channel_header_mobile/collapse_rhs_button/index.ts index cc876a9445..a00085c8f2 100644 --- a/webapp/channels/src/components/channel_header_mobile/collapse_rhs_button/index.ts +++ b/webapp/channels/src/components/channel_header_mobile/collapse_rhs_button/index.ts @@ -1,10 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators, Dispatch} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch} from 'redux'; -import {GenericAction} from 'mattermost-redux/types/actions'; +import type {GenericAction} from 'mattermost-redux/types/actions'; import {toggleMenu as toggleRhsMenu} from 'actions/views/rhs'; diff --git a/webapp/channels/src/components/channel_header_mobile/index.ts b/webapp/channels/src/components/channel_header_mobile/index.ts index 5e6d2ac482..9b177d734e 100644 --- a/webapp/channels/src/components/channel_header_mobile/index.ts +++ b/webapp/channels/src/components/channel_header_mobile/index.ts @@ -1,28 +1,28 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {Location} from 'history'; +import type {Location} from 'history'; import {connect} from 'react-redux'; -import {bindActionCreators, Dispatch} from 'redux'; import {withRouter, matchPath} from 'react-router-dom'; +import {bindActionCreators} from 'redux'; +import type {Dispatch} from 'redux'; import {createSelector} from 'mattermost-redux/selectors/create_selector'; -import {getCurrentUser} from 'mattermost-redux/selectors/entities/users'; import { getCurrentChannel, getMyCurrentChannelMembership, } from 'mattermost-redux/selectors/entities/channels'; +import {getCurrentUser} from 'mattermost-redux/selectors/entities/users'; import {isChannelMuted} from 'mattermost-redux/utils/channel_utils'; +import {close as closeLhs} from 'actions/views/lhs'; import { closeRightHandSide as closeRhs, closeMenu as closeRhsMenu, } from 'actions/views/rhs'; -import {close as closeLhs} from 'actions/views/lhs'; - import {getIsMobileView} from 'selectors/views/browser'; -import {GlobalState} from 'types/store'; +import type {GlobalState} from 'types/store'; import ChannelHeaderMobile from './channel_header_mobile'; diff --git a/webapp/channels/src/components/channel_header_mobile/show_search_button/index.ts b/webapp/channels/src/components/channel_header_mobile/show_search_button/index.ts index 0ffb84ecf9..ac4564c280 100644 --- a/webapp/channels/src/components/channel_header_mobile/show_search_button/index.ts +++ b/webapp/channels/src/components/channel_header_mobile/show_search_button/index.ts @@ -1,10 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators, Dispatch} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch} from 'redux'; -import {GenericAction} from 'mattermost-redux/types/actions'; +import type {GenericAction} from 'mattermost-redux/types/actions'; import {openRHSSearch} from 'actions/views/rhs'; diff --git a/webapp/channels/src/components/channel_header_mobile/show_search_button/show_search_button.tsx b/webapp/channels/src/components/channel_header_mobile/show_search_button/show_search_button.tsx index de2e327693..833286f401 100644 --- a/webapp/channels/src/components/channel_header_mobile/show_search_button/show_search_button.tsx +++ b/webapp/channels/src/components/channel_header_mobile/show_search_button/show_search_button.tsx @@ -3,10 +3,10 @@ import React from 'react'; -import {localizeMessage} from 'utils/utils'; - import SearchIcon from 'components/widgets/icons/search_icon'; +import {localizeMessage} from 'utils/utils'; + type Actions = { openRHSSearch: () => void; } diff --git a/webapp/channels/src/components/channel_header_mobile/unmute_channel_button/index.ts b/webapp/channels/src/components/channel_header_mobile/unmute_channel_button/index.ts index 89f821915e..1d6ae8ffd5 100644 --- a/webapp/channels/src/components/channel_header_mobile/unmute_channel_button/index.ts +++ b/webapp/channels/src/components/channel_header_mobile/unmute_channel_button/index.ts @@ -1,12 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators, Dispatch} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch} from 'redux'; import {updateChannelNotifyProps} from 'mattermost-redux/actions/channels'; - -import {GenericAction} from 'mattermost-redux/types/actions'; +import type {GenericAction} from 'mattermost-redux/types/actions'; import UnmuteChannelButton from './unmute_channel_button'; diff --git a/webapp/channels/src/components/channel_header_mobile/unmute_channel_button/unmute_channel_button.test.tsx b/webapp/channels/src/components/channel_header_mobile/unmute_channel_button/unmute_channel_button.test.tsx index 6efbb83094..5a09842d0e 100644 --- a/webapp/channels/src/components/channel_header_mobile/unmute_channel_button/unmute_channel_button.test.tsx +++ b/webapp/channels/src/components/channel_header_mobile/unmute_channel_button/unmute_channel_button.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import {NotificationLevels} from 'utils/constants'; diff --git a/webapp/channels/src/components/channel_header_mobile/unmute_channel_button/unmute_channel_button.tsx b/webapp/channels/src/components/channel_header_mobile/unmute_channel_button/unmute_channel_button.tsx index 76ca31e942..6ee4bb342f 100644 --- a/webapp/channels/src/components/channel_header_mobile/unmute_channel_button/unmute_channel_button.tsx +++ b/webapp/channels/src/components/channel_header_mobile/unmute_channel_button/unmute_channel_button.tsx @@ -3,7 +3,7 @@ import React from 'react'; -import {ChannelNotifyProps} from '@mattermost/types/channels'; +import type {ChannelNotifyProps} from '@mattermost/types/channels'; import {NotificationLevels} from 'utils/constants'; diff --git a/webapp/channels/src/components/channel_info_rhs/about_area.tsx b/webapp/channels/src/components/channel_info_rhs/about_area.tsx index 330b595a3c..af0a325e7f 100644 --- a/webapp/channels/src/components/channel_info_rhs/about_area.tsx +++ b/webapp/channels/src/components/channel_info_rhs/about_area.tsx @@ -4,15 +4,15 @@ import React from 'react'; import styled from 'styled-components'; +import type {Channel} from '@mattermost/types/channels'; +import type {UserProfile} from '@mattermost/types/users'; + import Constants from 'utils/constants'; -import {Channel} from '@mattermost/types/channels'; -import {UserProfile} from '@mattermost/types/users'; - -import {DMUser} from './channel_info_rhs'; +import AboutAreaChannel from './about_area_channel'; import AboutAreaDM from './about_area_dm'; import AboutAreaGM from './about_area_gm'; -import AboutAreaChannel from './about_area_channel'; +import type {DMUser} from './channel_info_rhs'; const Container = styled.div` overflow-wrap: anywhere; diff --git a/webapp/channels/src/components/channel_info_rhs/about_area_channel.test.tsx b/webapp/channels/src/components/channel_info_rhs/about_area_channel.test.tsx index fedc13b555..bf07b42af3 100644 --- a/webapp/channels/src/components/channel_info_rhs/about_area_channel.test.tsx +++ b/webapp/channels/src/components/channel_info_rhs/about_area_channel.test.tsx @@ -4,9 +4,10 @@ import React from 'react'; import {Provider} from 'react-redux'; +import type {Channel} from '@mattermost/types/channels'; + import {renderWithIntl, screen} from 'tests/react_testing_utils'; import mockStore from 'tests/test_store'; -import {Channel} from '@mattermost/types/channels'; import AboutAreaChannel from './about_area_channel'; diff --git a/webapp/channels/src/components/channel_info_rhs/about_area_channel.tsx b/webapp/channels/src/components/channel_info_rhs/about_area_channel.tsx index 4d28977d1b..e2c76acb89 100644 --- a/webapp/channels/src/components/channel_info_rhs/about_area_channel.tsx +++ b/webapp/channels/src/components/channel_info_rhs/about_area_channel.tsx @@ -2,15 +2,15 @@ // See LICENSE.txt for license information. import React from 'react'; -import styled from 'styled-components'; import {useIntl} from 'react-intl'; +import styled from 'styled-components'; + +import type {Channel} from '@mattermost/types/channels'; import Markdown from 'components/markdown'; -import {Channel} from '@mattermost/types/channels'; - -import LineLimiter from './components/linelimiter'; import EditableArea from './components/editable_area'; +import LineLimiter from './components/linelimiter'; const ChannelId = styled.div` margin-bottom: 12px; diff --git a/webapp/channels/src/components/channel_info_rhs/about_area_dm.test.tsx b/webapp/channels/src/components/channel_info_rhs/about_area_dm.test.tsx index 8a528db455..22e94adf01 100644 --- a/webapp/channels/src/components/channel_info_rhs/about_area_dm.test.tsx +++ b/webapp/channels/src/components/channel_info_rhs/about_area_dm.test.tsx @@ -4,11 +4,12 @@ import React from 'react'; import {Provider} from 'react-redux'; +import type {Channel} from '@mattermost/types/channels'; +import type {UserProfile} from '@mattermost/types/users'; + import {renderWithIntl, screen} from 'tests/react_testing_utils'; import mockStore from 'tests/test_store'; import Constants from 'utils/constants'; -import {Channel} from '@mattermost/types/channels'; -import {UserProfile} from '@mattermost/types/users'; import AboutAreaDM from './about_area_dm'; diff --git a/webapp/channels/src/components/channel_info_rhs/about_area_dm.tsx b/webapp/channels/src/components/channel_info_rhs/about_area_dm.tsx index fc047f33c7..9f61307734 100644 --- a/webapp/channels/src/components/channel_info_rhs/about_area_dm.tsx +++ b/webapp/channels/src/components/channel_info_rhs/about_area_dm.tsx @@ -2,20 +2,21 @@ // See LICENSE.txt for license information. import React from 'react'; -import styled from 'styled-components'; import {useIntl} from 'react-intl'; +import styled from 'styled-components'; + +import type {Channel} from '@mattermost/types/channels'; -import BotTag from 'components/widgets/tag/bot_tag'; -import GuestTag from 'components/widgets/tag/guest_tag'; -import Markdown from 'components/markdown'; -import ProfilePicture from 'components/profile_picture'; import {Client4} from 'mattermost-redux/client'; -import {Channel} from '@mattermost/types/channels'; +import Markdown from 'components/markdown'; +import ProfilePicture from 'components/profile_picture'; +import BotTag from 'components/widgets/tag/bot_tag'; +import GuestTag from 'components/widgets/tag/guest_tag'; -import {DMUser} from './channel_info_rhs'; -import LineLimiter from './components/linelimiter'; +import type {DMUser} from './channel_info_rhs'; import EditableArea from './components/editable_area'; +import LineLimiter from './components/linelimiter'; const Username = styled.p` font-family: Metropolis, sans-serif; diff --git a/webapp/channels/src/components/channel_info_rhs/about_area_gm.test.tsx b/webapp/channels/src/components/channel_info_rhs/about_area_gm.test.tsx index ce9e03dfe8..603dbc00ad 100644 --- a/webapp/channels/src/components/channel_info_rhs/about_area_gm.test.tsx +++ b/webapp/channels/src/components/channel_info_rhs/about_area_gm.test.tsx @@ -4,10 +4,11 @@ import React from 'react'; import {Provider} from 'react-redux'; +import type {Channel} from '@mattermost/types/channels'; +import type {UserProfile} from '@mattermost/types/users'; + import {renderWithIntl, screen} from 'tests/react_testing_utils'; import mockStore from 'tests/test_store'; -import {Channel} from '@mattermost/types/channels'; -import {UserProfile} from '@mattermost/types/users'; import AboutAreaGM from './about_area_gm'; diff --git a/webapp/channels/src/components/channel_info_rhs/about_area_gm.tsx b/webapp/channels/src/components/channel_info_rhs/about_area_gm.tsx index 8c7bedae44..681a1048c2 100644 --- a/webapp/channels/src/components/channel_info_rhs/about_area_gm.tsx +++ b/webapp/channels/src/components/channel_info_rhs/about_area_gm.tsx @@ -2,17 +2,18 @@ // See LICENSE.txt for license information. import React from 'react'; -import styled from 'styled-components'; import {useIntl} from 'react-intl'; +import styled from 'styled-components'; + +import type {Channel} from '@mattermost/types/channels'; +import type {UserProfile} from '@mattermost/types/users'; + +import {Client4} from 'mattermost-redux/client'; import Markdown from 'components/markdown'; import ProfilePicture from 'components/profile_picture'; -import {Client4} from 'mattermost-redux/client'; import UserProfileElement from 'components/user_profile'; -import {Channel} from '@mattermost/types/channels'; -import {UserProfile} from '@mattermost/types/users'; - import EditableArea from './components/editable_area'; import LineLimiter from './components/linelimiter'; diff --git a/webapp/channels/src/components/channel_info_rhs/channel_info_rhs.test.tsx b/webapp/channels/src/components/channel_info_rhs/channel_info_rhs.test.tsx index 3804a07b77..1e46250e8c 100644 --- a/webapp/channels/src/components/channel_info_rhs/channel_info_rhs.test.tsx +++ b/webapp/channels/src/components/channel_info_rhs/channel_info_rhs.test.tsx @@ -3,11 +3,11 @@ import React from 'react'; -import {act, renderWithIntl} from 'tests/react_testing_utils'; +import type {Channel, ChannelStats} from '@mattermost/types/channels'; +import type {Team} from '@mattermost/types/teams'; +import type {UserProfile} from '@mattermost/types/users'; -import {Channel, ChannelStats} from '@mattermost/types/channels'; -import {UserProfile} from '@mattermost/types/users'; -import {Team} from '@mattermost/types/teams'; +import {act, renderWithIntl} from 'tests/react_testing_utils'; import ChannelInfoRHS from './channel_info_rhs'; diff --git a/webapp/channels/src/components/channel_info_rhs/channel_info_rhs.tsx b/webapp/channels/src/components/channel_info_rhs/channel_info_rhs.tsx index 7f75970911..289c647f33 100644 --- a/webapp/channels/src/components/channel_info_rhs/channel_info_rhs.tsx +++ b/webapp/channels/src/components/channel_info_rhs/channel_info_rhs.tsx @@ -2,26 +2,27 @@ // See LICENSE.txt for license information. import React, {memo} from 'react'; - import styled from 'styled-components'; -import {getSiteURL} from 'utils/url'; +import type {Channel, ChannelStats} from '@mattermost/types/channels'; +import type {Team} from '@mattermost/types/teams'; +import type {UserProfile} from '@mattermost/types/users'; + import ChannelInviteModal from 'components/channel_invite_modal'; -import {ModalData} from 'types/actions'; -import Constants, {ModalIdentifiers} from 'utils/constants'; -import EditChannelPurposeModal from 'components/edit_channel_purpose_modal'; -import EditChannelHeaderModal from 'components/edit_channel_header_modal'; import ChannelNotificationsModal from 'components/channel_notifications_modal'; +import EditChannelHeaderModal from 'components/edit_channel_header_modal'; +import EditChannelPurposeModal from 'components/edit_channel_purpose_modal'; import MoreDirectChannels from 'components/more_direct_channels'; -import {Channel, ChannelStats} from '@mattermost/types/channels'; -import {UserProfile} from '@mattermost/types/users'; -import {Team} from '@mattermost/types/teams'; +import Constants, {ModalIdentifiers} from 'utils/constants'; +import {getSiteURL} from 'utils/url'; + +import type {ModalData} from 'types/actions'; -import Menu from './menu'; import AboutArea from './about_area'; -import TopButtons from './top_buttons'; import Header from './header'; +import Menu from './menu'; +import TopButtons from './top_buttons'; const Divider = styled.div` width: 88%; diff --git a/webapp/channels/src/components/channel_info_rhs/components/linelimiter.tsx b/webapp/channels/src/components/channel_info_rhs/components/linelimiter.tsx index 3fbadc87e6..a419cb5dbb 100644 --- a/webapp/channels/src/components/channel_info_rhs/components/linelimiter.tsx +++ b/webapp/channels/src/components/channel_info_rhs/components/linelimiter.tsx @@ -2,8 +2,8 @@ // See LICENSE.txt for license information. import React, {useEffect, useRef, useState} from 'react'; -import styled from 'styled-components'; import {CSSTransition} from 'react-transition-group'; +import styled from 'styled-components'; interface LineLimiterProps { children: React.ReactNode; diff --git a/webapp/channels/src/components/channel_info_rhs/header.test.tsx b/webapp/channels/src/components/channel_info_rhs/header.test.tsx index 9a76affafe..4708c844fa 100644 --- a/webapp/channels/src/components/channel_info_rhs/header.test.tsx +++ b/webapp/channels/src/components/channel_info_rhs/header.test.tsx @@ -3,7 +3,8 @@ import React from 'react'; -import {Channel} from '@mattermost/types/channels'; +import type {Channel} from '@mattermost/types/channels'; + import {fireEvent, renderWithIntl, screen} from 'tests/react_testing_utils'; import Header from './header'; diff --git a/webapp/channels/src/components/channel_info_rhs/header.tsx b/webapp/channels/src/components/channel_info_rhs/header.tsx index 82d741079b..5807c266e4 100644 --- a/webapp/channels/src/components/channel_info_rhs/header.tsx +++ b/webapp/channels/src/components/channel_info_rhs/header.tsx @@ -5,13 +5,14 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; import styled from 'styled-components'; -import Constants from 'utils/constants'; +import type {Channel} from '@mattermost/types/channels'; + import LocalizedIcon from 'components/localized_icon'; import OverlayTrigger from 'components/overlay_trigger'; import Tooltip from 'components/tooltip'; -import {t} from 'utils/i18n'; -import {Channel} from '@mattermost/types/channels'; +import Constants from 'utils/constants'; +import {t} from 'utils/i18n'; interface Props { channel: Channel; diff --git a/webapp/channels/src/components/channel_info_rhs/index.ts b/webapp/channels/src/components/channel_info_rhs/index.ts index f30d8ebb8b..50b328e71b 100644 --- a/webapp/channels/src/components/channel_info_rhs/index.ts +++ b/webapp/channels/src/components/channel_info_rhs/index.ts @@ -2,31 +2,31 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {AnyAction, bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {AnyAction, Dispatch} from 'redux'; -import {getCurrentChannel, isCurrentChannelFavorite, isCurrentChannelMuted, isCurrentChannelArchived, getCurrentChannelStats} from 'mattermost-redux/selectors/entities/channels'; -import {isModalOpen} from 'selectors/views/modals'; - -import {closeRightHandSide, showChannelFiles, showChannelMembers, showPinnedPosts} from 'actions/views/rhs'; - -import {GlobalState} from 'types/store'; - -import {Constants, ModalIdentifiers} from 'utils/constants'; - -import {getCurrentUser} from 'mattermost-redux/selectors/entities/common'; -import {getIsMobileView} from 'selectors/views/browser'; -import {getCurrentTeam} from 'mattermost-redux/selectors/entities/teams'; import {unfavoriteChannel, favoriteChannel, getChannelStats} from 'mattermost-redux/actions/channels'; -import {muteChannel, unmuteChannel} from 'actions/channel_actions'; -import {openModal} from 'actions/views/modals'; -import {getDisplayNameByUser, getUserIdFromChannelId} from 'utils/utils'; +import {Permissions} from 'mattermost-redux/constants'; +import {getCurrentChannel, isCurrentChannelFavorite, isCurrentChannelMuted, isCurrentChannelArchived, getCurrentChannelStats} from 'mattermost-redux/selectors/entities/channels'; +import {getCurrentUser} from 'mattermost-redux/selectors/entities/common'; +import {haveIChannelPermission} from 'mattermost-redux/selectors/entities/roles'; +import {getCurrentTeam} from 'mattermost-redux/selectors/entities/teams'; import {getProfilesInCurrentChannel, getStatusForUserId, getUser} from 'mattermost-redux/selectors/entities/users'; import {isGuest} from 'mattermost-redux/utils/user_utils'; -import {haveIChannelPermission} from 'mattermost-redux/selectors/entities/roles'; -import {Permissions} from 'mattermost-redux/constants'; +import {muteChannel, unmuteChannel} from 'actions/channel_actions'; +import {openModal} from 'actions/views/modals'; +import {closeRightHandSide, showChannelFiles, showChannelMembers, showPinnedPosts} from 'actions/views/rhs'; +import {getIsMobileView} from 'selectors/views/browser'; +import {isModalOpen} from 'selectors/views/modals'; -import RHS, {Props} from './channel_info_rhs'; +import {Constants, ModalIdentifiers} from 'utils/constants'; +import {getDisplayNameByUser, getUserIdFromChannelId} from 'utils/utils'; + +import type {GlobalState} from 'types/store'; + +import RHS from './channel_info_rhs'; +import type {Props} from './channel_info_rhs'; const EMPTY_CHANNEL_STATS = { member_count: 0, diff --git a/webapp/channels/src/components/channel_info_rhs/menu.test.tsx b/webapp/channels/src/components/channel_info_rhs/menu.test.tsx index 2532f66ea6..d74641122e 100644 --- a/webapp/channels/src/components/channel_info_rhs/menu.test.tsx +++ b/webapp/channels/src/components/channel_info_rhs/menu.test.tsx @@ -3,6 +3,8 @@ import React from 'react'; +import type {Channel, ChannelStats} from '@mattermost/types/channels'; + import { act, fireEvent, @@ -11,8 +13,6 @@ import { } from 'tests/react_testing_utils'; import Constants from 'utils/constants'; -import {Channel, ChannelStats} from '@mattermost/types/channels'; - import Menu from './menu'; describe('channel_info_rhs/menu', () => { diff --git a/webapp/channels/src/components/channel_info_rhs/menu.tsx b/webapp/channels/src/components/channel_info_rhs/menu.tsx index c298d26e32..61b94c0101 100644 --- a/webapp/channels/src/components/channel_info_rhs/menu.tsx +++ b/webapp/channels/src/components/channel_info_rhs/menu.tsx @@ -2,14 +2,14 @@ // See LICENSE.txt for license information. import React, {useEffect, useState} from 'react'; -import styled from 'styled-components'; import {useIntl} from 'react-intl'; +import styled from 'styled-components'; -import {Constants} from 'utils/constants'; +import type {Channel, ChannelStats} from '@mattermost/types/channels'; import LoadingSpinner from 'components/widgets/loading/loading_spinner'; -import {Channel, ChannelStats} from '@mattermost/types/channels'; +import {Constants} from 'utils/constants'; const MenuItemContainer = styled.div` padding: 8px 16px; diff --git a/webapp/channels/src/components/channel_info_rhs/top_buttons.test.tsx b/webapp/channels/src/components/channel_info_rhs/top_buttons.test.tsx index efa54a4b68..4aef6c3998 100644 --- a/webapp/channels/src/components/channel_info_rhs/top_buttons.test.tsx +++ b/webapp/channels/src/components/channel_info_rhs/top_buttons.test.tsx @@ -6,7 +6,8 @@ import React from 'react'; import {fireEvent, renderWithIntl, screen} from 'tests/react_testing_utils'; import Constants from 'utils/constants'; -import TopButtons, {Props} from './top_buttons'; +import TopButtons from './top_buttons'; +import type {Props} from './top_buttons'; const mockOnCopyTextClick = jest.fn(); jest.mock('../common/hooks/useCopyText', () => { diff --git a/webapp/channels/src/components/channel_info_rhs/top_buttons.tsx b/webapp/channels/src/components/channel_info_rhs/top_buttons.tsx index 447162da3f..9ebacce06f 100644 --- a/webapp/channels/src/components/channel_info_rhs/top_buttons.tsx +++ b/webapp/channels/src/components/channel_info_rhs/top_buttons.tsx @@ -2,11 +2,12 @@ // See LICENSE.txt for license information. import React from 'react'; -import styled from 'styled-components'; import {useIntl, FormattedMessage} from 'react-intl'; +import styled from 'styled-components'; + +import useCopyText from 'components/common/hooks/useCopyText'; import Constants from 'utils/constants'; -import useCopyText from 'components/common/hooks/useCopyText'; const ChannelInfoRhsTopButtons = styled.div` display: flex; diff --git a/webapp/channels/src/components/channel_invite_modal/channel_invite_modal.test.tsx b/webapp/channels/src/components/channel_invite_modal/channel_invite_modal.test.tsx index c87a59ea30..f03e62eb6e 100644 --- a/webapp/channels/src/components/channel_invite_modal/channel_invite_modal.test.tsx +++ b/webapp/channels/src/components/channel_invite_modal/channel_invite_modal.test.tsx @@ -1,18 +1,18 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import {Modal} from 'react-bootstrap'; +import type {Channel} from '@mattermost/types/channels'; +import type {UserProfile} from '@mattermost/types/users'; +import type {RelationOneToOne} from '@mattermost/types/utilities'; + import {General} from 'mattermost-redux/constants'; -import {Value} from 'components/multiselect/multiselect'; import ChannelInviteModal from 'components/channel_invite_modal/channel_invite_modal'; - -import {UserProfile} from '@mattermost/types/users'; -import {Channel} from '@mattermost/types/channels'; -import {RelationOneToOne} from '@mattermost/types/utilities'; +import type {Value} from 'components/multiselect/multiselect'; type UserProfileValue = Value & UserProfile; diff --git a/webapp/channels/src/components/channel_invite_modal/channel_invite_modal.tsx b/webapp/channels/src/components/channel_invite_modal/channel_invite_modal.tsx index 0dc8f37eba..5275e8b69d 100644 --- a/webapp/channels/src/components/channel_invite_modal/channel_invite_modal.tsx +++ b/webapp/channels/src/components/channel_invite_modal/channel_invite_modal.tsx @@ -5,25 +5,25 @@ import React from 'react'; import {Modal} from 'react-bootstrap'; import {FormattedMessage} from 'react-intl'; -import GuestTag from 'components/widgets/tag/guest_tag'; -import BotTag from 'components/widgets/tag/bot_tag'; +import type {Channel} from '@mattermost/types/channels'; +import type {UserProfile} from '@mattermost/types/users'; +import type {RelationOneToOne} from '@mattermost/types/utilities'; import {Client4} from 'mattermost-redux/client'; -import {RelationOneToOne} from '@mattermost/types/utilities'; -import {ActionResult} from 'mattermost-redux/types/actions'; -import {Channel} from '@mattermost/types/channels'; -import {UserProfile} from '@mattermost/types/users'; - +import type {ActionResult} from 'mattermost-redux/types/actions'; import {displayUsername, filterProfilesStartingWithTerm, isGuest} from 'mattermost-redux/utils/user_utils'; -import {localizeMessage} from 'utils/utils'; -import ProfilePicture from 'components/profile_picture'; -import MultiSelect, {Value} from 'components/multiselect/multiselect'; -import AddIcon from 'components/widgets/icons/fa_add_icon'; import InvitationModal from 'components/invitation_modal'; +import MultiSelect from 'components/multiselect/multiselect'; +import type {Value} from 'components/multiselect/multiselect'; +import ProfilePicture from 'components/profile_picture'; import ToggleModalButton from 'components/toggle_modal_button'; +import AddIcon from 'components/widgets/icons/fa_add_icon'; +import BotTag from 'components/widgets/tag/bot_tag'; +import GuestTag from 'components/widgets/tag/guest_tag'; import Constants, {ModalIdentifiers} from 'utils/constants'; +import {localizeMessage} from 'utils/utils'; const USERS_PER_PAGE = 50; const USERS_FROM_DMS = 10; @@ -275,14 +275,13 @@ export default class ChannelInviteModal extends React.PureComponent{displayName} {option.is_bot && } {isGuest(option.roles) && } - {displayName === option.username ? - null : + {displayName === option.username ? null : ( {'@'}{option.username} - } + )} diff --git a/webapp/channels/src/components/channel_invite_modal/index.ts b/webapp/channels/src/components/channel_invite_modal/index.ts index 48358059d0..6b29cd9669 100644 --- a/webapp/channels/src/components/channel_invite_modal/index.ts +++ b/webapp/channels/src/components/channel_invite_modal/index.ts @@ -2,30 +2,29 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; + +import type {UserProfile} from '@mattermost/types/users'; import {getTeamStats} from 'mattermost-redux/actions/teams'; import {getProfilesNotInChannel, getProfilesInChannel, searchProfiles} from 'mattermost-redux/actions/users'; -import {getProfilesNotInCurrentChannel, getProfilesInCurrentChannel, getProfilesNotInCurrentTeam, getProfilesNotInTeam, getUserStatuses, makeGetProfilesNotInChannel, makeGetProfilesInChannel} from 'mattermost-redux/selectors/entities/users'; -import {getTeammateNameDisplaySetting} from 'mattermost-redux/selectors/entities/preferences'; - -import {Action, ActionResult} from 'mattermost-redux/types/actions'; -import {UserProfile} from '@mattermost/types/users'; +import {Permissions} from 'mattermost-redux/constants'; +import {getRecentProfilesFromDMs} from 'mattermost-redux/selectors/entities/channels'; import {getConfig, getLicense} from 'mattermost-redux/selectors/entities/general'; +import {getTeammateNameDisplaySetting} from 'mattermost-redux/selectors/entities/preferences'; import {haveICurrentTeamPermission} from 'mattermost-redux/selectors/entities/roles'; import {getCurrentTeam, getTeam} from 'mattermost-redux/selectors/entities/teams'; -import {Permissions} from 'mattermost-redux/constants'; - -import {Value} from 'components/multiselect/multiselect'; +import {getProfilesNotInCurrentChannel, getProfilesInCurrentChannel, getProfilesNotInCurrentTeam, getProfilesNotInTeam, getUserStatuses, makeGetProfilesNotInChannel, makeGetProfilesInChannel} from 'mattermost-redux/selectors/entities/users'; +import type {Action, ActionResult} from 'mattermost-redux/types/actions'; import {addUsersToChannel} from 'actions/channel_actions'; import {loadStatusesForProfilesList} from 'actions/status_actions'; - import {closeModal} from 'actions/views/modals'; -import {GlobalState} from 'types/store'; +import type {Value} from 'components/multiselect/multiselect'; -import {getRecentProfilesFromDMs} from 'mattermost-redux/selectors/entities/channels'; +import type {GlobalState} from 'types/store'; import ChannelInviteModal from './channel_invite_modal'; diff --git a/webapp/channels/src/components/channel_layout/center_channel/center_channel.test.tsx b/webapp/channels/src/components/channel_layout/center_channel/center_channel.test.tsx index 37d9bdf21e..9b4104457f 100644 --- a/webapp/channels/src/components/channel_layout/center_channel/center_channel.test.tsx +++ b/webapp/channels/src/components/channel_layout/center_channel/center_channel.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import CenterChannel from './center_channel'; diff --git a/webapp/channels/src/components/channel_layout/center_channel/center_channel.tsx b/webapp/channels/src/components/channel_layout/center_channel/center_channel.tsx index e42818c48a..d9879b92ec 100644 --- a/webapp/channels/src/components/channel_layout/center_channel/center_channel.tsx +++ b/webapp/channels/src/components/channel_layout/center_channel/center_channel.tsx @@ -1,15 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import classNames from 'classnames'; import React from 'react'; import {Route, Switch, Redirect} from 'react-router-dom'; -import classNames from 'classnames'; -import LoadingScreen from 'components/loading_screen'; -import PermalinkView from 'components/permalink_view'; +import {makeAsyncComponent} from 'components/async_load'; import ChannelIdentifierRouter from 'components/channel_layout/channel_identifier_router'; import PlaybookRunner from 'components/channel_layout/playbook_runner'; -import {makeAsyncComponent} from 'components/async_load'; +import LoadingScreen from 'components/loading_screen'; +import PermalinkView from 'components/permalink_view'; import type {OwnProps, PropsFromRedux} from './index'; diff --git a/webapp/channels/src/components/channel_layout/center_channel/index.ts b/webapp/channels/src/components/channel_layout/center_channel/index.ts index a62531034f..33c8ee1e1c 100644 --- a/webapp/channels/src/components/channel_layout/center_channel/index.ts +++ b/webapp/channels/src/components/channel_layout/center_channel/index.ts @@ -1,26 +1,29 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {connect, ConnectedProps} from 'react-redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; -import {RouteComponentProps, withRouter} from 'react-router-dom'; +import {connect} from 'react-redux'; +import type {ConnectedProps} from 'react-redux'; +import {withRouter} from 'react-router-dom'; +import type {RouteComponentProps} from 'react-router-dom'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; -import {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; import {getProfiles} from 'mattermost-redux/actions/users'; -import {getTeamByName} from 'mattermost-redux/selectors/entities/teams'; import {getRedirectChannelNameForTeam} from 'mattermost-redux/selectors/entities/channels'; import {isCollapsedThreadsEnabled} from 'mattermost-redux/selectors/entities/preferences'; +import {getTeamByName} from 'mattermost-redux/selectors/entities/teams'; import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users'; +import type {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; -import {getIsMobileView} from 'selectors/views/browser'; -import {getIsRhsOpen, getIsRhsMenuOpen} from 'selectors/rhs'; import {getIsLhsOpen} from 'selectors/lhs'; import {getLastViewedChannelNameByTeamName, getLastViewedTypeByTeamName, getPreviousTeamId, getPreviousTeamLastViewedType} from 'selectors/local_storage'; - -import {GlobalState} from 'types/store'; +import {getIsRhsOpen, getIsRhsMenuOpen} from 'selectors/rhs'; +import {getIsMobileView} from 'selectors/views/browser'; import {PreviousViewedTypes} from 'utils/constants'; +import type {GlobalState} from 'types/store'; + import CenterChannel from './center_channel'; type Params = { diff --git a/webapp/channels/src/components/channel_layout/channel_controller.tsx b/webapp/channels/src/components/channel_layout/channel_controller.tsx index 754d49b432..a6fa5ce0dd 100644 --- a/webapp/channels/src/components/channel_layout/channel_controller.tsx +++ b/webapp/channels/src/components/channel_layout/channel_controller.tsx @@ -1,23 +1,22 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import classNames from 'classnames'; import React, {useEffect} from 'react'; import {useDispatch} from 'react-redux'; -import classNames from 'classnames'; -import {DispatchFunc} from 'mattermost-redux/types/actions'; +import type {DispatchFunc} from 'mattermost-redux/types/actions'; import {loadStatusesForChannelAndSidebar} from 'actions/status_actions'; +import CenterChannel from 'components/channel_layout/center_channel'; +import FaviconTitleHandler from 'components/favicon_title_handler'; +import LoadingScreen from 'components/loading_screen'; +import ProductNoticesModal from 'components/product_notices_modal'; import ResetStatusModal from 'components/reset_status_modal'; import Sidebar from 'components/sidebar'; -import CenterChannel from 'components/channel_layout/center_channel'; -import LoadingScreen from 'components/loading_screen'; -import FaviconTitleHandler from 'components/favicon_title_handler'; -import ProductNoticesModal from 'components/product_notices_modal'; import Pluggable from 'plugins/pluggable'; - import {Constants} from 'utils/constants'; import {isInternetExplorer, isEdge} from 'utils/user_agent'; diff --git a/webapp/channels/src/components/channel_layout/channel_identifier_router/actions.test.ts b/webapp/channels/src/components/channel_layout/channel_identifier_router/actions.test.ts index 74c61411ca..b84e747084 100644 --- a/webapp/channels/src/components/channel_layout/channel_identifier_router/actions.test.ts +++ b/webapp/channels/src/components/channel_layout/channel_identifier_router/actions.test.ts @@ -6,9 +6,9 @@ import nock from 'nock'; import {getChannelByNameAndTeamName, getChannelMember, joinChannel} from 'mattermost-redux/actions/channels'; import {getUserByEmail} from 'mattermost-redux/actions/users'; import {Client4} from 'mattermost-redux/client'; -import TestHelper from 'packages/mattermost-redux/test/test_helper'; import {emitChannelClickEvent} from 'actions/global_actions'; + import { goToChannelByChannelName, goToDirectChannelByUserId, @@ -17,6 +17,8 @@ import { goToDirectChannelByEmail, getPathFromIdentifier, } from 'components/channel_layout/channel_identifier_router/actions'; + +import TestHelper from 'packages/mattermost-redux/test/test_helper'; import mockStore from 'tests/test_store'; import {joinPrivateChannelPrompt} from 'utils/channel_utils'; diff --git a/webapp/channels/src/components/channel_layout/channel_identifier_router/actions.ts b/webapp/channels/src/components/channel_layout/channel_identifier_router/actions.ts index 18ac5b6ff2..3e37a1bdf3 100644 --- a/webapp/channels/src/components/channel_layout/channel_identifier_router/actions.ts +++ b/webapp/channels/src/components/channel_layout/channel_identifier_router/actions.ts @@ -1,27 +1,28 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {History} from 'history'; +import type {History} from 'history'; -import {Client4} from 'mattermost-redux/client'; +import type {Channel} from '@mattermost/types/channels'; +import type {GlobalState} from '@mattermost/types/store'; import {joinChannel, getChannelByNameAndTeamName, getChannelMember, markGroupChannelOpen, fetchMyChannelsAndMembersREST} from 'mattermost-redux/actions/channels'; import {getUser, getUserByUsername, getUserByEmail} from 'mattermost-redux/actions/users'; +import {Client4} from 'mattermost-redux/client'; +import {getChannelByName, getOtherChannels, getChannel, getChannelsNameMapInTeam, getRedirectChannelNameForTeam} from 'mattermost-redux/selectors/entities/channels'; import {getTeamByName} from 'mattermost-redux/selectors/entities/teams'; import {getCurrentUser, getCurrentUserId, getUserByUsername as selectUserByUsername, getUser as selectUser, getUserByEmail as selectUserByEmail} from 'mattermost-redux/selectors/entities/users'; -import {getChannelByName, getOtherChannels, getChannel, getChannelsNameMapInTeam, getRedirectChannelNameForTeam} from 'mattermost-redux/selectors/entities/channels'; -import {GetStateFunc, DispatchFunc, ActionFunc} from 'mattermost-redux/types/actions'; -import {GlobalState} from '@mattermost/types/store'; -import {Channel} from '@mattermost/types/channels'; +import type {GetStateFunc, DispatchFunc, ActionFunc} from 'mattermost-redux/types/actions'; +import * as UserUtils from 'mattermost-redux/utils/user_utils'; import {openDirectChannelToUserId} from 'actions/channel_actions'; import * as GlobalActions from 'actions/global_actions'; + import {joinPrivateChannelPrompt} from 'utils/channel_utils'; import {Constants} from 'utils/constants'; import * as Utils from 'utils/utils'; -import * as UserUtils from 'mattermost-redux/utils/user_utils'; -import {Match, MatchAndHistory} from './channel_identifier_router'; +import type {Match, MatchAndHistory} from './channel_identifier_router'; const LENGTH_OF_ID = 26; const LENGTH_OF_GROUP_ID = 40; diff --git a/webapp/channels/src/components/channel_layout/channel_identifier_router/channel_identifier_router.test.tsx b/webapp/channels/src/components/channel_layout/channel_identifier_router/channel_identifier_router.test.tsx index ae02a208f1..ad3704db05 100644 --- a/webapp/channels/src/components/channel_layout/channel_identifier_router/channel_identifier_router.test.tsx +++ b/webapp/channels/src/components/channel_layout/channel_identifier_router/channel_identifier_router.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import {getHistory} from 'utils/browser_history'; diff --git a/webapp/channels/src/components/channel_layout/channel_identifier_router/channel_identifier_router.tsx b/webapp/channels/src/components/channel_layout/channel_identifier_router/channel_identifier_router.tsx index 4e4ed3b079..47d09677c2 100644 --- a/webapp/channels/src/components/channel_layout/channel_identifier_router/channel_identifier_router.tsx +++ b/webapp/channels/src/components/channel_layout/channel_identifier_router/channel_identifier_router.tsx @@ -4,6 +4,7 @@ import React from 'react'; import ChannelView from 'components/channel_view/index'; + import {getHistory} from 'utils/browser_history'; import Constants from 'utils/constants'; diff --git a/webapp/channels/src/components/channel_layout/channel_identifier_router/index.ts b/webapp/channels/src/components/channel_layout/channel_identifier_router/index.ts index 2361536bce..22e543bb1f 100644 --- a/webapp/channels/src/components/channel_layout/channel_identifier_router/index.ts +++ b/webapp/channels/src/components/channel_layout/channel_identifier_router/index.ts @@ -2,10 +2,11 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {bindActionCreators, Dispatch} from 'redux'; import {withRouter} from 'react-router-dom'; +import {bindActionCreators} from 'redux'; +import type {Dispatch} from 'redux'; -import {GenericAction} from 'mattermost-redux/types/actions'; +import type {GenericAction} from 'mattermost-redux/types/actions'; import {onChannelByIdentifierEnter} from './actions'; import ChannelIdentifierRouter from './channel_identifier_router'; diff --git a/webapp/channels/src/components/channel_layout/playbook_runner.tsx b/webapp/channels/src/components/channel_layout/playbook_runner.tsx index 77799e24c8..4b56dfe79b 100644 --- a/webapp/channels/src/components/channel_layout/playbook_runner.tsx +++ b/webapp/channels/src/components/channel_layout/playbook_runner.tsx @@ -2,20 +2,22 @@ // See LICENSE.txt for license information. import {useEffect} from 'react'; -import {AnyAction, Dispatch} from 'redux'; import {useDispatch, useSelector} from 'react-redux'; import {useRouteMatch} from 'react-router-dom'; +import type {AnyAction, Dispatch} from 'redux'; + +import type {Channel} from '@mattermost/types/channels'; -import {getChannelByTeamIdAndChannelName} from 'mattermost-redux/selectors/entities/channels'; -import {Client4} from 'mattermost-redux/client'; import {IntegrationTypes} from 'mattermost-redux/action_types'; -import {Channel} from '@mattermost/types/channels'; +import {Client4} from 'mattermost-redux/client'; +import {getChannelByTeamIdAndChannelName} from 'mattermost-redux/selectors/entities/channels'; import {getTeamByName} from 'mattermost-redux/selectors/entities/teams'; import {generateId} from 'mattermost-redux/utils/helpers'; import {switchToChannel} from 'actions/views/channel'; import {getLastViewedChannelNameByTeamName} from 'selectors/local_storage'; -import {GlobalState} from 'types/store'; + +import type {GlobalState} from 'types/store'; interface MatchParams { team: string; diff --git a/webapp/channels/src/components/channel_members_dropdown/channel_members_dropdown.test.tsx b/webapp/channels/src/components/channel_members_dropdown/channel_members_dropdown.test.tsx index a7556cfdda..22b3bf4c35 100644 --- a/webapp/channels/src/components/channel_members_dropdown/channel_members_dropdown.test.tsx +++ b/webapp/channels/src/components/channel_members_dropdown/channel_members_dropdown.test.tsx @@ -1,13 +1,16 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; + +import type {Channel, ChannelMembership} from '@mattermost/types/channels'; +import type {UserProfile} from '@mattermost/types/users'; + +import type {ActionResult} from 'mattermost-redux/types/actions'; import ChannelMembersDropdown from 'components/channel_members_dropdown/channel_members_dropdown'; -import {Channel, ChannelMembership} from '@mattermost/types/channels'; -import {UserProfile} from '@mattermost/types/users'; -import {ActionResult} from 'mattermost-redux/types/actions'; + import {mockDispatch} from 'packages/mattermost-redux/test/test_store'; import {ModalIdentifiers} from 'utils/constants'; diff --git a/webapp/channels/src/components/channel_members_dropdown/channel_members_dropdown.tsx b/webapp/channels/src/components/channel_members_dropdown/channel_members_dropdown.tsx index a4750321c7..993f0a5eb7 100644 --- a/webapp/channels/src/components/channel_members_dropdown/channel_members_dropdown.tsx +++ b/webapp/channels/src/components/channel_members_dropdown/channel_members_dropdown.tsx @@ -3,26 +3,25 @@ import React, {useState} from 'react'; import {FormattedMessage} from 'react-intl'; - import {useDispatch} from 'react-redux'; -import {UserProfile} from '@mattermost/types/users'; -import {Channel, ChannelMembership} from '@mattermost/types/channels'; +import type {Channel, ChannelMembership} from '@mattermost/types/channels'; +import type {UserProfile} from '@mattermost/types/users'; +import type {ActionResult} from 'mattermost-redux/types/actions'; import * as UserUtils from 'mattermost-redux/utils/user_utils'; -import {ActionResult} from 'mattermost-redux/types/actions'; + +import LeaveChannelModal from 'components/leave_channel_modal'; +import OverlayTrigger from 'components/overlay_trigger'; +import Tooltip from 'components/tooltip'; +import DropdownIcon from 'components/widgets/icons/fa_dropdown_icon'; +import Menu from 'components/widgets/menu/menu'; +import MenuWrapper from 'components/widgets/menu/menu_wrapper'; import {Constants, ModalIdentifiers} from 'utils/constants'; import * as Utils from 'utils/utils'; -import {ModalData} from 'types/actions'; - -import DropdownIcon from 'components/widgets/icons/fa_dropdown_icon'; -import Menu from 'components/widgets/menu/menu'; -import MenuWrapper from 'components/widgets/menu/menu_wrapper'; -import OverlayTrigger from 'components/overlay_trigger'; -import Tooltip from 'components/tooltip'; -import LeaveChannelModal from 'components/leave_channel_modal'; +import type {ModalData} from 'types/actions'; const ROWS_FROM_BOTTOM_TO_OPEN_UP = 2; diff --git a/webapp/channels/src/components/channel_members_dropdown/index.ts b/webapp/channels/src/components/channel_members_dropdown/index.ts index 55956d74db..d582b9aadd 100644 --- a/webapp/channels/src/components/channel_members_dropdown/index.ts +++ b/webapp/channels/src/components/channel_members_dropdown/index.ts @@ -2,18 +2,22 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {ActionCreatorsMapObject, AnyAction, bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, AnyAction, Dispatch} from 'redux'; + +import type {Channel} from '@mattermost/types/channels'; import {getChannelStats, updateChannelMemberSchemeRoles, removeChannelMember, getChannelMember} from 'mattermost-redux/actions/channels'; -import {haveIChannelPermission} from 'mattermost-redux/selectors/entities/roles'; import {Permissions} from 'mattermost-redux/constants'; +import {haveIChannelPermission} from 'mattermost-redux/selectors/entities/roles'; import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users'; -import {canManageMembers} from 'utils/channel_utils'; -import {GlobalState} from 'types/store'; -import {Channel} from '@mattermost/types/channels'; +import type {Action} from 'mattermost-redux/types/actions'; + import {openModal} from 'actions/views/modals'; -import {Action} from 'mattermost-redux/types/actions'; +import {canManageMembers} from 'utils/channel_utils'; + +import type {GlobalState} from 'types/store'; import ChannelMembersDropdown from './channel_members_dropdown'; diff --git a/webapp/channels/src/components/channel_members_modal/channel_members_modal.test.tsx b/webapp/channels/src/components/channel_members_modal/channel_members_modal.test.tsx index 5da2a608b5..1863bd2caf 100644 --- a/webapp/channels/src/components/channel_members_modal/channel_members_modal.test.tsx +++ b/webapp/channels/src/components/channel_members_modal/channel_members_modal.test.tsx @@ -1,13 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {shallow} from 'enzyme'; import React from 'react'; import {Modal} from 'react-bootstrap'; -import {shallow} from 'enzyme'; -import {ChannelType} from '@mattermost/types/channels'; +import type {ChannelType} from '@mattermost/types/channels'; import ChannelInviteModal from 'components/channel_invite_modal'; + import {ModalIdentifiers} from 'utils/constants'; import ChannelMembersModal from './channel_members_modal'; diff --git a/webapp/channels/src/components/channel_members_modal/channel_members_modal.tsx b/webapp/channels/src/components/channel_members_modal/channel_members_modal.tsx index d861d4ef0d..3cef021298 100644 --- a/webapp/channels/src/components/channel_members_modal/channel_members_modal.tsx +++ b/webapp/channels/src/components/channel_members_modal/channel_members_modal.tsx @@ -5,15 +5,15 @@ import React from 'react'; import {Modal} from 'react-bootstrap'; import {FormattedMessage} from 'react-intl'; -import {Channel} from '@mattermost/types/channels'; +import type {Channel} from '@mattermost/types/channels'; -import MemberListChannel from 'components/member_list_channel'; import ChannelInviteModal from 'components/channel_invite_modal'; - -import {ModalData} from 'types/actions'; +import MemberListChannel from 'components/member_list_channel'; import {ModalIdentifiers} from 'utils/constants'; +import type {ModalData} from 'types/actions'; + type Props = { /** diff --git a/webapp/channels/src/components/channel_members_modal/index.ts b/webapp/channels/src/components/channel_members_modal/index.ts index fc0c74713b..6554c72ce9 100644 --- a/webapp/channels/src/components/channel_members_modal/index.ts +++ b/webapp/channels/src/components/channel_members_modal/index.ts @@ -1,16 +1,17 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators, Dispatch, ActionCreatorsMapObject} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch, ActionCreatorsMapObject} from 'redux'; import {canManageChannelMembers} from 'mattermost-redux/selectors/entities/channels'; -import {Action} from 'mattermost-redux/types/actions'; +import type {Action} from 'mattermost-redux/types/actions'; import {openModal} from 'actions/views/modals'; -import {ModalData} from 'types/actions'; -import {GlobalState} from 'types/store'; +import type {ModalData} from 'types/actions'; +import type {GlobalState} from 'types/store'; import ChannelMembersModal from './channel_members_modal'; diff --git a/webapp/channels/src/components/channel_members_rhs/action_bar.test.tsx b/webapp/channels/src/components/channel_members_rhs/action_bar.test.tsx index ea2eee070e..486feb8376 100644 --- a/webapp/channels/src/components/channel_members_rhs/action_bar.test.tsx +++ b/webapp/channels/src/components/channel_members_rhs/action_bar.test.tsx @@ -6,7 +6,8 @@ import React from 'react'; import {fireEvent, renderWithIntl, screen} from 'tests/react_testing_utils'; import Constants from 'utils/constants'; -import ActionBar, {Props} from './action_bar'; +import ActionBar from './action_bar'; +import type {Props} from './action_bar'; describe('channel_members_rhs/action_bar', () => { const actionBarDefaultProps: Props = { diff --git a/webapp/channels/src/components/channel_members_rhs/channel_members_rhs.tsx b/webapp/channels/src/components/channel_members_rhs/channel_members_rhs.tsx index 730b0b766d..7693113863 100644 --- a/webapp/channels/src/components/channel_members_rhs/channel_members_rhs.tsx +++ b/webapp/channels/src/components/channel_members_rhs/channel_members_rhs.tsx @@ -7,18 +7,19 @@ import {FormattedMessage, useIntl} from 'react-intl'; import {useHistory} from 'react-router-dom'; import styled from 'styled-components'; -import {UserProfile} from '@mattermost/types/users'; -import {Channel, ChannelMembership} from '@mattermost/types/channels'; -import Constants, {ModalIdentifiers} from 'utils/constants'; -import MoreDirectChannels from 'components/more_direct_channels'; -import ChannelInviteModal from 'components/channel_invite_modal'; -import {ModalData} from 'types/actions'; +import type {Channel, ChannelMembership} from '@mattermost/types/channels'; +import type {UserProfile} from '@mattermost/types/users'; import {ProfilesInChannelSortBy} from 'mattermost-redux/actions/users'; import AlertBanner from 'components/alert_banner'; - +import ChannelInviteModal from 'components/channel_invite_modal'; import ExternalLink from 'components/external_link'; +import MoreDirectChannels from 'components/more_direct_channels'; + +import Constants, {ModalIdentifiers} from 'utils/constants'; + +import type {ModalData} from 'types/actions'; import ActionBar from './action_bar'; import Header from './header'; diff --git a/webapp/channels/src/components/channel_members_rhs/header.tsx b/webapp/channels/src/components/channel_members_rhs/header.tsx index 4fc9dbc9ab..2497a7dce3 100644 --- a/webapp/channels/src/components/channel_members_rhs/header.tsx +++ b/webapp/channels/src/components/channel_members_rhs/header.tsx @@ -5,11 +5,13 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; import styled from 'styled-components'; -import Constants from 'utils/constants'; -import {Channel} from '@mattermost/types/channels'; +import type {Channel} from '@mattermost/types/channels'; + import LocalizedIcon from 'components/localized_icon'; import OverlayTrigger from 'components/overlay_trigger'; import Tooltip from 'components/tooltip'; + +import Constants from 'utils/constants'; import {t} from 'utils/i18n'; interface Props { diff --git a/webapp/channels/src/components/channel_members_rhs/index.ts b/webapp/channels/src/components/channel_members_rhs/index.ts index 3ebb828d87..3224baa54e 100644 --- a/webapp/channels/src/components/channel_members_rhs/index.ts +++ b/webapp/channels/src/components/channel_members_rhs/index.ts @@ -2,10 +2,16 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {AnyAction, bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {AnyAction, Dispatch} from 'redux'; +import type {Channel, ChannelMembership} from '@mattermost/types/channels'; +import type {UserProfile} from '@mattermost/types/users'; +import type {RelationOneToOne} from '@mattermost/types/utilities'; + +import {loadMyChannelMemberAndRole} from 'mattermost-redux/actions/channels'; +import {Permissions} from 'mattermost-redux/constants'; import {createSelector} from 'mattermost-redux/selectors/create_selector'; - import { getCurrentChannel, getCurrentChannelStats, @@ -13,30 +19,28 @@ import { getMyCurrentChannelMembership, isCurrentChannelArchived, } from 'mattermost-redux/selectors/entities/channels'; -import {GlobalState} from 'types/store'; -import {Constants, RHSStates} from 'utils/constants'; +import {getTeammateNameDisplaySetting} from 'mattermost-redux/selectors/entities/preferences'; +import {haveIChannelPermission} from 'mattermost-redux/selectors/entities/roles'; import {getCurrentRelativeTeamUrl, getCurrentTeam} from 'mattermost-redux/selectors/entities/teams'; import { getActiveProfilesInCurrentChannelWithoutSorting, getUserStatuses, searchActiveProfilesInCurrentChannel, } from 'mattermost-redux/selectors/entities/users'; -import {haveIChannelPermission} from 'mattermost-redux/selectors/entities/roles'; -import {Permissions} from 'mattermost-redux/constants'; -import {getTeammateNameDisplaySetting} from 'mattermost-redux/selectors/entities/preferences'; import {displayUsername} from 'mattermost-redux/utils/user_utils'; + import {openDirectChannelToUserId} from 'actions/channel_actions'; +import {loadProfilesAndReloadChannelMembers, searchProfilesAndChannelMembers} from 'actions/user_actions'; import {openModal} from 'actions/views/modals'; import {closeRightHandSide, goBack, setEditChannelMembers} from 'actions/views/rhs'; -import {getIsEditingMembers, getPreviousRhsState} from 'selectors/rhs'; import {setChannelMembersRhsSearchTerm} from 'actions/views/search'; -import {loadProfilesAndReloadChannelMembers, searchProfilesAndChannelMembers} from 'actions/user_actions'; -import {Channel, ChannelMembership} from '@mattermost/types/channels'; -import {loadMyChannelMemberAndRole} from 'mattermost-redux/actions/channels'; +import {getIsEditingMembers, getPreviousRhsState} from 'selectors/rhs'; -import {UserProfile} from '@mattermost/types/users'; -import {RelationOneToOne} from '@mattermost/types/utilities'; +import {Constants, RHSStates} from 'utils/constants'; -import RHS, {Props, ChannelMember} from './channel_members_rhs'; +import type {GlobalState} from 'types/store'; + +import RHS from './channel_members_rhs'; +import type {Props, ChannelMember} from './channel_members_rhs'; const buildProfileList = ( profilesInCurrentChannel: UserProfile[], diff --git a/webapp/channels/src/components/channel_members_rhs/member.tsx b/webapp/channels/src/components/channel_members_rhs/member.tsx index eb1110f09a..b305966357 100644 --- a/webapp/channels/src/components/channel_members_rhs/member.tsx +++ b/webapp/channels/src/components/channel_members_rhs/member.tsx @@ -1,31 +1,29 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; -import styled from 'styled-components'; import classNames from 'classnames'; +import React from 'react'; import {FormattedMessage} from 'react-intl'; +import styled from 'styled-components'; -import GuestTag from 'components/widgets/tag/guest_tag'; -import ProfilePopover from 'components/profile_popover'; +import type {Channel} from '@mattermost/types/channels'; +import type {UserProfile} from '@mattermost/types/users'; -import ProfilePicture from 'components/profile_picture'; import {Client4} from 'mattermost-redux/client'; -import ChannelMembersDropdown from 'components/channel_members_dropdown'; +import {isGuest} from 'mattermost-redux/utils/user_utils'; -import OverlayTrigger, {BaseOverlayTrigger} from 'components/overlay_trigger'; +import ChannelMembersDropdown from 'components/channel_members_dropdown'; +import CustomStatusEmoji from 'components/custom_status/custom_status_emoji'; +import OverlayTrigger from 'components/overlay_trigger'; +import type {BaseOverlayTrigger} from 'components/overlay_trigger'; +import ProfilePicture from 'components/profile_picture'; +import ProfilePopover from 'components/profile_popover'; import Tooltip from 'components/tooltip'; +import GuestTag from 'components/widgets/tag/guest_tag'; import Constants from 'utils/constants'; -import {isGuest} from 'mattermost-redux/utils/user_utils'; - -import {Channel} from '@mattermost/types/channels'; -import {UserProfile} from '@mattermost/types/users'; - -import CustomStatusEmoji from 'components/custom_status/custom_status_emoji'; - -import {ChannelMember} from './channel_members_rhs'; +import type {ChannelMember} from './channel_members_rhs'; const Avatar = styled.div` flex-basis: fit-content; diff --git a/webapp/channels/src/components/channel_members_rhs/member_list.tsx b/webapp/channels/src/components/channel_members_rhs/member_list.tsx index bf339b2562..f1547f31f5 100644 --- a/webapp/channels/src/components/channel_members_rhs/member_list.tsx +++ b/webapp/channels/src/components/channel_members_rhs/member_list.tsx @@ -3,14 +3,16 @@ import React, {memo, useEffect, useRef, useState} from 'react'; import AutoSizer from 'react-virtualized-auto-sizer'; -import {VariableSizeList, ListChildComponentProps} from 'react-window'; +import {VariableSizeList} from 'react-window'; +import type {ListChildComponentProps} from 'react-window'; import InfiniteLoader from 'react-window-infinite-loader'; -import {UserProfile} from '@mattermost/types/users'; -import {Channel} from '@mattermost/types/channels'; +import type {Channel} from '@mattermost/types/channels'; +import type {UserProfile} from '@mattermost/types/users'; +import {ListItemType} from './channel_members_rhs'; +import type {ChannelMember, ListItem} from './channel_members_rhs'; import Member from './member'; -import {ChannelMember, ListItem, ListItemType} from './channel_members_rhs'; export interface Props { channel: Channel; diff --git a/webapp/channels/src/components/channel_members_rhs/search.tsx b/webapp/channels/src/components/channel_members_rhs/search.tsx index 776c96a57b..1e08cf8bb4 100644 --- a/webapp/channels/src/components/channel_members_rhs/search.tsx +++ b/webapp/channels/src/components/channel_members_rhs/search.tsx @@ -3,10 +3,9 @@ import React from 'react'; import {useIntl} from 'react-intl'; - import styled from 'styled-components'; -import Input from '../widgets/inputs/input/input'; +import Input from 'components/widgets/inputs/input/input'; interface Props { className?: string; diff --git a/webapp/channels/src/components/channel_move_to_sub_menu/index.tsx b/webapp/channels/src/components/channel_move_to_sub_menu/index.tsx index 14ea825b6c..2173765455 100644 --- a/webapp/channels/src/components/channel_move_to_sub_menu/index.tsx +++ b/webapp/channels/src/components/channel_move_to_sub_menu/index.tsx @@ -1,7 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {memo, MouseEvent, KeyboardEvent} from 'react'; +import React, {memo} from 'react'; +import type {MouseEvent, KeyboardEvent} from 'react'; import {FormattedMessage, useIntl} from 'react-intl'; import {useDispatch, useSelector} from 'react-redux'; @@ -12,29 +13,27 @@ import { ChevronRightIcon, CheckIcon, } from '@mattermost/compass-icons/components'; +import type {ChannelCategory} from '@mattermost/types/channel_categories'; +import type {Channel} from '@mattermost/types/channels'; -import {Channel} from '@mattermost/types/channels'; -import {DispatchFunc} from 'mattermost-redux/types/actions'; -import {ChannelCategory} from '@mattermost/types/channel_categories'; - -import {getCategoryInTeamWithChannel} from 'mattermost-redux/selectors/entities/channel_categories'; -import {getCurrentTeam} from 'mattermost-redux/selectors/entities/teams'; import {CategoryTypes} from 'mattermost-redux/constants/channel_categories'; +import {getCategoryInTeamWithChannel} from 'mattermost-redux/selectors/entities/channel_categories'; import {getAllChannels} from 'mattermost-redux/selectors/entities/channels'; - -import {GlobalState} from 'types/store'; - -import {getCategoriesForCurrentTeam} from 'selectors/views/channel_sidebar'; - -import Constants, {ModalIdentifiers} from 'utils/constants'; +import {getCurrentTeam} from 'mattermost-redux/selectors/entities/teams'; +import type {DispatchFunc} from 'mattermost-redux/types/actions'; import {trackEvent} from 'actions/telemetry_actions'; import {addChannelsInSidebar} from 'actions/views/channel_sidebar'; import {openModal} from 'actions/views/modals'; +import {getCategoriesForCurrentTeam} from 'selectors/views/channel_sidebar'; import EditCategoryModal from 'components/edit_category_modal'; import * as Menu from 'components/menu'; +import Constants, {ModalIdentifiers} from 'utils/constants'; + +import type {GlobalState} from 'types/store'; + type Props = { channel: Channel; inHeaderDropdown?: boolean; diff --git a/webapp/channels/src/components/channel_move_to_sub_menu_old/index.tsx b/webapp/channels/src/components/channel_move_to_sub_menu_old/index.tsx index aa24f4eb3a..efabbfc069 100644 --- a/webapp/channels/src/components/channel_move_to_sub_menu_old/index.tsx +++ b/webapp/channels/src/components/channel_move_to_sub_menu_old/index.tsx @@ -11,30 +11,28 @@ import { StarOutlineIcon, FolderMoveOutlineIcon, } from '@mattermost/compass-icons/components'; +import type {ChannelCategory} from '@mattermost/types/channel_categories'; +import type {Channel} from '@mattermost/types/channels'; -import {Channel} from '@mattermost/types/channels'; -import {DispatchFunc} from 'mattermost-redux/types/actions'; -import {ChannelCategory} from '@mattermost/types/channel_categories'; - -import {getCategoryInTeamWithChannel} from 'mattermost-redux/selectors/entities/channel_categories'; -import {getCurrentTeam} from 'mattermost-redux/selectors/entities/teams'; import {CategoryTypes} from 'mattermost-redux/constants/channel_categories'; +import {getCategoryInTeamWithChannel} from 'mattermost-redux/selectors/entities/channel_categories'; import {getAllChannels} from 'mattermost-redux/selectors/entities/channels'; - -import {GlobalState} from 'types/store'; -import type {Menu as MenuType} from 'types/store/plugins'; - -import {getCategoriesForCurrentTeam} from 'selectors/views/channel_sidebar'; - -import Constants, {ModalIdentifiers} from 'utils/constants'; +import {getCurrentTeam} from 'mattermost-redux/selectors/entities/teams'; +import type {DispatchFunc} from 'mattermost-redux/types/actions'; import {trackEvent} from 'actions/telemetry_actions'; import {addChannelsInSidebar} from 'actions/views/channel_sidebar'; import {openModal} from 'actions/views/modals'; +import {getCategoriesForCurrentTeam} from 'selectors/views/channel_sidebar'; import EditCategoryModal from 'components/edit_category_modal'; import Menu from 'components/widgets/menu/menu'; +import Constants, {ModalIdentifiers} from 'utils/constants'; + +import type {GlobalState} from 'types/store'; +import type {Menu as MenuType} from 'types/store/plugins'; + type Props = { channel: Channel; openUp: boolean; diff --git a/webapp/channels/src/components/channel_notifications_modal/channel_notifications_modal.test.tsx b/webapp/channels/src/components/channel_notifications_modal/channel_notifications_modal.test.tsx index e3b1ee8dc7..b681e4e65a 100644 --- a/webapp/channels/src/components/channel_notifications_modal/channel_notifications_modal.test.tsx +++ b/webapp/channels/src/components/channel_notifications_modal/channel_notifications_modal.test.tsx @@ -1,16 +1,17 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {ComponentProps} from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; +import type {ComponentProps} from 'react'; -import {ChannelAutoFollowThreads, DesktopSound, IgnoreChannelMentions, NotificationLevels, NotificationSections} from 'utils/constants'; -import {TestHelper} from 'utils/test_helper'; +import type {ChannelMembership, ChannelNotifyProps} from '@mattermost/types/channels'; +import type {UserNotifyProps} from '@mattermost/types/users'; import ChannelNotificationsModal from 'components/channel_notifications_modal/channel_notifications_modal'; -import {UserNotifyProps} from '@mattermost/types/users'; -import {ChannelMembership, ChannelNotifyProps} from '@mattermost/types/channels'; +import {ChannelAutoFollowThreads, DesktopSound, IgnoreChannelMentions, NotificationLevels, NotificationSections} from 'utils/constants'; +import {TestHelper} from 'utils/test_helper'; describe('components/channel_notifications_modal/ChannelNotificationsModal', () => { const baseProps: ComponentProps = { diff --git a/webapp/channels/src/components/channel_notifications_modal/channel_notifications_modal.tsx b/webapp/channels/src/components/channel_notifications_modal/channel_notifications_modal.tsx index ed0b160fe1..ca02d81827 100644 --- a/webapp/channels/src/components/channel_notifications_modal/channel_notifications_modal.tsx +++ b/webapp/channels/src/components/channel_notifications_modal/channel_notifications_modal.tsx @@ -6,16 +6,15 @@ import React from 'react'; import {Modal} from 'react-bootstrap'; import {FormattedMessage} from 'react-intl'; -import * as NotificationSounds from 'utils/notification_sounds'; +import type {Channel, ChannelNotifyProps} from '@mattermost/types/channels'; +import type {UserNotifyProps, UserProfile} from '@mattermost/types/users'; import {isChannelMuted} from 'mattermost-redux/utils/channel_utils'; -import {ChannelAutoFollowThreads, DesktopSound, IgnoreChannelMentions, NotificationLevels, NotificationSections} from 'utils/constants'; - import NotificationSection from 'components/channel_notifications_modal/components/notification_section.jsx'; -import {Channel, ChannelNotifyProps} from '@mattermost/types/channels'; -import {UserNotifyProps, UserProfile} from '@mattermost/types/users'; +import {ChannelAutoFollowThreads, DesktopSound, IgnoreChannelMentions, NotificationLevels, NotificationSections} from 'utils/constants'; +import * as NotificationSounds from 'utils/notification_sounds'; import type {PropsFromRedux} from './index'; diff --git a/webapp/channels/src/components/channel_notifications_modal/components/collapse_view.test.tsx b/webapp/channels/src/components/channel_notifications_modal/components/collapse_view.test.tsx index 0b8f529f67..71f5c5c87f 100644 --- a/webapp/channels/src/components/channel_notifications_modal/components/collapse_view.test.tsx +++ b/webapp/channels/src/components/channel_notifications_modal/components/collapse_view.test.tsx @@ -1,13 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; - -import {NotificationLevels, NotificationSections} from 'utils/constants'; +import React from 'react'; import CollapseView from 'components/channel_notifications_modal/components/collapse_view'; +import {NotificationLevels, NotificationSections} from 'utils/constants'; + describe('components/channel_notifications_modal/CollapseView', () => { const baseProps = { section: NotificationSections.DESKTOP, diff --git a/webapp/channels/src/components/channel_notifications_modal/components/describe.test.tsx b/webapp/channels/src/components/channel_notifications_modal/components/describe.test.tsx index 8f7058fdc2..7576ce1d5f 100644 --- a/webapp/channels/src/components/channel_notifications_modal/components/describe.test.tsx +++ b/webapp/channels/src/components/channel_notifications_modal/components/describe.test.tsx @@ -1,13 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; - -import {NotificationLevels, NotificationSections} from 'utils/constants'; +import React from 'react'; import Describe from 'components/channel_notifications_modal/components/describe'; +import {NotificationLevels, NotificationSections} from 'utils/constants'; + describe('components/channel_notifications_modal/NotificationSection', () => { const baseProps = { section: NotificationSections.DESKTOP, diff --git a/webapp/channels/src/components/channel_notifications_modal/components/expand_view.test.tsx b/webapp/channels/src/components/channel_notifications_modal/components/expand_view.test.tsx index 39e13f6817..caec34c4bd 100644 --- a/webapp/channels/src/components/channel_notifications_modal/components/expand_view.test.tsx +++ b/webapp/channels/src/components/channel_notifications_modal/components/expand_view.test.tsx @@ -1,13 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; - -import {NotificationLevels, NotificationSections} from 'utils/constants'; +import React from 'react'; import ExpandView from 'components/channel_notifications_modal/components/expand_view'; +import {NotificationLevels, NotificationSections} from 'utils/constants'; + jest.mock('react-redux', () => ({ ...jest.requireActual('react-redux'), useSelector: jest.fn(), diff --git a/webapp/channels/src/components/channel_notifications_modal/components/expand_view.tsx b/webapp/channels/src/components/channel_notifications_modal/components/expand_view.tsx index 1e586b2707..aff565d2fc 100644 --- a/webapp/channels/src/components/channel_notifications_modal/components/expand_view.tsx +++ b/webapp/channels/src/components/channel_notifications_modal/components/expand_view.tsx @@ -1,20 +1,20 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {ChangeEvent, useMemo, useRef} from 'react'; +import React, {useMemo, useRef} from 'react'; +import type {ChangeEvent} from 'react'; import {FormattedMessage} from 'react-intl'; import {useSelector} from 'react-redux'; +import ReactSelect from 'react-select'; +import type {ValueType} from 'react-select'; -import ReactSelect, {ValueType} from 'react-select'; +import type {ChannelNotifyProps} from '@mattermost/types/channels'; import {isCollapsedThreadsEnabled} from 'mattermost-redux/selectors/entities/preferences'; -import {ChannelAutoFollowThreads, DesktopSound, IgnoreChannelMentions, NotificationLevels, NotificationSections} from 'utils/constants'; - import SettingItemMax from 'components/setting_item_max'; -import {ChannelNotifyProps} from '@mattermost/types/channels'; - +import {ChannelAutoFollowThreads, DesktopSound, IgnoreChannelMentions, NotificationLevels, NotificationSections} from 'utils/constants'; import {notificationSounds} from 'utils/notification_sounds'; import Describe from './describe'; diff --git a/webapp/channels/src/components/channel_notifications_modal/components/extra_info.test.tsx b/webapp/channels/src/components/channel_notifications_modal/components/extra_info.test.tsx index 8412088c34..2d20bc1426 100644 --- a/webapp/channels/src/components/channel_notifications_modal/components/extra_info.test.tsx +++ b/webapp/channels/src/components/channel_notifications_modal/components/extra_info.test.tsx @@ -1,13 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; - -import {NotificationSections} from 'utils/constants'; +import React from 'react'; import ExtraInfo from 'components/channel_notifications_modal/components/extra_info'; +import {NotificationSections} from 'utils/constants'; + describe('components/channel_notifications_modal/ExtraInfo', () => { const baseProps = { section: NotificationSections.DESKTOP, diff --git a/webapp/channels/src/components/channel_notifications_modal/components/notification_section.test.jsx b/webapp/channels/src/components/channel_notifications_modal/components/notification_section.test.jsx index bb35930571..d6e805cad0 100644 --- a/webapp/channels/src/components/channel_notifications_modal/components/notification_section.test.jsx +++ b/webapp/channels/src/components/channel_notifications_modal/components/notification_section.test.jsx @@ -1,13 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; - -import {NotificationLevels, NotificationSections} from 'utils/constants'; +import React from 'react'; import NotificationSection from 'components/channel_notifications_modal/components/notification_section.jsx'; +import {NotificationLevels, NotificationSections} from 'utils/constants'; + describe('components/channel_notifications_modal/NotificationSection', () => { const baseProps = { section: NotificationSections.DESKTOP, diff --git a/webapp/channels/src/components/channel_notifications_modal/components/section_title.test.tsx b/webapp/channels/src/components/channel_notifications_modal/components/section_title.test.tsx index 9d020cb2c0..76f6d45d5e 100644 --- a/webapp/channels/src/components/channel_notifications_modal/components/section_title.test.tsx +++ b/webapp/channels/src/components/channel_notifications_modal/components/section_title.test.tsx @@ -1,13 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; - -import {NotificationSections} from 'utils/constants'; +import React from 'react'; import SectionTitle from 'components/channel_notifications_modal/components/section_title'; +import {NotificationSections} from 'utils/constants'; + describe('components/channel_notifications_modal/ExtraInfo', () => { const baseProps = { section: NotificationSections.DESKTOP, diff --git a/webapp/channels/src/components/channel_notifications_modal/index.ts b/webapp/channels/src/components/channel_notifications_modal/index.ts index 651d3336c5..4984cca2a5 100644 --- a/webapp/channels/src/components/channel_notifications_modal/index.ts +++ b/webapp/channels/src/components/channel_notifications_modal/index.ts @@ -1,17 +1,19 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; -import {connect, ConnectedProps} from 'react-redux'; +import {connect} from 'react-redux'; +import type {ConnectedProps} from 'react-redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; + +import type {ChannelNotifyProps} from '@mattermost/types/channels'; import {updateChannelNotifyProps} from 'mattermost-redux/actions/channels'; -import {getConfig} from 'mattermost-redux/selectors/entities/general'; import {getMyCurrentChannelMembership} from 'mattermost-redux/selectors/entities/channels'; -import {ActionResult} from 'mattermost-redux/types/actions'; +import {getConfig} from 'mattermost-redux/selectors/entities/general'; +import type {ActionResult} from 'mattermost-redux/types/actions'; -import {GlobalState} from 'types/store/index'; - -import {ChannelNotifyProps} from '@mattermost/types/channels'; +import type {GlobalState} from 'types/store/index'; import ChannelNotificationsModal from './channel_notifications_modal'; diff --git a/webapp/channels/src/components/channel_select/channel_select.test.tsx b/webapp/channels/src/components/channel_select/channel_select.test.tsx index 21b0df7bbc..54ac217c5a 100644 --- a/webapp/channels/src/components/channel_select/channel_select.test.tsx +++ b/webapp/channels/src/components/channel_select/channel_select.test.tsx @@ -1,14 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; -import {ChannelType} from '@mattermost/types/channels'; +import type {ChannelType} from '@mattermost/types/channels'; import ChannelSelect from 'components/channel_select/channel_select'; -import Constants from 'utils/constants'; +import Constants from 'utils/constants'; import {TestHelper} from 'utils/test_helper'; describe('components/ChannelSelect', () => { diff --git a/webapp/channels/src/components/channel_select/channel_select.tsx b/webapp/channels/src/components/channel_select/channel_select.tsx index b7c32449d9..ba79b1c6f7 100644 --- a/webapp/channels/src/components/channel_select/channel_select.tsx +++ b/webapp/channels/src/components/channel_select/channel_select.tsx @@ -1,9 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {ChangeEventHandler} from 'react'; +import React from 'react'; +import type {ChangeEventHandler} from 'react'; -import {Channel} from '@mattermost/types/channels'; +import type {Channel} from '@mattermost/types/channels'; import Constants from 'utils/constants'; import * as Utils from 'utils/utils'; diff --git a/webapp/channels/src/components/channel_select/index.ts b/webapp/channels/src/components/channel_select/index.ts index d8f246619d..08d71804dd 100644 --- a/webapp/channels/src/components/channel_select/index.ts +++ b/webapp/channels/src/components/channel_select/index.ts @@ -3,13 +3,13 @@ import {connect} from 'react-redux'; +import type {GlobalState} from '@mattermost/types/store'; + import {createSelector} from 'mattermost-redux/selectors/create_selector'; import {getMyChannels} from 'mattermost-redux/selectors/entities/channels'; import {getCurrentUserLocale} from 'mattermost-redux/selectors/entities/i18n'; import {sortChannelsByTypeAndDisplayName} from 'mattermost-redux/utils/channel_utils'; -import {GlobalState} from '@mattermost/types/store'; - import ChannelSelect from './channel_select'; const getMyChannelsSorted = createSelector( diff --git a/webapp/channels/src/components/channel_selector_modal/channel_selector_modal.test.tsx b/webapp/channels/src/components/channel_selector_modal/channel_selector_modal.test.tsx index 6f81dc742d..3a7c4486e4 100644 --- a/webapp/channels/src/components/channel_selector_modal/channel_selector_modal.test.tsx +++ b/webapp/channels/src/components/channel_selector_modal/channel_selector_modal.test.tsx @@ -1,11 +1,13 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; + +import type {ChannelWithTeamData} from '@mattermost/types/channels'; import ChannelSelectorModal from 'components/channel_selector_modal/channel_selector_modal'; -import {ChannelWithTeamData} from '@mattermost/types/channels'; + import {TestHelper} from 'utils/test_helper'; describe('components/ChannelSelectorModal', () => { diff --git a/webapp/channels/src/components/channel_selector_modal/channel_selector_modal.tsx b/webapp/channels/src/components/channel_selector_modal/channel_selector_modal.tsx index c9b9711541..17e5803601 100644 --- a/webapp/channels/src/components/channel_selector_modal/channel_selector_modal.tsx +++ b/webapp/channels/src/components/channel_selector_modal/channel_selector_modal.tsx @@ -5,17 +5,17 @@ import React from 'react'; import {Modal} from 'react-bootstrap'; import {FormattedMessage} from 'react-intl'; -import {Channel, ChannelSearchOpts, ChannelWithTeamData} from '@mattermost/types/channels'; +import type {Channel, ChannelSearchOpts, ChannelWithTeamData} from '@mattermost/types/channels'; -import {ActionResult} from 'mattermost-redux/types/actions'; +import type {ActionResult} from 'mattermost-redux/types/actions'; + +import FormattedMarkdownMessage from 'components/formatted_markdown_message'; +import MultiSelect from 'components/multiselect/multiselect'; +import type {Value} from 'components/multiselect/multiselect'; import Constants from 'utils/constants'; import {localizeMessage} from 'utils/utils'; -import MultiSelect, {Value} from 'components/multiselect/multiselect'; - -import FormattedMarkdownMessage from 'components/formatted_markdown_message'; - type ChannelWithTeamDataValue = ChannelWithTeamData & Value; type Props = { diff --git a/webapp/channels/src/components/channel_selector_modal/index.ts b/webapp/channels/src/components/channel_selector_modal/index.ts index e3372334d4..90cc9425bc 100644 --- a/webapp/channels/src/components/channel_selector_modal/index.ts +++ b/webapp/channels/src/components/channel_selector_modal/index.ts @@ -2,17 +2,17 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; + +import type {ChannelWithTeamData, ChannelSearchOpts} from '@mattermost/types/channels'; import {getAllChannels as loadChannels, searchAllChannels} from 'mattermost-redux/actions/channels'; - -import {ChannelWithTeamData, ChannelSearchOpts} from '@mattermost/types/channels'; - -import {ActionFunc, ActionResult, GenericAction} from 'mattermost-redux/types/actions'; +import type {ActionFunc, ActionResult, GenericAction} from 'mattermost-redux/types/actions'; import {setModalSearchTerm} from 'actions/views/search'; -import {GlobalState} from '../../types/store'; +import type {GlobalState} from 'types/store'; import ChannelSelectorModal from './channel_selector_modal'; diff --git a/webapp/channels/src/components/channel_view/channel_view.test.tsx b/webapp/channels/src/components/channel_view/channel_view.test.tsx index 14d37572ba..6303676704 100644 --- a/webapp/channels/src/components/channel_view/channel_view.test.tsx +++ b/webapp/channels/src/components/channel_view/channel_view.test.tsx @@ -1,10 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; -import ChannelView, {Props} from './channel_view'; +import ChannelView from './channel_view'; +import type {Props} from './channel_view'; describe('components/channel_view', () => { const baseProps: Props = { diff --git a/webapp/channels/src/components/channel_view/channel_view.tsx b/webapp/channels/src/components/channel_view/channel_view.tsx index 54177a1f2f..e8aea81704 100644 --- a/webapp/channels/src/components/channel_view/channel_view.tsx +++ b/webapp/channels/src/components/channel_view/channel_view.tsx @@ -3,14 +3,14 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {RouteComponentProps} from 'react-router-dom'; +import type {RouteComponentProps} from 'react-router-dom'; -import deferComponentRender from 'components/deferComponentRender'; -import ChannelHeader from 'components/channel_header'; -import FileUploadOverlay from 'components/file_upload_overlay'; -import PostView from 'components/post_view'; -import FormattedMarkdownMessage from 'components/formatted_markdown_message'; import AdvancedCreatePost from 'components/advanced_create_post'; +import ChannelHeader from 'components/channel_header'; +import deferComponentRender from 'components/deferComponentRender'; +import FileUploadOverlay from 'components/file_upload_overlay'; +import FormattedMarkdownMessage from 'components/formatted_markdown_message'; +import PostView from 'components/post_view'; import type {PropsFromRedux} from './index'; diff --git a/webapp/channels/src/components/channel_view/index.ts b/webapp/channels/src/components/channel_view/index.ts index 0f6779b8fa..1bcd38faab 100644 --- a/webapp/channels/src/components/channel_view/index.ts +++ b/webapp/channels/src/components/channel_view/index.ts @@ -1,7 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {connect, ConnectedProps} from 'react-redux'; +import {connect} from 'react-redux'; +import type {ConnectedProps} from 'react-redux'; import {withRouter} from 'react-router-dom'; import {getCurrentChannel, getDirectTeammate} from 'mattermost-redux/selectors/entities/channels'; @@ -11,7 +12,7 @@ import {isFirstAdmin} from 'mattermost-redux/selectors/entities/users'; import {goToLastViewedChannel} from 'actions/views/channel'; -import {GlobalState} from 'types/store'; +import type {GlobalState} from 'types/store'; import ChannelView from './channel_view'; diff --git a/webapp/channels/src/components/choose_different_shipping/index.tsx b/webapp/channels/src/components/choose_different_shipping/index.tsx index 43b810f2e8..e3347099aa 100644 --- a/webapp/channels/src/components/choose_different_shipping/index.tsx +++ b/webapp/channels/src/components/choose_different_shipping/index.tsx @@ -2,7 +2,6 @@ // See LICENSE.txt for license information. import React from 'react'; - import {useIntl} from 'react-intl'; import './choose_different_shipping.scss'; diff --git a/webapp/channels/src/components/claim/claim_controller.tsx b/webapp/channels/src/components/claim/claim_controller.tsx index de38adf741..9f3e87fc46 100644 --- a/webapp/channels/src/components/claim/claim_controller.tsx +++ b/webapp/channels/src/components/claim/claim_controller.tsx @@ -4,15 +4,15 @@ import React from 'react'; import {Route, Switch} from 'react-router-dom'; -import logoImage from 'images/logo.png'; +import type {AuthChangeResponse} from '@mattermost/types/users'; -import {AuthChangeResponse} from '@mattermost/types/users'; - -import BackButton from 'components/common/back_button'; -import OAuthToEmail from 'components/claim/components/oauth_to_email'; +import EmailToLDAP from 'components/claim/components/email_to_ldap'; import EmailToOAuth from 'components/claim/components/email_to_oauth'; import LDAPToEmail from 'components/claim/components/ldap_to_email'; -import EmailToLDAP from 'components/claim/components/email_to_ldap'; +import OAuthToEmail from 'components/claim/components/oauth_to_email'; +import BackButton from 'components/common/back_button'; + +import logoImage from 'images/logo.png'; export interface PasswordConfig { minimumLength: number; diff --git a/webapp/channels/src/components/claim/components/email_to_ldap.tsx b/webapp/channels/src/components/claim/components/email_to_ldap.tsx index b0e861888c..8399054c91 100644 --- a/webapp/channels/src/components/claim/components/email_to_ldap.tsx +++ b/webapp/channels/src/components/claim/components/email_to_ldap.tsx @@ -1,21 +1,20 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import classNames from 'classnames'; import React, {useRef} from 'react'; import {FormattedMessage} from 'react-intl'; -import classNames from 'classnames'; - -import {AuthChangeResponse} from '@mattermost/types/users'; +import type {AuthChangeResponse} from '@mattermost/types/users'; import {emailToLdap} from 'actions/admin_actions.jsx'; -import {localizeMessage} from 'utils/utils'; -import {t} from 'utils/i18n'; -import {ClaimErrors} from 'utils/constants'; - -import LoginMfa from 'components/login/login_mfa'; import LocalizedInput from 'components/localized_input/localized_input'; +import LoginMfa from 'components/login/login_mfa'; + +import {ClaimErrors} from 'utils/constants'; +import {t} from 'utils/i18n'; +import {localizeMessage} from 'utils/utils'; import ErrorLabel from './error_label'; diff --git a/webapp/channels/src/components/claim/components/email_to_oauth.tsx b/webapp/channels/src/components/claim/components/email_to_oauth.tsx index e985106262..d98dcb7b87 100644 --- a/webapp/channels/src/components/claim/components/email_to_oauth.tsx +++ b/webapp/channels/src/components/claim/components/email_to_oauth.tsx @@ -1,23 +1,22 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import classNames from 'classnames'; import React, {useState, useRef} from 'react'; import {FormattedMessage} from 'react-intl'; -import classNames from 'classnames'; - -import {AuthChangeResponse} from '@mattermost/types/users'; +import type {AuthChangeResponse} from '@mattermost/types/users'; import {emailToOAuth} from 'actions/admin_actions.jsx'; -import Constants, {ClaimErrors} from 'utils/constants'; -import {localizeMessage, toTitleCase} from 'utils/utils'; -import {t} from 'utils/i18n'; - -import LoginMfa from 'components/login/login_mfa'; import LocalizedInput from 'components/localized_input/localized_input'; +import LoginMfa from 'components/login/login_mfa'; -import {SubmitOptions} from './email_to_ldap'; +import Constants, {ClaimErrors} from 'utils/constants'; +import {t} from 'utils/i18n'; +import {localizeMessage, toTitleCase} from 'utils/utils'; + +import type {SubmitOptions} from './email_to_ldap'; import ErrorLabel from './error_label'; type Props = { diff --git a/webapp/channels/src/components/claim/components/ldap_to_email.test.tsx b/webapp/channels/src/components/claim/components/ldap_to_email.test.tsx index a68e10ef14..37dbe21a52 100644 --- a/webapp/channels/src/components/claim/components/ldap_to_email.test.tsx +++ b/webapp/channels/src/components/claim/components/ldap_to_email.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import LDAPToEmail from './ldap_to_email'; diff --git a/webapp/channels/src/components/claim/components/ldap_to_email.tsx b/webapp/channels/src/components/claim/components/ldap_to_email.tsx index c4834f9d9e..f82e31eccb 100644 --- a/webapp/channels/src/components/claim/components/ldap_to_email.tsx +++ b/webapp/channels/src/components/claim/components/ldap_to_email.tsx @@ -1,25 +1,24 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import classNames from 'classnames'; import React, {useRef, useState} from 'react'; import {FormattedMessage} from 'react-intl'; -import classNames from 'classnames'; +import type {AuthChangeResponse} from '@mattermost/types/users'; +import LocalizedInput from 'components/localized_input/localized_input'; +import LoginMfa from 'components/login/login_mfa'; + +import {ClaimErrors} from 'utils/constants'; import {t} from 'utils/i18n'; import {isValidPassword, localizeMessage} from 'utils/utils'; -import {ClaimErrors} from 'utils/constants'; -import LoginMfa from 'components/login/login_mfa'; -import LocalizedInput from 'components/localized_input/localized_input'; - -import {PasswordConfig} from '../claim_controller'; - -import {AuthChangeResponse} from '@mattermost/types/users'; - -import {SubmitOptions} from './email_to_ldap'; +import type {SubmitOptions} from './email_to_ldap'; import ErrorLabel from './error_label'; +import type {PasswordConfig} from '../claim_controller'; + type Props = { email: string | null; switchLdapToEmail: (ldapPassword: string, email: string, password: string, token: string) => Promise<{data?: AuthChangeResponse; error?: {server_error_id: string; message: string}}>; diff --git a/webapp/channels/src/components/claim/components/oauth_to_email.tsx b/webapp/channels/src/components/claim/components/oauth_to_email.tsx index cbbff50b65..c5af9d5243 100644 --- a/webapp/channels/src/components/claim/components/oauth_to_email.tsx +++ b/webapp/channels/src/components/claim/components/oauth_to_email.tsx @@ -1,20 +1,20 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import classNames from 'classnames'; import React, {useRef, useState} from 'react'; import {FormattedMessage} from 'react-intl'; -import classNames from 'classnames'; - -import {AuthChangeResponse} from '@mattermost/types/users'; +import type {AuthChangeResponse} from '@mattermost/types/users'; import {oauthToEmail} from 'actions/admin_actions.jsx'; +import LocalizedInput from 'components/localized_input/localized_input'; + import Constants from 'utils/constants'; import {t} from 'utils/i18n'; -import {getPasswordConfig, isValidPassword, localizeMessage, toTitleCase} from 'utils/utils'; - -import LocalizedInput from 'components/localized_input/localized_input'; +import {isValidPassword, localizeMessage, toTitleCase} from 'utils/utils'; +import type {getPasswordConfig} from 'utils/utils'; import ErrorLabel from './error_label'; diff --git a/webapp/channels/src/components/claim/index.ts b/webapp/channels/src/components/claim/index.ts index 271d49f57c..6cd4d1be90 100644 --- a/webapp/channels/src/components/claim/index.ts +++ b/webapp/channels/src/components/claim/index.ts @@ -2,16 +2,19 @@ // See LICENSE.txt for license information. import {connect} from 'react-redux'; -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; + +import type {GlobalState} from '@mattermost/types/store'; import {switchLdapToEmail} from 'mattermost-redux/actions/users'; import {getConfig} from 'mattermost-redux/selectors/entities/general'; -import {GlobalState} from '@mattermost/types/store'; -import {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; +import type {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; import {getPasswordConfig} from 'utils/utils'; -import ClaimController, {Props} from './claim_controller'; +import ClaimController from './claim_controller'; +import type {Props} from './claim_controller'; function mapStateToProps(state: GlobalState) { const config = getConfig(state); diff --git a/webapp/channels/src/components/cloud_effects/index.test.tsx b/webapp/channels/src/components/cloud_effects/index.test.tsx index c5b993f01c..df304cc597 100644 --- a/webapp/channels/src/components/cloud_effects/index.test.tsx +++ b/webapp/channels/src/components/cloud_effects/index.test.tsx @@ -2,18 +2,17 @@ // See LICENSE.txt for license information. import React from 'react'; - import {Provider} from 'react-redux'; +import type {GlobalState} from '@mattermost/types/store'; +import type {DeepPartial} from '@mattermost/types/utilities'; + +import * as useShowAdminLimitReachedHook from 'components/common/hooks/useShowAdminLimitReached'; + import {mountWithIntl} from 'tests/helpers/intl-test-helper'; import mockStore from 'tests/test_store'; -import {DeepPartial} from '@mattermost/types/utilities'; -import {GlobalState} from '@mattermost/types/store'; - import {TestHelper} from 'utils/test_helper'; -import * as useShowAdminLimitReachedHook from 'components/common/hooks/useShowAdminLimitReached'; - import CloudEffectsWrapper from './'; function nonCloudLicense(state: DeepPartial): GlobalState { diff --git a/webapp/channels/src/components/cloud_fetch_error/index.tsx b/webapp/channels/src/components/cloud_fetch_error/index.tsx index 7ba446b661..dfe4d4a52b 100644 --- a/webapp/channels/src/components/cloud_fetch_error/index.tsx +++ b/webapp/channels/src/components/cloud_fetch_error/index.tsx @@ -4,16 +4,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import React from 'react'; - import {FormattedMessage} from 'react-intl'; - import {useDispatch, useSelector} from 'react-redux'; -import {DispatchFunc} from 'mattermost-redux/types/actions'; - -import {retryFailedHostedCustomerFetches} from 'actions/hosted_customer'; -import {retryFailedCloudFetches} from 'actions/cloud'; import {isCurrentLicenseCloud} from 'mattermost-redux/selectors/entities/cloud'; +import type {DispatchFunc} from 'mattermost-redux/types/actions'; + +import {retryFailedCloudFetches} from 'actions/cloud'; +import {retryFailedHostedCustomerFetches} from 'actions/hosted_customer'; import './cloud_fetch_error.scss'; diff --git a/webapp/channels/src/components/cloud_invoice_preview/index.tsx b/webapp/channels/src/components/cloud_invoice_preview/index.tsx index c3680f0e6d..abd767ae5c 100644 --- a/webapp/channels/src/components/cloud_invoice_preview/index.tsx +++ b/webapp/channels/src/components/cloud_invoice_preview/index.tsx @@ -2,21 +2,21 @@ // See LICENSE.txt for license information. import React from 'react'; +import {Modal} from 'react-bootstrap'; import {FormattedMessage} from 'react-intl'; - import {useDispatch, useSelector} from 'react-redux'; -import {Modal} from 'react-bootstrap'; +import {closeModal} from 'actions/views/modals'; +import {isModalOpen} from 'selectors/views/modals'; +import ExternalLink from 'components/external_link'; import PDFPreview from 'components/pdf_preview'; -import {closeModal} from 'actions/views/modals'; import {ModalIdentifiers} from 'utils/constants'; -import {isModalOpen} from 'selectors/views/modals'; -import {GlobalState} from 'types/store'; + +import type {GlobalState} from 'types/store'; import './cloud_invoice_preview.scss'; -import ExternalLink from 'components/external_link'; type Props = { onHide?: () => void; diff --git a/webapp/channels/src/components/cloud_start_trial/cloud_start_trial_btn.test.tsx b/webapp/channels/src/components/cloud_start_trial/cloud_start_trial_btn.test.tsx index ba2903e5a0..6212178d56 100644 --- a/webapp/channels/src/components/cloud_start_trial/cloud_start_trial_btn.test.tsx +++ b/webapp/channels/src/components/cloud_start_trial/cloud_start_trial_btn.test.tsx @@ -1,21 +1,17 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import type {ReactWrapper} from 'enzyme'; +import {shallow} from 'enzyme'; import React from 'react'; - -import {ReactWrapper, shallow} from 'enzyme'; - +import {act} from 'react-dom/test-utils'; import {Provider} from 'react-redux'; -import {act} from 'react-dom/test-utils'; - import * as cloudActions from 'actions/cloud'; +import {trackEvent} from 'actions/telemetry_actions.jsx'; import {mountWithIntl} from 'tests/helpers/intl-test-helper'; import mockStore from 'tests/test_store'; - -import {trackEvent} from 'actions/telemetry_actions.jsx'; - import {TELEMETRY_CATEGORIES} from 'utils/constants'; import CloudStartTrialButton from './cloud_start_trial_btn'; diff --git a/webapp/channels/src/components/cloud_start_trial/cloud_start_trial_btn.tsx b/webapp/channels/src/components/cloud_start_trial/cloud_start_trial_btn.tsx index f511e36bb7..d441dcb99e 100644 --- a/webapp/channels/src/components/cloud_start_trial/cloud_start_trial_btn.tsx +++ b/webapp/channels/src/components/cloud_start_trial/cloud_start_trial_btn.tsx @@ -1,24 +1,25 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {useEffect, useState, ReactNode} from 'react'; +import React, {useEffect, useState} from 'react'; +import type {ReactNode} from 'react'; import {useIntl} from 'react-intl'; import {useDispatch} from 'react-redux'; -import {DispatchFunc} from 'mattermost-redux/types/actions'; - -import useGetSubscription from 'components/common/hooks/useGetSubscription'; +import type {DispatchFunc} from 'mattermost-redux/types/actions'; import {requestCloudTrial, validateWorkspaceBusinessEmail, getCloudLimits} from 'actions/cloud'; import {trackEvent} from 'actions/telemetry_actions'; import {openModal, closeModal} from 'actions/views/modals'; -import TrialBenefitsModal from 'components/trial_benefits_modal/trial_benefits_modal'; +import useGetSubscription from 'components/common/hooks/useGetSubscription'; import ExternalLink from 'components/external_link'; +import TrialBenefitsModal from 'components/trial_benefits_modal/trial_benefits_modal'; import {ModalIdentifiers, TELEMETRY_CATEGORIES, LicenseLinks} from 'utils/constants'; import RequestBusinessEmailModal from './request_business_email_modal'; + import './cloud_start_trial_btn.scss'; export type CloudStartTrialBtnProps = { diff --git a/webapp/channels/src/components/cloud_start_trial/input_business_email.test.tsx b/webapp/channels/src/components/cloud_start_trial/input_business_email.test.tsx index fbfe60d3f3..1baaf340cb 100644 --- a/webapp/channels/src/components/cloud_start_trial/input_business_email.test.tsx +++ b/webapp/channels/src/components/cloud_start_trial/input_business_email.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {mount, shallow} from 'enzyme'; +import React from 'react'; import {ItemStatus} from 'utils/constants'; diff --git a/webapp/channels/src/components/cloud_start_trial/input_business_email.tsx b/webapp/channels/src/components/cloud_start_trial/input_business_email.tsx index 1556f33ee6..2c5404f0d1 100644 --- a/webapp/channels/src/components/cloud_start_trial/input_business_email.tsx +++ b/webapp/channels/src/components/cloud_start_trial/input_business_email.tsx @@ -4,7 +4,8 @@ import React from 'react'; import {useIntl} from 'react-intl'; -import Input, {CustomMessageInputType} from 'components/widgets/inputs/input/input'; +import Input from 'components/widgets/inputs/input/input'; +import type {CustomMessageInputType} from 'components/widgets/inputs/input/input'; interface InputBusinessEmailProps { email: string; handleEmailValues: (e: React.ChangeEvent) => void; diff --git a/webapp/channels/src/components/cloud_start_trial/request_business_email_modal.test.tsx b/webapp/channels/src/components/cloud_start_trial/request_business_email_modal.test.tsx index b8c98c470a..b05ed5d4ef 100644 --- a/webapp/channels/src/components/cloud_start_trial/request_business_email_modal.test.tsx +++ b/webapp/channels/src/components/cloud_start_trial/request_business_email_modal.test.tsx @@ -1,17 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; - -import {Provider} from 'react-redux'; -import {act} from 'react-dom/test-utils'; - import {shallow} from 'enzyme'; - -import * as cloudActions from 'actions/cloud'; +import React from 'react'; +import {act} from 'react-dom/test-utils'; +import {Provider} from 'react-redux'; import {GenericModal} from '@mattermost/components'; +import * as cloudActions from 'actions/cloud'; + import {mountWithIntl} from 'tests/helpers/intl-test-helper'; import mockStore from 'tests/test_store'; diff --git a/webapp/channels/src/components/cloud_start_trial/request_business_email_modal.tsx b/webapp/channels/src/components/cloud_start_trial/request_business_email_modal.tsx index bd40be93c5..7638730c91 100644 --- a/webapp/channels/src/components/cloud_start_trial/request_business_email_modal.tsx +++ b/webapp/channels/src/components/cloud_start_trial/request_business_email_modal.tsx @@ -1,27 +1,25 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {debounce} from 'lodash'; import React, {useCallback, useEffect, useState} from 'react'; +import {FormattedMessage, useIntl} from 'react-intl'; import {useDispatch} from 'react-redux'; -import {FormattedMessage, useIntl} from 'react-intl'; +import {GenericModal} from '@mattermost/components'; -import {debounce} from 'lodash'; - -import {DispatchFunc} from 'mattermost-redux/types/actions'; +import type {DispatchFunc} from 'mattermost-redux/types/actions'; +import {isEmail} from 'mattermost-redux/utils/helpers'; +import {validateBusinessEmail} from 'actions/cloud'; import {trackEvent} from 'actions/telemetry_actions'; import {closeModal} from 'actions/views/modals'; -import {validateBusinessEmail} from 'actions/cloud'; + +import ExternalLink from 'components/external_link'; +import type {CustomMessageInputType} from 'components/widgets/inputs/input/input'; import {ItemStatus, TELEMETRY_CATEGORIES, ModalIdentifiers, LicenseLinks, AboutLinks} from 'utils/constants'; -import {GenericModal} from '@mattermost/components'; -import {CustomMessageInputType} from 'components/widgets/inputs/input/input'; -import ExternalLink from 'components/external_link'; - -import {isEmail} from 'mattermost-redux/utils/helpers'; - import StartCloudTrialBtn from './cloud_start_trial_btn'; import InputBusinessEmail from './input_business_email'; diff --git a/webapp/channels/src/components/cloud_subscribe_result_modal/error.tsx b/webapp/channels/src/components/cloud_subscribe_result_modal/error.tsx index 2340430c02..9ddc0b0106 100644 --- a/webapp/channels/src/components/cloud_subscribe_result_modal/error.tsx +++ b/webapp/channels/src/components/cloud_subscribe_result_modal/error.tsx @@ -3,22 +3,21 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; - import {useDispatch, useSelector} from 'react-redux'; import {getSubscriptionProduct} from 'mattermost-redux/selectors/entities/cloud'; -import PaymentFailedSvg from 'components/common/svg_images_components/payment_failed_svg'; - -import IconMessage from 'components/purchase_modal/icon_message'; - -import FullScreenModal from 'components/widgets/modals/full_screen_modal'; -import {useOpenCloudZendeskSupportForm} from 'components/common/hooks/useOpenZendeskForm'; - import {closeModal} from 'actions/views/modals'; -import {ModalIdentifiers} from 'utils/constants'; import {isModalOpen} from 'selectors/views/modals'; -import {GlobalState} from 'types/store'; + +import {useOpenCloudZendeskSupportForm} from 'components/common/hooks/useOpenZendeskForm'; +import PaymentFailedSvg from 'components/common/svg_images_components/payment_failed_svg'; +import IconMessage from 'components/purchase_modal/icon_message'; +import FullScreenModal from 'components/widgets/modals/full_screen_modal'; + +import {ModalIdentifiers} from 'utils/constants'; + +import type {GlobalState} from 'types/store'; import './style.scss'; diff --git a/webapp/channels/src/components/cloud_subscribe_result_modal/success.test.tsx b/webapp/channels/src/components/cloud_subscribe_result_modal/success.test.tsx index 96143faae1..a379bea37d 100644 --- a/webapp/channels/src/components/cloud_subscribe_result_modal/success.test.tsx +++ b/webapp/channels/src/components/cloud_subscribe_result_modal/success.test.tsx @@ -2,7 +2,6 @@ // See LICENSE.txt for license information. import React from 'react'; - import * as redux from 'react-redux'; import {mountWithIntl} from 'tests/helpers/intl-test-helper'; diff --git a/webapp/channels/src/components/cloud_subscribe_result_modal/success.tsx b/webapp/channels/src/components/cloud_subscribe_result_modal/success.tsx index c991d74bc6..9710bd76ca 100644 --- a/webapp/channels/src/components/cloud_subscribe_result_modal/success.tsx +++ b/webapp/channels/src/components/cloud_subscribe_result_modal/success.tsx @@ -3,21 +3,20 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; - import {useDispatch, useSelector} from 'react-redux'; import {getSubscriptionProduct} from 'mattermost-redux/selectors/entities/cloud'; +import {closeModal} from 'actions/views/modals'; +import {isModalOpen} from 'selectors/views/modals'; + import PaymentSuccessStandardSvg from 'components/common/svg_images_components/payment_success_standard_svg'; - import IconMessage from 'components/purchase_modal/icon_message'; - import FullScreenModal from 'components/widgets/modals/full_screen_modal'; -import {closeModal} from 'actions/views/modals'; import {ModalIdentifiers} from 'utils/constants'; -import {isModalOpen} from 'selectors/views/modals'; -import {GlobalState} from 'types/store'; + +import type {GlobalState} from 'types/store'; import './style.scss'; diff --git a/webapp/channels/src/components/cloud_usage_modal/index.test.tsx b/webapp/channels/src/components/cloud_usage_modal/index.test.tsx index 95163f085d..fc230a320d 100644 --- a/webapp/channels/src/components/cloud_usage_modal/index.test.tsx +++ b/webapp/channels/src/components/cloud_usage_modal/index.test.tsx @@ -2,21 +2,19 @@ // See LICENSE.txt for license information. import React from 'react'; - import * as redux from 'react-redux'; import {Provider} from 'react-redux'; +import type {Subscription} from '@mattermost/types/cloud'; +import type {GlobalState} from '@mattermost/types/store'; + import {renderWithIntl, screen} from 'tests/react_testing_utils'; import mockStore from 'tests/test_store'; +import {Constants} from 'utils/constants'; import {FileSizes} from 'utils/file_utils'; -import {Constants} from 'utils/constants'; - -import {GlobalState} from '@mattermost/types/store'; - -import {Subscription} from '@mattermost/types/cloud'; - -import CloudUsageModal, {Props} from './index'; +import CloudUsageModal from './index'; +import type {Props} from './index'; const freeLimits = { messages: { diff --git a/webapp/channels/src/components/cloud_usage_modal/index.tsx b/webapp/channels/src/components/cloud_usage_modal/index.tsx index 6c1021f050..40018cae01 100644 --- a/webapp/channels/src/components/cloud_usage_modal/index.tsx +++ b/webapp/channels/src/components/cloud_usage_modal/index.tsx @@ -2,19 +2,18 @@ // See LICENSE.txt for license information. import React from 'react'; - import {useSelector} from 'react-redux'; +import {GenericModal} from '@mattermost/components'; +import type {Limits} from '@mattermost/types/cloud'; + import {getTheme} from 'mattermost-redux/selectors/entities/preferences'; -import {Message} from 'utils/i18n'; - -import CompassThemeProvider from 'components/compass_theme_provider/compass_theme_provider'; -import {GenericModal} from '@mattermost/components'; import useGetLimits from 'components/common/hooks/useGetLimits'; import useGetUsage from 'components/common/hooks/useGetUsage'; +import CompassThemeProvider from 'components/compass_theme_provider/compass_theme_provider'; -import {Limits} from '@mattermost/types/cloud'; +import type {Message} from 'utils/i18n'; import WorkspaceLimitsPanel, {messageToElement} from './workspace_limits_panel'; diff --git a/webapp/channels/src/components/cloud_usage_modal/lhs_nearing_limit_modal.tsx b/webapp/channels/src/components/cloud_usage_modal/lhs_nearing_limit_modal.tsx index e8fd43493c..24feaf3182 100644 --- a/webapp/channels/src/components/cloud_usage_modal/lhs_nearing_limit_modal.tsx +++ b/webapp/channels/src/components/cloud_usage_modal/lhs_nearing_limit_modal.tsx @@ -2,24 +2,23 @@ // See LICENSE.txt for license information. import React from 'react'; - import {useIntl} from 'react-intl'; - import {useDispatch, useSelector} from 'react-redux'; import {getSubscriptionProduct} from 'mattermost-redux/selectors/entities/cloud'; import {closeModal} from 'actions/views/modals'; -import {ModalIdentifiers} from 'utils/constants'; -import {t, Message} from 'utils/i18n'; -import {fallbackStarterLimits, asGBString, LimitTypes} from 'utils/limits'; - import useGetHighestThresholdCloudLimit from 'components/common/hooks/useGetHighestThresholdCloudLimit'; -import useGetUsage from 'components/common/hooks/useGetUsage'; import useGetLimits from 'components/common/hooks/useGetLimits'; +import useGetUsage from 'components/common/hooks/useGetUsage'; import useOpenPricingModal from 'components/common/hooks/useOpenPricingModal'; +import {ModalIdentifiers} from 'utils/constants'; +import {t} from 'utils/i18n'; +import type {Message} from 'utils/i18n'; +import {fallbackStarterLimits, asGBString, LimitTypes} from 'utils/limits'; + import CloudUsageModal from './index'; export default function LHSNearingLimitsModal() { diff --git a/webapp/channels/src/components/cloud_usage_modal/workspace_limits_panel.tsx b/webapp/channels/src/components/cloud_usage_modal/workspace_limits_panel.tsx index 3a6da3b198..00c32ba041 100644 --- a/webapp/channels/src/components/cloud_usage_modal/workspace_limits_panel.tsx +++ b/webapp/channels/src/components/cloud_usage_modal/workspace_limits_panel.tsx @@ -4,10 +4,10 @@ import React from 'react'; import {FormattedMessage, useIntl} from 'react-intl'; -import {CloudUsage, Limits} from '@mattermost/types/cloud'; -import {asGBString, inK} from 'utils/limits'; +import type {CloudUsage, Limits} from '@mattermost/types/cloud'; -import {Message} from 'utils/i18n'; +import type {Message} from 'utils/i18n'; +import {asGBString, inK} from 'utils/limits'; import LimitLine from './limit_line'; diff --git a/webapp/channels/src/components/code_block/code_block.test.tsx b/webapp/channels/src/components/code_block/code_block.test.tsx index 4483a5a061..677d08ded7 100644 --- a/webapp/channels/src/components/code_block/code_block.test.tsx +++ b/webapp/channels/src/components/code_block/code_block.test.tsx @@ -1,7 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {mount, ReactWrapper} from 'enzyme'; +import type {ReactWrapper} from 'enzyme'; +import {mount} from 'enzyme'; import React from 'react'; import {act} from 'react-dom/test-utils'; import {IntlProvider} from 'react-intl'; diff --git a/webapp/channels/src/components/code_block/code_block.tsx b/webapp/channels/src/components/code_block/code_block.tsx index 89138a77ab..88e2297ac1 100644 --- a/webapp/channels/src/components/code_block/code_block.tsx +++ b/webapp/channels/src/components/code_block/code_block.tsx @@ -2,17 +2,15 @@ // See LICENSE.txt for license information. import React, {useCallback, useEffect, useState} from 'react'; - import {useSelector} from 'react-redux'; -import {GlobalState} from 'types/store'; - import CopyButton from 'components/copy_button'; import * as SyntaxHighlighting from 'utils/syntax_highlighting'; - import * as TextFormatting from 'utils/text_formatting'; +import type {GlobalState} from 'types/store'; + type Props = { code: string; language: string; diff --git a/webapp/channels/src/components/code_preview.tsx b/webapp/channels/src/components/code_preview.tsx index dfdcd6e90e..669016e4d1 100644 --- a/webapp/channels/src/components/code_preview.tsx +++ b/webapp/channels/src/components/code_preview.tsx @@ -3,15 +3,15 @@ import React from 'react'; +import type {FileInfo} from '@mattermost/types/files'; + +import FileInfoPreview from 'components/file_info_preview'; +import LoadingSpinner from 'components/widgets/loading/loading_spinner'; + import Constants from 'utils/constants'; import * as SyntaxHighlighting from 'utils/syntax_highlighting'; -import LoadingSpinner from 'components/widgets/loading/loading_spinner'; -import FileInfoPreview from 'components/file_info_preview'; - -import {FileInfo} from '@mattermost/types/files'; - -import {LinkInfo} from './file_preview_modal/types'; +import type {LinkInfo} from './file_preview_modal/types'; type Props = { fileInfo: FileInfo; diff --git a/webapp/channels/src/components/color_input.test.tsx b/webapp/channels/src/components/color_input.test.tsx index 5ab54882d2..ad36b67e9e 100644 --- a/webapp/channels/src/components/color_input.test.tsx +++ b/webapp/channels/src/components/color_input.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import ColorInput from './color_input'; diff --git a/webapp/channels/src/components/color_input.tsx b/webapp/channels/src/components/color_input.tsx index 5c16234e2f..f305b02e1a 100644 --- a/webapp/channels/src/components/color_input.tsx +++ b/webapp/channels/src/components/color_input.tsx @@ -2,7 +2,8 @@ // See LICENSE.txt for license information. import React from 'react'; -import {ChromePicker, ColorResult} from 'react-color'; +import {ChromePicker} from 'react-color'; +import type {ColorResult} from 'react-color'; import tinycolor from 'tinycolor2'; type Props = { diff --git a/webapp/channels/src/components/commercial_support_modal/commercial_support_modal.test.tsx b/webapp/channels/src/components/commercial_support_modal/commercial_support_modal.test.tsx index 0fd8856c50..0126c12d88 100644 --- a/webapp/channels/src/components/commercial_support_modal/commercial_support_modal.test.tsx +++ b/webapp/channels/src/components/commercial_support_modal/commercial_support_modal.test.tsx @@ -1,10 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import CommercialSupportModal from 'components/commercial_support_modal/commercial_support_modal'; + import {TestHelper} from 'utils/test_helper'; describe('components/CommercialSupportModal', () => { diff --git a/webapp/channels/src/components/commercial_support_modal/commercial_support_modal.tsx b/webapp/channels/src/components/commercial_support_modal/commercial_support_modal.tsx index ab763acb45..0b477c6e90 100644 --- a/webapp/channels/src/components/commercial_support_modal/commercial_support_modal.tsx +++ b/webapp/channels/src/components/commercial_support_modal/commercial_support_modal.tsx @@ -5,8 +5,9 @@ import React from 'react'; import {Modal} from 'react-bootstrap'; import {FormattedMessage} from 'react-intl'; +import type {UserProfile} from '@mattermost/types/users'; + import {Client4} from 'mattermost-redux/client'; -import {UserProfile} from '@mattermost/types/users'; import AlertBanner from 'components/alert_banner'; import FormattedMarkdownMessage from 'components/formatted_markdown_message'; @@ -64,8 +65,7 @@ export default class CommercialSupportModal extends React.PureComponent void; diff --git a/webapp/channels/src/components/common/hocs/cloud/with_open_start_trial_form_modal.tsx b/webapp/channels/src/components/common/hocs/cloud/with_open_start_trial_form_modal.tsx index bbfcc533b3..bb3e3cb525 100644 --- a/webapp/channels/src/components/common/hocs/cloud/with_open_start_trial_form_modal.tsx +++ b/webapp/channels/src/components/common/hocs/cloud/with_open_start_trial_form_modal.tsx @@ -1,7 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {ComponentType} from 'react'; +import React from 'react'; +import type {ComponentType} from 'react'; import useOpenStartTrialFormModal from 'components/common/hooks/useOpenStartTrialFormModal'; diff --git a/webapp/channels/src/components/common/hocs/cloud/with_use_get_usage_deltas.test.tsx b/webapp/channels/src/components/common/hocs/cloud/with_use_get_usage_deltas.test.tsx index 8639420f97..ce652f6072 100644 --- a/webapp/channels/src/components/common/hocs/cloud/with_use_get_usage_deltas.test.tsx +++ b/webapp/channels/src/components/common/hocs/cloud/with_use_get_usage_deltas.test.tsx @@ -1,8 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {ComponentType} from 'react'; import {mount} from 'enzyme'; +import React from 'react'; +import type {ComponentType} from 'react'; import withUseGetUsageDeltas from './with_use_get_usage_deltas'; diff --git a/webapp/channels/src/components/common/hocs/cloud/with_use_get_usage_deltas.tsx b/webapp/channels/src/components/common/hocs/cloud/with_use_get_usage_deltas.tsx index d0c00c8153..a450f3c0e0 100644 --- a/webapp/channels/src/components/common/hocs/cloud/with_use_get_usage_deltas.tsx +++ b/webapp/channels/src/components/common/hocs/cloud/with_use_get_usage_deltas.tsx @@ -1,7 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {ComponentType} from 'react'; +import React from 'react'; +import type {ComponentType} from 'react'; import useGetUsageDeltas from 'components/common/hooks/useGetUsageDeltas'; diff --git a/webapp/channels/src/components/common/hooks/useCanSelfHostedExpand.ts b/webapp/channels/src/components/common/hooks/useCanSelfHostedExpand.ts index 1488713947..d82d2cfcc6 100644 --- a/webapp/channels/src/components/common/hooks/useCanSelfHostedExpand.ts +++ b/webapp/channels/src/components/common/hooks/useCanSelfHostedExpand.ts @@ -5,13 +5,12 @@ import {useEffect, useState} from 'react'; import {useSelector} from 'react-redux'; import {Client4} from 'mattermost-redux/client'; -import {getConfig, getLicense} from 'mattermost-redux/selectors/entities/general'; import {getSubscriptionProduct} from 'mattermost-redux/selectors/entities/cloud'; +import {getConfig, getLicense} from 'mattermost-redux/selectors/entities/general'; + import {BillingSchemes, SelfHostedProducts} from 'utils/constants'; - -import {isCloudLicense} from 'utils/license_utils'; - import {findSelfHostedProductBySku} from 'utils/hosted_customer'; +import {isCloudLicense} from 'utils/license_utils'; import useGetSelfHostedProducts from './useGetSelfHostedProducts'; diff --git a/webapp/channels/src/components/common/hooks/useControlModal.ts b/webapp/channels/src/components/common/hooks/useControlModal.ts index 55c2a45b33..7a8a4af506 100644 --- a/webapp/channels/src/components/common/hooks/useControlModal.ts +++ b/webapp/channels/src/components/common/hooks/useControlModal.ts @@ -4,12 +4,15 @@ import {useMemo} from 'react'; import {useDispatch} from 'react-redux'; -import {ModalData} from 'types/actions'; import {openModal, closeModal} from 'actions/views/modals'; -import {ModalIdentifiers} from 'utils/constants'; + import AirGappedSelfHostedPurchaseModal from 'components/air_gapped_self_hosted_purchase_modal'; import ScreeningInProgressModal from 'components/screening_in_progress_modal'; +import {ModalIdentifiers} from 'utils/constants'; + +import type {ModalData} from 'types/actions'; + export interface ControlModal { open: () => void; close: () => void; diff --git a/webapp/channels/src/components/common/hooks/useControlSelfHostedExpansionModal.ts b/webapp/channels/src/components/common/hooks/useControlSelfHostedExpansionModal.ts index b16eeb187f..51a4162a2c 100644 --- a/webapp/channels/src/components/common/hooks/useControlSelfHostedExpansionModal.ts +++ b/webapp/channels/src/components/common/hooks/useControlSelfHostedExpansionModal.ts @@ -4,18 +4,21 @@ import {useMemo} from 'react'; import {useDispatch, useSelector} from 'react-redux'; -import {trackEvent} from 'actions/telemetry_actions'; -import {openModal} from 'actions/views/modals'; -import {ModalIdentifiers, TELEMETRY_CATEGORIES} from 'utils/constants'; -import PurchaseInProgressModal from 'components/purchase_in_progress_modal'; +import {HostedCustomerTypes} from 'mattermost-redux/action_types'; import {Client4} from 'mattermost-redux/client'; import {getCurrentUser} from 'mattermost-redux/selectors/entities/common'; -import {HostedCustomerTypes} from 'mattermost-redux/action_types'; +import {trackEvent} from 'actions/telemetry_actions'; +import {openModal} from 'actions/views/modals'; + +import PurchaseInProgressModal from 'components/purchase_in_progress_modal'; import {STORAGE_KEY_EXPANSION_IN_PROGRESS} from 'components/self_hosted_purchases/constants'; import SelfHostedExpansionModal from 'components/self_hosted_purchases/self_hosted_expansion_modal'; -import {useControlModal, ControlModal} from './useControlModal'; +import {ModalIdentifiers, TELEMETRY_CATEGORIES} from 'utils/constants'; + +import {useControlModal} from './useControlModal'; +import type {ControlModal} from './useControlModal'; interface HookOptions{ trackingLocation?: string; diff --git a/webapp/channels/src/components/common/hooks/useControlSelfHostedPurchaseModal.ts b/webapp/channels/src/components/common/hooks/useControlSelfHostedPurchaseModal.ts index 8de1c55a9d..eccd97d043 100644 --- a/webapp/channels/src/components/common/hooks/useControlSelfHostedPurchaseModal.ts +++ b/webapp/channels/src/components/common/hooks/useControlSelfHostedPurchaseModal.ts @@ -4,20 +4,24 @@ import {useMemo} from 'react'; import {useDispatch, useSelector} from 'react-redux'; -import {trackEvent} from 'actions/telemetry_actions'; -import {closeModal, openModal} from 'actions/views/modals'; -import {ModalIdentifiers, TELEMETRY_CATEGORIES} from 'utils/constants'; -import SelfHostedPurchaseModal from 'components/self_hosted_purchases/self_hosted_purchase_modal'; -import {STORAGE_KEY_PURCHASE_IN_PROGRESS} from 'components/self_hosted_purchases/constants'; -import PurchaseInProgressModal from 'components/purchase_in_progress_modal'; +import {HostedCustomerTypes} from 'mattermost-redux/action_types'; import {Client4} from 'mattermost-redux/client'; import {getCurrentUser} from 'mattermost-redux/selectors/entities/common'; -import {HostedCustomerTypes} from 'mattermost-redux/action_types'; + +import {trackEvent} from 'actions/telemetry_actions'; +import {closeModal, openModal} from 'actions/views/modals'; import {isModalOpen} from 'selectors/views/modals'; -import {GlobalState} from 'types/store'; +import PurchaseInProgressModal from 'components/purchase_in_progress_modal'; +import {STORAGE_KEY_PURCHASE_IN_PROGRESS} from 'components/self_hosted_purchases/constants'; +import SelfHostedPurchaseModal from 'components/self_hosted_purchases/self_hosted_purchase_modal'; -import {useControlModal, ControlModal} from './useControlModal'; +import {ModalIdentifiers, TELEMETRY_CATEGORIES} from 'utils/constants'; + +import type {GlobalState} from 'types/store'; + +import {useControlModal} from './useControlModal'; +import type {ControlModal} from './useControlModal'; interface HookOptions{ onClick?: () => void; diff --git a/webapp/channels/src/components/common/hooks/useExpandOverageUsersCheck.ts b/webapp/channels/src/components/common/hooks/useExpandOverageUsersCheck.ts index 6ef7bf34b6..297c7a558c 100644 --- a/webapp/channels/src/components/common/hooks/useExpandOverageUsersCheck.ts +++ b/webapp/channels/src/components/common/hooks/useExpandOverageUsersCheck.ts @@ -5,13 +5,14 @@ import {useEffect, useMemo} from 'react'; import {useIntl} from 'react-intl'; import {useDispatch, useSelector} from 'react-redux'; -import {GlobalState} from 'types/store'; +import type {LicenseSelfServeStatusReducer} from '@mattermost/types/cloud'; + +import {getLicenseSelfServeStatus} from 'mattermost-redux/actions/cloud'; import {trackEvent} from 'actions/telemetry_actions.jsx'; import {getExpandSeatsLink} from 'selectors/cloud'; -import {getLicenseSelfServeStatus} from 'mattermost-redux/actions/cloud'; -import {LicenseSelfServeStatusReducer} from '@mattermost/types/cloud'; +import type {GlobalState} from 'types/store'; type UseExpandOverageUsersCheckArgs = { isWarningState: boolean; diff --git a/webapp/channels/src/components/common/hooks/useFetchAdminConfig.ts b/webapp/channels/src/components/common/hooks/useFetchAdminConfig.ts index 90adfb64bb..45898da6ba 100644 --- a/webapp/channels/src/components/common/hooks/useFetchAdminConfig.ts +++ b/webapp/channels/src/components/common/hooks/useFetchAdminConfig.ts @@ -1,14 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {useState, useEffect} from 'react'; import {useDispatch, useSelector} from 'react-redux'; -import {useState, useEffect} from 'react'; - -import {isCurrentUserSystemAdmin} from 'mattermost-redux/selectors/entities/users'; -import {getConfig} from 'mattermost-redux/selectors/entities/admin'; - import {getConfig as getConfigAction} from 'mattermost-redux/actions/admin'; +import {getConfig} from 'mattermost-redux/selectors/entities/admin'; +import {isCurrentUserSystemAdmin} from 'mattermost-redux/selectors/entities/users'; // used only for queueing the fetch, where needed. Data is read from redux // rather than this hook when it is used diff --git a/webapp/channels/src/components/common/hooks/useFetchStandardAnalytics.ts b/webapp/channels/src/components/common/hooks/useFetchStandardAnalytics.ts index d531789713..91ab05de91 100644 --- a/webapp/channels/src/components/common/hooks/useFetchStandardAnalytics.ts +++ b/webapp/channels/src/components/common/hooks/useFetchStandardAnalytics.ts @@ -1,13 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {useState, useEffect} from 'react'; import {useDispatch, useSelector} from 'react-redux'; -import {useState, useEffect} from 'react'; - -import {isCurrentUserSystemAdmin} from 'mattermost-redux/selectors/entities/users'; -import {getAdminAnalytics} from 'mattermost-redux/selectors/entities/admin'; import {getStandardAnalytics} from 'mattermost-redux/actions/admin'; +import {getAdminAnalytics} from 'mattermost-redux/selectors/entities/admin'; +import {isCurrentUserSystemAdmin} from 'mattermost-redux/selectors/entities/users'; // used only for queueing the fetch, where needed. Data is read from redux // rather than this hook when it is used diff --git a/webapp/channels/src/components/common/hooks/useGetHighestThresholdCloudLimit.test.ts b/webapp/channels/src/components/common/hooks/useGetHighestThresholdCloudLimit.test.ts index 3cbd28f975..8a12cdb223 100644 --- a/webapp/channels/src/components/common/hooks/useGetHighestThresholdCloudLimit.test.ts +++ b/webapp/channels/src/components/common/hooks/useGetHighestThresholdCloudLimit.test.ts @@ -1,10 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {limitThresholds, LimitTypes} from 'utils/limits'; import {FileSizes} from 'utils/file_utils'; +import {limitThresholds, LimitTypes} from 'utils/limits'; -import useGetHighestThresholdCloudLimit, {LimitSummary} from './useGetHighestThresholdCloudLimit'; +import useGetHighestThresholdCloudLimit from './useGetHighestThresholdCloudLimit'; +import type {LimitSummary} from './useGetHighestThresholdCloudLimit'; jest.mock('react', () => ({ useMemo: (fn: () => LimitSummary) => fn(), diff --git a/webapp/channels/src/components/common/hooks/useGetHighestThresholdCloudLimit.ts b/webapp/channels/src/components/common/hooks/useGetHighestThresholdCloudLimit.ts index e125c0b7aa..a73a9263d8 100644 --- a/webapp/channels/src/components/common/hooks/useGetHighestThresholdCloudLimit.ts +++ b/webapp/channels/src/components/common/hooks/useGetHighestThresholdCloudLimit.ts @@ -3,7 +3,8 @@ import {useMemo} from 'react'; -import {CloudUsage, Limits} from '@mattermost/types/cloud'; +import type {CloudUsage, Limits} from '@mattermost/types/cloud'; + import {limitThresholds, LimitTypes} from 'utils/limits'; interface MaybeLimitSummary { diff --git a/webapp/channels/src/components/common/hooks/useGetLimits.ts b/webapp/channels/src/components/common/hooks/useGetLimits.ts index fd851f1724..595581b9a7 100644 --- a/webapp/channels/src/components/common/hooks/useGetLimits.ts +++ b/webapp/channels/src/components/common/hooks/useGetLimits.ts @@ -4,9 +4,12 @@ import {useState, useEffect, useMemo} from 'react'; import {useDispatch, useSelector} from 'react-redux'; -import {Limits} from '@mattermost/types/cloud'; +import type {Limits} from '@mattermost/types/cloud'; + import {getSubscriptionProduct, getCloudLimits, getCloudLimitsLoaded, isCurrentLicenseCloud} from 'mattermost-redux/selectors/entities/cloud'; + import {getCloudLimits as getCloudLimitsAction} from 'actions/cloud'; + import {useIsLoggedIn} from 'components/global_header/hooks'; export default function useGetLimits(): [Limits, boolean] { diff --git a/webapp/channels/src/components/common/hooks/useGetMultiplesExceededCloudLimit.test.ts b/webapp/channels/src/components/common/hooks/useGetMultiplesExceededCloudLimit.test.ts index baa3340e68..ef92428582 100644 --- a/webapp/channels/src/components/common/hooks/useGetMultiplesExceededCloudLimit.test.ts +++ b/webapp/channels/src/components/common/hooks/useGetMultiplesExceededCloudLimit.test.ts @@ -1,10 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {limitThresholds, LimitTypes} from 'utils/limits'; import {FileSizes} from 'utils/file_utils'; +import {limitThresholds, LimitTypes} from 'utils/limits'; -import useGetMultiplesExceededCloudLimit, {LimitSummary} from './useGetMultiplesExceededCloudLimit'; +import useGetMultiplesExceededCloudLimit from './useGetMultiplesExceededCloudLimit'; +import type {LimitSummary} from './useGetMultiplesExceededCloudLimit'; jest.mock('react', () => ({ useMemo: (fn: () => LimitSummary) => fn(), diff --git a/webapp/channels/src/components/common/hooks/useGetMultiplesExceededCloudLimit.ts b/webapp/channels/src/components/common/hooks/useGetMultiplesExceededCloudLimit.ts index a9e8a3f792..0a1c9cc188 100644 --- a/webapp/channels/src/components/common/hooks/useGetMultiplesExceededCloudLimit.ts +++ b/webapp/channels/src/components/common/hooks/useGetMultiplesExceededCloudLimit.ts @@ -3,7 +3,8 @@ import {useMemo} from 'react'; -import {CloudUsage, Limits} from '@mattermost/types/cloud'; +import type {CloudUsage, Limits} from '@mattermost/types/cloud'; + import {limitThresholds, LimitTypes} from 'utils/limits'; type LimitsKeys = typeof LimitTypes[keyof typeof LimitTypes]; diff --git a/webapp/channels/src/components/common/hooks/useGetNotifyAdmin.ts b/webapp/channels/src/components/common/hooks/useGetNotifyAdmin.ts index 60d1980b1d..12b10fdb98 100644 --- a/webapp/channels/src/components/common/hooks/useGetNotifyAdmin.ts +++ b/webapp/channels/src/components/common/hooks/useGetNotifyAdmin.ts @@ -3,8 +3,10 @@ import {useState} from 'react'; -import {NotifyAdminRequest} from '@mattermost/types/cloud'; +import type {NotifyAdminRequest} from '@mattermost/types/cloud'; + import {Client4} from 'mattermost-redux/client'; + import {trackEvent} from 'actions/telemetry_actions'; export const NotifyStatus = { diff --git a/webapp/channels/src/components/common/hooks/useGetSelfHostedProducts.ts b/webapp/channels/src/components/common/hooks/useGetSelfHostedProducts.ts index ea9e6f6889..ded117d318 100644 --- a/webapp/channels/src/components/common/hooks/useGetSelfHostedProducts.ts +++ b/webapp/channels/src/components/common/hooks/useGetSelfHostedProducts.ts @@ -4,12 +4,14 @@ import {useState, useEffect, useMemo} from 'react'; import {useDispatch, useSelector} from 'react-redux'; -import {getSelfHostedProducts, getSelfHostedProductsLoaded} from 'mattermost-redux/selectors/entities/hosted_customer'; -import {isCurrentLicenseCloud} from 'mattermost-redux/selectors/entities/cloud'; -import {getSelfHostedProducts as getSelfHostedProductsAction} from 'actions/hosted_customer'; -import {useIsLoggedIn} from 'components/global_header/hooks'; +import type {Product} from '@mattermost/types/cloud'; -import {Product} from '@mattermost/types/cloud'; +import {isCurrentLicenseCloud} from 'mattermost-redux/selectors/entities/cloud'; +import {getSelfHostedProducts, getSelfHostedProductsLoaded} from 'mattermost-redux/selectors/entities/hosted_customer'; + +import {getSelfHostedProducts as getSelfHostedProductsAction} from 'actions/hosted_customer'; + +import {useIsLoggedIn} from 'components/global_header/hooks'; export default function useGetSelfHostedProducts(): [Record, boolean] { const isCloud = useSelector(isCurrentLicenseCloud); diff --git a/webapp/channels/src/components/common/hooks/useGetSubscription.ts b/webapp/channels/src/components/common/hooks/useGetSubscription.ts index aa72d7958c..edf45941b1 100644 --- a/webapp/channels/src/components/common/hooks/useGetSubscription.ts +++ b/webapp/channels/src/components/common/hooks/useGetSubscription.ts @@ -4,13 +4,13 @@ import {useEffect, useState} from 'react'; import {useDispatch, useSelector} from 'react-redux'; +import type {Subscription} from '@mattermost/types/cloud'; + import { getCloudSubscription as getCloudSubscriptionAction, } from 'mattermost-redux/actions/cloud'; -import {getLicense} from 'mattermost-redux/selectors/entities/general'; - -import {Subscription} from '@mattermost/types/cloud'; import {getCloudSubscription} from 'mattermost-redux/selectors/entities/cloud'; +import {getLicense} from 'mattermost-redux/selectors/entities/general'; export default function useGetSubscription(): Subscription | undefined { const cloudSubscription = useSelector(getCloudSubscription); diff --git a/webapp/channels/src/components/common/hooks/useGetTotalUsersNoBots.ts b/webapp/channels/src/components/common/hooks/useGetTotalUsersNoBots.ts index 96a2c598fd..3b4afbedcf 100644 --- a/webapp/channels/src/components/common/hooks/useGetTotalUsersNoBots.ts +++ b/webapp/channels/src/components/common/hooks/useGetTotalUsersNoBots.ts @@ -5,7 +5,7 @@ import {useEffect, useState} from 'react'; import {useDispatch} from 'react-redux'; import {getFilteredUsersStats} from 'mattermost-redux/actions/users'; -import {DispatchFunc} from 'mattermost-redux/types/actions'; +import type {DispatchFunc} from 'mattermost-redux/types/actions'; const useGetTotalUsersNoBots = (includeInactive = false): number => { const dispatch = useDispatch(); diff --git a/webapp/channels/src/components/common/hooks/useGetUsage.ts b/webapp/channels/src/components/common/hooks/useGetUsage.ts index 1ccb8dc38a..c844bfaebe 100644 --- a/webapp/channels/src/components/common/hooks/useGetUsage.ts +++ b/webapp/channels/src/components/common/hooks/useGetUsage.ts @@ -4,14 +4,17 @@ import {useEffect, useState} from 'react'; import {useDispatch, useSelector} from 'react-redux'; -import {CloudUsage} from '@mattermost/types/cloud'; -import {getUsage} from 'mattermost-redux/selectors/entities/usage'; +import type {CloudUsage} from '@mattermost/types/cloud'; + import {isCurrentLicenseCloud} from 'mattermost-redux/selectors/entities/cloud'; +import {getUsage} from 'mattermost-redux/selectors/entities/usage'; + import { getMessagesUsage, getFilesUsage, getTeamsUsage, } from 'actions/cloud'; + import {useIsLoggedIn} from 'components/global_header/hooks'; export default function useGetUsage(): CloudUsage { diff --git a/webapp/channels/src/components/common/hooks/useGetUsageDeltas.ts b/webapp/channels/src/components/common/hooks/useGetUsageDeltas.ts index 2098ffa192..9f527aca8a 100644 --- a/webapp/channels/src/components/common/hooks/useGetUsageDeltas.ts +++ b/webapp/channels/src/components/common/hooks/useGetUsageDeltas.ts @@ -3,10 +3,10 @@ import {useMemo} from 'react'; -import {CloudUsage} from '@mattermost/types/cloud'; +import type {CloudUsage} from '@mattermost/types/cloud'; -import useGetUsage from './useGetUsage'; import useGetLimits from './useGetLimits'; +import useGetUsage from './useGetUsage'; // Returns an object of type CloudUsage with the values being the delta between the limit, and the actual usage of this installation. // A value < 0 means that they are NOT over the limit. A value > 0 means they've exceeded that limit diff --git a/webapp/channels/src/components/common/hooks/useLoadStripe.ts b/webapp/channels/src/components/common/hooks/useLoadStripe.ts index 1cafaabd27..0a00068792 100644 --- a/webapp/channels/src/components/common/hooks/useLoadStripe.ts +++ b/webapp/channels/src/components/common/hooks/useLoadStripe.ts @@ -1,16 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import type {Stripe} from '@stripe/stripe-js'; +import {loadStripe} from '@stripe/stripe-js/pure'; // https://github.com/stripe/stripe-js#importing-loadstripe-without-side-effects import {useEffect, useRef, useState} from 'react'; import {useSelector} from 'react-redux'; -import {Stripe} from '@stripe/stripe-js'; - -import {loadStripe} from '@stripe/stripe-js/pure'; // https://github.com/stripe/stripe-js#importing-loadstripe-without-side-effects - -import {GlobalState} from 'types/store'; import {getStripePublicKey} from 'components/payment_form/stripe'; +import type {GlobalState} from 'types/store'; + // reloadHint export default function useLoadStripe(reloadHint?: number) { const stripeRef = useRef(null); diff --git a/webapp/channels/src/components/common/hooks/useOpenCloudPurchaseModal.ts b/webapp/channels/src/components/common/hooks/useOpenCloudPurchaseModal.ts index 93b6e99bb2..8e89ed1cfe 100644 --- a/webapp/channels/src/components/common/hooks/useOpenCloudPurchaseModal.ts +++ b/webapp/channels/src/components/common/hooks/useOpenCloudPurchaseModal.ts @@ -5,9 +5,11 @@ import {useDispatch} from 'react-redux'; import {trackEvent} from 'actions/telemetry_actions'; import {openModal} from 'actions/views/modals'; -import {ModalIdentifiers, TELEMETRY_CATEGORIES} from 'utils/constants'; + import PurchaseModal from 'components/purchase_modal'; +import {ModalIdentifiers, TELEMETRY_CATEGORIES} from 'utils/constants'; + interface OpenPurchaseModalOptions{ onClick?: () => void; trackingLocation?: string; diff --git a/webapp/channels/src/components/common/hooks/useOpenDowngradeModal.ts b/webapp/channels/src/components/common/hooks/useOpenDowngradeModal.ts index 1971a79bc2..00c598e484 100644 --- a/webapp/channels/src/components/common/hooks/useOpenDowngradeModal.ts +++ b/webapp/channels/src/components/common/hooks/useOpenDowngradeModal.ts @@ -5,9 +5,11 @@ import {useDispatch} from 'react-redux'; import {trackEvent} from 'actions/telemetry_actions'; import {openModal} from 'actions/views/modals'; -import {ModalIdentifiers, TELEMETRY_CATEGORIES} from 'utils/constants'; + import DowngradeModal from 'components/downgrade_modal'; +import {ModalIdentifiers, TELEMETRY_CATEGORIES} from 'utils/constants'; + interface OpenDowngradeModalOptions{ trackingLocation?: string; } diff --git a/webapp/channels/src/components/common/hooks/useOpenInvitePeopleModal.ts b/webapp/channels/src/components/common/hooks/useOpenInvitePeopleModal.ts index 63cbcceaab..e6e05ae492 100644 --- a/webapp/channels/src/components/common/hooks/useOpenInvitePeopleModal.ts +++ b/webapp/channels/src/components/common/hooks/useOpenInvitePeopleModal.ts @@ -5,9 +5,11 @@ import {useDispatch} from 'react-redux'; import {trackEvent} from 'actions/telemetry_actions'; import {openModal} from 'actions/views/modals'; -import {ModalIdentifiers} from 'utils/constants'; + import InvitationModal from 'components/invitation_modal'; +import {ModalIdentifiers} from 'utils/constants'; + export default function useOpenInvitePeopleModal() { const dispatch = useDispatch(); return () => { diff --git a/webapp/channels/src/components/common/hooks/useOpenPricingModal.ts b/webapp/channels/src/components/common/hooks/useOpenPricingModal.ts index 1a8c0f1198..6beeacbd1e 100644 --- a/webapp/channels/src/components/common/hooks/useOpenPricingModal.ts +++ b/webapp/channels/src/components/common/hooks/useOpenPricingModal.ts @@ -3,12 +3,14 @@ import {useDispatch, useSelector} from 'react-redux'; +import {isCurrentLicenseCloud} from 'mattermost-redux/selectors/entities/cloud'; + import {trackEvent} from 'actions/telemetry_actions'; import {openModal} from 'actions/views/modals'; -import {ModalIdentifiers, TELEMETRY_CATEGORIES} from 'utils/constants'; + import PricingModal from 'components/pricing_modal'; -import {isCurrentLicenseCloud} from 'mattermost-redux/selectors/entities/cloud'; +import {ModalIdentifiers, TELEMETRY_CATEGORIES} from 'utils/constants'; export type TelemetryProps = { trackingLocation: string; diff --git a/webapp/channels/src/components/common/hooks/useOpenSalesLink.ts b/webapp/channels/src/components/common/hooks/useOpenSalesLink.ts index 1bc2c87e31..2a88fd39f0 100644 --- a/webapp/channels/src/components/common/hooks/useOpenSalesLink.ts +++ b/webapp/channels/src/components/common/hooks/useOpenSalesLink.ts @@ -5,8 +5,9 @@ import {useSelector} from 'react-redux'; import {getCloudCustomer, isCurrentLicenseCloud} from 'mattermost-redux/selectors/entities/cloud'; import {getCurrentUser} from 'mattermost-redux/selectors/entities/users'; -import {buildMMURL, goToMattermostContactSalesForm} from 'utils/contact_support_sales'; + import {LicenseLinks} from 'utils/constants'; +import {buildMMURL, goToMattermostContactSalesForm} from 'utils/contact_support_sales'; export default function useOpenSalesLink(): [() => void, string] { const isCloud = useSelector(isCurrentLicenseCloud); diff --git a/webapp/channels/src/components/common/hooks/useOpenStartTrialFormModal.ts b/webapp/channels/src/components/common/hooks/useOpenStartTrialFormModal.ts index ec6a456d9d..79ac7b5391 100644 --- a/webapp/channels/src/components/common/hooks/useOpenStartTrialFormModal.ts +++ b/webapp/channels/src/components/common/hooks/useOpenStartTrialFormModal.ts @@ -4,9 +4,12 @@ import {useDispatch} from 'react-redux'; import {openModal} from 'actions/views/modals'; -import {ModalIdentifiers} from 'utils/constants'; + import StartTrialFormModal from 'components/start_trial_form_modal'; -import {TelemetryProps} from './useOpenPricingModal'; + +import {ModalIdentifiers} from 'utils/constants'; + +import type {TelemetryProps} from './useOpenPricingModal'; export default function useOpenStartTrialFormModal() { const dispatch = useDispatch(); diff --git a/webapp/channels/src/components/common/hooks/useOpenZendeskForm.ts b/webapp/channels/src/components/common/hooks/useOpenZendeskForm.ts index 16df9d9a02..71d4abf389 100644 --- a/webapp/channels/src/components/common/hooks/useOpenZendeskForm.ts +++ b/webapp/channels/src/components/common/hooks/useOpenZendeskForm.ts @@ -5,6 +5,7 @@ import {useSelector} from 'react-redux'; import {getCloudCustomer} from 'mattermost-redux/selectors/entities/cloud'; import {getCurrentUser} from 'mattermost-redux/selectors/entities/users'; + import {getCloudSupportLink, getSelfHostedSupportLink, goToCloudSupportForm, goToSelfHostedSupportForm} from 'utils/contact_support_sales'; export function useOpenCloudZendeskSupportForm(subject: string, description: string): [() => void, string] { diff --git a/webapp/channels/src/components/common/hooks/usePreference.ts b/webapp/channels/src/components/common/hooks/usePreference.ts index 52a54e140c..6a63181a50 100644 --- a/webapp/channels/src/components/common/hooks/usePreference.ts +++ b/webapp/channels/src/components/common/hooks/usePreference.ts @@ -4,13 +4,13 @@ import {useCallback, useMemo} from 'react'; import {useDispatch, useSelector} from 'react-redux'; -import {PreferenceType} from '@mattermost/types/preferences'; +import type {PreferenceType} from '@mattermost/types/preferences'; import {savePreferences} from 'mattermost-redux/actions/preferences'; import {getCurrentUserId} from 'mattermost-redux/selectors/entities/common'; import {getMyPreferences} from 'mattermost-redux/selectors/entities/preferences'; +import type {ActionFunc} from 'mattermost-redux/types/actions'; import {getPreferenceKey} from 'mattermost-redux/utils/preference_utils'; -import {ActionFunc} from 'mattermost-redux/types/actions'; export default function usePreference(category: string, name: string): [string | undefined, (value: string) => ActionFunc] { const dispatch = useDispatch(); diff --git a/webapp/channels/src/components/common/hooks/useSavePreferences.ts b/webapp/channels/src/components/common/hooks/useSavePreferences.ts index 62b66eaf3e..4be5d47afe 100644 --- a/webapp/channels/src/components/common/hooks/useSavePreferences.ts +++ b/webapp/channels/src/components/common/hooks/useSavePreferences.ts @@ -2,10 +2,9 @@ // See LICENSE.txt for license information. import {useCallback} from 'react'; - import {useDispatch, useSelector} from 'react-redux'; -import {PreferenceType} from '@mattermost/types/preferences'; +import type {PreferenceType} from '@mattermost/types/preferences'; import {savePreferences} from 'mattermost-redux/actions/preferences'; import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users'; diff --git a/webapp/channels/src/components/common/hooks/useShowAdminLimitReached.test.tsx b/webapp/channels/src/components/common/hooks/useShowAdminLimitReached.test.tsx index f994dc3718..5243976287 100644 --- a/webapp/channels/src/components/common/hooks/useShowAdminLimitReached.test.tsx +++ b/webapp/channels/src/components/common/hooks/useShowAdminLimitReached.test.tsx @@ -1,19 +1,19 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {ReactPortal} from 'react'; +import React from 'react'; +import type {ReactPortal} from 'react'; import {Provider} from 'react-redux'; -import {renderWithIntl, screen} from 'tests/react_testing_utils'; - -import {TestHelper} from 'utils/test_helper'; -import {Preferences} from 'utils/constants'; +import configureStore from 'store'; import * as useGetLimitsHook from 'components/common/hooks/useGetLimits'; import * as useGetUsageHook from 'components/common/hooks/useGetUsage'; - import ModalController from 'components/modal_controller'; -import configureStore from 'store'; + +import {renderWithIntl, screen} from 'tests/react_testing_utils'; +import {Preferences} from 'utils/constants'; +import {TestHelper} from 'utils/test_helper'; import useShowAdminLimitReached from './useShowAdminLimitReached'; diff --git a/webapp/channels/src/components/common/hooks/useShowAdminLimitReached.ts b/webapp/channels/src/components/common/hooks/useShowAdminLimitReached.ts index 442406b624..d504da4195 100644 --- a/webapp/channels/src/components/common/hooks/useShowAdminLimitReached.ts +++ b/webapp/channels/src/components/common/hooks/useShowAdminLimitReached.ts @@ -5,19 +5,18 @@ import {useIntl} from 'react-intl'; import {useDispatch, useSelector} from 'react-redux'; -import {getNeedsLoggedInLimitReachedCheck} from 'selectors/views/admin'; import {setNeedsLoggedInLimitReachedCheck} from 'actions/views/admin'; import {closeModal, openModal} from 'actions/views/modals'; - -import {ModalIdentifiers, Preferences} from 'utils/constants'; +import {getNeedsLoggedInLimitReachedCheck} from 'selectors/views/admin'; import CloudUsageModal from 'components/cloud_usage_modal'; import useOpenPricingModal from 'components/common/hooks/useOpenPricingModal'; +import {ModalIdentifiers, Preferences} from 'utils/constants'; import {t} from 'utils/i18n'; -import useGetUsage from './useGetUsage'; import useGetLimits from './useGetLimits'; +import useGetUsage from './useGetUsage'; import usePreference from './usePreference'; // intended to only be run for admins of cloud instances. diff --git a/webapp/channels/src/components/common/hooks/useTelemetryIdentifySync.tsx b/webapp/channels/src/components/common/hooks/useTelemetryIdentifySync.tsx index 1f20faf27c..6a204f91b5 100644 --- a/webapp/channels/src/components/common/hooks/useTelemetryIdentifySync.tsx +++ b/webapp/channels/src/components/common/hooks/useTelemetryIdentifySync.tsx @@ -5,7 +5,6 @@ import {useEffect} from 'react'; import {useSelector} from 'react-redux'; import {Client4} from 'mattermost-redux/client'; - import {getCurrentUser} from 'mattermost-redux/selectors/entities/users'; /** diff --git a/webapp/channels/src/components/common/hooks/useTooltip.tsx b/webapp/channels/src/components/common/hooks/useTooltip.tsx index ce87e0b917..b9cbb78c3f 100644 --- a/webapp/channels/src/components/common/hooks/useTooltip.tsx +++ b/webapp/channels/src/components/common/hooks/useTooltip.tsx @@ -1,10 +1,11 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {useHover, useInteractions, useFloating, arrow, offset, autoPlacement} from '@floating-ui/react-dom-interactions'; +import type {Strategy, Placement} from '@floating-ui/react-dom-interactions'; +import classNames from 'classnames'; import React, {useState, useRef} from 'react'; import ReactDOM from 'react-dom'; -import classNames from 'classnames'; -import {useHover, useInteractions, useFloating, arrow, offset, autoPlacement, Strategy, Placement} from '@floating-ui/react-dom-interactions'; import {Constants} from 'utils/constants'; diff --git a/webapp/channels/src/components/common/infinite_scroll.test.tsx b/webapp/channels/src/components/common/infinite_scroll.test.tsx index aae29a6d66..0b33ba5367 100644 --- a/webapp/channels/src/components/common/infinite_scroll.test.tsx +++ b/webapp/channels/src/components/common/infinite_scroll.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import type {ReactWrapper} from 'enzyme'; import React from 'react'; -import {ReactWrapper} from 'enzyme'; import InfiniteScroll from 'components/common/infinite_scroll'; diff --git a/webapp/channels/src/components/common/infinite_scroll.tsx b/webapp/channels/src/components/common/infinite_scroll.tsx index 6056d62962..c250af5a66 100644 --- a/webapp/channels/src/components/common/infinite_scroll.tsx +++ b/webapp/channels/src/components/common/infinite_scroll.tsx @@ -1,8 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {CSSProperties} from 'react'; import debounce from 'lodash/debounce'; +import React from 'react'; +import type {CSSProperties} from 'react'; import LoadingScreen from 'components/loading_screen'; diff --git a/webapp/channels/src/components/common/multi_select_cards/index.tsx b/webapp/channels/src/components/common/multi_select_cards/index.tsx index 2767a979a6..77041c6f41 100644 --- a/webapp/channels/src/components/common/multi_select_cards/index.tsx +++ b/webapp/channels/src/components/common/multi_select_cards/index.tsx @@ -3,7 +3,8 @@ import React from 'react'; -import MultiSelectCard, {Props as CardProps} from './multi_select_card'; +import MultiSelectCard from './multi_select_card'; +import type {Props as CardProps} from './multi_select_card'; import './index.scss'; type Props = { diff --git a/webapp/channels/src/components/common/multi_select_cards/multi_select_card.tsx b/webapp/channels/src/components/common/multi_select_cards/multi_select_card.tsx index d83cefcb06..540ba660df 100644 --- a/webapp/channels/src/components/common/multi_select_cards/multi_select_card.tsx +++ b/webapp/channels/src/components/common/multi_select_cards/multi_select_card.tsx @@ -2,7 +2,6 @@ // See LICENSE.txt for license information. import React from 'react'; - import {FormattedMessage} from 'react-intl'; import './multi_select_card.scss'; diff --git a/webapp/channels/src/components/common/plan_label/index.tsx b/webapp/channels/src/components/common/plan_label/index.tsx index f97e8e8445..5f38c24884 100644 --- a/webapp/channels/src/components/common/plan_label/index.tsx +++ b/webapp/channels/src/components/common/plan_label/index.tsx @@ -2,16 +2,16 @@ // See LICENSE.txt for license information. import React from 'react'; +import {useIntl} from 'react-intl'; import {useSelector} from 'react-redux'; import styled from 'styled-components'; -import {useIntl} from 'react-intl'; - -import {TrialPeriodDays} from 'utils/constants'; -import {getRemainingDaysFromFutureTimestamp} from 'utils/utils'; import {getCloudSubscription as selectCloudSubscription, isCurrentLicenseCloud} from 'mattermost-redux/selectors/entities/cloud'; import {getLicense} from 'mattermost-redux/selectors/entities/general'; +import {TrialPeriodDays} from 'utils/constants'; +import {getRemainingDaysFromFutureTimestamp} from 'utils/utils'; + type PlanLabelProps = { text: string; bgColor: string; diff --git a/webapp/channels/src/components/common/radio_group.test.tsx b/webapp/channels/src/components/common/radio_group.test.tsx index 3e2c9b91b0..fa74eaecaa 100644 --- a/webapp/channels/src/components/common/radio_group.test.tsx +++ b/webapp/channels/src/components/common/radio_group.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import RadioButtonGroup from 'components/common/radio_group'; diff --git a/webapp/channels/src/components/common/radio_group.tsx b/webapp/channels/src/components/common/radio_group.tsx index 25a337ce76..e75c55a10d 100644 --- a/webapp/channels/src/components/common/radio_group.tsx +++ b/webapp/channels/src/components/common/radio_group.tsx @@ -1,7 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {ReactNode} from 'react'; +import React from 'react'; +import type {ReactNode} from 'react'; import Tag from 'components/widgets/tag/tag'; diff --git a/webapp/channels/src/components/common/site_name_and_description.test.tsx b/webapp/channels/src/components/common/site_name_and_description.test.tsx index 99f7ae36d5..c0d9892cc0 100644 --- a/webapp/channels/src/components/common/site_name_and_description.test.tsx +++ b/webapp/channels/src/components/common/site_name_and_description.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import {FormattedMessage} from 'react-intl'; import SiteNameAndDescription from 'components/common/site_name_and_description'; diff --git a/webapp/channels/src/components/common/svg_images_components/magnifying_glass_svg.tsx b/webapp/channels/src/components/common/svg_images_components/magnifying_glass_svg.tsx index 75b2ec8d3d..d9d404bb21 100644 --- a/webapp/channels/src/components/common/svg_images_components/magnifying_glass_svg.tsx +++ b/webapp/channels/src/components/common/svg_images_components/magnifying_glass_svg.tsx @@ -1,7 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {SVGProps} from 'react'; +import React from 'react'; +import type {SVGProps} from 'react'; const SvgComponent = (props: SVGProps) => ( ` height: ${(props) => (typeof props.width === 'number' ? Math.ceil(props.width / 20).toString() + 'px' : '8px')}; width: ${(props) => (typeof props.width === 'number' ? props.width.toString() + 'px' : props.width)}; background: ${(props) => ( - isExceeded(props.percent, props.thresholds) ? - 'var(--dnd-indicator)' : - 'rgba(var(--center-channel-color-rgb), 0.11)' + isExceeded(props.percent, props.thresholds) ? 'var(--dnd-indicator)' : 'rgba(var(--center-channel-color-rgb), 0.11)' )}; border-radius: 8px; position: relative; diff --git a/webapp/channels/src/components/compass_design_provider/index.tsx b/webapp/channels/src/components/compass_design_provider/index.tsx index 091f391145..3be02ddcf3 100644 --- a/webapp/channels/src/components/compass_design_provider/index.tsx +++ b/webapp/channels/src/components/compass_design_provider/index.tsx @@ -1,10 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {FC, memo, ReactNode, useMemo} from 'react'; -import {createTheme, ThemeProvider, Theme as MuiTheme, useTheme as useDefaultMuiTheme, alpha} from '@mui/material/styles'; +import {createTheme, ThemeProvider, useTheme as useDefaultMuiTheme, alpha} from '@mui/material/styles'; +import type {Theme as MuiTheme} from '@mui/material/styles'; +import React, {memo, useMemo} from 'react'; +import type {FC, ReactNode} from 'react'; -import {Theme} from 'mattermost-redux/selectors/entities/preferences'; +import type {Theme} from 'mattermost-redux/selectors/entities/preferences'; interface Props { theme?: Theme; diff --git a/webapp/channels/src/components/compass_theme_provider/compass_theme_provider.tsx b/webapp/channels/src/components/compass_theme_provider/compass_theme_provider.tsx index 60d6cbf20f..58825125c3 100644 --- a/webapp/channels/src/components/compass_theme_provider/compass_theme_provider.tsx +++ b/webapp/channels/src/components/compass_theme_provider/compass_theme_provider.tsx @@ -5,7 +5,7 @@ import React, {useState, useEffect} from 'react'; import ThemeProvider, {lightTheme} from '@mattermost/compass-components/utilities/theme'; // eslint-disable-line no-restricted-imports -import {Theme} from 'mattermost-redux/selectors/entities/preferences'; +import type {Theme} from 'mattermost-redux/selectors/entities/preferences'; type Props = { theme: Theme; diff --git a/webapp/channels/src/components/convert_channel_modal/convert_channel_modal.tsx b/webapp/channels/src/components/convert_channel_modal/convert_channel_modal.tsx index eb67fd62b6..f0aa27df30 100644 --- a/webapp/channels/src/components/convert_channel_modal/convert_channel_modal.tsx +++ b/webapp/channels/src/components/convert_channel_modal/convert_channel_modal.tsx @@ -5,12 +5,14 @@ import React from 'react'; import {Modal} from 'react-bootstrap'; import {FormattedMessage} from 'react-intl'; -import {trackEvent} from 'actions/telemetry_actions.jsx'; -import Constants from 'utils/constants'; import {General} from 'mattermost-redux/constants'; +import {trackEvent} from 'actions/telemetry_actions.jsx'; + import FormattedMarkdownMessage from 'components/formatted_markdown_message'; +import Constants from 'utils/constants'; + type Props = { channelDisplayName: string; channelId: string; diff --git a/webapp/channels/src/components/convert_channel_modal/index.ts b/webapp/channels/src/components/convert_channel_modal/index.ts index 9328560569..7e79b11664 100644 --- a/webapp/channels/src/components/convert_channel_modal/index.ts +++ b/webapp/channels/src/components/convert_channel_modal/index.ts @@ -1,8 +1,9 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {bindActionCreators, Dispatch} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; +import type {Dispatch} from 'redux'; import {updateChannelPrivacy} from 'mattermost-redux/actions/channels'; diff --git a/webapp/channels/src/components/copy_button.tsx b/webapp/channels/src/components/copy_button.tsx index ae48b351b6..1f9bf5881a 100644 --- a/webapp/channels/src/components/copy_button.tsx +++ b/webapp/channels/src/components/copy_button.tsx @@ -1,16 +1,16 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React, {useState} from 'react'; -import {FormattedMessage} from 'react-intl'; -import {Tooltip} from 'react-bootstrap'; import classNames from 'classnames'; +import React, {useState} from 'react'; +import {Tooltip} from 'react-bootstrap'; +import {FormattedMessage} from 'react-intl'; import OverlayTrigger from 'components/overlay_trigger'; import Constants from 'utils/constants'; -import {copyToClipboard} from 'utils/utils'; import {t} from 'utils/i18n'; +import {copyToClipboard} from 'utils/utils'; type Props = { content: string; diff --git a/webapp/channels/src/components/copy_url_context_menu/copy_url_context_menu.test.tsx b/webapp/channels/src/components/copy_url_context_menu/copy_url_context_menu.test.tsx index fec395591a..32e789242a 100644 --- a/webapp/channels/src/components/copy_url_context_menu/copy_url_context_menu.test.tsx +++ b/webapp/channels/src/components/copy_url_context_menu/copy_url_context_menu.test.tsx @@ -1,8 +1,8 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; +import React from 'react'; import CopyUrlContextMenu from 'components/copy_url_context_menu/copy_url_context_menu'; diff --git a/webapp/channels/src/components/copy_url_context_menu/index.ts b/webapp/channels/src/components/copy_url_context_menu/index.ts index a14923d24c..f986fa1859 100644 --- a/webapp/channels/src/components/copy_url_context_menu/index.ts +++ b/webapp/channels/src/components/copy_url_context_menu/index.ts @@ -3,12 +3,12 @@ import {connect} from 'react-redux'; -import {GlobalState} from 'types/store/index.js'; - import {getConfig} from 'mattermost-redux/selectors/entities/general'; import {copyToClipboard} from 'utils/utils'; +import type {GlobalState} from 'types/store/index.js'; + import CopyUrlContextMenu from './copy_url_context_menu'; function mapStateToProps(state: GlobalState) { diff --git a/webapp/channels/src/components/create_team/__snapshots__/create_team.test.tsx.snap b/webapp/channels/src/components/create_team/__snapshots__/create_team.test.tsx.snap index 4d4f2154ce..0ff60d22c7 100644 --- a/webapp/channels/src/components/create_team/__snapshots__/create_team.test.tsx.snap +++ b/webapp/channels/src/components/create_team/__snapshots__/create_team.test.tsx.snap @@ -2,7 +2,7 @@ exports[`component/create_team should match snapshot default 1`] = `
- + diff --git a/webapp/channels/src/components/create_team/components/display_name.test.tsx b/webapp/channels/src/components/create_team/components/display_name.test.tsx index f23826a4d5..35b39a1bda 100644 --- a/webapp/channels/src/components/create_team/components/display_name.test.tsx +++ b/webapp/channels/src/components/create_team/components/display_name.test.tsx @@ -1,12 +1,14 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {shallow} from 'enzyme'; +import type {ReactWrapper} from 'enzyme'; import React from 'react'; -import {ReactWrapper, shallow} from 'enzyme'; import {FormattedMessage} from 'react-intl'; -import {mountWithIntl} from 'tests/helpers/intl-test-helper'; import DisplayName from 'components/create_team/components/display_name'; + +import {mountWithIntl} from 'tests/helpers/intl-test-helper'; import Constants from 'utils/constants'; import {cleanUpUrlable} from 'utils/url'; diff --git a/webapp/channels/src/components/create_team/components/display_name.tsx b/webapp/channels/src/components/create_team/components/display_name.tsx index f4001000a0..cca27aabff 100644 --- a/webapp/channels/src/components/create_team/components/display_name.tsx +++ b/webapp/channels/src/components/create_team/components/display_name.tsx @@ -4,13 +4,15 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {Team} from '@mattermost/types/teams'; +import type {Team} from '@mattermost/types/teams'; import {trackEvent} from 'actions/telemetry_actions.jsx'; + +import NextIcon from 'components/widgets/icons/fa_next_icon'; + +import logoImage from 'images/logo.png'; import Constants from 'utils/constants'; import {cleanUpUrlable} from 'utils/url'; -import logoImage from 'images/logo.png'; -import NextIcon from 'components/widgets/icons/fa_next_icon'; type CreateTeamState = { team?: Partial; diff --git a/webapp/channels/src/components/create_team/components/team_url/index.ts b/webapp/channels/src/components/create_team/components/team_url/index.ts index 12d0230c65..6217f04650 100644 --- a/webapp/channels/src/components/create_team/components/team_url/index.ts +++ b/webapp/channels/src/components/create_team/components/team_url/index.ts @@ -1,14 +1,15 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux'; import {connect} from 'react-redux'; +import {bindActionCreators} from 'redux'; +import type {ActionCreatorsMapObject, Dispatch} from 'redux'; + +import type {ServerError} from '@mattermost/types/errors'; +import type {Team} from '@mattermost/types/teams'; -import {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; import {checkIfTeamExists, createTeam} from 'mattermost-redux/actions/teams'; - -import {Team} from '@mattermost/types/teams'; -import {ServerError} from '@mattermost/types/errors'; +import type {ActionFunc, GenericAction} from 'mattermost-redux/types/actions'; import TeamUrl from './team_url'; diff --git a/webapp/channels/src/components/create_team/components/team_url/team_url.test.tsx b/webapp/channels/src/components/create_team/components/team_url/team_url.test.tsx index b49a4be5aa..544a4a35ae 100644 --- a/webapp/channels/src/components/create_team/components/team_url/team_url.test.tsx +++ b/webapp/channels/src/components/create_team/components/team_url/team_url.test.tsx @@ -1,18 +1,17 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import React from 'react'; import {shallow} from 'enzyme'; - +import React from 'react'; +import type {Button} from 'react-bootstrap'; import {FormattedMessage} from 'react-intl'; -import {Button} from 'react-bootstrap'; - import {Provider} from 'react-redux'; -import {mountWithIntl} from 'tests/helpers/intl-test-helper'; import TeamUrl from 'components/create_team/components/team_url/team_url'; -import Constants from 'utils/constants'; + +import {mountWithIntl} from 'tests/helpers/intl-test-helper'; import mockStore from 'tests/test_store'; +import Constants from 'utils/constants'; jest.mock('images/logo.png', () => 'logo.png'); diff --git a/webapp/channels/src/components/create_team/components/team_url/team_url.tsx b/webapp/channels/src/components/create_team/components/team_url/team_url.tsx index 0988cb22bf..1b692438fd 100644 --- a/webapp/channels/src/components/create_team/components/team_url/team_url.tsx +++ b/webapp/channels/src/components/create_team/components/team_url/team_url.tsx @@ -5,19 +5,18 @@ import React from 'react'; import {Button} from 'react-bootstrap'; import {FormattedMessage} from 'react-intl'; -import {Team} from '@mattermost/types/teams'; -import {ServerError} from '@mattermost/types/errors'; +import type {ServerError} from '@mattermost/types/errors'; +import type {Team} from '@mattermost/types/teams'; import {trackEvent} from 'actions/telemetry_actions.jsx'; -import Constants from 'utils/constants'; -import * as URL from 'utils/url'; - -import logoImage from 'images/logo.png'; - +import ExternalLink from 'components/external_link'; import OverlayTrigger from 'components/overlay_trigger'; import Tooltip from 'components/tooltip'; -import ExternalLink from 'components/external_link'; + +import logoImage from 'images/logo.png'; +import Constants from 'utils/constants'; +import * as URL from 'utils/url'; type State = { isLoading: boolean; diff --git a/webapp/channels/src/components/create_team/create_team.test.tsx b/webapp/channels/src/components/create_team/create_team.test.tsx index fdd83ac4d4..b61074859c 100644 --- a/webapp/channels/src/components/create_team/create_team.test.tsx +++ b/webapp/channels/src/components/create_team/create_team.test.tsx @@ -1,11 +1,10 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {shallow} from 'enzyme'; import React from 'react'; import {FormattedMessage} from 'react-intl'; -import {shallow} from 'enzyme'; - import CreateTeam from './create_team'; describe('component/create_team', () => { diff --git a/webapp/channels/src/components/create_team/create_team.tsx b/webapp/channels/src/components/create_team/create_team.tsx index 1b0de835b1..9ec2d20e0d 100644 --- a/webapp/channels/src/components/create_team/create_team.tsx +++ b/webapp/channels/src/components/create_team/create_team.tsx @@ -2,17 +2,18 @@ // See LICENSE.txt for license information. import React from 'react'; -import {Route, Switch, Redirect, RouteComponentProps} from 'react-router-dom'; import {FormattedMessage} from 'react-intl'; +import {Route, Switch, Redirect} from 'react-router-dom'; +import type {RouteComponentProps} from 'react-router-dom'; -import {Channel} from '@mattermost/types/channels'; -import {CloudUsage} from '@mattermost/types/cloud'; -import {Team} from '@mattermost/types/teams'; +import type {Channel} from '@mattermost/types/channels'; +import type {CloudUsage} from '@mattermost/types/cloud'; +import type {Team} from '@mattermost/types/teams'; import AnnouncementBar from 'components/announcement_bar'; import BackButton from 'components/common/back_button'; -import DisplayName from 'components/create_team/components/display_name'; import SiteNameAndDescription from 'components/common/site_name_and_description'; +import DisplayName from 'components/create_team/components/display_name'; import TeamUrl from 'components/create_team/components/team_url'; export type Props = { diff --git a/webapp/channels/src/components/create_team/index.ts b/webapp/channels/src/components/create_team/index.ts index a8ccbd106c..1217a87fe6 100644 --- a/webapp/channels/src/components/create_team/index.ts +++ b/webapp/channels/src/components/create_team/index.ts @@ -4,17 +4,19 @@ import {connect} from 'react-redux'; import {compose} from 'redux'; -import {getConfig, getLicense} from 'mattermost-redux/selectors/entities/general'; import {getCurrentChannel} from 'mattermost-redux/selectors/entities/channels'; -import {getCurrentTeam} from 'mattermost-redux/selectors/entities/teams'; import {getCloudSubscription as selectCloudSubscription} from 'mattermost-redux/selectors/entities/cloud'; +import {getConfig, getLicense} from 'mattermost-redux/selectors/entities/general'; +import {getCurrentTeam} from 'mattermost-redux/selectors/entities/teams'; import withUseGetUsageDelta from 'components/common/hocs/cloud/with_use_get_usage_deltas'; + import {isCloudLicense} from 'utils/license_utils'; -import {GlobalState} from 'types/store'; +import type {GlobalState} from 'types/store'; -import CreateTeam, {Props} from './create_team'; +import CreateTeam from './create_team'; +import type {Props} from './create_team'; function mapStateToProps(state: GlobalState) { const config = getConfig(state); diff --git a/webapp/channels/src/components/create_user_groups_modal/create_user_groups_modal.test.tsx b/webapp/channels/src/components/create_user_groups_modal/create_user_groups_modal.test.tsx index 953cbfb246..ac1cd4e7af 100644 --- a/webapp/channels/src/components/create_user_groups_modal/create_user_groups_modal.test.tsx +++ b/webapp/channels/src/components/create_user_groups_modal/create_user_groups_modal.test.tsx @@ -1,13 +1,12 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import {shallow} from 'enzyme'; import React from 'react'; -import {shallow} from 'enzyme'; +import type {UserProfile} from '@mattermost/types/users'; -import {UserProfile} from '@mattermost/types/users'; - -import {Value} from 'components/multiselect/multiselect'; +import type {Value} from 'components/multiselect/multiselect'; import CreateUserGroupsModal from './create_user_groups_modal'; diff --git a/webapp/channels/src/components/create_user_groups_modal/create_user_groups_modal.tsx b/webapp/channels/src/components/create_user_groups_modal/create_user_groups_modal.tsx index 0f98f6d123..399aa5287c 100644 --- a/webapp/channels/src/components/create_user_groups_modal/create_user_groups_modal.tsx +++ b/webapp/channels/src/components/create_user_groups_modal/create_user_groups_modal.tsx @@ -2,26 +2,27 @@ // See LICENSE.txt for license information. import React from 'react'; - import {Modal} from 'react-bootstrap'; - import {FormattedMessage} from 'react-intl'; -import {UserProfile} from '@mattermost/types/users'; +import type {GroupCreateWithUserIds} from '@mattermost/types/groups'; +import type {UserProfile} from '@mattermost/types/users'; +import type {ActionResult} from 'mattermost-redux/types/actions'; + +import AddUserToGroupMultiSelect from 'components/add_user_to_group_multiselect'; +import LocalizedIcon from 'components/localized_icon'; +import Input from 'components/widgets/inputs/input/input'; + +import Constants, {ItemStatus} from 'utils/constants'; +import {t} from 'utils/i18n'; import * as Utils from 'utils/utils'; -import {GroupCreateWithUserIds} from '@mattermost/types/groups'; +import {localizeMessage} from 'utils/utils'; + +import type {ModalData} from 'types/actions'; import 'components/user_groups_modal/user_groups_modal.scss'; import './create_user_groups_modal.scss'; -import {ModalData} from 'types/actions'; -import Input from 'components/widgets/inputs/input/input'; -import AddUserToGroupMultiSelect from 'components/add_user_to_group_multiselect'; -import {ActionResult} from 'mattermost-redux/types/actions'; -import LocalizedIcon from 'components/localized_icon'; -import {t} from 'utils/i18n'; -import {localizeMessage} from 'utils/utils'; -import Constants, {ItemStatus} from 'utils/constants'; export type Props = { onExited: () => void; @@ -176,7 +177,7 @@ export default class CreateUserGroupsModal extends React.PureComponent { - typeof this.props.backButtonCallback === 'function' ? + typeof this.props.backButtonCallback === 'function' ? ( <> - -
- ) : null; + + + +
+ ) : null; return (