-
Notifications
You must be signed in to change notification settings - Fork 32
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
Section pages search #1038
Section pages search #1038
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1038 +/- ##
=========================================
- Coverage 78.03% 77.8% -0.24%
=========================================
Files 421 421
Lines 10869 10888 +19
=========================================
- Hits 8482 8471 -11
- Misses 2387 2417 +30
Continue to review full report at Codecov.
|
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, just a couple of details to fix!
} else { | ||
$('<div class="result"><p>No hay resultados</p></div>').appendTo($resultsContainer); | ||
$('<div class="result"><p>'+I18n.t("layouts.search.no_results")+'</p></div>').appendTo($resultsContainer); | ||
} | ||
|
||
$('<div class="result"><small>'+I18n.t("layouts.search.powered_by")+'</small></div>').appendTo($resultsContainer); |
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.
It's a small detail, but that message is not very useful in the admin UI. Could we add a flag to remove the powered by if we are in the admin?
if(window.searchClient.indexes.length == 1) { | ||
var result = '<div class="activity_item">' + | ||
'<h2>' + '<a class="tipsit" href=' + ["/admin/cms/pages/", d['objectID'], "/edit?collection_id=", d['collection_id']].join('') + | ||
' original-title="Arrastra y suelta en la parte izquierda para colocar esta página en el menú">' + |
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.
Missing translations
<script type="text/javascript"> | ||
window.searchClient = { | ||
client: algoliasearch('<%= Rails.application.secrets.algolia_application_id %>', '<%= Rails.application.secrets.algolia_search_api_key %>'), | ||
indexes: ["gobierto_populate_<%= Rails.env %>_GobiertoCms::Page"], |
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.
Use this method to get the index name.
Connects to #1014
What does this PR do?
To look for in the sections within the pages. Front autocomplete has been reused.
How should this be manually tested?
Go to /admin/cms/sections, create a section and it looks for in the pages
Reindex
Add collection to the indexing of the pages, so reindex it.
bundle exec rake algoliasearch:reindex