think_feel_do_engine 3.19.9 → 3.20.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +11 -3
- data/app/assets/config/manifest.js +3 -0
- data/app/assets/javascripts/think_feel_do_engine/activities/activity_tracker.js +3 -2
- data/app/controllers/think_feel_do_engine/application_controller.rb +4 -3
- data/app/controllers/think_feel_do_engine/bit_maker/content_modules_controller.rb +4 -3
- data/app/controllers/think_feel_do_engine/bit_maker/content_providers_controller.rb +2 -1
- data/app/controllers/think_feel_do_engine/bit_maker/slides_controller.rb +7 -5
- data/app/controllers/think_feel_do_engine/bit_maker/slideshow_anchors_controller.rb +3 -2
- data/app/controllers/think_feel_do_engine/bit_maker/slideshows_controller.rb +1 -0
- data/app/controllers/think_feel_do_engine/coach/group_dashboard_controller.rb +1 -0
- data/app/controllers/think_feel_do_engine/coach/memberships_controller.rb +7 -4
- data/app/controllers/think_feel_do_engine/coach/messages_controller.rb +2 -1
- data/app/controllers/think_feel_do_engine/coach/participant_activities_visualizations_controller.rb +1 -0
- data/app/controllers/think_feel_do_engine/coach/participant_thoughts_visualizations_controller.rb +1 -0
- data/app/controllers/think_feel_do_engine/coach/patient_dashboards_controller.rb +1 -0
- data/app/controllers/think_feel_do_engine/coach/phq_assessments_controller.rb +1 -0
- data/app/controllers/think_feel_do_engine/coach/received_messages_controller.rb +2 -1
- data/app/controllers/think_feel_do_engine/coach/sent_messages_controller.rb +1 -0
- data/app/controllers/think_feel_do_engine/coach/site_messages_controller.rb +1 -0
- data/app/controllers/think_feel_do_engine/coach_dashboard_controller.rb +1 -0
- data/app/controllers/think_feel_do_engine/concerns/browser_detective.rb +13 -12
- data/app/controllers/think_feel_do_engine/concerns/invalid_auth_token.rb +1 -0
- data/app/controllers/think_feel_do_engine/concerns/navigator_enabled.rb +1 -0
- data/app/controllers/think_feel_do_engine/keep_alive_controller.rb +1 -0
- data/app/controllers/think_feel_do_engine/lesson_slides_controller.rb +3 -2
- data/app/controllers/think_feel_do_engine/lessons_controller.rb +4 -3
- data/app/controllers/think_feel_do_engine/manage/groups_controller.rb +3 -2
- data/app/controllers/think_feel_do_engine/manage/tasks_controller.rb +1 -0
- data/app/controllers/think_feel_do_engine/memberships_controller.rb +1 -0
- data/app/controllers/think_feel_do_engine/navigator_controller.rb +7 -4
- data/app/controllers/think_feel_do_engine/participant_data_controller.rb +3 -2
- data/app/controllers/think_feel_do_engine/participants/activities_controller.rb +8 -11
- data/app/controllers/think_feel_do_engine/participants/assessments_controller.rb +4 -3
- data/app/controllers/think_feel_do_engine/participants/lessons_controller.rb +1 -0
- data/app/controllers/think_feel_do_engine/participants/media_access_events_controller.rb +3 -3
- data/app/controllers/think_feel_do_engine/participants/passwords_controller.rb +1 -0
- data/app/controllers/think_feel_do_engine/participants/public_slides_controller.rb +3 -2
- data/app/controllers/think_feel_do_engine/participants/sessions_controller.rb +1 -0
- data/app/controllers/think_feel_do_engine/participants/thoughts_controller.rb +4 -5
- data/app/controllers/think_feel_do_engine/password_entropy_bits_controller.rb +3 -1
- data/app/controllers/think_feel_do_engine/privacy_policies_controller.rb +1 -0
- data/app/controllers/think_feel_do_engine/quick_sign_ins_controller.rb +1 -0
- data/app/controllers/think_feel_do_engine/users/passwords_controller.rb +1 -0
- data/app/controllers/think_feel_do_engine/users/registrations_controller.rb +1 -0
- data/app/controllers/think_feel_do_engine/users/sessions_controller.rb +1 -0
- data/app/helpers/think_feel_do_engine/activities_helper.rb +2 -1
- data/app/helpers/think_feel_do_engine/application_helper.rb +2 -1
- data/app/helpers/think_feel_do_engine/brand_helper.rb +1 -0
- data/app/helpers/think_feel_do_engine/coach/activity_color_code_helper.rb +1 -0
- data/app/helpers/think_feel_do_engine/coach/dashboard_and_phq_table_helper.rb +6 -5
- data/app/helpers/think_feel_do_engine/coach/group_dashboard_helper.rb +5 -3
- data/app/helpers/think_feel_do_engine/coach/messages_helper.rb +3 -1
- data/app/helpers/think_feel_do_engine/coach/moods_and_phq_viz_helper.rb +1 -0
- data/app/helpers/think_feel_do_engine/coach/patient_dashboard_helper.rb +9 -8
- data/app/helpers/think_feel_do_engine/emotions_helper.rb +1 -0
- data/app/helpers/think_feel_do_engine/phq_assessment_helper.rb +1 -0
- data/app/helpers/think_feel_do_engine/presenters_helper.rb +1 -0
- data/app/helpers/think_feel_do_engine/slides_helper.rb +5 -2
- data/app/helpers/think_feel_do_engine/tasks_helper.rb +11 -9
- data/app/mailers/think_feel_do_engine/lesson_notification_mailer.rb +5 -2
- data/app/mailers/think_feel_do_engine/message_notifications.rb +1 -0
- data/app/mailers/think_feel_do_engine/site_message_mailer.rb +3 -1
- data/app/models/ability.rb +1 -0
- data/app/models/activity.rb +21 -10
- data/app/models/activity_type.rb +1 -0
- data/app/models/arm.rb +2 -2
- data/app/models/arm_validator.rb +3 -1
- data/app/models/available_content_module.rb +6 -2
- data/app/models/awake_period.rb +1 -0
- data/app/models/bit_core/slide_observer.rb +1 -0
- data/app/models/coach_assignment.rb +1 -0
- data/app/models/concerns/accessibility.rb +1 -0
- data/app/models/concerns/copier.rb +25 -17
- data/app/models/content_modules/lesson_module.rb +6 -5
- data/app/models/content_modules.rb +3 -2
- data/app/models/content_provider_decorator.rb +1 -0
- data/app/models/content_provider_policy.rb +1 -0
- data/app/models/content_providers/accomplished_activity_index_provider.rb +1 -0
- data/app/models/content_providers/activity_index_provider.rb +1 -0
- data/app/models/content_providers/augmented_thoughts_table_provider.rb +1 -0
- data/app/models/content_providers/awake_period_form.rb +1 -0
- data/app/models/content_providers/create_activity.rb +4 -3
- data/app/models/content_providers/edit_past_feel_provider.rb +1 -0
- data/app/models/content_providers/evaluate_thoughts_provider.rb +1 -0
- data/app/models/content_providers/fun_activity_checklist.rb +5 -4
- data/app/models/content_providers/harmful_thoughts_edit_form_provider.rb +1 -0
- data/app/models/content_providers/helpful_thoughts_index_provider.rb +1 -0
- data/app/models/content_providers/important_activity_checklist.rb +5 -4
- data/app/models/content_providers/index_past_feel_provider.rb +1 -0
- data/app/models/content_providers/input_new_activity_form.rb +1 -0
- data/app/models/content_providers/learn_lessons_index_provider.rb +5 -4
- data/app/models/content_providers/messages_index_provider.rb +2 -1
- data/app/models/content_providers/module_index_provider.rb +1 -0
- data/app/models/content_providers/new_complete_thought_form_provider.rb +1 -0
- data/app/models/content_providers/new_current_emotion_provider.rb +1 -0
- data/app/models/content_providers/new_current_feel_provider.rb +1 -0
- data/app/models/content_providers/new_harmful_thought_form_provider.rb +1 -0
- data/app/models/content_providers/new_message_form_provider.rb +1 -0
- data/app/models/content_providers/new_past_feel_provider.rb +1 -0
- data/app/models/content_providers/new_thought_form_provider.rb +1 -0
- data/app/models/content_providers/new_thoughts_form_provider.rb +1 -0
- data/app/models/content_providers/past_activity_form.rb +1 -0
- data/app/models/content_providers/past_activity_review_form.rb +1 -0
- data/app/models/content_providers/past_due_activities_viz.rb +1 -0
- data/app/models/content_providers/pleasurable_activity_index_provider.rb +1 -0
- data/app/models/content_providers/previous_planned_activities_provider.rb +1 -0
- data/app/models/content_providers/random_slide_provider.rb +1 -0
- data/app/models/content_providers/show_message_provider.rb +5 -3
- data/app/models/content_providers/thought_patterns_index_provider.rb +1 -0
- data/app/models/content_providers/thoughts_distortion_viz_provider.rb +1 -0
- data/app/models/content_providers/thoughts_table_provider.rb +1 -0
- data/app/models/content_providers/unhelpful_thoughts_list_provider.rb +5 -2
- data/app/models/content_providers/unhelpful_thoughts_reflection_provider.rb +1 -0
- data/app/models/content_providers/unplanned_activity_form.rb +1 -0
- data/app/models/content_providers/your_activities_provider.rb +4 -2
- data/app/models/delivered_message.rb +3 -1
- data/app/models/emotion.rb +3 -2
- data/app/models/emotional_rating.rb +1 -0
- data/app/models/engagement.rb +1 -0
- data/app/models/group.rb +2 -1
- data/app/models/group_metrics/weekly_activities_count.rb +1 -0
- data/app/models/group_metrics/weekly_comments_count.rb +1 -0
- data/app/models/group_metrics/weekly_count.rb +1 -0
- data/app/models/group_metrics/weekly_goals_count.rb +1 -0
- data/app/models/group_metrics/weekly_likes_count.rb +1 -0
- data/app/models/group_metrics/weekly_logins_count.rb +1 -0
- data/app/models/group_metrics/weekly_on_the_mind_statements_count.rb +1 -0
- data/app/models/group_metrics/weekly_thoughts_count.rb +1 -0
- data/app/models/media_access_event.rb +1 -0
- data/app/models/membership.rb +5 -3
- data/app/models/message.rb +1 -0
- data/app/models/message_sms_notification.rb +3 -1
- data/app/models/mood.rb +3 -1
- data/app/models/participant.rb +2 -1
- data/app/models/participant_login_event.rb +1 -0
- data/app/models/participant_metrics/weekly_count.rb +1 -0
- data/app/models/participant_metrics/weekly_logins_count.rb +1 -0
- data/app/models/participant_token.rb +3 -2
- data/app/models/phq_assessment.rb +3 -0
- data/app/models/phq_stepping.rb +5 -4
- data/app/models/phq_stepping_assessment.rb +12 -13
- data/app/models/planned_activity.rb +1 -0
- data/app/models/roles/clinician.rb +1 -0
- data/app/models/roles/content_author.rb +1 -0
- data/app/models/roles/researcher.rb +1 -0
- data/app/models/site_message.rb +1 -0
- data/app/models/slideshow_anchor.rb +2 -1
- data/app/models/task.rb +3 -1
- data/app/models/task_status.rb +4 -2
- data/app/models/think_feel_do_engine/addressable.rb +1 -0
- data/app/models/think_feel_do_engine/concerns/validate_password.rb +1 -0
- data/app/models/think_feel_do_engine/password_validator.rb +3 -1
- data/app/models/think_feel_do_engine/reports/emotional_rating.rb +1 -0
- data/app/models/think_feel_do_engine/reports/event.rb +3 -2
- data/app/models/think_feel_do_engine/reports/lesson_module.rb +4 -3
- data/app/models/think_feel_do_engine/reports/lesson_slide_view.rb +1 -0
- data/app/models/think_feel_do_engine/reports/lesson_viewing.rb +9 -8
- data/app/models/think_feel_do_engine/reports/login.rb +1 -0
- data/app/models/think_feel_do_engine/reports/messaging.rb +2 -1
- data/app/models/think_feel_do_engine/reports/module_page_view.rb +1 -0
- data/app/models/think_feel_do_engine/reports/module_session.rb +6 -5
- data/app/models/think_feel_do_engine/reports/patient_activity.rb +1 -0
- data/app/models/think_feel_do_engine/reports/patient_thought.rb +2 -1
- data/app/models/think_feel_do_engine/reports/phq_assessment.rb +1 -0
- data/app/models/think_feel_do_engine/reports/reporter.rb +2 -1
- data/app/models/think_feel_do_engine/reports/site_session.rb +1 -0
- data/app/models/think_feel_do_engine/reports/task_completion.rb +3 -2
- data/app/models/think_feel_do_engine/reports/tool_access.rb +1 -0
- data/app/models/think_feel_do_engine/reports/tool_module.rb +1 -0
- data/app/models/think_feel_do_engine/reports/user_agent.rb +1 -0
- data/app/models/think_feel_do_engine/reports/video_session.rb +1 -0
- data/app/models/think_feel_do_engine/reports/wai_assessment.rb +1 -0
- data/app/models/thought.rb +4 -2
- data/app/models/thought_pattern.rb +1 -0
- data/app/models/tool_nav_item.rb +2 -1
- data/app/models/tools/home.rb +1 -0
- data/app/models/tools/learn.rb +1 -0
- data/app/models/tools/messages.rb +1 -0
- data/app/models/tools/think.rb +1 -0
- data/app/models/unplanned_activities.rb +2 -2
- data/app/models/user.rb +1 -0
- data/app/models/user_role.rb +2 -1
- data/app/models/values/accomplishment.rb +1 -0
- data/app/models/values/emotional_rating.rb +1 -0
- data/app/models/values/mood.rb +1 -0
- data/app/models/values/pleasure.rb +1 -0
- data/app/models/wai_assessment.rb +4 -1
- data/app/presenters/think_feel_do_engine/harmful_thought_viz_presenter.rb +1 -0
- data/app/presenters/think_feel_do_engine/lesson_event/completion_data_presenter.rb +1 -0
- data/app/presenters/think_feel_do_engine/media_access_event_presenter.rb +1 -0
- data/app/support/mood_and_emotion_visualization_service.rb +22 -25
- data/lib/think_feel_do_engine/engine.rb +1 -0
- data/lib/think_feel_do_engine/version.rb +2 -1
- data/lib/think_feel_do_engine.rb +1 -0
- metadata +20 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3b3775063e21d489dcf856ddef6e179cd34e8c2
|
4
|
+
data.tar.gz: 2ea4750cceba7cd1786b7c3c795dd2f1aaa3201e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12a9befe18ff9028e706a304f6723ae0569f76fb6e1ab5987bc5cc9d309e52383888aebff8b0bea25f87698a784aa2c2ac44209084e0ea1b2981197bd4686226
|
7
|
+
data.tar.gz: dc32b56ca3eb64cf1184f73cd9330db7daf4ec4b3eb2e108ffadf3724e6064044403018a75949886a8ae10cc0bb02b0bbe08abff26597c342adcbc1efc963312
|
data/Rakefile
CHANGED
@@ -15,8 +15,15 @@ load "#{git_tagger.gem_dir}/lib/tasks/deploy.rake"
|
|
15
15
|
require "rspec/core"
|
16
16
|
require "rspec/core/rake_task"
|
17
17
|
|
18
|
-
|
19
|
-
RSpec::Core::RakeTask.new(:
|
18
|
+
# Run all specs using transactional fixtures
|
19
|
+
RSpec::Core::RakeTask.new(:fixture_specs) do |t|
|
20
|
+
t.pattern = "spec/{models,controllers,helpers,mailers,presenters,requests,tasks,views}/{,/*/**}/*_spec.rb"
|
21
|
+
end
|
22
|
+
|
23
|
+
# Run all specs using Database Cleaner
|
24
|
+
RSpec::Core::RakeTask.new(:cleaner_specs) do |t|
|
25
|
+
t.pattern = "spec/{features}/{,/*/**}/*_spec.rb"
|
26
|
+
end
|
20
27
|
|
21
28
|
desc "Run all JS specs"
|
22
29
|
task :js_spec do
|
@@ -48,5 +55,6 @@ task :default do
|
|
48
55
|
Rake::Task["jshint"].invoke
|
49
56
|
Rake::Task["rubocop"].invoke
|
50
57
|
Rake::Task["js_spec"].invoke
|
51
|
-
Rake::Task["
|
58
|
+
Rake::Task["fixture_specs"].invoke
|
59
|
+
Rake::Task["cleaner_specs"].invoke
|
52
60
|
end
|
@@ -122,6 +122,7 @@
|
|
122
122
|
};
|
123
123
|
|
124
124
|
this.handleSubmitClick = function(e) {
|
125
|
+
$("#submit_activities").prop('disabled', true);
|
125
126
|
var shared_item_name;
|
126
127
|
|
127
128
|
if($(".activity_shared_item_true")[0]) {
|
@@ -139,7 +140,7 @@
|
|
139
140
|
if ($('.has-error').length === 0) {
|
140
141
|
$forms.submit();
|
141
142
|
}
|
142
|
-
|
143
|
+
$("#submit_activities").prop('disabled', false);
|
143
144
|
return false;
|
144
145
|
} else {
|
145
146
|
return _.each($forms, function (form, index, list) {
|
@@ -162,7 +163,7 @@
|
|
162
163
|
dataType: "script"
|
163
164
|
});
|
164
165
|
}
|
165
|
-
|
166
|
+
$("#submit_activities").prop('disabled', false);
|
166
167
|
return false;
|
167
168
|
});
|
168
169
|
}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require "cancancan"
|
2
3
|
|
3
4
|
module ThinkFeelDoEngine
|
@@ -62,12 +63,12 @@ module ThinkFeelDoEngine
|
|
62
63
|
# Called by last route matching unmatched routes. Raises an exception that
|
63
64
|
# is expected to be rescued.
|
64
65
|
def raise_not_found!
|
65
|
-
|
66
|
-
|
66
|
+
raise ActionController::RoutingError,
|
67
|
+
"No route matches #{params[:unmatched_route]}"
|
67
68
|
end
|
68
69
|
|
69
70
|
def render_not_found(_)
|
70
|
-
render file: "#{Rails.root}/public/404.html",
|
71
|
+
render file: "#{Rails.root}/public/404.html", status: 404
|
71
72
|
end
|
72
73
|
|
73
74
|
protected
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require_dependency "think_feel_do_engine/application_controller"
|
2
3
|
|
3
4
|
module ThinkFeelDoEngine
|
@@ -5,7 +6,7 @@ module ThinkFeelDoEngine
|
|
5
6
|
# Enables users to create, update, and delete modules
|
6
7
|
# These modules contain providers that display content to the participants
|
7
8
|
class ContentModulesController < ApplicationController
|
8
|
-
ARM_NOT_FOUND_MESSAGE = "Unable to find that arm."
|
9
|
+
ARM_NOT_FOUND_MESSAGE = "Unable to find that arm."
|
9
10
|
before_action :authenticate_user!, :set_arm, :set_tools
|
10
11
|
before_action :set_content_module, only: [:show, :edit, :update, :destroy]
|
11
12
|
load_and_authorize_resource only: [:show, :edit, :update, :destroy]
|
@@ -71,14 +72,14 @@ module ThinkFeelDoEngine
|
|
71
72
|
BitCore::ContentModule.transaction do
|
72
73
|
ids = @content_module.content_provider_ids
|
73
74
|
ContentProviderPolicy.where(bit_core_content_provider_id: ids)
|
74
|
-
|
75
|
+
.destroy_all
|
75
76
|
|
76
77
|
if tasks_destroyed
|
77
78
|
@content_module.destroy!
|
78
79
|
|
79
80
|
true
|
80
81
|
else
|
81
|
-
|
82
|
+
raise ActiveRecord::Rollback
|
82
83
|
end
|
83
84
|
end
|
84
85
|
rescue
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require_dependency "think_feel_do_engine/application_controller"
|
2
3
|
|
3
4
|
module ThinkFeelDoEngine
|
@@ -81,7 +82,7 @@ module ThinkFeelDoEngine
|
|
81
82
|
else
|
82
83
|
redirect_to arm_bit_maker_content_providers_url(@arm),
|
83
84
|
alert: "Unable to delete ContentProvider " +
|
84
|
-
|
85
|
+
model_errors
|
85
86
|
end
|
86
87
|
end
|
87
88
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require_dependency "think_feel_do_engine/application_controller"
|
2
3
|
|
3
4
|
module ThinkFeelDoEngine
|
@@ -42,7 +43,8 @@ module ThinkFeelDoEngine
|
|
42
43
|
position: FIRST_SLIDE_POSITION,
|
43
44
|
title: "Table of Contents",
|
44
45
|
is_title_visible: true,
|
45
|
-
body: ""
|
46
|
+
body: ""
|
47
|
+
)
|
46
48
|
authorize! :create, @slide
|
47
49
|
|
48
50
|
if @slide.save
|
@@ -63,11 +65,11 @@ module ThinkFeelDoEngine
|
|
63
65
|
toc_decrement_slide_pos(@slideshow)
|
64
66
|
@slideshow.update(has_table_of_contents: false)
|
65
67
|
flash[:success] = "Table of contents deleted."
|
66
|
-
redirect_to arm_bit_maker_slideshow_path(@arm, @slide.slideshow)
|
67
68
|
else
|
68
69
|
flash[:error] = "There were errors."
|
69
|
-
redirect_to arm_bit_maker_slideshow_path(@arm, @slide.slideshow)
|
70
70
|
end
|
71
|
+
|
72
|
+
redirect_to arm_bit_maker_slideshow_path(@arm, @slide.slideshow)
|
71
73
|
end
|
72
74
|
|
73
75
|
def show
|
@@ -90,11 +92,11 @@ module ThinkFeelDoEngine
|
|
90
92
|
def destroy
|
91
93
|
if @slide.destroy
|
92
94
|
flash[:success] = "Slide deleted."
|
93
|
-
redirect_to arm_bit_maker_slideshow_path(@arm, @slide.slideshow)
|
94
95
|
else
|
95
96
|
flash[:error] = "There were errors."
|
96
|
-
redirect_to arm_bit_maker_slideshow_path(@arm, @slide.slideshow)
|
97
97
|
end
|
98
|
+
|
99
|
+
redirect_to arm_bit_maker_slideshow_path(@arm, @slide.slideshow)
|
98
100
|
end
|
99
101
|
|
100
102
|
def sort
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require_dependency "think_feel_do_engine/application_controller"
|
2
3
|
|
3
4
|
module ThinkFeelDoEngine
|
@@ -51,8 +52,8 @@ module ThinkFeelDoEngine
|
|
51
52
|
|
52
53
|
def anchor_params
|
53
54
|
params.require(:slideshow_anchor)
|
54
|
-
|
55
|
-
|
55
|
+
.permit(:target_name)
|
56
|
+
.merge(bit_core_slideshow_id: @slideshow.id)
|
56
57
|
end
|
57
58
|
|
58
59
|
def set_arm
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require_dependency "think_feel_do_engine/application_controller"
|
2
3
|
|
3
4
|
module ThinkFeelDoEngine
|
@@ -13,10 +14,12 @@ module ThinkFeelDoEngine
|
|
13
14
|
redirect_to coach_group_patient_dashboards_path(@group),
|
14
15
|
notice: "Participant was successfully stepped."
|
15
16
|
else
|
16
|
-
redirect_to
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
redirect_to(
|
18
|
+
coach_group_patient_dashboards_path(@group),
|
19
|
+
alert: @membership.errors.full_messages.join(", ") +
|
20
|
+
"End date cannot be set prior to tomorrow's date. "\
|
21
|
+
"Please use [Discontinue] or [Terminate Access]."
|
22
|
+
)
|
20
23
|
end
|
21
24
|
end
|
22
25
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require_dependency "think_feel_do_engine/application_controller"
|
2
3
|
|
3
4
|
module ThinkFeelDoEngine
|
@@ -25,7 +26,7 @@ module ThinkFeelDoEngine
|
|
25
26
|
|
26
27
|
@reply_recipient =
|
27
28
|
current_user.participants
|
28
|
-
|
29
|
+
.find(params[:recipient_id]) if params[:recipient_id]
|
29
30
|
|
30
31
|
render(
|
31
32
|
locals: {
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require_dependency "think_feel_do_engine/application_controller"
|
2
3
|
|
3
4
|
module ThinkFeelDoEngine
|
@@ -28,7 +29,7 @@ module ThinkFeelDoEngine
|
|
28
29
|
new_coach_group_message_path(
|
29
30
|
@group,
|
30
31
|
# This Message.class IS DeliveredMessage
|
31
|
-
body:
|
32
|
+
body: received_message.body,
|
32
33
|
message_id: received_message.id,
|
33
34
|
recipient_id: received_message.message.sender_id,
|
34
35
|
subject: "Reply: #{received_message.subject}"
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module ThinkFeelDoEngine
|
2
3
|
module Concerns
|
3
4
|
# Methods for browser type detection.
|
@@ -8,18 +9,18 @@ module ThinkFeelDoEngine
|
|
8
9
|
|
9
10
|
# See http://richonrails.com/articles/action-pack-variants-in-rails-4-1
|
10
11
|
def detect_browser
|
11
|
-
case request.user_agent
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
12
|
+
request.variant = case request.user_agent
|
13
|
+
when /iPad/i
|
14
|
+
:tablet
|
15
|
+
when /iPhone|Windows Phone/i
|
16
|
+
:phone
|
17
|
+
when /Android/i && /mobile/i
|
18
|
+
:phone
|
19
|
+
when /Android/i
|
20
|
+
:tablet
|
21
|
+
else
|
22
|
+
:desktop
|
23
|
+
end
|
23
24
|
end
|
24
25
|
end
|
25
26
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require_dependency "think_feel_do_engine/application_controller"
|
2
3
|
|
3
4
|
module ThinkFeelDoEngine
|
@@ -60,11 +61,11 @@ module ThinkFeelDoEngine
|
|
60
61
|
authorize! :update, ContentModules::LessonModule
|
61
62
|
if @lesson.sort(params[:slide])
|
62
63
|
flash.now[:success] = "Reorder was successful."
|
63
|
-
render nothing: true
|
64
64
|
else
|
65
65
|
flash.now[:alert] = @lesson.errors.full_messages.join(", ")
|
66
|
-
render nothing: true
|
67
66
|
end
|
67
|
+
|
68
|
+
render nothing: true
|
68
69
|
end
|
69
70
|
|
70
71
|
private
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require_dependency "think_feel_do_engine/application_controller"
|
2
3
|
|
3
4
|
module ThinkFeelDoEngine
|
@@ -11,7 +12,7 @@ module ThinkFeelDoEngine
|
|
11
12
|
def index
|
12
13
|
authorize! :index, ContentModules::LessonModule
|
13
14
|
@lessons = @lessons.includes(content_providers: :source_content)
|
14
|
-
|
15
|
+
.order(:position)
|
15
16
|
end
|
16
17
|
|
17
18
|
def all_content
|
@@ -87,11 +88,11 @@ module ThinkFeelDoEngine
|
|
87
88
|
|
88
89
|
if ContentModules::LessonModule.sort(@arm.id, params[:lesson])
|
89
90
|
flash.now[:success] = "Reorder was successful."
|
90
|
-
render nothing: true
|
91
91
|
else
|
92
92
|
flash.now[:alert] = "Error while sorting."
|
93
|
-
render nothing: true
|
94
93
|
end
|
94
|
+
|
95
|
+
render nothing: true
|
95
96
|
end
|
96
97
|
|
97
98
|
private
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require_dependency "think_feel_do_engine/application_controller"
|
2
3
|
|
3
4
|
module ThinkFeelDoEngine
|
@@ -14,8 +15,8 @@ module ThinkFeelDoEngine
|
|
14
15
|
|
15
16
|
def edit_tasks
|
16
17
|
@group = @arm.groups
|
17
|
-
|
18
|
-
|
18
|
+
.includes(tasks: { bit_core_content_module: :tool })
|
19
|
+
.find(params[:id])
|
19
20
|
authorize! :update, @group
|
20
21
|
@task = current_user.tasks.build
|
21
22
|
@content_modules = BitCore::ContentModule
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require "devise"
|
2
3
|
require_dependency "think_feel_do_engine/application_controller"
|
3
4
|
|
@@ -47,7 +48,8 @@ module ThinkFeelDoEngine
|
|
47
48
|
module_id: @navigator.current_module.try(:id),
|
48
49
|
provider_id: @navigator.current_content_provider
|
49
50
|
.try(:id),
|
50
|
-
content_position: @navigator.content_position
|
51
|
+
content_position: @navigator.content_position
|
52
|
+
)
|
51
53
|
else
|
52
54
|
next_content_not_found
|
53
55
|
end
|
@@ -122,7 +124,8 @@ module ThinkFeelDoEngine
|
|
122
124
|
def mark_engagement_completed
|
123
125
|
if navigator_content_module && last_engagement &&
|
124
126
|
!@navigator.current_content_provider.exists?(
|
125
|
-
@navigator.content_position + 1
|
127
|
+
@navigator.content_position + 1
|
128
|
+
)
|
126
129
|
last_engagement.update_attributes(completed_at: DateTime.current)
|
127
130
|
end
|
128
131
|
end
|
@@ -151,8 +154,8 @@ module ThinkFeelDoEngine
|
|
151
154
|
|
152
155
|
def home_tool
|
153
156
|
current_participant.current_group
|
154
|
-
|
155
|
-
|
157
|
+
.arm
|
158
|
+
.bit_core_tools.find_by_type("Tools::Home")
|
156
159
|
end
|
157
160
|
|
158
161
|
def next_content_not_found
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require_dependency "think_feel_do_engine/application_controller"
|
2
3
|
|
3
4
|
module ThinkFeelDoEngine
|
@@ -54,7 +55,7 @@ module ThinkFeelDoEngine
|
|
54
55
|
|
55
56
|
def singular_association
|
56
57
|
unless provider.data_class_name
|
57
|
-
|
58
|
+
raise "Sorry, unable to process your request. Please try again."
|
58
59
|
end
|
59
60
|
|
60
61
|
@singular_association ||= provider.data_class_name.underscore
|
@@ -78,7 +79,7 @@ module ThinkFeelDoEngine
|
|
78
79
|
render template: "think_feel_do_engine/navigator/show_content"
|
79
80
|
end
|
80
81
|
format.js { render status: 400 }
|
81
|
-
format.json
|
82
|
+
format.json { render json: { status: "error" } }
|
82
83
|
end
|
83
84
|
end
|
84
85
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require_dependency "think_feel_do_engine/application_controller"
|
2
3
|
|
3
4
|
module ThinkFeelDoEngine
|
@@ -17,14 +18,12 @@ module ThinkFeelDoEngine
|
|
17
18
|
def update
|
18
19
|
if @activity.update_as_reviewed(activity_params_for_update)
|
19
20
|
flash[:notice] = "Activity updated."
|
20
|
-
respond_to do |format|
|
21
|
-
format.js { render inline: "Turbolinks.visit(window.location);" }
|
22
|
-
end
|
23
21
|
else
|
24
22
|
flash[:alert] = @activity.errors.full_messages.join(", ")
|
25
|
-
|
26
|
-
|
27
|
-
|
23
|
+
end
|
24
|
+
|
25
|
+
respond_to do |format|
|
26
|
+
format.js { render inline: "Turbolinks.visit(window.location);" }
|
28
27
|
end
|
29
28
|
end
|
30
29
|
|
@@ -37,11 +36,9 @@ module ThinkFeelDoEngine
|
|
37
36
|
|
38
37
|
def activity_params
|
39
38
|
params.require(:activities)
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
])
|
44
|
-
.fetch(activity_id)
|
39
|
+
.permit(activity_id => [:actual_pleasure_intensity,
|
40
|
+
:actual_accomplishment_intensity])
|
41
|
+
.fetch(activity_id)
|
45
42
|
end
|
46
43
|
# ...
|
47
44
|
|
@@ -1,10 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require_dependency "think_feel_do_engine/application_controller"
|
2
3
|
|
3
4
|
module ThinkFeelDoEngine
|
4
5
|
module Participants
|
5
6
|
# Authorizes and manages Assessment administration.
|
6
7
|
class AssessmentsController < ApplicationController
|
7
|
-
ASSESSMENT_TYPES = { phq9: PhqAssessment, wai: WaiAssessment }
|
8
|
+
ASSESSMENT_TYPES = { phq9: PhqAssessment, wai: WaiAssessment }.freeze
|
8
9
|
|
9
10
|
before_action :authorize_token
|
10
11
|
|
@@ -77,8 +78,8 @@ module ThinkFeelDoEngine
|
|
77
78
|
def available_token
|
78
79
|
@available_token ||= @token.others_on_this_day.to_a.find do |token|
|
79
80
|
!assessment_class(token.token_type)
|
80
|
-
|
81
|
-
|
81
|
+
.exists?(participant_id: token.participant_id,
|
82
|
+
release_date: token.release_date)
|
82
83
|
end
|
83
84
|
end
|
84
85
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require_dependency "think_feel_do_engine/application_controller"
|
2
3
|
|
3
4
|
module ThinkFeelDoEngine
|
@@ -35,9 +36,8 @@ module ThinkFeelDoEngine
|
|
35
36
|
|
36
37
|
def media_access_event_params
|
37
38
|
params.require(:media_access_event)
|
38
|
-
|
39
|
-
|
40
|
-
])
|
39
|
+
.permit([:media_type, :bit_core_slide_id, :media_link, :end_time,
|
40
|
+
:id])
|
41
41
|
end
|
42
42
|
end
|
43
43
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require_dependency "think_feel_do_engine/application_controller"
|
2
3
|
|
3
4
|
module ThinkFeelDoEngine
|
@@ -8,8 +9,8 @@ module ThinkFeelDoEngine
|
|
8
9
|
@slideshow = BitCore::Slideshow.find(params[:slideshow_id])
|
9
10
|
@slide = @slideshow.slides.find(params[:id])
|
10
11
|
|
11
|
-
|
12
|
-
|
12
|
+
rescue ActiveRecord::RecordNotFound => e
|
13
|
+
redirect_to new_participant_session_path, alert: e.message
|
13
14
|
end
|
14
15
|
end
|
15
16
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require_dependency "think_feel_do_engine/application_controller"
|
2
3
|
|
3
4
|
module ThinkFeelDoEngine
|
@@ -19,11 +20,9 @@ module ThinkFeelDoEngine
|
|
19
20
|
|
20
21
|
def thought_params
|
21
22
|
params.require(:thoughts)
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
])
|
26
|
-
.fetch(thought_id)
|
23
|
+
.permit(thought_id => [:content, :effect, :pattern_id,
|
24
|
+
:challenging_thought, :act_as_if])
|
25
|
+
.fetch(thought_id)
|
27
26
|
end
|
28
27
|
end
|
29
28
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require_dependency "think_feel_do_engine/application_controller"
|
2
3
|
|
3
4
|
module ThinkFeelDoEngine
|
@@ -7,7 +8,8 @@ module ThinkFeelDoEngine
|
|
7
8
|
validator = PasswordValidator
|
8
9
|
.new(
|
9
10
|
password: params[:password],
|
10
|
-
password_token: params[:reset_password_token]
|
11
|
+
password_token: params[:reset_password_token]
|
12
|
+
)
|
11
13
|
render json: { bits: validator.entropy_value }
|
12
14
|
end
|
13
15
|
end
|