* MM-54640 Add API to get multiple emojis by name at once
* Fix status code when too many names are requested
* Address feedback
* Update unit tests
* Fix styling
* Fix more styling
* Fix mismatched i18n id
* fix openApi vetting
The underlying mattermost-govet tool effectively hasn't been called for some time, as we weren't checking out and building the spec files to pass. Now that hte API is in the monorepo, build it locally and check against it.
Unfortunately, our API documentation isn't up-to-date, and this PR isn't fixing that. For now, add a discrete `make vet-api` and workflow that won't block the build until the API documentation is back in sync and can be merged into the existing `make vet` directive.
* mattermost-govet: use upstream@new
* fix missing /api/v4 prefix for commands autocomplete suggestion
* document /api/v4/ldap/users/{user_id}/group_sync_memberships
* document /api/v4/groups/{group_id}/restore
* fix /files/{file_id}/public actually at root
* document /api/v4/users/invalid_emails
* fix SetThreadUnreadByPostId
* Revert "fix SetThreadUnreadByPostId"
This reverts commit b16bcc8044.
* Revert "Revert "fix SetThreadUnreadByPostId""
This reverts commit 8bda05dc8a.
* workaround undocumented API endpoints
* remove unnecessary whiteline
* ignore go tool output
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
* Make GM behave as DM
* Fix lint
* Add desktop notification special behavior
* Change notification preferences menu
* Make changes to the GM channel intro
* Fix tests
* Fix i18n and style lint
* Add system notice and update style
* Fix style and fix tests
* Fix tests
* Handle push notifications as desktop notifications
* Fix tests
* Add test and default GMs to none when user level config is none
* Fix test
* Update only for mentions text
* Add tests
* Fix lint
* Fix lint
* 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>
* adding group members to channel initial commit
* adding group to channel functionality along with add new team members
* fixing circular dependency
* fixing e2e and other optimizations
* adding e2e tests for adding group members to channels
* cypress lint
* fixing comments
* adding count to button
* improvements
* adjusting some stuff from PR comments
* remove ability to add user to team, update message for non-team members
* remove adding to team from add groups functionality
* update misspelled variable
* lint and unit test fixes
* add tests, cleanup
* lint fix
* revert package-lock.json
* fixes for cypress tests
* rename TeamInviteBanner to TeamWarningBanner, since invites are no longer allowed
* update for warning
* lint fixes
* cleanup
* fix failing e2e tests
* update messages to not use markdown
---------
Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
* MM-54182 - add correct information to session table from mobile devices
* improve comments around helper function
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
* Refactor: Use generic to change func StringInSlice to Contains
* Refactor: Use generic to change func stringNotInSlice to Contains
Make utils.go (dir server/public/utils) and func Contains
* Refactor: Move func Contains from channels/utils to public/utils
Move func Contains from channels/utils to public/utils
Fix import declarations line
* Docs: Add a description of the Contains function
* Test: add TestContains
Add a test code for a Contain function
* add ability to restore groups from the user group modal
* factory selector for groups to reduce number of renders across the app
* react window and infinite scroll for user groups
* adding archive groups to dropdown
* restore user group from the view modal
* component cleanup
* lint
* adding websocket for archiveGroup
* updating tests
* adding some tests and fixing types
* lint
* fixing broken test
* fixing snapshot
* fixing infinitescroll
* lint
* increasing max-height and updating snapshots
* fixing PR comments
* fixing case for button
* snapshot and translation
* fixing PR comments
* tiding up repition and creating new hook
* fixing tests
* add additional parammeter for call to getGroups()
* make sure popup is visible for all rows
* update text for admin console
* update css for lint
* fix edge cases found in review
* revert package-lock.json
* revert adding query to GetGroupsParam
* fixing lint
* change include_archived to false in team_controller
---------
Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local>
Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
* [MM-37984] Allow Desktop App to authenticate via external providers outside of the app on supported servers
* PR feedback
* Add support for mattermost-dev protocol for development use
* Update server/channels/db/migrations/postgres/000110_create_desktop_tokens.up.sql
* Fix silly typo
* Update server/channels/db/migrations/postgres/000110_create_desktop_tokens.up.sql
* Remove storage of client token, only validate it on the client
* Update migrations
* Add concurrently create index
* Remove CONCURRENTLY for now
* Fix issue with changing history
* Remove old migration
* Use idempotent statement to drop old index
* Remove reference to old table
There were multiple problems with loading of a license.
1. It was called from inside app/server.go and app/platform/service.go. The first one wasn't really needed anymore, so we remove it.
2. To make loading of a license work across a cluster, the license load action was attached along with the `InvalidateAllCachesSkipSend` method. But the problem with that was that it would even get called in the caller node as well, putting it in a recursive loop.
```
LoadLicense -> SaveLicense -> InvalidateAllCaches -> InvalidateAllCachesSkipSend -> LoadLicense
```
To fix this, we create a dedicated loadLicense cluster event and move it away from the `InvalidateAllCachesSkipSend` method. And then from the caller side, we just trigger this action.
3. We also remove the first call to check license expiration which would load the license again. This is unnecessary because if the license is expired, server wouldn't start at all.
While here, we also make some other improvements like removing unnecessary goroutine spawning while publishing websocket events. They are already handled asynchronously, so there is no need
to create a goroutine for that.
We also remove
```
ps.ReloadConfig()
ps.InvalidateAllCaches()
```
from requestTrialLicense as they are already called from inside `*PlatformService.SaveLicense`.
And lastly, we remove the `*model.AppError` return from `*PlatformService.InvalidateAllCaches` because there was nothing to return at all.
https://mattermost.atlassian.net/browse/MM-53879
```release-note
Fix several issues with loading of a license
```
* move plugin signature verification to caller
The semantics for when plugin signature validation is required are unique to the caller, so move this logic there instead of masking it, thus simplifying some of the downstream code.
* support transitionally prepacked plugins
Transitionally prepackaged plugins are prepackaged plugins slated for unpackaging in some future release. Like prepackaged plugins, they automatically install or upgrade if the server is configured to enable that plugin, but unlike prepackaged plugins they don't add to the marketplace to allow for offline installs. In fact, if unlisted from the marketplace and not already enabled via `config.json`, a transitionally prepackaged plugin is essentially hidden.
To ensure a smooth transition in the future release when this plugin is no longer prepackaged at all, transitionally prepackaged plugins are persisted to the filestore as if they had been installed by the enduser. On the next restart, even while the plugin is still transitionally prepackaged, the version in the filestore will take priority. It remains possible for a transitionally prepackaged plugin to upgrade (and once again persist) if we ship a newer version before dropping it altogether.
Some complexity arises in a multi-server cluster, primarily because we don't want to deal with multiple servers writing the same object to the filestore. This is probably fine for S3, but has undefined semantics for regular filesystems, especially with some customers backing their files on any number of different fileshare technologies. To simplify the complexity, only the cluster leader persists transitionally prepackaged plugins.
Unfortunately, this too is complicated, since on upgrade to the first version with the transitionally prepackaged plugin, there is no guarantee that server will be the leader. In fact, as all nodes restart, there is no guarantee that any newly started server will start as the leader. So the persistence has to happen in a job-like fashion. The migration system might work, except we want the ability to run this repeatedly as we add to (or update) these transitionally prepackaged plugins. We also want to minimize the overhead required from the server to juggle any of this.
As a consequence, the persistence of transitionally prepackaged plugins occurs on every cluster leader change. Each server will try at most once to persist its collection of transitionally prepackaged plugins, and newly started servers will see the plugins in the filestore and skip this step altogether.
The current set of transitionally prepackaged plugins include the following, but this is expected to change:
* focalboard
* complete list of transitionally prepackaged plugins
* update plugin_install.go docs
* updated test plugins
* unit test transitionally prepackged plugins
* try restoring original working directory
* Apply suggestions from code review
Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com>
* clarify processPrepackagedPlugins comment
---------
Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com>
* Making all the counts aware of Remote users
* Disable login for remote users
* Adding tests for login remote_users error
* Adding tests for the store
* Adding frontend part of not counting remote users in the license
* Addressing PR review comment
* Adding the new ExternaUserId field to users
* Running make migrations-extract
* Running make app-layers and make gen-serialized
* Revert "Adding the new ExternaUserId field to users"
This reverts commit 12e5fd5189.
* Adding GetUserByRemoteID methods
* Adding needed migration for users
* i18n-extract
* Fixing postgres increase remote user id field size migration up and down
* run make gen-serialized
* Removing migration code
* Not count remote users as part of the cloud pricing
* Add the cloud subscription when a user gets promote from remote to not-remote
* Fixing merge problems
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
* Mark category as read
* Fix lint and test
* Fix tests
* Fix test and remove wrong aria
* Address server issues and add mark as read for unreads
* Missing changes
* Fix tests
* fix tests
* Add confirmation popup to mark as read category
* Always use viewMultipleChannels and other fixes
* Remove unneeded code
* Fix test
* Address feedback
* Address feedback
* Fix tests
* Fix test
* Fix tests
* Update aria-haspopup depending on the number of channels to mark as viewed
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
* Revert "POC: Cross-team recent search (#20027)"
This reverts commit aa59c28b04, preserving
a few code tidyings unrelated to the original PR.
* Revert "Add feature flag for command palette (#20011)"
This reverts commit c78c5ce3f3.
* add base for calling the endpoint
* add endpoint and handler
* update store and layers
* call the endpoint
* align types
* update app layers
* generate mocks
* complete handler
* finish store query
* add todos
* add ui for member count
* add selector
* add a todo
* add cache layer
* optimize calls in FE
* handle invalidation of the cache
* fix go style
* fix test
* use existing channel layer count
* fix import error
* delete unnecessary code
* write tests for channel cache layer
* fix testname
* fix mocks
* fix cache layer test
* fix a test
* really fix the test
* write more tests for server
* address PR comments
* remove comment
* rename more_channels to browse_channels
* fix style
* update snapshot
* add translations
* Revert "add translations"
This reverts commit 56476a5dab.
* add only related translations
* address PR review points
* add test
* fix test
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
* add teams to allowed frame-ancestors
* fix unit tests
* set SameSite attribute for session cookie
* further restrict ancestors
* skip landing page if in iframe
* Only set cookie SameSite=None if embedded in iframe
* don't set MMEMBED cookie on landing page (check only)
* fully parse MMEMBED cookie
* add comment
* more comments
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
* WIP
* Add rate limiting for desktop token API
* Missing mocks
* Style fixes
* Update snapshots
* Maybe use an actual redirect link :P
* Refactoring for tests
* Add tests for server
* Fix lint issue
* Fix tests
* Fix lint
* Add front-end screen component
* Component logic
* Style changes
* Quick style fix
* Lint fixes
* Initial PR feedback
* Enable logging into the browser as well when completing the login process
* Refactor to push more logic to the other component
* Remove unnecessary helper code
* Fix i18n
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
* temp commit
* update test to allow bot creation
* add bot check to updateUser and deleteUser
* add more unit tests
* lint fixes
* lint fix
* update based on doc
* add more unit tests
* lint fixes
* fix unit tests
* fix unit tests
---------
Co-authored-by: Mattermost Build <build@mattermost.com>