Compare commits
2 Commits
add-notice
...
fix-bug-wi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a47c69f36d | ||
|
|
51d56dc9ac |
@@ -17,7 +17,6 @@ $(document).on "turbolinks:load", ->
|
|||||||
when "video_status_update" then @showVideoStatusUpdate(data.content)
|
when "video_status_update" then @showVideoStatusUpdate(data.content)
|
||||||
when "download_status_update" then @showDownloadStatusUpdate(data.content)
|
when "download_status_update" then @showDownloadStatusUpdate(data.content)
|
||||||
when "conference_recording_ready" then @showDownloadStatusUpdate(data.content)
|
when "conference_recording_ready" then @showDownloadStatusUpdate(data.content)
|
||||||
when "appearance_matching_flash_message" then @showMatchingStatusUpdate(data.content)
|
|
||||||
|
|
||||||
showVideoStatusUpdate: (content) ->
|
showVideoStatusUpdate: (content) ->
|
||||||
$("[data-ujs-target='video-analysis-msg']").replaceWith content
|
$("[data-ujs-target='video-analysis-msg']").replaceWith content
|
||||||
@@ -25,7 +24,3 @@ $(document).on "turbolinks:load", ->
|
|||||||
showDownloadStatusUpdate: (content) ->
|
showDownloadStatusUpdate: (content) ->
|
||||||
$(".flash-message").html content
|
$(".flash-message").html content
|
||||||
$(".toast").toast('show')
|
$(".toast").toast('show')
|
||||||
|
|
||||||
showMatchingStatusUpdate: (content) ->
|
|
||||||
$(".flash-message").html content
|
|
||||||
$(".toast").toast('show')
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
$(document).on("click", "[data-behavior=play_recording]", function() {
|
$(document).on("click", "[data-behavior=play_recording]", function() {
|
||||||
|
$("#raw-video-embed").remove();
|
||||||
|
|
||||||
clearPlayingHighlight();
|
clearPlayingHighlight();
|
||||||
$(this).parent().parent().addClass('playing-highlight');
|
$(this).parent().parent().addClass('playing-highlight');
|
||||||
|
|
||||||
@@ -18,7 +20,6 @@ $(document).on("click", "[data-behavior=play_recording]", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$(document).on("click", "[data-behavior=play_stream]", function() {
|
$(document).on("click", "[data-behavior=play_stream]", function() {
|
||||||
// clearPlayingHighlight();
|
|
||||||
$("#broadcast_video").data('videoType', 'stream');
|
$("#broadcast_video").data('videoType', 'stream');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -33,15 +33,4 @@ class ProjectsChannel < ApplicationCable::Channel
|
|||||||
content = ApplicationController.render partial: 'application/flash', locals: { flash: flash }
|
content = ApplicationController.render partial: 'application/flash', locals: { flash: flash }
|
||||||
broadcast_to project, event: :conference_recording_ready, content: content
|
broadcast_to project, event: :conference_recording_ready, content: content
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.appearance_matching_flash_message(project, message, flash_type = :notice)
|
|
||||||
if (flash_type == :notice)
|
|
||||||
flash = OpenStruct.new notice: message
|
|
||||||
else
|
|
||||||
flash = OpenStruct.new alert: message
|
|
||||||
end
|
|
||||||
content = ApplicationController.render partial: 'application/flash', locals: { flash: flash }
|
|
||||||
|
|
||||||
broadcast_to project, event: :appearance_matching_flash_message, content: content
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -6,10 +6,7 @@ class MatchAppearanceReleasesJob < ApplicationJob
|
|||||||
def perform(project, attachments)
|
def perform(project, attachments)
|
||||||
filtered_attachments_object = filter_attachments attachments
|
filtered_attachments_object = filter_attachments attachments
|
||||||
|
|
||||||
if filtered_attachments_object[:keys].blank?
|
return if filtered_attachments_object[:keys].blank?
|
||||||
ProjectsChannel.appearance_matching_flash_message project, failed_message, :alert
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
matching_request = MatchingRequest.create project: project, attachments: filtered_attachments_object[:signed_ids]
|
matching_request = MatchingRequest.create project: project, attachments: filtered_attachments_object[:signed_ids]
|
||||||
|
|
||||||
@@ -20,8 +17,6 @@ class MatchAppearanceReleasesJob < ApplicationJob
|
|||||||
handle_matches matches, project, key_signed_id_hash
|
handle_matches matches, project, key_signed_id_hash
|
||||||
handle_unmatches matches, project, key_signed_id_hash
|
handle_unmatches matches, project, key_signed_id_hash
|
||||||
matching_request.destroy
|
matching_request.destroy
|
||||||
|
|
||||||
ProjectsChannel.appearance_matching_flash_message project, success_message
|
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
@@ -118,12 +113,4 @@ class MatchAppearanceReleasesJob < ApplicationJob
|
|||||||
signed_ids: filtered_attachments_signed_ids
|
signed_ids: filtered_attachments_signed_ids
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
def success_message
|
|
||||||
I18n.t 'appearance_releases.create.matching_completed'
|
|
||||||
end
|
|
||||||
|
|
||||||
def failed_message
|
|
||||||
I18n.t 'appearance_releases.create.matching_failed'
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,14 +3,14 @@
|
|||||||
<!-- Position toasts -->
|
<!-- Position toasts -->
|
||||||
<div class="position-absolute" style="top: 0.5rem; right: 0.5rem;">
|
<div class="position-absolute" style="top: 0.5rem; right: 0.5rem;">
|
||||||
<% if flash.alert.present? %>
|
<% if flash.alert.present? %>
|
||||||
<div id="flash-message" class="toast fade show bg-black text-white toast-min-w-border-radius" data-autohide="false">
|
<div class="toast fade show bg-black text-white toast-min-w-border-radius" data-autohide="false">
|
||||||
<div class="toast-body toast-border-left-danger">
|
<div class="toast-body toast-border-left-danger">
|
||||||
<button type="button" class="close text-white ml-2" data-dismiss="toast">×</button>
|
<button type="button" class="close text-white ml-2" data-dismiss="toast">×</button>
|
||||||
<p><%= flash.alert.html_safe %></p>
|
<p><%= flash.alert.html_safe %></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% elsif flash.notice.present? %>
|
<% elsif flash.notice.present? %>
|
||||||
<div id="flash-message" class="toast fade show bg-black text-white toast-min-w-border-radius" data-autohide="false">
|
<div class="toast fade show bg-black text-white toast-min-w-border-radius" data-autohide="false">
|
||||||
<div class="toast-body toast-border-left-primary">
|
<div class="toast-body toast-border-left-primary">
|
||||||
<button type="button" class="close text-white ml-2" data-dismiss="toast">×</button>
|
<button type="button" class="close text-white ml-2" data-dismiss="toast">×</button>
|
||||||
<p><%= flash.notice.html_safe %></p>
|
<p><%= flash.notice.html_safe %></p>
|
||||||
@@ -19,3 +19,4 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<% if broadcast.director_mode_video_embed.present? && params[:non_director_mode].nil? %>
|
<% if broadcast.director_mode_video_embed.present? && params[:non_director_mode].nil? %>
|
||||||
<div id="director_broadcast_video" class="embed-responsive-item" data-video-type="stream">
|
<div id="director_broadcast_video" class="embed-responsive-item" data-video-type="stream">
|
||||||
<%= raw broadcast.director_mode_video_embed %>
|
<div id="broadcast_video" class="embed-responsive-item" data-video-type="strean"></div>
|
||||||
|
<div id="raw-video-embed"><%= raw broadcast.director_mode_video_embed %></div>
|
||||||
</div>
|
</div>
|
||||||
<% elsif broadcast.streamer_recording? && broadcast.active? %>
|
<% elsif broadcast.streamer_recording? && broadcast.active? %>
|
||||||
<div id="broadcast_video" class="embed-responsive-item" data-video-type="stream"></div>
|
<div id="broadcast_video" class="embed-responsive-item" data-video-type="stream"></div>
|
||||||
|
|||||||
@@ -151,8 +151,6 @@ en:
|
|||||||
failed_import: Failed to create appearance release for files listed below
|
failed_import: Failed to create appearance release for files listed below
|
||||||
matching_started: Matching started
|
matching_started: Matching started
|
||||||
no_attachments: Failed to import - no attachments
|
no_attachments: Failed to import - no attachments
|
||||||
matching_completed: Matching completed. Reload page to see new releases
|
|
||||||
matching_failed: Matching failed
|
|
||||||
edit:
|
edit:
|
||||||
heading: Edit Appearance Release
|
heading: Edit Appearance Release
|
||||||
form:
|
form:
|
||||||
|
|||||||
@@ -58,8 +58,6 @@ es:
|
|||||||
failed_import: Failed to create appearance release for files listed below (ES)
|
failed_import: Failed to create appearance release for files listed below (ES)
|
||||||
matching_started: Matching started (ES)
|
matching_started: Matching started (ES)
|
||||||
no_attachments: Failed to import - no attachments (ES)
|
no_attachments: Failed to import - no attachments (ES)
|
||||||
matching_completed: Matching completed (ES)
|
|
||||||
matching_failed: Matching failed (ES)
|
|
||||||
form:
|
form:
|
||||||
guardian_2_info:
|
guardian_2_info:
|
||||||
heading: Second Guardian Information (if company requires) (ES)
|
heading: Second Guardian Information (if company requires) (ES)
|
||||||
|
|||||||
@@ -204,12 +204,31 @@ feature 'User managing broadcasts' do
|
|||||||
|
|
||||||
visit project_broadcast_path(project, broadcast)
|
visit project_broadcast_path(project, broadcast)
|
||||||
|
|
||||||
expect(page).not_to have_selector('#broadcast_video')
|
expect(page).to have_selector('#raw-video-embed')
|
||||||
expect(page).to have_selector('#director_broadcast_video')
|
expect(page).to have_selector('#director_broadcast_video')
|
||||||
|
|
||||||
expect(page).to have_selector('#director_mode_switch')
|
expect(page).to have_selector('#director_mode_switch')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scenario 'playing recordings is possible in director mode', js: true do
|
||||||
|
broadcast = create(:broadcast, :with_stream, :with_files, project: project, director_mode_video_embed: 'director_mode')
|
||||||
|
create(:broadcast_recording, broadcast: broadcast, asset_uid: "asset_uid_1")
|
||||||
|
create(:broadcast_recording, broadcast: broadcast, asset_uid: "asset_uid_2")
|
||||||
|
|
||||||
|
visit project_broadcast_path(project, broadcast)
|
||||||
|
|
||||||
|
expect(page).to have_selector('#raw-video-embed')
|
||||||
|
expect(page).to have_selector('#broadcast_video')
|
||||||
|
|
||||||
|
broadcast_video_div = find('#broadcast_video')
|
||||||
|
expect(broadcast_video_div.all('*').length).to eq 0
|
||||||
|
|
||||||
|
first("[data-behavior='play_recording']").click
|
||||||
|
|
||||||
|
expect(page).not_to have_selector('#raw-video-embed')
|
||||||
|
expect(broadcast_video_div.all('*').length).to be > 2
|
||||||
|
end
|
||||||
|
|
||||||
context 'When the user is associate' do
|
context 'When the user is associate' do
|
||||||
let(:current_user) { create(:user, :associate) }
|
let(:current_user) { create(:user, :associate) }
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ describe MatchAppearanceReleasesJob do
|
|||||||
it "returns if no attachment is sent" do
|
it "returns if no attachment is sent" do
|
||||||
expect(MatchingRequest).not_to receive(:create)
|
expect(MatchingRequest).not_to receive(:create)
|
||||||
attachments = []
|
attachments = []
|
||||||
expect(ProjectsChannel).to receive(:appearance_matching_flash_message).with(kind_of(Project), failure_flash_message, :alert)
|
|
||||||
MatchAppearanceReleasesJob.perform_now project, attachments
|
MatchAppearanceReleasesJob.perform_now project, attachments
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -21,7 +20,6 @@ describe MatchAppearanceReleasesJob do
|
|||||||
expect(MatchingRequest).not_to receive(:create)
|
expect(MatchingRequest).not_to receive(:create)
|
||||||
dummy_video = create(:video)
|
dummy_video = create(:video)
|
||||||
attachments = [dummy_video.file.blob.signed_id]
|
attachments = [dummy_video.file.blob.signed_id]
|
||||||
expect(ProjectsChannel).to receive(:appearance_matching_flash_message).with(kind_of(Project), failure_flash_message, :alert)
|
|
||||||
MatchAppearanceReleasesJob.perform_now project, attachments
|
MatchAppearanceReleasesJob.perform_now project, attachments
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -46,8 +44,6 @@ describe MatchAppearanceReleasesJob do
|
|||||||
expect(BrayniacAI::QrMatching).to receive(:create!).with(qr_matching_payload).and_return(qr_matching_mock_response)
|
expect(BrayniacAI::QrMatching).to receive(:create!).with(qr_matching_payload).and_return(qr_matching_mock_response)
|
||||||
expect(dummy_matching_request).to receive(:destroy)
|
expect(dummy_matching_request).to receive(:destroy)
|
||||||
|
|
||||||
expect(ProjectsChannel).to receive(:appearance_matching_flash_message).with(kind_of(Project), success_flash_message)
|
|
||||||
|
|
||||||
expect {
|
expect {
|
||||||
MatchAppearanceReleasesJob.perform_now project, signed_ids
|
MatchAppearanceReleasesJob.perform_now project, signed_ids
|
||||||
}.to change{AppearanceRelease.count}.by(1)
|
}.to change{AppearanceRelease.count}.by(1)
|
||||||
@@ -77,8 +73,6 @@ describe MatchAppearanceReleasesJob do
|
|||||||
expect(BrayniacAI::QrMatching).to receive(:create!).with(qr_matching_payload).and_return(qr_matching_mock_response)
|
expect(BrayniacAI::QrMatching).to receive(:create!).with(qr_matching_payload).and_return(qr_matching_mock_response)
|
||||||
expect(dummy_matching_request).to receive(:destroy)
|
expect(dummy_matching_request).to receive(:destroy)
|
||||||
|
|
||||||
expect(ProjectsChannel).to receive(:appearance_matching_flash_message).with(kind_of(Project), success_flash_message)
|
|
||||||
|
|
||||||
expect {
|
expect {
|
||||||
MatchAppearanceReleasesJob.perform_now project, signed_ids
|
MatchAppearanceReleasesJob.perform_now project, signed_ids
|
||||||
}.to change{AppearanceRelease.count}.by(1)
|
}.to change{AppearanceRelease.count}.by(1)
|
||||||
@@ -115,8 +109,6 @@ describe MatchAppearanceReleasesJob do
|
|||||||
expect(BrayniacAI::QrMatching).to receive(:create!).with(qr_matching_payload).and_return(qr_matching_mock_response)
|
expect(BrayniacAI::QrMatching).to receive(:create!).with(qr_matching_payload).and_return(qr_matching_mock_response)
|
||||||
expect(dummy_matching_request).to receive(:destroy)
|
expect(dummy_matching_request).to receive(:destroy)
|
||||||
|
|
||||||
expect(ProjectsChannel).to receive(:appearance_matching_flash_message).with(kind_of(Project), success_flash_message)
|
|
||||||
|
|
||||||
MatchAppearanceReleasesJob.perform_now project, signed_ids
|
MatchAppearanceReleasesJob.perform_now project, signed_ids
|
||||||
|
|
||||||
expect(AppearanceRelease.last.identifier).to eq mock_match.identifier
|
expect(AppearanceRelease.last.identifier).to eq mock_match.identifier
|
||||||
@@ -152,8 +144,6 @@ describe MatchAppearanceReleasesJob do
|
|||||||
expect(BrayniacAI::QrMatching).to receive(:create!).with(qr_matching_payload).and_return(qr_matching_mock_response)
|
expect(BrayniacAI::QrMatching).to receive(:create!).with(qr_matching_payload).and_return(qr_matching_mock_response)
|
||||||
expect(dummy_matching_request).to receive(:destroy)
|
expect(dummy_matching_request).to receive(:destroy)
|
||||||
|
|
||||||
expect(ProjectsChannel).to receive(:appearance_matching_flash_message).with(kind_of(Project), success_flash_message)
|
|
||||||
|
|
||||||
expect {
|
expect {
|
||||||
MatchAppearanceReleasesJob.perform_now project, signed_ids
|
MatchAppearanceReleasesJob.perform_now project, signed_ids
|
||||||
}.to change{AppearanceRelease.count}.by(2)
|
}.to change{AppearanceRelease.count}.by(2)
|
||||||
@@ -197,8 +187,6 @@ describe MatchAppearanceReleasesJob do
|
|||||||
expect(BrayniacAI::QrMatching).to receive(:create!).with(qr_matching_payload).and_return(qr_matching_mock_response)
|
expect(BrayniacAI::QrMatching).to receive(:create!).with(qr_matching_payload).and_return(qr_matching_mock_response)
|
||||||
expect(dummy_matching_request).to receive(:destroy)
|
expect(dummy_matching_request).to receive(:destroy)
|
||||||
|
|
||||||
expect(ProjectsChannel).to receive(:appearance_matching_flash_message).with(kind_of(Project), success_flash_message)
|
|
||||||
|
|
||||||
MatchAppearanceReleasesJob.perform_now project, signed_ids
|
MatchAppearanceReleasesJob.perform_now project, signed_ids
|
||||||
|
|
||||||
expect(AppearanceRelease.last.identifier).to eq mock_match.identifier
|
expect(AppearanceRelease.last.identifier).to eq mock_match.identifier
|
||||||
@@ -240,8 +228,6 @@ describe MatchAppearanceReleasesJob do
|
|||||||
expect(BrayniacAI::QrMatching).to receive(:create!).with(qr_matching_payload).and_return(qr_matching_mock_response)
|
expect(BrayniacAI::QrMatching).to receive(:create!).with(qr_matching_payload).and_return(qr_matching_mock_response)
|
||||||
expect(dummy_matching_request).to receive(:destroy)
|
expect(dummy_matching_request).to receive(:destroy)
|
||||||
|
|
||||||
expect(ProjectsChannel).to receive(:appearance_matching_flash_message).with(kind_of(Project), success_flash_message)
|
|
||||||
|
|
||||||
MatchAppearanceReleasesJob.perform_now project, signed_ids
|
MatchAppearanceReleasesJob.perform_now project, signed_ids
|
||||||
|
|
||||||
expect(AppearanceRelease.last.identifier).to eq mock_match.identifier
|
expect(AppearanceRelease.last.identifier).to eq mock_match.identifier
|
||||||
@@ -289,8 +275,6 @@ describe MatchAppearanceReleasesJob do
|
|||||||
expect(BrayniacAI::QrMatching).to receive(:create!).with(qr_matching_payload).and_return(qr_matching_mock_response)
|
expect(BrayniacAI::QrMatching).to receive(:create!).with(qr_matching_payload).and_return(qr_matching_mock_response)
|
||||||
expect(dummy_matching_request).to receive(:destroy)
|
expect(dummy_matching_request).to receive(:destroy)
|
||||||
|
|
||||||
expect(ProjectsChannel).to receive(:appearance_matching_flash_message).with(kind_of(Project), success_flash_message)
|
|
||||||
|
|
||||||
MatchAppearanceReleasesJob.perform_now project, signed_ids
|
MatchAppearanceReleasesJob.perform_now project, signed_ids
|
||||||
|
|
||||||
releases = AppearanceRelease.last(2)
|
releases = AppearanceRelease.last(2)
|
||||||
@@ -304,14 +288,4 @@ describe MatchAppearanceReleasesJob do
|
|||||||
expect(releases[1].contract.attached?).to eq true
|
expect(releases[1].contract.attached?).to eq true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def success_flash_message
|
|
||||||
I18n.t 'appearance_releases.create.matching_completed'
|
|
||||||
end
|
|
||||||
|
|
||||||
def failure_flash_message
|
|
||||||
I18n.t 'appearance_releases.create.matching_failed'
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user