Browse Source

add has_actions to projects

pull/347/head
kingChan 2 years ago
parent
commit
ec01552818
20 changed files with 99 additions and 75 deletions
  1. +1
    -0
      app/controllers/api/v1/sonarqubes_controller.rb
  2. +3
    -3
      app/models/action/node.rb
  3. +1
    -1
      app/models/action/node_input.rb
  4. +1
    -1
      app/models/action/node_type.rb
  5. +1
    -1
      app/models/action/template.rb
  6. +41
    -42
      app/models/attachment.rb
  7. +20
    -0
      app/models/gitlink_competition_apply.rb
  8. +0
    -1
      app/models/license.rb
  9. +0
    -1
      app/models/member.rb
  10. +0
    -1
      app/models/organization_user.rb
  11. +1
    -0
      app/models/project.rb
  12. +0
    -1
      app/models/project_category.rb
  13. +0
    -4
      app/models/project_language.rb
  14. +0
    -1
      app/models/repository.rb
  15. +2
    -0
      app/models/sync_repositories/gitee.rb
  16. +2
    -0
      app/models/sync_repositories/github.rb
  17. +16
    -15
      app/models/token.rb
  18. +2
    -2
      app/models/user_extension.rb
  19. +3
    -1
      config/configuration.yml.example
  20. +5
    -0
      db/migrate/20240620060536_add_has_actions_to_projects.rb

+ 1
- 0
app/controllers/api/v1/sonarqubes_controller.rb View File

@@ -10,6 +10,7 @@ class Api::V1::SonarqubesController < Api::V1::BaseController
Gitea::Repository::ActionSecretsService.new(@owner, @project.identifier, 'SONAR_HOST_URL', Rails.application.config_for(:configuration)['sonarqube']['url'] ).destroy
Gitea::Repository::ActionSecretsService.new(@owner, @project.identifier, 'SONAR_TOKEN', Rails.application.config_for(:configuration)['sonarqube']['secret'] ).destroy
end
@project.update(gitea_params)
render_ok
end



+ 3
- 3
app/models/action/node.rb View File

@@ -16,12 +16,12 @@
# user_id :integer
# created_at :datetime not null
# updated_at :datetime not null
# label :string(255)
#
# Indexes
#
# by_name (name)
# index_action_nodes_on_action_types_id (action_node_types_id)
# index_action_nodes_on_user_id (user_id)
# index_action_nodes_on_action_node_types_id (action_node_types_id)
# index_action_nodes_on_user_id (user_id)
#

class Action::Node < ApplicationRecord


+ 1
- 1
app/models/action/node_input.rb View File

@@ -8,7 +8,7 @@
# input_type :string(255)
# description :string(255)
# is_required :boolean default("0")
# sort_no :string(255) default("0")
# sort_no :integer default("0")
# user_id :integer
# created_at :datetime not null
# updated_at :datetime not null


+ 1
- 1
app/models/action/node_type.rb View File

@@ -5,7 +5,7 @@
# id :integer not null, primary key
# name :string(255)
# description :string(255)
# sort_no :integer
# sort_no :integer default("0")
# created_at :datetime not null
# updated_at :datetime not null
#


+ 1
- 1
app/models/action/template.rb View File

@@ -6,7 +6,7 @@
# name :string(255)
# description :string(255)
# img :string(255)
# sort_no :string(255) default("0")
# sort_no :integer default("0")
# json :text(65535)
# yaml :text(65535)
# created_at :datetime not null


+ 41
- 42
app/models/attachment.rb View File

@@ -1,45 +1,44 @@
# == Schema Information
#
# Table name: attachments
#
# id :integer not null, primary key
# container_id :integer
# container_type :string(30)
# filename :string(255) default(""), not null
# disk_filename :string(255) default(""), not null
# filesize :integer default("0"), not null
# content_type :string(255) default("")
# digest :string(60) default(""), not null
# downloads :integer default("0"), not null
# author_id :integer default("0"), not null
# created_on :datetime
# description :text(65535)
# disk_directory :string(255)
# attachtype :integer default("1")
# is_public :integer default("1")
# copy_from :integer
# quotes :integer default("0")
# is_publish :integer default("1")
# publish_time :datetime
# resource_bank_id :integer
# unified_setting :boolean default("1")
# cloud_url :string(255) default("")
# course_second_category_id :integer default("0")
# delay_publish :boolean default("0")
# memo_image :boolean default("0")
# extra_type :integer default("0")
# uuid :string(255)
#
# Indexes
#
# index_attachments_on_author_id (author_id)
# index_attachments_on_container_id_and_container_type (container_id,container_type)
# index_attachments_on_course_second_category_id (course_second_category_id)
# index_attachments_on_created_on (created_on)
# index_attachments_on_is_public (is_public)
# index_attachments_on_quotes (quotes)
# index_attachments_on_uuid (uuid)
#
# == Schema Information
#
# Table name: attachments
#
# id :integer not null, primary key
# container_id :integer
# container_type :string(30)
# filename :string(255) default(""), not null
# disk_filename :string(255) default(""), not null
# filesize :integer default("0"), not null
# content_type :string(255) default("")
# digest :string(60) default(""), not null
# downloads :integer default("0"), not null
# author_id :integer default("0"), not null
# created_on :datetime
# description :text(65535)
# disk_directory :string(255)
# attachtype :integer default("1")
# is_public :integer default("1")
# copy_from :integer
# quotes :integer default("0")
# is_publish :integer default("1")
# publish_time :datetime
# resource_bank_id :integer
# unified_setting :boolean default("1")
# cloud_url :string(255) default("")
# course_second_category_id :integer default("0")
# delay_publish :boolean default("0")
# uuid :string(255)
#
# Indexes
#
# index_attachments_on_author_id (author_id)
# index_attachments_on_container_id_and_container_type (container_id,container_type)
# index_attachments_on_course_second_category_id (course_second_category_id)
# index_attachments_on_created_on (created_on)
# index_attachments_on_is_public (is_public)
# index_attachments_on_quotes (quotes)
# index_attachments_on_uuid (uuid)
#



+ 20
- 0
app/models/gitlink_competition_apply.rb View File

@@ -1,3 +1,23 @@
# == Schema Information
#
# Table name: gitlink_competition_applies
#
# id :integer not null, primary key
# competition_id :integer
# competition_identifier :string(255)
# team_id :integer
# team_name :string(255)
# school_name :string(255)
# educoder_login :string(255)
# nickname :string(255)
# phone :string(255)
# email :string(255)
# identity :string(255)
# role :string(255)
# created_at :datetime not null
# updated_at :datetime not null
#

# == Schema Information
#
# Table name: gitlink_competition_applies


+ 0
- 1
app/models/license.rb View File

@@ -7,7 +7,6 @@
# content :text(65535)
# created_at :datetime not null
# updated_at :datetime not null
# is_secret :boolean default("0")
#

class License < ApplicationRecord


+ 0
- 1
app/models/member.rb View File

@@ -11,7 +11,6 @@
# course_group_id :integer default("0")
# is_collect :integer default("1")
# graduation_group_id :integer default("0")
# is_apply_signature :boolean default("0")
# team_user_id :integer
#
# Indexes


+ 0
- 1
app/models/organization_user.rb View File

@@ -5,7 +5,6 @@
# id :integer not null, primary key
# user_id :integer
# organization_id :integer
# is_creator :boolean default("0")
# created_at :datetime not null
# updated_at :datetime not null
#


+ 1
- 0
app/models/project.rb View File

@@ -59,6 +59,7 @@
# is_pinned :boolean default("0")
# recommend_index :integer default("0")
# pr_view_admin :boolean default("0")
# has_actions :boolean default("0")
#
# Indexes
#


+ 0
- 1
app/models/project_category.rb View File

@@ -15,7 +15,6 @@
# Indexes
#
# index_project_categories_on_ancestry (ancestry)
# index_project_categories_on_id (id)
#

class ProjectCategory < ApplicationRecord


+ 0
- 4
app/models/project_language.rb View File

@@ -9,10 +9,6 @@
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_project_languages_on_id (id)
#

class ProjectLanguage < ApplicationRecord
include Projectable


+ 0
- 1
app/models/repository.rb View File

@@ -27,7 +27,6 @@
#
# Indexes
#
# index_name (project_id)
# index_repositories_on_identifier (identifier)
# index_repositories_on_project_id (project_id)
# index_repositories_on_user_id (user_id)


+ 2
- 0
app/models/sync_repositories/gitee.rb View File

@@ -11,6 +11,8 @@
# sync_direction :integer
# created_at :datetime not null
# updated_at :datetime not null
# external_token :string(255)
# webhook_gid :integer
#
# Indexes
#


+ 2
- 0
app/models/sync_repositories/github.rb View File

@@ -11,6 +11,8 @@
# sync_direction :integer
# created_at :datetime not null
# updated_at :datetime not null
# external_token :string(255)
# webhook_gid :integer
#
# Indexes
#


+ 16
- 15
app/models/token.rb View File

@@ -1,18 +1,19 @@
# == Schema Information
#
# Table name: tokens
#
# id :integer not null, primary key
# user_id :integer default("0"), not null
# action :string(30) default(""), not null
# value :string(40) default(""), not null
# created_on :datetime not null
#
# Indexes
#
# index_tokens_on_user_id (user_id)
# tokens_value (value) UNIQUE
#
# == Schema Information
#
# Table name: tokens
#
# id :integer not null, primary key
# user_id :integer default("0"), not null
# action :string(30) default(""), not null
# value :string(40) default(""), not null
# created_on :datetime not null
#
# Indexes
#
# index_tokens_on_user_id (user_id)
# tokens_value (value) UNIQUE
#

#


+ 2
- 2
app/models/user_extension.rb View File

@@ -22,9 +22,9 @@
# school_id :integer
# description :string(255)
# department_id :integer
# province :text(65535)
# custom_department :string(255)
# province :string(255)
# city :string(255)
# custom_department :string(255)
# show_email :boolean default("0")
# show_location :boolean default("0")
# show_department :boolean default("0")


+ 3
- 1
config/configuration.yml.example View File

@@ -53,7 +53,9 @@ default: &default
# 区块链相关配置
blockchain:
api_url: 'blockchain service url'

sonarqube:
url: ''
secret: ''
production:
<<: *default



+ 5
- 0
db/migrate/20240620060536_add_has_actions_to_projects.rb View File

@@ -0,0 +1,5 @@
class AddHasActionsToProjects < ActiveRecord::Migration[5.2]
def change
add_column :projects , :has_actions, :boolean, default: false
end
end

Loading…
Cancel
Save