Compare commits

..

4 Commits

Author SHA1 Message Date
bilal
6a0eb0dd06 add comment 2020-06-29 14:36:38 +02:00
bilal
6831c66fda add ActionMailbox::InboundEmail to total_storage spec 2020-06-29 14:11:07 +02:00
bilal
4bff4c9d5b update rails 2020-06-29 13:02:24 +02:00
Senad Uka
8951667e61 Upstrream sync 2020-06-26 18:45:11 +02:00
29 changed files with 231 additions and 525 deletions

View File

@@ -4,7 +4,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby "2.6.3"
# Bundle edge Rails instead: gem "rails", github: "rails/rails"
gem "rails", "~> 6.0.0"
gem "rails", "~> 6.0.3.1"
# Use postgresql as the database for Active Record
gem "pg", "~> 0.18"
# Use Puma as the app server

View File

@@ -44,71 +44,71 @@ GEM
remote: https://rubygems.org/
specs:
Ascii85 (1.0.3)
actioncable (6.0.0)
actionpack (= 6.0.0)
actioncable (6.0.3.2)
actionpack (= 6.0.3.2)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.0.0)
actionpack (= 6.0.0)
activejob (= 6.0.0)
activerecord (= 6.0.0)
activestorage (= 6.0.0)
activesupport (= 6.0.0)
actionmailbox (6.0.3.2)
actionpack (= 6.0.3.2)
activejob (= 6.0.3.2)
activerecord (= 6.0.3.2)
activestorage (= 6.0.3.2)
activesupport (= 6.0.3.2)
mail (>= 2.7.1)
actionmailer (6.0.0)
actionpack (= 6.0.0)
actionview (= 6.0.0)
activejob (= 6.0.0)
actionmailer (6.0.3.2)
actionpack (= 6.0.3.2)
actionview (= 6.0.3.2)
activejob (= 6.0.3.2)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.0.0)
actionview (= 6.0.0)
activesupport (= 6.0.0)
rack (~> 2.0)
actionpack (6.0.3.2)
actionview (= 6.0.3.2)
activesupport (= 6.0.3.2)
rack (~> 2.0, >= 2.0.8)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.0.0)
actionpack (= 6.0.0)
activerecord (= 6.0.0)
activestorage (= 6.0.0)
activesupport (= 6.0.0)
actiontext (6.0.3.2)
actionpack (= 6.0.3.2)
activerecord (= 6.0.3.2)
activestorage (= 6.0.3.2)
activesupport (= 6.0.3.2)
nokogiri (>= 1.8.5)
actionview (6.0.0)
activesupport (= 6.0.0)
actionview (6.0.3.2)
activesupport (= 6.0.3.2)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
active_storage_base64 (1.0.0)
rails (~> 6.0)
activejob (6.0.0)
activesupport (= 6.0.0)
activejob (6.0.3.2)
activesupport (= 6.0.3.2)
globalid (>= 0.3.6)
activemodel (6.0.0)
activesupport (= 6.0.0)
activemodel (6.0.3.2)
activesupport (= 6.0.3.2)
activemodel-serializers-xml (1.0.2)
activemodel (> 5.x)
activesupport (> 5.x)
builder (~> 3.1)
activerecord (6.0.0)
activemodel (= 6.0.0)
activesupport (= 6.0.0)
activerecord (6.0.3.2)
activemodel (= 6.0.3.2)
activesupport (= 6.0.3.2)
activeresource (5.1.0)
activemodel (>= 5.0, < 7)
activemodel-serializers-xml (~> 1.0)
activesupport (>= 5.0, < 7)
activestorage (6.0.0)
actionpack (= 6.0.0)
activejob (= 6.0.0)
activerecord (= 6.0.0)
activestorage (6.0.3.2)
actionpack (= 6.0.3.2)
activejob (= 6.0.3.2)
activerecord (= 6.0.3.2)
marcel (~> 0.3.1)
activesupport (6.0.0)
activesupport (6.0.3.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.1, >= 2.1.8)
zeitwerk (~> 2.2, >= 2.2.2)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
afm (0.2.2)
@@ -181,7 +181,7 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.1.5)
concurrent-ruby (1.1.6)
connection_pool (2.2.2)
countries (2.1.4)
i18n_data (~> 0.8.0)
@@ -230,7 +230,7 @@ GEM
hubspot-ruby (0.9.0)
activesupport (>= 3.0.0)
httparty (>= 0.10.0)
i18n (1.8.2)
i18n (1.8.3)
concurrent-ruby (~> 1.0)
i18n_data (0.8.0)
i18n_yaml_sorter (0.2.0)
@@ -270,22 +270,22 @@ GEM
ruby_dep (~> 1.2)
loaf (0.8.1)
rails (>= 3.2)
loofah (2.4.0)
loofah (2.6.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (0.3.3)
mimemagic (~> 0.3.2)
method_source (0.9.2)
method_source (1.0.0)
mime-types (3.3)
mime-types-data (~> 3.2015)
mime-types-data (3.2019.0904)
mimemagic (0.3.3)
mimemagic (0.3.5)
mini_magick (4.9.5)
mini_mime (1.0.2)
mini_portile2 (2.4.0)
minitest (5.14.0)
minitest (5.14.1)
monetize (1.9.2)
money (~> 6.12)
money (6.13.4)
@@ -298,8 +298,8 @@ GEM
msgpack (1.3.1)
multi_xml (0.6.0)
multipart-post (2.1.1)
nio4r (2.5.1)
nokogiri (1.10.7)
nio4r (2.5.2)
nokogiri (1.10.9)
mini_portile2 (~> 2.4.0)
oath (1.1.0)
bcrypt
@@ -337,20 +337,20 @@ GEM
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (6.0.0)
actioncable (= 6.0.0)
actionmailbox (= 6.0.0)
actionmailer (= 6.0.0)
actionpack (= 6.0.0)
actiontext (= 6.0.0)
actionview (= 6.0.0)
activejob (= 6.0.0)
activemodel (= 6.0.0)
activerecord (= 6.0.0)
activestorage (= 6.0.0)
activesupport (= 6.0.0)
rails (6.0.3.2)
actioncable (= 6.0.3.2)
actionmailbox (= 6.0.3.2)
actionmailer (= 6.0.3.2)
actionpack (= 6.0.3.2)
actiontext (= 6.0.3.2)
actionview (= 6.0.3.2)
activejob (= 6.0.3.2)
activemodel (= 6.0.3.2)
activerecord (= 6.0.3.2)
activestorage (= 6.0.3.2)
activesupport (= 6.0.3.2)
bundler (>= 1.3.0)
railties (= 6.0.0)
railties (= 6.0.3.2)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.4)
actionpack (>= 5.0.1.x)
@@ -363,9 +363,9 @@ GEM
nokogiri (>= 1.6)
rails-html-sanitizer (1.3.0)
loofah (~> 2.3)
railties (6.0.0)
actionpack (= 6.0.0)
activesupport (= 6.0.0)
railties (6.0.3.2)
actionpack (= 6.0.3.2)
activesupport (= 6.0.3.2)
method_source
rake (>= 0.8.7)
thor (>= 0.20.3, < 2.0)
@@ -469,7 +469,7 @@ GEM
turbolinks-source (5.2.0)
typhoeus (1.3.1)
ethon (>= 0.9.0)
tzinfo (1.2.6)
tzinfo (1.2.7)
thread_safe (~> 0.1)
uglifier (4.1.20)
execjs (>= 0.3.0, < 3)
@@ -494,9 +494,9 @@ GEM
activesupport (>= 4.2)
rack-proxy (>= 0.6.1)
railties (>= 4.2)
websocket-driver (0.7.1)
websocket-driver (0.7.2)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.4)
websocket-extensions (0.1.5)
will_paginate (3.2.1)
will_paginate-bootstrap4 (0.2.2)
will_paginate (~> 3.0, >= 3.0.0)
@@ -504,7 +504,7 @@ GEM
wkhtmltopdf-heroku (2.12.5.0)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.2.2)
zeitwerk (2.3.1)
PLATFORMS
ruby
@@ -561,7 +561,7 @@ DEPENDENCIES
rack!
rack-contrib (~> 2.0.1)
rack-cors
rails (~> 6.0.0)
rails (~> 6.0.3.1)
rails-controller-testing (~> 1.0.4)
rails-data-migrations (~> 1.2.0)
redcarpet (~> 3.4.0)

