forked from Ivasoft/mattermost-mobile
* initial partial implementation of search date flags UI (on: before: after:) * Make the calendar show correctly * dismiss keyboard when showing the date suggestion since this type of input will primarily be entered through the calendar and later edited if needed * fixed code style errors * updates as per pull request comments * fixed eslint errors * changes as per pull request comments, removing unnecessary code * added handling for hiding the date filter feature if the server version doesn't support it * fixed eslint errors * removed unnecessary property defaults and server version checks, as per PR suggestions * this default is needed for the initial load of the component * changed the way we capture the flag from the search string, this handles scenarios where multiple flags might be present in the search string that are handled by the same suggestion component as is the case here with date based flags * need property declared to pass jslint rules * eslint style fix, moved regex out into constants * removed unused code and references * updated as per pull request feedback * updated to latest redux version * changed to new search posts api that supports passing in of time zone utc offset to support date based search flags * updated to the upcoming release version in preparation for merging to master * Properly memoize DateSuggestion mapStateToProps * Remove moment-timezone
14 lines
493 B
JavaScript
14 lines
493 B
JavaScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
export const AT_MENTION_REGEX = /\B(@([^@\r\n\s]*))$/i;
|
|
|
|
export const AT_MENTION_SEARCH_REGEX = /\bfrom:\s*(\S*)$/i;
|
|
|
|
export const CHANNEL_MENTION_REGEX = /\B(~([^~\r\n]*))$/i;
|
|
|
|
export const CHANNEL_MENTION_SEARCH_REGEX = /\b(?:in|channel):\s*(\S*)$/i;
|
|
|
|
export const DATE_MENTION_SEARCH_REGEX = /\b(?:on|before|after):\s*(\S*)$/i;
|
|
|
|
export const ALL_SEARCH_FLAGS_REGEX = /\b\w+:/g; |