Skip to content

Commit

Permalink
Merge pull request #7601 from scinote-eln/develop
Browse files Browse the repository at this point in the history
May 2024 Release
  • Loading branch information
artoscinote authored May 29, 2024
2 parents f50725a + 2999f4d commit d67c470
Show file tree
Hide file tree
Showing 151 changed files with 4,322 additions and 1,442 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ gem 'i18n-js', '~> 3.6' # Localization in javascript files
gem 'jbuilder' # JSON structures via a Builder-style DSL
gem 'logging', '~> 2.0.0'
gem 'nested_form_fields'
gem 'nokogiri', '~> 1.16.2' # HTML/XML parser
gem 'nokogiri', '~> 1.16.5' # HTML/XML parser
gem 'noticed'
gem 'rails_autolink', '~> 1.1', '>= 1.1.6'
gem 'rgl' # Graph framework for project diagram calculations
Expand Down
16 changes: 9 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ GEM
mime-types-data (3.2023.0218.1)
mini_magick (4.12.0)
mini_mime (1.1.5)
mini_portile2 (2.8.5)
mini_portile2 (2.8.6)
minitest (5.22.2)
msgpack (1.7.1)
multi_json (1.15.0)
Expand All @@ -456,12 +456,12 @@ GEM
net-protocol
newrelic_rpm (9.2.2)
nio4r (2.7.0)
nokogiri (1.16.2)
nokogiri (1.16.5)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.16.2-arm64-darwin)
nokogiri (1.16.5-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.2-x86_64-linux)
nokogiri (1.16.5-x86_64-linux)
racc (~> 1.4)
noticed (1.6.3)
http (>= 4.0.0)
Expand Down Expand Up @@ -609,7 +609,8 @@ GEM
responders (3.1.1)
actionpack (>= 5.2)
railties (>= 5.2)
rexml (3.2.5)
rexml (3.2.8)
strscan (>= 3.0.9)
rgl (0.6.3)
pairing_heap (>= 0.3.0)
rexml (~> 3.2, >= 3.2.4)
Expand Down Expand Up @@ -701,6 +702,7 @@ GEM
activesupport (>= 5.2)
sprockets (>= 3.0.0)
stream (0.5.5)
strscan (3.1.0)
swd (2.0.2)
activesupport (>= 3)
attr_required (>= 0.0.5)
Expand Down Expand Up @@ -731,13 +733,13 @@ GEM
unf_ext (0.0.8.2)
unicode-display_width (2.4.2)
uniform_notifier (1.16.0)
uri (0.13.0)
validate_email (0.1.6)
activemodel (>= 3.0)
mail (>= 2.2.5)
validate_url (1.0.15)
activemodel (>= 3.0.0)
public_suffix
uri (0.13.0)
version_gem (1.1.3)
view_component (3.9.0)
activesupport (>= 5.2.0, < 8.0)
Expand Down Expand Up @@ -827,7 +829,7 @@ DEPENDENCIES
logging (~> 2.0.0)
nested_form_fields
newrelic_rpm
nokogiri (~> 1.16.2)
nokogiri (~> 1.16.5)
noticed
omniauth (~> 2.1)
omniauth-azure-activedirectory-v2
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.33.0
1.34.0
17 changes: 17 additions & 0 deletions app/assets/javascripts/experiments/show.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,23 @@
}
});
});

$('#experiment-canvas').on('shown.bs.modal', () => {
// disable the submit button by default
$('#new-modal-submit-btn').prop('disabled', true);

// listen for input event on the my_module_name input field
$(`${newMyModuleModal} #my_module_name`).on('input', function () {
if ($(this).val().trim().length > 1) {
// enable the submit button if the input field is populated
$('#new-modal-submit-btn').prop('disabled', false);
} else {
// otherwise, disable it
$('#new-modal-submit-btn').prop('disabled', true);
}
});
});

