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

pulibrary / tigerdata-app / 7291b10e-eaa3-4284-9371-5a980ceebf59

24 Nov 2025 07:18PM UTC coverage: 87.613% (-3.7%) from 91.333%
7291b10e-eaa3-4284-9371-5a980ceebf59

push

circleci

web-flow
Adds breadcrumb to Wizard (#2231)

Adds the breadcrumb to the Wizard and the functionality to allow the
user to save their changes before leaving the Wizard when clicking on
the "Dashboard" link in the breadcrumbs.

Closes #2102

5 of 12 new or added lines in 11 files covered. (41.67%)

904 existing lines in 36 files now uncovered.

2801 of 3197 relevant lines covered (87.61%)

360.23 hits per line

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

97.67
/app/models/mediaflux/query_request.rb
1
# frozen_string_literal: true
2
module Mediaflux
3✔
3
  class QueryRequest < Request
3✔
4
    attr_reader :aql_query, :collection, :action, :deep_search, :iterator
3✔
5

6
    # Constructor
7
    # @param session_token [String] the API token for the authenticated session
8
    # @param aql_query [String] Optional AQL query string
9
    # @param collection [Integer] Optional collection id
10
    # @param action [String] Optional, by default it uses get-name but it could also be get-meta to get all
11
    #                        the fields for the assets or `get-values` to get a limited list of fields.
12
    # @param deep_search [Bool] Optional, false by default. When true queries the collection and it subcollections.
13
    # @param iterator [Bool] Optional, true by default. When true returns an iterator.  When false returns a list of results
14
    def initialize(session_token:, aql_query: nil, collection: nil, action: "get-values", deep_search: false, iterator: true)
3✔
15
      super(session_token: session_token)
35✔
16
      @aql_query = aql_query
35✔
17
      @collection = collection
35✔
18
      @action = action
35✔
19
      @deep_search = deep_search
35✔
20
      @iterator = iterator
35✔
21
    end
22

23
    # Specifies the Mediaflux service to use when running a query
24
    # @return [String]
25
    def self.service
3✔
26
      "asset.query"
70✔
27
    end
28

29
    # Returns the iterator that could be used to fetch the data
30
    def result
3✔
31
      xml = response_xml
23✔
32
      xml.xpath("/response/reply/result/iterator").text.to_i
23✔
33
    end
34

35
    def result_items
3✔
UNCOV
36
      xml = response_xml
11✔
UNCOV
37
      xml.xpath("/response/reply/result").children.map do |node|
11✔
38
        {
UNCOV
39
          id: node.xpath("./@id").text,
33✔
40
          name: node.xpath("./name").text,
41
          path: node.xpath("./path").text
42
        }
43
      end
44
    end
45

46
    private
3✔
47

48
      def build_http_request_body(name:)
3✔
49
        super do |xml|
70✔
50
          xml.args do
70✔
51
            # TODO: there is a bug in mediaflux that does not allow the comented out line to paginate
52
            #      For the moment we will utilize the where clasue that does allow pagination
53
            # xml.collection collection if collection.present?
54
            if collection.present?
70✔
55
              xml.where mf_where(collection)
38✔
56
            end
57
            xml.where aql_query if aql_query.present?
70✔
58
            xml.action action if action.present?
70✔
59
            declare_get_values_fields(xml) if action == "get-values"
70✔
60
            xml.as "iterator" if iterator
70✔
61
          end
62
        end
63
      end
64

65
      def mf_where(collection)
3✔
66
        if deep_search
38✔
67
          "asset in static collection or subcollection of #{collection}"
38✔
68
        else
69
          "asset in collection #{collection}"
×
70
        end
71
      end
72

73
      # Adds the declarations to fetch specific fields
74
      def declare_get_values_fields(xml)
3✔
75
        declare_get_value_field(xml, "name", "name")
68✔
76
        declare_get_value_field(xml, "path", "path")
68✔
77
        declare_get_value_field(xml, "content/@total-size", "total-size")
68✔
78
        declare_get_value_field(xml, "mtime", "mtime")
68✔
79
        declare_get_value_field(xml, "@collection", "collection")
68✔
80
      end
81

82
      # Adds a single field declaration
83
      def declare_get_value_field(xml, field_xpath, field_name)
3✔
84
        xml.xpath do
340✔
85
          xml.parent.set_attribute("ename", field_name)
340✔
86
          xml.text(field_xpath)
340✔
87
        end
88
      end
89
  end
90
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