Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
92723760
Commit
92723760
authored
Dec 03, 2021
by
Sean Arnold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix image path in escalation email
Add specs for change in behaviour
parent
b72dae3f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
3 deletions
+32
-3
ee/app/mailers/ee/emails/projects.rb
ee/app/mailers/ee/emails/projects.rb
+0
-1
ee/app/models/issuable_metric_image.rb
ee/app/models/issuable_metric_image.rb
+1
-1
ee/app/views/notify/incident_escalation_fired_email.html.haml
...pp/views/notify/incident_escalation_fired_email.html.haml
+1
-1
ee/app/views/notify/incident_escalation_fired_email.text.erb
ee/app/views/notify/incident_escalation_fired_email.text.erb
+7
-0
ee/spec/models/issuable_metric_image_spec.rb
ee/spec/models/issuable_metric_image_spec.rb
+23
-0
No files found.
ee/app/mailers/ee/emails/projects.rb
View file @
92723760
...
@@ -45,7 +45,6 @@ module EE
...
@@ -45,7 +45,6 @@ module EE
def
incident_escalation_fired_email
(
project
,
user
,
issue
)
def
incident_escalation_fired_email
(
project
,
user
,
issue
)
@project
=
project
@project
=
project
@incident
=
issue
.
present
@incident
=
issue
.
present
@escalation_status
=
issue
.
incident_management_issuable_escalation_status
@escalation_status
=
issue
.
incident_management_issuable_escalation_status
add_project_headers
add_project_headers
...
...
ee/app/models/issuable_metric_image.rb
View file @
92723760
...
@@ -33,7 +33,7 @@ class IssuableMetricImage < ApplicationRecord
...
@@ -33,7 +33,7 @@ class IssuableMetricImage < ApplicationRecord
return
file
&
.
url
unless
file
&
.
upload
return
file
&
.
url
unless
file
&
.
upload
# If we're using a CDN, we need to use the full URL
# If we're using a CDN, we need to use the full URL
asset_host
=
ActionController
::
Base
.
asset_host
asset_host
=
ActionController
::
Base
.
asset_host
||
Gitlab
.
config
.
gitlab
.
base_url
local_path
=
Gitlab
::
Routing
.
url_helpers
.
issuable_metric_image_upload_path
(
local_path
=
Gitlab
::
Routing
.
url_helpers
.
issuable_metric_image_upload_path
(
filename:
file
.
filename
,
filename:
file
.
filename
,
id:
file
.
upload
.
model_id
,
id:
file
.
upload
.
model_id
,
...
...
ee/app/views/notify/incident_escalation_fired_email.html.haml
View file @
92723760
...
@@ -23,4 +23,4 @@
...
@@ -23,4 +23,4 @@
%p
%p
=
_
(
'Metrics:'
)
=
_
(
'Metrics:'
)
-
@incident
.
metric_images
.
each
do
|
image
|
-
@incident
.
metric_images
.
each
do
|
image
|
=
link_to
image
.
filename
,
image
.
url
=
link_to
image
.
filename
,
image
.
file_path
ee/app/views/notify/incident_escalation_fired_email.text.erb
View file @
92723760
...
@@ -12,3 +12,10 @@
...
@@ -12,3 +12,10 @@
<%
if
@escalation_status
.
policy
%>
<%
if
@escalation_status
.
policy
%>
<%=
_
(
'Escalation policy:'
)
%>
<%=
@escalation_status
.
policy
.
name
%>
<%=
_
(
'Escalation policy:'
)
%>
<%=
@escalation_status
.
policy
.
name
%>
<%
end
%>
<%
end
%>
<%
if
@incident
.
metric_images
.
any?
%>
<%=
_
(
'Metrics:'
)
%>
<%
@incident
.
metric_images
.
each
do
|
image
|
%>
<%=
image
.
file_path
%>
<%
end
%>
<%
end
%>
ee/spec/models/issuable_metric_image_spec.rb
View file @
92723760
...
@@ -60,4 +60,27 @@ RSpec.describe IssuableMetricImage do
...
@@ -60,4 +60,27 @@ RSpec.describe IssuableMetricImage do
it
{
is_expected
.
to
eq
(
false
)
}
it
{
is_expected
.
to
eq
(
false
)
}
end
end
end
end
describe
'#file_path'
do
let
(
:issuable_metric_image
)
{
create
(
:issuable_metric_image
)
}
let
(
:expected_path
)
{
issuable_metric_image
.
file
.
url
}
subject
(
:file_path
)
{
issuable_metric_image
.
file_path
}
context
'with asset host configured'
do
it
'returns a full URL with the asset host and system path'
do
asset_host
=
'https://gitlab-assets.example.com'
allow
(
ActionController
::
Base
).
to
receive
(
:asset_host
)
{
asset_host
}
expect
(
file_path
).
to
eq
(
"
#{
asset_host
}#{
expected_path
}
"
)
end
end
context
'no asset path configured'
do
it
'returns a full URL with the base url and system path'
do
base_url
=
Gitlab
.
config
.
gitlab
.
base_url
expect
(
file_path
).
to
eq
(
"
#{
base_url
}#{
expected_path
}
"
)
end
end
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