Compare commits
4 Commits
make-direc
...
allow-task
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c17f41525d | ||
|
|
d12cec8487 | ||
|
|
bde18ab0f1 | ||
|
|
fc320a3421 |
@@ -6,5 +6,5 @@ class TaskRequest < ApplicationRecord
|
|||||||
|
|
||||||
scope :order_by_recent, -> { order(created_at: :desc) }
|
scope :order_by_recent, -> { order(created_at: :desc) }
|
||||||
|
|
||||||
validates :time_allowed, numericality: { only_integer: true, greater_than_or_equal_to: 2 }
|
validates :time_allowed, numericality: { only_integer: true, greater_than_or_equal_to: 2 }, allow_blank: true
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,9 +1,19 @@
|
|||||||
<%= errors_summary_for task_request %>
|
<%= errors_summary_for task_request %>
|
||||||
|
|
||||||
<%= bootstrap_form_with model: model, url: [@project, @task_request, show_chat: true], local: true do |form| %>
|
<%= bootstrap_form_with model: model, url: [@project, @task_request, show_chat: true], local: true do |form| %>
|
||||||
<div class="alert alert-info text-center text-md-left">
|
|
||||||
<%= fa_icon "info-circle" %>
|
<div class="d-flex">
|
||||||
<strong><%= t '.info_message' %></strong>
|
<div class="row">
|
||||||
|
<div class="col-xl-10 col-12">
|
||||||
|
<div class="alert alert-info text-center text-md-left">
|
||||||
|
<%= fa_icon "info-circle" %>
|
||||||
|
<strong><%= t '.info_message' %></strong>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xl-2 col-12">
|
||||||
|
<%= form.submit t('.actions.chat_now'), class: "btn btn-block btn-warning pt-4 pb-4 mb-1", data: { disable_with: t("shared.disable_with") } %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%= form.text_area :description, label: t('.labels.description') %>
|
<%= form.text_area :description, label: t('.labels.description') %>
|
||||||
|
|||||||
@@ -1284,7 +1284,9 @@ en:
|
|||||||
heading:
|
heading:
|
||||||
Edit Task Request
|
Edit Task Request
|
||||||
form:
|
form:
|
||||||
info_message: After submitting this task request, you'll be connected via chat with a ME Suite representative.
|
actions:
|
||||||
|
chat_now: Chat Now
|
||||||
|
info_message: For best results, please fill out this form prior to being connected with a TaskME assistant. However, if urgent, you can start speaking with a TaskME assistant by pressing the Chat Now button to the right
|
||||||
labels:
|
labels:
|
||||||
additional_notes: Please add any additional notes we should be aware of regarding this task.
|
additional_notes: Please add any additional notes we should be aware of regarding this task.
|
||||||
deadline: What is the deadline for this task?
|
deadline: What is the deadline for this task?
|
||||||
|
|||||||
@@ -484,7 +484,9 @@ es:
|
|||||||
create:
|
create:
|
||||||
success_message: Your task request was successfully submitted. Thank you. A chat window will pop up on the lower right in a few seconds. (ES)
|
success_message: Your task request was successfully submitted. Thank you. A chat window will pop up on the lower right in a few seconds. (ES)
|
||||||
form:
|
form:
|
||||||
info_message: After submitting this task request, you'll be connected via chat with a ME Suite representative. (ES)
|
actions:
|
||||||
|
chat_now: Chat Now (ES)
|
||||||
|
info_message: For best results, please fill out this form prior to being connected with a TaskME assistant. However, if urgent, you can start speaking with a TaskME assistant by pressing the Chat Now button to the right (ES)
|
||||||
index:
|
index:
|
||||||
table_headers:
|
table_headers:
|
||||||
task_request_description: Description (ES)
|
task_request_description: Description (ES)
|
||||||
|
|||||||
@@ -9,20 +9,6 @@ SET xmloption = content;
|
|||||||
SET client_min_messages = warning;
|
SET client_min_messages = warning;
|
||||||
SET row_security = off;
|
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: -
|
-- Name: fuzzystrmatch; Type: EXTENSION; Schema: -; Owner: -
|
||||||
--
|
--
|
||||||
|
|||||||
@@ -91,6 +91,21 @@ feature "User managing task requests" do
|
|||||||
expect(page).to have_content add_new_project_label
|
expect(page).to have_content add_new_project_label
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scenario "user can click Chat Now and start chat event with a blank form" do
|
||||||
|
visit project_task_requests_path(project)
|
||||||
|
|
||||||
|
click_on create_task_request
|
||||||
|
|
||||||
|
expect(page).to have_content chat_now_button
|
||||||
|
expect(page).to have_content form_notice
|
||||||
|
|
||||||
|
expect do
|
||||||
|
click_on chat_now_button
|
||||||
|
end.to change(TaskRequest, :count).by(1)
|
||||||
|
|
||||||
|
expect(page).to have_content task_request_created_notice
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def no_task_requests_label
|
def no_task_requests_label
|
||||||
@@ -120,4 +135,20 @@ feature "User managing task requests" do
|
|||||||
def schedule_demo
|
def schedule_demo
|
||||||
t 'task_requests.splash.actions.book_demo'
|
t 'task_requests.splash.actions.book_demo'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def create_task_request
|
||||||
|
t 'task_requests.index.actions.new'
|
||||||
|
end
|
||||||
|
|
||||||
|
def chat_now_button
|
||||||
|
t 'task_requests.form.actions.chat_now'
|
||||||
|
end
|
||||||
|
|
||||||
|
def form_notice
|
||||||
|
t 'task_requests.form.info_message'
|
||||||
|
end
|
||||||
|
|
||||||
|
def task_request_created_notice
|
||||||
|
t 'task_requests.create.success_message'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -13,8 +13,4 @@ RSpec.describe TaskRequest, type: :model do
|
|||||||
subject { described_class }
|
subject { described_class }
|
||||||
it { is_expected.to respond_to(:order_by_recent) }
|
it { is_expected.to respond_to(:order_by_recent) }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "#validations" do
|
|
||||||
it { should validate_numericality_of(:time_allowed).only_integer.is_greater_than_or_equal_to(2) }
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user