Commit Graph

18285 Commits

Author SHA1 Message Date
Harshil Sharma
4fda7e6f34
Moved some common SQL function to public utils as they are used in plugins (#26412)
* Moved some common SQL function tu public utls as they are used in plugins

* goimported file

* Added tests

* Created sub-package

* MOved SetupConnection to public sql utils
2024-03-11 09:54:23 +05:30
Agniva De Sarker
f34445a6f4
MM-56625: Use patchConfig to update configs from system console (#26332)
While updating config from admin console, the webapp would set
any config param to null if the user doesn't have permission to edit
that setting.

This is common in cloud environments where a lot of config settings
are set to `cloud_restrictable`.

The problem due to that is since the client uses the updateConfig
endpoint, this acts as a full config replace and therefore, the null
fields get replaced by their default values.

To fix this, we use the patch endpoint which only updates the fields
that are actually set.

https://mattermost.atlassian.net/browse/MM-56625

```release-note
Fix a bug where config cannot be updated from admin console
in cloud environments.
```


Co-authored-by: Mattermost Build <build@mattermost.com>
2024-03-08 21:21:23 +05:30
Scott Bishel
1eec4ad30f
MM-56784 - Update wrong documentation link (#26363)
* update documentation link

* update snapshot

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-03-08 08:50:27 -07:00
Agniva De Sarker
89f5a0deec
MM-56402: Initialize replica conn pool on-demand (#26410)
Previously, we would setup both pools only when
GetMasterDB was called. This was inefficient and
would waste open connections if the replica wasn't used
at all.

We fix it to initialize the pools as they are called.

https://mattermost.atlassian.net/browse/MM-56402
```release-note
NONE
```

Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>
2024-03-08 13:11:48 +05:30
sazzad hossain
bc887441d0
MM-56629 Render Markdown in batched email notifications (#26217)
* [MM-56629] rendered markdown in batched email (#26116)

* [MM-56629] added unit test for GenerateHyperlinkForChannels (#26116)

* [MM-56629] refactored code to remove duplicates, updated test (#26116)

* [MM-56629] updated landing url and cleared check-style (#26116)

* [MM-56629] added app-layesrs and mocks (#26116)

* [MM-56629] updated unit tests (#26116)

* [MM-56629] reverted changes of removing unused context parameter (#26116)

* [MM-56629] removed unused method generateHyperlinkForChannels (#26116)

* [MM-56629] fixed check-style error (#26116)

* [MM-56629] refactored (#26116)

---------

Co-authored-by: Sazzad Hossain <sazzad.hossain@marginedge.com>
Co-authored-by: Harrison Healey <harrisonmhealey@gmail.com>
2024-03-07 11:27:08 -05:00
Scott Bishel
ab029105fd
MM 56929 Dont allow guests to be set via channel API (#26385)
* don't allow guest to be set only on channels.

* fix bad merge, add jira ticket link

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-03-07 08:44:43 -07:00
Scott Bishel
8e99bca82b
MM-56980 add shared channel icon to searchable channel list (#26388)
* add shared channel icon to searchable channel list

* update css for shared channel icon

* update, so archive happens first
2024-03-07 08:01:14 -07:00
mattermod
19c1165117 Update latest version to 9.5.2 2024-03-07 12:17:08 +00:00
Agniva De Sarker
204c728b08
MM-56879: Migrate caches from store layer to cache layer (#26255)
There were 3 remaining caches which were there in the store layer.
We migrate them to make the store layer fully free
from any caches.

https://mattermost.atlassian.net/browse/MM-56879

```release-note
NONE
```

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-03-07 10:55:28 +05:30
Mario Vitale
d7a77d8c42
CLD-7074 Implement full E2E tests on Github Actions (#26093)
* Move license setting from env var to mmctl upload
* Extract common E2E steps
* Add E2E fulltests
* Fix plugin_startup_fail_spec.js, timeout runners, fix local dashboard run
* Implement reporting script and job
* Bump artifact related actions
* Fix E2E variable generator script
* Skip reporting steps if not required
* Get rid of deprecation warnings
* Fix inbucket hostname parameter
* Support arbitrary refs in test template
* Fix cycle BRANCH var for non-PR commits
---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-03-06 11:27:53 +01:00
Aki
c82352c90c
[MM-57030] Fixed the problem that items with longer text did not widen user guide dropdown to its max-width (#26104)
Co-authored-by: Mattermost Build <build@mattermost.com>
2024-03-06 09:01:54 +01:00
Joram Wilander
b70943707a
Update client and types npm packages to link to monorepo directly (#26346) 2024-03-05 14:39:04 -05:00
Ben Cooke
9d4d5366a1
[MM-56088] Adding extra logs for openId state failures (#25663)
* adding extra logs for openId failures
2024-03-05 13:12:33 -05:00
Dahlton S
fd713ae9bb
[MM-56651] fix: set cache duration (#26338)
* fix: set cache duration

* fix: extra 0
2024-03-05 22:49:26 +05:30
Harrison Healey
eaaf75a232
Fix Rollup warnings and remove some unused Rollup plugins (#26387)
* Fix rollup warnings

* Remove some unused Rollup plugins

* Re-add unintentionally half-removed Stylelint
2024-03-05 09:53:17 -05:00
Anna
3efcef45ff
[GH-21224] return error in plugin cmd (#26305) 2024-03-05 13:18:30 +01:00
Asaad Mahmood
09f78c240a
MM-57077 - Updating channel switcher header (#26384) 2024-03-05 13:50:02 +05:00
Scott Bishel
30454f241d
MM-56881 Validate and ensure valid CustomStatus is stored (#26287)
* don't allow invalid CustomStatus

* allow empty emoji in custom status

* lint fix

* add english translation

* update for review comments.

* fix bad fix

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-03-04 15:53:55 -07:00
Harrison Healey
5740b43922
Upgrade web app and pacakges to TypeScript 5.3.3 (#26354) 2024-03-04 16:07:39 -05:00
Harrison Healey
d5446cd25e
MM-56948 Fix flaky TestUserHasJoinedChannel (#26359)
* MM-56948 Fix flaky TestUserHasJoinedChannel

* Add comment explaining flakiness
2024-03-04 20:16:56 +00:00
Syed Ali Abbas Zaidi
6ba3ac4a02
[MM-56848] Convert ./components/admin_console/settings_group.tsx from Class Component to Function Component (#26258)
Co-authored-by: Mattermost Build <build@mattermost.com>
2024-03-04 14:44:05 -05:00
Scott Bishel
e0f3713bdf
MM-56929- Dont allow guests to be set via team API (#26286)
* dont allow guests to be set via team API

* comment out invalid test

* Update import_functions_test.go

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-03-04 09:48:11 -07:00
Weblate (bot)
f8253439b8
Translations update from Mattermost Weblate (#26380) 2024-03-04 12:32:40 -04:00
Muzakir Shah
98726b9d22
changed helper text to control-label class (#25969)
* changed helper text to control-label class

* removed the help-text class

* added "helping-text" className

* Updated helping-text color

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-03-02 23:08:29 +05:00
unified-ci-app[bot]
86f6a3c937
Update latest minor version to 9.7.0 (#26364)
Automatic Merge
2024-03-01 19:21:10 +01:00
Ben Schumacher
02379b17ca
Implement plugin KV store in memory (#26244) 2024-03-01 12:12:52 +01:00
Agniva De Sarker
f9861b8666
MM-56987: Improve cache API (#26298)
This is in preparation to make the codebase
ready to use Redis. In Redis, iterating all
the keys at once is an expensive operation.
It is recommended to work on batches of keys.

Remove the Len method as it was unused.

I tried to repurpose the Keys method to iterate
on keys rather than returning all keys at once, but
it has other complicacies because the code calls
other cache functions on those keys, so to handle
the LRU cache properly, it becomes slightly more
painful.

For now, we keep it like this and rather collect
all keys from Redis and then return.

https://mattermost.atlassian.net/browse/MM-56987

```release-note
NONE
```
2024-03-01 09:46:09 +05:30
Ayush Thakur
75e32051c4
Bump prepackage Github plugin version to 2.2.0 (#26218)
Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
2024-02-29 18:45:53 -05:00
Devin Binnie
893c44fe85
[MM-56757] Expand NotificationsLog to include websocket and email, adding much more varied logging across the entire process (#26273)
* [MM-56757] Expand NotificationsLog to include websocket and email, adding much more varied logging across the entire process

* Rework the status/notify prop calls

* Avoid some repetition in the logging calls

* Fix one log

* Wrap error

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-02-29 12:33:05 -05:00
Alejandro García Montoro
2690e1322a
Update dependencies (#26324)
* make update-dependencies

* cd public; go get -u ./...; go mod tidy
2024-02-29 13:19:43 +01:00
bewing
96e5e17d13
Set batched notification email timestamps to user TZ (#26121)
* refactor: migrate getFormattedPostTime to utils

Move app.getFormattedPostTime to utils and export along with its struct

* Set batch notification post times to user TZ

* default useMilitaryTime to false in batched email

If there is an error reading the user's preference for useMilitaryTime,
default to false, as that should be the default value if the user never
sets it.

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-02-29 12:42:34 +01:00
Agniva De Sarker
c9fc6297f3
MM-56877: Reduce usages of SessionHasPermissionToChannelByPost (#26239)
1. For file endpoints, a recent optimization added the ChannelID column
to be part of the fileinfo table. Therefore, we can skip the postID
and directly use the channelID.
2. For post endpoints, we reorder the sequence of calls such that
we get the channelID first, and use it to check the permission of the channel
rather than query the long way around by joining with the posts table
in the permissions query.

  The benefit is that SessionHasPermissionToChannel is cache-backed.
So in the happy path, we save a DB call. Because GetSinglePost anyways
needed to be called.
And in the bad path, we replace it with a more efficient call. Because
SessionHasPermissionToChannel is cache-backed, so effectively we
are replacing SessionHasPermissionToChannelByPost with GetSinglePost.
3. And then for the calls that don't have the channelID available,
we change the implementation itself to get the channelID by querying
the posts table first, and then calling SessionHasPermissionToChannel.
This creates the happy path as mentioned earlier.

While here, we also do some other optimizations:
4. Pre-populate the channelID while saving the reaction, so that
we don't need to query the posts table for every single reaction save.
5. Remove unnecessary goroutine spawning for publishing reaction events,
because anyways those are asynchronous.

https://mattermost.atlassian.net/browse/MM-56877

```release-note
NONE
```

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-02-29 09:34:55 +05:30
Nick Misasi
9e99280a40
[CLD-7046] Ability to disable self hosted server-side requests to CWS (#26070)
* Add 'Disable' config to CloudSettings to prevent the CWS backend from making calls to the Customer Portal

* Add custom error when disabled

* Make Disable setting cloud_restrictable

* Return 422 instead of 400

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-02-28 11:53:19 -05:00
Nick Misasi
9ffec5eab6
[CLD-7029] Add a new system console page for configuring custom export FileSettings (#26034)
* Add a new system console page for configuring custom export FileSettings

* Remove NONE option for ExportDriverName dropdown

* Fix tests

* Fix i18n

* Update webapp/channels/src/components/admin_console/admin_definition.tsx

Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>

* PR Feedback

* Fix formatting

* gofmt

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
2024-02-28 16:06:17 +00:00
Alejandro García Montoro
344c5a7528
MM-56781: Use correct error in doInviteRemote (#26304)
* Use correct error in doInviteRemote

A Sentry crash report identified this nil pointer dereference:
https://mattermost-mr.sentry.io/issues/4930233067/events/eae438652c7b4335be2bbe19c977f680

Interestingly, the stack trace shows the actual crash happening in the
function deferred above this line, which makes sense, given that it's
accessing the returned value, which is now nil as well. However, the
origin of the crash is here, since it's using the previous appErr, which
at this point is ensured to be nil, instead of the error returned by
InviteRemoteToChannel. This makes the returned value that should have
been generated by responsef to no longer exist.

* Test inviting a remote to a channel shared with us

* Improve error when InviteRemoteToChannel fails

* Clarify that channel has remoteID

Co-authored-by: Doug Lauder <wiggin77@warpmail.net>

* gofmt

---------

Co-authored-by: Doug Lauder <wiggin77@warpmail.net>
2024-02-28 14:00:41 +00:00
Ben Schumacher
6dbdfbbcb4
[MM-19869] Remove unused SAML code (#26133) 2024-02-28 13:40:53 +01:00
Antonis Stamatiou
cafcc2ac06
feat: Upgrade github actions for node20 (#26318) 2024-02-28 10:55:04 +02:00
Antonis Stamatiou
61578f7e21
feat: Remove prepackaged plugins from unsupported mattermost server OS (#26310) 2024-02-28 09:09:37 +02:00
Harshil Sharma
6e6deaccf8
marked some missed file APIs (#26279)
* marked some missed file APIs

* Added file handler flag to shared c hannel attachment API
2024-02-27 20:09:16 -06:00
Scott Bishel
b0015c5a5d
MM-56090 Group Search fix (#26128)
* make group search on modal and invite to work like group mentions

* update tests for better coverage

* change it back to startsWith

* update test

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-02-27 17:40:45 -07:00
Ben Schumacher
18f7c3775a
[MM-56890] Expose allocs and mutex pprof profiling data (#26243) 2024-02-27 13:59:42 +01:00
Alejandro García Montoro
994e437f2a
MM-56780: Ensure p.Integration is not nil (#26301)
* Ensure p.Integration is not nil

A Sentry crash report showed that the check
    p.Integration.URL != input.integration.URL
was dereferencing a nil pointer. At that point in the code,
input.Integration is known to be non-nil, but we still need to check
whether the original, p.Integration, is.

Crash report: https://mattermost-mr.sentry.io/issues/4918263046/events/5738b67edcee4c9c883d40f7d26563a6

* Test nil original integration and both nil
2024-02-27 13:52:52 +01:00
Asaad Mahmood
a65de52c90
MM-56965 - Updating header icon value (#26284) 2024-02-27 16:56:21 +05:00
Syed Ali Abbas Zaidi
590b75e9fc
[MM-56842] Convert ./components/status_icon.tsx from Class Component to Function Component (#26257)
Co-authored-by: Mattermost Build <build@mattermost.com>
2024-02-27 10:13:38 +01:00
Syed Ali Abbas Zaidi
a19e999c11
[MM-56845] Convert ./components/suggestion/suggestion_date.tsx from Class Component to Function Component (#26236)
Co-authored-by: Mattermost Build <build@mattermost.com>
2024-02-27 10:08:49 +01:00
Alejandro García Montoro
fac1245143
Fix "doesn't exists" typo (#26307) 2024-02-27 08:13:12 +05:30
soham
f1a37e06bc
Fix multiple timer issue in CopyButton by using useRef (#26285)
* Fix multiple timer issue in CopyButton by using useRef
This commit resolves a bug where rapidly clicking the Copy button in the CopyButton component would initiate multiple overlapping timers, leading to unpredictable copy state toggling. By utilizing useRef, we now ensure a single timer instance is managed and cleared appropriately, stabilizing the copy functionality.

* Remove null assignment to timerRef.current before setting new timeout

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-02-26 16:51:27 -05:00
goooov
d788ece25d
[MM-56661] Fix: When deleting a draft you have to move your cursor away from the card and back to activate the buttons (#26170)
* [MM-56661] fix: hover logic changed to onMouseOver

* fix: updated snapshots

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-02-26 16:48:05 -05:00
Harrison Healey
0d2053aa5c
MM-56985 Remove babel-plugin-lodash (#26295) 2024-02-26 16:47:26 -05:00
Syed Ali Abbas Zaidi
48117fb21f
[MM-56850] Convert ./components/modal_controller/modal_controller.tsx from Class Component to Function Component (#26259)
* [MM-56850] Convert `./components/modal_controller/modal_controller.tsx` from Class Component to Function Component

* fix: failing type check
2024-02-26 16:04:36 -05:00