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

Fix #1260: Added frontend support for autocomplete #1411

Closed
wants to merge 15 commits into from

Conversation

MSTEWARDSON
Copy link
Contributor

Issue This PR Addresses

Fixed #1260

Type of Change

  • Bugfix: Change which fixes an issue
  • New Feature: Change which adds functionality
  • Documentation Update: Change which improves documentation
  • UI: Change which improves UI

Description

This PR is for implementing the front-end portion of the author autocomplete. With this SearchBar can now pick between two different input's depending on the filter value. From here the author input has a data-list attached to it that I can later add in the back-end support for all author names.

Currently there is some fake data in the data-list just to show how it works. If approved I will remove before merge.

Checklist

  • Quality: This PR builds and passes our npm test and works locally
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Screenshots: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not (if applicable)
  • Documentation: This PR includes updated/added documentation to user exposed functionality or configuration variables are added/changed or an explanation of why it does not(if applicable)

Copy link
Contributor

@humphd humphd left a comment

Choose a reason for hiding this comment

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

This is really good stuff. I made some comments on things to fix, then I think this is pretty close to being ready.

One other thing we need is for you to file a new issue to add the backend changes for doing the author name autocomplete via our REST API, and hooking it up to this frontend code. You can link back to this PR so people can see what you did here, and what's left.

package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
src/frontend/src/components/SearchBar/SearchBar.jsx Outdated Show resolved Hide resolved
src/frontend/src/components/SearchBar/SearchBar.jsx Outdated Show resolved Hide resolved
src/frontend/src/components/SearchInput/SearchInput.jsx Outdated Show resolved Hide resolved
src/frontend/src/components/SearchInput/SearchInput.jsx Outdated Show resolved Hide resolved
src/frontend/src/components/SearchInput/SearchInput.jsx Outdated Show resolved Hide resolved
src/frontend/src/components/SearchInput/SearchInput.jsx Outdated Show resolved Hide resolved
src/frontend/src/components/SearchInput/SearchInput.jsx Outdated Show resolved Hide resolved
Copy link
Contributor

@humphd humphd left a comment

Choose a reason for hiding this comment

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

This is excellent, great job.

Based on my testing, I want two more small CSS tweaks.

Also, do we need to repeat the input style in both Author and Post search components? Could we not move that up to the parent SearchInput component and only do it once? Duplicate code like this is problematic because people will change one but forget the other. If they have to be split like this, that's fine, but it would be good to DRY this code out a bit more.

Finally, you need to rebase to fix a merge conflict with master. To do that:

git checkout master
git pull upstream master
git checkout issue-1260
git rebase master
...fix the conflict
git add <file-you-fixed>
git commit -m "..."
git push origin issue-1260 -f

I'd love to get this merged today if possible, so I can include it in the 1.4 release.

height: '55px',
backgroundColor: theme.palette.background.default,
paddingLeft: '10px',
border: '1px solid #B3B6B7',
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add an outline: none, here too so we don't get a double border when selected.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

height: '55px',
backgroundColor: theme.palette.background.default,
paddingLeft: '10px',
border: '1px solid #B3B6B7',
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add an outline: none, here too so we don't get a double border when selected.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@@ -0,0 +1,60 @@
import React from 'react';
<<<<<<< HEAD
Copy link
Contributor

Choose a reason for hiding this comment

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

Your rebase didn't work, can you fix this?

@@ -0,0 +1,126 @@
import React from 'react';
import PropTypes from 'prop-types';
<<<<<<< HEAD
Copy link
Contributor

Choose a reason for hiding this comment

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

Same issue here.

@MSTEWARDSON
Copy link
Contributor Author

When I get rebase now it says the current branch is up to date already.

@humphd
Copy link
Contributor

humphd commented Nov 19, 2020

It's up to date in terms of commits being in your line of development, but you haven't successfully dealt with merge conflict. All the conflict markers are still in those files. Look at the code.

@MSTEWARDSON
Copy link
Contributor Author

Yeah I'm currently looking. Fixed the issue within AuthorSearchInput.jsx, but I do not see the issue within SearchInput.jsx

@humphd
Copy link
Contributor

humphd commented Nov 19, 2020

Filed #1414 to add the backend support we need to make this feature work. cc @StellaJung-Student, @joelazwar as well, who have been working on the Elasticsearch backend too.

@humphd
Copy link
Contributor

humphd commented Nov 19, 2020

Closing in favour of #1418

@humphd humphd closed this Nov 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add autocomplete to search for Authors
2 participants