Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Added functionality to archive/unarchive teams from system console #8129

Merged
merged 9 commits into from
Jul 16, 2021

Conversation

manojmalik20
Copy link
Contributor

@manojmalik20 manojmalik20 commented May 19, 2021

Summary

Added feature to archive/unarchive teams from the system console

Ticket: https://mattermost.atlassian.net/browse/MM-37195

Screenshots

image

image

image

Release Note

Added new feature to archive and unarchive teams through the Teams section in the system console

Made RECEIVED_TEAM_UNARCHIVED action type
Made unarchiveTeam action and client function
Made appropriate reducer to handle the action
Added UI for archive/unarchive team in team_profile component
Added ConfirmModal for archiving teams
Made appropriate functions and added logic in handleSubmit of team_details
Added appropriate localization ids in en.json
Added new unit tests in team_details and team_profile
Updated snapshots
Added Archived label in the teams_list
@mattermod
Copy link
Contributor

Hello @manojmalik20,

Thanks for your pull request! A Core Committer will review your pull request soon. For code contributions, you can learn more about the review process here.

@mattermod mattermod requested a review from hmhealey May 19, 2021 07:26
@mattermod mattermod added 2: Dev Review Requires review by a core commiter 3: QA Review Requires review by a QA tester labels May 19, 2021
@hmhealey hmhealey requested review from mkraft and mickmister and removed request for hmhealey May 19, 2021 21:14
@mkraft mkraft added 1: UX Review Requires review by a UX Designer 1: PM Review Requires review by a product manager labels May 21, 2021
@mkraft mkraft requested review from esethna and matthewbirtch May 21, 2021 10:42
@mkraft
Copy link
Contributor

mkraft commented May 21, 2021

@esethna I've added you for PM review and @matthewbirtch for UX review. Please redirect as appropriate.

@matthewbirtch matthewbirtch added the Setup Cloud Test Server Setup a test server using Mattermost Cloud label May 21, 2021
Copy link
Contributor

@matthewbirtch matthewbirtch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution @manojmalik20! Seems like a great idea to have this feature.

Just a couple notes from me:

  1. I can't seem to consistently reproduce this, but when I archive a team and save that change, it kicked me out of the system console and back in to the chat UI. Can we make sure it always routes back to the Teams listing page in the system console?

  2. If I archive the currently active team, and I click 'back to {team}' in the top-left, it errors out with 'Team not found'. This makes sense, but we should consider activating the last accessed unarchived team and changing the 'back to {team}' so that it reflects that team.

  3. If the server only has one team that is not archived, should we allow archiving of the one team? I wonder if the archive button should be disabled or hidden in this case - maybe with some help text to explain that 'Archiving is disabled when there is only one active team`. I tried archiving the last remaining team and as soon as I archived the last team, it kicked me out of the system console to this screen below.
    image

  4. For the teams list view, can we change the (Archived) color so that it's not red? Red implies an error. I would suggest going with a 56% or 64% opacity of the standard text color

Copy link
Contributor

@mickmister mickmister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @manojmalik20! Mostly looks good 👍 I have a few requests

@esethna
Copy link
Contributor

esethna commented May 21, 2021

Adding @wiersgallak @aaronrothschild as they might have more context on system console features. If the concept of "archiving a team" didn't exist before this, then I think we need to think through what that actually means, and what happens to existing channels, users, memberships, accounts etc on that team.

@esethna esethna requested review from wiersgallak and aaronrothschild and removed request for esethna May 21, 2021 16:46
Code refactoring in team_details and team_details.test and team_profile
Added localization and styling in (Archived) label in the team list
@manojmalik20
Copy link
Contributor Author

There is a WebSocket event WEBSOCKET_EVENT_DELETE_TEAM which is sent whenever a team is archived and in the event handler in the webapp, there is a redirect logic that redirects the user to the homepage(chat UI) or the welcome screen if no team is left. I was wondering how to stop that event handler to stop redirecting if the event is fired because of the Archive Team option in the system console. But doing that will also stop redirecting if the team is archived with the help of mmctl commands which can create a problem if the user deletes the currently active team. What should I do? Maybe one of the developers can help.

Copy link
Contributor

@mickmister mickmister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering how to stop that event handler to stop redirecting if the event is fired because of the Archive Team option in the system console.

Since the system console is separate from the channel view, can we decouple their relationship as far as the "current team"? We could have conditional logic in the websocket handler for handling the case of being in the system console, that effectively sets the currently active team to null. Then when the user tries to navigate back to the channel view, that's when we send them to the select team page. @manojmalik20 What are your thoughts on this?

@aaronrothschild
Copy link
Contributor

Adding @wiersgallak @aaronrothschild as they might have more context on system console features. If the concept of "archiving a team" didn't exist before this, then I think we need to think through what that actually means, and what happens to existing channels, users, memberships, accounts etc on that team.

I agree with this....what happens to channels? How can I find them again? Unarachive the team then unarchive the channels?

@manojmalik20 Right now, does this essentially "hide" a team without deleting it?

@manojmalik20
Copy link
Contributor Author

I agree with this....what happens to channels? How can I find them again? Unarchive the team then unarchive the channels?

@manojmalik20 Right now, does this essentially "hide" a team without deleting it?

Yes @aaronrothschild, this essentially "hides" a team without deleting it. Once you unarchive the team, you don't have to separately unarchive channels unless they were already archived before archiving the team. So basically, on unarchiving a team, it restores back to the state in which it was before archiving.

* Solved redirecting issue and changed back to {team} text
Solved redirecting issue by checking for pathname in the websocket handler
Refactored some code according to review fixes
Modified backstage_navbar to display "back to home" if team is not there
Added localization ids

* Updated the navbar text in the system console if no team is present
@manojmalik20
Copy link
Contributor Author

@mkraft @mickmister @wiersgallak Is there anything left on this PR?

@jasonblais jasonblais requested a review from furqanmlk July 16, 2021 14:22
@jasonblais jasonblais removed 2: Dev Review Requires review by a core commiter Lifecycle/1:stale labels Jul 16, 2021
@jasonblais
Copy link
Contributor

Sorry for the delay, and thanks for the contribution @manojmalik20!

The last step is a QA review, I've requested @furqanmlk to help. Once completed, we're ready to merge! :)

Copy link
Contributor

@furqanmlk furqanmlk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

N/A

@furqanmlk furqanmlk self-requested a review July 16, 2021 18:43
Copy link
Contributor

@furqanmlk furqanmlk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working as expected. all e2e test cases passed ✅

@jasonblais jasonblais added 4: Reviews Complete All reviewers have approved the pull request AutoMerge used by Mattermod to merge PR automatically and removed 3: QA Review Requires review by a QA tester labels Jul 16, 2021
@mattermod
Copy link
Contributor

Will try to auto merge this PR once all tests and checks are passing. This might take up to an hour.

@mattermod
Copy link
Contributor

Trying to auto merge this PR.

@mattermod mattermod merged commit 3ede09f into mattermost:master Jul 16, 2021
@mattermod
Copy link
Contributor

Pull Request successfully merged
SHA: 3ede09f

@mattermod mattermod removed Setup Cloud Test Server Setup a test server using Mattermost Cloud AutoMerge used by Mattermod to merge PR automatically labels Jul 16, 2021
@mm-cloud-bot
Copy link

Test server destroyed

1 similar comment
@mm-cloud-bot
Copy link

Test server destroyed

@jasonblais
Copy link
Contributor

Thanks again @manojmalik20!

cc @amyblais not sure if this should have a Jira ticket for release test coverage.

@amyblais amyblais added Changelog/Done Required changelog entry has been written Docs/Needed Requires documentation labels Jul 16, 2021
@amyblais amyblais added this to the v5.38.0 milestone Jul 16, 2021
@manojmalik20 manojmalik20 deleted the archive_team branch July 19, 2021 05:30
cwarnermm added a commit to mattermost/docs that referenced this pull request Aug 5, 2021
Documentation for: mattermost/mattermost-webapp#8129

Updated:
- Set Up, Manage, Onboard, and Comply > Manage Mattermost > Self-Managed Deployments > Managing Team and Channel Members (E20) > Team Profile
   - Updated section to include details on how to archive/unarchive the team
amyblais pushed a commit to mattermost/docs that referenced this pull request Aug 9, 2021
…4927)

* Added functionality to archive/unarchive teams from system console

Documentation for: mattermost/mattermost-webapp#8129

Updated:
- Set Up, Manage, Onboard, and Comply > Manage Mattermost > Self-Managed Deployments > Managing Team and Channel Members (E20) > Team Profile
   - Updated section to include details on how to archive/unarchive the team

* Added archive/unarchive updates to Cloud-specific page

* Updated LHS

- Moved self-managed topic from all instances to self-managed
- Added Cloud-specific topic

* added mmctl equivalent for team restore

* added mmctl equivalent for team restore (self-managed)

* Update source/manage/cloud-team-and-channel.rst

Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com>

* Update source/manage/team-channel-members.rst

Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com>
@amyblais amyblais added Docs/Done Required documentation has been written and removed Docs/Needed Requires documentation labels Aug 9, 2021
amyblais added a commit to mattermost/docs that referenced this pull request Aug 16, 2021
* Update conf.py

* Update open-source-components.rst

* Update release-lifecycle.rst

* Reliable Websockets: default to true

Documentation for: mattermost/mattermost#17890

Updated:
- Set Up, Manage, Onboard, and Comply > Set Up Mattermost > Self-Managed Deployments > Configuration Settings > Experimental Settings only in config.json > Enable Reliable Websockets
   - Updated the default value of the config setting to ``true``

* PR didn't follow internal processes for submission

