• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pulibrary / tigerdata-app / 3e38a84e-4de6-458b-9255-50c2c34d151a

12 Dec 2025 04:35PM UTC coverage: 85.53% (-5.6%) from 91.135%
3e38a84e-4de6-458b-9255-50c2c34d151a

push

circleci

web-flow
Fixing widths via align-self stretch (#2302)

I wasn't able to make the wizard completely correct

## Before the blue-box change
<img width="1076" height="1013" alt="Screenshot 2025-12-12 at 10 07
38 AM"
src="https://github.com/user-attachments/assets/b991ab7b-b63c-48c5-a2fa-820f378f3415"
/>

## after blue-box change
<img width="1070" height="1214" alt="Screenshot 2025-12-12 at 9 59
40 AM"
src="https://github.com/user-attachments/assets/b31b891b-8873-4312-82e9-559e9db072a4"
/>

## before wizard changes
<img width="1074" height="1226" alt="Screenshot 2025-12-12 at 9 56
37 AM"
src="https://github.com/user-attachments/assets/77cede9a-29a1-42a3-9826-0d993b0fb98c"
/>


## after wizard changes
<img width="1078" height="1222" alt="Screenshot 2025-12-12 at 9 57
01 AM"
src="https://github.com/user-attachments/assets/94f262b8-1737-4e5c-8139-0a199260559c"
/>

2790 of 3262 relevant lines covered (85.53%)

467.73 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

76.74
/app/controllers/application_controller.rb
1
# frozen_string_literal: true
2
class ApplicationController < ActionController::Base
4✔
3
  protect_from_forgery with: :exception
4✔
4
  before_action :authenticate_user!
4✔
5
  before_action :mediaflux_session
4✔
6
  around_action :mediaflux_session_errors
4✔
7
  around_action :mediaflux_login_errors
4✔
8
  before_action :emulate_user
4✔
9
  before_action :downtime_check
4✔
10

11
  helper_method :breadcrumbs
4✔
12

13
  def new_session_path(_scope)
4✔
14
    new_user_session_path
×
15
  end
16

17
  def after_sign_in_path_for(_resource)
4✔
18
    mediaflux_passthru_path
1✔
19
    # "/users/#{@user.id}"
20
  end
21

22
  def require_admin_user
4✔
23
    head :forbidden unless current_user&.eligible_sysadmin?
4✔
24
  end
25

26
  def breadcrumbs
4✔
27
    @breadcrumbs ||= []
908✔
28
  end
29

30
  def add_breadcrumb(name, path = nil)
4✔
31
    breadcrumbs << Breadcrumb.new(name, path)
475✔
32
  end
33

34
  # Render a 404 page for any undefined route
35
  def render_not_found
4✔
36
    render file: Rails.public_path.join("404.html").to_s, layout: false, status: :not_found
1✔
37
  end
38

39
  private
4✔
40

41
    def mediaflux_session
4✔
42
      logger.debug "Application Session #{session[:mediaflux_session]} cas: #{session[:active_web_user]}"
489✔
43
      unless ["passthru", "cas"].include?(action_name)
489✔
44
        current_user&.mediaflux_from_session(session)
486✔
45
      end
46
    end
47

48
    def mediaflux_session_errors
4✔
49
      yield
489✔
50
    rescue ActionView::Template::Error, Mediaflux::SessionExpired => e
51
      raise unless e.is_a?(Mediaflux::SessionExpired) || e.cause.is_a?(Mediaflux::SessionExpired)
×
52
      if session[:active_web_user]
×
53
        redirect_to mediaflux_passthru_path(path: request.path)
×
54
      elsif session_error_handler
×
55
        retry
×
56
      else
57
        raise
×
58
      end
59
    end
60

61
    def mediaflux_login_errors
4✔
62
      yield
489✔
63
    rescue Mediaflux::SessionError
64
      if session_error_handler
×
65
        retry
×
66
      else
67
        raise
×
68
      end
69
    end
70

71
    def session_error_handler
4✔
72
      @retry_count ||= 0
×
73
      @retry_count += 1
×
74

75
      current_user.clear_mediaflux_session(session)
×
76
      current_user.mediaflux_from_session(session)
×
77
      @retry_count < 3 # If the session is expired we should not have to retry more than once, but let's have a little wiggle room
×
78
    end
79

80
    def emulate_user
4✔
81
      return if Rails.env.production?
489✔
82
      return if current_user.blank? || !current_user.trainer
475✔
83

84
      if session[:emulation_role]
34✔
85
        if session[:emulation_role] == "Eligible Data Sponsor"
14✔
86
          emulate_sponsor
3✔
87
        elsif session[:emulation_role] == "Eligible Data Manager"
11✔
88
          emulate_manager
3✔
89
        elsif session[:emulation_role] == "System Administrator"
8✔
90
          emulate_sysadmin
7✔
91
        elsif session[:emulation_role] == "Eligible Data User"
1✔
92
          emulate_data_user
1✔
93
        elsif session[:emulation_role] == "Return to Self"
×
94
          return_to_self
×
95
        end
96
      end
97
    end
98

99
    def emulate_sponsor
4✔
100
      current_user.eligible_sponsor = true
3✔
101
      current_user.eligible_manager = false
3✔
102
      current_user.sysadmin = false
3✔
103
    end
104

105
    def emulate_manager
4✔
106
      current_user.eligible_manager = true
3✔
107
      current_user.eligible_sponsor = false
3✔
108
      current_user.sysadmin = false
3✔
109
    end
110

111
    def emulate_sysadmin
4✔
112
      current_user.sysadmin = true
7✔
113
      current_user.eligible_manager = false
7✔
114
      current_user.eligible_sponsor = false
7✔
115
    end
116

117
    def emulate_data_user
4✔
118
      current_user.eligible_sponsor = false
1✔
119
      current_user.eligible_manager = false
1✔
120
      current_user.sysadmin = false
1✔
121
      current_user.trainer = false
1✔
122
    end
123

124
    def return_to_self
4✔
125
      current_user.eligible_sponsor = false
×
126
      current_user.eligible_manager = false
×
127
      current_user.sysadmin = false
×
128
    end
129

130
    def downtime_check(with_redirect: true)
4✔
131
      if Flipflop.disable_login?
459✔
132
        if current_user&.eligible_sysadmin?
6✔
133
          flash[:notice] = I18n.t(:only_sysadmin_users)
3✔
134
        else
135
          redirect_to root_path if with_redirect
3✔
136
          flash[:notice] = I18n.t(:no_login_currently)
3✔
137
        end
138
      end
139
    end
140
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc