Compare commits

..

2 Commits

Author SHA1 Message Date
Bilal
cc30262811 add splash page for directME 2020-07-01 12:58:03 +02:00
Bilal
252501f789 rebase; sort translations 2020-07-01 12:18:24 +02:00
9 changed files with 110 additions and 79 deletions

View File

@@ -5,6 +5,7 @@ class BroadcastsController < ApplicationController
before_action :build_broadcast, only: [:new, :create]
before_action :set_broadcast, only: [:show, :destroy, :update]
before_action :set_multi_view_broadcasts, only: [:show]
before_action :show_splash_screen, only: :index
def index
@broadcasts = filtered_broadcasts.order_by_recent.paginate(page: params[:page])
@@ -49,6 +50,10 @@ class BroadcastsController < ApplicationController
private
def show_splash_screen
render :splash if broadcasts.count.zero?
end
def broadcast_params
params.require(:broadcast).permit(:name, files: [])
end

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

@@ -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 :direct_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(Broadcast).new? %>
<%= link_to t(".actions.create_stream"), [:new, @project, :broadcast], 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.create_stream' %></li>
<li><%= t '.list_items.share_stream' %></li>
<li><%= t '.list_items.launch_video_conference' %></li>
<li><%= t '.list_items.share_files' %></li>
</ol>
</div>
</div>
@@ -47,9 +47,10 @@
<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.stream_from_mobile_app'))) %>
<%= content_tag(:li, fa_icon("check li", text: t('.list_items.direct_shoots_anywhere'))) %>
<%= content_tag(:li, fa_icon("check li", text: t('.list_items.share_live_stream'))) %>
<%= content_tag(:li, fa_icon("check li", text: t('.list_items.stream_multiple_cameras'))) %>
</ul>
</div>
</div>

View File

@@ -207,6 +207,24 @@ en:
new:
heading:
Create Live Stream
splash:
actions:
book_demo: Schedule a Demo
create_stream: Create New Live Stream
headings:
benefits: Benefits
how_it_works: How It Works
subtitle: Remote directing and video village solution
welcome: Welcome to
list_items:
create_stream: Create a live stream
direct_shoots_anywhere: Direct shoots anywhere around the world
launch_video_conference: Launch Video Conference using plugin
share_files: Share files via the ME Suite mobile app
share_live_stream: Share live stream with clients all over the the world
share_stream: Share live stream link with clients
stream_from_mobile_app: Stream from ME Suite Mobile app, or via a professional camera
stream_multiple_cameras: Stream multiple cameras at one time
bulk_taggings:
new_bulk_tag_modal:
submit: Add
@@ -1202,23 +1220,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

View File

@@ -57,6 +57,25 @@ es:
pdf:
do_not_copy_warning: "Do not copy (ES)"
serial_number_label: "Serial Number (ES)"
broadcasts:
splash:
actions:
book_demo: Schedule a Demo
create_stream: Create New Live Stream
headings:
benefits: Benefits
how_it_works: How It Works
subtitle: Remote directing and video village solution
welcome: Welcome to
list_items:
create_stream: Create a live stream
direct_shoots_anywhere: Direct shoots anywhere around the world
launch_video_conference: Launch Video Conference using plugin
share_files: Share files via the ME Suite mobile app
share_live_stream: Share live stream with clients all over the the world
share_stream: Share live stream link with clients
stream_from_mobile_app: Stream from ME Suite Mobile app, or via a professional camera
stream_multiple_cameras: Stream multiple cameras at one time
contract_templates:
blank_contracts:
create:
@@ -358,23 +377,6 @@ 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)

View File

@@ -22,7 +22,7 @@ RSpec.describe BroadcastsController, type: :controller do
expect(response).to be_successful
end
it "renders content" do
it "renders content if theere are existing broadcasts" do
create(:broadcast, project: project, name: "Another Broadcast")
get :index, params: { project_id: project }
@@ -34,12 +34,13 @@ RSpec.describe BroadcastsController, type: :controller do
end
context "when there are no active broadcasts" do
it "renders an empty message" do
it "renders splash screen" do
Broadcast.destroy_all
get :index, params: { project_id: project }
expect(response.body).to have_content("Live streams will appear here")
expect(response.body).to have_link create_stream
expect(response.body).to have_link schedule_demo
end
end
@@ -55,10 +56,8 @@ RSpec.describe BroadcastsController, type: :controller do
context "for xhr request" do
it "filters the broadcasts by a query param" do
appearance_releases = [
create(:broadcast, skip_create_callback: true, name: "Stream by Adam"),
create(:broadcast, skip_create_callback: true, name: "Stream by Zoe"),
]
create(:broadcast, project: project, skip_create_callback: true, name: "Stream by Adam")
create(:broadcast, project: project, skip_create_callback: true, name: "Stream by Zoe")
get :index, params: { project_id: project, query: "Zoe" }, xhr: true
@@ -245,4 +244,12 @@ RSpec.describe BroadcastsController, type: :controller do
{ files: [contract_file] }
end
def schedule_demo
t 'broadcasts.splash.actions.book_demo'
end
def create_stream
t 'broadcasts.splash.actions.create_stream'
end
end

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

@@ -12,6 +12,13 @@ feature 'User managing broadcasts' do
allow(MuxLiveStream).to receive(:new).and_return(double(id: 'id', key: 'key', playback_id: 'playback_id'))
end
scenario "splash page is shown if there are no existing streams" do
visit project_broadcasts_path(project)
expect(page).to have_content schedule_demo
expect(page).to have_content create_stream
end
scenario 'creating and deleting a broadcast', js: true do
visit new_project_broadcast_path(project)
@@ -131,6 +138,29 @@ feature 'User managing broadcasts' do
end
end
end
context 'When the user is associate' do
let(:current_user) { create(:user, :associate) }
it 'does not show button to create new live stream' do
visit project_broadcasts_path(project)
expect(page).to have_content schedule_demo
expect(page).not_to have_content create_stream
end
end
context 'When the user is account manager' do
let(:current_user) { create(:user, :account_manager) }
it 'does show button to create new live stream' do
visit project_broadcasts_path(project)
expect(page).to have_content schedule_demo
expect(page).to have_content create_stream
end
end
end
private
@@ -151,4 +181,12 @@ feature 'User managing broadcasts' do
def switch_view_dropdown
'Switch View'
end
def schedule_demo
t 'broadcasts.splash.actions.book_demo'
end
def create_stream
t 'broadcasts.splash.actions.create_stream'
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