Skip to content

Commit ec2b4e6

Browse files
committed
Merge remote-tracking branch 'upstream/master' into oai_pmh_ingestors
2 parents b78eb32 + 452613e commit ec2b4e6

187 files changed

Lines changed: 28951 additions & 4281 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242

4343
# Initializes the CodeQL tools for scanning.
4444
- name: Initialize CodeQL
45-
uses: github/codeql-action/init@v3
45+
uses: github/codeql-action/init@v4
4646
with:
4747
languages: ${{ matrix.language }}
4848
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -53,7 +53,7 @@ jobs:
5353
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5454
# If this step fails, then you should remove it and run the build manually (see below)
5555
- name: Autobuild
56-
uses: github/codeql-action/autobuild@v3
56+
uses: github/codeql-action/autobuild@v4
5757

5858
# ℹ️ Command-line programs to run using the OS shell.
5959
# 📚 https://git.io/JvXDl
@@ -67,4 +67,4 @@ jobs:
6767
# make release
6868

6969
- name: Perform CodeQL Analysis
70-
uses: github/codeql-action/analyze@v3
70+
uses: github/codeql-action/analyze@v4

.github/workflows/deployment-checks.yml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,32 @@ jobs:
1212
DB_PASSWORD: password
1313
SECRET_BASE_KEY: test_key
1414
RAILS_ENV: production
15+
services:
16+
postgres:
17+
image: postgres
18+
env:
19+
POSTGRES_DB: ${{ env.DB_NAME }}
20+
POSTGRES_USER: ${{ env.DB_USER }}
21+
POSTGRES_PASSWORD: ${{ env.DB_PASSWORD }}
22+
ports:
23+
- 5432:5432
24+
options: >-
25+
--health-cmd "pg_isready"
26+
--health-interval 10s
27+
--health-timeout 5s
28+
--health-retries 5
29+
redis:
30+
image: redis
31+
options: >-
32+
--health-cmd "redis-cli ping"
33+
--health-interval 10s
34+
--health-timeout 5s
35+
--health-retries 5
36+
ports:
37+
- 6379:6379
1538
steps:
16-
- uses: harmon758/postgresql-action@v1
17-
with:
18-
postgresql db: ${DB_NAME}
19-
postgresql user: ${DB_USER}
20-
postgresql password: ${DB_PASSWORD}
21-
name: Set up database
22-
2339
- uses: actions/checkout@v4
2440
name: Set up Ruby
25-
2641
- uses: ruby/setup-ruby@v1
2742
with:
2843
bundler-cache: true

.github/workflows/test.yml

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,35 @@ jobs:
1212
DB_PASSWORD: password
1313
SECRET_BASE_KEY: test_key
1414
RAILS_ENV: test
15-
REDIS_TEST_URL: redis://localhost:6456/0
15+
REDIS_TEST_URL: redis://localhost:6379/0
16+
services:
17+
postgres:
18+
image: postgres
19+
env:
20+
POSTGRES_DB: ${{ env.DB_NAME }}
21+
POSTGRES_USER: ${{ env.DB_USER }}
22+
POSTGRES_PASSWORD: ${{ env.DB_PASSWORD }}
23+
ports:
24+
- 5432:5432
25+
options: >-
26+
--health-cmd "pg_isready"
27+
--health-interval 10s
28+
--health-timeout 5s
29+
--health-retries 5
30+
redis:
31+
image: redis
32+
options: >-
33+
--health-cmd "redis-cli ping"
34+
--health-interval 10s
35+
--health-timeout 5s
36+
--health-retries 5
37+
ports:
38+
- 6379:6379
1639
steps:
1740
- name: Install system dependencies
1841
run: |
1942
sudo apt-get update
2043
sudo apt-get install imagemagick
21-
- name: Set up database
22-
uses: harmon758/postgresql-action@v1
23-
with:
24-
postgresql db: ${DB_NAME}
25-
postgresql user: ${DB_USER}
26-
postgresql password: ${DB_PASSWORD}
27-
- name: Set up Redis
28-
uses: supercharge/redis-github-action@1.5.0
29-
with:
30-
redis-version: 6
31-
redis-port: 6456
3244
- name: Check out code
3345
uses: actions/checkout@v4
3446
- name: Install Ruby & gems

