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
Xiaowu Zhang
slapos.core
Commits
392d4037
Commit
392d4037
authored
Dec 01, 2021
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_jio: Now add project via Request Project API
parent
7bb9deec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
41 deletions
+14
-41
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_add_project_js.js
...b_page_module/rjs_gadget_erp5_page_slap_add_project_js.js
+10
-38
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Person_requestProject.py
...rtal_skins/slapos_hal_json_style/Person_requestProject.py
+4
-3
No files found.
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_add_project_js.js
View file @
392d4037
...
...
@@ -12,7 +12,7 @@
.
declareAcquiredMethod
(
"
getSetting
"
,
"
getSetting
"
)
.
declareAcquiredMethod
(
"
getUrlFor
"
,
"
getUrlFor
"
)
.
declareAcquiredMethod
(
"
redirect
"
,
"
redirect
"
)
.
declareAcquiredMethod
(
"
jio_
post
"
,
"
jio_pos
t
"
)
.
declareAcquiredMethod
(
"
jio_
getAttachment
"
,
"
jio_getAttachmen
t
"
)
.
declareAcquiredMethod
(
"
notifySubmitting
"
,
"
notifySubmitting
"
)
.
declareAcquiredMethod
(
"
notifySubmitted
"
,
'
notifySubmitted
'
)
.
declareAcquiredMethod
(
"
getTranslationList
"
,
"
getTranslationList
"
)
...
...
@@ -34,14 +34,19 @@
return
form_gadget
.
getContent
();
})
.
push
(
function
(
doc
)
{
return
gadget
.
jio_post
(
doc
);
return
gadget
.
getSetting
(
"
hateoas_url
"
)
.
push
(
function
(
url
)
{
// This is horrible
return
gadget
.
jio_getAttachment
(
doc
.
parent_relative_url
,
url
+
doc
.
parent_relative_url
+
"
/Person_requestProject?title=
"
+
doc
.
title
);
});
})
.
push
(
function
(
key
)
{
.
push
(
function
(
result
)
{
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
"
:
key
,
"
page
"
:
"
slap_controller
"
}});
"
options
"
:
{
"
jio_key
"
:
result
.
relative_url
,
"
page
"
:
"
slap_controller
"
}});
});
});
})
...
...
@@ -89,39 +94,6 @@
"
hidden
"
:
0
,
"
type
"
:
"
StringField
"
},
"
my_description
"
:
{
"
description
"
:
result
[
2
][
1
],
"
title
"
:
result
[
2
][
3
],
"
default
"
:
""
,
"
css_class
"
:
""
,
"
required
"
:
0
,
"
editable
"
:
1
,
"
key
"
:
"
description
"
,
"
hidden
"
:
0
,
"
type
"
:
"
TextAreaField
"
},
"
my_destination_decision
"
:
{
"
description
"
:
""
,
"
title
"
:
result
[
2
][
4
],
"
default
"
:
result
[
1
],
"
css_class
"
:
""
,
"
required
"
:
1
,
"
editable
"
:
1
,
"
key
"
:
"
destination_decision
"
,
"
hidden
"
:
1
,
"
type
"
:
"
StringField
"
},
"
my_portal_type
"
:
{
"
description
"
:
result
[
2
][
1
],
"
title
"
:
result
[
2
][
5
],
"
default
"
:
"
Project
"
,
"
css_class
"
:
""
,
"
required
"
:
1
,
"
editable
"
:
1
,
"
key
"
:
"
portal_type
"
,
"
hidden
"
:
1
,
"
type
"
:
"
StringField
"
},
"
my_parent_relative_url
"
:
{
"
description
"
:
""
,
"
title
"
:
result
[
2
][
7
],
...
...
@@ -144,7 +116,7 @@
form_definition
:
{
group_list
:
[[
"
left
"
,
[[
"
my_title
"
],
[
"
my_
description
"
],
[
"
my_destination_decision
"
],
[
"
my_portal_type
"
],
[
"
my_
parent_relative_url
"
]]
[[
"
my_title
"
],
[
"
my_parent_relative_url
"
]]
]]
}
});
...
...
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Person_requestProject.py
View file @
392d4037
...
...
@@ -10,9 +10,10 @@ if person is None:
else
:
request_kw
=
dict
(
project_title
=
title
)
person
.
requestProject
(
**
request_kw
)
project
=
context
.
restrictedTraverse
(
context
.
REQUEST
.
get
(
'project'
))
project_relative_url
=
context
.
REQUEST
.
get
(
'project_relative_url'
)
project_reference
=
context
.
REQUEST
.
get
(
'project_reference'
)
return
json
.
dumps
({
"reference"
:
project
.
getReference
()
,
"relative_url"
:
project
.
getRelativeUrl
()
"reference"
:
project
_reference
,
"relative_url"
:
project
_relative_url
})
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