redmine_remotes 0.15.3 → 0.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/remote_issue_statuses_controller.rb +14 -1
- data/app/models/remote_issue_status.rb +6 -0
- data/app/models/remote_tracker.rb +2 -1
- data/app/models/remote_user.rb +1 -1
- data/config/locales/en.yml +7 -0
- data/config/locales/pt-BR.yml +8 -1
- data/db/migrate/20190531171641_create_remote_trackers.rb +3 -1
- data/db/migrate/20190910182842_create_remote_users.rb +3 -1
- data/db/migrate/20190910203552_create_remote_issue_statuses.rb +3 -1
- data/db/migrate/20190911165556_rename_issue_status_id_to_local_issue_status_id_in_remote_issue_statuses.rb +3 -1
- data/db/migrate/20190912000000_create_remote_issues.rb +3 -1
- data/db/migrate/20190913195930_add_default_local_user_id_to_remote_trackers.rb +3 -1
- data/db/migrate/20200504183142_create_remote_tracker_settings.rb +3 -1
- data/db/migrate/20200505153200_add_timestamps_to_redmine_trackers.rb +3 -1
- data/db/migrate/20200505160938_add_timestamps_to_remote_issues.rb +3 -1
- data/db/migrate/20200505161002_add_timestamps_to_remote_users.rb +3 -1
- data/db/migrate/20200602192120_add_outdated_at_to_remote_issues.rb +3 -1
- data/db/migrate/20200602194753_add_fetched_at_to_remote_issues.rb +3 -1
- data/db/migrate/20200602203020_add_fetched_at_to_remote_trackers.rb +3 -1
- data/lib/redmine_remotes/esosti/entities/issue.rb +14 -1
- data/lib/redmine_remotes/esosti/instance.rb +2 -2
- data/lib/redmine_remotes/patches/user.rb +2 -2
- data/lib/redmine_remotes/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f974e7b689f90b6250957c0a0356f22fa78fbd9e84705a18abbd5667df745da0
|
4
|
+
data.tar.gz: eb073a99fd7ee11795b341d132f943e820f78103928baa66983ccbebef2531a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74953344c1a68f1ce612e808341767fbdc0a4e359f145d55273cd29c7b5160da9b2fc149dc4bb1b536a1ea96d0a2ef95a0e690f4c6f0f20019a143414ee01f7c
|
7
|
+
data.tar.gz: cd80adf88f456deedeb3a440626877fa7e5c50bc9d84b8a9311531459e5ad731e9e69422b7b169c306e1630eca4f97a90a126233725dbce9446738b4d751d5b1
|
@@ -8,9 +8,22 @@ class RemoteIssueStatusesController < ApplicationController
|
|
8
8
|
layout 'nonproject_modules'
|
9
9
|
require_permission PERMISSIONS
|
10
10
|
|
11
|
+
SEARCH_COLUMNS = %i[remote_name local_issue_status local_tracker remote_tracker].freeze
|
12
|
+
before_action :localize_options
|
13
|
+
|
11
14
|
active_scaffold :remote_issue_status do |conf|
|
12
|
-
|
15
|
+
conf.actions.swap :search, :field_search
|
16
|
+
SEARCH_COLUMNS.each do |column|
|
13
17
|
conf.columns[column].form_ui = :select
|
14
18
|
end
|
19
|
+
conf.field_search.columns = SEARCH_COLUMNS
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def localize_options
|
25
|
+
active_scaffold_config.columns[:remote_name].options = {
|
26
|
+
options: ::RemoteIssueStatus.remote_name_options
|
27
|
+
}
|
15
28
|
end
|
16
29
|
end
|
@@ -13,4 +13,10 @@ class RemoteIssueStatus < ActiveRecord::Base
|
|
13
13
|
validates :remote_tracker, presence: true
|
14
14
|
validates :local_tracker, presence: true
|
15
15
|
validates :local_issue_status, presence: true
|
16
|
+
|
17
|
+
class << self
|
18
|
+
def remote_name_options
|
19
|
+
all.pluck(:remote_name).map { |v| [v.upcase, v] }
|
20
|
+
end
|
21
|
+
end
|
16
22
|
end
|
@@ -19,7 +19,8 @@ class RemoteTracker < ActiveRecord::Base
|
|
19
19
|
dependent: :destroy
|
20
20
|
has_many :remote_users, class_name: 'RemoteUser', inverse_of: :remote_tracker,
|
21
21
|
dependent: :restrict_with_error
|
22
|
-
belongs_to :default_local_user, class_name: 'User', inverse_of: :remote_trackers_as_default
|
22
|
+
belongs_to :default_local_user, class_name: 'User', inverse_of: :remote_trackers_as_default,
|
23
|
+
foreign_key: :default_local_user_id
|
23
24
|
|
24
25
|
validates :profile, presence: true, inclusion: { in: lists.profile.values }
|
25
26
|
validates :root_url, presence: true, uniqueness: { scope: [:username] }, url: true
|
data/app/models/remote_user.rb
CHANGED
@@ -6,7 +6,7 @@ class RemoteUser < ActiveRecord::Base
|
|
6
6
|
downcase_columns :remote_login
|
7
7
|
|
8
8
|
belongs_to :remote_tracker, class_name: 'RemoteTracker', inverse_of: :remote_users
|
9
|
-
belongs_to :local_user, class_name: 'User', inverse_of: :remote_users
|
9
|
+
belongs_to :local_user, class_name: 'User', inverse_of: :remote_users, foreign_key: :local_user_id
|
10
10
|
|
11
11
|
validates :remote_login, presence: true, uniqueness: { scope: [:remote_tracker] }
|
12
12
|
validates :local_user, presence: true
|
data/config/locales/en.yml
CHANGED
@@ -1,4 +1,9 @@
|
|
1
1
|
en:
|
2
|
+
activerecord:
|
3
|
+
models:
|
4
|
+
remote_issue_status:
|
5
|
+
one: Remote issue status
|
6
|
+
other: Remote issue statuses
|
2
7
|
eac_ruby_utils:
|
3
8
|
listable:
|
4
9
|
remote_tracker:
|
@@ -13,8 +18,10 @@ en:
|
|
13
18
|
label: Alternative "description" field
|
14
19
|
field_issue_remote_code: Remote issue's code
|
15
20
|
field_local_issue: Local issue
|
21
|
+
field_local_issue_status: Local issue status
|
16
22
|
field_local_tracker: Local tracker
|
17
23
|
field_remote_code: Remote code
|
24
|
+
field_remote_name: Local issue status's name
|
18
25
|
field_remote_tracker: Remote tracker
|
19
26
|
label_remote_issues: Remote issues
|
20
27
|
label_remote_trackers: Remote trackers
|
data/config/locales/pt-BR.yml
CHANGED
@@ -1,4 +1,9 @@
|
|
1
1
|
pt-BR:
|
2
|
+
activerecord:
|
3
|
+
models:
|
4
|
+
remote_issue_status:
|
5
|
+
one: Situação de demanda remota
|
6
|
+
other: Situações de demandas remotas
|
2
7
|
eac_ruby_utils:
|
3
8
|
listable:
|
4
9
|
remote_tracker:
|
@@ -13,8 +18,10 @@ pt-BR:
|
|
13
18
|
label: Campo "descrição" alternativo
|
14
19
|
field_issue_remote_code: Código da demanda remota
|
15
20
|
field_local_issue: Demanda local
|
16
|
-
|
21
|
+
field_local_issue_status: Situação de demanda local
|
22
|
+
field_local_tracker: Tipo de demanda local
|
17
23
|
field_remote_code: Código remoto
|
24
|
+
field_remote_name: Nome da situação de demanda remota
|
18
25
|
field_remote_tracker: Tracker remoto
|
19
26
|
label_remote_issues: Demandas remotas
|
20
27
|
label_remote_trackers: Trackers remotos
|
@@ -1,6 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
class CreateRemoteTrackers <
|
3
|
+
class CreateRemoteTrackers < (
|
4
|
+
::Rails.version < '5.1' ? ::ActiveRecord::Migration : ::ActiveRecord::Migration[4.2]
|
5
|
+
)
|
4
6
|
def change
|
5
7
|
create_table :remote_trackers do |t| # rubocop:disable Rails/CreateTableWithTimestamps
|
6
8
|
t.string :profile
|
@@ -1,6 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
class CreateRemoteUsers <
|
3
|
+
class CreateRemoteUsers < (
|
4
|
+
::Rails.version < '5.1' ? ::ActiveRecord::Migration : ::ActiveRecord::Migration[4.2]
|
5
|
+
)
|
4
6
|
def change
|
5
7
|
create_table :remote_users do |t| # rubocop:disable Rails/CreateTableWithTimestamps
|
6
8
|
t.references :remote_tracker, index: true
|
@@ -1,6 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
class CreateRemoteIssueStatuses <
|
3
|
+
class CreateRemoteIssueStatuses < (
|
4
|
+
::Rails.version < '5.1' ? ::ActiveRecord::Migration : ::ActiveRecord::Migration[4.2]
|
5
|
+
)
|
4
6
|
def change
|
5
7
|
create_table :remote_issue_statuses do |t| # rubocop:disable Rails/CreateTableWithTimestamps
|
6
8
|
t.references :remote_tracker, index: true
|
@@ -1,6 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
class RenameIssueStatusIdToLocalIssueStatusIdInRemoteIssueStatuses <
|
3
|
+
class RenameIssueStatusIdToLocalIssueStatusIdInRemoteIssueStatuses < (
|
4
|
+
::Rails.version < '5.1' ? ::ActiveRecord::Migration : ::ActiveRecord::Migration[4.2]
|
5
|
+
)
|
4
6
|
def change
|
5
7
|
rename_column :remote_issue_statuses, :issue_status_id, :local_issue_status_id
|
6
8
|
end
|
@@ -1,6 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
class CreateRemoteIssues <
|
3
|
+
class CreateRemoteIssues < (
|
4
|
+
::Rails.version < '5.1' ? ::ActiveRecord::Migration : ::ActiveRecord::Migration[4.2]
|
5
|
+
)
|
4
6
|
def change
|
5
7
|
create_table :remote_issues do |t| # rubocop:disable Rails/CreateTableWithTimestamps
|
6
8
|
t.references :remote_tracker, index: true
|
@@ -1,6 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
class AddDefaultLocalUserIdToRemoteTrackers <
|
3
|
+
class AddDefaultLocalUserIdToRemoteTrackers < (
|
4
|
+
::Rails.version < '5.1' ? ::ActiveRecord::Migration : ::ActiveRecord::Migration[4.2]
|
5
|
+
)
|
4
6
|
def change
|
5
7
|
add_reference :remote_trackers, :default_local_user, index: true
|
6
8
|
|
@@ -1,6 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
class CreateRemoteTrackerSettings <
|
3
|
+
class CreateRemoteTrackerSettings < (
|
4
|
+
::Rails.version < '5.1' ? ::ActiveRecord::Migration : ::ActiveRecord::Migration[4.2]
|
5
|
+
)
|
4
6
|
def change
|
5
7
|
create_table :remote_tracker_settings do |t|
|
6
8
|
t.references :remote_tracker, index: true
|
@@ -1,6 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
class AddTimestampsToRedmineTrackers <
|
3
|
+
class AddTimestampsToRedmineTrackers < (
|
4
|
+
::Rails.version < '5.1' ? ::ActiveRecord::Migration : ::ActiveRecord::Migration[4.2]
|
5
|
+
)
|
4
6
|
class RemoteTracker < ::ActiveRecord::Base; end
|
5
7
|
|
6
8
|
def change
|
@@ -1,6 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
class AddTimestampsToRemoteIssues <
|
3
|
+
class AddTimestampsToRemoteIssues < (
|
4
|
+
::Rails.version < '5.1' ? ::ActiveRecord::Migration : ::ActiveRecord::Migration[4.2]
|
5
|
+
)
|
4
6
|
class RemoteIssue < ::ActiveRecord::Base; end
|
5
7
|
|
6
8
|
def change
|
@@ -1,6 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
class AddTimestampsToRemoteUsers <
|
3
|
+
class AddTimestampsToRemoteUsers < (
|
4
|
+
::Rails.version < '5.1' ? ::ActiveRecord::Migration : ::ActiveRecord::Migration[4.2]
|
5
|
+
)
|
4
6
|
class RemoteUser < ::ActiveRecord::Base; end
|
5
7
|
|
6
8
|
def change
|
@@ -1,6 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
class AddOutdatedAtToRemoteIssues <
|
3
|
+
class AddOutdatedAtToRemoteIssues < (
|
4
|
+
::Rails.version < '5.1' ? ::ActiveRecord::Migration : ::ActiveRecord::Migration[4.2]
|
5
|
+
)
|
4
6
|
def change
|
5
7
|
add_column :remote_issues, :outdated_at, :datetime
|
6
8
|
end
|
@@ -1,6 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
class AddFetchedAtToRemoteIssues <
|
3
|
+
class AddFetchedAtToRemoteIssues < (
|
4
|
+
::Rails.version < '5.1' ? ::ActiveRecord::Migration : ::ActiveRecord::Migration[4.2]
|
5
|
+
)
|
4
6
|
def change
|
5
7
|
add_column :remote_issues, :fetched_at, :timestamp
|
6
8
|
end
|
@@ -1,6 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
class AddFetchedAtToRemoteTrackers <
|
3
|
+
class AddFetchedAtToRemoteTrackers < (
|
4
|
+
::Rails.version < '5.1' ? ::ActiveRecord::Migration : ::ActiveRecord::Migration[4.2]
|
5
|
+
)
|
4
6
|
def change
|
5
7
|
add_column :remote_trackers, :fetched_at, :datetime
|
6
8
|
end
|
@@ -6,11 +6,16 @@ module RedmineRemotes
|
|
6
6
|
module Esosti
|
7
7
|
module Entities
|
8
8
|
class Issue < ::Avmtrf1::Esosti::Entities::Issue
|
9
|
+
DEFAULT_TYPE_FOR_URL_PREFIX = '_unmapped_'
|
9
10
|
EXTRA_DESCRIPTION_BEFORE = { reported_by: 'Relatado por', affected_person: 'Pessoa afetada',
|
10
11
|
type_description: 'Tipo de solicitação' }.freeze
|
12
|
+
TYPES_FOR_URL = {
|
13
|
+
'INCIDENTE' => 'ms_incident',
|
14
|
+
'SS' => 'ms_sr'
|
15
|
+
}.freeze
|
11
16
|
|
12
17
|
def human_view_url
|
13
|
-
instance.issue_human_view_url(uid)
|
18
|
+
instance.issue_human_view_url(type_for_url, uid)
|
14
19
|
end
|
15
20
|
|
16
21
|
def author_login
|
@@ -63,6 +68,14 @@ module RedmineRemotes
|
|
63
68
|
description.gsub(/\s+/, ' ')
|
64
69
|
end
|
65
70
|
|
71
|
+
def type_for_url
|
72
|
+
TYPES_FOR_URL[type_class] || "#{DEFAULT_TYPE_FOR_URL_PREFIX}#{type_class}"
|
73
|
+
end
|
74
|
+
|
75
|
+
def type_class
|
76
|
+
attributes.fetch('CLASS')
|
77
|
+
end
|
78
|
+
|
66
79
|
def type_description
|
67
80
|
attributes.fetch('DESCRIPTION')
|
68
81
|
end
|
@@ -17,8 +17,8 @@ module RedmineRemotes
|
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
|
-
def issue_human_view_url(ticket_uid)
|
21
|
-
"#{root_url}/itsm/ui/?event=loadapp&value
|
20
|
+
def issue_human_view_url(ticket_type, ticket_uid)
|
21
|
+
"#{root_url}/itsm/ui/?event=loadapp&value=#{ticket_type}&uniqueid=#{ticket_uid}"
|
22
22
|
end
|
23
23
|
|
24
24
|
def fetch_issues_changed(start_time, _end_time)
|
@@ -7,10 +7,10 @@ module EacRedmineUsability
|
|
7
7
|
|
8
8
|
included do
|
9
9
|
has_many :remote_users, class_name: 'RemoteUser', inverse_of: :local_user,
|
10
|
-
dependent: :destroy
|
10
|
+
dependent: :destroy, foreign_key: :local_user_id
|
11
11
|
has_many :remote_trackers_as_default,
|
12
12
|
class_name: 'RemoteTracker', inverse_of: :default_local_user,
|
13
|
-
dependent: :restrict_with_error
|
13
|
+
dependent: :restrict_with_error, foreign_key: :default_local_user_id
|
14
14
|
end
|
15
15
|
end
|
16
16
|
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.16.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: 2022-
|
11
|
+
date: 2022-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aranha-parsers
|