Commit Graph

17706 Commits

Author SHA1 Message Date
Antonis Stamatiou
7bf9be2619
fix: Add new dev registry for pr artifacts (#25341) 2023-11-14 15:04:00 +02:00
KIMBOH LOVETTE
29cd6177c0
[GH-21565]-Add the request context and logger to all public methods in server/channels/app/audit.go (#25368) 2023-11-14 13:34:47 +01:00
Paul-Stern
5f8133254d
[MM-55304] Migrate "server/channels/store/searchlayer/user_layer.go" to use GenericStoreResult (#25351)
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
2023-11-14 10:18:10 +01:00
Syed Ali Abbas Zaidi
620acc029a
[MM-55334] Migrate ./components/admin_console/blockable_link/blockab_link.tsx from Class Component to Function Component (#25386)
* [MM-55334] Migrate `./components/admin_console/blockable_link/blockable_link.tsx` from Class Component to Function Component

* refactor: use prop destructuring

* fix: Implement useCallback to avoid unwanted renders

* refactor: import mouse event type from react

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-11-14 10:02:09 +01:00
Syed Ali Abbas Zaidi
b5bbe278eb
[MM-55333] Convert ./components/post_view/floating_timestamp/floating_timestamp.tsx from Class Component to Function Component (#25401)
Co-authored-by: Mattermost Build <build@mattermost.com>
2023-11-14 10:01:10 +01:00
Christopher Poile
5dea20dd3e
MM-54963 - Update prepackaged calls to v0.21.0
Co-authored-by: Mattermost Build <build@mattermost.com>
2023-11-13 21:27:09 -05:00
Syed Ali Abbas Zaidi
71ea829328
[MM-55332] Convert ./components/permissions_gates/channel_permission_gate.tsx from Class Component to Function Component (#25399)
* [MM-55332] Convert `./components/permissions_gates/channel_permission_gate/channel_permission_gate.tsx` from Class Component to Function Component

* refactor: unify the if conditions

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-11-13 15:37:24 -05:00
Sudhanva-Nadiger
9156770b25
[MM-55326] Convert ./components/post_view/commented_on_files_message/commented_on_files_message.tsx from Class Component to Function Component (#25407)
* covert to func component

* update snap

* minor fix
2023-11-13 15:33:40 -05:00
M-ZubairAhmed
5a14575dee
snapshot (#25411) 2023-11-13 15:13:58 -05:00
Harrison Healey
9397970644
MM-55267 Add ability for server-side Markdown code to understand emojis (#25332)
* MM-55267 Add ability for server-side Markdown code to understand emojis

* Remove unused regex
2023-11-13 14:38:05 -05:00
Ashish Dhama
448d442a0b
[MM-40384]: Channel notification settings modal UX revamp (#24984)
* Move notification preferences modal to new UI

* fix lint issue

* fix i18n

* fix unit test

* fix type issue and lint errors

* fix test case

* move common components to widget modals dir

* fix css issue

* feedback changes

* fix lint and i18n issues

* more feedback changes

* fix issue with mobile notification ui

* fix test

* clean up

* remove name

* fix test

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-11-13 14:20:35 -05:00
Agniva De Sarker
ec88ab4ee9
MM-55295: Improve DB performance of some APIs (#25318)
Load tests show that channelstore.GetMember and
channelstore.GetMembersForUser are among the chief
queries that take up CPU in the DB.

In this PR, we attempt some strategic optimizations to
reduce/optimize calls to channelstore.GetMember

1. Optimize  `(a *App) HasPermissionToChannel`

We replace GetChannelMember with GetAllChannelMembersForUser
because it's cache backed. So although it gets more data,
it does not hit the DB and saves some latency.

2. Optimize getPostsForChannelAroundLastUnread

We repace getChannelMember with getChannelMemberOnly
which is a lite version of the store call which queries
just the ChannelMembers table. This is because
in the app layer, we just use the LastViewedAt attribute.
Therefore, there is no reason to join with 5 tables when
a single table can do the job.

3. Optimize publishWebsocketEventForPermalinkPost

We use GetAllChannelMembersById instead of GetChannelMembersPage
which again joins with a lot of other tables.

4. Optimize countMentionsFromPost

Again, we replace GetChannelMember which is a costly call joining
multiple tables, with GetAllChannelMembersNotifyPropsForChannel
which is cache-backed and gives us just what we need in the app
layer - notify props.

```release-note
Make small optimizations in several DB calls:
- App.HasPermissionToChannel
- getPostsForChannelAroundLastUnread
- publishWebsocketEventForPermalinkPost
- countMentionsFromPost
```

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

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-11-13 21:15:57 +05:30
Nicolas Le Cam
1ed5d87342
Switch to docker compose v2 (#25048) 2023-11-13 14:30:24 +01:00
Antonis Stamatiou
bdb363bd28
fix: Fix about modal version for cloud installations (#25389) 2023-11-13 10:33:47 +02:00
Ben Schumacher
9cf84fb93f
[MM-55412] Use go-style error handling in team_controller (#25402) 2023-11-13 09:13:54 +01:00
Soumyadip Moni
3e3087955b
make use of GenericStoreResult in telemetry.go (#25388) 2023-11-13 11:11:17 +05:30
M-ZubairAhmed
9ac389f506
[MM-53102] Add support for multi-word highlights without notifications in web (#24050)
- Adds a new section under settings/notifications for adding custom multi-word keywords that get highlighted without notification
- Adds a new classname for highlighting words although the styling is the same as mentions highlights
- Added a few components to the ReduxFromProps pattern
- Adds supported type for the hook of PluginComponent type
- Add upsell for highlight without notification
- Moved 'setting_item.tsx' to the components folder
- Improved prop names and function structure for setting_item, setting_item_max and setting_item_min
- Moved 'toggle_modal_button.tsx' to the components folder
- Removed t and utility messages from a few components
- Fixed bug where the tooltip was not getting rendered on restrictedButtons
- Improved the mobile view of the settings modal
- Adds E2E for the feature
2023-11-11 19:33:28 +05:30
Jesse Hallam
48bf4e9bd8
Fix issue 25390 (#25403) 2023-11-10 21:55:33 -04:00
Trivikram Kamat
10026972b5
Migrate AWS SDK for JavaScript v2 APIs to v3 in e2e-tests (#25301) 2023-11-11 00:09:17 +05:30
Aldrin
f74bf47f07
[MM-55102] Replace usage of LocalizedIcon in 'channel_intro_message.tsx' with i/span tags (#25164) 2023-11-10 22:06:06 +05:30
M-ZubairAhmed
1ff1a1312b
upgrade (#25398) 2023-11-10 10:30:34 -05:00
Ben Schumacher
612e4458ef
[MM-55409] Enable revive linter on enterprise code (#25391) 2023-11-10 15:24:12 +01:00
Umar Abid
8e84adb176
[GH-24843]: Fix customize_your_experience overlay position (#25053)
* fix: customize_your_experience tour point position

* fix: overlayPunchOut position

* fix: styling

* fix: styling

* fix: semi-colon typo

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-11-10 09:01:02 -05:00
Paul-Stern
7d92e71daf
[MM-55299] Migrate server/channels/app/notification.go to make use of GenericStoreResult (#25338) 2023-11-10 14:45:02 +01:00
Paul-Stern
a602dcdfb2
[MM-55305] Migrate "server/channels/store/sqlstore/post_store.go" to use GenericStoreResult (#25344)
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
2023-11-10 14:43:39 +01:00
Paul-Stern
3a373fffc0
[MM-55300] Migrate "server/channels/app/post.go" to make use of GenericStoreResult (#25339)
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
2023-11-10 14:41:08 +01:00
Muzakir Shah
e130a37199
Convert status_icon_new.tsx to functional component (#24993)
* Convert  status_icon_new.tsx to functional component

* run the command run npm run fix and npm run test -- -u

* type check error fixed

* revised the changes

* Unintended changes revised.

* Revised changes

* map moved outside of component

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-11-10 10:23:11 +01:00
Ben Schumacher
a31b899818
Wipe LDAP filter when running make config-ldap (#25393) 2023-11-10 09:02:16 +01:00
Pantelis Vratsalis
d9f5cd2740
[MM-52445] Fix double url encoding of oauth redirect URI params (#23176)
* [MM-52445] Fix double url encoding of oauth redirect URI params

* Additional test based on code review

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-11-09 19:18:24 +01:00
Jesse Hallam
c9e71a2dde
Remove workflow failure check in favour of Argo-driven version (#25366)
* Simplify workflow failure check

Consolidate the workflow failure check directly into *-master.yml. This results in some code duplication, but makes it much clearer as to what's going on. While we're in here, remove the legacy reference to the `monorepo` branch when triggering.

* just remove the workflow in favour of the Argo version
2023-11-09 12:01:49 -04:00
Devin Binnie
8bf0c19714
[MM-55165] Remove target=_blank from file preview links (#25317) 2023-11-09 09:21:13 -05:00
Sapna Sivakumar
dc269f244e
[MM-55108] Replace usage of LocalizedIcon in 'user_group_popover.tsx' with i/span tags (#25283) 2023-11-09 15:53:46 +05:30
M-ZubairAhmed
cd58a5baaf
[MM-55339] Improve types for Markdown component (#25350) 2023-11-09 14:17:22 +05:30
Ben Cooke
ee6457c3df
[MM-55009] Remove pre-fetch preference and set new pre fetch limits (#25251)
* remove pre-fetch preference and set new pre fetch limits

* i18n

* adding unit test

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-11-08 17:23:32 -05:00
Claudio Costa
e96fb9c32c
Register WebVTT format to be previewable as text (#25289) 2023-11-08 16:21:26 -06:00
Harrison Healey
be34a5d2df
Run component tests with a real store and use renderWithContext everywhere (#25217)
* Change renderWithFullContext to not mock Redux store

* Remove renderWithIntl and renderWithIntlAndStore

* Rename renderWithFullContext to renderWithContext

* Use renderWithContext for WS context
2023-11-08 17:02:40 -05:00
Santosh
ab349946db
Fixes #25120 - Horizontal scrollbar appearing on slash command autocomplete (#25154) 2023-11-08 15:42:42 -06:00
Harrison Healey
ef66f7beab
MM-54238 Add WebSocket broadcast hook and don't broadcast when other users were mentioned (#24641)
* MM-54238 Initial implementation

* MM-54238 Move websocket hook into app package

* MM-54238 Add tests for mentions in posted websocket messages

* Fix styling

* Fix other styling

* Idiomatic ID naming for new code

* Fix more styles

* Separate hooks to add mentions and followers

* Improved error handling for invalid types in hooks

* Rename HasChanges to ShouldProcess

* Pass broadcast hooks through hubStart

* Add test helper for asserting json unmarshaling

* Fix missing arguments in tests

* Ensure broadcast hooks are sent across the cluster and not to users

* Ensure tests actually cover following a post

* Fix code broken by merge

* Go vet again...

* Deep copy event before processing it with hooks

* Replace RemoveBroadcastHooks with WithoutBroadcastHooks

* Address feedback

* Add helper to fix type information for hook args

* Wrap WebSocketEvent and simplify BroadcastHook

* Address feedback

* Address feedback
2023-11-08 16:17:07 -05:00
Ben Schumacher
5e62ba8ccc
Fix bad merge (#25371) 2023-11-08 12:18:33 -05:00
Nhan Nguyen - Edward
808c6ec6dc
MM-53360 : Scroll to the bottom of channel banner (#24682)
* feat(channel-chat): MM-53360 Scroll to the bottom of channel chat

This commit adds new toast to the channel chat, which allows users to
scroll to the bottom quickly.

As it is needed to be along side with the `Search hint toast`, I needed
to adjust the code inside `hint_toast, toast_wrapper` more than
expected.

- [x] Updated tests/snapshots

* refactor(scroll-to-bottom): MM-53360 Replace if block => separated func

* style: MM-53360 Fix order of imports

* refactor(scroll-to-bottom): MM-53360 Simplify hideScrollToBottonToast

* test(scroll-to-bottom): MM-53360 Migrate test from enzyme to react test

This commit migrates unit tests from `enzyme` to `react-testing-library`.

Besides, it adds new test ids for testing purposes.

* fixup! test(scroll-to-bottom): MM-53360 Migrate test from enzyme to react test

* style: MM-53360 Fix eslint error

* style(hint_toast): MM-53360 Update style to match the design

Decrease the size, and increase the font-weight of the shortcut key.
See more at: https://www.figma.com/file/gbnx8ydTX0bTFIbJ8NWGfR/MM-53360-Scroll-to-bottom-of-chat?type=design&node-id=1101-21615&mode=dev

* feat(scroll-to-bottom): MM-53360 Change condition to show toast

- Hide the toast after clicking "Jump to recents".
- Do not show the toast if the user dismissed it before.

* fixup! feat(scroll-to-bottom): MM-53360 Change condition to show toast

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-11-08 12:13:52 -05:00
Asaad Mahmood
2c82ff85a5
MM-55050 - Updating Terms of Service page (#25163)
* MM-55050 - Updating Terms of Service page

* Updating button group

* Updating button style

* Updating bsstyle

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-11-08 20:35:20 +05:00
Antonis Stamatiou
cfa48dd4c4
fix: Show proper version on about modal (#25370) 2023-11-08 17:24:23 +02:00
Scott Bishel
818a48190e
MM-54774 - update session roles when promote/demote guests (#25156)
* update session roles from user roles.

* update so user is not retrieved again

* return error, rather than log warning

* Update session.go

Fix bad merge

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-11-08 07:27:42 -07:00
KIMBOH LOVETTE
a6ba7163c8
[GH-21566] Add request context and logger to all public methods in server/channels/app/authentication.go (#25270) 2023-11-08 14:39:09 +01:00
Paul Vrn
dd46afacd6
[MM-55004] Add warning log message when app run as root (#25213)
* feat: add log warn when app is run as root user

* Modify warning message

* Move warning message condition to L415

* move check to cmd/mattermost/main.go

* Update server/channels/app/server.go

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

* Moved checkForRootUser to root.go

* format root.go

* remove unnecessary space

---------

Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
2023-11-08 11:39:37 +01:00
Asaad Mahmood
682ce17bc7
MM-50246 - Updating custom styles for login page (#25347)
Co-authored-by: Mattermost Build <build@mattermost.com>
2023-11-08 12:30:50 +05:00
Agniva De Sarker
3563e56a77
MM-54998: Optimize JSON marshalling in websocket broadcast (#25286)
Marshalling a json.RawMessage is not zero overhead. Instead,
it compacts the raw message which starts to have an overhead
at scale.

https://github.com/golang/go/issues/33422

Since we have full control over the message constructed, we
can simply write the byte slice into the network stream.
This gives considerable performance boost.

```
goos: linux
goarch: amd64
pkg: github.com/mattermost/mattermost/server/public/model
cpu: Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz
             │   old.txt    │              new_2.txt              │
             │    sec/op    │   sec/op     vs base                │
EncodeJSON-8   1640.5n ± 2%   289.6n ± 1%  -82.35% (p=0.000 n=10)

             │  old.txt   │             new_2.txt             │
             │    B/op    │    B/op     vs base               │
EncodeJSON-8   528.0 ± 0%   503.0 ± 0%  -4.73% (p=0.000 n=10)

             │  old.txt   │             new_2.txt              │
             │ allocs/op  │ allocs/op   vs base                │
EncodeJSON-8   5.000 ± 0%   4.000 ± 0%  -20.00% (p=0.000 n=10)
```

P.S. No concerns over changing the model API because we are
still using 0.x

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

```release-note
Improve websocket event marshalling performance
```
2023-11-08 12:15:24 +05:30
Akbar Abdrakhmanov
f29fbddef1
[MM-55107] Replace usage of LocalizedIcon in 'update_user_group_modal.tsx' with i/span tags (#25299) 2023-11-08 06:46:30 +05:30
Aydın Davutoğlu
b19b62b83f
Add the request context and logger to all public methods in server/channels/app/auto_responder.go (#25295)
Co-authored-by: Mattermost Build <build@mattermost.com>
2023-11-07 19:25:52 +01:00
Paul-Stern
9596c46115
Mm 55298 generic integration action (#25320) 2023-11-07 12:07:08 +01:00