Gemfile.lock

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,8 @@ GEM
233233
http-accept (1.7.0)
234234
http-cookie (1.0.5)
235235
domain_name (~> 0.5)
236-
httparty (0.21.0)
236+
httparty (0.24.0)
237+
csv
237238
mini_mime (>= 1.0.0)
238239
multi_xml (>= 0.5.2)
239240
i18n (1.14.7)
@@ -376,7 +377,8 @@ GEM
376377
railties (>= 3.0)
377378
msgpack (1.7.2)
378379
multi_json (1.17.0)
379-
multi_xml (0.6.0)
380+
multi_xml (0.8.0)
381+
bigdecimal (>= 3.1, < 5)
380382
multipart-post (2.4.1)
381383
nested_form (0.3.2)
382384
net-http (0.6.0)
@@ -778,7 +780,7 @@ GEM
778780
unf_ext (0.0.8.2)
779781
unicode-display_width (2.4.2)
780782
unicode-types (1.10.0)
781-
uri (1.0.3)
783+
uri (1.0.4)
782784
useragent (0.16.11)
783785
validate_email (0.1.6)
784786
activemodel (>= 3.0)
Lines changed: 5 additions & 0 deletions
Loading
Lines changed: 4 additions & 0 deletions
Loading

app/assets/javascripts/application.js

Lines changed: 38 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
//= require bootstrap-tab-history
1818
//= require cytoscape
1919
//= require cytoscape-panzoom
20-
//= require jscolor
2120
//= require jquery.simplecolorpicker.js
2221
//= require split
2322
//= require handlebars.runtime
@@ -41,36 +40,41 @@
4140
//= require ol
4241
//= require ol-geocoder
4342