View File

@@ -45,59 +45,42 @@ class Public::TalentReleasesController < Public::BaseController
.permit(
person_params,
guardian_params,
second_guardian_params,
:signature_base64,
:locale,
:contract_template,
photos: []
photos: [],
)
end
def person_params
%i[
person_first_name
person_last_name
person_phone
person_email
person_address_street1
person_address_street2
person_address_city
person_address_state
person_address_zip
person_address_country
[
:person_first_name,
:person_last_name,
:person_phone,
:person_email,
:person_address_street1,
:person_address_street2,
:person_address_city,
:person_address_state,
:person_address_zip,
:person_address_country,
]
end
def guardian_params
%i[
guardian_first_name
guardian_last_name
guardian_phone
guardian_email
minor
guardian_address_street1
guardian_address_street2
guardian_address_city
guardian_address_state
guardian_address_zip
guardian_address_country
guardian_photo
]
end
def second_guardian_params
%i[
guardian_2_first_name
guardian_2_last_name
guardian_2_phone
guardian_2_email
guardian_2_address_street1
guardian_2_address_street2
guardian_2_address_city
guardian_2_address_state
guardian_2_address_zip
guardian_2_address_country
guardian_2_photo
[
:guardian_first_name,
:guardian_last_name,
:guardian_phone,
:guardian_email,
:minor,
:guardian_address_street1,
:guardian_address_street2,
:guardian_address_city,
:guardian_address_state,
:guardian_address_zip,
:guardian_address_country,
:guardian_photo,
]
end

View File

@@ -61,67 +61,15 @@ class TalentReleasesController < ApplicationController
end
end
def person_params
%i[
person_first_name
person_last_name
person_phone
person_email
person_address_street1
person_address_street2
person_address_city
person_address_state
person_address_zip
person_address_country
]
end
def guardian_params
%i[
guardian_first_name
guardian_last_name
guardian_phone
guardian_email
minor
guardian_address_street1
guardian_address_street2
guardian_address_city
guardian_address_state
guardian_address_zip
guardian_address_country
guardian_photo
]
end
def second_guardian_params
%i[
guardian_2_first_name
guardian_2_last_name
guardian_2_phone
guardian_2_email
guardian_2_address_street1
guardian_2_address_street2
guardian_2_address_city
guardian_2_address_state
guardian_2_address_zip
guardian_2_address_country
guardian_2_photo
]
end
def talent_release_params
params.require(:talent_release).permit(person_params,
guardian_params,
second_guardian_params,
:contract, { photos: [] },
:applicable_medium_id,
:applicable_medium_text,
:territory_id,
:territory_text,
:term_id,
:term_text,
:restriction_id,
:restriction_text)
params.require(:talent_release).permit(
:person_first_name, :person_last_name, :person_phone, :guardian_photo, :person_email,
:person_address_street1, :person_address_street2, :person_address_city, :person_address_state, :person_address_zip, :person_address_country,
:guardian_first_name, :guardian_last_name, :guardian_phone, :guardian_email, :minor,
:guardian_address_street1, :guardian_address_street2, :guardian_address_city, :guardian_address_state, :guardian_address_zip, :guardian_address_country,
:contract, { photos: [] },
:applicable_medium_id, :applicable_medium_text, :territory_id, :territory_text, :term_id, :term_text, :restriction_id, :restriction_text
)
end
def build_talent_release(attrs = {})

View File

@@ -11,9 +11,7 @@ class TalentRelease < ApplicationRecord
include Taggable
include PersonName
include GuardianPhotoable
include SecondGuardianPhotoable
include GuardianName
include SecondGuardianName
composed_of :person_address,
class_name: "Address",
@@ -37,17 +35,6 @@ class TalentRelease < ApplicationRecord
%w(guardian_address_country country)
]
composed_of :guardian_2_address,
class_name: "Address",
mapping: [
%w(guardian_2_address_street1 street1),
%w(guardian_2_address_street2 street2),
%w(guardian_2_address_city city),
%w(guardian_2_address_state state),
%w(guardian_2_address_zip zip),
%w(guardian_2_address_country country)
]
def self.face_photo_acceptable_content_types
["image/png", "image/jpeg"]
end
@@ -71,7 +58,6 @@ class TalentRelease < ApplicationRecord
# These validations apply to releases being signed by a minor
with_options if: :minor? do
validates :guardian_first_name, :guardian_last_name, presence: true
validates :guardian_email, :guardian_2_email, email: true, allow_blank: true
validates :guardian_phone, presence: true
end
@@ -98,10 +84,6 @@ class TalentRelease < ApplicationRecord
false
end
def second_guardian_present?
guardian_2_first_name.present?
end
def contract_file_name
"#{project.name.parameterize}_#{contract_template.release_type}_#{(signed_at || created_at).strftime("%Y.%m.%d")}_#{release_number}_#{filename_suffix.parameterize}"
end

View File

@@ -12,7 +12,7 @@ class AcquiredMediaReleasePolicy < ApplicationPolicy
end
def destroy?
true
user.manager? || user.account_manager?
end
def tag_multiple?

View File

@@ -16,7 +16,7 @@ class AppearanceReleasePolicy < ReleasePolicy
end
def destroy?
true
user.manager? || user.account_manager?
end
def tag_multiple?

View File

@@ -16,7 +16,7 @@ class LocationReleasePolicy < ReleasePolicy
end
def destroy?
true
user.manager? || user.account_manager?
end
def edit_photos?

View File

@@ -16,7 +16,7 @@ class MaterialReleasePolicy < ReleasePolicy
end
def destroy?
true
user.manager? || user.account_manager?
end
def edit_photos?

View File

@@ -12,7 +12,7 @@ class MedicalReleasePolicy < ReleasePolicy
end
def destroy?
true
user.manager? || user.account_manager?
end
def edit_photos?

View File

@@ -12,7 +12,7 @@ class MiscReleasePolicy < ReleasePolicy
end
def destroy?
true
user.manager? || user.account_manager?
end
def edit_photos?

View File

@@ -12,7 +12,7 @@ class MusicReleasePolicy < ReleasePolicy
end
def destroy?
true
user.manager? || user.account_manager?
end
def tag_multiple?

View File

@@ -12,7 +12,7 @@ class TalentReleasePolicy < ReleasePolicy
end
def destroy?
true
user.manager? || user.account_manager?
end
def edit_photos?

View File

@@ -31,6 +31,8 @@
<%= form.text_field :person_first_name, required: true, wrapper_class: "col-sm-6" %>
<%= form.text_field :person_last_name, required: true, wrapper_class: "col-sm-6" %>
<%= form.phone_field :person_phone, wrapper_class: "col-sm-6" %>
</div>
<div class="form-row">
<%= form.email_field :person_email, wrapper_class: "col-sm-6" %>
</div>
<%= render "shared/address_fields", form: form, subject: "person" %>
@@ -49,6 +51,8 @@
<%= form.text_field :guardian_first_name, required: @talent_release.minor?, wrapper_class: "col-sm-3" %>
<%= form.text_field :guardian_last_name, required: @talent_release.minor?, wrapper_class: "col-sm-3" %>
<%= form.phone_field :guardian_phone, wrapper_class: "col-sm-6" %>
</div>
<div class="form-row">
<%= form.text_field :guardian_email, wrapper_class: "col-sm-6" %>
</div>
<%= render "shared/address_fields", form: form, subject: "guardian" %>
@@ -83,48 +87,6 @@
</div>
<% end %>
<hr>
<%= card_field_set_tag t(".guardian_2_info.heading") do %>
<div class="form-row">
<%= form.text_field :guardian_2_first_name, wrapper_class: "col-sm-3" %>
<%= form.text_field :guardian_2_last_name, wrapper_class: "col-sm-3" %>
<%= form.phone_field :guardian_2_phone, wrapper_class: "col-sm-6" %>
<%= form.text_field :guardian_2_email, wrapper_class: "col-sm-6" %>
</div>
<%= render "shared/address_fields", form: form, subject: "guardian_2" %>
<% end %>
<hr>
<%= card_field_set_tag t(".guardian_2_photo.heading") do %>
<div class="alert alert-warning font-weight-bold"><%= t ".guardian_2_photo.instructions" %></div>
<div class="text-center">
<div class="d-inline-block mb-2" data-behavior="guardian-photo-preview" data-file-input="[data-ujs-target=guardian-2-photo-input]">
<div class="align-items-center d-flex photo-preview img-thumbnail justify-content-center">
<span><%= t ".guardian_2_photo.no_photo" %></span>
</div>
</div>
<div class="d-inline-block text-left">
<% if @talent_release.guardian_2_photo.attached? %>
<%= javascript_tag nonce: true do %>
App.PhotoPreview.set("[data-behavior=guardian-photo-preview]", "<%= url_for(@talent_release.guardian_2_photo.variant(auto_orient: true, resize: '200x200')) %>");
<% end %>
<% end %>
<div class="hidden-file-input">
<%= form.hidden_field :guardian_2_photo, value: form.object.guardian_2_photo.signed_id if @talent_release.guardian_2_photo.attached? %>
<%= form.file_field :guardian_2_photo, hide_label: true, data: { ujs_target: "guardian-2-photo-input" }, accept: @talent_release.class.face_photo_acceptable_content_types.join(","), direct_upload: true %>
</div>
<%= button_tag t(".guardian_2_photo.take_photo"), type: "button", class: "btn btn-lg btn-primary take-photo-button", data: { behavior: "trigger-click", target: "[data-ujs-target=guardian-2-photo-input]" } %>
</div>
<p class="p-2 font-weight-bold">
<%= fa_icon "arrow-up", text: t(".guardian_2_photo.camera_instructions_html") %><br>
<small class="text-muted"><%= t ".guardian_2_photo.warning" %></small>
</p>
</div>
<% end %>
<hr>
</div>
<hr>

View File

@@ -9,30 +9,22 @@
<%= form.text_field :person_first_name, required: true, wrapper_class: "col-sm-3" %>
<%= form.text_field :person_last_name, required: true, wrapper_class: "col-sm-3" %>
<%= form.phone_field :person_phone, wrapper_class: "col-sm-6" %>
</div>
<div class="form-row">
<%= form.email_field :person_email, wrapper_class: "col-sm-6" %>
</div>
<%= render "shared/address_fields", form: form, subject: "person" %>
<div class="<%= class_string("collapse" => !talent_release.minor?) %>" data-ujs-target="guardian-fields">
<%= card_field_set_tag t(".guardian_info.heading") do %>
<div class="form-row">
<%= form.text_field :guardian_first_name, required: talent_release.minor?, wrapper_class: "col-sm-3" %>
<%= form.text_field :guardian_last_name, required: talent_release.minor?, wrapper_class: "col-sm-3" %>
<%= form.phone_field :guardian_phone, wrapper_class: "col-sm-6" %>
<%= form.text_field :guardian_email, wrapper_class: "col-sm-6" %>
</div>
<%= render "shared/address_fields", form: form, subject: "guardian" %>
<% end %>
<%= card_field_set_tag t(".guardian_2_info.heading") do %>
<div class="form-row">
<%= form.text_field :guardian_2_first_name, required: talent_release.minor?, wrapper_class: "col-sm-3" %>
<%= form.text_field :guardian_2_last_name, required: talent_release.minor?, wrapper_class: "col-sm-3" %>
<%= form.phone_field :guardian_2_phone, wrapper_class: "col-sm-6" %>
<%= form.text_field :guardian_2_email, wrapper_class: "col-sm-6" %>
</div>
<%= render "shared/address_fields", form: form, subject: "guardian_2" %>
<% end %>
<div class="form-row">
<%= form.text_field :guardian_first_name, required: talent_release.minor?, wrapper_class: "col-sm-3" %>
<%= form.text_field :guardian_last_name, required: talent_release.minor?, wrapper_class: "col-sm-3" %>
<%= form.phone_field :guardian_phone, wrapper_class: "col-sm-6" %>
</div>
<div class="form-row">
<%= form.text_field :guardian_email, wrapper_class: "col-sm-6" %>
</div>
<%= render "shared/address_fields", form: form, subject: "guardian" %>
</div>
<% end %>
@@ -52,36 +44,20 @@
<br>
<div class="text-left">
<p><%= t(".photos.guardian_photo.heading") %></p>
<div id="guardian-photo-preview" class="d-inline-block mb-2" data-behavior="guardian-photo-preview" data-file-input="[data-ujs-target=guardian-photo-input]">
<div class="d-inline-block mb-2" data-behavior="guardian-photo-preview" data-file-input="[data-ujs-target=guardian-photo-input]">
<div class="align-items-center d-flex photo-preview img-thumbnail justify-content-center">
<span>No photo yet</span>
</div>
</div>
<% if talent_release.guardian_photo.attached? %>
<%= javascript_tag nonce: true do %>
App.PhotoPreview.set("#guardian-photo-preview", "<%= url_for(talent_release.guardian_photo.variant(auto_orient: true, resize: '200x200')) %>");
App.PhotoPreview.set("[data-behavior=guardian-photo-preview]", "<%= url_for(talent_release.guardian_photo.variant(auto_orient: true, resize: '200x200')) %>");
<% end %>
<% end %>
<div class="d-inline-block">
<%= form.hidden_field :guardian_photo, value: form.object.guardian_photo.signed_id if talent_release.guardian_photo.attached?%>
<%= form.file_field :guardian_photo, hide_label: true, data: { ujs_target: "guardian-photo-input" }, help: "PNG or JPG only", accept: talent_release.class.face_photo_acceptable_content_types.join(",") %>
</div>
<p><%= t(".photos.guardian_2_photo.heading") %></p>
<div id="guardian-2-photo-preview" class="d-inline-block mb-2" data-behavior="guardian-photo-preview" data-file-input="[data-ujs-target=guardian-2-photo-input]">
<div class="align-items-center d-flex photo-preview img-thumbnail justify-content-center">
<span>No photo yet</span>
</div>
</div>
<% if talent_release.guardian_2_photo.attached? %>
<%= javascript_tag nonce: true do %>
App.PhotoPreview.set("#guardian-2-photo-preview", "<%= url_for(talent_release.guardian_2_photo.variant(auto_orient: true, resize: '200x200')) %>");
<% end %>
<% end %>
<div class="d-inline-block">
<%= form.hidden_field :guardian_2_photo, value: form.object.guardian_2_photo.signed_id if talent_release.guardian_2_photo.attached?%>
<%= form.file_field :guardian_2_photo, hide_label: true, data: { ujs_target: "guardian-2-photo-input" }, help: "PNG or JPG only", accept: talent_release.class.face_photo_acceptable_content_types.join(",") %>
</div>
</div>
<hr>
</div>

View File

@@ -458,16 +458,6 @@ en:
project:
predefined_client_name: Client
talent_release:
guardian_2_address_city: Guardian 2 city
guardian_2_address_country: Guardian 2 country
guardian_2_address_state: Guardian 2 state
guardian_2_address_street1: Guardian 2 address
guardian_2_address_street2: Guardian 2 address (Line 2)
guardian_2_address_zip: Guardian 2 zip code
guardian_2_email: Guardian 2 email
guardian_2_first_name: Guardian 2 first name
guardian_2_last_name: Guardian 2 last name
guardian_2_phone: Guardian 2 phone
guardian_address_city: City
guardian_address_country: Guardian country
guardian_address_state: State
@@ -1021,16 +1011,6 @@ en:
notice: Your release has been signed. Thank you!
new:
cancel: Cancel
guardian_2_info:
heading: Second Guardian Information (if company requires)
guardian_2_photo:
camera_instructions_html: Click <em>Take Photo</em> to Turn ON Camera
heading: Second Guardian Photo
instructions: >
Lastly, it's time for second guardian to take a selfie photo! Please remove your hat and sunglasses (regular eyewear is ok), make sure that you are the only person in the photo, look straight into the camera, and say Cheese!
no_photo: No photo yet
take_photo: Take Photo
warning: If your photo appears sideways, it will be autocorrected when you submit your release.
guardian_clause:
heading: Guardian Clause
guardian_info:
@@ -1131,13 +1111,7 @@ en:
form:
contract_and_rights:
heading: 2 of 3 Contract & Exploitable Rights
guardian_2_info:
heading: Guardian Information (if company requires)
guardian_info:
heading: Guardian Information
photos:
guardian_2_photo:
heading: Second Guardian Photo
guardian_photo:
heading: Guardian Photo
heading: 3 of 3 Photos

View File

@@ -194,36 +194,6 @@ es:
name: Nómbre del proyecto de vídeo
producer_address: Dirección del productor
producer_name: Nómbre del productor
talen_release:
guardian_2_address_city: Guardian 2 city (ES)
guardian_2_address_country: Guardian 2 country (ES)
guardian_2_address_state: Guardian 2 state (ES)
guardian_2_address_street1: Guardian 2 address (ES)
guardian_2_address_street2: Guardian 2 address (Line 2) (ES)
guardian_2_address_zip: Guardian 2 zip code (ES)
guardian_2_email: Guardian 2 email (ES)
guardian_2_first_name: Guardian 2 first name (ES)
guardian_2_last_name: Guardian 2 last name (ES)
guardian_2_phone: Guardian 2 phone (ES)
guardian_address_city: City (ES)
guardian_address_country: Guardian country (ES)
guardian_address_state: State (ES)
guardian_address_street1: Guardian address (ES)
guardian_address_street2: Guardian address (Line 2) (ES)
guardian_address_zip: Zip code (ES)
guardian_email: Guardian email address (ES)
guardian_name: Guardian name (ES)
guardian_phone: Guardian phone number (ES)
minor: Is the person a minor? (ES)
person_address_city: City (ES)
person_address_country: Country (ES)
person_address_state: State (ES)
person_address_street1: Address (ES)
person_address_street2: Address (Line 2) (ES)
person_address_zip: Zip code (ES)
person_email: Email address (ES)
person_name: Name (ES)
person_phone: Phone number (ES)
placeholder:
appearance_release:
person_address: Calle, Número de apartamento, Ciudad, Estado, Código Postal
@@ -311,19 +281,8 @@ es:
warning: Si su foto aparece de lado, se corregirá automáticamente cuando actualizar la autorización
talent_releases:
new:
guardian_2_info:
heading: Second Guardian Information (if company requires) (ES)
guardian_2_photo:
camera_instructions_html: ""
heading: Second Guardian Photo (ES)
instructions: ""
no_photo: ""
take_photo: ""
warning: ""
guardian_clause:
heading: Guardian Clause (ES)
guardian_info:
heading: ""
guardian_photo:
camera_instructions_html: (ES) Click <em>Take Photo</em> to Turn ON Camera (ES)
heading: Guardian Photo (ES)
@@ -331,8 +290,6 @@ es:
no_photo: No hay foto todavía
take_photo: Take Photo (ES)
warning: (ES) If your photo appears sideways, it will be autocorrected when you submit your release. (ES)
photo:
heading: Photos (ES)
teams:
show:
choose_project: ¿Qué proyecto de la lista de abajo asistirá?
@@ -341,12 +298,6 @@ es:
print: Print (ES)
talent_releases:
form:
guardian_2_info:
heading: Guardian Information (if company requires) (ES)
guardian_info:
heading: Guardian Information (ES)
photos:
guardian_2_photo:
heading: Second Guardian Photo (ES)
guardian_photo:
heading: Guardian Photo (ES)

View File

@@ -1,14 +0,0 @@
class AddSecondGuardianFieldsToTalentReleases < ActiveRecord::Migration[6.0]
def change
add_column :talent_releases, :guardian_2_first_name, :string
add_column :talent_releases, :guardian_2_last_name, :string
add_column :talent_releases, :guardian_2_email, :string
add_column :talent_releases, :guardian_2_phone, :string
add_column :talent_releases, :guardian_2_address_street1, :string
add_column :talent_releases, :guardian_2_address_street2, :string
add_column :talent_releases, :guardian_2_address_city, :string
add_column :talent_releases, :guardian_2_address_state, :string
add_column :talent_releases, :guardian_2_address_zip, :string
add_column :talent_releases, :guardian_2_address_country, :string
end
end

View File

@@ -1503,17 +1503,7 @@ CREATE TABLE public.talent_releases (
person_first_name character varying,
person_last_name character varying,
guardian_first_name character varying,
guardian_last_name character varying,
guardian_2_first_name character varying,
guardian_2_last_name character varying,
guardian_2_email character varying,
guardian_2_phone character varying,
guardian_2_address_street1 character varying,
guardian_2_address_street2 character varying,
guardian_2_address_city character varying,
guardian_2_address_state character varying,
guardian_2_address_zip character varying,
guardian_2_address_country character varying
guardian_last_name character varying
);
@@ -3822,7 +3812,6 @@ INSERT INTO "schema_migrations" (version) VALUES
('20200619081446'),
('20200619085823'),
('20200619134853'),
('20200622180507'),
('20200625144713');
('20200622180507');

View File

@@ -62,47 +62,6 @@ feature "User managing talent releases" do
expect(page).to have_content("Your release was successfully submitted. Thank you.")
end
scenario "creating a release for a minor with two guardians", js: true do
contract_template = create(:contract_template, project: project)
visit new_account_project_contract_template_talent_release_path(project.account, project, contract_template)
expect(page).not_to have_content guardian_information_heading.upcase
expect(page).not_to have_content guardian_2_information_heading.upcase
expect(page).not_to have_content guardian_photo_heading.upcase
expect(page).not_to have_content guardian_2_photo_heading.upcase
page.check person_is_minor_checkbox
expect(page).to have_content guardian_information_heading.upcase
expect(page).to have_content guardian_2_information_heading.upcase
expect(page).to have_content guardian_photo_heading.upcase
expect(page).to have_content guardian_2_photo_heading.upcase
fill_in person_first_name_field, with: "Jane"
fill_in person_last_name_field, with: "Doe"
fill_in person_address_field, with: "123 Test Lane, New York, NY 10000"
fill_in person_phone_field, with: "555-555-5555"
fill_in person_email_field, with: "jane.doe@test.com"
fill_in guardian_first_name_field, with: "Guardian"
fill_in guardian_last_name_field, with: "Name"
fill_in guardian_phone_field, with: "001101"
fill_in guardian_2_first_name_field, with: "Second"
fill_in guardian_2_last_name_field, with: "Guardian"
drop_file Rails.root.join(file_fixture("person_photo.png")), type: :dropzone
attach_file guardian_photo_field, file_fixture("hemsworth.jpeg"), visible: :all
attach_file guardian_2_photo_field, file_fixture("person_photo.png"), visible: :all
draw_signature file_fixture("signature.png"), "talent_release_signature_base64"
click_button submit_button
expect(page).to have_content success_submit_message
expect(TalentRelease.last.guardian_2_photo.attached?).to eq true
expect(TalentRelease.last.guardian_2_name).to eq "Second Guardian"
end
end
context "when signed in" do
@@ -166,43 +125,6 @@ feature "User managing talent releases" do
expect(page).to have_photo("person_photo.png")
end
scenario "creating a release for minor with two guardians", js: true do
visit new_project_talent_release_path(project)
expect(page).not_to have_content guardian_photo_heading
expect(page).not_to have_content guardian_2_photo_heading
page.check person_is_minor_checkbox
expect(page).to have_content guardian_photo_heading
expect(page).to have_content guardian_2_photo_heading
fill_in person_first_name_field, with: "John"
fill_in person_last_name_field, with: "Doe"
fill_in guardian_first_name_field, with: "Guardian"
fill_in guardian_last_name_field, with: "Name"
fill_in guardian_phone_field, with: "01010"
fill_in guardian_2_first_name_field, with: "Second"
fill_in guardian_2_last_name_field, with: "Guardian"
fill_in_exploitable_rights
attach_file contract_field, Rails.root.join(file_fixture("contract.pdf")), visible: false
drop_file Rails.root.join(file_fixture("person_photo.png")), type: :dropzone
attach_file guardian_photo_field, Rails.root.join(file_fixture("hemsworth.jpeg")), visible: false
attach_file guardian_2_photo_field, Rails.root.join(file_fixture("pratt.jpg")), visible: false
click_button create_release_button
expect(page).to have_content create_release_notice
expect(page).to have_photo("person_photo.png")
expect(TalentRelease.last.guardian_2_photo.attached?).to eq true
expect(TalentRelease.last.guardian_2_name).to eq "Second Guardian"
end
scenario "updating an existing release" do
talent_release = create(:talent_release, project: project)
@@ -379,14 +301,6 @@ feature "User managing talent releases" do
"Guardian last name"
end
def guardian_2_first_name_field
"talent_release[guardian_2_first_name]"
end
def guardian_2_last_name_field
"talent_release[guardian_2_last_name]"
end
def guardian_phone_field
"Guardian phone"
end
@@ -395,10 +309,6 @@ feature "User managing talent releases" do
"talent_release[guardian_photo]"
end
def guardian_2_photo_field
"talent_release[guardian_2_photo]"
end
def have_photo_button
have_selector(".take-photo-button")
end
@@ -477,32 +387,4 @@ feature "User managing talent releases" do
select "Other", from: "Restriction"
fill_in "Describe other restrictions", with: "Test"
end
def guardian_information_heading
t 'public.talent_releases.new.guardian_info.heading'
end
def guardian_2_information_heading
t 'public.talent_releases.new.guardian_2_info.heading'
end
def guardian_photo_heading
t 'public.talent_releases.new.guardian_photo.heading'
end
def guardian_2_photo_heading
t 'public.talent_releases.new.guardian_2_photo.heading'
end
def submit_button
t 'shared.submit_release_long'
end
def success_submit_message
"Your release was successfully submitted. Thank you."
end
def contract_field
"talent_release[contract]"
end
end

View File

@@ -133,7 +133,8 @@ RSpec.describe Account do
ZoomMeeting,
MedicalRelease,
MiscRelease,
MatchingRequest
MatchingRequest,
ActionMailbox::InboundEmail # This is Rails model, we are not using it and it is NOT added to the Account#storage_total calculation
]
Rails.application.eager_load!
ActiveRecord::Base.descendants.each do |model|

