mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-22 02:56:06 +10:00
Merge branch 'improve/project_share_ui' of /home/git/repositories/gitlab/gitlab-ee
This commit is contained in:
@@ -2,35 +2,36 @@
|
||||
%p.light
|
||||
Project can be stored in one group at once. However you can share project with other groups here.
|
||||
%hr
|
||||
.row
|
||||
.span5.enabled-groups
|
||||
- if @group_links.present?
|
||||
.enabled-groups.append-bottom-20
|
||||
%h4
|
||||
Already shared with:
|
||||
Already shared with
|
||||
%ul.bordered-list
|
||||
- @group_links.each do |group_link|
|
||||
- group = group_link.group
|
||||
%li
|
||||
%h4
|
||||
.pull-left
|
||||
= link_to project_group_link_path(@project, group_link), method: :delete, class: 'btn btn-small append-right-10' do
|
||||
%i.icon-remove
|
||||
= link_to group do
|
||||
%i.icon-folder-open
|
||||
= group.name
|
||||
%small.light up to #{group_link.human_access}
|
||||
.pull-right
|
||||
= link_to project_group_link_path(@project, group_link), method: :delete, class: 'btn btn-small append-right-10' do
|
||||
%i.icon-remove
|
||||
disable sharing
|
||||
|
||||
.span5.available-groups
|
||||
- if @available_groups.present?
|
||||
.available-groups
|
||||
%h4
|
||||
Can be shared with:
|
||||
%ul.bordered-list
|
||||
- @available_groups.each do |group|
|
||||
%li
|
||||
.pull-right
|
||||
= form_tag project_group_links_path(@project), method: :post do
|
||||
= select_tag :group_access, options_for_select(ProjectGroupLink.access_options, ProjectGroupLink.default_access), class: "span2"
|
||||
= hidden_field_tag :group_id, group.id
|
||||
= submit_tag "Share", class: "btn btn-small"
|
||||
%h4
|
||||
%i.icon-folder-close
|
||||
= group.name
|
||||
Can be shared with
|
||||
%div
|
||||
= form_tag project_group_links_path(@project), method: :post do
|
||||
.control-group
|
||||
= label_tag :group_id, 'Group'
|
||||
.controls= select_tag :group_id, options_from_collection_for_select(@available_groups, :id, :name), class: 'chosen'
|
||||
.control-group
|
||||
= label_tag :group_access, 'Max access level'
|
||||
.controls= select_tag :group_access, options_for_select(ProjectGroupLink.access_options, ProjectGroupLink.default_access), class: "span2"
|
||||
.form-actions
|
||||
= submit_tag "Share", class: "btn btn-create"
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
Feature: Project Group Links
|
||||
Background:
|
||||
Given I sign in as a user
|
||||
And I own project "Shop"
|
||||
And project "Shop" is shared with group "Ops"
|
||||
And project "Shop" is not shared with group "Market"
|
||||
And I visit project group links page
|
||||
|
||||
Scenario: I should see list of groups
|
||||
Then I should see project already shared with group "Ops"
|
||||
Then I should see project is not shared with group "Market"
|
||||
|
||||
Scenario: I share project with group
|
||||
When I select group "Market" for share
|
||||
Then I should see project is shared with group "Market"
|
||||
@@ -0,0 +1,48 @@
|
||||
class Spinach::Features::ProjectGroupLinks < Spinach::FeatureSteps
|
||||
include SharedAuthentication
|
||||
include SharedProject
|
||||
include SharedPaths
|
||||
|
||||
step 'I should see project already shared with group "Ops"' do
|
||||
within '.enabled-groups' do
|
||||
page.should have_content "Ops"
|
||||
end
|
||||
end
|
||||
|
||||
step 'I should see project is not shared with group "Market"' do
|
||||
within '.enabled-groups' do
|
||||
page.should_not have_content "Market"
|
||||
end
|
||||
end
|
||||
|
||||
step 'I select group "Market" for share' do
|
||||
select "Master", from: 'group_access'
|
||||
select "Market", from: 'group_id'
|
||||
click_button "Share"
|
||||
end
|
||||
|
||||
step 'I should see project is shared with group "Market"' do
|
||||
within '.enabled-groups' do
|
||||
page.should have_content "Market"
|
||||
end
|
||||
end
|
||||
|
||||
step 'project "Shop" is shared with group "Ops"' do
|
||||
group = create(:group, name: 'Ops')
|
||||
share_link = project.project_group_links.new(group_access: Gitlab::Access::MASTER)
|
||||
share_link.group_id = group.id
|
||||
share_link.save!
|
||||
end
|
||||
|
||||
step 'project "Shop" is not shared with group "Market"' do
|
||||
create(:group, name: 'Market')
|
||||
end
|
||||
|
||||
step 'I visit project group links page' do
|
||||
visit project_group_links_path(project)
|
||||
end
|
||||
|
||||
def project
|
||||
@project ||= Project.find_by_name "Shop"
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user