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

pulibrary / tigerdata-app / 8306569a-4f72-444d-ba8a-d69ed227106c

05 Nov 2025 07:43PM UTC coverage: 91.527% (+0.03%) from 91.5%
8306569a-4f72-444d-ba8a-d69ed227106c

push

circleci

web-flow
Set the displayed value to the entire name (#2151)

Centralize the view and javascript for data manager and sponsor
Set the displayed value to the entire name and have a hidden field with
the uid

fix spec error "not to search for nil"
<img width="1707" height="1085" alt="Screenshot 2025-11-05 at 2 38
43 PM"
src="https://github.com/user-attachments/assets/82278712-d16d-4b58-8b9c-5c33587a7810"
/>

6 of 10 new or added lines in 1 file covered. (60.0%)

1010 existing lines in 37 files now uncovered.

2841 of 3104 relevant lines covered (91.53%)

792.96 hits per line

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

100.0
/app/operations/project_search.rb
UNCOV
1
class ProjectSearch < Dry::Operation
3✔
UNCOV
2
    def call(search_string:, requestor:, field_name: "Title")
3✔
UNCOV
3
        verified_search_string = step verify_search_string(search_string)
26✔
UNCOV
4
        result_ids = step query_mediaflux(search_string: verified_search_string, requestor:, field_name:)
24✔
UNCOV
5
        step convert_results(result_ids)
22✔
UNCOV
6
    end
7

UNCOV
8
    private
3✔
9

UNCOV
10
    def verify_search_string(search_string)
3✔
11
        # An empty search does not make sense
UNCOV
12
        if search_string.blank?
26✔
UNCOV
13
            Failure("Search String cannot be empty")
2✔
14
        # Assuming there may be more verifications in the future
UNCOV
15
        else
UNCOV
16
            Success(search_string)
24✔
UNCOV
17
        end
UNCOV
18
    end
19

UNCOV
20
    def query_mediaflux(search_string:, requestor:, field_name:)
3✔
UNCOV
21
      query = mediaflux_query(search_string:, requestor:, field_name:)
24✔
UNCOV
22
      if query.error?
24✔
UNCOV
23
        Failure("Error querying mediaflux: #{query.response_error[:message]}")
2✔
UNCOV
24
      else
UNCOV
25
        result_ids = query.result_items.map{|result| result[:id]}
47✔
UNCOV
26
        Success(result_ids)
22✔
UNCOV
27
      end
UNCOV
28
    end
29

UNCOV
30
    def mediaflux_query(search_string:, requestor:, field_name:)
3✔
UNCOV
31
      aql_query = "xpath(tigerdata:project/#{field_name}) matches ignore-case '#{search_string}'"
24✔
UNCOV
32
      Mediaflux::QueryRequest.new(session_token: requestor.mediaflux_session, aql_query: , iterator: false )
24✔
UNCOV
33
    end
34

35

UNCOV
36
    def convert_results(result_ids)
3✔
UNCOV
37
        errors = []
22✔
UNCOV
38
        projects = result_ids.map do |mediaflux_id|
22✔
UNCOV
39
          project = Project.find_by(mediaflux_id: )
25✔
UNCOV
40
          if project.blank?
25✔
UNCOV
41
            errors << mediaflux_id
2✔
UNCOV
42
          end
UNCOV
43
          project
25✔
UNCOV
44
        end
UNCOV
45
        if errors.count > 0
22✔
UNCOV
46
          Failure("The following Mediaflux Projects were not found in the Rails database: #{errors.join(', ')}")
2✔
UNCOV
47
        else
UNCOV
48
          Success(projects)
20✔
UNCOV
49
        end
UNCOV
50
    end
UNCOV
51
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