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

pulibrary / tigerdata-app / 756a0a0e-f51a-4bd1-91ab-2ac117b82d34

22 Nov 2025 01:36AM UTC coverage: 82.047% (-9.3%) from 91.317%
756a0a0e-f51a-4bd1-91ab-2ac117b82d34

Pull #2234

circleci

carolyncole
Close the custom storage div when a user chooses a preset option
fixes #2115
Pull Request #2234: Close the custom storage div when a user chooses a preset option

2605 of 3175 relevant lines covered (82.05%)

389.8 hits per line

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

100.0
/app/models/mediaflux/project_user_add_request.rb
1
# frozen_string_literal: true
2
module Mediaflux
2✔
3
  class ProjectUserAddRequest < Request
2✔
4
    attr_reader :project, :project_metadata
2✔
5

6
    # Constructor
7
    # @param session_token [String] the API token for the authenticated session
8
    # @param project [Project] project to be created in Mediaflux
9
    def initialize(session_token:, project:)
2✔
10
      super(session_token: session_token)
25✔
11
      @project = project
25✔
12
      @id = @project.mediaflux_id
25✔
13
      @xml_namespace = self.class.default_xml_namespace
25✔
14
      @xml_namespace_uri = self.class.default_xml_namespace_uri
25✔
15

16
      @all_data_users = @project.metadata_model.ro_users + @project.metadata_model.rw_users
25✔
17
      @ro_users = @project.metadata_model.ro_users
25✔
18
      @rw_users = @project.metadata_model.rw_users
25✔
19
    end
20

21
    # Specifies the Mediaflux service to use when updating assets
22
    # @return [String]
23
    def self.service
2✔
24
      "tigerdata.project.user.add"
50✔
25
    end
26

27
    # Returns the entire response returned by the project create service.
28
    # This includes debug information that is useful to troubleshoot issues
29
    # if the request fails.
30
    def debug_output
2✔
31
      response_xml.xpath("response/reply/result/result").to_s
25✔
32
    end
33

34
    private
2✔
35

36
      # rubocop:disable Metrics/MethodLength
37
      # rubocop:disable Metrics/AbcSize
38
      # rubocop:disable Metrics/BlockLength
39
      #
40
      # This is what the call would look like from aterm:
41
      # tigerdata.project.user.add \
42
      #   :id 1234 \
43
      #   :data-user "md1908" \
44
      #
45
      # OR FOR MULTIPLE USERS:
46
      # tigerdata.project.user.add \
47
      #   :id 1234 \
48
      #   :data-user "md1908" \
49
      #   :data-user "md1909" \
50
      #   :data-user "md1910" \
51
      #
52
      def build_http_request_body(name:)
2✔
53
        super do |xml|
50✔
54
          xml.args do
50✔
55
            xml.id @id
50✔
56
            # send each user in the list
57
            @ro_users.each do |user|
50✔
58
              xml.send("data-user") do
48✔
59
                xml.parent.set_attribute("readonly", "true")
48✔
60
                xml.text(user)
48✔
61
              end
62
            end
63
            @rw_users.each do |user|
50✔
64
              xml.send("data-user") do
2✔
65
                xml.parent.set_attribute("readonly", "false")
2✔
66
                xml.text(user)
2✔
67
              end
68
            end
69
          end
70
        end
71
      end
72
    # rubocop:enable Metrics/AbcSize
73
    # rubocop:enable Metrics/MethodLength
74
    # rubocop:enable Metrics/BlockLength
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