Skip to content

Commit

Permalink
Merge pull request #485 from Vizzuality/develop
Browse files Browse the repository at this point in the history
Minor prod release
  • Loading branch information
martintomas authored Jan 15, 2024
2 parents a413b20 + a6264c7 commit 901fd4d
Show file tree
Hide file tree
Showing 11 changed files with 122 additions and 51 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ gem 'bootsnap', '>= 1.4.2', require: false

gem 'activerecord-import'
gem 'acts_as_list'
gem 'activeadmin', '2.9.0' # TODO: update when csv export is fixed, check bom options
gem 'activeadmin'
gem 'activeadmin_addons'
gem 'devise', '>= 4.7.1'
gem 'cancancan'
Expand Down
88 changes: 44 additions & 44 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ GEM
actionpack
addressable
active_material (1.5.2)
activeadmin (2.9.0)
activeadmin (3.2.0)
arbre (~> 1.2, >= 1.2.1)
formtastic (>= 3.1, < 5.0)
formtastic_i18n (~> 0.4)
formtastic (>= 3.1)
formtastic_i18n (>= 0.4)
inherited_resources (~> 1.7)
jquery-rails (~> 4.2)
kaminari (~> 1.0, >= 1.2.1)
railties (>= 5.2, < 6.2)
ransack (~> 2.1, >= 2.1.1)
jquery-rails (>= 4.2)
kaminari (>= 1.2.1)
railties (>= 6.1)
ransack (>= 4.0)
activeadmin_addons (1.9.0)
active_material
railties
Expand Down Expand Up @@ -97,9 +97,9 @@ GEM
rake (>= 10.4, < 14.0)
appsignal (3.4.6)
rack
arbre (1.5.0)
activesupport (>= 3.0.0, < 7.1)
ruby2_keywords (>= 0.0.2, < 1.0)
arbre (1.7.0)
activesupport (>= 3.0.0)
ruby2_keywords (>= 0.0.2)
ast (2.4.2)
attr_extras (6.2.5)
babel-source (5.8.35)
Expand Down Expand Up @@ -163,7 +163,7 @@ GEM
activerecord (>= 5.a)
database_cleaner-core (~> 2.0.0)
database_cleaner-core (2.0.1)
date (3.3.3)
date (3.3.4)
declarative (0.0.20)
devise (4.8.1)
bcrypt (~> 3.0)
Expand Down Expand Up @@ -203,13 +203,13 @@ GEM
ffi (1.15.5)
font-awesome-rails (4.7.0.8)
railties (>= 3.2, < 8.0)
formtastic (4.0.0)
actionpack (>= 5.2.0)
formtastic (5.0.0)
actionpack (>= 6.0.0)
formtastic_i18n (0.7.0)
friendly_id (5.4.2)
activerecord (>= 4.0.0)
globalid (1.1.0)
activesupport (>= 5.0)
globalid (1.2.1)
activesupport (>= 6.1)
google-apis-core (0.7.0)
addressable (~> 2.5, >= 2.5.1)
googleauth (>= 0.16.2, < 2.a)
Expand Down Expand Up @@ -244,7 +244,7 @@ GEM
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (>= 0.16, < 2.a)
has_scope (0.8.0)
has_scope (0.8.2)
actionpack (>= 5.2)
activesupport (>= 5.2)
htmlentities (4.3.4)
Expand All @@ -254,12 +254,12 @@ GEM
image_processing (1.12.2)
mini_magick (>= 4.9.5, < 5)
ruby-vips (>= 2.0.17, < 3)
inherited_resources (1.13.1)
actionpack (>= 5.2, < 7.1)
has_scope (~> 0.6)
railties (>= 5.2, < 7.1)
responders (>= 2, < 4)
jquery-rails (4.5.0)
inherited_resources (1.14.0)
actionpack (>= 6.0)
has_scope (>= 0.6)
railties (>= 6.0)
responders (>= 2)
jquery-rails (4.6.0)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
Expand All @@ -281,7 +281,7 @@ GEM
listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
loofah (2.21.3)
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
mail (2.8.1)
Expand All @@ -295,24 +295,24 @@ GEM
method_source (1.0.0)
mini_magick (4.11.0)
mini_mime (1.1.5)
mini_portile2 (2.8.4)
minitest (5.19.0)
mini_portile2 (2.8.5)
minitest (5.21.1)
msgpack (1.5.3)
multi_json (1.15.0)
net-imap (0.3.7)
net-imap (0.4.9.1)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.1)
net-protocol (0.2.2)
timeout
net-scp (1.2.1)
net-ssh (>= 2.6.5)
net-smtp (0.3.3)
net-smtp (0.4.0.1)
net-protocol
net-ssh (7.0.1)
nio4r (2.5.9)
nokogiri (1.15.4)
nio4r (2.7.0)
nokogiri (1.16.0)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
optimist (3.0.1)
Expand All @@ -336,9 +336,9 @@ GEM
i18n (>= 0.5.0)
railties (>= 5.0.0)
public_suffix (4.0.7)
puma (5.6.7)
puma (5.6.8)
nio4r (~> 2.0)
racc (1.7.1)
racc (1.7.3)
rack (2.2.8)
rack-cors (1.1.1)
rack (>= 2.0.0)
Expand Down Expand Up @@ -379,10 +379,10 @@ GEM
rake (>= 12.2)
thor (~> 1.0)
rainbow (3.1.1)
rake (13.0.6)
ransack (2.6.0)
activerecord (>= 6.0.4)
activesupport (>= 6.0.4)
rake (13.1.0)
ransack (4.1.1)
activerecord (>= 6.1.5)
activesupport (>= 6.1.5)
i18n
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
Expand All @@ -401,9 +401,9 @@ GEM
request_store (1.5.1)
rack (>= 1.4)
require_all (3.0.0)
responders (3.0.1)
actionpack (>= 5.0)
railties (>= 5.0)
responders (3.1.1)
actionpack (>= 5.2)
railties (>= 5.2)
retriable (3.1.2)
rexml (3.2.6)
roo (2.10.0)
Expand Down Expand Up @@ -487,7 +487,7 @@ GEM
spring-watcher-listen (2.0.1)
listen (>= 2.7, < 4.0)
spring (>= 1.2, < 3.0)
sprockets (4.2.0)
sprockets (4.2.1)
concurrent-ruby (~> 1.0)
rack (>= 2.2.4, < 4)
sprockets-rails (3.4.2)
Expand All @@ -502,10 +502,10 @@ GEM
diff-lcs
patience_diff
test-prof (1.0.9)
thor (1.2.2)
thor (1.3.0)
tilt (2.0.10)
timecop (0.9.5)
timeout (0.4.0)
timeout (0.4.1)
trailblazer-option (0.1.2)
turbolinks (5.2.1)
turbolinks-source (~> 5.2)
Expand Down Expand Up @@ -543,14 +543,14 @@ GEM
rails (>= 3.2.16)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.6.11)
zeitwerk (2.6.12)

