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

pulibrary / tigerdata-app / 0fa44f37-9401-471e-84d4-efbabcf424ab

22 Oct 2025 02:10PM UTC coverage: 91.212% (+0.2%) from 91.051%
0fa44f37-9401-471e-84d4-efbabcf424ab

push

circleci

web-flow
Getting rid of the New Project Wizard flipper (#2072)

3 of 4 new or added lines in 1 file covered. (75.0%)

794 existing lines in 41 files now uncovered.

2740 of 3004 relevant lines covered (91.21%)

751.91 hits per line

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

100.0
/app/presenters/project_dashboard_presenter.rb
1
# frozen_string_literal: true
UNCOV
2
class ProjectDashboardPresenter < ProjectShowPresenter
3✔
UNCOV
3
  include ActionView::Helpers::DateHelper
3✔
4

UNCOV
5
  delegate :to_model, :updated_at, to: :project
3✔
6

UNCOV
7
  delegate :data_sponsor, :data_manager, to: :project_metadata
3✔
8

UNCOV
9
  def type
3✔
UNCOV
10
    if storage_performance_expectations["approved"].nil?
356✔
UNCOV
11
      "Requested #{storage_performance_expectations['requested']}"
6✔
UNCOV
12
    else
UNCOV
13
      storage_performance_expectations["approved"]
350✔
UNCOV
14
    end
UNCOV
15
  end
16

UNCOV
17
  def latest_file_list_time
3✔
UNCOV
18
    requests = FileInventoryRequest.where(project_id: project.id).order(completion_time: :desc)
358✔
UNCOV
19
    if requests.empty?
358✔
UNCOV
20
      "No Downloads"
350✔
UNCOV
21
    elsif requests.first.completion_time
8✔
UNCOV
22
      "Prepared #{time_ago_in_words(requests.first.completion_time)} ago"
6✔
UNCOV
23
    else
UNCOV
24
      "Preparing now"
2✔
UNCOV
25
    end
UNCOV
26
  end
27

UNCOV
28
  def last_activity
3✔
UNCOV
29
    if project_metadata.updated_on.nil?
354✔
30
      "Not yet active"
8✔
UNCOV
31
    else
UNCOV
32
      "#{remove_about time_ago_in_words(project_metadata.updated_on)} ago"
346✔
UNCOV
33
    end
UNCOV
34
  end
35

UNCOV
36
  def role(user)
3✔
37
    if data_sponsor == user.uid
352✔
38
      "Sponsor"
100✔
39
    elsif data_manager == user.uid
252✔
40
      "Data Manager"
88✔
UNCOV
41
    else
42
      "Data User"
164✔
UNCOV
43
    end
UNCOV
44
  end
45

46
  # Removes "about" (as in "about 1 month ago") from time_ago_in_words
UNCOV
47
  def remove_about(time_ago)
3✔
UNCOV
48
    time_ago.gsub("about ", "")
346✔
UNCOV
49
  end
UNCOV
50
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