-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Feature/search after before on #1574
Feature/search after before on #1574
Conversation
…splay the suggestion in a list or date type of a suggestion conditionally based on the provider that triggers handling for the current flag, added conditional triggering of the blur even on the suggestion box (for date presentation we don't want to trigger blur as soon as the suggestion box input loses focus because the daypicker suggestion may require multiple clicks to get to the needed selection, particularly when changing months before selecting a day)
Just took a quick look, noticing some issues:
|
@michaelgamble @wiersgallak this behavior is indicative of the initial implementation and not the latest code, can you guys get the test server re-created with the latest code? all of these issues were fixed already and you'll be able to take a look at @asaadmahmood 's styling updates as well |
Discussed with @dmitrysamuylovpharo, (2) and by extension (1) are out of scope for this PR as it is how autocomplete works now in all parts of the app. Will create a ticket to address this separately |
Green light from QA, moving to dev review |
@hmhealey there's one outstanding item here that doesn't affect functionality and is more of a code refactor we discussed with moving responsibility of telling what type of suggestion presentation we should use to the providers once they have determined that they will handle the current flag, i don't think it makes sense to rush through that refactor or to block the feature just because of it, I can make this update after the main PR is accepted if you agree and are ok with that and we don't find any other issues |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I'm not sure why the readme changed, so that would be nice to get reverted, but it's not a big deal
README.md
Outdated
@@ -48,4 +48,4 @@ Get the Latest News: | |||
- **Email** - Subscribe to our [newsletter](http:https://mattermost.us11.list-manage.com/subscribe?u=6cdba22349ae374e188e7ab8e&id=2add1c8034) (1 or 2 per month) | |||
- **IRC** - Join us on #matterbridge (thanks to [matterircd](https://github.com/42wim/matterircd)) | |||
|
|||
Any other questions, mail us at [email protected]. We'd love to meet you! | |||
Any other questions, mail us at [email protected]. We'd love to meet you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what's changed here since there's no new line changing here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i used that to trigger another build earlier because jenkins got stuck and wasn't picking up the latest changes, pushing this commit worked, it can be reverted, i just removed an empty line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, reverted this change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 👍 . Looks good. I just have few minor questions.
return ( | ||
<DayPicker | ||
onDayClick={this.handleDayClick} | ||
showOutsideDays={true} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit picking here: We can disable all future days here with disabledDays={{after: new Date()}}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried that, and it only visually disabled the days, but you could still view and click on them. I think that's something we can address in a followup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure of course. This is a non-blocking thing. You are right just disabling them is not enough i think we need to use it for onClick to disable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't think it is even needed, let the user select what they want, it doesn't break anything, if they want to select a date in the future, sure, they just won't get any results
SuggestionStore.removeSuggestionsChangedListener(this.props.suggestionId, this.handleSuggestionsChanged); | ||
} | ||
|
||
getContent() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see references of this in code but I don't follow it. How is this called?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove that. It's copied from the SuggestionList component, but that only needs it because of some code that it shares with the SearchSuggestionList, but the SuggestionDate component is completely independent of those two
this.setState(this.getStateFromStores()); | ||
} | ||
|
||
handleOnBlur(event) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we use this?
static propTypes = { | ||
suggestionId: PropTypes.string.isRequired, | ||
location: PropTypes.string, | ||
renderDividers: PropTypes.bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some more holdovers from the SuggestionList
export default class SuggestionDate extends React.Component { | ||
static propTypes = { | ||
suggestionId: PropTypes.string.isRequired, | ||
location: PropTypes.string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any references to this. Do we use this prop?
Spinmint test server destroyed |
<SuggestionDateComponent | ||
suggestionId={this.suggestionId} | ||
location={listStyle} | ||
renderDividers={renderDividers} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hmhealey can you remove these as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sudheerDev i removed these
…component in SuggestionBox
Spinmint test running for more than 7 days. This test server was terminated. |
* initial implementation of UI for date based suggestions * cleaned up some unneeded code that was copied over, added logic to display the suggestion in a list or date type of a suggestion conditionally based on the provider that triggers handling for the current flag, added conditional triggering of the blur even on the suggestion box (for date presentation we don't want to trigger blur as soon as the suggestion box input loses focus because the daypicker suggestion may require multiple clicks to get to the needed selection, particularly when changing months before selecting a day) * cleaned up code to meet requirements of `make check-style` * Updating styling for datepicker * add function to retrieve browser time zone offset in minutes and pass it in seconds to the server when performing a search of posts * updated to latest version of redux * fixed search posts rhs test * fixed error reported from "make check-style" * removed new line at the end to trigger a new build, jenkins wasn't pulling in the latest commit * updated the search help tooltip text as requested in PR * reverted earlier unnecessary change * Remove unused code from SuggestionDate * removed unused properties passed in when initializing SuggestionDate component in SuggestionBox
When filling in a section please remove the help text and the above text.
Summary
This is the UI handling for the feature added in mattermost/mattermost#9219 to be able to use additional flags (
on:
before:
after:
) in search to filter by a date or a date range. This implementation adds a new type of suggestion presentation showing a date picker letting the user find the date they are looking for easierTicket Link
https://mattermost.atlassian.net/browse/MM-11687
Checklist
make check-style
to check for style errors (required for all pull requests)make test
to ensure unit and component tests passed