// Modal's submit handler function
$(experimentWrapper)
.on('ajax:success', newMyModuleModal, function() {
Expand Down
4 changes: 2 additions & 2 deletions app/assets/javascripts/my_modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@
},
optionLabel: (data) => {
if (data.value > 0) {
return `<span class="my-module-tags-color" style="background:${data.params.color}"></span>
${data.label}`;
return `<span class="h-6 px-1.5 flex items-center max-w-80 truncate text-sn-white rounded"
style="background:${data.params.color}">${data.label}</span>`;
}
return `<span class="my-module-tags-color new"><i class="sn-icon sn-icon-new-task"></i></span>
${data.label + ' '}
Expand Down
19 changes: 13 additions & 6 deletions app/assets/javascripts/projects/canvas.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -570,13 +570,20 @@ function handleAnchorClick(event) {
}
};

// listen to clicks on links in navigator and leftMenuContainer
$(document).ready(function() {
const navigatorEl = $('.sci--layout-navigation-navigator');
const leftMenuContainerEl = $('.sci--layout--left-menu-container');
$(document).on('turbolinks:before-visit.canvas_edit', (e) => {
const alertText = $("#update-canvas").attr("data-unsaved-work-text");

navigatorEl.on('click', 'a', handleAnchorClick);
leftMenuContainerEl.on('click', 'a', handleAnchorClick);
if (alertText) {
// eslint-disable-next-line no-alert
if (confirm(alertText)) {
$(document).off('turbolinks:before-visit.canvas_edit');
return true;
}
e.preventDefault();
return false;
}
$(document).off('turbolinks:before-visit.canvas_edit');
return true;
});

function bindEditModeCloseWindow() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ $.fn.dataTable.render.defaultRepositoryAssetValue = function() {
};

$.fn.dataTable.render.RepositoryTextValue = function(data) {
var text = $(`<span class="text-value">${data.value.view}</span>`);
const text = $(`<span class="text-value [&>p]:mb-0">${data.value.view}</span>`);
text.attr('data-edit-value', data.value.edit);
return text.prop('outerHTML');
};
Expand Down
7 changes: 5 additions & 2 deletions app/assets/javascripts/shared/inline_editing.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,10 @@ let inlineEditing = (function() {
if (response.status === 403) {
HelperModule.flashAlertMsg(I18n.t('general.no_permissions'), 'danger');
} else if (response.status === 422) {
HelperModule.flashAlertMsg(response.responseJSON.errors
? Object.values(response.responseJSON.errors).join(', ') : I18n.t('errors.general'), 'danger');
const errors = response.responseJSON.errors || response.responseJSON;
if (!errors) {
HelperModule.flashAlertMsg(I18n.t('errors.general'), 'danger');
}
}
if (!error) error = response.responseJSON.errors[fieldToUpdate];
container.addClass('error');
Expand Down Expand Up @@ -155,6 +157,7 @@ let inlineEditing = (function() {
if (inputField(container).attr('disabled')) {
saveAllEditFields();
let input = inputField(container);
input.val(container.attr('data-original-name'));
input.attr('disabled', false)
.removeClass('hidden')
.focus();
Expand Down
2 changes: 2 additions & 0 deletions app/assets/javascripts/sitewide/constants.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ const GLOBAL_CONSTANTS = {
SLOW_STATUS_POLLING_INTERVAL: <%= Constants::SLOW_STATUS_POLLING_INTERVAL %>,
ASSET_POLLING_INTERVAL: <%= Constants::ASSET_POLLING_INTERVAL %>,
ASSET_SYNC_URL: '<%= Constants::ASSET_SYNC_URL %>',
GLOBAL_SEARCH_PREVIEW_LIMIT: <%= Constants::GLOBAL_SEARCH_PREVIEW_LIMIT %>,
SEARCH_LIMIT: <%= Constants::SEARCH_LIMIT %>
};
2 changes: 1 addition & 1 deletion app/assets/javascripts/sitewide/pdf_preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ var PdfPreview = (function() {


function loadPdfDocument(canvas, page = 1) {
var loadingPdf = pdfjsLib.getDocument(canvas.dataset.pdfUrl);
var loadingPdf = pdfjsLib.getDocument({ url: canvas.dataset.pdfUrl, isEvalSupported: false });
$(canvas).data('load-attempts', $(canvas).data('load-attempts') + 1);
loadingPdf.promise
.then(function(pdfDocument) {
Expand Down
23 changes: 23 additions & 0 deletions app/assets/javascripts/sitewide/tooltips.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
window.initTooltip = (element) => {
$(element).tooltip({
container: 'body',
delay: { show: 300, hide: 150 },
trigger: 'hover',
placement: (_, source) => {
const position = $(source).attr('data-tooltip-placement');
return position || 'top';
},
template: `<div class="tooltip" role="tooltip"><div class="tooltip-arrow">
</div><div class="tooltip-inner !max-w-[250px] text-left bg-black text-sn-white text-xs p-2"></div></div>`
});
};

window.destroyTooltip = (element) => {
$(element).tooltip('destroy');
};

$(document).on('turbolinks:load', function() {
$(document).find('[data-render-tooltip]').each(function() {
window.initTooltip(this);
})
});
12 changes: 12 additions & 0 deletions app/assets/stylesheets/application.tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,15 @@ html {
.ag-theme-alpine {
--ag-font-family: "SN Inter", "Open Sans", Arial, Helvetica, sans-serif !important;
}

.animate-skeleton {
background-image: linear-gradient(90deg, #ddd 0px, #e8e8e8 40px, #ddd 80px);
background-size: 500px;
animation: shine-lines 1.6s infinite linear
}

@keyframes shine-lines {
0% { background-position: -150px }

40%, 100% { background-position: 320px }
}
20 changes: 20 additions & 0 deletions app/assets/stylesheets/experiment/canvas.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@

.panel-heading {
padding: 7px 30px 7px 15px;

.panel-title {
align-items: center;
display: flex;
height: 100%;
}
}

.panel-body {
Expand Down Expand Up @@ -97,4 +103,18 @@
grid-template-columns: 1fr;
}
}

.bootstrap-select .dropdown-toggle:focus {
outline: none !important;
}

.filter-option-inner {
height: 100%;

.filter-option-inner-inner {
align-items: center;
display: flex;
height: 100%;
}
}
}
10 changes: 10 additions & 0 deletions app/assets/stylesheets/reports_pdf.sass.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,13 @@ thead {
display: table-row-group;
}

.report-module-repository-element {
.report-element-header {
.repository-name {
max-width: 100vw;
padding-bottom: 4px;
white-space: normal !important;
}
}
}

13 changes: 12 additions & 1 deletion app/assets/stylesheets/shared/datetime_picker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@

.dp__input {
line-height: unset;

&::placeholder {
color: var(--sn-grey);
}
}
}

Expand Down Expand Up @@ -147,6 +151,13 @@
height: 36px;
}
}

&.borderless-input {
.dp__input {
background-color: transparent;
border-color: transparent;
}
}
}

.dp__theme_light {
Expand Down Expand Up @@ -182,7 +193,7 @@
&:hover {
border-color: var(--sn-science-blue);
}
border-color: var(--sn-science-blue);
border-color: var(--sn-science-blue) !important;
}

:root {
Expand Down
8 changes: 6 additions & 2 deletions app/assets/stylesheets/shared_styles/elements/checkboxes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ input[type="checkbox"].sci-checkbox {
&::before {
@include font-awesome;
animation-timing-function: $timing-function-sharp;
background: $color-white;
background: transparent;
border: 1px solid var(--sn-black);
border-radius: 1px;
color: $color-white;
Expand Down Expand Up @@ -78,10 +78,14 @@ input[type="checkbox"].sci-checkbox {
}

&:focus {
outline: none;
outline: 0;
outline-offset: 0;
}

&:focus + .sci-checkbox-label {
outline: 4px solid var(--sn-science-blue-hover);
}

&:disabled {
cursor: default;

Expand Down
Loading

0 comments on commit d67c470

Please sign in to comment.