Skip to content
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
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ See `Optional Environment Variables` for more information.
- `BOOLEAN_OPTIONS`: comma separated list of values to present to testers on instances where `BOOLEAN_PICKER` feature is enabled.
- `BOOLEAN_PICKER`: feature to allow users to select their preferred boolean type. If set, feature is enabled. This feature is only intended for internal team
testing and should never be enabled in production (mostly because the UI is a mess more than it would cause harm).
- `FACT_PANELS_ENABLED`: Comma separated list of enabled fact panels. See `/views/results.html.erb` for implemented panels/valid options. Leave unset to disable all.
- `FILTER_ACCESS_TO_FILES`: The name to use instead of "Access to files" for that filter / aggregation.
- `FILTER_CONTENT_TYPE`: The name to use instead of "Content type" for that filter / aggregation.
- `FILTER_CONTRIBUTOR`: The name to use instead of "Contributor" for that filter / aggregation.
Expand Down
1 change: 1 addition & 0 deletions app/assets/stylesheets/application.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@
@import "partials/_shared";
@import "partials/_results";
@import "partials/_typography";
@import "partials/_suggestion-panel";
11 changes: 0 additions & 11 deletions app/assets/stylesheets/partials/_panels.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,6 @@
}
}

.fact {
.panel {
margin-top: 0;

.panel-heading {
margin-top: 0;
padding-top: 16.8px;
}
}
}

.ask-us {
margin-top: 3rem;
a {
Expand Down
106 changes: 106 additions & 0 deletions app/assets/stylesheets/partials/_suggestion-panel.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
/* Color Variables */
Copy link
Member

Choose a reason for hiding this comment

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

Non-blocking question (and maybe more for @djanelle-mit than you) - reading this stylesheet, it feels like the long-term plan for many of these variables, mixins, and other styles is to house them more centrally to the application stylesheet setup? Ultimately I think this partial could end up being just lines 27-59?

I don't mind this change as-is for now, but I want to confirm whether I understand the long-term plan correctly.

Copy link
Contributor

Choose a reason for hiding this comment

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

@matt-bernhardt Yep, you're spot on! This was originally written into the TACOS repo with the variables colocated to keep things simple. I'm also going to be introducing more variables into the _variables style sheet with some of my upcoming work.

I have a ticket to update some styling, I can make a note that it should include a refactor of the variables' location, too.


// Core
$blue-500: #0000FF;

$purple-700: #990099;

$white: #fff;
$gray-100: #F2F2F2;
$black: #111;

@mixin focus-outline {
&:focus {
outline: 3px solid $blue-500;
}
}

@mixin hover-transition {
transition: all .25s ease-in-out 0s;
}

// Semantic
$color-suggestion-border: $purple-700;
$color-suggestion-accent-text: $purple-700;

/* Suggestion Panel */
.mitlib-suggestion-panel {
border: 4px solid $color-suggestion-border;

display: flex;
column-gap: 24px;

padding: 20px 24px;
position: relative;

.panel-type {
color: $color-suggestion-accent-text;
font-size: 14px;
font-weight: 600;
margin-bottom: 8px;
}

h3 {
font-size: 20px;
font-weight: 600;
line-height: 1.25;
margin-bottom: 8px;
}

p {
font-size: 16px;
}

ul.metadata {
font-size: 14px;
list-style: none inside;
padding-left: 0;
margin-bottom: 20px;
}

// This would need to be extracted into an Icon Button in the future.
button.dismiss {
//Temporarily hiding until we can move to a prop
display: none;

width: 48px;
height: 48px;
position: absolute;
top: 0;
right: 0;

background-color: $white;
border: none;
color: $black;
cursor: pointer;
font-weight: 600;

@include hover-transition;

@include focus-outline;

&:hover {
background-color: $gray-100;
}
}
}

/* Button styles to be extracted into button component */
.button.secondary {
border: 1px solid $black;
border-radius: 0;
display: inline-block;
padding: 6px 12px;
text-decoration: none;
font-size: 16px;
font-weight: 600;

@include hover-transition;

@include focus-outline;

&:hover {
color: $white;
background-color: $black;
}
}
27 changes: 0 additions & 27 deletions app/controllers/fact_controller.rb

This file was deleted.

6 changes: 5 additions & 1 deletion app/controllers/tacos_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ class TacosController < ApplicationController
def analyze
return unless ApplicationHelper.tacos_enabled?

Tacos.analyze(params[:q])
tacos_response = Tacos.analyze(params[:q])

# Suggestions return as an array but we don't want to display more than one.
# We may want to have a "priority" system in the future to determine which suggestion to show.
Copy link
Member

Choose a reason for hiding this comment

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

+1 to having this sort of logic, and +1 to not worrying about it now. The time for that sort of determination feels like "after we are getting more than just suggested resources back from TACOS" because then we'll have more things to sort through, in addition to multiple suggested resource matches.

@suggestions = tacos_response['data']['logSearchEvent']['detectors']['suggestedResources'].first
end
end
7 changes: 0 additions & 7 deletions app/helpers/record_helper.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
module RecordHelper
def doi(metadata)
dois = metadata['identifiers']&.select { |id| id['kind'].downcase == 'doi' }
return unless dois.present?

dois.first['value']
end

def date_parse(date)
return unless date.present?

Expand Down
4 changes: 0 additions & 4 deletions app/helpers/results_helper.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
module ResultsHelper
def fact_enabled?(fact_type)
ENV.fetch('FACT_PANELS_ENABLED', false).split(',').include?(fact_type)
end

def results_summary(hits)
hits.to_i >= 10_000 ? '10,000+ results' : "#{number_with_delimiter(hits)} results"
end
Expand Down
44 changes: 0 additions & 44 deletions app/models/fact_doi.rb

This file was deleted.

51 changes: 0 additions & 51 deletions app/models/fact_isbn.rb

This file was deleted.

63 changes: 0 additions & 63 deletions app/models/fact_issn.rb

This file was deleted.

Loading