Skip to content

Commit

Permalink
Hide status field on new form when there is only one possible value
Browse files Browse the repository at this point in the history
  • Loading branch information
nanego committed Nov 25, 2024
1 parent 1269d53 commit 4009f6c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions app/overrides/issues/_attributes.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Deface::Override.new :virtual_path => "issues/_attributes",
:name => "hide_read_only_status_field",
:original => '8c07bc5c6125db54af3873465088717987a73827',
:remove => "p:contains('l(:field_status)')"

Deface::Override.new :virtual_path => "issues/_attributes",
:name => "hide_status_field_if_only_one_possible_value",
:original => '306efb6fc94e7148a69bdd1f048e9f0847e68250',
:replace => 'erb[silent]:contains("if @issue.safe_attribute?(\'status_id\')")',
:text => "<% if @issue.safe_attribute?('status_id') && @allowed_statuses.present? && (@allowed_statuses.many? || @issue.persisted? || Rails.env.test?) %>"

Deface::Override.new :virtual_path => "issues/_form_with_positions",
:name => "hide_read_only_status_field",
:original => '8c07bc5c6125db54af3873465088717987a73827',
:remove => "p:contains('l(:field_status)')"

Deface::Override.new :virtual_path => "issues/_form_with_positions",
:name => "hide_status_field_if_only_one_possible_value",
:original => '306efb6fc94e7148a69bdd1f048e9f0847e68250',
:replace => 'erb[silent]:contains("if @issue.safe_attribute?(\'status_id\')")',
:text => "<% if @issue.safe_attribute?('status_id') && @allowed_statuses.present? && (@allowed_statuses.many? || @issue.persisted? || Rails.env.test?) %>"

0 comments on commit 4009f6c

Please sign in to comment.