redmine_remotes 0.8.2 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/remote_tracker.rb +2 -8
- data/app/models/remote_tracker/remote.rb +19 -0
- data/config/locales/en.yml +2 -0
- data/config/locales/pt-BR.yml +2 -0
- data/lib/redmine_remotes/esosti/entities/issue.rb +43 -0
- data/lib/redmine_remotes/esosti/instance.rb +26 -0
- data/lib/redmine_remotes/version.rb +1 -1
- metadata +5 -3
- data/app/models/remote_tracker/jira.rb +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d3b9ae54d882f36e34f1ff7a0e76d75f8bf601730101584fc0ee6bd3026ae59
|
4
|
+
data.tar.gz: dada38afebcf9b89d454a7163b637b658834178561d48260aff831c507a6337d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 335421b0f747cc7db893a74e7c351760cafb4d9a360473abbc7f362e0b6b6be663f87ef801738b72d32a59a3b107d7816a09aaf3036c506d55b6a79bca6d2e74
|
7
|
+
data.tar.gz: 3ebc5ee52fc4a9dd4b7ee67b3cb3ffbeb65bee168a86a9533a376643a4d16647c0798a9ecd1e2608fdc7ac6935a6cfc346eade934db098e26195e54f4a801c27
|
@@ -6,14 +6,14 @@ require 'validate_url'
|
|
6
6
|
|
7
7
|
class RemoteTracker < ActiveRecord::Base
|
8
8
|
include ::EacRubyUtils::Listable
|
9
|
-
include ::RemoteTracker::
|
9
|
+
include ::RemoteTracker::Remote
|
10
10
|
|
11
11
|
has_many :issues, class_name: 'RemoteIssue', inverse_of: :remote_tracker,
|
12
12
|
dependent: :restrict_with_error
|
13
13
|
has_many :settings, class_name: 'RemoteTrackerSetting', inverse_of: :remote_tracker,
|
14
14
|
dependent: :destroy
|
15
15
|
|
16
|
-
lists.add_string :profile, :jira
|
16
|
+
lists.add_string :profile, :esosti, :jira
|
17
17
|
|
18
18
|
has_many :issue_statuses, class_name: 'RemoteIssueStatus', inverse_of: :remote_tracker,
|
19
19
|
dependent: :destroy
|
@@ -31,12 +31,6 @@ class RemoteTracker < ActiveRecord::Base
|
|
31
31
|
"#{root_url} [#{profile_label}, #{username}]"
|
32
32
|
end
|
33
33
|
|
34
|
-
def find_remote_issue(issue_id)
|
35
|
-
raise 'Profile blank' if profile.blank?
|
36
|
-
|
37
|
-
send("#{profile}_find_remote_issue", issue_id)
|
38
|
-
end
|
39
|
-
|
40
34
|
def setting_value(name)
|
41
35
|
::RemoteTrackerSetting.where(remote_tracker: self, name: name).first.if_present(&:value)
|
42
36
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class RemoteTracker < ActiveRecord::Base
|
4
|
+
module Remote
|
5
|
+
def find_remote_issue(issue_id)
|
6
|
+
remote_instance.find_issue(issue_id)
|
7
|
+
end
|
8
|
+
|
9
|
+
def remote_instance
|
10
|
+
remote_instance_class.new(self, root_url, username, password)
|
11
|
+
end
|
12
|
+
|
13
|
+
def remote_instance_class
|
14
|
+
raise 'Profile blank' if profile.blank?
|
15
|
+
|
16
|
+
::RedmineRemotes.const_get(profile.capitalize).const_get('Instance')
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/config/locales/en.yml
CHANGED
data/config/locales/pt-BR.yml
CHANGED
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avmtrf1/esosti/entities/issue'
|
4
|
+
|
5
|
+
module RedmineRemotes
|
6
|
+
module Esosti
|
7
|
+
module Entities
|
8
|
+
class Issue < ::Avmtrf1::Esosti::Entities::Issue
|
9
|
+
def author_login
|
10
|
+
attributes.fetch('CREATEDBY').if_present { |v| v.gsub(/@[^@]+\z/, '') }
|
11
|
+
end
|
12
|
+
|
13
|
+
def attributes
|
14
|
+
data.first.fetch('Attributes')
|
15
|
+
end
|
16
|
+
|
17
|
+
def code
|
18
|
+
attributes.fetch('TICKETID')
|
19
|
+
end
|
20
|
+
|
21
|
+
def created_on
|
22
|
+
attributes.fetch('CREATIONDATE')
|
23
|
+
end
|
24
|
+
|
25
|
+
def description
|
26
|
+
related_mbos.fetch('LONGDESCRIPTION').first.fetch('Attributes').fetch('LDTEXT')
|
27
|
+
end
|
28
|
+
|
29
|
+
def related_mbos
|
30
|
+
data.first.fetch('RelatedMbos')
|
31
|
+
end
|
32
|
+
|
33
|
+
def status_name
|
34
|
+
attributes.fetch('STATUS')
|
35
|
+
end
|
36
|
+
|
37
|
+
def subject
|
38
|
+
attributes.fetch('DESCRIPTION')
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RedmineRemotes
|
4
|
+
module Esosti
|
5
|
+
class Instance < ::RedmineRemotes::RestProvider::Instance
|
6
|
+
ISSUE_ID_PATTERN = /\A(?:ss|in)[0-9]+\z/i.freeze
|
7
|
+
|
8
|
+
class << self
|
9
|
+
def parse_issue_id(global_issue_id)
|
10
|
+
m = ISSUE_ID_PATTERN.match(global_issue_id)
|
11
|
+
return nil unless m
|
12
|
+
|
13
|
+
::OpenStruct.new(provider_issue_id: m[0], project_id: nil, project_issue_id: nil)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def build_service_url(service_url_suffix)
|
18
|
+
"#{root_url}/maxrest/rest#{service_url_suffix}"
|
19
|
+
end
|
20
|
+
|
21
|
+
def issue_get_url_suffix(provider_issue_id)
|
22
|
+
"/os/MS_RMTICKET/?ticketid=#{provider_issue_id}"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redmine_remotes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eduardo Henrique Bogoni
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aranha-parsers
|
@@ -145,7 +145,7 @@ files:
|
|
145
145
|
- app/models/remote_issue.rb
|
146
146
|
- app/models/remote_issue_status.rb
|
147
147
|
- app/models/remote_tracker.rb
|
148
|
-
- app/models/remote_tracker/
|
148
|
+
- app/models/remote_tracker/remote.rb
|
149
149
|
- app/models/remote_tracker_setting.rb
|
150
150
|
- app/models/remote_user.rb
|
151
151
|
- app/views/project_remote_issues/_issues.html.erb
|
@@ -170,6 +170,8 @@ files:
|
|
170
170
|
- db/migrate/20200505161002_add_timestamps_to_remote_users.rb
|
171
171
|
- init.rb
|
172
172
|
- lib/redmine_remotes.rb
|
173
|
+
- lib/redmine_remotes/esosti/entities/issue.rb
|
174
|
+
- lib/redmine_remotes/esosti/instance.rb
|
173
175
|
- lib/redmine_remotes/jira/entities/issue.rb
|
174
176
|
- lib/redmine_remotes/jira/instance.rb
|
175
177
|
- lib/redmine_remotes/patches/issue.rb
|
@@ -1,13 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
class RemoteTracker < ActiveRecord::Base
|
4
|
-
module Jira
|
5
|
-
def jira_find_remote_issue(issue_id)
|
6
|
-
jira_create_instance.find_issue(issue_id)
|
7
|
-
end
|
8
|
-
|
9
|
-
def jira_create_instance
|
10
|
-
::RedmineRemotes::Jira::Instance.new(self, root_url, username, password)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|