Commit 94e464ac authored by Romain Courteaud's avatar Romain Courteaud

[erp5_administration] Activate actions for ERP5JS

parent 79071ceb
...@@ -16,13 +16,13 @@ ...@@ -16,13 +16,13 @@
<key> <string>categories</string> </key> <key> <string>categories</string> </key>
<value> <value>
<tuple> <tuple>
<string>action_type/object_report</string> <string>action_type/object_jio_report</string>
</tuple> </tuple>
</value> </value>
</item> </item>
<item> <item>
<key> <string>category</string> </key> <key> <string>category</string> </key>
<value> <string>object_report</string> </value> <value> <string>object_jio_report</string> </value>
</item> </item>
<item> <item>
<key> <string>condition</string> </key> <key> <string>condition</string> </key>
......
...@@ -7,14 +7,35 @@ class Message: ...@@ -7,14 +7,35 @@ class Message:
Supports both being displayed in a listbox and being printed. Supports both being displayed in a listbox and being printed.
""" """
def __init__(self, location, message, edit_url): def __init__(self, location, message, edit_url, jio_key=None):
self.location = location self.location = location
self.message = message self.message = message
self.edit_url = edit_url self.edit_url = edit_url
self.jio_key = jio_key
def getListItemUrl(self, *args, **kw): def getListItemUrl(self, *args, **kw):
return self.edit_url return self.edit_url
def getListItemUrlDict(self, *args, **kw):
if self.jio_key is None:
# Use raw portal skins edition
return {
'command': 'raw',
'options': {
'url': self.edit_url
}
}
else:
# Stay in ERP5JS
# XXX How to focus on the line to change directly?
return {
'command': 'push_history',
'options': {
'jio_key': self.jio_key,
'editable': True,
}
}
def __repr__(self): def __repr__(self):
return "{}:{}".format(self.location, self.message) return "{}:{}".format(self.location, self.message)
...@@ -52,7 +73,8 @@ def checkComponent(component_instance): ...@@ -52,7 +73,8 @@ def checkComponent(component_instance):
Message( Message(
location="{component_path}:{row}:{column}".format(**annotation), location="{component_path}:{row}:{column}".format(**annotation),
message=annotation["text"], message=annotation["text"],
edit_url="{component_path}?line={row}".format(**annotation),)) edit_url="{component_path}?line={row}".format(**annotation),
jio_key=annotation['component_path'],),)
# Check scripts # Check scripts
script_container_list = [] script_container_list = []
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment