Compare commits

..

3 Commits

Author SHA1 Message Date
Bilal
14445aeb14 do not use remember_me, set cookie expiration 2020-08-25 05:25:16 +02:00
Bilal
01da597f3e modify specs 2020-08-25 05:25:16 +02:00
Bilal
663a6d5c33 add remember_me token 2020-08-25 05:25:16 +02:00
6 changed files with 6 additions and 32 deletions

View File

@@ -4,6 +4,7 @@ require './lib/knock_monkeypatch'
class Api::UserTokenController < Knock::AuthTokenController
include Oath::ControllerHelpers
include RememberMe::Controller
skip_before_action :verify_authenticity_token
before_action :sign_in_user

View File

@@ -18,8 +18,4 @@ class BroadcastRecording < ApplicationRecord
def download_file_name
"#{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
def thumbnail_url(width = 300)
"https://image.mux.com/#{asset_playback_uid}/thumbnail.jpg?width=#{width}"
end
end

View File

@@ -3,11 +3,10 @@
<ul class="mt-2">
<% recordings.each do |recording| %>
<li>
<%= link_to(recording.download_file_name, recording.download_url, target: "_blank") %>
<%= link_to(recording.download_file_name, recording.download_url, target: "_blank") %>
<% if (controller.class.module_parent.to_s != "Public" && policy(BroadcastRecording).destroy?) %>
<%= link_to "Hide", [broadcast.project, broadcast, recording], class: "btn-sm btn-primary ml-1 text-decoration-none", remote: true, method: :delete, data: { confirm: t('.confirm_hide') } %>
<% end %>
<%= image_tag(recording.thumbnail_url, class: 'img-thumbnail img-fluid mt-2 mb-2') %>
</li>
<% end %>
</ul>

View File

@@ -0,0 +1 @@
Rails.application.config.session_store :cookie_store, key: '_easy_release_session', expire_after: 1.month

View File

@@ -9,20 +9,6 @@ SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
--
-- Name: fuzzystrmatch; Type: EXTENSION; Schema: -; Owner: -
--
@@ -1503,6 +1489,7 @@ CREATE TABLE public.settings (
--
CREATE SEQUENCE public.settings_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -1538,6 +1525,7 @@ CREATE TABLE public.taggings (
--
CREATE SEQUENCE public.taggings_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
@@ -1568,6 +1556,7 @@ CREATE TABLE public.tags (
--
CREATE SEQUENCE public.tags_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE

View File

@@ -223,18 +223,6 @@ feature 'User managing broadcasts' do
expect(page).to have_content("Recording of the live stream will appear here")
end
scenario 'Broadcast recording preview thumbnail is shown' do
broadcast = create(:broadcast, :with_stream, :with_files, project: project)
recording = create(:broadcast_recording, broadcast: broadcast, asset_uid: "another_asset_uid")
visit project_broadcast_path(project, broadcast)
click_on 'Previous Sessions'
expect(page).to have_css('img.img-thumbnail')
expect(page.find('img.img-thumbnail')['src']).to match recording.asset_playback_uid
end
context 'When the user is associate' do
let(:current_user) { create(:user, :associate) }