fix: [Snyk] Security upgrade administrate from 0.19.0 to 0.20.1 (#8741)

-  Upgrade  administrate  gem to latest
- Update the `show` partial with changes from upstream
This commit is contained in:
Sojan Jose
2024-01-25 17:33:21 +04:00
committed by GitHub
parent 381423b1ae
commit 59184122f7
4 changed files with 62 additions and 42 deletions

View File

@@ -74,7 +74,7 @@ gem 'devise_token_auth'
gem 'jwt' gem 'jwt'
gem 'pundit' gem 'pundit'
# super admin # super admin
gem 'administrate', '>= 0.19.0' gem 'administrate', '>= 0.20.1'
gem 'administrate-field-active_storage', '>= 1.0.1' gem 'administrate-field-active_storage', '>= 1.0.1'
gem 'administrate-field-belongs_to_search', '>= 0.9.0' gem 'administrate-field-belongs_to_search', '>= 0.9.0'

View File

@@ -105,12 +105,12 @@ GEM
activerecord (>= 6.0, < 7.1) activerecord (>= 6.0, < 7.1)
addressable (2.8.4) addressable (2.8.4)
public_suffix (>= 2.0.2, < 6.0) public_suffix (>= 2.0.2, < 6.0)
administrate (0.19.0) administrate (0.20.1)
actionpack (>= 5.0) actionpack (>= 6.0, < 8.0)
actionview (>= 5.0) actionview (>= 6.0, < 8.0)
activerecord (>= 5.0) activerecord (>= 6.0, < 8.0)
jquery-rails (>= 4.0) jquery-rails (~> 4.6.0)
kaminari (>= 1.0) kaminari (~> 1.2.2)
sassc-rails (~> 2.1) sassc-rails (~> 2.1)
selectize-rails (~> 0.6) selectize-rails (~> 0.6)
administrate-field-active_storage (1.0.1) administrate-field-active_storage (1.0.1)
@@ -461,7 +461,7 @@ GEM
mini_magick (4.12.0) mini_magick (4.12.0)
mini_mime (1.1.5) mini_mime (1.1.5)
mini_portile2 (2.8.5) mini_portile2 (2.8.5)
minitest (5.20.0) minitest (5.21.2)
mock_redis (0.36.0) mock_redis (0.36.0)
ruby2_keywords ruby2_keywords
msgpack (1.7.0) msgpack (1.7.0)
@@ -840,7 +840,7 @@ DEPENDENCIES
active_record_query_trace active_record_query_trace
activerecord-import activerecord-import
acts-as-taggable-on acts-as-taggable-on
administrate (>= 0.19.0) administrate (>= 0.20.1)
administrate-field-active_storage (>= 1.0.1) administrate-field-active_storage (>= 1.0.1)
administrate-field-belongs_to_search (>= 0.9.0) administrate-field-belongs_to_search (>= 0.9.0)
annotate annotate

View File

@@ -34,17 +34,25 @@ as well as a link to its edit page.
<section class="main-content__body"> <section class="main-content__body">
<dl> <dl>
<% page.attributes.each do |attribute| %> <% page.attributes.each do |title, attributes| %>
<fieldset class="<%= "field-unit--nested" if title.present? %>">
<% if title.present? %>
<legend><%= t "helpers.label.#{page.resource_name}.#{title}", default: title %></legend>
<% end %>
<% attributes.each do |attribute| %>
<dt class="attribute-label" id="<%= attribute.name %>"> <dt class="attribute-label" id="<%= attribute.name %>">
<%= t( <%= t(
"helpers.label.#{resource_name}.#{attribute.name}", "helpers.label.#{resource_name}.#{attribute.name}",
default: attribute.name.titleize, default: page.resource.class.human_attribute_name(attribute.name),
) %> ) %>
</dt> </dt>
<dd class="attribute-data attribute-data--<%=attribute.html_class%>" <dd class="attribute-data attribute-data--<%=attribute.html_class%>"
><%= render_field attribute, page: page %></dd> ><%= render_field attribute, page: page %></dd>
<% end %> <% end %>
</fieldset>
<% end %>
</dl> </dl>
</section> </section>
@@ -69,7 +77,8 @@ as well as a link to its edit page.
</div> </div>
<% end %> <% end %>
<% account_user_page.attributes.each do |attribute| -%> <% account_user_page.attributes.each do |title, attributes| -%>
<% attributes.each do |attribute| %>
<% if attribute.name == "account" %> <% if attribute.name == "account" %>
<%= f.hidden_field('account_id', value: page.resource.id) %> <%= f.hidden_field('account_id', value: page.resource.id) %>
<% else %> <% else %>
@@ -77,6 +86,7 @@ as well as a link to its edit page.
<%= render_field attribute, f: f %> <%= render_field attribute, f: f %>
</div> </div>
<% end %> <% end %>
<% end %>
<% end -%> <% end -%>
<div class="form-actions"> <div class="form-actions">

View File

@@ -34,17 +34,25 @@ as well as a link to its edit page.
<section class="main-content__body"> <section class="main-content__body">
<dl> <dl>
<% page.attributes.each do |attribute| %> <% page.attributes.each do |title, attributes| %>
<fieldset class="<%= "field-unit--nested" if title.present? %>">
<% if title.present? %>
<legend><%= t "helpers.label.#{page.resource_name}.#{title}", default: title %></legend>
<% end %>
<% attributes.each do |attribute| %>
<dt class="attribute-label" id="<%= attribute.name %>"> <dt class="attribute-label" id="<%= attribute.name %>">
<%= t( <%= t(
"helpers.label.#{resource_name}.#{attribute.name}", "helpers.label.#{resource_name}.#{attribute.name}",
default: attribute.name.titleize, default: page.resource.class.human_attribute_name(attribute.name),
) %> ) %>
</dt> </dt>
<dd class="attribute-data attribute-data--<%=attribute.html_class%>" <dd class="attribute-data attribute-data--<%=attribute.html_class%>"
><%= render_field attribute, page: page %></dd> ><%= render_field attribute, page: page %></dd>
<% end %> <% end %>
</fieldset>
<% end %>
</dl> </dl>
</section> </section>
@@ -69,7 +77,8 @@ as well as a link to its edit page.
</div> </div>
<% end %> <% end %>
<% account_user_page.attributes.each do |attribute| -%> <% account_user_page.attributes.each do |title, attributes| -%>
<% attributes.each do |attribute| %>
<% if attribute.name == "user" %> <% if attribute.name == "user" %>
<%= f.hidden_field('user_id', value: page.resource.id) %> <%= f.hidden_field('user_id', value: page.resource.id) %>
<% else %> <% else %>
@@ -77,6 +86,7 @@ as well as a link to its edit page.
<%= render_field attribute, f: f %> <%= render_field attribute, f: f %>
</div> </div>
<% end %> <% end %>
<% end %>
<% end -%> <% end -%>
<div class="form-actions"> <div class="form-actions">