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

Fixes SearchResults not displaying posts when searching #2012

Closed
wants to merge 0 commits into from
Closed

Fixes SearchResults not displaying posts when searching #2012

wants to merge 0 commits into from

Conversation

HyperTHD
Copy link
Contributor

@HyperTHD HyperTHD commented Mar 23, 2021

Issue This PR Addresses

No issue was made for this PR

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 addresses the SearchResults page not properly displaying posts. This page originally used the telescopeURL, which was the original backend url used here. I switched the url to the new posts service url, which will correctly pull in the search microservice url. This bug was found when debugging #1910 and should hopefully help frontend developers working on the frontend search related components

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)

@@ -56,7 +56,7 @@ type SearchResultProps = {
const SearchResults = ({ text, filter }: SearchResultProps) => {
const classes = useStyles();
const prepareUrl = (index: number) =>
`${telescopeUrl}/query?text=${encodeURIComponent(text)}&filter=${filter}&page=${index}`;
`${postsServiceUrl}/query?text=${encodeURIComponent(text)}&filter=${filter}&page=${index}`;
Copy link
Contributor

Choose a reason for hiding this comment

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

A lot of our current config URLs deal with adding the end-point (i.e., /query), see https://github.com/Seneca-CDOT/telescope/blob/master/src/web/src/config.ts#L15-L18. I wonder if we should do the same, so you'd do:

${postsServiceUrl}?text=${encodeURIComponent(text)}&filter=${filter}&page=${index};

Copy link
Contributor

Choose a reason for hiding this comment

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

Another question: why are we doing a search (/query) at the posts URL?

@@ -56,7 +56,7 @@ type SearchResultProps = {
const SearchResults = ({ text, filter }: SearchResultProps) => {
const classes = useStyles();
const prepareUrl = (index: number) =>
`${telescopeUrl}/query?text=${encodeURIComponent(text)}&filter=${filter}&page=${index}`;
`${postsServiceUrl}/query?text=${encodeURIComponent(text)}&filter=${filter}&page=${index}`;
Copy link
Contributor

Choose a reason for hiding this comment

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

Another question: why are we doing a search (/query) at the posts URL?

@HyperTHD
Copy link
Contributor Author

HyperTHD commented Mar 23, 2021

I done goofed up here. This PR should be switching to the ElasticSearch microservice url, not the posts microservice url. ELK is used here to index posts. This PR will have to either be closed, or wait until #1802 is merged

@HyperTHD
Copy link
Contributor Author

Filed #2014 to successfully link to this issue. This issue can also deal with moving the search service to production/staging since that'll also be needed for the frontend to work

@humphd
Copy link
Contributor

humphd commented Mar 26, 2021

You haven't dealt with my review comments, are you planning to fix? If not, let's close this.

@humphd humphd added the Blocked Can't do this, until something else is done label Mar 26, 2021
@humphd humphd added this to the 2.0-alpha Release milestone Mar 26, 2021
@humphd
Copy link
Contributor

humphd commented Mar 26, 2021

This is waiting on #1802. We need the Search service in place before we can update this URL.

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.

Did your actual changes get lost here?

@HyperTHD
Copy link
Contributor Author

HyperTHD commented Apr 5, 2021

Did your actual changes get lost here?

They did, it's nothing minor since the change I made did not work, but I do need to fix the history here as well

@chrispinkney
Copy link
Contributor

What's going on with this? Think we can get it for today's release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: deployment Production or Staging deployment area: front-end area: microservices Blocked Can't do this, until something else is done
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants