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

pulibrary / tigerdata-app / 223c44ca-f7f8-4e47-9682-0458528b3d84

12 Dec 2024 04:11PM UTC coverage: 83.787% (-0.4%) from 84.159%
223c44ca-f7f8-4e47-9682-0458528b3d84

Pull #1119

circleci

carolyncole
Update to show actual expiration dates
also removed size since we have no way of calculating it now.
Pull Request #1119: "Recent Downloads" in the projects dashboard

4 of 4 branches covered (100.0%)

6 of 19 new or added lines in 3 files covered. (31.58%)

7 existing lines in 1 file now uncovered.

2248 of 2683 relevant lines covered (83.79%)

326.54 hits per line

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

70.83
/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
1✔
7
    return if current_user.nil?
59✔
8
    @pending_projects = Project.pending_projects.map { |project| ProjectDashboardPresenter.new(project) }
157✔
9
    @approved_projects = Project.approved_projects.map { |project| ProjectDashboardPresenter.new(project) }
59✔
10
    @eligible_data_user = true if !current_user.eligible_sponsor? && !current_user.eligible_manager?
54✔
11

12
    @dashboard_projects = Project.users_projects(@current_user).map { |project| ProjectDashboardPresenter.new(project) }
108✔
13

14
    @my_inventory_requests = current_user.user_requests.where(type: "FileInventoryRequest")
54✔
15
    @dash_session = "project"
54✔
16
    session[:dashtab] ||= @dash_session
54✔
17
    @dash_session = session[:dashtab]
54✔
18
    @session_id = current_user.mediaflux_session
54✔
19
  end
20

21
  def emulate
1✔
22
    return if Rails.env.production?
3✔
23
    return if current_user.nil? || current_user.id.nil?
3✔
24

25
    absolute_user = User.find(current_user.id)
3✔
26
    return unless absolute_user.trainer
3✔
27

28
    if params.key?("emulation_menu")
3✔
29
      session[:emulation_role] = params[:emulation_menu]
3✔
30
    end
31
  end
32

33
  def dash_classic
1✔
34
    return if current_user.nil? || current_user.id.nil?
×
35
    if params.key?("dashtab")
×
36
      session[:dashtab] = params[:dashtab]
×
37
    end
38
  end
39

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

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

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

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