Compare commits

..

5 Commits

Author SHA1 Message Date
Bilal
749aa4efd9 fix spec 2020-07-01 12:46:53 +02:00
Bilal
709cdc030d fix MR comments 2020-07-01 11:44:21 +02:00
Bilal
469839cee7 fix MR comments 2020-07-01 11:27:18 +02:00
Bilal
6fc05f0b7f rebase; sort translations 2020-07-01 11:21:52 +02:00
Bilal
ba985b0af6 add splash screen for deliverME 2020-07-01 11:15:59 +02:00
9 changed files with 110 additions and 78 deletions

View File

@@ -4,7 +4,6 @@ class TaskRequestsController < ApplicationController
before_action :set_project
before_action :build_task_request, only: [:new, :create]
before_action :set_task_request, only: [:show, :edit, :update, :cancel]
before_action :show_splash_screen, only: :index
def index
@task_requests = task_requests.order_by_recent.paginate(page: params[:page])
@@ -47,10 +46,6 @@ class TaskRequestsController < ApplicationController
private
def show_splash_screen
render :splash if task_requests.count.zero?
end
def task_request_params
params.require(:task_request).permit(:description, :deadline, :time_allowed, :additional_notes, files: [])
end

View File

@@ -3,6 +3,7 @@ class VideosController < ApplicationController
before_action :set_project, only: [:index, :new, :create, :landing]
before_action :set_video, only: [:edit, :update]
before_action :show_splash_screen, only: :index
def landing
authorize Video, :new?
@@ -60,6 +61,10 @@ class VideosController < ApplicationController
private
def show_splash_screen
render :splash if videos.count.zero?
end
def set_project
@project = policy_scope(Project).find(params[:project_id])
end

View File

@@ -1,12 +1,12 @@
<div class="d-flex flex-row">
<div class="d-flex flex-column">
<%= product_wordmark :task_me, prefix: t('.headings.welcome'), class: "h2" %>
<%= product_wordmark :deliver_me, prefix: t('.headings.welcome'), class: "h2" %>
<p class="text-muted"><%= t '.headings.subtitle' %>
</div>
<%= link_to t(".actions.book_demo"), 'https://meetings.hubspot.com/bray2', class: "btn btn-primary border align-self-center h-50 ml-auto mr-2 pb-2", target: '_blank' %>
<% if policy(TaskRequest).new? %>
<%= link_to t(".actions.create_task_request"), [:new, @project, :task_request], class: "btn btn-success border align-self-center h-50 pb-2" %>
<% if policy(Video).new? %>
<%= link_to t(".actions.upload_video"), [:new, @project, :video], class: "btn btn-success border align-self-center h-50 pb-2" %>
<% end %>
</div>
@@ -36,10 +36,10 @@
<div class="col">
<h3><%= t '.headings.how_it_works' %></h3>
<ol>
<li><%= t '.list_items.enter_task_request' %></li>
<li><%= t '.list_items.state_deadline' %></li>
<li><%= t '.list_items.enter_number_of_hours' %></li>
<li><%= t '.list_items.virtual_assistant_delivers_task' %></li>
<li><%= t '.list_items.import_video' %></li>
<li><%= t '.list_items.import_EDLs' %></li>
<li><%= t '.list_items.AI_generates_documents' %></li>
<li><%= t '.list_items.download_documents' %></li>
</ol>
</div>
</div>
@@ -47,12 +47,13 @@
<div class="col">
<h3><%= t '.headings.benefits' %></h3>
<ul class="fa-ul ml-5">
<%= content_tag(:li, fa_icon("check li", text: t('.list_items.reduces_need_for_full_time_staff'))) %>
<%= content_tag(:li, fa_icon("check li", text: t('.list_items.reduces_workload'))) %>
<%= content_tag(:li, fa_icon("check li", text: t('.list_items.spend_per_task'))) %>
<%= content_tag(:li, fa_icon("check li", text: t('.list_items.reduces_labor_cost'))) %>
<%= content_tag(:li, fa_icon("check li", text: t('.list_items.more_accurate'))) %>
<%= content_tag(:li, fa_icon("check li", text: t('.list_items.simplifies_cue_sheets'))) %>
<%= content_tag(:li, fa_icon("check li", text: t('.list_items.production_elements_logs'))) %>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -1202,23 +1202,6 @@ en:
heading: New Task Request
show:
empty: Attached files will appear here.
splash:
actions:
book_demo: Schedule a Demo
create_task_request: Create Task Request
headings:
benefits: Benefits
how_it_works: How It Works
subtitle: Pay-by-the-hour, digitally-enabled remote assistants
welcome: Welcome to
list_items:
enter_number_of_hours: Enter the number of hours you want the task worked on
enter_task_request: Enter your task request
reduces_need_for_full_time_staff: Reduces need to hire full-time staff
reduces_workload: Reduces workload for current staff
spend_per_task: Spend as little as $60 per task
state_deadline: State your deadline
virtual_assistant_delivers_task: Virtual assistant delivers task via TaskME portal
task_request:
actions:
manage: Manage
@@ -1290,6 +1273,24 @@ en:
new:
heading: Upload Video
subheading: 2 of 2 Files
splash:
actions:
book_demo: Schedule a Demo
upload_video: Upload New Video
headings:
benefits: Benefits
how_it_works: How It Works
subtitle: Automate your deliverable documents
welcome: Welcome to
list_items:
AI_generates_documents: AI generates deliverable documents
download_documents: Download deliverable documents
import_EDLs: Import your EDLs
import_video: Import your video
more_accurate: More accurate than human-generated reports
production_elements_logs: Production Elements Logs, and more
reduces_labor_cost: Reduces labor costs
simplifies_cue_sheets: Simplifies Music Cue Sheets, Graphic Cue Sheets
update:
notice: The video has been updated
video:

View File

@@ -358,25 +358,27 @@ es:
index:
table_headers:
task_request_description: Description (ES)
splash:
actions:
book_demo: Schedule a Demo (ES)
create_task_request: Create Task Request
headings:
benefits: Benefits (ES)
how_it_works: How It Works (ES)
subtitle: Pay-by-the-hour, digitally-enabled remote assistants (ES)
welcome: Welcome to (ES)
list_items:
enter_number_of_hours: Enter the number of hours you want the task worked on (ES)
enter_task_request: Enter your task request (ES)
reduces_need_for_full_time_staff: Reduces need to hire full-time staff (ES)
reduces_workload: Reduces workload for current staff (ES)
spend_per_task: Spend as little as $60 per task (ES)
state_deadline: State your deadline (ES)
virtual_assistant_delivers_task: Virtual assistant delivers task via TaskME portal (ES)
task_request:
actions:
manage: Manage (ES)
open_deliverable: Open Deliverable (ES)
read_more: read more (ES)
videos:
splash:
actions:
book_demo: Schedule a Demo (ES)
upload_video: Upload New Video (ES)
headings:
benefits: Benefits (ES)
how_it_works: How It Works (ES)
subtitle: Automate your deliverable documents (ES)
welcome: Welcome to (ES)
list_items:
AI_generates_documents: AI generates deliverable documents (ES)
download_documents: Download deliverable documents (ES)
import_EDLs: Import your EDLs (ES)
import_video: Import your video (ES)
more_accurate: More accurate than human-generated reports (ES)
production_elements_logs: Production Elements Logs, and more (ES)
reduces_labor_cost: Reduces labor costs (ES)
simplifies_cue_sheets: Simplifies Music Cue Sheets, Graphic Cue Sheets (ES)

View File

@@ -18,14 +18,7 @@ RSpec.describe TaskRequestsController, type: :controller do
expect(response).to be_successful
end
it "renders splash page if there are no task requests" do
get :index, params: { project_id: project }
expect(response.body).to have_link "Create Task Request"
expect(response.body).to have_link schedule_demo
end
it "renders task requests table if there are task requests" do
it "renders content" do
create(:task_request, project: project, description: "Another Request")
get :index, params: { project_id: project }
@@ -133,8 +126,4 @@ RSpec.describe TaskRequestsController, type: :controller do
def update_params
{ description: "This is updated description" }
end
def schedule_demo
t 'task_requests.splash.actions.book_demo'
end
end