View File

@@ -1,7 +1,8 @@
require "rails_helper"
describe AcquiredMediaReleasePolicy do
let(:user_context) { build(:user_context) }
let(:user) { create(:user, :manager) }
let(:user_context) { build(:user_context, user: user, account: user.primary_account) }
subject { described_class }
@@ -24,6 +25,14 @@ describe AcquiredMediaReleasePolicy do
end
permissions :destroy? do
it { is_expected.to permit(:destroy) }
it { is_expected.to permit(user_context, :destroy) }
end
context "for an associate" do
let(:user) { create(:user, :associate) }
permissions :destroy? do
it { is_expected.not_to permit(user_context, :destroy) }
end
end
end

View File

@@ -1,7 +1,8 @@
require "rails_helper"
describe AppearanceReleasePolicy do
let(:user_context) { build(:user_context) }
let(:user) { create(:user, :manager) }
let(:user_context) { build(:user_context, user: user, account: user.primary_account) }
subject { described_class }
@@ -24,6 +25,14 @@ describe AppearanceReleasePolicy do
end
permissions :destroy? do
it { is_expected.to permit(:destroy) }
it { is_expected.to permit(user_context, :destroy) }
end
context "for an associate" do
let(:user) { create(:user, :associate) }
permissions :destroy? do
it { is_expected.not_to permit(user_context, :destroy) }
end
end
end

