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
90cbc8e7
Commit
90cbc8e7
authored
Dec 05, 2023
by
Tấn Trần Thanh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show error link in view
parent
a81ca957
Pipeline
#1595
canceled with stages
in 0 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
9 deletions
+18
-9
plugins/workflow_report/app/controllers/workflow_report_controller.rb
+1
-1
plugins/workflow_report/app/views/workflow_report/_table_workflow_report.html.slim
+5
-0
plugins/workflow_report/app/views/workflow_report/build_table.js.erb
+1
-1
plugins/workflow_report/assets/stylesheets/style.css
+6
-1
plugins/workflow_report/lib/workflow_report.rb
+5
-6
No files found.
plugins/workflow_report/app/controllers/workflow_report_controller.rb
View file @
90cbc8e7
...
@@ -49,7 +49,7 @@ class WorkflowReportController < ApplicationController
...
@@ -49,7 +49,7 @@ class WorkflowReportController < ApplicationController
WorkflowReport
.
build_report
(
params
[
:year
].
to_i
,
params
[
:month
].
to_i
,
project_ids
)
WorkflowReport
.
build_report
(
params
[
:year
].
to_i
,
params
[
:month
].
to_i
,
project_ids
)
end
end
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
js
{
render
'build_table'
,
locals:
{
result:
result
,
thead:
TABLE_HEADER
}
}
format
.
js
{
render
'build_table'
,
locals:
{
result:
result
[
:workflow_report
],
error_links:
result
[
:error_links
]
,
thead:
TABLE_HEADER
}
}
end
end
end
end
...
...
plugins/workflow_report/app/views/workflow_report/_table_workflow_report.html.slim
View file @
90cbc8e7
-
if
result
.
present?
-
if
result
.
present?
table
[
border
=
"1"
]
table
[
border
=
"1"
]
tr
.header_table--visible
tr
.header_table--visible
...
@@ -32,3 +33,7 @@
...
@@ -32,3 +33,7 @@
td
=
result
[
i
][
index
]
td
=
result
[
i
][
index
]
-
else
-
else
h1
.text-center
There
is
no
data
for
the
'workflow
report'
table
.
h1
.text-center
There
is
no
data
for
the
'workflow
report'
table
.
.mt-10
-
if
error_links
.
present?
-
error_links
.
each
do
|
link
|
p
.red.error_link
=
link
plugins/workflow_report/app/views/workflow_report/build_table.js.erb
View file @
90cbc8e7
$("#data_workflow").html("
<%=
escape_javascript
(
render
partial:
'table_workflow_report'
,
locals:
{
result:
result
,
thead:
thead
}
)
%>
")
$("#data_workflow").html("
<%=
escape_javascript
(
render
partial:
'table_workflow_report'
,
locals:
{
result:
result
,
error_links:
error_links
,
thead:
thead
}
)
%>
")
<%
if
result
.
present?
%>
<%
if
result
.
present?
%>
$('button.export-button').removeClass('d-none')
$('button.export-button').removeClass('d-none')
<%
else
%>
<%
else
%>
...
...
plugins/workflow_report/assets/stylesheets/style.css
View file @
90cbc8e7
#data_workflow
{
#data_workflow
>
table
,
#data_workflow
>
h1
{
overflow
:
auto
;
overflow
:
auto
;
height
:
100vh
;
height
:
100vh
;
}
}
...
@@ -77,3 +77,8 @@ button.export-button {
...
@@ -77,3 +77,8 @@ button.export-button {
#user_ids
{
#user_ids
{
margin-right
:
8px
;
margin-right
:
8px
;
}
}
p
.error_link
{
padding
:
4px
12px
;
color
:
white
;
}
plugins/workflow_report/lib/workflow_report.rb
View file @
90cbc8e7
...
@@ -11,6 +11,7 @@ module WorkflowReport
...
@@ -11,6 +11,7 @@ module WorkflowReport
class
<<
self
class
<<
self
def
build_report
(
year
,
month
,
project_ids
)
def
build_report
(
year
,
month
,
project_ids
)
github
=
Github
.
new
oauth_token:
$workflow_report_config
[
'github_token'
]
github
=
Github
.
new
oauth_token:
$workflow_report_config
[
'github_token'
]
error_links
=
[]
result
=
TABLE_HEADER
.
length
.
times
.
map
{
[]
}
result
=
TABLE_HEADER
.
length
.
times
.
map
{
[]
}
root_ids
=
WorkflowReportIssue
.
find_root_ids
(
year
,
month
,
project_ids
)
root_ids
=
WorkflowReportIssue
.
find_root_ids
(
year
,
month
,
project_ids
)
return
unless
root_ids
.
length
.
positive?
return
unless
root_ids
.
length
.
positive?
...
@@ -57,9 +58,7 @@ module WorkflowReport
...
@@ -57,9 +58,7 @@ module WorkflowReport
result
[
12
]
<<
number_of_est_changes
result
[
12
]
<<
number_of_est_changes
result
[
13
]
<<
notes
result
[
13
]
<<
notes
else
else
result
[
11
]
<<
''
(
11
..
13
).
each
{
|
i
|
result
[
i
]
<<
''
}
result
[
12
]
<<
''
result
[
13
]
<<
''
end
end
pull_request
=
''
pull_request
=
''
jp_request
=
''
jp_request
=
''
...
@@ -105,7 +104,7 @@ module WorkflowReport
...
@@ -105,7 +104,7 @@ module WorkflowReport
end
end
rescue
=>
e
rescue
=>
e
p
"Error in ISSUE link
#{
jp_request
}
"
error_links
<<
"Error occurred during the build with the ISSUE link:
#{
jp_request
}
"
result
[
33
].
push
(
''
)
result
[
33
].
push
(
''
)
end
end
else
else
...
@@ -132,7 +131,7 @@ module WorkflowReport
...
@@ -132,7 +131,7 @@ module WorkflowReport
pr
[
:pr_changed_files
]
+=
pr_detail
.
changed_files
pr
[
:pr_changed_files
]
+=
pr_detail
.
changed_files
end
end
rescue
=>
e
rescue
=>
e
p
"Error in PR link
#{
link
}
"
error_links
<<
"Error occurred during the build with the PR link:
#{
link
}
"
end
end
end
end
end
end
...
@@ -141,7 +140,7 @@ module WorkflowReport
...
@@ -141,7 +140,7 @@ module WorkflowReport
end
end
end
end
result
{
workflow_report:
result
,
error_links:
error_links
}
end
end
private
private
...
...
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