-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from MITLibraries/cleanup_work
Cleanup work
- Loading branch information
Showing
13 changed files
with
267 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,21 @@ | ||
# tacos | ||
# TACOS: Tool for Analyzing and Categorization Of Searchterms | ||
|
||
## Required Environment Variables | ||
|
||
`LINKRESOLVER_BASEURL`: base url for our link resolver. `https://mit.primo.exlibrisgroup.com/discovery/openurl?institution=01MIT_INST&rfr_id=info:sid/mit.tacos.api&vid=01MIT_INST:MIT` is probably the best value unless you are doing something interesting. | ||
|
||
`UNPAYWALL_EMAIL`: email address to include in API call as required in their [documentation](https://unpaywall.org/products/api). Your personal email is appropriate for development. Deployed and for tests, use the timdex moira list email. | ||
|
||
## Documentation | ||
|
||
[Architecture Decisions](docs/architecture-decisions/) | ||
|
||
### Explanation/Overview | ||
|
||
[Work Activity Analysis](docs/explanation/work-activity-analysis.md) | ||
|
||
[Pattern Detection and Enhancement](docs/explanation/pattern_detection_and_enhancement.md) | ||
|
||
### Reference | ||
|
||
[Class Diagram](docs/reference/classes.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,5 @@ | |
*= require_tree . | ||
*= require_self | ||
*/ | ||
|
||
@import "libraries-main"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
class ApplicationController < ActionController::Base | ||
helper Mitlibraries::Theme::Engine.helpers | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class StaticController < ApplicationController | ||
def index; end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<div class="wrap-outer-header-local layout-band"> | ||
<div class="wrap-header-local"> | ||
<div class="local-identity"> | ||
<h2 class="title title-site"><a href="/">TACOS</a></h2> | ||
</div> | ||
<div class="wrap-local-nav"> | ||
<div class="wrap-bar"> | ||
<nav class="local-nav" aria-label="Main menu"> | ||
<%= nav_link_to("Home", root_path) %> | ||
</nav> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<%= content_for(:title, "TACOS") %> | ||
|
||
<div class="layout-3q1q layoutband"> | ||
<div class="col3q"> | ||
<div class="about-timdex box-content"> | ||
<h3 class="title">About TACOS</h3> | ||
|
||
<p>TACOS is an anonymous searchterm analysis system.</p> | ||
|
||
<p>TACOS aims to be a combination of data collection of anonymous searchterms from our various systems, | ||
algorithmic detection of patterns (such as ISSN, ISBN, DOI, PMID), data lookups of facts about detected | ||
patterns, and a staff workflow to categorize searchterms our algorithmic approach cannot yet understand.</p> | ||
|
||
<p>The hope is that TACOS will provide insight into what a user is intending to search for _before_ we ask a | ||
traditional search system to process that search.</p> | ||
|
||
<div class="well"> | ||
TACOS is coming soon! | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<aside class="col1q-r"> | ||
<p>Imagine a cool logo here</p> | ||
</aside> | ||
|
||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
Rails.application.routes.draw do | ||
if Rails.env.development? | ||
mount GraphiQL::Rails::Engine, at: "/graphiql", graphql_path: "/graphql" | ||
end | ||
post "/graphql", to: "graphql#execute" | ||
post '/graphql', to: 'graphql#execute' | ||
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html | ||
|
||
# Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500. | ||
# Can be used by load balancers and uptime monitors to verify that the app is live. | ||
get "up" => "rails/health#show", as: :rails_health_check | ||
get 'up' => 'rails/health#show', as: :rails_health_check | ||
|
||
# Defines the root path route ("/") | ||
# root "posts#index" | ||
root to: 'static#index' | ||
end |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,178 @@ | ||
<!-- | ||
* Copyright (c) 2021 GraphQL Contributors | ||
* All rights reserved. | ||
* | ||
* MIT License | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
--> | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<style> | ||
body { | ||
height: 100%; | ||
margin: 0; | ||
width: 100%; | ||
overflow: hidden; | ||
} | ||
|
||
#graphiql { | ||
height: 100vh; | ||
} | ||
</style> | ||
|
||
<!-- | ||
This GraphiQL example depends on Promise and fetch, which are available in | ||
modern browsers, but can be "polyfilled" for older browsers. | ||
GraphiQL itself depends on React DOM. | ||
If you do not want to rely on a CDN, you can host these files locally or | ||
include them directly in your favored resource bundler. | ||
--> | ||
<script crossorigin src="https://unpkg.com/react@17/umd/react.development.js"></script> | ||
<script crossorigin src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"></script> | ||
<!-- | ||
These two files can be found in the npm module, however you may wish to | ||
copy them directly into your environment, or perhaps include them in your | ||
favored resource bundler. | ||
--> | ||
<link rel="stylesheet" href="https://unpkg.com/graphiql/graphiql.min.css" /> | ||
</head> | ||
|
||
<body> | ||
<div id="graphiql">Loading...</div> | ||
<script src="https://unpkg.com/graphiql/graphiql.min.js" type="application/javascript"></script> | ||
<script> | ||
/** | ||
* This GraphiQL example illustrates how to use some of GraphiQL's props | ||
* in order to enable reading and updating the URL parameters, making | ||
* link sharing of queries a little bit easier. | ||
* | ||
* This is only one example of this kind of feature, GraphiQL exposes | ||
* various React params to enable interesting integrations. | ||
* | ||
* Sourced from: https://github.com/graphql/graphiql/blob/bcb27538d9074afdac3ff56074046965b456e57a/packages/graphiql/resources/renderExample.js | ||
*/ | ||
|
||
// Parse the search string to get url parameters. | ||
var search = window.location.search; | ||
var parameters = {}; | ||
search | ||
.substr(1) | ||
.split("&") | ||
.forEach(function (entry) { | ||
var eq = entry.indexOf("="); | ||
if (eq >= 0) { | ||
parameters[decodeURIComponent(entry.slice(0, eq))] = decodeURIComponent(entry.slice(eq + 1)); | ||
} | ||
}); | ||
|
||
// If variables was provided, try to format it. | ||
if (parameters.variables) { | ||
try { | ||
parameters.variables = JSON.stringify(JSON.parse(parameters.variables), null, 2); | ||
} catch (e) { | ||
// Do nothing, we want to display the invalid JSON as a string, rather | ||
// than present an error. | ||
} | ||
} | ||
|
||
// When the query and variables string is edited, update the URL bar so | ||
// that it can be easily shared. | ||
function onEditQuery(newQuery) { | ||
parameters.query = newQuery; | ||
updateURL(); | ||
} | ||
|
||
function onEditVariables(newVariables) { | ||
parameters.variables = newVariables; | ||
updateURL(); | ||
} | ||
|
||
function onEditOperationName(newOperationName) { | ||
parameters.operationName = newOperationName; | ||
updateURL(); | ||
} | ||
|
||
function updateURL() { | ||
var newSearch = | ||
"?" + | ||
Object.keys(parameters) | ||
.filter(function (key) { | ||
return Boolean(parameters[key]); | ||
}) | ||
.map(function (key) { | ||
return encodeURIComponent(key) + "=" + encodeURIComponent(parameters[key]); | ||
}) | ||
.join("&"); | ||
history.replaceState(null, null, newSearch); | ||
} | ||
|
||
// Defines a GraphQL fetcher using the fetch API. You're not required to | ||
// use fetch, and could instead implement graphQLFetcher however you like, | ||
// as long as it returns a Promise or Observable. | ||
function graphQLFetcher(graphQLParams) { | ||
// This should allow for the playground to use the local GraphQL endpoint in all of our environments, | ||
// including localhost, pr builds, staging environments, and production. | ||
// For this to work, we must host the static playground.html on the same server that runs the graphql endpoint. | ||
// In other words, even those this is a static page, we can't host it in our documentation server or we'd need | ||
// to rework how the graphql endpoint is calculated. | ||
const api = location.origin + "/graphql"; | ||
console.log(api); | ||
return fetch(api, { | ||
method: "post", | ||
headers: { | ||
Accept: "application/json", | ||
"Content-Type": "application/json", | ||
}, | ||
body: JSON.stringify(graphQLParams), | ||
credentials: "omit", | ||
}) | ||
.then(function (response) { | ||
return response.text(); | ||
}) | ||
.then(function (responseBody) { | ||
try { | ||
return JSON.parse(responseBody); | ||
} catch (error) { | ||
return responseBody; | ||
} | ||
}); | ||
} | ||
|
||
// Render <GraphiQL /> into the body. | ||
// See the README in the top level of this module to learn more about | ||
// how you can customize GraphiQL by providing different values or | ||
// additional child elements. | ||
ReactDOM.render( | ||
React.createElement(GraphiQL, { | ||
fetcher: graphQLFetcher, | ||
query: parameters.query, | ||
variables: parameters.variables, | ||
operationName: parameters.operationName, | ||
onEditQuery: onEditQuery, | ||
onEditVariables: onEditVariables, | ||
defaultVariableEditorOpen: true, | ||
onEditOperationName: onEditOperationName, | ||
}), | ||
document.getElementById("graphiql") | ||
); | ||
</script> | ||
</body> | ||
</html> |