Skip to content

Commit

Permalink
Merge pull request #7747 from scinote-eln/develop
Browse files Browse the repository at this point in the history
July 2024 Release
  • Loading branch information
artoscinote authored Jul 24, 2024
2 parents b0bc0ee + c7d3fdf commit 6db98fe
Show file tree
Hide file tree
Showing 163 changed files with 4,064 additions and 1,081 deletions.
5 changes: 1 addition & 4 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Style/GuardClause:
MinBodyLength: 1

Style/HashSyntax:
EnforcedStyle: ruby19
EnforcedShorthandSyntax: never

Style/IfUnlessModifier:
Enabled: true
Expand Down Expand Up @@ -299,9 +299,6 @@ Naming/VariableName:
Naming/VariableNumber:
EnforcedStyle: normalcase

Naming/BlockForwarding:
EnforcedStyle: explicit

Style/WordArray:
EnforcedStyle: percent
MinSize: 0
Expand Down
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ gem 'bcrypt', '~> 3.1.10'
# gem 'caracal'
gem 'caracal',
git: 'https://github.com/scinote-eln/caracal.git', branch: 'rubyzip2' # Build docx report
gem 'caxlsx' # Build XLSX files
gem 'deface', '~> 1.9'
gem 'down', '~> 5.0'
gem 'faker' # Generate fake data
Expand Down Expand Up @@ -106,6 +107,7 @@ group :development, :test do
gem 'awesome_print'
gem 'better_errors'
gem 'binding_of_caller'
gem 'brakeman', require: false
gem 'bullet'
gem 'byebug'
gem 'factory_bot_rails'
Expand Down
128 changes: 69 additions & 59 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -60,47 +60,47 @@ GIT
GEM
remote: http://rubygems.org/
specs:
actioncable (7.0.8.1)
actionpack (= 7.0.8.1)
activesupport (= 7.0.8.1)
actioncable (7.0.8.4)
actionpack (= 7.0.8.4)
activesupport (= 7.0.8.4)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (7.0.8.1)
actionpack (= 7.0.8.1)
activejob (= 7.0.8.1)
activerecord (= 7.0.8.1)
activestorage (= 7.0.8.1)
activesupport (= 7.0.8.1)
actionmailbox (7.0.8.4)
actionpack (= 7.0.8.4)
activejob (= 7.0.8.4)
activerecord (= 7.0.8.4)
activestorage (= 7.0.8.4)
activesupport (= 7.0.8.4)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.0.8.1)
actionpack (= 7.0.8.1)
actionview (= 7.0.8.1)
activejob (= 7.0.8.1)
activesupport (= 7.0.8.1)
actionmailer (7.0.8.4)
actionpack (= 7.0.8.4)
actionview (= 7.0.8.4)
activejob (= 7.0.8.4)
activesupport (= 7.0.8.4)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (7.0.8.1)
actionview (= 7.0.8.1)
activesupport (= 7.0.8.1)
actionpack (7.0.8.4)
actionview (= 7.0.8.4)
activesupport (= 7.0.8.4)
rack (~> 2.0, >= 2.2.4)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (7.0.8.1)
actionpack (= 7.0.8.1)
activerecord (= 7.0.8.1)
activestorage (= 7.0.8.1)
activesupport (= 7.0.8.1)
actiontext (7.0.8.4)
actionpack (= 7.0.8.4)
activerecord (= 7.0.8.4)
activestorage (= 7.0.8.4)
activesupport (= 7.0.8.4)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.0.8.1)
activesupport (= 7.0.8.1)
actionview (7.0.8.4)
activesupport (= 7.0.8.4)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
Expand All @@ -110,14 +110,14 @@ GEM
activemodel (>= 4.1, < 7.1)
case_transform (>= 0.2)
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
activejob (7.0.8.1)
activesupport (= 7.0.8.1)
activejob (7.0.8.4)
activesupport (= 7.0.8.4)
globalid (>= 0.3.6)
activemodel (7.0.8.1)
activesupport (= 7.0.8.1)
activerecord (7.0.8.1)
activemodel (= 7.0.8.1)
activesupport (= 7.0.8.1)
activemodel (7.0.8.4)
activesupport (= 7.0.8.4)
activerecord (7.0.8.4)
activemodel (= 7.0.8.4)
activesupport (= 7.0.8.4)
activerecord-import (1.4.1)
activerecord (>= 4.2)
activerecord-session_store (2.1.0)
Expand All @@ -127,14 +127,14 @@ GEM
multi_json (~> 1.11, >= 1.11.2)
rack (>= 2.0.8, < 4)
railties (>= 6.1)
activestorage (7.0.8.1)
actionpack (= 7.0.8.1)
activejob (= 7.0.8.1)
activerecord (= 7.0.8.1)
activesupport (= 7.0.8.1)
activestorage (7.0.8.4)
actionpack (= 7.0.8.4)
activejob (= 7.0.8.4)
activerecord (= 7.0.8.4)
activesupport (= 7.0.8.4)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (7.0.8.1)
activesupport (7.0.8.4)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
Expand Down Expand Up @@ -208,6 +208,8 @@ GEM
debug_inspector (>= 0.0.1)
bootsnap (1.16.0)
msgpack (~> 1.2)
brakeman (6.1.2)
racc
builder (3.2.4)
bullet (7.0.7)
activesupport (>= 3.0.0)
Expand All @@ -227,6 +229,11 @@ GEM
mail
case_transform (0.2)
activesupport
caxlsx (4.0.0)
htmlentities (~> 4.3, >= 4.3.4)
marcel (~> 1.0)
nokogiri (~> 1.10, >= 1.10.4)
rubyzip (>= 1.3.0, < 3)
cgi (0.4.1)
childprocess (4.1.0)
chunky_png (1.4.0)
Expand All @@ -241,7 +248,7 @@ GEM
combine_pdf (1.0.23)
matrix
ruby-rc4 (>= 0.1.5)
concurrent-ruby (1.2.3)
concurrent-ruby (1.3.1)
crack (0.4.5)
rexml
crass (1.0.6)
Expand Down Expand Up @@ -353,6 +360,7 @@ GEM
nokogiri (~> 1.0)
hashdiff (1.0.1)
hashie (5.0.0)
htmlentities (4.3.4)
http (5.1.1)
addressable (~> 2.8)
http-cookie (~> 1.0)
Expand All @@ -364,7 +372,7 @@ GEM
httparty (0.21.0)
mini_mime (>= 1.0.0)
multi_xml (>= 0.5.2)
i18n (1.14.1)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
i18n-js (3.9.2)
i18n (>= 0.6.6)
Expand Down Expand Up @@ -433,8 +441,8 @@ GEM
mime-types-data (3.2023.0218.1)
mini_magick (4.12.0)
mini_mime (1.1.5)
mini_portile2 (2.8.6)
minitest (5.22.2)
mini_portile2 (2.8.7)
minitest (5.23.1)
msgpack (1.7.1)
multi_json (1.15.0)
multi_test (1.1.0)
Expand Down Expand Up @@ -540,8 +548,8 @@ GEM
puma (6.4.2)
nio4r (~> 2.0)
raabro (1.4.0)
racc (1.7.3)
rack (2.2.8.1)
racc (1.8.0)
rack (2.2.9)
rack-attack (6.6.1)
rack (>= 1.0, < 3)
rack-cors (2.0.2)
Expand All @@ -557,20 +565,20 @@ GEM
rack
rack-test (2.1.0)
rack (>= 1.3)
rails (7.0.8.1)
actioncable (= 7.0.8.1)
actionmailbox (= 7.0.8.1)
actionmailer (= 7.0.8.1)
actionpack (= 7.0.8.1)
actiontext (= 7.0.8.1)
actionview (= 7.0.8.1)
activejob (= 7.0.8.1)
activemodel (= 7.0.8.1)
activerecord (= 7.0.8.1)
activestorage (= 7.0.8.1)
activesupport (= 7.0.8.1)
rails (7.0.8.4)
actioncable (= 7.0.8.4)
actionmailbox (= 7.0.8.4)
actionmailer (= 7.0.8.4)
actionpack (= 7.0.8.4)
actiontext (= 7.0.8.4)
actionview (= 7.0.8.4)
activejob (= 7.0.8.4)
activemodel (= 7.0.8.4)
activerecord (= 7.0.8.4)
activestorage (= 7.0.8.4)
activesupport (= 7.0.8.4)
bundler (>= 1.15.0)
railties (= 7.0.8.1)
railties (= 7.0.8.4)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
Expand All @@ -591,9 +599,9 @@ GEM
railties (> 3.1)
rails_serve_static_assets (0.0.5)
rails_stdout_logging (0.0.5)
railties (7.0.8.1)
actionpack (= 7.0.8.1)
activesupport (= 7.0.8.1)
railties (7.0.8.4)
actionpack (= 7.0.8.4)
activesupport (= 7.0.8.4)
method_source
rake (>= 12.2)
thor (~> 1.0)
Expand Down Expand Up @@ -791,12 +799,14 @@ DEPENDENCIES
better_errors
binding_of_caller
bootsnap
brakeman
bullet
byebug
canaid!
capybara
capybara-email
caracal!
caxlsx
cssbundling-rails
cucumber-rails
database_cleaner
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.35.0.2
1.36.0
Binary file added app/assets/images/import_instruction.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions app/assets/javascripts/my_modules/repositories.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,8 @@ var MyModuleRepositories = (function() {
json.state.columns[0].visible = false;
}
if ($(tableContainer).data('type') !== 'snapshot') {
json.state.columns[6].visible = false;
json.state.columns[7].visible = false;
json.state.columns[9].visible = false;
json.state.columns[10].visible = false;
}
if (json.state.search) delete json.state.search;
if ($(tableContainer).data('stockConsumptionColumn')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ $.fn.dataTable.render.editRepositoryNumberValue = function(formId, columnId, cel
});

$input.on('input', function() {
const regexp = decimals === 0 ? /[^0-9]/g : /[^0-9.]/g;
const decimalsRegex = new RegExp(`^\\d*(\\.\\d{0,${decimals}})?`);
const regexp = decimals === 0 ? /[^-0-9]/g : /[^-0-9.]/g;
const decimalsRegex = new RegExp(`^-?\\d*(\\.\\d{0,${decimals}})?`);
let value = this.value;
value = value.replace(regexp, '');
value = value.match(decimalsRegex)[0];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ $.fn.dataTable.render.newRepositoryNumberValue = function(formId, columnId, $cel
});

$input.on('input', function() {
const decimalsRegex = new RegExp(`^\\d*(\\.\\d{0,${decimals}})?`);
const decimalsRegex = new RegExp(`^-?\\d*(\\.\\d{0,${decimals}})?`);
let value = this.value;
value = value.replace(/[^0-9.]/g, '');
value = value.replace(/[^-0-9.]/g, '');
value = value.match(decimalsRegex)[0];
this.value = value;
});
Expand Down
15 changes: 12 additions & 3 deletions app/assets/javascripts/repositories/repository_datatable.js
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,8 @@ var RepositoryDatatable = (function(global) {
visible: true,
render: function(data, type, row) {
return "<a href='" + row.recordInfoUrl + "'"
+ "class='record-info-link' data-e2e='e2e-TL-invInventoryTR-Item-" + row.DT_RowId + "'>" + data + '</a>';
+ " class='record-info-link' data-e2e='e2e-TL-invInventoryTR-Item-" + row.DT_RowId + "'"
+ " title='" + data + "'>" + data + '</a>';
}
}, {
targets: 4,
Expand All @@ -661,6 +662,14 @@ var RepositoryDatatable = (function(global) {
targets: 6,
class: 'added-by',
visible: true
}, {
targets: 7,
class: 'updated-on',
visible: true
}, {
targets: 8,
class: 'updated-by',
visible: true
}, {
targets: '_all',
render: function(data) {
Expand Down Expand Up @@ -751,8 +760,8 @@ var RepositoryDatatable = (function(global) {
var state = localStorage.getItem(`datatables_repositories_state/${repositoryId}/${viewType}`);

json.state.start = state !== null ? JSON.parse(state).start : 0;
if (json.state.columns[7]) json.state.columns[7].visible = archived;
if (json.state.columns[8]) json.state.columns[8].visible = archived;
if (json.state.columns[9]) json.state.columns[9].visible = archived;
if (json.state.columns[10]) json.state.columns[10].visible = archived;
if (json.state.search) delete json.state.search;

if (json.state.ColSizes && json.state.ColSizes.length > 0) {
Expand Down
19 changes: 16 additions & 3 deletions app/assets/javascripts/repositories/show.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@
$('#parse-records-modal').modal('show');
repositoryRecordsImporter();
});

// Handling cancel click in #parse-records-modal
$('#parse-records-modal').on('click', '#parse-records-cancel-btn', () => {
$('#parse-records-modal').modal('hide');
// remove previous modal (necessary to get the new relevant data instead of old data)
setTimeout(() => {
$('#parse-records-modal').remove();
}, 200);
});
}

function initTable() {
Expand All @@ -56,7 +65,7 @@
data.responseJSON.message + '</span>');
});

submitBtn.on('click', function(event) {
submitBtn.one('click', (event) => {
var data = new FormData();
submitBtn.attr('disabled', true);
$('#parse-sheet-loader').removeClass('hidden');
Expand All @@ -78,8 +87,12 @@

function initImportRecordsModal() {
$('.repository-show').on('click', '#importRecordsButton', function() {
$('#modal-import-records').modal('show');
initParseRecordsModal();
window.importRepositoryModalComponent.open();
});

// Handling cancel click in #modal-import-records
$('#modal-import-records').on('click', '#import-records-cancel-btn', () => {
$('#modal-import-records').modal('hide');
});
}

Expand Down
Loading

0 comments on commit 6db98fe

Please sign in to comment.