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
Labels
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Rafael Monnerat
slapos.core
Commits
f62ccafe
Commit
f62ccafe
authored
Dec 06, 2021
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Plain Diff
rss_style: include guid in tickets RSS
See merge request
nexedi/slapos.core!351
parents
19b3eac1
df57bbe4
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
129 additions
and
0 deletions
+129
-0
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
...ateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
+42
-0
master/bt5/slapos_rss_style/SkinTemplateItem/portal_skins/slapos_rss_style/ComputeNode_view/listbox.xml
...ortal_skins/slapos_rss_style/ComputeNode_view/listbox.xml
+4
-0
master/bt5/slapos_rss_style/SkinTemplateItem/portal_skins/slapos_rss_style/InstanceTree_view/listbox.xml
...rtal_skins/slapos_rss_style/InstanceTree_view/listbox.xml
+4
-0
master/bt5/slapos_rss_style/SkinTemplateItem/portal_skins/slapos_rss_style/Ticket_getRSSGuid.py
...teItem/portal_skins/slapos_rss_style/Ticket_getRSSGuid.py
+9
-0
master/bt5/slapos_rss_style/SkinTemplateItem/portal_skins/slapos_rss_style/Ticket_getRSSGuid.xml
...eItem/portal_skins/slapos_rss_style/Ticket_getRSSGuid.xml
+62
-0
master/bt5/slapos_rss_style/SkinTemplateItem/portal_skins/slapos_rss_style/WebSection_viewCriticalTicketListAsRSS/listbox.xml
..._style/WebSection_viewCriticalTicketListAsRSS/listbox.xml
+4
-0
master/bt5/slapos_rss_style/SkinTemplateItem/portal_skins/slapos_rss_style/WebSection_viewTicketListAsRSS/listbox.xml
...apos_rss_style/WebSection_viewTicketListAsRSS/listbox.xml
+4
-0
No files found.
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
View file @
f62ccafe
...
@@ -28,6 +28,8 @@ from DateTime import DateTime
...
@@ -28,6 +28,8 @@ from DateTime import DateTime
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
import
json
import
json
import
feedparser
def
getFakeSlapState
():
def
getFakeSlapState
():
return
"destroy_requested"
return
"destroy_requested"
...
@@ -1943,3 +1945,43 @@ return "Visited by SupportRequest_trySendNotificationMessage %s %s" % (message_t
...
@@ -1943,3 +1945,43 @@ return "Visited by SupportRequest_trySendNotificationMessage %s %s" % (message_t
support_request
.
getSimulationState
())
support_request
.
getSimulationState
())
class
TestSlapOSSupportRequestRSS
(
TestCRMSkinsMixin
):
def
test_WebSection_viewTicketListAsRSS
(
self
):
person
=
self
.
makePerson
()
module
=
self
.
portal
.
support_request_module
support_request
=
module
.
newContent
(
portal_type
=
"Support Request"
,
title
=
'Help'
,
destination_decision_value
=
person
,
)
self
.
portal
.
event_module
.
newContent
(
portal_type
=
'Web Message'
,
follow_up_value
=
support_request
,
text_content
=
'I need help !'
,
source_value
=
person
,
).
start
()
support_request
.
validate
()
self
.
tic
()
self
.
login
(
person
.
getUserId
())
self
.
portal
.
portal_skins
.
changeSkin
(
'RSS'
)
parsed
=
feedparser
.
parse
(
self
.
portal
.
WebSection_viewTicketListAsRSS
())
self
.
assertFalse
(
parsed
.
bozo
)
first_entry_id
=
[
item
.
id
for
item
in
parsed
.
entries
]
self
.
assertEqual
([
item
.
summary
for
item
in
parsed
.
entries
],
[
'I need help !'
])
self
.
portal
.
event_module
.
newContent
(
portal_type
=
'Web Message'
,
follow_up_value
=
support_request
,
text_content
=
'How can I help you ?'
,
destination_value
=
person
,
).
start
()
self
.
tic
()
self
.
portal
.
portal_skins
.
changeSkin
(
'RSS'
)
parsed
=
feedparser
.
parse
(
self
.
portal
.
WebSection_viewTicketListAsRSS
())
self
.
assertFalse
(
parsed
.
bozo
)
self
.
assertEqual
([
item
.
summary
for
item
in
parsed
.
entries
],
[
'How can I help you ?'
])
self
.
assertNotEqual
([
item
.
id
for
item
in
parsed
.
entries
][
0
],
first_entry_id
)
master/bt5/slapos_rss_style/SkinTemplateItem/portal_skins/slapos_rss_style/ComputeNode_view/listbox.xml
View file @
f62ccafe
...
@@ -127,6 +127,10 @@
...
@@ -127,6 +127,10 @@
<string>
title
</string>
<string>
title
</string>
<string>
Title
</string>
<string>
Title
</string>
</tuple>
</tuple>
<tuple>
<string>
Ticket_getRSSGuid
</string>
<string>
guid
</string>
</tuple>
<tuple>
<tuple>
<string>
modification_date
</string>
<string>
modification_date
</string>
<string>
pubDate
</string>
<string>
pubDate
</string>
...
...
master/bt5/slapos_rss_style/SkinTemplateItem/portal_skins/slapos_rss_style/InstanceTree_view/listbox.xml
View file @
f62ccafe
...
@@ -127,6 +127,10 @@
...
@@ -127,6 +127,10 @@
<string>
title
</string>
<string>
title
</string>
<string>
Title
</string>
<string>
Title
</string>
</tuple>
</tuple>
<tuple>
<string>
Ticket_getRSSGuid
</string>
<string>
guid
</string>
</tuple>
<tuple>
<tuple>
<string>
modification_date
</string>
<string>
modification_date
</string>
<string>
pubDate
</string>
<string>
pubDate
</string>
...
...
master/bt5/slapos_rss_style/SkinTemplateItem/portal_skins/slapos_rss_style/Ticket_getRSSGuid.py
0 → 100644
View file @
f62ccafe
latest_event_relative_url
=
''
latest_event
=
context
.
Ticket_getLatestEvent
()
if
latest_event
:
latest_event_relative_url
=
latest_event
.
getRelativeUrl
()
return
'{}-{}'
.
format
(
context
.
getRelativeUrl
(),
latest_event_relative_url
,
)
master/bt5/slapos_rss_style/SkinTemplateItem/portal_skins/slapos_rss_style/Ticket_getRSSGuid.xml
0 → 100644
View file @
f62ccafe
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Ticket_getRSSGuid
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_rss_style/SkinTemplateItem/portal_skins/slapos_rss_style/WebSection_viewCriticalTicketListAsRSS/listbox.xml
View file @
f62ccafe
...
@@ -127,6 +127,10 @@
...
@@ -127,6 +127,10 @@
<string>
title
</string>
<string>
title
</string>
<string>
Title
</string>
<string>
Title
</string>
</tuple>
</tuple>
<tuple>
<string>
Ticket_getRSSGuid
</string>
<string>
guid
</string>
</tuple>
<tuple>
<tuple>
<string>
modification_date
</string>
<string>
modification_date
</string>
<string>
pubDate
</string>
<string>
pubDate
</string>
...
...
master/bt5/slapos_rss_style/SkinTemplateItem/portal_skins/slapos_rss_style/WebSection_viewTicketListAsRSS/listbox.xml
View file @
f62ccafe
...
@@ -127,6 +127,10 @@
...
@@ -127,6 +127,10 @@
<string>
title
</string>
<string>
title
</string>
<string>
Title
</string>
<string>
Title
</string>
</tuple>
</tuple>
<tuple>
<string>
Ticket_getRSSGuid
</string>
<string>
guid
</string>
</tuple>
<tuple>
<tuple>
<string>
modification_date
</string>
<string>
modification_date
</string>
<string>
pubDate
</string>
<string>
pubDate
</string>
...
...
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