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
Thomas Leymonerie
slapos.core
Commits
cdbdd701
Commit
cdbdd701
authored
Sep 09, 2020
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_jio: Display Regularisation requests on attention point
parent
56c433b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
10 deletions
+36
-10
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Base_getAttentionPointList.py
...skins/slapos_hal_json_style/Base_getAttentionPointList.py
+36
-10
No files found.
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Base_getAttentionPointList.py
View file @
cdbdd701
from
json
import
dumps
from
json
import
dumps
attention_point_list
=
[]
attention_point_list
=
[]
portal
=
context
.
getPortalObject
()
# For now keep the logic here hardcoded.
def
addAttentionForTicket
(
ticket
):
if
context
.
getPortalType
()
==
"Hosting Subscription"
:
msg
=
None
if
ticket
.
getPortalType
()
==
"Support Request"
:
msg
=
context
.
Base_translateString
(
"Ticket waiting your response"
)
elif
ticket
.
getPortalType
()
==
"Upgrade Decision"
:
msg
=
context
.
Base_translateString
(
"Please Upgrade this service"
)
elif
ticket
.
getPortalType
()
==
"Regularisation Request"
:
msg
=
context
.
Base_translateString
(
"Regularisation waiting your response"
)
if
msg
:
return
{
"text"
:
msg
,
"link"
:
ticket
.
getRelativeUrl
()}
# Display unresponded tickets on services or servers
if
context
.
getPortalType
()
in
[
"Hosting Subscription"
,
"Computer"
]:
simulation_state
=
[
"suspended"
,
"confirmed"
]
simulation_state
=
[
"suspended"
,
"confirmed"
]
for
ticket
in
context
.
Base_getOpenRelatedTicketList
(
for
ticket
in
context
.
Base_getOpenRelatedTicketList
(
limit
=
3
,
simulation_state
=
simulation_state
):
limit
=
3
,
simulation_state
=
simulation_state
):
if
ticket
.
getPortalType
()
==
"Support Request"
:
entry
=
addAttentionForTicket
(
ticket
)
attention_point_list
.
append
(
if
entry
is
not
None
:
{
"text"
:
"Ticket waiting your response"
,
attention_point_list
.
append
(
entry
)
"link"
:
ticket
.
getRelativeUrl
()})
elif
ticket
.
getPortalType
()
==
"Upgrade Decision"
:
# This is a limitation of the API that will consider that all tickets
attention_point_list
.
append
(
# Are from this module
{
"text"
:
"Please Upgrade this service"
,
if
context
.
getPortalType
()
in
[
"Support Request Module"
]:
"link"
:
ticket
.
getRelativeUrl
()})
simulation_state
=
[
"suspended"
,
"confirmed"
]
person
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
for
ticket
in
portal
.
portal_catalog
(
portal_type
=
(
"Support Request"
,
"Upgrade Decision"
,
"Regularisation Request"
),
destination_decision_uid
=
person
.
getUid
(),
limit
=
3
,
simulation_state
=
simulation_state
):
entry
=
addAttentionForTicket
(
ticket
)
if
entry
is
not
None
:
attention_point_list
.
append
(
entry
)
return
dumps
(
attention_point_list
)
return
dumps
(
attention_point_list
)
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