Skip to content

Commit

Permalink
Remove deprecated float positional classes from ingredients
Browse files Browse the repository at this point in the history
They have been replaced by `css_classes` in your ingredients settings.
  • Loading branch information
tvdeyen committed Sep 18, 2024
1 parent 2a791a1 commit eceb4bd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 31 deletions.
19 changes: 3 additions & 16 deletions app/views/alchemy/admin/ingredients/_file_fields.html.erb
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
<% css_classes = ingredient.settings[:css_classes] %>
<%= f.input :link_text %>
<%= f.input :title %>
<%- if css_classes.present? -%>
<%= f.input :css_class,
collection: css_classes,
include_blank: Alchemy.t('None') %>
<%- else -%>
<% Alchemy::Deprecation.warn %(Float positioning in File ingredients is deprecated. If you rely on them, please use `css_classes` in your "#{ingredient.role}" settings instead.) %>
<%= f.input :css_class,
label: Alchemy.t(:position_in_text),
collection: [
[Alchemy.t(:above), "no_float"],
[Alchemy.t(:left), "left"],
[Alchemy.t(:right), "right"]
], include_blank: Alchemy.t('Layout default') %>
<%- end -%>
<%= f.input :css_class,
collection: ingredient.settings[:css_classes],
include_blank: Alchemy.t('None') %>
9 changes: 0 additions & 9 deletions app/views/alchemy/admin/ingredients/_picture_fields.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,4 @@
end
end %>
<%= f.input :css_class, collection: css_classes_collection, include_blank: false %>
<%- else -%>
<% Alchemy::Deprecation.warn %(Float positioning in Picture ingredients is deprecated. If you rely on them, please use `css_classes` in your "#{ingredient.role}" settings instead.) %>
<%= f.input :css_class,
label: Alchemy.t(:position_in_text),
collection: [
[Alchemy.t(:above), "no_float"],
[Alchemy.t(:left), "left"],
[Alchemy.t(:right), "right"]
], include_blank: Alchemy.t("Layout default") %>
<%- end -%>
6 changes: 0 additions & 6 deletions spec/views/alchemy/admin/ingredients/edit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@
view.instance_variable_set(:@ingredient, ingredient)
end

around do |example|
Alchemy::Deprecation.silence do
example.run
end
end

context "for a picture ingredient" do
let(:image) do
fixture_file_upload(
Expand Down

0 comments on commit eceb4bd

Please sign in to comment.