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

Adds panel for NPS surveys #1335

Merged
merged 4 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ to construct thumbnail URLs.
- `TACOS_URL`: The GraphQL endpoint for the [TACOS](https://github.com/mitlibraries/tacos/) application.
- `TIMDEX_TIMEOUT`: value to override the 6 second default for TIMDEX timeout.

### NPS Survey Environment Variables (optional)

- `NPS_BLURB`: Text to display before the survey link. Survey link will still display if not provided.
- `NPS_LINK_TEXT`: Survey link text. If not present, survey does not display.
- `NPS_URL`: Survey link URL. If not present, survey does not display.

## Confirming functionality after updating dependencies

This application has good code coverage, so most issues are detected by just running tests normally:
Expand Down
23 changes: 23 additions & 0 deletions app/assets/stylesheets/_survey.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.nps-feedback {
margin-top: 1em;
padding: 20px 10px;
background-color: $gray-d1;
color: $white;
text-align: center;
font-size: $fs-large;
display: block;

a {
color: $blue-bright;
&:hover {
color: $green;
}
&:active {
color: $magenta;
}
}

@media (max-width: $bp-screen-md) {
font-size: $fs-base;
}
}
1 change: 1 addition & 0 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
@import "_search";
@import "_results";
@import "_hint";
@import "_survey";
@import "_print";
7 changes: 7 additions & 0 deletions app/views/search/_nps_feedback.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<% return unless ENV.fetch('NPS_URL', false).present? %>
<% return unless ENV.fetch('NPS_LINK_TEXT', false).present? %>

<div class="nps-feedback">
<span class="nps-blurb"><%= ENV.fetch('NPS_BLURB', nil) %></span>
<a class="nps-link" href="<%= ENV.fetch('NPS_URL')%>"><%= ENV.fetch('NPS_LINK_TEXT') %></a>
</div>
2 changes: 2 additions & 0 deletions app/views/search/bento.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
<p>Not finding what you need? <%= link_to('Ask us', 'https://libraries.mit.edu/ask/') %></p>
</div>

<%= render partial: "nps_feedback" if ENV.fetch('NPS_URL', false).present? %>

<div id="hint"></div>

<div class="gridband layout-2c">
Expand Down