Upstream sync

This commit is contained in:
Senad Uka
2020-07-21 13:12:27 +00:00
parent 40f241b75f
commit 2590b6bdc9
13 changed files with 32 additions and 11257 deletions

View File

@@ -60,7 +60,7 @@ class BroadcastsController < ApplicationController
end
def broadcast_params
params.require(:broadcast).permit(:name, files: [])
params.require(:broadcast).permit(:name, :shoot_location_time_zone, files: [])
end
def set_project

View File

@@ -14,6 +14,6 @@ class BroadcastRecording < ApplicationRecord
end
def download_file_name
"#{broadcast_name}_Date_#{created_at.strftime("%Y-%m-%d")}_Time_#{created_at.strftime("%T")}".parameterize
"#{broadcast_name}_Date_#{created_at.in_time_zone(broadcast.shoot_location_time_zone).strftime("%Y-%m-%d")}_Time_#{created_at.in_time_zone(broadcast.shoot_location_time_zone).strftime("%T")}".parameterize
end
end

View File

@@ -111,7 +111,7 @@ class TalentRelease < ApplicationRecord
end
def uses_edl?
false
true
end
def second_guardian_present?

View File

@@ -3,6 +3,9 @@
<td>
<%= broadcast.name %>
</td>
<td>
<%= broadcast.shoot_location_time_zone %>
</td>
<td>
<%= broadcast.status.titleize %>
</td>

View File

@@ -2,6 +2,7 @@
<%= bootstrap_form_with model: model, local: true do |form| %>
<%= form.text_field :name %>
<%= form.time_zone_select(:shoot_location_time_zone, nil, label: "Time zone of shoot location") %>
<div class="row align-items-center text-center mt-4">
<%= link_to t("shared.cancel"), [project, :broadcasts], class: "col-3 text-reset" %>

View File

@@ -22,6 +22,7 @@
<tr>
<th></th>
<th><%= t(".table_headers.broadcast_name") %></th>
<th><%= t(".table_headers.broadcast_time_zone") %></th>
<th><%= t(".table_headers.broadcast_status") %></th>
<th><%= t(".table_headers.broadcast_created_at") %></th>
<th></th>
@@ -32,7 +33,7 @@
<%= render @broadcasts %>
<% else %>
<tr>
<td colspan="5" class="py-4 text-center text-muted"><%= t(".empty") %></td>
<td colspan="6" class="py-4 text-center text-muted"><%= t(".empty") %></td>
</tr>
<% end %>
</tbody>

View File

@@ -222,6 +222,7 @@ en:
broadcast_created_at: Created Date
broadcast_name: Name
broadcast_status: Status
broadcast_time_zone: Time Zone of Shoot Location
new:
heading:
Create Live Stream

View File

@@ -0,0 +1,5 @@
class AddShootLocationTimeZoneToBroadcasts < ActiveRecord::Migration[6.0]
def change
add_column :broadcasts, :shoot_location_time_zone, :string, default: "UTC"
end
end

View File

@@ -553,7 +553,8 @@ CREATE TABLE public.broadcasts (
stream_key character varying,
stream_playback_uid character varying,
token character varying,
streamer_status integer DEFAULT 0
streamer_status integer DEFAULT 0,
shoot_location_time_zone character varying DEFAULT 'UTC'::character varying
);
@@ -3952,6 +3953,7 @@ INSERT INTO "schema_migrations" (version) VALUES
('20200716083706'),
('20200716094927'),
('20200716103525'),
('20200716105723');
('20200716105723'),
('20200720051634');

11246
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -24,10 +24,12 @@ feature 'User managing broadcasts' do
by 'filling out the form' do
fill_in broadcast_name_field, with: 'My Broadcast'
select_time_zone("New Delhi")
end
click_button 'Create Live Stream'
expect(page).to have_content('A live stream has been created')
expect(page).to have_content('New Delhi')
click_on 'Manage'
expect(page).to have_link('Copy Stream URL', exact: true)
expect(page).to have_link('Copy Stream Key', exact: true)
@@ -220,6 +222,12 @@ feature 'User managing broadcasts' do
def broadcast_name_field
'broadcast[name]'
end
def select_time_zone(value)
if value.present?
select value, from: "broadcast[shoot_location_time_zone]"
end
end
def click_checkboxes
all('input[type="checkbox"]')[0].click

View File

@@ -292,7 +292,7 @@ feature "User performs video analysis" do
expect(page).to have_unreleased_appearance(notes: unreleased_appearance.notes)
end
scenario "confirming a talent release" do
scenario "confirming a talent release", js: true do
talent_release = create(:talent_release, project: project)
sign_in current_user
@@ -300,7 +300,7 @@ feature "User performs video analysis" do
expect(page).to have_unconfirmed_release(talent_release)
confirm_release(video, talent_release)
confirm_first_release_using_edl_modal(video, talent_release)
expect(page).to have_confirmed_release(talent_release)
expect(page).not_to have_unconfirmed_release(talent_release)
@@ -442,7 +442,7 @@ feature "User performs video analysis" do
scenario "confirming a talent release match", js: true do
video.analysis_success!
talent_release = create(:talent_release, project: project)
talent_release = create(:talent_release, project: project, person_name: "Jane Doe")
allow(BrayniacAI::FacialRecognition).to receive(:find).and_return(
BrayniacAI::FacialRecognition.new({
bucket_name: "",
@@ -469,7 +469,7 @@ feature "User performs video analysis" do
expect(page).not_to have_css(".fa-check-circle")
end
confirm_suggested_talent_match(video, talent_release)
confirm_suggested_match(video, talent_release)
within "#suggested_matches" do
expect(page).to have_css(".fa-check-circle")

View File

@@ -51,7 +51,7 @@ RSpec.describe TalentRelease do
end
describe "#uses_edl?" do
it { is_expected.not_to be_uses_edl }
it { is_expected.to be_uses_edl }
end
describe "#contract_file_name" do