Skip to content

Commit

Permalink
Merge pull request #7979 from scinote-eln/develop
Browse files Browse the repository at this point in the history
October 2024 Release
  • Loading branch information
artoscinote authored Oct 16, 2024
2 parents 62acbe0 + da50309 commit 501e5a9
Show file tree
Hide file tree
Showing 163 changed files with 5,608 additions and 938 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,7 @@ public/marvin4js-license.cxl

/app/assets/builds/*
!/app/assets/builds/.keep

# Ignore automatically generated js-routes files.
/app/javascript/routes.js
/app/javascript/routes.d.ts
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ before_install:
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-linux-x86_64 > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
- sudo chown --recursive 1000 .
- make docker-ci
script:
- make tests-ci
11 changes: 8 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:3.2.2-bookworm
FROM ruby:3.2-bookworm
MAINTAINER SciNote <info@scinote.net>

# additional dependecies
Expand All @@ -20,21 +20,26 @@ RUN apt-get update -qq && \
fonts-wqy-microhei \
fonts-wqy-zenhei \
libfile-mimeinfo-perl \
chromium-driver \
chromium \
chromium-sandbox \
yarnpkg && \
ln -s /usr/lib/x86_64-linux-gnu/libvips.so.42 /usr/lib/x86_64-linux-gnu/libvips.so && \
rm -rf /var/lib/apt/lists/*

ENV PATH=/usr/share/nodejs/yarn/bin:$PATH

RUN yarn add puppeteer@npm:puppeteer-core
RUN yarn add puppeteer@npm:puppeteer-core@^22.15.0

ENV BUNDLE_PATH /usr/local/bundle/

# create app directory
ENV APP_HOME /usr/src/app
ENV PATH $APP_HOME/bin:$PATH
RUN mkdir $APP_HOME
RUN adduser --uid 1000 scinote
RUN chown scinote:scinote $APP_HOME
USER scinote
ENV CHROMIUM_PATH=$APP_HOME/bin/chromium
WORKDIR $APP_HOME

CMD rails s -b 0.0.0.0
18 changes: 12 additions & 6 deletions Dockerfile.production
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Building stage
FROM ruby:3.2.2-bookworm AS builder
FROM ruby:3.2-bookworm AS builder

RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN \
Expand All @@ -23,7 +23,7 @@ COPY . $APP_HOME
RUN rm -f $APP_HOME/config/application.yml $APP_HOME/production.env
WORKDIR $APP_HOME
RUN \
--mount=target=$APP_HOME/tmp/bundle,type=cache \
--mount=target=/usr/src/app/tmp/bundle,type=cache \
bundle config set without 'development test' && \
bundle config set path '/usr/src/app/tmp/bundle' && \
bundle install --jobs `nproc` && \
Expand All @@ -34,14 +34,14 @@ RUN \

RUN \
--mount=type=cache,target=/usr/local/share/.cache/yarn/v6,sharing=locked \
--mount=type=cache,target=$APP_HOME/node_modules,sharing=locked \
--mount=type=cache,target=/usr/src/app/node_modules,sharing=locked \
DATABASE_URL=postgresql://postgres@db/scinote_production \
SECRET_KEY_BASE=dummy \
DEFACE_ENABLED=true \
bash -c "rake assets:precompile && rake deface:precompile"
bash -c "rake assets:precompile && rake deface:precompile && rm -rf ./tmp/cache"

# Final stage
FROM ruby:3.2.2-bookworm AS runner
FROM ruby:3.2-bookworm AS runner
MAINTAINER SciNote <info@scinote.net>

RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
Expand Down Expand Up @@ -76,6 +76,7 @@ RUN \
libvips42 \
graphviz \
chromium \
chromium-sandbox \
libfile-mimeinfo-perl \
yarnpkg && \
/usr/share/nodejs/yarn/bin/yarn add puppeteer@npm:puppeteer-core@^22.15.0 && \
Expand All @@ -88,6 +89,8 @@ RUN \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
touch /etc/build-${BUILD_TIMESTAMP} && \
DEBIAN_FRONTEND=noninteractive \
apt-get remove -y *-dev && \
apt-get autoremove -y && \
apt-get update -qq && \
apt-get upgrade -y && \
rm -rf /var/lib/apt/lists/*
Expand All @@ -98,7 +101,10 @@ ENV GEM_HOME=$APP_HOME/vendor/bundle/ruby/3.2.0
ENV PATH=$GEM_HOME/bin:$PATH
ENV BUNDLE_APP_CONFIG=.bundle

COPY --from=builder $APP_HOME $APP_HOME
RUN adduser --uid 1000 scinote
USER scinote

COPY --from=builder --chown=scinote:scinote $APP_HOME $APP_HOME

WORKDIR $APP_HOME

Expand Down
7 changes: 3 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source 'http://rubygems.org'

ruby '3.2.2'
ruby '~> 3.2.2'

gem 'activerecord-session_store'
gem 'bootsnap', require: false
Expand Down Expand Up @@ -62,6 +62,7 @@ gem 'logging', '~> 2.0.0'
gem 'nested_form_fields'
gem 'nokogiri', '~> 1.16.5' # HTML/XML parser
gem 'noticed'
gem 'oj'
gem 'rails_autolink', '~> 1.1', '>= 1.1.6'
gem 'rgl' # Graph framework for project diagram calculations
gem 'roo', '~> 2.10.0' # Spreadsheet parser
Expand All @@ -81,9 +82,6 @@ gem 'aws-sdk-lambda'
gem 'aws-sdk-rails'
gem 'aws-sdk-s3'
gem 'delayed_job_active_record'
gem 'devise-async',
git: 'https://github.com/mhfs/devise-async.git',
branch: 'devise-4.x'
gem 'image_processing'
gem 'img2zpl', git: 'https://github.com/scinote-eln/img2zpl'
gem 'rufus-scheduler'
Expand All @@ -94,6 +92,7 @@ gem 'graphviz'

gem 'cssbundling-rails'
gem 'jsbundling-rails'
gem 'js-routes'

gem 'tailwindcss-rails', '~> 2.4'

Expand Down
59 changes: 30 additions & 29 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@ GIT
sneaky-save (0.1.3)
activerecord (>= 3.2.0)

GIT
remote: https://github.com/mhfs/devise-async.git
revision: 177f6363a002f7ff28f1d289c8cab7ad8d9cb8c5
branch: devise-4.x
specs:
devise-async (0.10.2)
devise (>= 4.0)

GIT
remote: https://github.com/scinote-eln/canaid
revision: bba1b817d1c9b0c7e0440a83d0f62848aabc0a1b
Expand Down Expand Up @@ -105,9 +97,9 @@ GEM
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
active_model_serializers (0.10.13)
actionpack (>= 4.1, < 7.1)
activemodel (>= 4.1, < 7.1)
active_model_serializers (0.10.14)
actionpack (>= 4.1)
activemodel (>= 4.1)
case_transform (>= 0.2)
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
activejob (7.0.8.4)
Expand Down Expand Up @@ -203,14 +195,15 @@ GEM
erubi (>= 1.0.0)
rack (>= 0.9.0)
rouge (>= 1.0.0)
bigdecimal (3.1.8)
bindata (2.5.0)
binding_of_caller (1.0.0)
debug_inspector (>= 0.0.1)
bootsnap (1.16.0)
msgpack (~> 1.2)
brakeman (6.1.2)
racc
builder (3.2.4)
builder (3.3.0)
bullet (7.0.7)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11)
Expand Down Expand Up @@ -324,7 +317,7 @@ GEM
railties (>= 5)
down (5.4.1)
addressable (~> 2.8)
erubi (1.12.0)
erubi (1.13.0)
et-orbi (1.2.11)
tzinfo
execjs (2.8.1)
Expand Down Expand Up @@ -372,22 +365,24 @@ GEM
httparty (0.21.0)
mini_mime (>= 1.0.0)
multi_xml (>= 0.5.2)
i18n (1.14.5)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
i18n-js (3.9.2)
i18n (>= 0.6.6)
image_processing (1.12.2)
mini_magick (>= 4.9.5, < 5)
ruby-vips (>= 2.0.17, < 3)
iniparse (1.5.0)
jbuilder (2.11.5)
jbuilder (2.13.0)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
jmespath (1.6.2)
jquery-rails (4.5.1)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
js-routes (2.2.8)
railties (>= 4)
jsbundling-rails (1.1.1)
railties (>= 6.0.0)
json (2.6.3)
Expand Down Expand Up @@ -441,8 +436,7 @@ GEM
mime-types-data (3.2023.0218.1)
mini_magick (4.12.0)
mini_mime (1.1.5)
mini_portile2 (2.8.7)
minitest (5.23.1)
minitest (5.25.1)
msgpack (1.7.1)
multi_json (1.15.0)
multi_test (1.1.0)
Expand All @@ -463,13 +457,13 @@ GEM
net-smtp (0.4.0.1)
net-protocol
newrelic_rpm (9.2.2)
nio4r (2.7.0)
nokogiri (1.16.5)
nio4r (2.7.3)
nokogiri (1.16.7)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.16.5-arm64-darwin)
nokogiri (1.16.7-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.5-x86_64-linux)
nokogiri (1.16.7-x86_64-linux)
racc (~> 1.4)
noticed (1.6.3)
http (>= 4.0.0)
Expand All @@ -481,7 +475,10 @@ GEM
rack (>= 1.2, < 4)
snaky_hash (~> 2.0)
version_gem (~> 1.1)
omniauth (2.1.1)
oj (3.16.6)
bigdecimal (>= 3.0)
ostruct (>= 0.2)
omniauth (2.1.2)
hashie (>= 3.4.6)
rack (>= 2.2.3)
rack-protection
Expand All @@ -495,9 +492,9 @@ GEM
omniauth-rails_csrf_protection (1.0.1)
actionpack (>= 4.2)
omniauth (~> 2.0)
omniauth-saml (2.1.0)
omniauth (~> 2.0)
ruby-saml (~> 1.12)
omniauth-saml (2.2.1)
omniauth (~> 2.1)
ruby-saml (~> 1.17)
omniauth_openid_connect (0.7.1)
omniauth (>= 1.9, < 3)
openid_connect (~> 2.2)
Expand All @@ -515,6 +512,7 @@ GEM
validate_url
webfinger (~> 2.0)
orm_adapter (0.5.0)
ostruct (0.6.0)
overcommit (0.60.0)
childprocess (>= 0.6.3, < 5)
iniparse (~> 1.4)
Expand Down Expand Up @@ -545,7 +543,7 @@ GEM
pry (>= 0.10.4)
psych (3.3.4)
public_suffix (5.0.1)
puma (6.4.2)
puma (6.4.3)
nio4r (~> 2.0)
raabro (1.4.0)
racc (1.8.1)
Expand All @@ -561,8 +559,9 @@ GEM
faraday-follow_redirects
json-jwt (>= 1.11.0)
rack (>= 2.1.0)
rack-protection (3.0.6)
rack
rack-protection (3.2.0)
base64 (>= 0.1.0)
rack (~> 2.2, >= 2.2.4)
rack-test (2.1.0)
rack (>= 1.3)
rails (7.0.8.4)
Expand Down Expand Up @@ -827,6 +826,7 @@ DEPENDENCIES
image_processing
img2zpl!
jbuilder
js-routes
jsbundling-rails
json-jwt
json_matchers
Expand All @@ -839,6 +839,7 @@ DEPENDENCIES
newrelic_rpm
nokogiri (~> 1.16.5)
noticed
oj
omniauth (~> 2.1)
omniauth-azure-activedirectory-v2
omniauth-linkedin-oauth2
Expand Down Expand Up @@ -897,4 +898,4 @@ RUBY VERSION
ruby 3.2.2p53

BUNDLED WITH
2.4.10
2.5.11
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ heroku:
@echo "Set environment variables, DATABASE_URL, RAILS_SERVE_STATIC_FILES, RAKE_ENV, RAILS_ENV, SECRET_KEY_BASE"

docker:
@docker-compose build
@docker-compose --progress plain build

docker-ci:
@docker-compose --progress plain build web

docker-production:
@docker-compose -f docker-compose.production.yml build --build-arg BUILD_TIMESTAMP=$(BUILD_TIMESTAMP)
@docker-compose --progress plain -f docker-compose.production.yml build --build-arg BUILD_TIMESTAMP=$(BUILD_TIMESTAMP)

config-production:
ifeq (production.env,$(wildcard production.env))
Expand Down
2 changes: 2 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ require File.expand_path('../config/application', __FILE__)

Rails.application.load_tasks
Doorkeeper::Rake.load_tasks
# Update js-routes file before javascript build
task 'javascript:build' => 'js:routes:typescript'
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.36.2.2
1.37.0
9 changes: 3 additions & 6 deletions app/assets/javascripts/repositories/repository_datatable.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,7 @@ var RepositoryDatatable = (function(global) {

checkAvailableColumns();

RepositoryDatatableRowEditor.switchRowToEditMode(row);

changeToEditMode();
RepositoryDatatableRowEditor.switchRowToEditMode(row, changeToEditMode);
});
}

Expand Down Expand Up @@ -692,6 +690,7 @@ var RepositoryDatatable = (function(global) {
},
rowCallback: function(row, data) {
$(row).attr('data-editable', data.recordEditable);
$(row).attr('data-info-url', data.recordInfoUrl);
$(row).attr('data-manage-stock-url', data.manageStockUrl);
// Get row ID
let rowId = data.DT_RowId;
Expand Down Expand Up @@ -1003,10 +1002,8 @@ var RepositoryDatatable = (function(global) {
$(TABLE_ID).find('.repository-row-edit-icon').remove();

rowsSelected.forEach(function(rowNumber) {
RepositoryDatatableRowEditor.switchRowToEditMode(TABLE.row('#' + rowNumber));
RepositoryDatatableRowEditor.switchRowToEditMode(TABLE.row('#' + rowNumber), changeToEditMode);
});

changeToEditMode();
})
.on('click', '#assignRepositoryRecords', function(e) {
e.preventDefault();
Expand Down
Loading

0 comments on commit 501e5a9

Please sign in to comment.