Commit 352ec75b authored by Jan-Willem van der Meer's avatar Jan-Willem van der Meer

Merge remote-tracking branch 'origin/master' into feature-admin-emails

Conflicts:
	db/schema.rb
parents 1dd995a7 361432af
...@@ -42,7 +42,8 @@ class JiraService < Service ...@@ -42,7 +42,8 @@ class JiraService < Service
{ type: 'text', name: 'project_url', placeholder: 'Url to JIRA, http://jira.example' }, { type: 'text', name: 'project_url', placeholder: 'Url to JIRA, http://jira.example' },
{ type: 'text', name: 'username', placeholder: '' }, { type: 'text', name: 'username', placeholder: '' },
{ type: 'password', name: 'password', placeholder: '' }, { type: 'password', name: 'password', placeholder: '' },
{ type: 'text', name: 'api_version', placeholder: '2' } { type: 'text', name: 'api_version', placeholder: '2' },
{ type: 'text', name: 'jira_issue_transition_id', placeholder: '2' }
] ]
end end
...@@ -69,7 +70,7 @@ class JiraService < Service ...@@ -69,7 +70,7 @@ class JiraService < Service
}] }]
}, },
'transition' => { 'transition' => {
'id' => '2' 'id' => jira_issue_transition_id
} }
} }
......
...@@ -31,6 +31,17 @@ ...@@ -31,6 +31,17 @@
%strong %strong
= @group.created_at.stamp("March 1, 1999") = @group.created_at.stamp("March 1, 1999")
- if @group.ldap_cn.present?
%li
%span.light LDAP group cn:
%strong
= @group.ldap_cn
%li
%span.light LDAP access level:
%strong
= @group.human_ldap_access
.panel.panel-default .panel.panel-default
.panel-heading .panel-heading
%h3.panel-title %h3.panel-title
...@@ -50,11 +61,11 @@ ...@@ -50,11 +61,11 @@
= paginate @projects, param_name: 'projects_page', theme: 'gitlab' = paginate @projects, param_name: 'projects_page', theme: 'gitlab'
- if @group.shared_projects.any? - if @group.shared_projects.any?
.ui-box .panel.panel-default
.title .panel-heading
Projects shared with #{@group.name} Projects shared with #{@group.name}
%small %span.badge
(#{@group.shared_projects.count}) #{@group.shared_projects.count}
%ul.well-list %ul.well-list
- @group.shared_projects.sort_by(&:name).each do |project| - @group.shared_projects.sort_by(&:name).each do |project|
%li %li
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
- if current_user && current_user.can?(:manage_group, @group) - if current_user && current_user.can?(:manage_group, @group)
.pull-right .pull-right
- if ldap_enabled? && @group.ldap_cn.present? - if ldap_enabled? && @group.ldap_cn.present?
= link_to reset_access_group_ldap_path(@group), class: 'btn grouped', data: { confirm: "Reset the access level of all other LDAP group team members to '#{@group.human_ldap_access}'?" }, method: :put do = link_to reset_access_group_ldap_path(@group), class: 'btn btn-grouped', data: { confirm: "Reset the access level of all other LDAP group team members to '#{@group.human_ldap_access}'?" }, method: :put do
Reset access Reset access
= link_to '#', class: 'btn btn-new js-toggle-button' do = link_to '#', class: 'btn btn-new js-toggle-button' do
...@@ -28,6 +28,14 @@ ...@@ -28,6 +28,14 @@
.js-toggle-content.hide.new-group-member-holder .js-toggle-content.hide.new-group-member-holder
= render "new_group_member" = render "new_group_member"
- if ldap_enabled? && @group.ldap_cn.present?
.bs-callout.bs-callout-info
The members of this group are synced with the LDAP group with cn
%code #{@group.ldap_cn}
\. They are given
%code #{@group.human_ldap_access}
access.
.panel.panel-default.prepend-top-20 .panel.panel-default.prepend-top-20
.panel-heading .panel-heading
%strong #{@group.name} %strong #{@group.name}
......
class AddJiraIssueTransitionIdToServices < ActiveRecord::Migration
def up
add_column :services, :jira_issue_transition_id, :string, default: '2'
Service.reset_column_information
Service.where(jira_issue_transition_id: nil).update_all jira_issue_transition_id: '2'
end
def down
remove_column :services, :jira_issue_transition_id
end
end
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20140811083829) do ActiveRecord::Schema.define(version: 20140811155127) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
...@@ -285,6 +285,7 @@ ActiveRecord::Schema.define(version: 20140811083829) do ...@@ -285,6 +285,7 @@ ActiveRecord::Schema.define(version: 20140811083829) do
t.string "username" t.string "username"
t.string "password" t.string "password"
t.string "api_version" t.string "api_version"
t.string "jira_issue_transition_id", default: "2"
end end
add_index "services", ["project_id"], name: "index_services_on_project_id", using: :btree add_index "services", ["project_id"], name: "index_services_on_project_id", using: :btree
......
...@@ -55,5 +55,13 @@ describe JiraService, models: true do ...@@ -55,5 +55,13 @@ describe JiraService, models: true do
body: /Issue solved with/ body: /Issue solved with/
).once ).once
end end
it "calls the api with jira_issue_transition_id" do
@jira_service.jira_issue_transition_id = 'this-is-a-custom-id'
@jira_service.execute(@sample_data, JiraIssue.new("JIRA-123"))
WebMock.should have_requested(:post, @api_url).with(
body: /this-is-a-custom-id/
).once
end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment