Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
redmine_v2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VeNtura
redmine_v2
Commits
e8650e1f
Commit
e8650e1f
authored
Nov 07, 2023
by
Tấn Trần Thanh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
permission, gemfile.lock for github_api
parent
e8a1223a
Pipeline
#1570
failed with stages
in 0 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
70 additions
and
10 deletions
+70
-10
plugins/workflow_report/Gemfile.lock
+37
-0
plugins/workflow_report/app/controllers/workflow_report_controller.rb
+7
-1
plugins/workflow_report/app/views/workflow_report/index.html.slim
+9
-3
plugins/workflow_report/assets/stylesheets/style.css
+0
-4
plugins/workflow_report/config/routes.rb
+0
-1
plugins/workflow_report/init.rb
+17
-1
No files found.
plugins/workflow_report/Gemfile.lock
0 → 100644
View file @
e8650e1f
GEM
specs:
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
faraday (1.0.1)
multipart-post (>= 1.2, < 3)
github_api (0.19.0)
addressable (~> 2.4)
descendants_tracker (~> 0.0.4)
faraday (>= 0.8, < 2)
hashie (~> 3.5, >= 3.5.2)
oauth2 (~> 1.0)
hashie (3.6.0)
jwt (2.3.0)
multi_json (1.13.0)
multi_xml (0.6.0)
multipart-post (2.3.0)
oauth2 (1.4.11)
faraday (>= 0.17.3, < 3.0)
jwt (>= 1.0, < 3.0)
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 4)
public_suffix (3.0.1)
rack (1.6.8)
thread_safe (0.3.6)
PLATFORMS
ruby
DEPENDENCIES
github_api (~> 0.19.0)
BUNDLED WITH
1.17.3
plugins/workflow_report/app/controllers/workflow_report_controller.rb
View file @
e8650e1f
require
'csv'
class
WorkflowReportController
<
ApplicationController
before_action
:authorize_global
before_action
:require_xhr_request
,
only: :export
def
index
@team_options
=
$workflow_report_config
[
'teams'
].
map
{
|
team
|
team
.
keys
()
}
end
def
export
thead
=
[
'root_id'
,
'project'
,
'subject'
,
'target_version'
,
' created_on '
,
'
closed_on '
,
' due_date '
,
' status '
,
'
Estimated_hours (*final version) '
,
'Actual time'
,
'Diff'
,
'Estimated_hours (*Initial version)'
,
thead
=
[
'root_id'
,
'project'
,
'subject'
,
'target_version'
,
' created_on '
,
'
closed_on '
,
'due_date '
,
' status '
,
'
Estimated_hours (*final version) '
,
'Actual time'
,
'Diff'
,
'Estimated_hours (*Initial version)'
,
'Number of estimation changes'
,
'Note of estimation changes'
,
'1. Requirement'
,
'2. Design'
,
'3. Coding'
,
'4. Testing'
,
'5. Bug fixing'
,
'6. Release'
,
'Others'
,
'1. Requirement'
,
'2. Design'
,
'3. Coding'
,
'4. Testing'
,
'5. Bug fixing'
,
'6. Release'
,
'Others'
,
'testcases'
,
'vn STG bug'
,
'Jp STG bug'
,
'Production'
,
'Issue'
,
'Issue comment'
,
'PR comment'
,
'Review comment'
,
'Commits'
,
'File changed'
,
'Addtion'
,
'Deletetion'
]
team
=
params
[
:team
]
...
...
@@ -239,4 +241,8 @@ class WorkflowReportController < ApplicationController
end
name
.
strip
end
def
require_xhr_request
head
:unprocessable_entity
unless
request
.
xhr?
end
end
plugins/workflow_report/app/views/workflow_report/index.html.slim
View file @
e8650e1f
...
...
@@ -5,9 +5,15 @@ fieldset.box.tabular
legend
|
EXPORT WORKFLOW
=
form_tag
do
=
select_tag
:month
,
options_for_select
(
1
..
12
,
Time
.
now
.
month
),{
prompt:
"Select month"
}
=
select_tag
:year
,
options_for_select
((
Time
.
now
.
year
-
5
)
..
(
Time
.
now
.
year
+
1
),
Time
.
now
.
year
),{
prompt:
"Select year"
}
=
select_tag
:team
,
options_for_select
(
@team_options
),
{
prompt:
"Select team"
}
p
=
label
:month
,
'Month'
=
select_tag
:month
,
options_for_select
(
1
..
12
,
Time
.
now
.
month
),{
prompt:
"Select month"
}
p
=
label
:year
,
'Year'
=
select_tag
:year
,
options_for_select
((
Time
.
now
.
year
-
5
)
..
(
Time
.
now
.
year
+
1
),
Time
.
now
.
year
),{
prompt:
"Select year"
}
p
=
label
:team
,
'Team'
=
select_tag
:team
,
options_for_select
(
@team_options
),
{
prompt:
"Select team"
}
=
submit_tag
'export'
,
id:
'export'
button
.export-button.d-none
Download
.CSV
#data_workflow
plugins/workflow_report/assets/stylesheets/style.css
View file @
e8650e1f
...
...
@@ -54,10 +54,6 @@ table {
background-color
:
pink
;
}
#year
,
#month
,
#team
,
#export
{
margin
:
8px
24px
0
0
;
}
button
.export-button
{
margin-bottom
:
35px
;
}
...
...
plugins/workflow_report/config/routes.rb
View file @
e8650e1f
...
...
@@ -3,4 +3,3 @@
get
'workflow_report'
,
to:
'workflow_report#index'
get
'workflow_report/export'
,
to:
'workflow_report#export'
get
'/download_csv'
,
to:
'workflow_report#export_csv'
plugins/workflow_report/init.rb
View file @
e8650e1f
...
...
@@ -13,5 +13,21 @@ Redmine::Plugin.register :workflow_report do
author_url
'http://example.com/about'
configfile
=
File
.
join
(
File
.
dirname
(
__FILE__
),
'config'
,
'settings.yml'
)
$workflow_report_config
=
YAML
::
load_file
(
configfile
)
menu
:top_menu
,
:workflow_report
,
{
controller:
'workflow_report'
,
action:
'index'
},
caption:
'Workflow Report'
end
Redmine
::
MenuManager
.
map
:top_menu
do
|
menu
|
menu
.
push
(
:workflow_report
,
{
controller:
'workflow_report'
,
action:
'index'
},
caption:
'Workflow Report'
,
if:
proc
{
User
.
current
.
allowed_to_globally?
(
:view_workflow_report
)
})
end
ActionDispatch
::
Reloader
.
to_prepare
do
Redmine
::
AccessControl
.
map
do
|
map
|
map
.
project_module
:workflow_report
do
|
pmap
|
pmap
.
permission
(
:view_workflow_report
,
{
workflow_report:
[
:index
,
:export
],
},
read:
true
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment