summaryrefslogtreecommitdiffstats
path: root/webapp/client
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-11-24 09:35:09 -0500
committerHarrison Healey <harrisonmhealey@gmail.com>2016-11-24 09:35:09 -0500
commit981ea33b8e10456bc279f36235c814305d01b243 (patch)
tree00fb6119d9ef16f60d4c0dbdaad1bd6dfbc347ed /webapp/client
parentc96ecae6da31aceabf29586cde872876b81d11d9 (diff)
downloadchat-981ea33b8e10456bc279f36235c814305d01b243.tar.gz
chat-981ea33b8e10456bc279f36235c814305d01b243.tar.bz2
chat-981ea33b8e10456bc279f36235c814305d01b243.zip
PLT-4403 Add server-based channel autocomplete, search and paging (#4585)
* Add more channel paging API * Add channel paging support to client * Add DB channel search functions * Add API for searching more channels * Add more channel search functionality to client * Add API for autocompleting channels * Add channel autocomplete functionality to the client * Move to be deprecated APIs to their own file * Final clean-up * Fixes related to feedback * Localization changes * Add unit as suffix to timeout constants
Diffstat (limited to 'webapp/client')
-rw-r--r--webapp/client/client.jsx29
1 files changed, 29 insertions, 0 deletions
diff --git a/webapp/client/client.jsx b/webapp/client/client.jsx
index a7d7a5c8a..38cc2f111 100644
--- a/webapp/client/client.jsx
+++ b/webapp/client/client.jsx
@@ -1362,6 +1362,7 @@ export default class Client {
this.track('api', 'api_channel_get');
}
+ // SCHEDULED FOR DEPRECATION IN 3.7 - use getMoreChannelsPage instead
getMoreChannels(success, error) {
request.
get(`${this.getChannelsRoute()}/more`).
@@ -1371,6 +1372,34 @@ export default class Client {
end(this.handleResponse.bind(this, 'getMoreChannels', success, error));
}
+ getMoreChannelsPage(offset, limit, success, error) {
+ request.
+ get(`${this.getChannelsRoute()}/more/${offset}/${limit}`).
+ set(this.defaultHeaders).
+ type('application/json').
+ accept('application/json').
+ end(this.handleResponse.bind(this, 'getMoreChannelsPage', success, error));
+ }
+
+ searchMoreChannels(term, success, error) {
+ request.
+ post(`${this.getChannelsRoute()}/more/search`).
+ set(this.defaultHeaders).
+ type('application/json').
+ accept('application/json').
+ send({term}).
+ end(this.handleResponse.bind(this, 'searchMoreChannels', success, error));
+ }
+
+ autocompleteChannels(term, success, error) {
+ request.
+ get(`${this.getChannelsRoute()}/autocomplete?term=${encodeURIComponent(term)}`).
+ set(this.defaultHeaders).
+ type('application/json').
+ accept('application/json').
+ end(this.handleResponse.bind(this, 'autocompleteChannels', success, error));
+ }
+
getChannelCounts(success, error) {
request.
get(`${this.getChannelsRoute()}/counts`).