Commit Graph

948 Commits

Author SHA1 Message Date
Jesús Espino
49e0473753 MM-11567: Autocomplete search in: for DMs and GMs (#9430)
* MM-11567: Autocomplete search in: for DMs and GMs

* Adding unit tests

* Allowing to search Direct Messages in the autocompletion

* Fix it in TE
2018-09-27 16:15:41 +02:00
Jesús Espino
89852d04c0 When leave a channel the push notification can fail (#9478) 2018-09-27 15:10:09 +01:00
Harshil Sharma
af275fe924 #MM-12130 changes for custom service terms (#9450)
* #MM-12130 changes for custom service terms

* Fixed styling

* Added getServiceTerms API

* removed unnecessary panic

* removed custom service terms text from flat config

* reverted user sql store as those changes are no longer needed

* added tests

* Updated a config key to be more standard

* Added copyright info

* Loading service terms only if the feature is enabled

* Loading service terms only if the feature is enabled

* removed unused index

* added createservice termns API

* made a param to bool instead of string

* added createservice termns API

* review fixes

* fixed styling

* Minor refactoring

* removed saveConfig and loadConfig magic

* added empty service terms text check to createServiceTerms API

* refactoed some urls to be terms_of_service instead of service_terms

* removed check for support settings

* changed URLs in tests

* removed unused code

* fixed a bug

* added service termd id in conif

* fixed a test

* review fixes

* minor fixes

* Fixed TestCreateServiceTerms
2018-09-26 16:49:22 -04:00
Harrison Healey
4e59a27293 Move HTTPService and ConfigService into services package (#9422)
* Move HTTPService and ConfigService into utils package

* Re-add StaticConfigService

* Move config and http services into their own packages
2018-09-26 12:42:51 -04:00
Jesús Espino
15d64fb201 MM-7188: Cleaning push notification on every read, not only on channel switch (#9348)
* MM-7188: Cleaning push notification on every read, not only on channel switch

* Removed unnecesary goroutine

* Fixing tests

* Applying suggestion from PR
2018-09-26 16:34:12 +02:00
Christopher Speller
37e00ef916 Adding paging to elasticsearch API. (#9425) 2018-09-26 10:27:04 -04:00
Jesús Espino
bfec808e53 Idiomatic error handling for app/file.go (#9456) 2018-09-25 16:23:23 -04:00
Jesús Espino
7636650a25 Migrate to idiomatic error handling app/a*.go and app/b*.go (#9455) 2018-09-25 08:42:06 -04:00
Jesús Espino
a4ae404473 Migrate to idiomatic error handling app/authentication.go (#9411) 2018-09-24 22:22:24 +02:00
Jesús Espino
38529ca23c Add missing dots (fixing compilation error on go 1.11) (#9448) 2018-09-24 12:00:28 -07:00
Jesús Espino
847f30a13b MM-11707: Change the default setting for EDIT_OTHERS_POSTS (#9447)
* MM-11707: Removes edit_others_posts permission from the team_admin role in MakeDefaultRoles().

* MM-11707: Tests fix.

* MM-11707: Update test store.

* MM-11707: Allow to change the permission for edit the others posts on TE

* Fixing tests
2018-09-24 15:35:39 +02:00
Jesús Espino
9d73c79def Idiomatic error handling for app/c*.go (#9423) 2018-09-24 13:27:31 +02:00
Jesús Espino
8898d7aab9 Idiomatic error handling for app/e*.go (#9426) 2018-09-24 12:52:29 +05:30
Jesús Espino
a08df883b4 Move file backend to its own service (#9435)
* Move file backend to its own service

* Moving utils/inbucket to mailservice package
2018-09-20 10:07:03 -07:00
Christopher Speller
3ea33b76f8 Improving token lookup. (#9436) 2018-09-20 10:23:44 -04:00
Hanzei
1463df21a5 Add ChannelId and TeamId to PostActionIntegrationRequest (#9384)
* Add ChannelId and TeamId to PostActionIntegrationRequest

* Add tests
2018-09-19 08:39:36 -04:00
Jesús Espino
c2496911c0 Migrate to idiomatic error handling the first half to the app/channel.go (#9413) 2018-09-17 23:10:57 +02:00
Harrison Healey
6c2a5555b8 MM-11700 Clean up handling of user display names for notifications (#9343)
* MM-11700 Clean up handling of user display names for notifications
2018-09-18 00:20:12 +05:30
George Goldberg
ab99f0656f MM-11781: Basic Data Export Command Line. (#9296)
* MM-11781: Basic Data Export Command Line.

* ChannelStore new unit tests.

* TeamStore new unit tests.

* Unit test for new UserStore function.

* Unit tests for post store new methods.

* Review fixes.

* Fix duplicate command name.
2018-09-17 15:51:26 +01:00
Charles Birk
a755bcdde6 [MM-11860]: Expose slack attachment parsing functions in the model package (#9351)
Refactored parseSlackAttachment functions from https://github.com/mattermost/mattermost-server/blob/master/app/post.go#L312
into model/slack_attachments.go so that plugins have access to them.
2018-09-17 10:15:28 -04:00
Jesús Espino
7226ea7dfb MM-12045: Fix MFA for ldap accounts (#9420) 2018-09-17 09:12:07 -03:00
FurmanovD
517faccc33 MM-11424 Extend bulk import to support themes across teams(#9305) (#9419)
* MM-11424 Extend bulk import to support themes across teams(#9305)

Also added:
Advanced Settings:
+'feature_enabled_markdown_preview'
+'formatting'
Sidebar Settings:
+'show_unread_section'

* MM-11424 (PR review) user teams' theme validator test updated

* MM-11424 (PR review) added test with valid JSON of invalid theme(by structure)

JSON string contains numeric and JSON object fields, not just a correct "string":"string" map
2018-09-17 11:46:06 +01:00
Carlos Tadeu Panato Junior
35c148d255 fixing log messages (#9341)
* fixing log messages

* update per review

* Update notification.go

* Update server.go

* Update notification.go
2018-09-17 09:29:04 +02:00
Jesús Espino
4fb7817610 Migrate to idiomatic error handling the second half to the app/channel.go (#9414) 2018-09-17 08:05:05 +02:00
Jesse Hallam
f2ddef9117 MM-11734: better plugin error handling (#9405)
* MM-11734: encode unregistered error implementations as an ErrorString

* MM-11734: test error string handling

* more idiomatic error handling
2018-09-13 11:31:22 -07:00
Jesse Hallam
8b17bf9e42 MM-11886: materialize channel search (#9349)
* materialize PublicChannels table

Introduce triggers for each supported database that automatically maintain a subset of the Channels table corresponding to only public channels. This improves corresponding queries that no longer need to filter out 99% DM channels.

This initial commit modifies the channel store directly for easier code reviewing, but the next wraps an experimental version around it to enable a kill switch in case there are unforeseen performance regressions.

This addresses [MM-11886](https://mattermost.atlassian.net/browse/MM-11886) and [MM-11945](https://mattermost.atlassian.net/browse/MM-11945).

* extract the experimental public channels materialization

Wrap the original channel store with an experimental version that
leverages the materialized public channels, but can be disabled to
fallback to the original implementation.

This addresses MM-11947.

* s/ExperimentalPublicChannelsMaterialization/EnablePublicChannelsMaterialization/

* simplify error handling

* move experimental config listener until after store is initialized
2018-09-13 13:47:17 -04:00
George Goldberg
0a5f792d2d MM-11230: Make permissions checks in commands failsafe. (#9392)
Also add additional unit tests to make sure the permissions tests are
completely solid.
2018-09-12 10:32:05 -04:00
Jesús Espino
e32581aef3 MM-11725: Add specific autocomplete endpoint for search autocomplete (#9337) 2018-09-11 22:45:31 +02:00
alezakos
d585f9d9a3 MM-11895: Don't crush user-provided GET parameters on slash command URLs (#9372) 2018-09-11 15:58:57 -04:00
Carlos Tadeu Panato Junior
1f87596e75 Merge release-5.3 2018-09-10 16:13:21 +02:00
Christopher Speller
a8d116b381 Speed up search results post selection. (#9380) 2018-09-10 15:20:01 +02:00
Harrison Healey
435ce3df4b Stop re-wrapping password reset email error in another error (#9382) 2018-09-10 07:42:59 -04:00
Harrison Healey
e39ab5c7dc MM-12007 Add max dimensions to emoji images (#9379) 2018-09-10 07:38:04 -04:00
Harrison Healey
0027d99855 MM-11855 Add App.HTTPService to allow mocking of HTTP client (#9359)
* MM-11855 Add App.HTTPService to allow mocking of HTTP client

* Initialize HTTPService earlier
2018-09-07 09:24:18 -04:00
Carlos Tadeu Panato Junior
153b119092 Merge release-5.3 2018-09-03 14:48:14 +02:00
Daniel Schalla
531897b1f0 add megacheck as makefile target (#9288)
Fix code issues in channel_test.go

Fix Channel Test Issues detected by Megacheck

Fix API Emoji Test Issues detected by Megacheck

Fixed API Issues Reported by Megacheck

Fixed App issues reported by megacheck

Remaining fixes

removed test added by mistake from old HEAD

gofmt

Store Fixes

simplified returns

Fix test for multi member channel delete

revert to delete unused function
2018-09-03 14:08:40 +02:00
Christopher Speller
9f46512759 MM-11693 Allow connections to /plugins for interactive message buttons. (#9333)
* Allow connetions to /plugins for interactive message buttons.

* Adding siteurl to exclusions for AllowedUntrustedInternalConnections

* Adding subpath support for allowing interactive message buttons plugin connections.
2018-09-02 09:30:10 +02:00
Sudheer
570c52b4cc MM-11710 Add a check to webhook messages to populate username from DM channel for email subject (#9314) 2018-08-30 13:07:36 +02:00
Joram Wilander
9c76d9ba00 Add GetLDAPUserAttributes method to the plugin API (#9326) 2018-08-29 11:07:27 -07:00
Jesús Espino
0291730c2f MM-11270: Forbid react/de-react in archived channels (#9323) 2018-08-29 15:07:37 +02:00
Pradeep Murugesan
7a3cf112c5 9304 added the attachments import to direct post (#9308) 2018-08-29 14:27:44 +02:00
Jesús Espino
ae3865b539 MM-10532: Add EnableSyncWithLdapIncludeAuth config (#9319) 2018-08-28 19:49:01 +02:00
Dmitry Samuylov
42806ae965 Feature/search after before on (#9219)
* initial implementation of after, before, on search flags allowing to restrict the search to a specific day or a date range

* missed setting beforeDate in SearchParams in one place

* fixed condition when only flags are used for search without any plain terms

* changed date format used for after/before/on flags to be in ISO8601 format as suggested in PR comments, added a helper function to pad month and day with zeroes allowing the user user either format, with or without leading zeroes

* corrected expected compare to date setting for the TestParseDateFilterToTimeISO8601 test

* fixed a bug for the scenario when you only have the date flags without any terms, added a couple of tests for that scenario

* updated the date filter logic to use parameters to construct the query instead of simply appending strings together, as suggested in the pull request comments

* added search unit test using date flags

* added a helper function to create a test post with a createat date manually set, updated the test for search using date flags to create test posts with different createat dates to be able to better test the functionality

* MM-11817 Add support for after/before/on search flags with Elasticsearch

* add support to search posts to perform the search in context of the client's timezone when filtering by createat date using on: after: before: flags

* updated tests to match the new signature
2018-08-28 13:09:32 -04:00
Gabe Van Engel
347ee1d205 MM-11327: Restrict Teams by Email (#9142)
* Check a team's AllowedDomains setting before adding users to the team.

* Updated AddUser tests to validate AllowedDomains restriction.

* Updated variable name to match convention.

* Removed AllowedDomains from team sanitization.

* Update AppError's Where to match the calling function.

* Added tests for user matching allowedDomains, and multi domain values of allowedDomains.

* Added test to make sure we block users who have a subdomain of a whitelisted domain.

* Revert "Removed AllowedDomains from team sanitization."

This reverts commit 17c2afea584da40c7d769787ae86408e9700510c.

* Update sanitization tests to include dockerhost, now that we enforce AllowedDomains.

* Added tests to verify the interplay between the global and per team domain restrictions.

* Validate AllowedDomains property against RestrictCreationToDomains before updating a team.

* Remove team.AllowedDomains from sanitization.

* Add i18n string for the team allowed domains restriction app error.
2018-08-28 11:06:57 -04:00
Jesús Espino
19e69681d7 Adding IdAttribute setting for SAML (#9291)
* Adding IdAttribute setting for SAML

* Adding Saml Id Attribute to the diagnostics information

* Adding entry to default.json
2018-08-28 11:56:40 +02:00
Joram Wilander
4de2e5206e Support for interactive menus in message attachments (#9285) 2018-08-24 11:16:17 +01:00
Carlos Tadeu Panato Junior
5876b52ecd Merge release-5.2 2018-08-24 11:36:39 +02:00
Jesús Espino
bba3bbd9f3 MM-11572: Force correct order on messages generated in the bulk (#9244) 2018-08-24 09:53:44 +02:00
George Goldberg
8bbee74ed8 MM-11348: Add telemetry for advanced permissions. (#9249) 2018-08-23 11:48:57 +01:00
George Goldberg
d2945cdd77 MM-11782: Make archived channels experimental and off-by-default. (#9281)
* MM-11782: Make archived channels experimental and off-by-default.

* Fix test.
2018-08-22 21:12:51 +02:00