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

pulibrary / tigerdata-app / 00980eb1-89cd-4642-8219-7966c9fc0920

05 Feb 2025 07:21PM UTC coverage: 84.171% (+0.04%) from 84.135%
00980eb1-89cd-4642-8219-7966c9fc0920

push

circleci

web-flow
Removing package-lock.json in order to resolve dependency conflicts (#1283)

4 of 4 branches covered (100.0%)

2345 of 2786 relevant lines covered (84.17%)

390.59 hits per line

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

76.6
/app/controllers/welcome_controller.rb
1
# frozen_string_literal: true
2
class WelcomeController < ApplicationController
1✔
3
  skip_before_action :authenticate_user!, except: [:styles_preview]
1✔
4
  skip_before_action :verify_authenticity_token
1✔
5

6
  def index # rubocop:disable Metrics/AbcSize
1✔
7
    if current_user.nil?
84✔
8
      render layout: "welcome"
8✔
9
      return
8✔
10
    end
11

12
    @pending_projects = Project.pending_projects.map { |project| ProjectDashboardPresenter.new(project) }
201✔
13
    @approved_projects = Project.approved_projects.map { |project| ProjectDashboardPresenter.new(project) }
81✔
14
    @eligible_data_user = true if !current_user.eligible_sponsor? && !current_user.eligible_manager?
76✔
15

16
    @dashboard_projects = Project.users_projects(@current_user).map { |project| ProjectDashboardPresenter.new(project) }
138✔
17

18
    @my_inventory_requests = current_user.user_requests.where(type: "FileInventoryRequest")
76✔
19
    @dash_session = "project"
76✔
20
    session[:dashtab] ||= @dash_session
76✔
21
    @dash_session = session[:dashtab]
76✔
22
    @session_id = current_user.mediaflux_session
76✔
23
    @emulation_role = session[:emulation_role] || "Not Emulating"
76✔
24
  end
25

26
  def emulate
1✔
27
    return if Rails.env.production?
4✔
28
    return if current_user.nil? || current_user.id.nil?
4✔
29

30
    absolute_user = User.find(current_user.id)
4✔
31
    return unless absolute_user.trainer?
4✔
32

33
    if params.key?("emulation_menu")
4✔
34
      session[:emulation_role] = params[:emulation_menu]
4✔
35
    end
36
  end
37

38
  def dash_classic
1✔
39
    return if current_user.nil? || current_user.id.nil?
×
40
    if params.key?("dashtab")
×
41
      session[:dashtab] = params[:dashtab]
×
42
    end
43
  end
44

45
  def dash_project
1✔
46
    return if current_user.nil? || current_user.id.nil?
×
47
    if params.key?("dashtab")
×
48
      session[:dashtab] = params[:dashtab]
×
49
    end
50
  end
51

52
  def dash_admin
1✔
53
    return if current_user.nil? || current_user.id.nil?
3✔
54
    if params.key?("dashtab")
3✔
55
      session[:dashtab] = params[:dashtab]
3✔
56
    end
57
  end
58

59
  def help
1✔
60
    # Piggybacking on this page to pass custom HTTP headers to Mediaflux
61
    # in a very controlled scenario.
62
    root_ns = Rails.configuration.mediaflux["api_root_collection_namespace"]
1✔
63
    parent_collection = Rails.configuration.mediaflux["api_root_collection_name"]
1✔
64
    @test_path = Pathname.new(root_ns).join(parent_collection)
1✔
65
    @test_http_headers = false
1✔
66
    unless current_user.nil?
1✔
67
      @test_http_headers = params["http-headers"] == "true"
×
68
      request = if @test_http_headers
×
69
                  Mediaflux::AssetExistRequest.new(session_token: current_user.mediaflux_session, path: @test_path, session_user: current_user)
×
70
                else
71
                  Mediaflux::AssetExistRequest.new(session_token: current_user.mediaflux_session, path: @test_path)
×
72
                end
73
      @test_path_exist = request.exist?
×
74
    end
75
  end
76
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

© 2025 Coveralls, Inc