Skip to content

Commit

Permalink
Change default browserlayer (#136)
Browse files Browse the repository at this point in the history
* Register all components on ISenaiteImpressLayer

* Added upgrade step

* Changelog updated
  • Loading branch information
ramonski authored Feb 14, 2023
1 parent 30c1466 commit 9feb13d
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 18 deletions.
1 change: 1 addition & 0 deletions docs/Changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
2.4.0 (unreleased)
------------------

- #136 Change default browserlayer
- #134 Convert impress header table to senaite.app.listing
- #133 Refactor publish view controls and content table to viewlets
- #132 Add custom action provider for direct PDF sharing via email
Expand Down
4 changes: 2 additions & 2 deletions src/senaite/impress/actions/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
for="*"
class=".providers.DownloadPDF"
permission="zope2.View"
layer="senaite.impress.interfaces.ILayer"
layer="senaite.impress.interfaces.ISenaiteImpressLayer"
/>

<!-- Send report PDF Action Provider -->
Expand All @@ -18,7 +18,7 @@
for="*"
class=".providers.SendPDF"
permission="zope2.View"
layer="senaite.impress.interfaces.ILayer"
layer="senaite.impress.interfaces.ISenaiteImpressLayer"
/>

</configure>
2 changes: 1 addition & 1 deletion src/senaite/impress/browser/publish/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
name="publish_content_listing"
class=".content.ContentListingView"
permission="zope2.View"
layer="senaite.impress.interfaces.ILayer"
layer="senaite.impress.interfaces.ISenaiteImpressLayer"
/>

</configure>
2 changes: 1 addition & 1 deletion src/senaite/impress/browser/viewlets/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
manager=".interfaces.IPublishCustomHtmlHeadViewlets"
class="senaite.app.listing.browser.viewlets.resources.ResourcesViewlet"
permission="zope2.View"
layer="senaite.impress.interfaces.ILayer"
layer="senaite.impress.interfaces.ISenaiteImpressLayer"
/>

<!-- Favicon viewlet -->
Expand Down
14 changes: 7 additions & 7 deletions src/senaite/impress/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
name="printview"
class="senaite.impress.publishview.PublishView"
permission="senaite.core.permissions.ManageAnalysisRequests"
layer="senaite.impress.interfaces.ILayer"
layer="senaite.impress.interfaces.ISenaiteImpressLayer"
/>

<!-- Publish View -->
Expand All @@ -38,7 +38,7 @@
name="publish"
class="senaite.impress.publishview.PublishView"
permission="senaite.core.permissions.ManageAnalysisRequests"
layer="senaite.impress.interfaces.ILayer"
layer="senaite.impress.interfaces.ISenaiteImpressLayer"
/>

<!-- Client Publish View -->
Expand All @@ -47,7 +47,7 @@
name="publish"
class="senaite.impress.publishview.PublishView"
permission="senaite.core.permissions.ManageAnalysisRequests"
layer="senaite.impress.interfaces.ILayer"
layer="senaite.impress.interfaces.ISenaiteImpressLayer"
/>

<!-- Sample Publish View -->
Expand All @@ -56,7 +56,7 @@
name="publish"
class="senaite.impress.publishview.PublishView"
permission="senaite.core.permissions.ManageAnalysisRequests"
layer="senaite.impress.interfaces.ILayer"
layer="senaite.impress.interfaces.ISenaiteImpressLayer"
/>

<!-- Batch Publish View -->
Expand All @@ -65,7 +65,7 @@
name="publish"
class="senaite.impress.publishview.PublishView"
permission="senaite.core.permissions.ManageAnalysisRequests"
layer="senaite.impress.interfaces.ILayer"
layer="senaite.impress.interfaces.ISenaiteImpressLayer"
/>

<!-- Ajax Publish Controller View -->
Expand All @@ -74,7 +74,7 @@
name="ajax_publish"
class="senaite.impress.ajax.AjaxPublishView"
permission="zope.Public"
layer="senaite.impress.interfaces.ILayer"
layer="senaite.impress.interfaces.ISenaiteImpressLayer"
/>

<!-- Publisher Controlpanel -->
Expand All @@ -83,7 +83,7 @@
for="Products.CMFPlone.interfaces.IPloneSiteRoot"
class=".controlpanel.ImpressControlPanelView"
permission="senaite.core.permissions.ManageBika"
layer="senaite.impress.interfaces.ILayer"
layer="senaite.impress.interfaces.ISenaiteImpressLayer"
/>

<!-- Generic Model -->
Expand Down
4 changes: 4 additions & 0 deletions src/senaite/impress/profiles/default/browserlayer.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?xml version="1.0"?>
<layers>
<!-- Register default browserlayer -->
<layer name="senaite.impress"
interface="senaite.impress.interfaces.ISenaiteImpressLayer" />
<!-- BBB: Remove this in version 2.5 -->
<layer remove="True"
interface="senaite.impress.interfaces.ILayer" />
</layers>
2 changes: 1 addition & 1 deletion src/senaite/impress/profiles/default/metadata.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<metadata>
<version>2402</version>
<version>2403</version>
</metadata>
5 changes: 2 additions & 3 deletions src/senaite/impress/profiles/uninstall/browserlayer.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0"?>
<layers>
<!-- Remove Browser Layer -->
<layer name="senaite.impress"
interface="senaite.impress.interfaces.ILayer"
<!-- Remove default browser layer -->
<layer interface="senaite.impress.interfaces.ISenaiteImpressLayer"
remove="True" />
</layers>
3 changes: 0 additions & 3 deletions src/senaite/impress/profiles/uninstall/metadata.xml

This file was deleted.

Empty file.
10 changes: 10 additions & 0 deletions src/senaite/impress/upgrades/v02_04_000.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,13 @@ def import_registry(tool):
logger.info("Import SENAITE IMPRESS registry ...")
tool.runImportStepFromProfile(PROFILE_ID, "plone.app.registry")
logger.info("Import SENAITE IMPRESS registry [DONE]")


def import_browserlayer(tool):
"""Import browser layer
:param tool: portal_setup tool
"""
logger.info("Import SENAITE IMPRESS browser layer ...")
tool.runImportStepFromProfile(PROFILE_ID, "browserlayer")
logger.info("Import SENAITE IMPRESS browser layer [DONE]")
8 changes: 8 additions & 0 deletions src/senaite/impress/upgrades/v02_04_000.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,12 @@
handler="senaite.impress.upgrades.v02_04_000.import_registry"
profile="senaite.impress:default"/>

<genericsetup:upgradeStep
title="SENAITE IMPRESS 2.4.0: Change default browser layer"
description="Change default browser layer from ILayer -> ISenaiteImpressLayer"
source="2402"
destination="2403"
handler="senaite.impress.upgrades.v02_04_000.import_browserlayer"
profile="senaite.impress:default"/>

</configure>

0 comments on commit 9feb13d

Please sign in to comment.