Commit a3f94b3f by Tấn Trần Thanh

config for dynamic setting team and project ids in server

parent e4ef2e78
Pipeline #1623 canceled with stages
in 0 seconds
...@@ -4,7 +4,7 @@ class WorkflowReportController < ApplicationController ...@@ -4,7 +4,7 @@ class WorkflowReportController < ApplicationController
before_action :require_xhr_request, only: %i[export show_daily_report export_time_entry] before_action :require_xhr_request, only: %i[export show_daily_report export_time_entry]
def index def index
@team_options = $workflow_report_config['teams'].map { |team| team.keys() } @team_options = $app_report_config['teams'].map { |team| team.keys() }
end end
def index_daily_report def index_daily_report
...@@ -56,7 +56,7 @@ class WorkflowReportController < ApplicationController ...@@ -56,7 +56,7 @@ class WorkflowReportController < ApplicationController
end end
def index_time_entry def index_time_entry
@team_options = $workflow_report_config['teams'].map { |team| team.keys() } @team_options = $app_report_config['teams'].map { |team| team.keys() }
end end
def export_time_entry def export_time_entry
...@@ -77,9 +77,9 @@ class WorkflowReportController < ApplicationController ...@@ -77,9 +77,9 @@ class WorkflowReportController < ApplicationController
def find_project_ids(team) def find_project_ids(team)
if team == 'All-team' if team == 'All-team'
$workflow_report_config['teams'].map(&:values).flatten.compact $app_report_config['teams'].map(&:values).flatten.compact
else else
$workflow_report_config['teams'].find { |hash| hash.key?(team) }[team] $app_report_config['teams'].find { |hash| hash.key?(team) }[team]
end end
end end
end end
github_token: your_github_token_here github_token: your_github_token_here
teams:
- Kyujin:
- 9
- 142
- 88
- Sumai:
- 17
- 29
- 31
- 131
- 140
- Kuruma:
- 139
- 138
- 94
- 90
- 93
- 120
- 128
- 147
- 121
- 116
- LS:
- 134
- PS:
- 145
- 141
- 144
- 151
- Sanko:
- 91
- 149
- CORDA:
- 92
- 112
- APW-Travelist-Air:
- 133
- APW-Travelist-Hotel:
- 148
- APW-Voyager:
- 146
- APW-SUB:
- 137
- All-team:
teams:
- Kyujin:
- 9
- 142
- 88
- Sumai:
- 17
- 29
- 31
- 131
- 140
- Kuruma:
- 139
- 138
- 94
- 90
- 93
- 120
- 128
- 147
- 121
- 116
- LS:
- 134
- PS:
- 145
- 141
- 144
- 151
- Sanko:
- 91
- 149
- CORDA:
- 92
- 112
- APW-Travelist-Air:
- 133
- APW-Travelist-Hotel:
- 148
- APW-Voyager:
- 146
- APW-SUB:
- 137
- All-team:
...@@ -11,10 +11,8 @@ Redmine::Plugin.register :workflow_report do ...@@ -11,10 +11,8 @@ Redmine::Plugin.register :workflow_report do
version '0.0.1' version '0.0.1'
url 'http://example.com/path/to/plugin' url 'http://example.com/path/to/plugin'
author_url 'http://example.com/about' author_url 'http://example.com/about'
configfile = File.join(File.dirname(__FILE__), 'config', 'settings.yml') configfile = File.join(File.dirname(__FILE__), 'config', 'application.yml')
application_config = File.join(File.dirname(__FILE__), 'config', 'application.yml') $app_report_config = YAML::load_file(configfile)
$workflow_report_config = YAML::load_file(configfile)
$app_report_config = YAML::load_file(application_config)
project_module :workflow_report do project_module :workflow_report do
permission :workflow_report_view_and_export, { workflow_report: %i[index export index_daily_report show_daily_report permission :workflow_report_view_and_export, { workflow_report: %i[index export index_daily_report show_daily_report
index_time_entry export_time_entry] }, require: :member index_time_entry export_time_entry] }, require: :member
......
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