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
Ivan Tyagov
slapos.core
Commits
03ee21ca
Commit
03ee21ca
authored
Apr 05, 2023
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Plain Diff
Instance tree fast input
See merge request
nexedi/slapos.core!504
parents
47ff8c75
ad8d64de
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
316 additions
and
4 deletions
+316
-4
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_instance_tree_view_js.js
...module/rjs_gadget_erp5_page_slap_instance_tree_view_js.js
+17
-1
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_instance_tree_view_js.xml
...odule/rjs_gadget_erp5_page_slap_instance_tree_view_js.xml
+2
-2
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/InstanceTree_getFastInputDict.py
...ns/slapos_hal_json_style/InstanceTree_getFastInputDict.py
+15
-0
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/InstanceTree_getFastInputDict.xml
...s/slapos_hal_json_style/InstanceTree_getFastInputDict.xml
+62
-0
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/InstanceTree_viewAsHateoas.xml
...kins/slapos_hal_json_style/InstanceTree_viewAsHateoas.xml
+1
-0
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/InstanceTree_viewAsHateoas/my_fast_input_dict.xml
...n_style/InstanceTree_viewAsHateoas/my_fast_input_dict.xml
+134
-0
master/bt5/slapos_jio/TestTemplateItem/portal_components/test.erp5.testSlapOSHalJsonStyleSkins.py
...ortal_components/test.erp5.testSlapOSHalJsonStyleSkins.py
+81
-0
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/SoftwareProduct_getSortedSoftwareReleaseList.py
...lapos_pdm/SoftwareProduct_getSortedSoftwareReleaseList.py
+3
-0
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/SoftwareProduct_getSortedSoftwareReleaseList.xml
...apos_pdm/SoftwareProduct_getSortedSoftwareReleaseList.xml
+1
-1
No files found.
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_instance_tree_view_js.js
View file @
03ee21ca
...
...
@@ -490,6 +490,18 @@
});
})
.
push
(
function
()
{
var
fast_input_dict
=
{
command
:
"
display
"
,
options
:
{
page
:
"
slap_intent
"
,
intent
:
"
request
"
,
shared
:
1
,
sofware_type
:
gadget
.
state
.
doc
.
source_reference
,
software_release
:
gadget
.
state
.
doc
.
url_string
,
sla_xml
:
gadget
.
state
.
doc
.
fast_input_dict
.
sla_xml
,
strict
:
"
True
"
}
};
return
RSVP
.
all
([
gadget
.
getUrlFor
({
command
:
"
change
"
,
options
:
{
editable
:
true
}}),
gadget
.
getUrlFor
({
command
:
"
change
"
,
options
:
{
"
page
"
:
"
slap_add_related_ticket
"
}}),
...
...
@@ -498,7 +510,8 @@
gadget
.
getUrlFor
({
command
:
"
change
"
,
options
:
{
"
page
"
:
"
slap_destroy_instance_tree
"
}}),
gadget
.
getUrlFor
({
command
:
"
change
"
,
options
:
{
page
:
"
slap_rss_ticket
"
}}),
gadget
.
getUrlFor
({
command
:
'
history_previous
'
}),
gadget
.
getUrlFor
({
command
:
"
change
"
,
options
:
{
page
:
"
slap_transfer_instance_tree
"
}})
gadget
.
getUrlFor
({
command
:
"
change
"
,
options
:
{
page
:
"
slap_transfer_instance_tree
"
}}),
gadget
.
getUrlFor
(
fast_input_dict
)
]);
})
.
push
(
function
(
url_list
)
{
...
...
@@ -517,6 +530,9 @@
if
(
gadget
.
state
.
doc
.
slap_state
===
"
stop_requested
"
)
{
header_dict
.
start_url
=
url_list
[
2
];
}
if
(
gadget
.
state
.
doc
.
fast_input_dict
.
enabled
!==
undefined
)
{
header_dict
.
fast_input_url
=
url_list
[
8
];
}
if
(
!
gadget
.
state
.
editable
)
{
header_dict
.
edit_content
=
url_list
[
0
];
}
...
...
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_instance_tree_view_js.xml
View file @
03ee21ca
...
...
@@ -238,7 +238,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
100
4.26872.6486.682
</string>
</value>
<value>
<string>
100
7.21760.63093.46916
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -258,7 +258,7 @@
</tuple>
<state>
<tuple>
<float>
16
69310224.29
</float>
<float>
16
79945002.44
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/InstanceTree_getFastInputDict.py
0 → 100644
View file @
03ee21ca
# Recommendation, keep as simple as possible.
# Use string in url because there are multiple products for ORS,
# and it would be a costly query and require Manager Proxy role.
if
context
.
getRootSlave
():
return
{}
for
sr_string
in
[
'software/re6stnet/'
,
'software/caddy-frontend/'
]:
if
context
.
getSuccessorReference
()
is
not
None
and
sr_string
in
context
.
getUrlString
(
''
):
return
{
'enabled'
:
True
,
'sla_xml'
:
'<parameter id="instance_guid">%s</parameter>'
%
context
.
getSuccessorReference
()
}
return
{}
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/InstanceTree_getFastInputDict.xml
0 → 100644
View file @
03ee21ca
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</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>
**kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
InstanceTree_getFastInputDict
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/InstanceTree_viewAsHateoas.xml
View file @
03ee21ca
...
...
@@ -114,6 +114,7 @@
<string>
my_source_project_title
</string>
<string>
my_source_title
</string>
<string>
my_list_image
</string>
<string>
my_fast_input_dict
</string>
</list>
</value>
</item>
...
...
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/InstanceTree_viewAsHateoas/my_fast_input_dict.xml
0 → 100644
View file @
03ee21ca
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ProxyField"
module=
"Products.ERP5Form.ProxyField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
delegated_list
</string>
</key>
<value>
<list>
<string>
default
</string>
<string>
title
</string>
</list>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
my_fast_input_dict
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
external_validator_failed
</string>
</key>
<value>
<string>
The input failed the external validator.
</string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
overrides
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
default
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
items
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
default
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
field_id
</string>
</key>
<value>
<string>
my_string_field
</string>
</value>
</item>
<item>
<key>
<string>
form_id
</string>
</key>
<value>
<string>
Base_viewFieldLibrary
</string>
</value>
</item>
<item>
<key>
<string>
items
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string>
Click to edit the target
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Fast Input Dict
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"TALESMethod"
module=
"Products.Formulator.TALESField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_text
</string>
</key>
<value>
<string>
here/InstanceTree_getFastInputDict
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_jio/TestTemplateItem/portal_components/test.erp5.testSlapOSHalJsonStyleSkins.py
View file @
03ee21ca
...
...
@@ -1659,3 +1659,84 @@ class TestBase_getAttentionPointList(TestSlapOSHalJsonStyleMixin):
attention_point_list
=
json
.
loads
(
support_request_module
.
Base_getAttentionPointList
())
self
.
assertEqual
(
attention_point_list
,
[])
class
TestInstanceTree_getFastInputDict
(
TestSlapOSHalJsonStyleMixin
):
def
afterSetUp
(
self
):
self
.
instance_tree
=
self
.
portal
.
instance_tree_module
.
newContent
(
portal_type
=
"Instance Tree"
)
self
.
software_instance
=
self
.
portal
.
software_instance_module
.
newContent
(
portal_type
=
"Software Instance"
)
TestSlapOSHalJsonStyleMixin
.
afterSetUp
(
self
)
def
testInstanceTree_getFastInputDict_noUrlString
(
self
):
self
.
assertEqual
({},
self
.
instance_tree
.
InstanceTree_getFastInputDict
())
def
testInstanceTree_getFastInputDict_re6st_no_instance
(
self
):
self
.
instance_tree
.
setUrlString
(
self
.
portal
.
software_release_module
.
re6st
.
getUrlString
())
self
.
assertEqual
({},
self
.
instance_tree
.
InstanceTree_getFastInputDict
())
def
testInstanceTree_getFastInputDict_frontend_no_instance
(
self
):
self
.
instance_tree
.
setUrlString
(
self
.
portal
.
software_release_module
.
frontend
.
getUrlString
())
self
.
assertEqual
({},
self
.
instance_tree
.
InstanceTree_getFastInputDict
())
def
testInstanceTree_getFastInputDict_slave_re6st
(
self
):
self
.
instance_tree
.
setRootSlave
(
True
)
self
.
instance_tree
.
setUrlString
(
self
.
portal
.
software_release_module
.
re6st
.
getUrlString
())
slave_instance
=
self
.
portal
.
software_instance_module
.
newContent
(
portal_type
=
"Slave Instance"
,
specialise_value
=
self
.
instance_tree
)
self
.
instance_tree
.
setSuccessorValue
(
slave_instance
)
self
.
assertEqual
({},
self
.
instance_tree
.
InstanceTree_getFastInputDict
())
def
testInstanceTree_getFastInputDict_slave_frontend
(
self
):
self
.
instance_tree
.
setRootSlave
(
True
)
slave_instance
=
self
.
portal
.
software_instance_module
.
newContent
(
portal_type
=
"Slave Instance"
,
specialise_value
=
self
.
instance_tree
)
self
.
instance_tree
.
setSuccessorValue
(
slave_instance
)
self
.
instance_tree
.
setUrlString
(
self
.
portal
.
software_release_module
.
frontend
.
getUrlString
())
self
.
assertEqual
({},
self
.
instance_tree
.
InstanceTree_getFastInputDict
())
def
testInstanceTree_getFastInputDict_re6st
(
self
):
self
.
instance_tree
.
setUrlString
(
self
.
portal
.
software_release_module
.
re6st
.
getUrlString
())
software_instance
=
self
.
portal
.
software_instance_module
.
newContent
(
portal_type
=
"Software Instance"
,
specialise_value
=
self
.
instance_tree
,
reference
=
"TESTSOFTINST-%s"
%
self
.
generateNewId
()
)
self
.
instance_tree
.
setSuccessorValue
(
software_instance
)
self
.
instance_tree
.
setUrlString
(
self
.
portal
.
software_release_module
.
re6st
.
getUrlString
())
self
.
assertEqual
({
'enabled'
:
True
,
'sla_xml'
:
'<parameter id="instance_guid">%s</parameter>'
%
software_instance
.
getReference
()
},
self
.
instance_tree
.
InstanceTree_getFastInputDict
())
def
testInstanceTree_getFastInputDict_frontend
(
self
):
software_instance
=
self
.
portal
.
software_instance_module
.
newContent
(
portal_type
=
"Software Instance"
,
specialise_value
=
self
.
instance_tree
,
reference
=
"TESTSOFTINST-%s"
%
self
.
generateNewId
()
)
self
.
instance_tree
.
setSuccessorValue
(
software_instance
)
self
.
instance_tree
.
setUrlString
(
self
.
portal
.
software_release_module
.
frontend
.
getUrlString
())
self
.
assertEqual
({
'enabled'
:
True
,
'sla_xml'
:
'<parameter id="instance_guid">%s</parameter>'
%
software_instance
.
getReference
()
},
self
.
instance_tree
.
InstanceTree_getFastInputDict
())
\ No newline at end of file
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/SoftwareProduct_getSortedSoftwareReleaseList.py
View file @
03ee21ca
...
...
@@ -14,6 +14,9 @@ if software_product_reference is None:
)
if
not
software_release
:
return
[]
if
strict
:
return
[
software_release
]
software_product_reference
=
software_release
.
getAggregateReference
()
if
not
software_product_reference
:
...
...
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/SoftwareProduct_getSortedSoftwareReleaseList.xml
View file @
03ee21ca
...
...
@@ -50,7 +50,7 @@
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
software_product_reference=None, software_release_url=None
</string>
</value>
<value>
<string>
software_product_reference=None, software_release_url=None
, strict=None
</string>
</value>
</item>
<item>
<key>
<string>
id
</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