* Re-added file deleted in error

* Re-added the correct file that was deleted in error

* MM-36779 - Add ChimeraOAuthProxyURL config option (#4928)

* MM-36779 - Add ChimeraOAuthProxyURL config option

Documentation for: mattermost/mattermost#17888

Updated:
- Set Up, Manage, Onboard, and Comply > Set Up Mattermost > Self-Managed Deployments > Configuration Settings > Plugins (Beta)
   - Added the Chimera OAuth Proxy URL configuration setting

* Added ChimeraOAuthProxyUrl to Telemetry

* added note about the setting being available only via config.json

* Update source/configure/configuration-settings.rst

Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com>

* Update source/configure/configuration-settings.rst

Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com>

Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com>

* Reliable Websockets: default to true (#4918)

Documentation for: mattermost/mattermost#17890

Updated:
- Set Up, Manage, Onboard, and Comply > Set Up Mattermost > Self-Managed Deployments > Configuration Settings > Experimental Settings only in config.json > Enable Reliable Websockets
    - Updated the default value of the config setting to ``true``

* Added functionality to archive/unarchive teams from system console (#4927)

* Added functionality to archive/unarchive teams from system console

Documentation for: mattermost/mattermost-webapp#8129

Updated:
- Set Up, Manage, Onboard, and Comply > Manage Mattermost > Self-Managed Deployments > Managing Team and Channel Members (E20) > Team Profile
   - Updated section to include details on how to archive/unarchive the team

* Added archive/unarchive updates to Cloud-specific page

* Updated LHS

- Moved self-managed topic from all instances to self-managed
- Added Cloud-specific topic

* added mmctl equivalent for team restore

* added mmctl equivalent for team restore (self-managed)

* Update source/manage/cloud-team-and-channel.rst

Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com>

* Update source/manage/team-channel-members.rst

Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com>

* Update data-retention-policy.rst (#4937)

* Update data-retention-policy.rst

Adding docs for custom data retention policies.

* Update data-retention-policy.rst

* Update source/comply/data-retention-policy.rst

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update source/comply/data-retention-policy.rst

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update source/comply/data-retention-policy.rst

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update source/comply/data-retention-policy.rst

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update source/comply/data-retention-policy.rst

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update source/comply/data-retention-policy.rst

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update source/comply/data-retention-policy.rst

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update source/comply/data-retention-policy.rst

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update source/comply/data-retention-policy.rst

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update source/comply/data-retention-policy.rst

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update source/comply/data-retention-policy.rst

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update source/comply/data-retention-policy.rst

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update source/comply/data-retention-policy.rst

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update data-retention-policy.rst

* Update data-retention-policy.rst

* Update source/comply/data-retention-policy.rst

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update source/comply/data-retention-policy.rst

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update source/comply/data-retention-policy.rst

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update source/comply/data-retention-policy.rst

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update important-upgrade-notes.rst (#4811)

* Update important-upgrade-notes.rst

* Update important-upgrade-notes.rst

* Update important-upgrade-notes.rst

* Fix typos

* MM-36547 Renamed 'Mute Channel' and 'Edit Channel Header' menus (#4941)

Documentation for: mattermost/mattermost-webapp#8313

Updated:
- Messaging > Manage Teams, Channels, and Members > Managing Channels > Creating a Direct or Group Message
   - Updated section to include mute, unmute, and edit header options for group and direct messages

* MM-35722: CRT, post click open thread (#4942)

Documentation for: mattermost/mattermost-webapp#8342

Updated:
- Messages > Work with Messages > Organizing Conversations using Collapsed Reply Threads (Beta) > Start or Reply to Threads
   - Updated Tip bullet point #1 to clarify that uses can click anywhere in a message in the center pane to view it/reply to it

* MM-35470 Disable config watching logic (#4951)

* MM-35470 Disable config watching logic

Documentation for: mattermost/mattermost#17913

Updated:
- Set Up, Manage, Onboard, and Comply > Set Up Mattermost > Self-Managed Deployments > Configuration Settings
   - Updated introductory content to remove < v5.12 legacy note and add config watcher note and link to mmctl command

* Update source/configure/configuration-settings.rst

Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com>

* v5.38.0 Changelog (#4810)

* Update self-managed-changelog.md

* Update self-managed-changelog.md

* Update self-managed-changelog.md

* Update self-managed-changelog.md

* Update self-managed-changelog.md

* Update self-managed-changelog.md

* Update self-managed-changelog.md

* Apply suggestions from code review

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update self-managed-changelog.md

* Update self-managed-changelog.md

* Update self-managed-changelog.md

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

Co-authored-by: Amy Blais <29708087+amyblais@users.noreply.github.com>
Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com>
Co-authored-by: Katie Wiersgalla <39744472+wiersgallak@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
4: Reviews Complete All reviewers have approved the pull request Changelog/Done Required changelog entry has been written Docs/Done Required documentation has been written release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.