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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
d37b9aec
Commit
d37b9aec
authored
Oct 04, 2024
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_panel: factorize the schema url calculation in a python script
parent
977467b2
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
2 deletions
+74
-2
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSCodingStyle.py
...Item/portal_components/test.erp5.testSlapOSCodingStyle.py
+1
-0
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/InstanceTree_viewParameterDialog/your_instance_xml.xml
...el/InstanceTree_viewParameterDialog/your_instance_xml.xml
+1
-1
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Project_getSoftwareReleaseSchemaUrl.py
...skins/slapos_panel/Project_getSoftwareReleaseSchemaUrl.py
+9
-0
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Project_getSoftwareReleaseSchemaUrl.xml
...kins/slapos_panel/Project_getSoftwareReleaseSchemaUrl.xml
+62
-0
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Project_viewRequestInstanceTreeDialog/your_text_content.xml
...oject_viewRequestInstanceTreeDialog/your_text_content.xml
+1
-1
No files found.
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSCodingStyle.py
View file @
d37b9aec
...
...
@@ -258,6 +258,7 @@ def makeTestSlapOSCodingStyleTestCase(tested_business_template):
'slapos_panel/Project_addSlapOSSoftwareProduct'
,
'slapos_panel/Project_getComputeNodeTrackingList'
,
'slapos_panel/Project_getPayableSoftwareProductPredicateList'
,
'slapos_panel/Project_getSoftwareReleaseSchemaUrl'
,
'slapos_panel/Project_redirectSlapOSComputeNodeCertificate'
,
'slapos_panel/Project_selectRequestInstanceTree'
,
'slapos_panel/Project_selectRequestSoftwareRelease'
,
...
...
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/InstanceTree_viewParameterDialog/your_instance_xml.xml
View file @
d37b9aec
...
...
@@ -115,7 +115,7 @@
<dictionary>
<item>
<key>
<string>
_text
</string>
</key>
<value>
<string>
python: [(\'parameter_xml\', context.getTextContent()), (\'restricted_softwaretype\', True), (\'softwaretype\', context.getSourceReference()), (\'json_url\', context.get
UrlString().split(\'?\')[0] + \'.json\'
), (\'restricted_softwaretype\', False), (\'shared\', context.isRootSlave())]
</string>
</value>
<value>
<string>
python: [(\'parameter_xml\', context.getTextContent()), (\'restricted_softwaretype\', True), (\'softwaretype\', context.getSourceReference()), (\'json_url\', context.get
FollowUpValue().Project_getSoftwareReleaseSchemaUrl(context.getUrlString()
), (\'restricted_softwaretype\', False), (\'shared\', context.isRootSlave())]
</string>
</value>
</item>
</dictionary>
</pickle>
...
...
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Project_getSoftwareReleaseSchemaUrl.py
0 → 100644
View file @
d37b9aec
from
zExceptions
import
Unauthorized
if
REQUEST
is
not
None
:
raise
Unauthorized
# Ensure this script is called on the expected context
# for futur compatibility
assert
context
.
getPortalType
()
==
'Project'
return
software_release_url
.
split
(
"?"
)[
0
]
+
".json"
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Project_getSoftwareReleaseSchemaUrl.xml
0 → 100644
View file @
d37b9aec
<?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>
software_release_url, REQUEST=None
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Project_getSoftwareReleaseSchemaUrl
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_panel/SkinTemplateItem/portal_skins/slapos_panel/Project_viewRequestInstanceTreeDialog/your_text_content.xml
View file @
d37b9aec
...
...
@@ -115,7 +115,7 @@
<dictionary>
<item>
<key>
<string>
_text
</string>
</key>
<value>
<string>
python: [(\'json_url\',
request.get(\'field_your_url_string\').split(\'?\')[0] + \'.json\'
), (\'restricted_softwaretype\', False), (\'software_type_list\', list(set([x.getSoftwareTypeTitle() for x in context.Project_getSoftwareProductPredicateList(software_product=context.getPortalObject().portal_catalog.getResultValue(portal_type=\'Software Product\', uid=request.get(\'field_your_aggregate_uid\')), software_product_release=context.getPortalObject().portal_catalog.getResultValue(portal_type=\'Software Product Release Variation\', parent_uid=request.get(\'field_your_aggregate_uid\'), url_string=request.get(\'field_your_url_string\')))])))]
</string>
</value>
<value>
<string>
python: [(\'json_url\',
context.Project_getSoftwareReleaseSchemaUrl(request.get(\'field_your_url_string\'))
), (\'restricted_softwaretype\', False), (\'software_type_list\', list(set([x.getSoftwareTypeTitle() for x in context.Project_getSoftwareProductPredicateList(software_product=context.getPortalObject().portal_catalog.getResultValue(portal_type=\'Software Product\', uid=request.get(\'field_your_aggregate_uid\')), software_product_release=context.getPortalObject().portal_catalog.getResultValue(portal_type=\'Software Product Release Variation\', parent_uid=request.get(\'field_your_aggregate_uid\'), url_string=request.get(\'field_your_url_string\')))])))]
</string>
</value>
</item>
</dictionary>
</pickle>
...
...
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