From e1c003d6afb544e40eadb85e08aa443548edac18 Mon Sep 17 00:00:00 2001 From: Bilal Date: Wed, 1 Jul 2020 08:56:23 +0200 Subject: [PATCH 1/2] fix MR comments --- app/controllers/task_requests_controller.rb | 5 ++ app/helpers/wordmark_helper.rb | 5 +- app/views/task_requests/splash.html.erb | 58 +++++++++++++++++++ config/locales/en.yml | 21 ++++++- config/locales/es.yml | 17 ++++++ .../task_requests_controller_spec.rb | 13 ++++- .../user_managing_task_requests_spec.rb | 15 +++-- 7 files changed, 126 insertions(+), 8 deletions(-) create mode 100644 app/views/task_requests/splash.html.erb diff --git a/app/controllers/task_requests_controller.rb b/app/controllers/task_requests_controller.rb index 07172d0..81723d0 100644 --- a/app/controllers/task_requests_controller.rb +++ b/app/controllers/task_requests_controller.rb @@ -4,6 +4,7 @@ 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]) @@ -46,6 +47,10 @@ 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 diff --git a/app/helpers/wordmark_helper.rb b/app/helpers/wordmark_helper.rb index 5b6eca7..09820c4 100644 --- a/app/helpers/wordmark_helper.rb +++ b/app/helpers/wordmark_helper.rb @@ -13,10 +13,13 @@ module WordmarkHelper css += options[:class].to_s content_tag(:div, class: css) do - safe_join [ + elements = [ content_tag(:span, t("shared.#{product_name}")), content_tag(:span, t("shared.me")) ] + prefix = options[:prefix] + elements.unshift content_tag(:span, "#{prefix} ") unless prefix.blank? + safe_join elements end end end diff --git a/app/views/task_requests/splash.html.erb b/app/views/task_requests/splash.html.erb new file mode 100644 index 0000000..98d626f --- /dev/null +++ b/app/views/task_requests/splash.html.erb @@ -0,0 +1,58 @@ +
+
+ <%= product_wordmark :task_me, prefix: t('.headings.welcome'), class: "h2" %> +

<%= t '.headings.subtitle' %> +

+ + <%= 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" %> + <% end %> +
+ +
+ +
+
+
+
+
+
+ + + + + + +
+ Video tutorial will be available soon +
+
+
+
+
+
+
+
+

<%= t '.headings.how_it_works' %>

+
    +
  1. <%= t '.list_items.enter_task_request' %>
  2. +
  3. <%= t '.list_items.state_deadline' %>
  4. +
  5. <%= t '.list_items.enter_number_of_hours' %>
  6. +
  7. <%= t '.list_items.virtual_assistant_delivers_task' %>
  8. +
+
+
+
+
+

<%= t '.headings.benefits' %>

+
    + <%= 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'))) %> +
+
+
+
+
+
diff --git a/config/locales/en.yml b/config/locales/en.yml index cc28c89..ac37dd6 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -324,11 +324,11 @@ en: notice: The release has been updated helpers: help: - task_request: - time_allowed: Minimum of 2 hours, no partial hours allowed contract_template: fee: Leave at $0.00 for no-fee guardian_clause: Leave blank if not required for this contract + task_request: + time_allowed: Minimum of 2 hours, no partial hours allowed video: audio_only_edl_file: If you do not upload an Audio Only EDL, the software will not generate a BiG Music Cue Sheet. edl_file: Please follow our directions on exporting the All Tracks EDL. Failure to do so could result in inaccurate and incomplete reporting. @@ -1202,6 +1202,23 @@ 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 diff --git a/config/locales/es.yml b/config/locales/es.yml index 3384431..72ad5aa 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -358,6 +358,23 @@ 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) diff --git a/spec/controllers/task_requests_controller_spec.rb b/spec/controllers/task_requests_controller_spec.rb index 614d814..22df666 100644 --- a/spec/controllers/task_requests_controller_spec.rb +++ b/spec/controllers/task_requests_controller_spec.rb @@ -18,7 +18,14 @@ RSpec.describe TaskRequestsController, type: :controller do expect(response).to be_successful end - it "renders content" do + 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 create(:task_request, project: project, description: "Another Request") get :index, params: { project_id: project } @@ -126,4 +133,8 @@ 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 diff --git a/spec/features/user_managing_task_requests_spec.rb b/spec/features/user_managing_task_requests_spec.rb index 80c4f1c..c40cd88 100644 --- a/spec/features/user_managing_task_requests_spec.rb +++ b/spec/features/user_managing_task_requests_spec.rb @@ -8,7 +8,14 @@ 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" @@ -19,10 +26,6 @@ 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) @@ -113,4 +116,8 @@ 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 -- 2.47.3 From d11ceab9168af2cd3972ef6646dbd6e6a98c5a38 Mon Sep 17 00:00:00 2001 From: Bilal Date: Wed, 1 Jul 2020 08:57:19 +0200 Subject: [PATCH 2/2] update struct --- db/structure.sql | 40 ++++++---------------------------------- 1 file changed, 6 insertions(+), 34 deletions(-) diff --git a/db/structure.sql b/db/structure.sql index c4de3ba..70304ab 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -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: - -- @@ -331,8 +317,8 @@ CREATE TABLE public.appearance_releases ( person_last_name character varying, guardian_first_name character varying, guardian_last_name character varying, - guardian_email character varying, identifier character varying, + guardian_email character varying, person_address_street2 character varying, person_address_city character varying, person_address_state character varying, @@ -666,15 +652,6 @@ CREATE SEQUENCE public.contract_templates_id_seq ALTER SEQUENCE public.contract_templates_id_seq OWNED BY public.contract_templates.id; --- --- Name: data_migrations; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.data_migrations ( - version character varying NOT NULL -); - - -- -- Name: directories; Type: TABLE; Schema: public; Owner: - -- @@ -1401,6 +1378,7 @@ CREATE TABLE public.settings ( -- CREATE SEQUENCE public.settings_id_seq + AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE @@ -1436,6 +1414,7 @@ CREATE TABLE public.taggings ( -- CREATE SEQUENCE public.taggings_id_seq + AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE @@ -1466,6 +1445,7 @@ CREATE TABLE public.tags ( -- CREATE SEQUENCE public.tags_id_seq + AS integer START WITH 1 INCREMENT BY 1 NO MINVALUE @@ -1826,9 +1806,9 @@ CREATE TABLE public.zoom_meetings ( api_meeting_id character varying, created_at timestamp(6) without time zone NOT NULL, updated_at timestamp(6) without time zone NOT NULL, - status integer DEFAULT 0, zoom_user_id bigint, - project_id bigint + project_id bigint, + status integer DEFAULT 0 ); @@ -2305,14 +2285,6 @@ ALTER TABLE ONLY public.contract_templates ADD CONSTRAINT contract_templates_pkey PRIMARY KEY (id); --- --- Name: data_migrations data_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.data_migrations - ADD CONSTRAINT data_migrations_pkey PRIMARY KEY (version); - - -- -- Name: directories directories_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- -- 2.47.3