Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui: Replaces Service listing filterbar with a phrase-editor search #5507

Merged
merged 2 commits into from
Mar 22, 2019

Conversation

johncowen
Copy link
Contributor

@johncowen johncowen commented Mar 19, 2019

This PR marks the beginning of work towards new improved search functionality. Specifically this PR introduces a new phrase-editor component that looks like:

Screenshot 2019-03-19 at 10 26 30

Currently this work is only present on the Services Listing page.

Changes to previous search:

  1. Search is only performed once the enter key has been pushed, or you remove a perviously entered term/phrase.
  2. We can now search using field:term syntax on specific fields. Here for example you can use service:name, tag:name, status:critical. This means you have much more control over what you are searching for.

Technically:

  1. Searching now uses arrays of terms instead of strings, multiple terms means AND
  2. From a URL/bookmarkability perspective we realized we are lucky enough to be able to use 'return' (%0A) as a separator in the URL, ideally I'd like to use filter[]=service:name&filter[]=tag:name but it looks like this is problematic so we avoided that rabbit hole by using 'return'/'0A'

Ignored the previous tests for this as they now break. But we are shelving this work for the moment to come back at a later date.

1. New phrase-editor restricting search to whole phrases (acts on
enter key). Allows removal of previously entered phrases
2. Searching now allows arrays of terms, multiple terms work via AND
@johncowen johncowen requested a review from a team March 19, 2019 12:31
@johncowen johncowen added the theme/ui Anything related to the UI label Mar 19, 2019
@johncowen johncowen requested a review from hannahhearth March 19, 2019 17:36
Copy link

@DingoEatingFuzz DingoEatingFuzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing blocking.

}
searchable.forEach(item => {
item.search(get(this, 'items'));
});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would normally expect this component to accept an action as an argument and call it rather than requiring a searchable as an interface. It limits its reusability.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep agree, this will eventually move up into a wrapping component when we compose more functionality here and wrap it up in a final reusable component.

);
let status;
switch (true) {
case term.indexOf('service:') === 0:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For what it's worth, Ember has had term.startsWith('service:') for ages and startsWith has been standard lib as of ES2015.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah, nice, thankyou! Will sort in a sec.

@johncowen
Copy link
Contributor Author

Hey thanks for this!

I switched out the indexOf usage for the more appropriate startsWith so I'm going to merge this. Just one little note that I forgot to put in the PR description. This isn't definitely going into a release as yet (although it may), theres possibly more work on top of this onto the feature branch we are merging to here.

@johncowen johncowen merged this pull request into feature/ui-search-improved Mar 22, 2019
@johncowen johncowen deleted the feature/ui-phrase-editor branch March 22, 2019 17:27
johncowen added a commit that referenced this pull request Mar 22, 2019
…5507)

1. New phrase-editor restricting search to whole phrases (acts on
enter key). Allows removal of previously entered phrases
2. Searching now allows arrays of terms, multiple terms work via AND
johncowen added a commit that referenced this pull request Apr 29, 2019
…5507)

1. New phrase-editor restricting search to whole phrases (acts on
enter key). Allows removal of previously entered phrases
2. Searching now allows arrays of terms, multiple terms work via AND
johncowen added a commit that referenced this pull request Apr 30, 2019
* ui: Replaces Service listing filterbar with a phrase-editor search (#5507)

1. New phrase-editor restricting search to whole phrases (acts on
enter key). Allows removal of previously entered phrases
2. Searching now allows arrays of terms, multiple terms work via AND
johncowen added a commit that referenced this pull request May 1, 2019
* ui: Replaces Service listing filterbar with a phrase-editor search (#5507)

1. New phrase-editor restricting search to whole phrases (acts on
enter key). Allows removal of previously entered phrases
2. Searching now allows arrays of terms, multiple terms work via AND
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/ui Anything related to the UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants