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

include searchtips modal #2590

Merged
merged 9 commits into from
Oct 8, 2024
Merged

include searchtips modal #2590

merged 9 commits into from
Oct 8, 2024

Conversation

hudajkhan
Copy link
Contributor

@hudajkhan hudajkhan commented Sep 30, 2024

Closes #2487

What this PR does:

  • Adds a component that displays the link that will open up the search tips modal
  • Adds a component that displays the content within the modal
  • Include a path for search tips link to open a modal with search tips content
  • Overrides exhibit navbar in order to also display the search tips link next to the search bar
  • Include tests for the component displaying the link for the modal and for the component responsible for the modal content.
  • Adds styling overrides
  • Also add ViewComponent configuration in spec_helper

Also, some notes:
I asked @alundgard and it is ok if the close button has a red outline for now. Also, the mobile view shows the search tips button on top of the search bar and not the bottom (which is what the designs show). This is also ok for now.

Comment on lines 37 to 38
config.include ViewComponent::TestHelpers, type: :component
config.include ViewComponent::SystemTestHelpers, type: :component
Copy link
Contributor

Choose a reason for hiding this comment

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

These should go in rails_helper.rb. There are a couple similar configuration entries near the end of the file.

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 will make these changes

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 have made these changes

# frozen_string_literal: true

require 'rails_helper'
require 'spec_helper'
Copy link
Contributor

Choose a reason for hiding this comment

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

spec_helper is already included in rails_helper

Suggested change
require 'spec_helper'

# frozen_string_literal: true

require 'rails_helper'
require 'spec_helper'
Copy link
Contributor

Choose a reason for hiding this comment

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

spec_helper is already included in rails_helper

Suggested change
require 'spec_helper'

@@ -11,6 +11,9 @@

FIXTURES_PATH = File.expand_path('fixtures', __dir__)
require 'simplecov'
require 'view_component/test_helpers'
require 'view_component/system_test_helpers'
require 'capybara/rspec'
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is needed

Suggested change
require 'capybara/rspec'

Comment on lines 14 to 15
require 'view_component/test_helpers'
require 'view_component/system_test_helpers'
Copy link
Contributor

Choose a reason for hiding this comment

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

These should move to rails_helper with the configs includes below

Comment on lines 313 to 323
// Overrides for search tips link and info icon
.image-masthead .searchtips-link {
text-transform: none !important;
}

.searchtips-link .bi-info-circle{
margin-bottom: 0.15rem;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these styles needed? The link text looks the same if I remove them and the icon position seems okay.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The first style applies when we add an image to the masthead. When that happens, there is an existing style that changes the text to uppercase. The style on line 314 prevents that from happening for search tips, since these should stay lowercase even with an image masthead.

For the second style, the vertical spacing did not seem exactly where the Figma screen had it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay. It's really strange that spotlight upcases the nav links when there's background image, but otherwise doesn't.

Comment on lines 4 to 7
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-info-circle" viewBox="0 0 16 16">
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16"/>
<path d="m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0"/>
</svg></span><%= t('search_tips.title') %></a>
Copy link
Contributor

Choose a reason for hiding this comment

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

There's an info icon component already in spotlight that could be used via blacklight_icon('info'). Should we use that icon or override it locally with this one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Happy to use an existing one. I'll try that out, thanks.

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 set one up using the blacklight icon method. This also changed some styling (there's an extra space that the component adds within the blacklight icon next to the svg element)

@hudajkhan
Copy link
Contributor Author

Requires waiting for approval of projectblacklight/spotlight#3171 with some additional changes in exhibits

@hudajkhan
Copy link
Contributor Author

Screenshots of current view in local development:

Screenshot 2024-10-08 at 2 36 59 PM

Screenshot 2024-10-08 at 2 37 08 PM

Comment on lines 321 to 323
.blacklight-icons:hover {
text-decoration: none;
}
Copy link
Contributor

@corylown corylown Oct 8, 2024

Choose a reason for hiding this comment

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

Is this doing anything? I don't see any underlined whitespace when I remove this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was displaying an underline earlier but now no longer is (perhaps due to upstream changes in Blacklight?) I've removed this line since it no longer appears necessary.

@corylown corylown merged commit 9298e3b into main Oct 8, 2024
2 checks passed
@corylown corylown deleted the searchtips branch October 8, 2024 21:26
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.

Help text needed to explain to users what advanced search features are available
2 participants