-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:iodepo/oih-ui into feature/restyling
# Conflicts: # frontend/public/index.html # frontend/src/components/results/types/CreativeWork.json # frontend/src/components/results/types/Dataset.json
- Loading branch information
Showing
12 changed files
with
229 additions
and
100 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "weekly" |
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 |
---|---|---|
|
@@ -12,7 +12,7 @@ jobs: | |
|
||
steps: | ||
- name: Checkout repository contents | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Use action to check for CRLF endings | ||
uses: erclu/[email protected] | ||
|
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
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,82 +1,49 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<meta name="OIH" content="OIH Global Search" /> | ||
<link | ||
href="https://fonts.googleapis.com/css2?family=Montserrat&display=swap" | ||
rel="stylesheet" | ||
/> | ||
<link | ||
rel="stylesheet" | ||
href="https://unpkg.com/[email protected]/dist/maplibre-gl.css" | ||
/> | ||
<script src="https://unpkg.com/[email protected]/dist/maplibre-gl.js"></script> | ||
<script src="https://www.unpkg.com/[email protected]/turf.min.js"></script> | ||
<script src="https://www.unpkg.com/@mapbox/[email protected]/dist/mapbox-gl-draw.js"></script> | ||
<link | ||
rel="stylesheet" | ||
href="https://www.unpkg.com/@mapbox/[email protected]/dist/mapbox-gl-draw.css" | ||
type="text/css" | ||
/> | ||
<title>OIH Global Search</title> | ||
<style> | ||
.oih-popover { | ||
margin: auto; | ||
width: 100%; | ||
padding: 20px; | ||
background-color: #012e6a; | ||
color: white; | ||
} | ||
</style> | ||
<!-- Matomo --> | ||
<script> | ||
var _paq = (window._paq = window._paq || []); | ||
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */ | ||
/* _paq.push(["trackPageView"]); */ | ||
_paq.push(["enableLinkTracking"]); | ||
(function () { | ||
var u = "//analytics.iode.org/"; | ||
_paq.push(["setTrackerUrl", u + "matomo.php"]); | ||
_paq.push(["setSiteId", "1"]); | ||
var d = document, | ||
g = d.createElement("script"), | ||
s = d.getElementsByTagName("script")[0]; | ||
g.async = true; | ||
g.src = u + "matomo.js"; | ||
s.parentNode.insertBefore(g, s); | ||
})(); | ||
</script> | ||
<!-- End Matomo Code --> | ||
</head> | ||
<body> | ||
<noscript>You need to enable JavaScript to run this app.</noscript> | ||
<!-- <script> | ||
//open first popover available in your page | ||
let popover = document.getElementById("popover"); | ||
popover.style.display = "block"; | ||
</script> | ||
<div | ||
class="oih-popover" | ||
role="dialog" | ||
id="popover" | ||
data-scrollable-element="#scrollable-element" | ||
> | ||
<h1>This is still a beta version.</h1> | ||
This page is the beta-version of the search interface for the OIH project | ||
proof of concept.<br /> | ||
Please visit the | ||
<a href="https://oceaninfohub.org">project's website</a> for more | ||
information.<br /> | ||
<br /> | ||
<a | ||
href="#" | ||
onclick="let popover = document.getElementById('popover');popover.style.display = 'none';" | ||
> | ||
close this warning | ||
</a> | ||
</div> --> | ||
<div id="root"></div> | ||
</body> | ||
</html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<meta name="OIH" content="OIH Global Search"/> | ||
<title>OIH Global Search</title> | ||
<style> | ||
.oih-popover { | ||
margin: auto; | ||
width: 100%; | ||
padding: 20px; | ||
background-color: #012e6a; | ||
color: white; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<noscript>You need to enable JavaScript to run this app.</noscript> | ||
<script> | ||
//we don't want people to visit this page, redirect to the homepage | ||
window.location.replace("https://oceaninfohub.org"); | ||
|
||
//all what follows is useless as we are redirecting to the homepage | ||
|
||
//open first popover available in your page | ||
//let popover = document.getElementById('popover'); | ||
//popover.style.display = "block"; | ||
</script> | ||
<!-- | ||
<div | ||
class="oih-popover" | ||
role="dialog" | ||
id="popover" | ||
data-scrollable-element="#scrollable-element"> | ||
<h1>This is still a beta version.</h1> | ||
This page is the beta-version of the search interface for the OIH project proof of concept.<br /> | ||
Please visit the <a href="https://oceaninfohub.org">project's website</a> for more information.<br /> | ||
<br /> | ||
<a | ||
href="#" | ||
onclick="let popover = document.getElementById('popover');popover.style.display = 'none';"> | ||
close this warning | ||
</a> | ||
</div> | ||
--> | ||
<div id="root"></div> | ||
</body> | ||
</html> |
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,22 @@ | ||
[ | ||
{ | ||
"key": "id", | ||
"type": ["truncated", "link"] | ||
}, | ||
{ | ||
"key": "txt_author", | ||
"type": "list", | ||
"label": "Author(s)" | ||
}, | ||
"txt_identifier", | ||
{ | ||
"key": "txt_keywords", | ||
"type": "keywords" | ||
}, | ||
{ | ||
"key": "txt_contributor", | ||
"type": "list", | ||
"label": "Contributor(s)" | ||
}, | ||
{ "key": "txt_distribution", "type": ["list", "link"] } | ||
] |
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,19 @@ | ||
[ | ||
"name", | ||
{ "key": "txt_sameAs", "type": ["list", "truncated", "link"] }, | ||
{ "key": "txt_license", "type": "list", "label": "License" }, | ||
{ "key": "txt_citation", "type": "list", "label": "Related Works" }, | ||
{ "key": "txt_creditText", "type": "list", "label": "Recommended Citation" }, | ||
"txt_version", | ||
{ "key": "txt_keywords", "type": "keywords" }, | ||
{ | ||
"key": "id_includedInDataCatalog", | ||
"type": ["list", "link"], | ||
"label": "Data Catalog" | ||
}, | ||
"txt_temporalCoverage", | ||
{ "key": "txt_distribution", "type": ["list", "link"] }, | ||
{ "key": "txt_region", "type": "list" }, | ||
{ "key": "id_provider", "type": ["list", "link"], "label": "Provider ID" }, | ||
{ "key": "txt_provider", "type": "list" } | ||
] |
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,89 @@ | ||
#!/usr/bin/env python3 | ||
|
||
""" | ||
Purpose: Load a directory of JSON files, generated from the ODIS graph->Solr | ||
process (mdp2solr.sh), into an existing Solr core. | ||
Steps: 1) set your Solr core endpoint variable at the commandline by: | ||
export SOLR_URL=http://127.0.0.1:8983/solr/cioos | ||
2) set the path to the directory of JSON files, at the commandline by: | ||
export DATA_DIR=/home/apps/oih-ui-jmckenna/indexer/data/test | ||
3) python indexer-graph-solr.py | ||
Output: Records indexed into the Solr core. Look for the "added resource" message | ||
in the command window (which means it successfully indexed into Solr) such as: | ||
***Processing filename: /home/apps/oih-ui-jmckenna/indexer/data/test/ttt1.json | ||
added resource https://catalogue.cioos.ca/dataset/00863729-b5a8-4ac6-b73a-523d463f9963.jsonld: schema:Dataset to index | ||
***Processing filename: /home/apps/oih-ui-jmckenna/indexer/data/test/ttt2.json | ||
added resource https://catalogue.cioos.ca/dataset/d1391e91-1ed2-4600-901a-5a5408fd1a6f.jsonld: schema:Dataset to index | ||
Requires: Python 3.x | ||
Notes: | ||
Input files are JSON (not JSON-LD that the orginal "indexer.py" required) | ||
""" | ||
|
||
import requests | ||
import json | ||
import os | ||
from pathlib import Path | ||
from test_utils import test_generation, dump_exception | ||
|
||
#set urls | ||
BASE_SOLR_URL=os.environ.get('SOLR_URL', '') | ||
solr_url = BASE_SOLR_URL + "/update/json/docs" | ||
delete_url = BASE_SOLR_URL + "/update" | ||
query_url = BASE_SOLR_URL + "/select" | ||
|
||
DATA_DIR=os.environ.get('DATA_DIR') | ||
BASE_DIR=Path(DATA_DIR) | ||
|
||
session = requests.Session() | ||
|
||
# set Solr params | ||
solr_params = { | ||
'commit': 'true', | ||
# echo implies a dry run | ||
# 'echo': 'true', | ||
} | ||
|
||
#loop through directory | ||
def import_file(file): | ||
with open(file, 'rb') as f: | ||
print ("***Processing filename: " + f.name) | ||
try: | ||
orig = json.load(f) | ||
except UnicodeDecodeError: | ||
f.seek(0) | ||
file_bytes= f.read() | ||
try: | ||
file_string = file_bytes.decode('latin1') | ||
orig = json.loads(file_string) | ||
except Exception as msg: | ||
print ("Issue decoding %s, continuing" % filename) | ||
shutil.copy(src, os.path.join('exceptions', filename.split('/')[-1])) | ||
return | ||
|
||
data = orig | ||
data['keys'] = list(data.keys()) | ||
# print (json.dumps(data, indent=2)) | ||
data['json_source'] = json.dumps(data) | ||
solr_post = session.post(solr_url, params=solr_params, json=data) | ||
try: | ||
solr_post.raise_for_status() | ||
print("added resource %s: %s to index" % (data['id'], data['type'])) | ||
except: | ||
dump_exception(orig, solr_post.text) | ||
return | ||
#print(solr_post.text) | ||
|
||
for item in os.scandir(BASE_DIR): | ||
import_file(item) | ||
|
Oops, something went wrong.