Remove old data
This commit is contained in:
parent
a7667ffc14
commit
17a8ee57fe
3 changed files with 1 additions and 42 deletions
|
@ -60,41 +60,6 @@ class Admin::TeamsController < Admin::ApplicationController
|
||||||
redirect_to admin_user_teams_path, notice: 'UserTeam was successfully deleted.'
|
redirect_to admin_user_teams_path, notice: 'UserTeam was successfully deleted.'
|
||||||
end
|
end
|
||||||
|
|
||||||
def delegate_projects
|
|
||||||
unless params[:project_ids].blank?
|
|
||||||
project_ids = params[:project_ids]
|
|
||||||
access = params[:greatest_project_access]
|
|
||||||
@team.assign_to_projects(project_ids, access)
|
|
||||||
end
|
|
||||||
|
|
||||||
redirect_to admin_team_path(@team), notice: 'Projects was successfully added.'
|
|
||||||
end
|
|
||||||
|
|
||||||
def relegate_project
|
|
||||||
project = params[:project_id]
|
|
||||||
@team.resign_from_project(project)
|
|
||||||
|
|
||||||
redirect_to admin_team_path(@team), notice: 'Project was successfully removed.'
|
|
||||||
end
|
|
||||||
|
|
||||||
def add_members
|
|
||||||
unless params[:user_ids].blank?
|
|
||||||
user_ids = params[:user_ids]
|
|
||||||
access = params[:default_project_access]
|
|
||||||
is_admin = params[:group_admin]
|
|
||||||
@team.add_members(user_ids, access, is_admin)
|
|
||||||
end
|
|
||||||
|
|
||||||
redirect_to admin_team_path(@team), notice: 'Members was successfully added.'
|
|
||||||
end
|
|
||||||
|
|
||||||
def remove_member
|
|
||||||
member = params[:member_id]
|
|
||||||
@team.remove_member(member)
|
|
||||||
|
|
||||||
redirect_to admin_team_path(@team), notice: 'Member was successfully removed.'
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def user_team
|
def user_team
|
||||||
|
|
|
@ -41,7 +41,7 @@ class UsersProject < ActiveRecord::Base
|
||||||
scope :masters, where(project_access: MASTER)
|
scope :masters, where(project_access: MASTER)
|
||||||
|
|
||||||
scope :in_project, ->(project) { where(project_id: project.id) }
|
scope :in_project, ->(project) { where(project_id: project.id) }
|
||||||
scope :in_projects, ->(projects) { where(project_id: projects.map(&:id)) }
|
scope :in_projects, ->(projects) { where(project_id: project_ids) }
|
||||||
scope :with_user, ->(user) { where(user_id: user.id) }
|
scope :with_user, ->(user) { where(user_id: user.id) }
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
|
|
|
@ -70,12 +70,6 @@ Gitlab::Application.routes.draw do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
resources :teams do #, constraints: { id: /[^\/]+/ } do end
|
resources :teams do #, constraints: { id: /[^\/]+/ } do end
|
||||||
member do
|
|
||||||
post :delegate_projects
|
|
||||||
delete :relegate_project
|
|
||||||
post :add_members
|
|
||||||
delete :remove_member
|
|
||||||
end
|
|
||||||
scope module: :teams do
|
scope module: :teams do
|
||||||
resources :members, only: [:edit, :update, :destroy, :new, :create]
|
resources :members, only: [:edit, :update, :destroy, :new, :create]
|
||||||
resources :projects, only: [:edit, :update, :destroy, :new, :create]
|
resources :projects, only: [:edit, :update, :destroy, :new, :create]
|
||||||
|
|
Loading…
Reference in a new issue