think_feel_do_engine 3.15.7 → 3.16.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 82fd6931e56fd0ca02083d81c60d1dae7cc4a699
4
- data.tar.gz: 90ab4c007f486dc3219a5d4a88944754bc9a1c1d
3
+ metadata.gz: 34d63772ced14e7d7761f7ba2c12d9d0b8766fcf
4
+ data.tar.gz: 5c384494bf24e725d4bf70583710dee49256bb64
5
5
  SHA512:
6
- metadata.gz: f1d9d992f0955896f46e3a2af431fa0cf1403ba4765bea6138a442dc7f2c1b6319ca51323e8567d3d7bacfbf75e1ee0bc136c96fd1b3e3c609dea1392de2b17e
7
- data.tar.gz: c3199a97efa3e2a8823f543ec4a03015b796c85940400f44a92d938f327187679440a2edfed465125721f6ac0ec9ebdfb8063aec18fb52278fc43cce02b3d071
6
+ metadata.gz: 4e807caf2b79b77bf1328bcf4d20f4a315a9fc6f0bd9af28608f16b5e6186d3758f7614ff954ab99d8a1048ed2434c62bd88dd3e6f8c559b42fa117ff79bdd29
7
+ data.tar.gz: 5f8bee00a72e0799bd89f76fe74de0b747326c13b17ac4949daa5914295a179da126f9d8dc7f4b48f014f766ccc32558b0ac4043bdff6cf4e6d5232b097ee4f5
@@ -5,6 +5,7 @@ module ThinkFeelDoEngine
5
5
  # Present Participant Activities Visualization to the Coach.
6
6
  class ParticipantActivitiesVisualizationsController < ApplicationController
7
7
  before_action :authenticate_user!
8
+ rescue_from ActiveRecord::RecordNotFound, with: :record_not_found
8
9
 
