Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Titouan Soulard
slapos.core
Commits
12c90edb
Commit
12c90edb
authored
Sep 28, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_crm: use notification message title instead of the ticket title
parent
c5cfb33b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
11 deletions
+65
-11
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Ticket_createProjectEvent.py
..._skins/slapos_crm_monitoring/Ticket_createProjectEvent.py
+5
-1
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py
...ateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py
+60
-10
No files found.
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Ticket_createProjectEvent.py
View file @
12c90edb
...
...
@@ -23,7 +23,6 @@ else:
event_kw
=
{
'portal_type'
:
portal_type
,
'title'
:
title
,
'resource'
:
resource
,
'source'
:
source_relative_url
,
'source_section'
:
source_section_relative_url
,
...
...
@@ -48,6 +47,11 @@ if notification_message:
substitution_method_parameter_dict
=
substitution_method_parameter_dict
)
# Prefer using the notification message title
# as it will be correctly translated
if
not
event
.
hasTitle
():
event
.
edit
(
title
=
title
)
if
not
keep_draft
:
if
direction
==
'incoming'
:
# Support event_workflow and event_simulation_workflow
...
...
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py
View file @
12c90edb
...
...
@@ -633,7 +633,12 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort)
self
.
assertEqual
(
len
(
event_list
),
1
)
event
=
event_list
[
0
]
self
.
assertEqual
(
event
.
getTitle
(),
ticket
.
getTitle
())
self
.
assertEqual
(
event
.
getTitle
(),
self
.
portal
.
restrictedTraverse
(
self
.
portal
.
REQUEST
[
'test_ComputeNode_checkSoftwareInstallationState_notify'
]
).
getTitle
()
)
self
.
assertIn
(
compute_node
.
getReference
(),
event
.
getTextContent
())
self
.
assertEqual
(
event
.
getFollowUp
(),
ticket
.
getRelativeUrl
())
self
.
assertEqual
(
event
.
getSourceProject
(),
compute_node
.
getFollowUp
())
...
...
@@ -665,7 +670,12 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort)
self
.
assertEqual
(
len
(
event_list
),
1
)
event
=
event_list
[
0
]
self
.
assertEqual
(
event
.
getTitle
(),
ticket
.
getTitle
())
self
.
assertEqual
(
event
.
getTitle
(),
self
.
portal
.
restrictedTraverse
(
self
.
portal
.
REQUEST
[
'test_ComputeNode_checkSoftwareInstallationState_notify'
]
).
getTitle
()
)
self
.
assertIn
(
compute_node
.
getReference
(),
event
.
getTextContent
())
self
.
assertEqual
(
event
.
getFollowUp
(),
ticket
.
getRelativeUrl
())
self
.
assertEqual
(
event
.
getSourceProject
(),
compute_node
.
getFollowUp
())
...
...
@@ -708,7 +718,12 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort)
self
.
assertEqual
(
len
(
event_list
),
1
)
event
=
event_list
[
0
]
self
.
assertEqual
(
event
.
getTitle
(),
ticket
.
getTitle
())
self
.
assertEqual
(
event
.
getTitle
(),
self
.
portal
.
restrictedTraverse
(
self
.
portal
.
REQUEST
[
'test_ComputeNode_checkSoftwareInstallationState_notify'
]
).
getTitle
()
)
self
.
assertIn
(
compute_node
.
getReference
(),
event
.
getTextContent
())
self
.
assertEqual
(
event
.
getFollowUp
(),
ticket
.
getRelativeUrl
())
self
.
assertEqual
(
event
.
getSourceProject
(),
compute_node
.
getFollowUp
())
...
...
@@ -752,7 +767,12 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort)
self
.
assertEqual
(
len
(
event_list
),
1
)
event
=
event_list
[
0
]
self
.
assertEqual
(
event
.
getTitle
(),
ticket
.
getTitle
())
self
.
assertEqual
(
event
.
getTitle
(),
self
.
portal
.
restrictedTraverse
(
self
.
portal
.
REQUEST
[
'test_ComputeNode_checkState_stalled_instance'
]
).
getTitle
()
)
self
.
assertIn
(
compute_node
.
getReference
(),
event
.
getTextContent
())
self
.
assertEqual
(
event
.
getFollowUp
(),
ticket
.
getRelativeUrl
())
self
.
assertEqual
(
event
.
getSourceProject
(),
compute_node
.
getFollowUp
())
...
...
@@ -845,7 +865,12 @@ class TestSlapOSCrmMonitoringCheckComputeNodeSoftwareInstallation(SlapOSTestCase
self
.
assertEqual
(
len
(
event_list
),
1
)
event
=
event_list
[
0
]
self
.
assertEqual
(
event
.
getTitle
(),
ticket
.
getTitle
())
self
.
assertEqual
(
event
.
getTitle
(),
self
.
portal
.
restrictedTraverse
(
self
.
portal
.
REQUEST
[
'test_ComputeNode_checkState_notify'
]
).
getTitle
()
)
self
.
assertIn
(
compute_node
.
getReference
(),
event
.
getTextContent
())
self
.
assertEqual
(
event
.
getFollowUp
(),
ticket
.
getRelativeUrl
())
self
.
assertEqual
(
event
.
getSourceProject
(),
compute_node
.
getFollowUp
())
...
...
@@ -889,7 +914,12 @@ class TestSlapOSCrmMonitoringCheckComputeNodeSoftwareInstallation(SlapOSTestCase
self
.
assertEqual
(
len
(
event_list
),
1
)
event
=
event_list
[
0
]
self
.
assertEqual
(
event
.
getTitle
(),
ticket
.
getTitle
())
self
.
assertEqual
(
event
.
getTitle
(),
self
.
portal
.
restrictedTraverse
(
self
.
portal
.
REQUEST
[
'test_ComputeNode_checkState_empty_cache_notify'
]
).
getTitle
()
)
self
.
assertIn
(
compute_node
.
getReference
(),
event
.
getTextContent
())
self
.
assertEqual
(
event
.
getFollowUp
(),
ticket
.
getRelativeUrl
())
self
.
assertEqual
(
event
.
getSourceProject
(),
compute_node
.
getFollowUp
())
...
...
@@ -961,7 +991,12 @@ class TestSlapOSCrmMonitoringCheckComputeNodeSoftwareInstallation(SlapOSTestCase
self
.
assertEqual
(
len
(
event_list
),
1
)
event
=
event_list
[
0
]
self
.
assertEqual
(
event
.
getTitle
(),
ticket
.
getTitle
())
self
.
assertEqual
(
event
.
getTitle
(),
self
.
portal
.
restrictedTraverse
(
self
.
portal
.
REQUEST
[
'test_ComputeNode_checkState_stalled_instance'
]
).
getTitle
()
)
self
.
assertIn
(
compute_node
.
getReference
(),
event
.
getTextContent
())
self
.
assertEqual
(
event
.
getFollowUp
(),
ticket
.
getRelativeUrl
())
self
.
assertEqual
(
event
.
getSourceProject
(),
compute_node
.
getFollowUp
())
...
...
@@ -1089,7 +1124,12 @@ class TestSlapOSCrmMonitoringCheckInstanceInError(SlapOSTestCaseMixinWithAbort):
self
.
assertEqual
(
len
(
event_list
),
1
)
event
=
event_list
[
0
]
self
.
assertEqual
(
event
.
getTitle
(),
ticket
.
getTitle
())
self
.
assertEqual
(
event
.
getTitle
(),
self
.
portal
.
restrictedTraverse
(
self
.
portal
.
REQUEST
[
'test_InstanceTree_checkSoftwareInstanceState_notify'
]
).
getTitle
()
)
self
.
assertIn
(
instance_tree
.
getReference
(),
event
.
getTextContent
())
self
.
assertEqual
(
event
.
getFollowUp
(),
ticket
.
getRelativeUrl
())
self
.
assertEqual
(
event
.
getSourceProject
(),
instance_tree
.
getFollowUp
())
...
...
@@ -1162,7 +1202,12 @@ class TestSlapOSCrmMonitoringCheckInstanceInError(SlapOSTestCaseMixinWithAbort):
self
.
assertEqual
(
len
(
event_list
),
1
)
event
=
event_list
[
0
]
self
.
assertEqual
(
event
.
getTitle
(),
ticket
.
getTitle
())
self
.
assertEqual
(
event
.
getTitle
(),
self
.
portal
.
restrictedTraverse
(
self
.
portal
.
REQUEST
[
'test_InstanceTree_checkSoftwareInstanceState_notify'
]
).
getTitle
()
)
self
.
assertIn
(
instance_tree
.
getReference
(),
event
.
getTextContent
())
self
.
assertEqual
(
event
.
getFollowUp
(),
ticket
.
getRelativeUrl
())
self
.
assertEqual
(
event
.
getSourceProject
(),
instance_tree
.
getFollowUp
())
...
...
@@ -1340,7 +1385,12 @@ class TestSlaposCrmUpdateSupportRequestState(SlapOSTestCaseMixinWithAbort):
self
.
assertEqual
(
len
(
event_list
),
1
)
event
=
event_list
[
0
]
self
.
assertEqual
(
event
.
getTitle
(),
"Instance Tree was destroyed was destroyed by the user"
)
self
.
assertEqual
(
event
.
getTitle
(),
self
.
portal
.
restrictedTraverse
(
self
.
portal
.
REQUEST
[
'test_SupportRequest_updateMonitoringState_notify'
]
).
getTitle
()
)
self
.
assertIn
(
instance_tree
.
getReference
(),
event
.
getTextContent
())
self
.
assertEqual
(
event
.
getFollowUp
(),
ticket
.
getRelativeUrl
())
self
.
assertEqual
(
event
.
getSourceProject
(),
instance_tree
.
getFollowUp
())
...
...
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