Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing icon #222

Merged
merged 5 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions news/222.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Add missing icon on comments' `view` action
Register contenttype icon for comments.
[gforcada, maurits]
5 changes: 5 additions & 0 deletions plone/app/discussion/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
for="plone.base.interfaces.IPloneSiteRoot"
directory="profiles/default"
/>
<utility
factory=".setuphandlers.HiddenProfiles"
provides="plone.base.interfaces.INonInstallable"
name="plone.app.discussion"
/>
<!-- For upgrade steps see upgrades.zcml. -->

<!-- Comments -->
Expand Down
2 changes: 1 addition & 1 deletion plone/app/discussion/profiles/default/metadata.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<version>2001</version>
<version>2002</version>
<dependencies>
<dependency>profile-plone.resource:default</dependency>
<dependency>profile-plone.app.registry:default</dependency>
Expand Down
6 changes: 6 additions & 0 deletions plone/app/discussion/profiles/default/registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,10 @@
<value key="edit_comment_enabled">False</value>
<value key="delete_own_comment_enabled">False</value>
</records>
<record name="plone.icon.contenttype/discussion-item">
<field type="plone.registry.field.TextLine">
<title>Plone Image</title>
</field>
<value key="resource">++plone++bootstrap-icons/chat-left-text.svg</value>
</record>
</registry>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<property name="description"
i18n:translate=""
>Comments added to a content item.</property>
<property name="content_icon">discussionitem_icon.png</property>
<property name="content_icon">++plone++bootstrap-icons/chat-left-text.svg</property>
<property name="content_meta_type">Discussion Item</property>
<property name="product" />
<property name="factory">plone.Comment</property>
Expand All @@ -28,6 +28,7 @@
<action action_id="view"
category="object"
condition_expr=""
icon_expr="string:toolbar-action/view"
title="View"
url_expr="string:${object_url}/@@view"
visible="True"
Expand Down
9 changes: 9 additions & 0 deletions plone/app/discussion/profiles/to_2002/registry.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<registry>
<record name="plone.icon.contenttype/discussion-item">
<field type="plone.registry.field.TextLine">
<title>Plone Image</title>
</field>
<value key="resource">++plone++bootstrap-icons/chat-left-text.svg</value>
</record>
</registry>
26 changes: 26 additions & 0 deletions plone/app/discussion/profiles/to_2002/types/Discussion_Item.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<object xmlns:i18n="http://xml.zope.org/namespaces/i18n"
meta_type="Factory-based Type Information"
name="Discussion Item"
i18n:domain="plone"
>
<property name="content_icon">++plone++bootstrap-icons/chat-left-text.svg</property>
<alias from="(Default)"
to="@@view"
/>
<alias from="view"
to="@@view"
/>
<!-- Note: we cannot only set an icon_exp in this action:
the other settings would be reset to empty then. -->
<action action_id="view"
category="object"
condition_expr=""
icon_expr="string:toolbar-action/view"
title="View"
url_expr="string:${object_url}/@@view"
visible="True"
>
<permission value="View" />
</action>
</object>
10 changes: 10 additions & 0 deletions plone/app/discussion/setuphandlers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from plone.base.interfaces import INonInstallable
from zope.interface import implementer


@implementer(INonInstallable)
class HiddenProfiles:
def getNonInstallableProfiles(self):
return [
"plone.app.discussion:to_2002",
]
19 changes: 19 additions & 0 deletions plone/app/discussion/upgrades.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,23 @@
/>
</genericsetup:upgradeSteps>

<genericsetup:registerProfile
name="to_2002"
title="Upgrade: icons"
provides="Products.GenericSetup.interfaces.EXTENSION"
for="plone.base.interfaces.IMigratingPloneSiteRoot"
directory="profiles/to_2002"
/>

<genericsetup:upgradeSteps
profile="plone.app.discussion:default"
source="2001"
destination="2002"
>
<genericsetup:upgradeDepends
title="Update icons"
import_profile="plone.app.discussion:to_2002"
/>
</genericsetup:upgradeSteps>

</configure>