View File

@@ -20,6 +20,7 @@ RSpec.describe VideosController, type: :controller do
end
it "has a search form" do
create(:video, project: project)
get :index, params: { project_id: project }
expect(response.body).to have_button("search-button")
@@ -43,7 +44,7 @@ RSpec.describe VideosController, type: :controller do
end
it "renders content" do
it "renders content if there are existing videos" do
video = create(:video, project: project, name: "My Video", number: "001", created_at: 1.day.ago)
get :index, params: { project_id: project }
@@ -58,10 +59,11 @@ RSpec.describe VideosController, type: :controller do
end
context "when there are no records" do
it "renders an empty message" do
it "renders splash screen" do
get :index, params: { project_id: project }
expect(response.body).to have_content("Videos will appear here")
expect(response.body).to have_link "Upload New Video"
expect(response.body).to have_link schedule_demo
end
end
@@ -277,4 +279,8 @@ RSpec.describe VideosController, type: :controller do
def video_update_params
attributes_for(:video, :with_graphics_only_edl_file, :with_audio_only_edl_file, name: "Test Video").except(:file)
end
def schedule_demo
t 'videos.splash.actions.book_demo'
end
end

View File

@@ -8,14 +8,7 @@ feature "User managing task requests" do
sign_in current_user
end
scenario "splash page is shown if there are no task requests" do
visit project_task_requests_path(project)
expect(page).to have_content schedule_demo
end
scenario "task requests table is visible" do
create(:task_request, project: project, description: 'Short Desc')
visit project_task_requests_path(project)
expect(page).to have_content "Created On"
@@ -26,6 +19,10 @@ feature "User managing task requests" do
end
scenario "sees list of task requests" do
visit project_task_requests_path(project)
expect(page).to have_content no_task_requests_label
task_request = create(:task_request, project: project)
visit project_task_requests_path(project)
@@ -116,8 +113,4 @@ feature "User managing task requests" do
def long_description_text
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'
end
def schedule_demo
t 'task_requests.splash.actions.book_demo'
end
end

View File

@@ -1,8 +1,8 @@
require "rails_helper"
feature "User managing videos" do
let(:current_user) { create(:user) }
let(:project) { create(:project, account: current_user.primary_account) }
let(:current_user) { create(:user, :manager) }
let(:project) { create(:project, members: current_user, account: current_user.primary_account) }
let!(:video) do
create(:video,
:with_graphics_only_edl_file,
@@ -17,6 +17,14 @@ feature "User managing videos" do
sign_in current_user
end
scenario "splash page is shown if there are no existing videos" do
Video.delete_all
visit project_videos_path(project)
expect(page).to have_content schedule_demo
expect(page).to have_content upload_new_video
end
scenario "creating a video", js: true do
visit project_videos_path(project)
click_link "Upload New Video"
@@ -96,6 +104,30 @@ feature "User managing videos" do
expect(page).to have_content("Second Video")
end
context 'When the user is associate' do
let(:current_user) { create(:user, :associate) }
it 'does show button to upload new video' do
Video.delete_all
visit project_videos_path(project)
expect(page).to have_content schedule_demo
expect(page).to have_content upload_new_video
end
end
context 'When the user is account manager' do
let(:current_user) { create(:user, :account_manager) }
it 'does show button to upload new video' do
Video.delete_all
visit project_videos_path(project)
expect(page).to have_content schedule_demo
expect(page).to have_content upload_new_video
end
end
private
def fill_in_video_fields(data)
@@ -115,4 +147,12 @@ feature "User managing videos" do
def update_video_notice
t "videos.update.notice"
end
def schedule_demo
t 'videos.splash.actions.book_demo'
end
def upload_new_video
t 'videos.splash.actions.upload_video'
end
end