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

Added support to search for a senator #1329

Closed
wants to merge 15 commits into from

Conversation

MutazAshhab
Copy link
Contributor

This aims to solve need easy way to search for senators #1198 issue.

I made changes to the UI to give the user an example of how to search for a senator. It now rotates between the different examples rather than adding or Senator for Tasmania since the width of the randomly chosen placeholder is unpredictable

UI_changes

The search supports all ways of representing a constituency e.g. Queensland or QLD

However it does not address this comment #1198 (comment) where I believe the user is trying to search for the senator by postcode? Maybe Senator for 3166

@MutazAshhab
Copy link
Contributor Author

Result:

Accepts both Senate for ... and Senator for .... of course case-insensitive

image

@MutazAshhab
Copy link
Contributor Author

Not sure why the build is failing, it passes both rake tasks and rubocop checks

@mlandauer
Copy link
Member

Well I can see from https://app.travis-ci.com/github/openaustralia/publicwhip/builds/246194478 that the CI is failing because the regression tests are failing. The most likely explanation is that what's running locally is not the same as what's running on travis! Maybe you forgot to commit something?

@MutazAshhab
Copy link
Contributor Author

This is a bit weird because I don't have any uncommitted changes. I even went as far as pulling the latest changes from openaustralia:master and rerun the rake and rubocop to have them both pass.

Here is what I get when I run bundle exec rake, bundle exec rubocop, and git status

mutaz@mutaz:~/Documents/repos/publicwhip$ bundle exec rake
/home/mutaz/.rbenv/versions/3.0.0/bin/ruby -I/home/mutaz/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rspec-core-3.11.0/lib:/home/mutaz/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rspec-support-3.11.0/lib /home/mutaz/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rspec-core-3.11.0/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb

Randomized with seed 28701
 386/386 |============================================================== 100 ==============================================================>| Time: 00:00:09 

Finished in 9.73 seconds (files took 2.78 seconds to load)
386 examples, 0 failures

Randomized with seed 28701
Coverage report generated for RSpec to /home/mutaz/Documents/repos/publicwhip/coverage. 2925 / 3260 LOC (89.72%) covered.
mutaz@mutaz:~/Documents/repos/publicwhip$ bundle exec rubocop
Inspecting 133 files
.....................................................................................................................................

133 files inspected, no offenses detected
mutaz@mutaz:~/Documents/repos/publicwhip$ git status
On branch senator_search
Your branch is up to date with 'origin/senator_search'.

nothing to commit, working tree clean
mutaz@mutaz:~/Documents/repos/publicwhip$

Screenshot of the terminal session

@@ -4,6 +4,8 @@
<meta charset='utf-8'>
<meta content='IE=edge' http-equiv='X-UA-Compatible'>
<meta content='width=device-width, initial-scale=1' name='viewport'>
<meta content='1234' property='fb:admins'>
Copy link
Member

Choose a reason for hiding this comment

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

@Taz17 this looks very suspicious. I would guess this is the source of the problem. Why was this committed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Those were changes made automatically after bundle exec rake was run. I manually anything under spec/*

Copy link
Member

Choose a reason for hiding this comment

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

It those get changed, that means the regression tests failed!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes definitely, that was in commit 42ba8f1

I then re-ran the rake and it added more changes. Here 33cca66

But its passing everything now?

Copy link
Member

Choose a reason for hiding this comment

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

Why is something to do with a meta tag to do with facebook getting updated in a PR to do with searching?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know, all the changes that I made are regarding search.

What could be the cause of the meta tag getting updated?

As a side note. I just ran the rake tasks on the branch (policy_filter_search_js) to see why PR #1332 was failing the rake tasks and I got the same changes for the facebook meta tags... very odd

Copy link
Contributor Author

@MutazAshhab MutazAshhab Feb 21, 2022

Choose a reason for hiding this comment

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

I also get the same meta tag changes if i run bundle exec rake on the master branch (note: i never code on the master branch)... Im considering deleting my fork and re-forking the project

Copy link
Member

Choose a reason for hiding this comment

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

What you need to do is understand where that meta tag is being generated and then figure out what you're doing to cause that to be different on your box vs someone else's box.

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.

2 participants