Closed bistline closed 4 weeks ago
Attention: Patch coverage is 93.75000%
with 3 lines
in your changes missing coverage. Please review.
Project coverage is 69.61%. Comparing base (
b4cf943
) to head (0235243
). Report is 42 commits behind head on development.
Files with missing lines | Patch % | Lines |
---|---|---|
app/models/home_page_link.rb | 93.61% | 3 Missing :warning: |
Build failure addressed in #2141
The AnnData test failures are false positives, insofar as user-facing impact is concerned.
The AnnData test failures are false positives, insofar as user-facing impact is concerned.
Right - thanks for the clarification. I meant only the NeMO tests.
BACKGROUND & CHANGES
This update adds the
HomePageLink
model for placing a single link on the home page. There is no UI for adding these links - instead they can be added directly from the Rails console to reduce the overhead of CRUDing the link. The model includes convenience methods for publishing/unpublishing links, and validations to ensure that only one link can be published at any time. Additionally, admins can embed an image inside the button by providing a filename of an existing image (sadly, we cannot link to remote images due to our CSPimg_src
rule). The button CSS classes & background color are configurable, though the CSS needs to be a previously defined class. Also, the button can have a tooltip to display a contextual message.Here's a screenshot of what the button can look like with an image (using the Cellarium logo, as this is primarily what this feature was designed to link to):
Additionally, this moves the link for the "Portal whitepaper" to the footer, next to the Terms of Service link.
MANUAL TESTING
HomePageLink
for the CAS survey, but don't publish it yet:link.published? => false
link.publish! => true
HomePageLink.unpublish! ... Unpublishing 'CAS Survey' => true
HomePageLink.unpublish! ... No published links => false
HomePageLink.publish_last! ... Publishing 'CAS Survey' => true
HomePageLink.publish_last! 'CAS Survey' is already published => false
link.update(bg_color: 'red', css_class: 'btn btn-lg') => true
link.reset_bg_color! ... Resetting bg_color to '#4999F9' => true
link.reset_css! ... Resetting css_class to 'btn btn-home-link' => true
new_link = HomePageLink.create(name: 'foo', href: 'bar', published: true) ... Published link exists: 'CAS Survey', please unpublish first with HomePageLink.unpublish! => #<HomePageLink _id: 66f32d5794ec8f52319c33f7, created_at: nil, updated_at: nil, name: "foo", href: "bar", tooltip: nil, bg_color: "#...
new_link.persisted? => false