44-
function redirect_to_sort_url(){
45-
url = new URL(window.location.href);
46-
url.searchParams.set(
47-
"sort",
48-
$("#sort").find(":selected").val()
49-
);
50-
window.location.replace(url.toString());
51-
}
52-
53-
function redirect_with_updated_search(param, paramVal) {
54-
url = new URL(window.location.href);
55-
// special case for empty range types
56-
if (param == 'start' && paramVal == '/') {
57-
url.searchParams.delete(param);
58-
} else {
59-
url.searchParams.set(param, paramVal);
60-
}
61-
window.location.replace(url.toString());
62-
}
43+
const Index = {
44+
applySorting: function () {
45+
Index.setParam("sort", $("#sort").val());
46+
},
6347

64-
function reposition_tiles(container, tileClass){
65-
var $container = $("." + container);
48+
applyPerPage: function () {
49+
Index.setParam("per_page", $("#per_page").val());
50+
},
6651

67-
$container.imagesLoaded(function () {
68-
$container.masonry({
69-
// options...
70-
itemSelector: "." + tileClass,
71-
columnWidth: 20
52+
applyDateParam: function (param, value) {
53+
const url = new URL(window.location.href);
54+
if (param === 'start' && value === '/') {
55+
url.searchParams.delete(param);
56+
} else {
57+
url.searchParams.set(param, value);
58+
}
59+
window.location.replace(url.toString());
60+
},
61+
62+
setParam: function (param, value) {
63+
const url = new URL(window.location.href);
64+
url.searchParams.set(param, value);
65+
window.location.replace(url.toString());
66+
},
67+
68+
repositionTiles(containerSelector, itemSelector) {
69+
const container = $(containerSelector);
70+
container.imagesLoaded(function () {
71+
container.masonry({
72+
// options...
73+
itemSelector: itemSelector,
74+
columnWidth: 20
75+
});
7276
});
73-
});
77+
}
7478
}
7579

7680
// Perform an ajax request to load the calendar and replace the contents
@@ -152,7 +156,7 @@ document.addEventListener("turbolinks:load", function(e) {
152156
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
153157
addTabToFilters(e.target.href.split('#').pop());
154158
// and reposition masonry tiles
155-
reposition_tiles('masonry', 'masonry-brick');
159+
Index.repositionTiles('.masonry', '.masonry-brick');
156160
});
157161

158162
// Manually trigger bootstrap tab history (we should probably remove the dependency and reimplement in a turbolink-compatible way)
@@ -168,12 +172,14 @@ document.addEventListener("turbolinks:load", function(e) {
168172

169173
// Masonry
170174
$(".nav-tabs a").on("shown.bs.tab", function(e) {
171-
reposition_tiles('masonry', 'masonry-brick');
175+
Index.repositionTiles('.masonry', '.masonry-brick');
172176
});
177+
173178
$(window).on("orientationchange", function() {
174-
reposition_tiles("masonry", "masonry-brick");
179+
Index.repositionTiles('.masonry', '.masonry-brick');
175180
});
176-
reposition_tiles("masonry", "masonry-brick");
181+
182+
Index.repositionTiles('.masonry', '.masonry-brick');
177183

178184
new Clipboard(".clipboard-btn");
179185

app/assets/javascripts/workflows.js

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,9 @@ var Workflows = {
192192
$('#node-modal-form-title').val(data.name);
193193
$('#node-modal-form-description').val(data.description);
194194
if (data.color) {
195-
$('#node-modal-form-colour')[0].jscolor.fromString(data.color);
195+
$('#node-modal-form-colour').val(data.color);
196196
} else if (data.parent) {
197-
$('#node-modal-form-colour')[0].jscolor.fromString(cy.$('#' + data.parent).data('color'));
197+
$('#node-modal-form-colour').val(cy.$('#' + data.parent).data('color'));
198198
}
199199
$('#node-modal-form-parent-id').val(data.parent);
200200
$('#node-modal-form-x').val(position.x);
@@ -211,7 +211,7 @@ var Workflows = {
211211
description: $('#node-modal-form-description').val(),
212212
html_description: MarkdownIt.render($('#node-modal-form-description').val()),
213213
color: $('#node-modal-form-colour').val(),
214-
font_color: $('#node-modal-form-colour').css("color"),
214+
font_color: Workflows.getTextColor($('#node-modal-form-colour').val()),
215215
parent: $('#node-modal-form-parent-id').val(),
216216
associatedResources: Workflows.associatedResources.fetch(),
217217
ontologyTerms: Workflows.ontologyTerms.fetch()
@@ -470,6 +470,21 @@ var Workflows = {
470470
);
471471
}
472472
}
473+
},
474+
getTextColor: function (hex) {
475+
// Remove the leading '#', if present
476+
hex = hex.replace('#', '');
477+
478+
// Parse r, g, b values
479+
const r = parseInt(hex.substring(0, 2), 16);
480+
const g = parseInt(hex.substring(2, 4), 16);
481+
const b = parseInt(hex.substring(4, 6), 16);
482+
483+
// Calculate perceived brightness (luminance)
484+
const brightness = (0.299 * r) + (0.587 * g) + (0.114 * b);
485+
486+
// Threshold of ~186 is a common practical cutoff
487+
return brightness > 186 ? '#000000' : '#FFFFFF';
473488
}
474489
};
475490

@@ -621,7 +636,6 @@ document.addEventListener("turbolinks:load", function() {
621636
// Initialize
622637
Workflows.cancelState();
623638
Workflows.history.initialize();
624-
jscolor.installByClassName('jscolor');
625639
} else {
626640
// Hiding/revealing of child nodes
627641
if(hideChildNodes) {

app/assets/stylesheets/application.scss

Lines changed: 65 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,32 @@
1818
@import "font-awesome-sprockets";
1919
@import "font-awesome";
2020
@import "mixins/mixins";
21-
@import "*";
21+
22+
// Local
23+
@import "about";
24+
@import "account";
25+
@import "activities";
26+
@import "autocomplete";
27+
@import "bootstrap-tweaks";
28+
@import "collaborations";
29+
@import "collection";
30+
@import "curators";
31+
@import "events";
32+
@import "external-resources";
33+
@import "footer";
34+
@import "forms";
35+
@import "headers";
36+
@import "helpers";
37+
@import "home";
38+
@import "icons";
39+
@import "learning-paths";
40+
@import "masonry";
41+
@import "nodes";
42+
@import "showcase";
43+
@import "toggle";
44+
@import "workflows";
45+
46+
// Vendor
2247
@import "cytoscape-panzoom";
2348
@import "jquery.simplecolorpicker";
2449
@import "eonasdan-bootstrap-datetimepicker";
@@ -393,10 +418,21 @@ ul.unstyled {
393418
}
394419

395420
.search-results-count {
396-
margin-right: 5px;
421+
margin-right: 1em;
397422
display: inline-block
398423
}
399424

425+
.search-results-per-page {
426+
display: inline-block;
427+
428+
select {
429+
border: none;
430+
padding: 0;
431+
background: transparent;
432+
border-bottom: 1px dashed $text-color;
433+
}
434+
}
435+
400436
.index-display-options {
401437
margin: 5px 0;
402438
}
@@ -1047,4 +1083,30 @@ td.day .calendar-text {
10471083
top: 0;
10481084
}
10491085
}
1050-
}
1086+
}
1087+
1088+
.theme-selector {
1089+
display: flex;
1090+
gap: 10px;
1091+
}
1092+
1093+
.theme-select-option {
1094+
flex-grow: 1;
1095+
label {
1096+
border: 5px solid;
1097+
padding: 10px 20px;
1098+
border-radius: 5px;
1099+
display: block;
1100+
1101+
hr {
1102+
border-width: 10px;
1103+
}
1104+
}
1105+
}
1106+
.btn-oidc-only {
1107+
font-size: 36px;
1108+
padding: 4px;
1109+
margin: 12px 10px;
1110+
display: flex;
1111+
justify-content: center;
1112+
}

0 commit comments

Comments
 (0)