View File

@@ -1,7 +1,8 @@
require "rails_helper"
describe LocationReleasePolicy do
let(:user_context) { build(:user_context) }
let(:user) { create(:user, :manager) }
let(:user_context) { build(:user_context, user: user, account: user.primary_account) }
subject { described_class }
@@ -23,10 +24,6 @@ describe LocationReleasePolicy do
end
end
permissions :destroy? do
it { is_expected.to permit(:destroy) }
end
permissions :edit_photos? do
it { is_expected.to permit(:edit_photos) }
end
@@ -34,4 +31,16 @@ describe LocationReleasePolicy do
permissions :update_photos? do
it { is_expected.to permit(:update_photos) }
end
permissions :destroy? do
it { is_expected.to permit(user_context, :destroy) }
end
context "for an associate" do
let(:user) { create(:user, :associate) }
permissions :destroy? do
it { is_expected.not_to permit(user_context, :destroy) }
end
end
end

View File

@@ -1,7 +1,8 @@
require "rails_helper"
describe MaterialReleasePolicy do
let(:user_context) { build(:user_context) }
let(:user) { create(:user, :manager) }
let(:user_context) { build(:user_context, user: user, account: user.primary_account) }
subject { described_class }
@@ -23,10 +24,6 @@ describe MaterialReleasePolicy do
end
end
permissions :destroy? do
it { is_expected.to permit(:destroy) }
end
permissions :edit_photos? do
it { is_expected.to permit(:edit_photos) }
end
@@ -34,4 +31,16 @@ describe MaterialReleasePolicy do
permissions :update_photos? do
it { is_expected.to permit(:update_photos) }
end
permissions :destroy? do
it { is_expected.to permit(user_context, :destroy) }
end
context "for an associate" do
let(:user) { create(:user, :associate) }
permissions :destroy? do
it { is_expected.not_to permit(user_context, :destroy) }
end
end
end

