MM-53125 Add feature to convert group message to private channel (#24421)

* Added convert to channel menu item

* WIP

* refactored channel name input field and created conversion modal

* style

* style

* WIP

* wip

* Created API to fetch common teams of GM members

* Added UI for all members deactivated

* Fetched common teams in client

* WIP

* Added a required attribute to DropdownInput component

* Fixed a case with dropdown input required flag

* WIP

* API first draft

* Genetayed layers and mocks

* Fixed create channel bug

* WIP

* Added cache invalidation

* Calling API from client

* Updated API to accept name and display name as well

* WIP

* Moved converted GM to correct category

* Style fixes

* Added logic to move user to new team/channel after GM conversion

* Prevented guest user from performing action

* Added loading indicator

* Added smoother height transistion when loading finishes

* UI imporvements

* WIP

* Formatted GM conversion message on client side

* lint fix

* Moved convert option from sidebar menu to channel header menu

* Some cleanup

* Updated server layers

* Fixed i18n

* Fixed types

* Fix server i18n

* Fixed channel creation bug

* Added store test for GetCommonTeamIDsForMultipleUsers

* Server tests done

* Updated snapshots

* Updated layers

* lint fix

* Update tests

* For CI

* lint

* restored debug code

* Used user ID instead of username in channel conversion post

* WIP

* Review fixes

* LInt fixes

* Test fix

* WIP

* WIP

* WIP

* wip

* Review fixes, lots of them

* Review fix

* Disabled WIP test

* test

* Cleanup

* Test fix

* removed testing line

* Fixed incorrect default message

* Review fixes

* Fixes

* lint and i18n fix

* Setting category on server side

* updated i18n

* Updated tests

* Added tests

* Refs cleanup

* added test

---------

Co-authored-by: Harshil Sharma <harshilsharma@Harshils-MacBook-Pro.local>
Этот коммит содержится в:
Harshil Sharma
2023-09-19 18:11:34 +05:30
коммит произвёл GitHub
родитель 11cdd2b66b
Коммит 39d6cb8008
46 изменённых файлов: 2243 добавлений и 119 удалений

Просмотреть файл

@@ -295,6 +295,14 @@
"id": "api.channel.get_channel_moderations.license.error",
"translation": "Your license does not support channel moderation"
},
{
"id": "api.channel.gm_to_channel_conversion.not_allowed_for_user.request_error",
"translation": "User is not allowed to convert group message to private channel"
},
{
"id": "api.channel.group_message.converted.to_private_channel",
"translation": "{{.ConvertedByUsername}} created this channel from a group message with {{.GMMembers}}."
},
{
"id": "api.channel.guest_join_channel.post_and_forget",
"translation": "%v joined the channel as guest."
@@ -4810,6 +4818,14 @@
"id": "app.channel.get_channels_with_unreads_and_with_mentions.app_error",
"translation": "Unable to check unreads and mentions"
},
{
"id": "app.channel.get_common_teams.incorrect_channel_type",
"translation": "Channel is not a group message."
},
{
"id": "app.channel.get_common_teams.store_get_common_teams_error",
"translation": "Couldn't fetch common teams."
},
{
"id": "app.channel.get_deleted.existing.app_error",
"translation": "Unable to find the existing deleted channel."
@@ -4870,6 +4886,26 @@
"id": "app.channel.get_unread.app_error",
"translation": "Unable to get the channel unread messages."
},
{
"id": "app.channel.gm_conversion_set_categories.delete_all.error",
"translation": "Couldn't delete existing sidebar categories for converted GM."
},
{
"id": "app.channel.group_message_conversion.channel_member_missing",
"translation": "Cannot find user's channel membership"
},
{
"id": "app.channel.group_message_conversion.incorrect_team",
"translation": "The specified team ID in conversion request does not contain all the group message members"
},
{
"id": "app.channel.group_message_conversion.original_channel_not_gm",
"translation": "The channel being converted is not a group message. You can only convert group messages"
},
{
"id": "app.channel.group_message_conversion.post_message.error",
"translation": "Failed to create group message to channel conversion post"
},
{
"id": "app.channel.migrate_channel_members.select.app_error",
"translation": "Failed to select the batch of channel members."
@@ -8082,6 +8118,10 @@
"id": "groups.unsupported_syncable_type",
"translation": "Unsupported syncable type '{{.Value}}'."
},
{
"id": "humanize.list_join",
"translation": "{{.OtherItems}} and {{.LastItem}}"
},
{
"id": "import_process.worker.do_job.file_exists",
"translation": "Unable to process import: file does not exists."