9
10
  RenderOptions = Struct.new(
10
11
  :view_context, :app_context, :position, :participant
@@ -12,6 +13,7 @@ module ThinkFeelDoEngine
12
13
 
13
14
  def show
14
15
  @participant = Participant.find(params[:participant_id])
16
+ @group = @participant.groups.find(params[:group_id])
15
17
  provider = ContentProviders::YourActivitiesProvider.new
16
18
  options = RenderOptions.new(
17
19
  self,
@@ -21,6 +23,12 @@ module ThinkFeelDoEngine
21
23
  )
22
24
  provider.render_current(options)
23
25
  end
26
+
27
+ def record_not_found
28
+ redirect_to main_app.root_path,
29
+ alert: "The activities visualization you were "\
30
+ "looking does not exist."
31
+ end
24
32
  end
25
33
  end
26
34
  end
@@ -5,13 +5,21 @@ module ThinkFeelDoEngine
5
5
  # Present Participant Thoughts Visualization to the Coach.
6
6
  class ParticipantThoughtsVisualizationsController < ApplicationController
7
7
  before_action :authenticate_user!
8
+ rescue_from ActiveRecord::RecordNotFound, with: :record_not_found
8
9
 
9
10
  def show
10
11
  @participant = Participant.find(params[:participant_id])
12
+ @group = @participant.groups.find(params[:group_id])
11
13
  thoughts = @participant.thoughts.harmful
12
14
  render "think_feel_do_engine/thoughts/distortion_viz",
13
15
  locals: { thoughts: thoughts, link_to_view: nil }
14
16
  end
17
+
18
+ def record_not_found
19
+ redirect_to main_app.root_path,
20
+ alert: "The thoughts visualization you were "\
21
+ "looking does not exist."
22
+ end
15
23
  end
16
24
  end
17
25
  end
@@ -11,7 +11,7 @@ module ThinkFeelDoEngine
11
11
  return unless VISUALIZATION_CONTROLLERS.include?(controller_name)
12
12
 
13
13
  dashboard_path = coach_group_patient_dashboard_path(
14
- @participant.active_group,
14
+ @group,
15
15
  @participant
16
16
  )
17
17
 
@@ -10,10 +10,10 @@
10
10
  <li class="list-group-item"><a href="#logins-container">Logins</a></li>
11
11
  <li class="list-group-item"><a href="#lessons-container">Lessons</a></li>
12
12
  <li class="list-group-item"><a href="#media-access-container">Audio Access</a></li>
13
- <li class="list-group-item"><%= link_to "Activities visualization", coach_participant_activities_visualization_path(@participant) %></li>
13
+ <li class="list-group-item"><%= link_to "Activities visualization", coach_participant_activities_visualization_path(participant_id: @participant.id, group_id: @group.id) %></li>
14
14
  <li class="list-group-item"><a href="#activities-future-container">Activities - Future</a></li>
15
15
  <li class="list-group-item"><a href="#activities-past-container">Activities - Past</a></li>
16
- <li class="list-group-item"><%= link_to "Thoughts visualization", coach_participant_thoughts_visualization_path(@participant) %></li>
16
+ <li class="list-group-item"><%= link_to "Thoughts visualization", coach_participant_thoughts_visualization_path(participant_id: @participant.id, group_id: @group.id) %></li>
17
17
  <li class="list-group-item"><a href="#thoughts-container">Thoughts</a></li>
18
18
  <li class="list-group-item"><a href="#messages-container">Messages</a></li>
19
19
  <li class="list-group-item"><a href="#tasks-container">Tasks</a></li>
@@ -12,11 +12,11 @@
12
12
  <%= render "think_feel_do_engine/coach/patient_dashboards/tables/lessons_table" %>
13
13
  <%= render "think_feel_do_engine/coach/patient_dashboards/tables/audio_access_table" %>
14
14
 
15
- <h3><%= link_to "Activities visualization", coach_participant_activities_visualization_path(@participant) %></h3>
15
+ <h3><%= link_to "Activities visualization", coach_participant_activities_visualization_path(participant_id: @participant.id, group_id: @group.id) %></h3>
16
16
  <%= render "think_feel_do_engine/coach/patient_dashboards/tables/future_activities_table" %>
17
17
  <%= render "think_feel_do_engine/coach/patient_dashboards/tables/past_activities_table" %>
18
18
 
19
- <h3><%= link_to "Thoughts visualization", coach_participant_thoughts_visualization_path(@participant) %></h3>
19
+ <h3><%= link_to "Thoughts visualization", coach_participant_thoughts_visualization_path(participant_id: @participant.id, group_id: @group.id) %></h3>
20
20
  <%= render "think_feel_do_engine/coach/patient_dashboards/tables/thoughts_table" %>
21
21
 
22
22
  <%= render "think_feel_do_engine/coach/patient_dashboards/tables/messages_table" %>
data/config/routes.rb CHANGED
@@ -68,10 +68,10 @@ ThinkFeelDoEngine::Engine.routes.draw do
68
68
  resources :site_messages, only: [:index, :show, :new, :create]
69
69
  resources :memberships, only: :update
70
70
  end
71
- get "participant_activities_visualization/:participant_id",
71
+ get "participant_activities_visualization/:participant_id/group/:group_id",
72
72
  to: "participant_activities_visualizations#show",
73
73
  as: "participant_activities_visualization"
74
- get "participant_thoughts_visualization/:participant_id",
74
+ get "participant_thoughts_visualization/:participant_id/group/:group_id",
75
75
  to: "participant_thoughts_visualizations#show",
76
76
  as: "participant_thoughts_visualization"
77
77
  end
@@ -1,4 +1,4 @@
1
1
  # nodoc
2
2
  module ThinkFeelDoEngine
3
- VERSION = "3.15.7"
3
+ VERSION = "3.16.0"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: think_feel_do_engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.15.7
4
+ version: 3.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Carty-Fickes