PLATFORMS
ruby

DEPENDENCIES
active_link_to
activeadmin (= 2.9.0)
activeadmin
activeadmin_addons
activerecord-import
acts_as_list
Expand Down
26 changes: 26 additions & 0 deletions app/assets/stylesheets/admin/trix.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,29 @@ trix-toolbar {
}
}
}

.trix-editor, .trix-content {
font-size: 1rem;

.attachment {
&__caption {
display: none;
}
}

.attachment--preview {
//position: relative;
//float: left;
//width: auto;
//margin: 10px 10px 10px 0;
text-align: center;
max-width: 100%;
padding: 0;
}

&:after {
content: '';
display: block;
clear: both;
}
}
19 changes: 19 additions & 0 deletions app/assets/stylesheets/tpi/_pages.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,25 @@ $margin-between-list-items: 20px;
margin-top: 30px;
margin-bottom: 30px;
}

.attachment {
&--preview {
//position: relative;
//float: left;
//margin: 10px 10px 10px 0;
text-align: center;
max-width: 100%;
padding: 0;

img {
margin: 0;
}
}

&__caption {
display: none;
}
}
}

.pages__content {
Expand Down
4 changes: 1 addition & 3 deletions app/decorators/news_article_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ def tpi_sector_links
end

def preview_url
h.tpi_publication_url(
model, {type: 'NewsArticle', host: Rails.configuration.try(:tpi_domain)}.compact
)
h.show_news_article_tpi_publication_path(model, {host: Rails.configuration.try(:tpi_domain)}.compact)
end
end
2 changes: 2 additions & 0 deletions app/inputs/trix_input.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ def to_html
input_wrapping do
editor_tag_params = {
input: input_html_options[:id],
'data-direct-upload-url': Rails.application.routes.url_helpers.rails_direct_uploads_path,
'data-blob-url-template': Rails.application.routes.url_helpers.rails_service_blob_path(':signed_id', ':filename'),
class: 'trix-content'
}

Expand Down
3 changes: 3 additions & 0 deletions app/javascript/packs/admin.js
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
import 'admin';

require('@rails/activestorage');
require('@rails/actiontext');
8 changes: 8 additions & 0 deletions app/models/application_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,12 @@ class ApplicationRecord < ActiveRecord::Base
def self.array_to_enum_hash(array)
array.map { |el| [el, el] }.to_h
end

def self.ransackable_associations(_auth_object = nil)
@ransackable_associations ||= reflect_on_all_associations.map { |a| a.name.to_s }
end

def self.ransackable_attributes(_auth_object = nil)
@ransackable_attributes ||= column_names + _ransackers.keys + _ransack_aliases.keys + attribute_aliases.keys
end
end
2 changes: 1 addition & 1 deletion bin/yarn
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ APP_ROOT = File.expand_path('..', __dir__)
Dir.chdir(APP_ROOT) do
yarn = ENV["PATH"].split(File::PATH_SEPARATOR).
select { |dir| File.expand_path(dir) != __dir__ }.
product(["yarn", "yarn.exe"]).
product(["yarn", "yarn.cmd", "yarn.ps1"]).
map { |dir, file| File.expand_path(file, dir) }.
find { |file| File.executable?(file) }

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"@hotwired/stimulus": "^3.1.0",
"@hotwired/stimulus-webpack-helpers": "^1.0.1",
"@rails/actioncable": "^6.0.3-3",
"@rails/actiontext": "^6.1.7-6",
"@rails/activestorage": "^6.0.3-3",
"@rails/ujs": "^6.0.3-3",
"@rails/webpacker": "^5.2.1",
Expand Down Expand Up @@ -63,7 +64,7 @@
"react_ujs": "^2.6.0",
"simple-statistics": "^7.1.0",
"tiny-slider": "^2.9.3",
"trix": "^1.2.4",
"trix": "^1.2.0",
"turbolinks": "^5.2.0"
},
"devDependencies": {
Expand Down
16 changes: 15 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1241,6 +1241,20 @@
resolved "https://registry.yarnpkg.com/@rails/actioncable/-/actioncable-6.0.5.tgz#a889f25b0c13ea0215d747e32fa3d1a52967f17b"
integrity sha512-79sIsTpIoHnJ6pRHKaC6h5NMRpY+VZD4mqOKN/035X1ehxHgToDWvgMZ4jV5y1qeObg4enmNESmgeKoImYGzOw==

"@rails/actiontext@^6.1.7-6":
version "6.1.7"
resolved "https://registry.yarnpkg.com/@rails/actiontext/-/actiontext-6.1.7.tgz#62997bda1d938743ed36bb802885592b01bc6782"
integrity sha512-o3TYFeFzDQKR22EGqE9qqJ6SD4DM+cATw8nioPtrRkIlAsBIHeaV0h4Kok1sDXyNjXiJztCr89CsfV7YXnYFmw==
dependencies:
"@rails/activestorage" "^6.0.0"

"@rails/activestorage@^6.0.0":
version "6.1.7"
resolved "https://registry.yarnpkg.com/@rails/activestorage/-/activestorage-6.1.7.tgz#5aaae9f4d10800fdb4fd6fe26fd8b4218579c6e3"
integrity sha512-h++k8LBLns4O8AqzdaFp1TsCLP9VSc2hgWI37bjzJ+4D995X7Rd8kdkRmXRaNAUlHDJgy6RpnbhBJ5oiIgWTDw==
dependencies:
spark-md5 "^3.0.0"

"@rails/activestorage@^6.0.3-3":
version "6.0.5"
resolved "https://registry.yarnpkg.com/@rails/activestorage/-/activestorage-6.0.5.tgz#446e4b3f45bf1d4e1c6fd0b8b6e2566cb70c2b18"
Expand Down Expand Up @@ -8724,7 +8738,7 @@ topojson-client@^3.0.0:
dependencies:
commander "2"

trix@^1.2.4:
trix@^1.2.0:
version "1.3.1"
resolved "https://registry.yarnpkg.com/trix/-/trix-1.3.1.tgz#ccce8d9e72bf0fe70c8c019ff558c70266f8d857"
integrity sha512-BbH6mb6gk+AV4f2as38mP6Ucc1LE3OD6XxkZnAgPIduWXYtvg2mI3cZhIZSLqmMh9OITEpOBCCk88IVmyjU7bA==
Expand Down

0 comments on commit 901fd4d

Please sign in to comment.