Compare commits
2 Commits
add-photos
...
make-US-de
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
253f6dc8f6 | ||
|
|
1bd6d456ab |
@@ -45,7 +45,7 @@ class Public::MaterialReleasesController < Public::BaseController
|
||||
:person_first_name, :person_last_name, :person_title, :person_company, :person_phone, :person_email,
|
||||
:person_address_street1, :person_address_street2, :person_address_city, :person_address_state, :person_address_zip, :person_address_country,
|
||||
:signature_base64,
|
||||
:locale, :contract_template, :description, photos: []
|
||||
:locale, :contract_template, :description
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
@@ -3,8 +3,6 @@ module DropzoneHelper
|
||||
case releasable.model_name.param_key
|
||||
when "acquired_media_release"
|
||||
"To Add Photos & Videos to the release:<br>Drag & Drop Files<br>or<br>Click or Tap here to browse photos and connect to Camera"
|
||||
when "material_release"
|
||||
t 'material_releases.form.photos.dropzone_label'
|
||||
when "music_release"
|
||||
"To Add Audio Files to the release:<br>Drag & Drop Files<br>or<br>Click or Tap here to browse files"
|
||||
when "directory"
|
||||
|
||||
@@ -34,10 +34,6 @@
|
||||
<%= render "shared/address_fields", form: form, subject: "person" %>
|
||||
<% end %>
|
||||
|
||||
<%= card_field_set_tag t(".photo.heading") do %>
|
||||
<%= render "shared/photos_dropzone_fields", form: form, release: @material_release %>
|
||||
<% end %>
|
||||
|
||||
<hr>
|
||||
|
||||
<%= card_field_set_tag t(".signature.heading") do %>
|
||||
|
||||
@@ -11,6 +11,6 @@
|
||||
</div>
|
||||
<%= form.form_group "#{field_name_prefix}address_country" do %>
|
||||
<%= form.label "#{field_name_prefix}address_country" %>
|
||||
<%= form.country_select "#{field_name_prefix}address_country", { priority: %w(US CA), prompt: true }, class: "form-control custom-select" %>
|
||||
<%= form.country_select "#{field_name_prefix}address_country", { selected: 'US', priority: %w(US CA), prompt: true }, class: "form-control custom-select" %>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -590,7 +590,6 @@ en:
|
||||
heading: 1 of 3 Material Details
|
||||
photos:
|
||||
heading: 4 of 4 Photos
|
||||
dropzone_label: Tap to take a photo of Licensed Material (optional)
|
||||
signer_details:
|
||||
heading: 2 of 4 Licensor/Owner Details
|
||||
index:
|
||||
@@ -816,8 +815,6 @@ en:
|
||||
heading: Release Information
|
||||
signature:
|
||||
heading: Sign Below
|
||||
photo:
|
||||
heading: Photos
|
||||
talent_releases:
|
||||
create:
|
||||
notice: Your release has been signed. Thank you!
|
||||
|
||||
@@ -175,10 +175,6 @@ es:
|
||||
show:
|
||||
choose_project: ¿Qué proyecto de la lista de abajo asistirá?
|
||||
welcome_html: Bienvenidos a la plataforma de firma autorizaciónes de <strong>%{name}</strong>
|
||||
material_releases:
|
||||
new:
|
||||
photo:
|
||||
heading: Photos (ES)
|
||||
shared:
|
||||
print: Print (ES)
|
||||
talent_releases:
|
||||
@@ -186,7 +182,3 @@ es:
|
||||
photos:
|
||||
guardian_photo:
|
||||
heading: Guardian Photo (ES)
|
||||
material_releases:
|
||||
form:
|
||||
photos:
|
||||
dropzone_label: Tap to take a photo of Licensed Material (optional)
|
||||
|
||||
@@ -7,15 +7,6 @@ describe Public::MaterialReleasesController do
|
||||
render_views
|
||||
|
||||
describe "#create" do
|
||||
it "allows photos param" do
|
||||
contract_template = create(:contract_template, project: project)
|
||||
|
||||
post :create, params: { account_id: user.primary_account.to_param, project_id: project, contract_template_id: contract_template, material_release: material_release_params_with_photos }
|
||||
|
||||
expect(response).to be_successful
|
||||
expect(MaterialRelease.last.photos.attached?).to eq true
|
||||
end
|
||||
|
||||
it "logs analytics" do
|
||||
contract_template = create(:contract_template, project: project)
|
||||
|
||||
@@ -74,11 +65,6 @@ describe Public::MaterialReleasesController do
|
||||
attributes_for(:material_release, :native).except(:signature).merge(signature_param)
|
||||
end
|
||||
|
||||
def material_release_params_with_photos
|
||||
attributes_for(:material_release, :native, :with_photo).except(:signature).merge(signature_param)
|
||||
end
|
||||
|
||||
|
||||
def signature_param
|
||||
file = file_fixture("signature.png")
|
||||
data_uri = Base64Image.from_image(file).data_uri
|
||||
|
||||
@@ -15,14 +15,6 @@ FactoryBot.define do
|
||||
end
|
||||
end
|
||||
|
||||
trait :with_photo do
|
||||
photos do
|
||||
path = Rails.root.join("spec", "fixtures", "files", "material_photo.png")
|
||||
[Rack::Test::UploadedFile.new(path, "image/png")]
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
trait :non_native do
|
||||
contract do
|
||||
path = Rails.root.join("spec", "fixtures", "files", "contract.pdf")
|
||||
|
||||
@@ -5,6 +5,13 @@ feature "User managing acquired_media releases" do
|
||||
let(:project) { create(:project, members: current_user, account: current_user.primary_account) }
|
||||
|
||||
context "when signed out" do
|
||||
scenario "United States is default country" do
|
||||
contract_template = create(:contract_template, project: project)
|
||||
|
||||
visit new_account_project_contract_template_acquired_media_release_path(project.account, project, contract_template)
|
||||
expect(country_field_value).to eq "US"
|
||||
end
|
||||
|
||||
scenario "creating a release", js: true do
|
||||
contract_template = create(:contract_template, project: project)
|
||||
|
||||
@@ -205,6 +212,10 @@ feature "User managing acquired_media releases" do
|
||||
|
||||
private
|
||||
|
||||
def country_field_value
|
||||
find_field("acquired_media_release[person_address_country]").value
|
||||
end
|
||||
|
||||
def acquired_media_name_field
|
||||
"acquired_media_release[name]"
|
||||
end
|
||||
|
||||
@@ -5,6 +5,13 @@ feature "User managing location releases" do
|
||||
let(:project) { create(:project, members: current_user, account: current_user.primary_account) }
|
||||
|
||||
context "when signed out" do
|
||||
scenario "United States is default country" do
|
||||
contract_template = create(:contract_template, project: project)
|
||||
|
||||
visit new_account_project_contract_template_location_release_path(project.account, project, contract_template)
|
||||
expect(country_field_value).to eq "US"
|
||||
end
|
||||
|
||||
scenario "creating a release", js: true do
|
||||
contract_template = create(:contract_template, project: project)
|
||||
|
||||
@@ -195,6 +202,10 @@ feature "User managing location releases" do
|
||||
|
||||
private
|
||||
|
||||
def country_field_value
|
||||
find_field("location_release[person_address_country]").value
|
||||
end
|
||||
|
||||
def photos_heading(photos_count = 1)
|
||||
t 'contracts.photos.heading', count: photos_count
|
||||
end
|
||||
|
||||
@@ -5,7 +5,14 @@ feature "User managing material releases" do
|
||||
let(:project) { create(:project, members: current_user, account: current_user.primary_account) }
|
||||
|
||||
context "when signed out" do
|
||||
scenario "creating a release without photos", js: true do
|
||||
scenario "United States is default country" do
|
||||
contract_template = create(:contract_template, project: project)
|
||||
|
||||
visit new_account_project_contract_template_material_release_path(project.account, project, contract_template)
|
||||
expect(country_field_value).to eq "US"
|
||||
end
|
||||
|
||||
scenario "creating a release", js: true do
|
||||
contract_template = create(:contract_template, project: project)
|
||||
|
||||
visit new_account_project_contract_template_material_release_path(project.account, project, contract_template)
|
||||
@@ -17,27 +24,10 @@ feature "User managing material releases" do
|
||||
draw_signature file_fixture("signature.png"), "material_release_signature_base64"
|
||||
end
|
||||
|
||||
click_button submit_release_button
|
||||
click_button "I have read and agree to the above"
|
||||
|
||||
expect(page).to have_content("Your release was successfully submitted. Thank you.")
|
||||
end
|
||||
|
||||
scenario "creating a release with photos", js: true do
|
||||
contract_template = create(:contract_template, project: project)
|
||||
|
||||
visit new_account_project_contract_template_material_release_path(project.account, project, contract_template)
|
||||
|
||||
fill_in material_name_field, with: "Pepsi Logo"
|
||||
fill_in person_first_name_field, with: "Jane"
|
||||
fill_in person_last_name_field, with: "Doe"
|
||||
draw_signature file_fixture("signature.png"), "material_release_signature_base64"
|
||||
|
||||
drop_file Rails.root.join(file_fixture("material_photo.png")), type: :dropzone
|
||||
click_button submit_release_button
|
||||
|
||||
expect(page).to have_content("Your release was successfully submitted. Thank you.")
|
||||
expect(MaterialRelease.last.photos.attached?).to eq true
|
||||
end
|
||||
end
|
||||
|
||||
context "when signed in" do
|
||||
@@ -197,6 +187,10 @@ feature "User managing material releases" do
|
||||
|
||||
private
|
||||
|
||||
def country_field_value
|
||||
find_field("material_release[person_address_country]").value
|
||||
end
|
||||
|
||||
def photos_heading(photos_count = 1)
|
||||
t 'contracts.photos.heading', count: photos_count
|
||||
end
|
||||
@@ -241,10 +235,6 @@ feature "User managing material releases" do
|
||||
t "helpers.submit.material_release.create"
|
||||
end
|
||||
|
||||
def submit_release_button
|
||||
t 'shared.submit_release_long'
|
||||
end
|
||||
|
||||
def create_release_notice
|
||||
t "material_releases.create.notice"
|
||||
end
|
||||
|
||||
@@ -5,6 +5,13 @@ feature "User managing talent releases" do
|
||||
let(:project) { create(:project, members: current_user, account: current_user.primary_account) }
|
||||
|
||||
context "when signed out" do
|
||||
scenario "United States is default country" do
|
||||
contract_template = create(:contract_template, project: project)
|
||||
|
||||
visit new_account_project_contract_template_talent_release_path(project.account, project, contract_template)
|
||||
expect(country_field_value).to eq "US"
|
||||
end
|
||||
|
||||
scenario "creating a release for an adult", js: true do
|
||||
contract_template = create(:contract_template, project: project)
|
||||
|
||||
@@ -274,6 +281,10 @@ feature "User managing talent releases" do
|
||||
|
||||
private
|
||||
|
||||
def country_field_value
|
||||
find_field("talent_release[person_address_country]").value
|
||||
end
|
||||
|
||||
def photos_heading(photos_count = 1)
|
||||
t 'contracts.photos.heading', count: photos_count
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user