add copy URL button

This commit is contained in:
Bilal
2020-07-22 12:17:57 +02:00
parent 55ffa3be7f
commit 1b5729ce34
4 changed files with 30 additions and 0 deletions

View File

@@ -1,3 +1,9 @@
<button type="button" class="btn btn-success mb-3" data-behavior="clipboard" href="<%= polymorphic_url [:new, @account, @project, @contract_template, @release, :amendment] %>">
<i class="fa fa-clipboard"></i>
<%= t '.copy_url' %>
</button>
<div class="card shadow-sm">
<div class="card-body">
<%= errors_summary_for @release %>

View File

@@ -1037,6 +1037,7 @@ en:
new:
amendment:
heading: Amendment
copy_url: Copy sign amendment URL
signature:
heading: Signature
appearance_releases:

View File

@@ -397,6 +397,7 @@ es:
new:
amendment:
heading: Amendment
copy_url: Copy sign amendment URL (ES)
signature:
heading: Signature (ES)
appearance_releases:

View File

@@ -110,6 +110,15 @@ feature "User managing location releases" do
expect(page).not_to have_content signed_successfully_message
expect(page).to have_content already_signed_message
end
scenario "amendment signing form has copy URL button" do
contract_template = create(:location_release_contract_template, :with_amendment_clause, project: project)
release = create(:location_release, contract_template: contract_template, project: project)
visit new_account_project_contract_template_location_release_amendment_path(project.account, project, contract_template, release)
expect(page).to have_content copy_url_button
end
end
context "when signed in" do
@@ -281,6 +290,15 @@ feature "User managing location releases" do
expect(page).to have_css('i.fa.fa-square-o', count: 1)
expect(page).to have_css('i.fa.fa-check-square-o', count: 1)
end
scenario "amendment signing form has copy URL button when user is signed in", js: true do
contract_template = create(:location_release_contract_template, :with_amendment_clause, project: project)
release = create(:location_release, contract_template: contract_template, project: project)
visit new_account_project_contract_template_location_release_amendment_path(project.account, project, contract_template, release)
expect(page).to have_content copy_url_button
end
end
scenario "viewing the contract PDF" do
@@ -664,4 +682,8 @@ feature "User managing location releases" do
def sign_amendment_link
t 'location_releases.location_release.actions.sign_amendment'
end
def copy_url_button
t 'public.amendments.new.copy_url'
end
end