mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-13 08:15:55 +08:00
Merge branch 'standalone_develop' into pm_project_develop
# Conflicts: # app/controllers/attachments_controller.rb # app/services/api/v1/issues/concerns/checkable.rb # app/services/api/v1/issues/concerns/loadable.rb
This commit is contained in:
@@ -3,7 +3,7 @@ class Api::V1::Issues::IssuePrioritiesController < Api::V1::BaseController
|
||||
before_action :require_public_and_member_above, only: [:index]
|
||||
|
||||
def index
|
||||
@priorities = IssuePriority.where.not(name: '立刻').order(position: :asc)
|
||||
@priorities = IssuePriority.order(position: :asc)
|
||||
@priorities = @priorities.ransack(name_cont: params[:keyword]).result if params[:keyword]
|
||||
@priorities = kaminary_select_paginate(@priorities)
|
||||
end
|
||||
|
||||
@@ -4,7 +4,7 @@ class Api::V1::Issues::StatuesController < Api::V1::BaseController
|
||||
|
||||
# 状态列表
|
||||
def index
|
||||
@statues = IssueStatus.where.not(name: '反馈').order("position asc")
|
||||
@statues = IssueStatus.order("position asc")
|
||||
@statues = @statues.ransack(name_cont: params[:keyword]).result if params[:keyword].present?
|
||||
@statues = kaminary_select_paginate(@statues)
|
||||
end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class Api::V1::IssuesController < Api::V1::BaseController
|
||||
before_action :require_login, except: [:index, :show]
|
||||
before_action :require_public_and_member_above, only: [:index, :show, :create, :update, :destroy]
|
||||
before_action :require_login, except: [:index, :show, :show_by_id]
|
||||
before_action :require_public_and_member_above, only: [:index, :show, :show_by_id, :create, :update, :destroy]
|
||||
before_action :require_operate_above, only: [:batch_update, :batch_destroy]
|
||||
|
||||
def index
|
||||
@@ -22,6 +22,12 @@ class Api::V1::IssuesController < Api::V1::BaseController
|
||||
|
||||
before_action :load_issue, only: [:show, :update, :destroy]
|
||||
before_action :check_issue_operate_permission, only: [:update, :destroy]
|
||||
before_action :load_issue_by_id, only: [:show_by_id]
|
||||
|
||||
def show_by_id
|
||||
@issue.associate_attachment_container
|
||||
@user_permission = current_user.present? && current_user.logged? && (@project.member?(current_user) || current_user.admin? || @issue.user == current_user)
|
||||
end
|
||||
|
||||
def show
|
||||
@issue.associate_attachment_container
|
||||
@@ -70,6 +76,13 @@ class Api::V1::IssuesController < Api::V1::BaseController
|
||||
end
|
||||
end
|
||||
|
||||
def load_issue_by_id
|
||||
@issue = Issue.find_by_id(params[:index])
|
||||
if @issue.blank?
|
||||
render_not_found("疑修不存在!")
|
||||
end
|
||||
end
|
||||
|
||||
def load_issues
|
||||
return render_error("请输入正确的ID数组!") unless params[:ids].is_a?(Array)
|
||||
params[:ids].each do |id|
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
class Api::V1::Projects::TagsController < Api::V1::BaseController
|
||||
before_action :require_public_and_member_above, only: [:index]
|
||||
before_action :require_public_and_member_above, only: [:index, :show]
|
||||
|
||||
def index
|
||||
@release_tags = @repository.version_releases.pluck(:tag_name)
|
||||
@result_object = Api::V1::Projects::Tags::ListService.call(@project, {page: page, limit: limit}, current_user&.gitea_token)
|
||||
puts @result_object
|
||||
end
|
||||
|
||||
def show
|
||||
@result_object = Api::V1::Projects::Tags::GetService.call(@project, params[:name], current_user&.gitea_token)
|
||||
end
|
||||
|
||||
before_action :require_operate_above, only: [:destroy]
|
||||
|
||||
Reference in New Issue
Block a user