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
Jérome Perrin
slapos.core
Commits
560c946f
Commit
560c946f
authored
Sep 22, 2022
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_jio: Fixup Support Request Close
Events are creates via script (and API) now, instead jio_post.
parent
691c77ac
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
81 deletions
+55
-81
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_close_ticket_js.js
..._page_module/rjs_gadget_erp5_page_slap_close_ticket_js.js
+27
-73
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_close_ticket_js.xml
...page_module/rjs_gadget_erp5_page_slap_close_ticket_js.xml
+3
-3
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/SupportRequest_close.py
...ortal_skins/slapos_hal_json_style/SupportRequest_close.py
+24
-4
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/SupportRequest_close.xml
...rtal_skins/slapos_hal_json_style/SupportRequest_close.xml
+1
-1
No files found.
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_close_ticket_js.js
View file @
560c946f
...
...
@@ -16,6 +16,8 @@
.
declareAcquiredMethod
(
"
jio_putAttachment
"
,
"
jio_putAttachment
"
)
.
declareAcquiredMethod
(
"
jio_get
"
,
"
jio_get
"
)
.
declareAcquiredMethod
(
"
getTranslationList
"
,
"
getTranslationList
"
)
.
declareAcquiredMethod
(
"
notifySubmitting
"
,
"
notifySubmitting
"
)
.
declareAcquiredMethod
(
"
notifySubmitted
"
,
"
notifySubmitted
"
)
/////////////////////////////////////////////////////////////////
// declared methods
...
...
@@ -26,24 +28,28 @@
.
onEvent
(
'
submit
'
,
function
()
{
var
gadget
=
this
;
return
gadget
.
getDeclaredGadget
(
'
form_view
'
)
return
gadget
.
notifySubmitting
()
.
push
(
function
()
{
return
gadget
.
getDeclaredGadget
(
'
form_view
'
);
})
.
push
(
function
(
form_gadget
)
{
return
form_gadget
.
getContent
();
return
RSVP
.
all
([
form_gadget
.
getContent
(),
gadget
.
getSetting
(
'
hateoas_url
'
)]);
})
.
push
(
function
(
doc
)
{
return
gadget
.
jio_post
(
doc
)
.
push
(
function
()
{
return
gadget
.
getSetting
(
"
hateoas_url
"
);
})
.
push
(
function
(
url
)
{
return
gadget
.
jio_putAttachment
(
doc
.
follow_up
,
url
+
doc
.
follow_up
+
"
/SupportRequest_close
"
,
{});
});
.
push
(
function
(
result
)
{
var
doc
=
result
[
0
],
url
=
result
[
1
];
return
gadget
.
jio_putAttachment
(
gadget
.
state
.
jio_key
,
url
+
gadget
.
state
.
jio_key
+
"
/SupportRequest_close
"
,
{
text_content
:
doc
.
text_content
});
})
.
push
(
function
()
{
return
gadget
.
redirect
({
"
command
"
:
"
change
"
,
"
options
"
:
{
"
jio_key
"
:
gadget
.
state
.
jio_key
,
"
page
"
:
"
slap_controller
"
}});
return
gadget
.
notifySubmitted
({
message
:
gadget
.
message_translation
,
status
:
'
success
'
})
.
push
(
function
()
{
// Workaround, find a way to open document without break gadget.
return
gadget
.
redirect
({
"
command
"
:
"
change
"
,
"
options
"
:
{
"
jio_key
"
:
gadget
.
state
.
jio_key
,
"
page
"
:
"
slap_controller
"
}});
});
});
})
...
...
@@ -60,11 +66,6 @@
"
Close:
"
,
"
Your Close Message
"
,
"
Include your close message
"
,
"
Source
"
,
"
Follow up
"
,
"
Portal Type
"
,
"
Web Message
"
,
"
Parent Relative Url
"
,
"
Close Ticket
"
];
gadget
.
state
.
jio_key
=
options
.
jio_key
;
...
...
@@ -73,20 +74,19 @@
.
push
(
function
()
{
return
RSVP
.
all
([
gadget
.
getDeclaredGadget
(
'
form_view
'
),
gadget
.
getSetting
(
'
me
'
),
gadget
.
jio_get
(
gadget
.
state
.
jio_key
),
gadget
.
getTranslationList
(
translation_list
)
]);
})
.
push
(
function
(
result
)
{
page_title_translation
=
result
[
3
][
10
];
page_title_translation
=
result
[
2
][
5
];
return
result
[
0
].
render
({
erp5_document
:
{
"
_embedded
"
:
{
"
_view
"
:
{
"
my_title
"
:
{
"
description
"
:
result
[
3
][
0
],
"
title
"
:
result
[
3
][
1
],
"
default
"
:
result
[
3
][
2
]
+
"
"
+
result
[
2
].
title
,
"
description
"
:
result
[
2
][
0
],
"
title
"
:
result
[
2
][
1
],
"
default
"
:
result
[
2
][
2
]
+
"
"
+
result
[
1
].
title
,
"
css_class
"
:
""
,
"
required
"
:
1
,
"
editable
"
:
1
,
...
...
@@ -95,8 +95,8 @@
"
type
"
:
"
StringField
"
},
"
my_text_content
"
:
{
"
description
"
:
result
[
3
][
3
],
"
title
"
:
result
[
3
][
4
],
"
description
"
:
result
[
2
][
3
],
"
title
"
:
result
[
2
][
4
],
"
default
"
:
""
,
"
css_class
"
:
""
,
"
required
"
:
1
,
...
...
@@ -104,50 +104,6 @@
"
key
"
:
"
text_content
"
,
"
hidden
"
:
0
,
"
type
"
:
"
TextAreaField
"
},
"
my_source
"
:
{
"
description
"
:
""
,
"
title
"
:
result
[
3
][
5
],
"
default
"
:
result
[
1
],
"
css_class
"
:
""
,
"
required
"
:
1
,
"
editable
"
:
1
,
"
key
"
:
"
source
"
,
"
hidden
"
:
1
,
"
type
"
:
"
StringField
"
},
"
my_follow_up
"
:
{
"
description
"
:
""
,
"
title
"
:
result
[
3
][
6
],
"
default
"
:
gadget
.
state
.
jio_key
,
"
css_class
"
:
""
,
"
required
"
:
1
,
"
editable
"
:
1
,
"
key
"
:
"
follow_up
"
,
"
hidden
"
:
1
,
"
type
"
:
"
StringField
"
},
"
my_portal_type
"
:
{
"
description
"
:
result
[
3
][
0
],
"
title
"
:
result
[
3
][
7
],
"
default
"
:
"
Web Message
"
,
"
css_class
"
:
""
,
"
required
"
:
1
,
"
editable
"
:
1
,
"
key
"
:
"
portal_type
"
,
"
hidden
"
:
1
,
"
type
"
:
"
StringField
"
},
"
my_parent_relative_url
"
:
{
"
description
"
:
""
,
"
title
"
:
result
[
3
][
9
],
"
default
"
:
"
event_module
"
,
"
css_class
"
:
""
,
"
required
"
:
1
,
"
editable
"
:
1
,
"
key
"
:
"
parent_relative_url
"
,
"
hidden
"
:
1
,
"
type
"
:
"
StringField
"
}
}},
"
_links
"
:
{
...
...
@@ -160,9 +116,7 @@
form_definition
:
{
group_list
:
[[
"
center
"
,
[[
"
my_title
"
],
[
"
my_text_content
"
],
[
"
my_follow_up
"
],
[
"
my_portal_type
"
],
[
"
my_parent_relative_url
"
],
[
"
my_follow_up
"
],
[
"
my_source
"
]]
[[
"
my_title
"
],
[
"
my_text_content
"
]]
]]
}
});
...
...
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_close_ticket_js.xml
View file @
560c946f
...
...
@@ -263,7 +263,7 @@
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zop
e
</string>
</value>
<value>
<string>
ERP5TypeTestCas
e
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
...
...
@@ -277,7 +277,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
987.11835.5812.36437
</string>
</value>
<value>
<string>
1003.8785.37917.1416
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -295,7 +295,7 @@
</tuple>
<state>
<tuple>
<float>
16
02260828.2
</float>
<float>
16
63870250.25
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/SupportRequest_close.py
View file @
560c946f
import
json
portal
=
context
.
getPortalObject
()
person
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
if
context
.
getPortalType
()
==
"Support Request"
and
\
person
.
getRelativeUrl
()
==
context
.
getDestinationDecision
()
and
\
context
.
getValidationState
()
!=
"invalidated"
:
context
.
invalidate
()
request
=
context
.
REQUEST
response
=
request
.
RESPONSE
if
person
is
None
:
response
.
setStatus
(
403
)
else
:
request_kw
=
{
"event_title"
:
"Close: %s"
%
context
.
getTitle
(),
"event_content"
:
text_content
,
"event_source"
:
person
.
getRelativeUrl
()
}
context
.
requestEvent
(
**
request_kw
)
if
context
.
getPortalType
()
==
"Support Request"
and
\
context
.
getSimulationState
()
!=
"invalidated"
:
context
.
invalidate
()
event_relative_url
=
request
.
get
(
'event_relative_url'
)
response
.
setHeader
(
'Content-Type'
,
"application/json"
)
return
json
.
dumps
({
"relative_url"
:
event_relative_url
})
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/SupportRequest_close.xml
View file @
560c946f
...
...
@@ -50,7 +50,7 @@
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string></string>
</value>
<value>
<string>
text_content
</string>
</value>
</item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
...
...
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