From dddf423a419529c840539be7eb5c763b606aa7e4 Mon Sep 17 00:00:00 2001 From: Yalaeddin Date: Tue, 14 May 2024 13:58:35 +0200 Subject: [PATCH] =?UTF-8?q?Masquage=20du=20champ=20Statut=20lorsqu'il=20n'?= =?UTF-8?q?est=20pas=20modifiable=20:=20d=C3=A9placer=20du=20plugin=20SCN?= =?UTF-8?q?=20vers=20TinyFeatures?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/overrides/issues/_attributes.rb | 9 +++++++++ spec/system/issues_spec.rb | 22 ++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 app/overrides/issues/_attributes.rb diff --git a/app/overrides/issues/_attributes.rb b/app/overrides/issues/_attributes.rb new file mode 100644 index 0000000..2e699fb --- /dev/null +++ b/app/overrides/issues/_attributes.rb @@ -0,0 +1,9 @@ +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/_form_with_positions", + :name => "hide_read_only_status_field", + :original => '8c07bc5c6125db54af3873465088717987a73827', + :remove => "p:contains('l(:field_status)')" \ No newline at end of file diff --git a/spec/system/issues_spec.rb b/spec/system/issues_spec.rb index 41b7b70..369fe8a 100644 --- a/spec/system/issues_spec.rb +++ b/spec/system/issues_spec.rb @@ -233,4 +233,26 @@ def log_user(login, password) expect(options).to eq (options.sort_by(&:parameterize)) end end + + describe "status field" do + let (:issue_test) { Issue.find(9) } + + before do + visit 'logout/' + find('input[name=commit]').click + log_user('jsmith', 'jsmith') + end + + it "Should hide the Status field when it is not editable" do + WorkflowTransition.delete_all + issue_test + visit "/issues/#{issue_test.id}/edit" + expect(page).to_not have_selector('label', text: "Status") + end + + it "Should show the Status field when it is editable" do + visit "/issues/#{issue_test.id}/edit" + expect(page).to have_selector('label', text: "Status *") + end + end end