imio.smartweb.common 1.2.12__tar.gz → 1.2.13__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/CHANGES.rst +19 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/PKG-INFO +20 -1
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/setup.py +2 -1
- imio.smartweb.common-1.2.13/src/imio/smartweb/common/browser/collective_taxonomy_controlpanel.py +63 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/browser/configure.zcml +16 -0
- imio.smartweb.common-1.2.13/src/imio/smartweb/common/browser/static/smartweb-common-view-compiled.css +1 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/browser/static/src/view.less +9 -2
- imio.smartweb.common-1.2.13/src/imio/smartweb/common/browser/vocabulary.py +26 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/interfaces.py +2 -1
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/profiles/default/metadata.xml +1 -1
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/profiles/default/registry.xml +10 -4
- imio.smartweb.common-1.2.13/src/imio/smartweb/common/profiles/testing/catalog.xml +9 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/profiles/testing/metadata.xml +1 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/profiles/testing/types/Document.xml +1 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/rest/search_filters.py +19 -7
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/testing.py +1 -1
- imio.smartweb.common-1.2.13/src/imio/smartweb/common/testing.zcml +8 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/tests/test_rest.py +25 -0
- imio.smartweb.common-1.2.13/src/imio/smartweb/common/tests/test_taxonomy.py +140 -0
- imio.smartweb.common-1.2.13/src/imio/smartweb/common/tests/test_vocabulary.py +45 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/upgrades/configure.zcml +36 -0
- imio.smartweb.common-1.2.13/src/imio/smartweb/common/upgrades/profiles/1027_to_1028/restored-faceted-jquery.xml +7 -0
- imio.smartweb.common-1.2.13/src/imio/smartweb/common/upgrades/profiles/1028_to_1029/registry.xml +15 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/utils.py +9 -1
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/vocabularies.py +1 -10
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio.smartweb.common.egg-info/PKG-INFO +20 -1
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio.smartweb.common.egg-info/SOURCES.txt +8 -1
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio.smartweb.common.egg-info/requires.txt +1 -0
- imio.smartweb.common-1.2.12/src/imio/smartweb/common/browser/static/patched.web3862.eea.faceted-jquery.min.js +0 -2
- imio.smartweb.common-1.2.12/src/imio/smartweb/common/browser/static/smartweb-common-view-compiled.css +0 -1
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/CONTRIBUTORS.rst +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/DEVELOP.rst +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/LICENSE.GPL +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/LICENSE.rst +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/MANIFEST.in +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/README.rst +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/docs/conf.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/docs/index.rst +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/requirements.txt +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/setup.cfg +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/__init__.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/__init__.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/__init__.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/adapters.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/adapters.zcml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/behaviors/__init__.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/behaviors/configure.zcml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/behaviors/iam.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/behaviors/topics.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/browser/__init__.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/browser/cropping.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/browser/description.pt +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/browser/description.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/browser/forms.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/browser/overrides/plone.app.z3cform.templates.widget.pt +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/browser/privacy/__init__.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/browser/privacy/configure.zcml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/browser/privacy/form.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/browser/privacy/utils.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/browser/privacy/views.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/browser/scaling.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/browser/static/Makefile +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/browser/static/package.json +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/browser/static/smartweb-common-edit-compiled.css +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/browser/static/smartweb-common-edit-compiled.js +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/browser/static/smartweb-common-view-compiled.js +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/browser/static/src/edit.js +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/browser/static/src/edit.less +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/browser/static/src/view.js +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/browser/static/webpack.config.js +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/caching.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/config.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/configure.zcml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/contact_utils.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/faceted/__init__.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/faceted/configure.zcml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/faceted/utils.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/faceted/widget.pt +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/faceted/widget.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/indexers.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/indexers.zcml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/permissions.zcml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/privacy.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/privacy.zcml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/profiles/default/actions.xml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/profiles/default/browserlayer.xml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/profiles/default/catalog.xml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/profiles/default/rolemap.xml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/profiles/testing/registry.xml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/profiles/testing/types/Collection.xml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/profiles/testing/types/Folder.xml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/profiles/uninstall/browserlayer.xml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/profiles.zcml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/rest/__init__.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/rest/configure.zcml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/rest/odwb.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/rest/utils.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/setuphandlers.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/sharing/__init__.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/sharing/configure.zcml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/sharing/localroles.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/sharing/permissions.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/sharing/permissions.zcml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/subscribers.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/subscribers.zcml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/tests/__init__.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/tests/resources/image.png +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/tests/resources/image_1400x800.png +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/tests/resources/image_1800x700.png +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/tests/robot/test_example.robot +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/tests/test_cropping.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/tests/test_description.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/tests/test_forms.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/tests/test_indexes.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/tests/test_local_roles.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/tests/test_permissions.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/tests/test_privacy.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/tests/test_robot.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/tests/test_setup.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/tests/test_subscribers.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/tests/test_text.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/tests/test_utils.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/tests/test_viewlets.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/tests/test_vocabularies.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/upgrades/__init__.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/upgrades/profiles/1007_to_1008/rolemap.xml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/upgrades/profiles/1008_to_1009/actions.xml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/upgrades/profiles/1009_to_1010/registry/tiny_nonbreakingspace.xml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/upgrades/profiles/1010_to_1011/registry/resources.xml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/upgrades/profiles/1010_to_1011/registry/scales.xml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/upgrades/profiles/1010_to_1011/registry/tinymce.xml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/upgrades/profiles/1011_to_1012/registry/bundles.xml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/upgrades/profiles/1013_to_1014/registry/tinymce.xml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/upgrades/profiles/1014_to_1015/registry/syndication.xml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/upgrades/profiles/1015_to_1016/registry/patched-faceted-jquery.xml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/upgrades/profiles/1016_to_1017/registry/scales.xml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/upgrades/profiles/1017_to_1018/registry.xml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/upgrades/profiles/1018_to_1019/registry/scales.xml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/upgrades/profiles/1022_to_1023/registry/scales.xml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/upgrades/profiles/1023_to_1024/registry/scales.xml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/upgrades/profiles/1025_to_1026/registry/scales.xml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/upgrades/upgrades.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/viewlets/__init__.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/viewlets/analytics.pt +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/viewlets/colophon.pt +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/viewlets/colophon.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/viewlets/configure.zcml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/viewlets/privacy.pt +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/viewlets/privacy.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/viewlets/skip_to_content.pt +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/viewlets/skip_to_content.py +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/vocabularies.zcml +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio.smartweb.common.egg-info/dependency_links.txt +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio.smartweb.common.egg-info/namespace_packages.txt +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio.smartweb.common.egg-info/not-zip-safe +0 -0
- {imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio.smartweb.common.egg-info/top_level.txt +0 -0
|
@@ -2,6 +2,25 @@ Changelog
|
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
1.2.13 (2024-05-24)
|
|
6
|
+
-------------------
|
|
7
|
+
|
|
8
|
+
- WEB-4088 : Cover use case for sending data in odwb for a staging environment
|
|
9
|
+
[boulch]
|
|
10
|
+
|
|
11
|
+
- Ensure translation of vocabularies when used with `AjaxSelectFieldWidget`
|
|
12
|
+
[laulaz]
|
|
13
|
+
|
|
14
|
+
- Remove useless `container_uid` from `search-filters` results
|
|
15
|
+
[laulaz]
|
|
16
|
+
|
|
17
|
+
- WEB-3864 : Ensure that a taxonomy term that is deleted is not used anywhere
|
|
18
|
+
[boulch]
|
|
19
|
+
|
|
20
|
+
- WEB-3862 : Unpatch (restore original) eea.facetednavigation jquery
|
|
21
|
+
[laulaz]
|
|
22
|
+
|
|
23
|
+
|
|
5
24
|
1.2.12 (2024-05-06)
|
|
6
25
|
-------------------
|
|
7
26
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: imio.smartweb.common
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.13
|
|
4
4
|
Summary: Common utilities, vocabularies, taxonomies for imio.smartweb & co products
|
|
5
5
|
Home-page: https://github.com/imio/imio.smartweb.common
|
|
6
6
|
Author: iMio
|
|
@@ -135,6 +135,25 @@ Changelog
|
|
|
135
135
|
=========
|
|
136
136
|
|
|
137
137
|
|
|
138
|
+
1.2.13 (2024-05-24)
|
|
139
|
+
-------------------
|
|
140
|
+
|
|
141
|
+
- WEB-4088 : Cover use case for sending data in odwb for a staging environment
|
|
142
|
+
[boulch]
|
|
143
|
+
|
|
144
|
+
- Ensure translation of vocabularies when used with `AjaxSelectFieldWidget`
|
|
145
|
+
[laulaz]
|
|
146
|
+
|
|
147
|
+
- Remove useless `container_uid` from `search-filters` results
|
|
148
|
+
[laulaz]
|
|
149
|
+
|
|
150
|
+
- WEB-3864 : Ensure that a taxonomy term that is deleted is not used anywhere
|
|
151
|
+
[boulch]
|
|
152
|
+
|
|
153
|
+
- WEB-3862 : Unpatch (restore original) eea.facetednavigation jquery
|
|
154
|
+
[laulaz]
|
|
155
|
+
|
|
156
|
+
|
|
138
157
|
1.2.12 (2024-05-06)
|
|
139
158
|
-------------------
|
|
140
159
|
|
|
@@ -16,7 +16,7 @@ long_description = "\n\n".join(
|
|
|
16
16
|
|
|
17
17
|
setup(
|
|
18
18
|
name="imio.smartweb.common",
|
|
19
|
-
version="1.2.
|
|
19
|
+
version="1.2.13",
|
|
20
20
|
description="Common utilities, vocabularies, taxonomies for imio.smartweb & co products",
|
|
21
21
|
long_description=long_description,
|
|
22
22
|
# Get more from https://pypi.org/classifiers/
|
|
@@ -66,6 +66,7 @@ setup(
|
|
|
66
66
|
"eea.facetednavigation",
|
|
67
67
|
"imio.gdpr",
|
|
68
68
|
"collective.privacy",
|
|
69
|
+
"collective.taxonomy",
|
|
69
70
|
"iaweb.privacy",
|
|
70
71
|
"imio.smartweb.locales",
|
|
71
72
|
"more-itertools",
|
imio.smartweb.common-1.2.13/src/imio/smartweb/common/browser/collective_taxonomy_controlpanel.py
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
from collective.taxonomy.interfaces import ITaxonomy
|
|
4
|
+
from collective.taxonomy.jsonimpl import ImportJson as baseImportJson
|
|
5
|
+
from imio.smartweb.locales import SmartwebMessageFactory as _
|
|
6
|
+
from plone import api
|
|
7
|
+
from zope.component import queryUtility
|
|
8
|
+
from zope.i18n import translate
|
|
9
|
+
|
|
10
|
+
import json
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ImportJson(baseImportJson):
|
|
14
|
+
"""Update taxonomy using json data."""
|
|
15
|
+
|
|
16
|
+
def __call__(self):
|
|
17
|
+
request = self.request
|
|
18
|
+
if request.method == "POST":
|
|
19
|
+
data = json.loads(request.get("BODY", ""))
|
|
20
|
+
taxonomy = queryUtility(ITaxonomy, name=data["taxonomy"])
|
|
21
|
+
languages = data["languages"]
|
|
22
|
+
items_to_check = []
|
|
23
|
+
nodes = data["tree"]["subnodes"]
|
|
24
|
+
for language in languages:
|
|
25
|
+
for node in nodes:
|
|
26
|
+
if node["translations"].get(language):
|
|
27
|
+
items_to_check.append(
|
|
28
|
+
{node["key"]: node["translations"][language]}
|
|
29
|
+
)
|
|
30
|
+
ids_remaining = [key for data in items_to_check for key in data.keys()]
|
|
31
|
+
if not taxonomy.inverted_data.get(language):
|
|
32
|
+
continue
|
|
33
|
+
initial_taxonomy_ids = [k for k in taxonomy.inverted_data[language]]
|
|
34
|
+
for id in initial_taxonomy_ids:
|
|
35
|
+
if id in ids_remaining:
|
|
36
|
+
continue
|
|
37
|
+
# This is a removed term
|
|
38
|
+
catalog = api.portal.get_tool("portal_catalog")
|
|
39
|
+
brains = catalog.searchResults(
|
|
40
|
+
object_provides=taxonomy.getGeneratedName()
|
|
41
|
+
)
|
|
42
|
+
for brain in brains:
|
|
43
|
+
index_key = f"taxonomy_{taxonomy.getShortName()}"
|
|
44
|
+
if hasattr(brain, index_key) and id in getattr(
|
|
45
|
+
brain, index_key
|
|
46
|
+
):
|
|
47
|
+
obj = brain.getObject()
|
|
48
|
+
here = obj.absolute_url()
|
|
49
|
+
term_title = taxonomy.translate(
|
|
50
|
+
id, context=obj, target_language=language
|
|
51
|
+
)
|
|
52
|
+
return json.dumps(
|
|
53
|
+
{
|
|
54
|
+
"status": "error",
|
|
55
|
+
"message": translate(
|
|
56
|
+
_(
|
|
57
|
+
f'Term "{term_title}" can\'t be removed because it is used (at least) here : {here}'
|
|
58
|
+
),
|
|
59
|
+
context=request,
|
|
60
|
+
),
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
return super(ImportJson, self).__call__()
|
|
@@ -73,6 +73,14 @@
|
|
|
73
73
|
layer="imio.smartweb.common.interfaces.IImioSmartwebCommonLayer"
|
|
74
74
|
/>
|
|
75
75
|
|
|
76
|
+
<browser:page
|
|
77
|
+
name="getVocabulary"
|
|
78
|
+
for="*"
|
|
79
|
+
class=".vocabulary.TranslatedVocabularyView"
|
|
80
|
+
permission="zope2.View"
|
|
81
|
+
layer="imio.smartweb.common.interfaces.IImioSmartwebCommonLayer"
|
|
82
|
+
/>
|
|
83
|
+
|
|
76
84
|
<browser:page
|
|
77
85
|
for="plone.app.layout.navigation.interfaces.INavigationRoot"
|
|
78
86
|
name="image_scale"
|
|
@@ -82,4 +90,12 @@
|
|
|
82
90
|
allowed_attributes="scale tag"
|
|
83
91
|
/>
|
|
84
92
|
|
|
93
|
+
<browser:page
|
|
94
|
+
name="taxonomy-import"
|
|
95
|
+
for="Products.CMFCore.interfaces.ISiteRoot"
|
|
96
|
+
class=".collective_taxonomy_controlpanel.ImportJson"
|
|
97
|
+
permission="collective.taxonomy.ManageTaxonomies"
|
|
98
|
+
layer="imio.smartweb.common.interfaces.IImioSmartwebCommonLayer"
|
|
99
|
+
/>
|
|
100
|
+
|
|
85
101
|
</configure>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.show-on-focus{border-radius:5px;box-shadow:0 0 2.9px rgba(0,0,0,.028),0 0 8.1px rgba(0,0,0,.04),0 0 19.6px rgba(0,0,0,.052),0 0 65px rgba(0,0,0,.08);color:#000!important;display:inline-block;font-weight:500;left:10px;position:absolute!important;text-decoration:none;top:10px}.show-on-focus:not(:focus){clip:rect(0,0,0,0);border-width:0;height:1px!important;margin:-1px;overflow:hidden;padding:0!important;white-space:nowrap;width:1px!important}.show-on-focus:focus{background-color:#fff!important;padding:1rem;z-index:999}.show-on-focus:hover{text-decoration:underline}#smartweb-footer{position:relative}#smartweb-footer .show-on-focus{color:#000!important}form .form-text{margin-bottom:.3em;margin-top:-.4em}#cookies-form #form-widgets-all_basic_cookies,#cookies-form .form-text p,#cookies-form label span.required{display:none}#gdpr-consent-banner{background:orange;display:none;left:0;padding:5px;position:fixed;top:0;width:100%;z-index:999999}.faceted-select-widget.faceted-zero-count-hidden .faceted-select-item-disabled{display:none}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
border-radius: 5px;
|
|
9
9
|
box-shadow: 0px 0px 2.9px rgba(0, 0, 0, 0.028), 0px 0px 8.1px rgba(0, 0, 0, 0.04), 0px 0px 19.6px rgba(0, 0, 0, 0.052), 0px 0px 65px rgba(0, 0, 0, 0.08);
|
|
10
10
|
font-weight: 500;
|
|
11
|
-
|
|
11
|
+
color: #000 !important;
|
|
12
12
|
&:not(:focus) {
|
|
13
13
|
width: 1px !important;
|
|
14
14
|
height: 1px !important;
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
&:focus {
|
|
24
|
-
background-color: #FFFFFF;
|
|
24
|
+
background-color: #FFFFFF!important;
|
|
25
25
|
padding: 1rem;
|
|
26
26
|
z-index: 999;
|
|
27
27
|
}
|
|
@@ -31,6 +31,13 @@
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
#smartweb-footer {
|
|
35
|
+
position: relative;
|
|
36
|
+
.show-on-focus {
|
|
37
|
+
color: #000!important;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
34
41
|
// Fields description position between title and input.
|
|
35
42
|
form .form-text {
|
|
36
43
|
margin-top: -0.4em;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
from imio.smartweb.locales import SmartwebMessageFactory as _
|
|
4
|
+
from plone import api
|
|
5
|
+
from plone.app.content.browser.vocabulary import VocabularyView
|
|
6
|
+
from plone.app.content.utils import json_dumps
|
|
7
|
+
from plone.app.content.utils import json_loads
|
|
8
|
+
from zope.i18n import translate
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class TranslatedVocabularyView(VocabularyView):
|
|
12
|
+
|
|
13
|
+
def __call__(self):
|
|
14
|
+
"""
|
|
15
|
+
Translate texts in JSON response
|
|
16
|
+
`@getVocabulary` does not do it and returns English values
|
|
17
|
+
"""
|
|
18
|
+
result = super(TranslatedVocabularyView, self).__call__()
|
|
19
|
+
json = json_loads(result)
|
|
20
|
+
if int(json.get("total", 0)) == 0:
|
|
21
|
+
return result
|
|
22
|
+
lang = api.portal.get_current_language()[:2]
|
|
23
|
+
for item in json["results"]:
|
|
24
|
+
if "text" in item:
|
|
25
|
+
item["text"] = translate(_(item["text"]), target_language=lang)
|
|
26
|
+
return json_dumps(json)
|
{imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/interfaces.py
RENAMED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
|
|
3
3
|
from collective.privacy.interfaces import ICollectivePrivacyLayer
|
|
4
|
+
from collective.taxonomy.interfaces import IBrowserLayer
|
|
4
5
|
from imio.smartweb.locales import SmartwebMessageFactory as _
|
|
5
6
|
from plone import schema
|
|
6
7
|
from plone.app.z3cform.interfaces import IPloneFormLayer
|
|
@@ -10,7 +11,7 @@ from zope.interface import Interface
|
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
class IImioSmartwebCommonLayer(
|
|
13
|
-
IDefaultPloneLayer, IPloneFormLayer, ICollectivePrivacyLayer
|
|
14
|
+
IBrowserLayer, IDefaultPloneLayer, IPloneFormLayer, ICollectivePrivacyLayer
|
|
14
15
|
):
|
|
15
16
|
"""Marker interface that defines a browser layer."""
|
|
16
17
|
|
|
@@ -54,10 +54,6 @@
|
|
|
54
54
|
<value key="load_defer">False</value>
|
|
55
55
|
</records>
|
|
56
56
|
|
|
57
|
-
<records prefix="plone.bundles/faceted.jquery"
|
|
58
|
-
interface='Products.CMFPlone.interfaces.IBundleRegistry'>
|
|
59
|
-
<value key="jscompilation">++plone++imio.smartweb.common/patched.web3862.eea.faceted-jquery.min.js</value>
|
|
60
|
-
</records>
|
|
61
57
|
|
|
62
58
|
<!-- TinyMCE custom configuration -->
|
|
63
59
|
|
|
@@ -1080,4 +1076,14 @@
|
|
|
1080
1076
|
<value>False</value>
|
|
1081
1077
|
</record>
|
|
1082
1078
|
|
|
1079
|
+
<record name="imio.smartweb.common.activate_sending_data_to_odwb_for_staging">
|
|
1080
|
+
<field type="plone.registry.field.Bool">
|
|
1081
|
+
<title>Activate sending data to odwb for staging</title>
|
|
1082
|
+
<description>Be careful, it must be existing an odwb table prefixing with staging and naming like prod table. Also, smartweb registry keys (odwb pushkey) must be respect.</description>
|
|
1083
|
+
<required>False</required>
|
|
1084
|
+
</field>
|
|
1085
|
+
<value>False</value>
|
|
1086
|
+
</record>
|
|
1087
|
+
|
|
1088
|
+
|
|
1083
1089
|
</registry>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
|
|
3
3
|
from imio.smartweb.common.config import VOCABULARIES_MAPPING
|
|
4
|
+
from imio.smartweb.common.rest.utils import get_restapi_query_lang
|
|
4
5
|
from imio.smartweb.common.utils import get_term_from_vocabulary
|
|
5
6
|
from operator import itemgetter
|
|
6
7
|
from plone.restapi.search.handler import SearchHandler
|
|
@@ -13,6 +14,7 @@ from zope.component import getMultiAdapter
|
|
|
13
14
|
|
|
14
15
|
# we don't need some brains metadata to construct search filters
|
|
15
16
|
EXCLUDED_METADATA = [
|
|
17
|
+
"container_uid",
|
|
16
18
|
"effective",
|
|
17
19
|
"end",
|
|
18
20
|
"has_leadimage",
|
|
@@ -65,6 +67,9 @@ class SearchFiltersHandler(SearchHandler):
|
|
|
65
67
|
if not isinstance(metadatas, list):
|
|
66
68
|
metadatas = [metadatas]
|
|
67
69
|
|
|
70
|
+
lang = get_restapi_query_lang(query)
|
|
71
|
+
local_categories_trans = {}
|
|
72
|
+
|
|
68
73
|
metadatas = list(set(metadatas) - set(EXCLUDED_METADATA))
|
|
69
74
|
filters = {metadata: set() for metadata in metadatas}
|
|
70
75
|
for brain in brains:
|
|
@@ -72,11 +77,14 @@ class SearchFiltersHandler(SearchHandler):
|
|
|
72
77
|
value = getattr(brain, metadata, None)
|
|
73
78
|
if not value:
|
|
74
79
|
continue
|
|
75
|
-
if isinstance(value, list
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
+
if not isinstance(value, (list, tuple)):
|
|
81
|
+
value = [value]
|
|
82
|
+
for v in value:
|
|
83
|
+
filters[metadata].add(v)
|
|
84
|
+
if metadata == "local_category":
|
|
85
|
+
local_categories_trans[v] = getattr(
|
|
86
|
+
brain, f"{metadata}_{lang}", v
|
|
87
|
+
)
|
|
80
88
|
|
|
81
89
|
results = {}
|
|
82
90
|
for metadata, values in filters.items():
|
|
@@ -91,8 +99,12 @@ class SearchFiltersHandler(SearchHandler):
|
|
|
91
99
|
term = serializer()
|
|
92
100
|
term["title"] = json_compatible(title) # needed for translations
|
|
93
101
|
results[metadata].append(term)
|
|
94
|
-
|
|
102
|
+
elif metadata == "local_category":
|
|
103
|
+
results[metadata] = [
|
|
104
|
+
{"token": v, "title": local_categories_trans[v]} for v in values
|
|
105
|
+
]
|
|
95
106
|
else:
|
|
96
|
-
results[metadata] = [{"token": v, "title": v} for v in
|
|
107
|
+
results[metadata] = [{"token": v, "title": v} for v in values]
|
|
108
|
+
results[metadata].sort(key=itemgetter("title"))
|
|
97
109
|
|
|
98
110
|
return results
|
{imio.smartweb.common-1.2.12 → imio.smartweb.common-1.2.13}/src/imio/smartweb/common/testing.py
RENAMED
|
@@ -26,7 +26,7 @@ class ImioSmartwebCommonLayer(PloneSandboxLayer):
|
|
|
26
26
|
import plone.restapi
|
|
27
27
|
|
|
28
28
|
self.loadZCML(package=plone.restapi)
|
|
29
|
-
self.loadZCML(package=imio.smartweb.common)
|
|
29
|
+
self.loadZCML(package=imio.smartweb.common, name="testing.zcml")
|
|
30
30
|
|
|
31
31
|
def setUpPloneSite(self, portal):
|
|
32
32
|
api.user.create(email="test@imio.be", username="test")
|
|
@@ -31,6 +31,10 @@ class TestREST(unittest.TestCase):
|
|
|
31
31
|
title="Doc 1",
|
|
32
32
|
)
|
|
33
33
|
self.doc1.topics = ["agriculture"]
|
|
34
|
+
self.doc1.local_category = "Titre FR"
|
|
35
|
+
self.doc1.local_category_nl = "NL title"
|
|
36
|
+
self.doc1.local_category_de = "DE title"
|
|
37
|
+
self.doc1.local_category_en = "EN title"
|
|
34
38
|
api.content.transition(self.doc1, "publish")
|
|
35
39
|
|
|
36
40
|
self.doc2 = api.content.create(
|
|
@@ -100,11 +104,31 @@ class TestREST(unittest.TestCase):
|
|
|
100
104
|
],
|
|
101
105
|
)
|
|
102
106
|
|
|
107
|
+
query = {
|
|
108
|
+
"portal_type": "Document",
|
|
109
|
+
"metadata_fields": "local_category",
|
|
110
|
+
}
|
|
111
|
+
response = self.api_session.get("/@search-filters", params=query)
|
|
112
|
+
json = response.json()
|
|
113
|
+
self.assertEqual(
|
|
114
|
+
json["local_category"],
|
|
115
|
+
[{"title": "Titre FR", "token": "Titre FR"}],
|
|
116
|
+
)
|
|
117
|
+
query["translated_in_nl"] = 1
|
|
118
|
+
response = self.api_session.get("/@search-filters", params=query)
|
|
119
|
+
json = response.json()
|
|
120
|
+
self.assertEqual(
|
|
121
|
+
json["local_category"],
|
|
122
|
+
[{"title": "NL title", "token": "Titre FR"}],
|
|
123
|
+
)
|
|
124
|
+
del query["translated_in_nl"]
|
|
125
|
+
|
|
103
126
|
query = {
|
|
104
127
|
"portal_type": "Event",
|
|
105
128
|
"metadata_fields": [
|
|
106
129
|
"iam",
|
|
107
130
|
"topics",
|
|
131
|
+
"container_uid",
|
|
108
132
|
"effective",
|
|
109
133
|
"end",
|
|
110
134
|
"has_leadimage",
|
|
@@ -114,6 +138,7 @@ class TestREST(unittest.TestCase):
|
|
|
114
138
|
}
|
|
115
139
|
response = self.api_session.get("/@search-filters", params=query)
|
|
116
140
|
json = response.json()
|
|
141
|
+
self.assertNotIn("container_uid", json)
|
|
117
142
|
self.assertNotIn("effective", json)
|
|
118
143
|
self.assertNotIn("end", json)
|
|
119
144
|
self.assertNotIn("has_leadimage", json)
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
from imio.smartweb.common.testing import IMIO_SMARTWEB_COMMON_FUNCTIONAL_TESTING
|
|
4
|
+
from plone import api
|
|
5
|
+
from plone.app.testing import setRoles
|
|
6
|
+
from plone.app.testing import TEST_USER_ID
|
|
7
|
+
from plone.app.testing.interfaces import SITE_OWNER_NAME
|
|
8
|
+
from plone.app.testing.interfaces import SITE_OWNER_PASSWORD
|
|
9
|
+
from plone.testing.z2 import Browser
|
|
10
|
+
from transaction import commit
|
|
11
|
+
|
|
12
|
+
import json
|
|
13
|
+
import unittest
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class TestTaxonomy(unittest.TestCase):
|
|
17
|
+
layer = IMIO_SMARTWEB_COMMON_FUNCTIONAL_TESTING
|
|
18
|
+
|
|
19
|
+
def setUp(self):
|
|
20
|
+
"""Custom shared utility setup for tests"""
|
|
21
|
+
self.request = self.layer["request"]
|
|
22
|
+
self.portal = self.layer["portal"]
|
|
23
|
+
setRoles(self.portal, TEST_USER_ID, ["Manager"])
|
|
24
|
+
self.browser = Browser(self.layer["app"])
|
|
25
|
+
self.browser.handleErrors = False
|
|
26
|
+
self.browser.addHeader(
|
|
27
|
+
"Authorization",
|
|
28
|
+
"Basic {0}:{1}".format(SITE_OWNER_NAME, SITE_OWNER_PASSWORD),
|
|
29
|
+
)
|
|
30
|
+
commit()
|
|
31
|
+
self.page = api.content.create(
|
|
32
|
+
container=self.portal,
|
|
33
|
+
type="Document",
|
|
34
|
+
title="Test page",
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
def test_removing_unused_taxonomy_term(self):
|
|
38
|
+
body_data = {
|
|
39
|
+
"languages": ["fr", "en", "nl", "ru", "da", "de"],
|
|
40
|
+
"tree": {
|
|
41
|
+
"key": "0",
|
|
42
|
+
"title": "Test vocabulary",
|
|
43
|
+
"subnodes": [
|
|
44
|
+
{
|
|
45
|
+
"key": "1",
|
|
46
|
+
"translations": {
|
|
47
|
+
"da": "Informationsvidenskab",
|
|
48
|
+
"de": "Informatik",
|
|
49
|
+
"en": "Information Science",
|
|
50
|
+
"ru": "Информатику",
|
|
51
|
+
},
|
|
52
|
+
"subnodes": [
|
|
53
|
+
{
|
|
54
|
+
"key": "3",
|
|
55
|
+
"translations": {"da": "Kronologi", "en": "Chronology"},
|
|
56
|
+
"subnodes": [],
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"default_language": "da",
|
|
62
|
+
},
|
|
63
|
+
"taxonomy": "collective.taxonomy.test",
|
|
64
|
+
}
|
|
65
|
+
json_str = json.dumps(body_data)
|
|
66
|
+
bytes_data = json_str.encode("utf-8")
|
|
67
|
+
self.request.set("BODY", bytes_data)
|
|
68
|
+
self.request.method = "POST"
|
|
69
|
+
result = self.portal.restrictedTraverse("@@taxonomy-import")()
|
|
70
|
+
self.assertEqual(
|
|
71
|
+
result,
|
|
72
|
+
'{"status": "info", "message": "Your taxonomy has been saved with success."}',
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
def test_removing_used_taxonomy_term(self):
|
|
76
|
+
self.page.taxonomy_test = ["1", "2"]
|
|
77
|
+
body_data = {
|
|
78
|
+
"languages": ["fr", "en", "nl", "ru", "da", "de"],
|
|
79
|
+
"tree": {
|
|
80
|
+
"key": "0",
|
|
81
|
+
"title": "Test vocabulary",
|
|
82
|
+
"subnodes": [
|
|
83
|
+
{
|
|
84
|
+
"key": "1",
|
|
85
|
+
"translations": {
|
|
86
|
+
"da": "Informationsvidenskab",
|
|
87
|
+
"de": "Informatik",
|
|
88
|
+
"en": "Information Science",
|
|
89
|
+
"ru": "Информатику",
|
|
90
|
+
},
|
|
91
|
+
"subnodes": [
|
|
92
|
+
{
|
|
93
|
+
"key": "3",
|
|
94
|
+
"translations": {"da": "Kronologi", "en": "Chronology"},
|
|
95
|
+
"subnodes": [],
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
"default_language": "da",
|
|
101
|
+
},
|
|
102
|
+
"taxonomy": "collective.taxonomy.test",
|
|
103
|
+
}
|
|
104
|
+
json_str = json.dumps(body_data)
|
|
105
|
+
bytes_data = json_str.encode("utf-8")
|
|
106
|
+
self.request.set("BODY", bytes_data)
|
|
107
|
+
self.request.method = "POST"
|
|
108
|
+
result = self.portal.restrictedTraverse("@@taxonomy-import")()
|
|
109
|
+
self.assertEqual(
|
|
110
|
+
result,
|
|
111
|
+
'{"status": "error", "message": "Term \\"Information Science \\u00bb Book Collecting\\" can\'t be removed because it is used (at least) here : http://nohost/plone/test-page"}',
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
def test_removing_used_parent_taxonomy_term(self):
|
|
115
|
+
self.page.taxonomy_test = ["2"]
|
|
116
|
+
self.page.reindexObject()
|
|
117
|
+
catalog = api.portal.get_tool("portal_catalog")
|
|
118
|
+
brain = api.content.find(UID=self.page.UID())[0]
|
|
119
|
+
indexes = catalog.getIndexDataForRID(brain.getRID())
|
|
120
|
+
index = indexes.get("taxonomy_test")
|
|
121
|
+
self.assertListEqual(sorted(index), ["1", "2"])
|
|
122
|
+
body_data = {
|
|
123
|
+
"languages": ["fr", "en", "nl", "ru", "da", "de"],
|
|
124
|
+
"tree": {
|
|
125
|
+
"key": "0",
|
|
126
|
+
"title": "Test vocabulary",
|
|
127
|
+
"subnodes": [],
|
|
128
|
+
"default_language": "da",
|
|
129
|
+
},
|
|
130
|
+
"taxonomy": "collective.taxonomy.test",
|
|
131
|
+
}
|
|
132
|
+
json_str = json.dumps(body_data)
|
|
133
|
+
bytes_data = json_str.encode("utf-8")
|
|
134
|
+
self.request.set("BODY", bytes_data)
|
|
135
|
+
self.request.method = "POST"
|
|
136
|
+
result = self.portal.restrictedTraverse("@@taxonomy-import")()
|
|
137
|
+
self.assertEqual(
|
|
138
|
+
result,
|
|
139
|
+
'{"status": "error", "message": "Term \\"Information Science\\" can\'t be removed because it is used (at least) here : http://nohost/plone/test-page"}',
|
|
140
|
+
)
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
from imio.smartweb.common.testing import IMIO_SMARTWEB_COMMON_INTEGRATION_TESTING
|
|
4
|
+
from plone import api
|
|
5
|
+
from plone.app.testing import setRoles
|
|
6
|
+
from plone.app.testing import TEST_USER_ID
|
|
7
|
+
from unittest.mock import patch
|
|
8
|
+
from zope.component import queryMultiAdapter
|
|
9
|
+
|
|
10
|
+
import json
|
|
11
|
+
import unittest
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class TestVocabulary(unittest.TestCase):
|
|
15
|
+
layer = IMIO_SMARTWEB_COMMON_INTEGRATION_TESTING
|
|
16
|
+
|
|
17
|
+
def setUp(self):
|
|
18
|
+
"""Custom shared utility setup for tests"""
|
|
19
|
+
self.request = self.layer["request"]
|
|
20
|
+
self.portal = self.layer["portal"]
|
|
21
|
+
setRoles(self.portal, TEST_USER_ID, ["Manager"])
|
|
22
|
+
self.document = api.content.create(
|
|
23
|
+
container=self.portal,
|
|
24
|
+
type="Document",
|
|
25
|
+
title="My Doc",
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
def test_getvocabulary(self):
|
|
29
|
+
self.request.form = {
|
|
30
|
+
"name": "imio.smartweb.vocabulary.Topics",
|
|
31
|
+
"field": "topics",
|
|
32
|
+
}
|
|
33
|
+
view = queryMultiAdapter((self.document, self.request), name="getVocabulary")
|
|
34
|
+
result = json.loads(view())
|
|
35
|
+
self.assertEqual(result["results"][0]["id"], "entertainment")
|
|
36
|
+
self.assertEqual(result["results"][0]["text"], "Entertainment")
|
|
37
|
+
with patch("plone.api.portal.get_current_language", return_value="fr"):
|
|
38
|
+
view = queryMultiAdapter(
|
|
39
|
+
(self.document, self.request), name="getVocabulary"
|
|
40
|
+
)
|
|
41
|
+
result = json.loads(view())
|
|
42
|
+
self.assertEqual(result["results"][0]["id"], "entertainment")
|
|
43
|
+
self.assertEqual(
|
|
44
|
+
result["results"][0]["text"], "Activités et divertissement"
|
|
45
|
+
)
|