Commit 163590c1 authored by Jérome Perrin's avatar Jérome Perrin

post /officejs_support_request_ui : fixes for coding style

- Add a Post interface so that we can use `Post` as a prefix for skins.
- fix pylint messages
- enable coding style test

See merge request !1152
parents 066bf86c 61017617
# pylint:disable=redefined-builtin
# this script uses file= argument
portal = context.getPortalObject() portal = context.getPortalObject()
follow_up_value = portal.restrictedTraverse(follow_up) follow_up_value = portal.restrictedTraverse(follow_up)
assert follow_up_value.getPortalType() == "Support Request" assert follow_up_value.getPortalType() == "Support Request"
......
# pylint:disable=redefined-builtin
# this script uses file= argument
portal = context.getPortalObject() portal = context.getPortalObject()
logged_in_user_value = portal.portal_membership.getAuthenticatedMember().getUserValue() logged_in_user_value = portal.portal_membership.getAuthenticatedMember().getUserValue()
......
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2020 Nexedi SA and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly advised to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from zope.interface import Interface
class IPost(Interface):
"""IPost Interface
A post is a container of raw data without any metadata. Data is stored in data property.
A post can be seen as any item sent or received through an instant messaging application.
Post support a simple workflow that represents their relation to an interface through which they are received or sent.
A default workflow is provided for types that may go through a chat interface (Image Post, File, Post, Sound Post, etc.).
Posts replace ingestion module.
"""
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Interface Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>IPost</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>interface.erp5.IPost</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Interface Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -22,6 +22,14 @@ ...@@ -22,6 +22,14 @@
<key> <string>factory</string> </key> <key> <string>factory</string> </key>
<value> <string>addXMLObject</string> </value> <value> <string>addXMLObject</string> </value>
</item> </item>
<item>
<key> <string>group_list</string> </key>
<value>
<tuple>
<string>post</string>
</tuple>
</value>
</item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>HTML Post</string> </value> <value> <string>HTML Post</string> </value>
...@@ -49,7 +57,9 @@ ...@@ -49,7 +57,9 @@
<item> <item>
<key> <string>type_interface</string> </key> <key> <string>type_interface</string> </key>
<value> <value>
<tuple/> <tuple>
<string>IPost</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
......
...@@ -22,6 +22,14 @@ ...@@ -22,6 +22,14 @@
<key> <string>factory</string> </key> <key> <string>factory</string> </key>
<value> <string>addXMLObject</string> </value> <value> <string>addXMLObject</string> </value>
</item> </item>
<item>
<key> <string>group_list</string> </key>
<value>
<tuple>
<string>post</string>
</tuple>
</value>
</item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Text Post</string> </value> <value> <string>Text Post</string> </value>
...@@ -49,7 +57,9 @@ ...@@ -49,7 +57,9 @@
<item> <item>
<key> <string>type_interface</string> </key> <key> <string>type_interface</string> </key>
<value> <value>
<tuple/> <tuple>
<string>IPost</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
......
interface.erp5.IPost
\ No newline at end of file
...@@ -1279,6 +1279,14 @@ class ERP5Site(ResponseHeaderGenerator, FolderMixIn, CMFSite, CacheCookieMixin): ...@@ -1279,6 +1279,14 @@ class ERP5Site(ResponseHeaderGenerator, FolderMixIn, CMFSite, CacheCookieMixin):
""" """
return self._getPortalGroupedTypeList('domain') return self._getPortalGroupedTypeList('domain')
security.declareProtected(Permissions.AccessContentsInformation,
'getPortalPostTypeList')
def getPortalPostTypeList(self):
"""
Return post types.
"""
return self._getPortalGroupedTypeList('post')
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getPortalCurrentInventoryStateList') 'getPortalCurrentInventoryStateList')
def getPortalCurrentInventoryStateList(self): def getPortalCurrentInventoryStateList(self):
......
...@@ -290,6 +290,7 @@ class ERP5TypeInformation(XMLObject, ...@@ -290,6 +290,7 @@ class ERP5TypeInformation(XMLObject,
'document', 'web_document', 'file_document', 'embedded_document', 'document', 'web_document', 'file_document', 'embedded_document',
'recent_document', 'my_document', 'template_document', 'recent_document', 'my_document', 'template_document',
'crawler_index', 'crawler_index',
'post',
# Solvers and simulation # Solvers and simulation
'divergence_tester', 'target_solver', 'delivery_solver', 'divergence_tester', 'target_solver', 'delivery_solver',
'amount_generator', 'amount_generator_line', 'amount_generator_cell', 'amount_generator', 'amount_generator_line', 'amount_generator_cell',
......
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