View File

@@ -1,7 +1,8 @@
require "rails_helper"
describe MedicalReleasePolicy do
let(:user_context) { build(:user_context) }
let(:user) { create(:user, :manager) }
let(:user_context) { build(:user_context, user: user, account: user.primary_account) }
subject { described_class }
@@ -23,10 +24,6 @@ describe MedicalReleasePolicy do
end
end
permissions :destroy? do
it { is_expected.to permit(:destroy) }
end
permissions :edit_photos? do
it { is_expected.to permit(:edit_photos) }
end
@@ -34,4 +31,16 @@ describe MedicalReleasePolicy do
permissions :update_photos? do
it { is_expected.to permit(:update_photos) }
end
permissions :destroy? do
it { is_expected.to permit(user_context, :destroy) }
end
context "for an associate" do
let(:user) { create(:user, :associate) }
permissions :destroy? do
it { is_expected.not_to permit(user_context, :destroy) }
end
end
end

View File

@@ -1,7 +1,8 @@
require "rails_helper"
describe MiscReleasePolicy do
let(:user_context) { build(:user_context) }
let(:user) { create(:user, :manager) }
let(:user_context) { build(:user_context, user: user, account: user.primary_account) }
subject { described_class }
@@ -19,10 +20,6 @@ describe MiscReleasePolicy do
end
end
permissions :destroy? do
it { is_expected.to permit(:destroy) }
end
permissions :edit_photos? do
it { is_expected.to permit(:edit_photos) }
end
@@ -30,4 +27,16 @@ describe MiscReleasePolicy do
permissions :update_photos? do
it { is_expected.to permit(:update_photos) }
end
permissions :destroy? do
it { is_expected.to permit(user_context, :destroy) }
end
context "for an associate" do
let(:user) { create(:user, :associate) }
permissions :destroy? do
it { is_expected.not_to permit(user_context, :destroy) }
end
end
end

View File

@@ -1,7 +1,8 @@
require "rails_helper"
RSpec.describe MusicReleasePolicy do
let(:user_context) { build(:user_context) }
let(:user) { create(:user, :manager) }
let(:user_context) { build(:user_context, user: user, account: user.primary_account) }
subject { described_class }
@@ -18,6 +19,14 @@ RSpec.describe MusicReleasePolicy do
end
permissions :destroy? do
it { is_expected.to permit(:destroy) }
it { is_expected.to permit(user_context, :destroy) }
end
context "for an associate" do
let(:user) { create(:user, :associate) }
permissions :destroy? do
it { is_expected.not_to permit(user_context, :destroy) }
end
end
end

View File

@@ -1,7 +1,8 @@
require "rails_helper"
describe TalentReleasePolicy do
let(:user_context) { build(:user_context) }
let(:user) { create(:user, :manager) }
let(:user_context) { build(:user_context, user: user, account: user.primary_account) }
subject { described_class }
@@ -23,10 +24,6 @@ describe TalentReleasePolicy do
end
end
permissions :destroy? do
it { is_expected.to permit(:destroy) }
end
permissions :edit_photos? do
it { is_expected.to permit(:edit_photos) }
end
@@ -34,4 +31,16 @@ describe TalentReleasePolicy do
permissions :update_photos? do
it { is_expected.to permit(:update_photos) }
end
permissions :destroy? do
it { is_expected.to permit(user_context, :destroy) }
end
context "for an associate" do
let(:user) { create(:user, :associate) }
permissions :destroy? do
it { is_expected.not_to permit(user_context, :destroy) }
end
end
end