Skip to content

Commit

Permalink
add seo behavior to file (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
mamico authored Jan 13, 2025
1 parent 0c22b13 commit c46ae65
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 19 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8]
python-version: [3.11]

steps:
# git checkout
- uses: actions/checkout@v2
- uses: actions/checkout@v4

# python setup
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

# python cache
- uses: actions/cache@v1
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pyroma.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8]
python-version: [3.11]

steps:
# git checkout
- uses: actions/checkout@v2
- uses: actions/checkout@v4

# python setup
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

# python cache
- uses: actions/cache@v1
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ jobs:
# [Python version, tox env]
# - ["2.7", "py27-plone52"]
# - ["3.7", "py37-plone52"]
- ["3.8", "py38-plone60"]
# - ["3.8", "py38-plone60"]
- ["3.9", "py39-plone60"]
- ["3.10", "py310-plone60"]
- ["3.11", "py311-plone60"]
name: ${{ matrix.config[1] }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.config[0] }}
- name: Pip cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.cache/pip
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/zpretty.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8]
python-version: [3.11]

steps:
# git checkout
- uses: actions/checkout@v2
- uses: actions/checkout@v4

# python setup
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

# python cache
- uses: actions/cache@v1
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
Expand Down
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Changelog

- Added the metadata preview_caption and image_caption. An upgrade step is not necessary because the metadata will primarily be used for new content.
[mamico]
- add SEO behavior to File
[mamico]

6.3.1 (2024-12-12)
------------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<version>7309</version>
<version>7310</version>
<dependencies>
<dependency>profile-redturtle.bandi:default</dependency>
<dependency>profile-collective.venue:default</dependency>
Expand Down
10 changes: 10 additions & 0 deletions src/design/plone/contenttypes/profiles/default/types/File.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<object xmlns:i18n="http://xml.zope.org/namespaces/i18n"
meta_type="Dexterity FTI"
name="File"
i18n:domain="plone"
>
<property name="behaviors" purge="False">
<element value="kitconcept.seo" />
</property>
</object>
8 changes: 7 additions & 1 deletion src/design/plone/contenttypes/upgrades/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -920,5 +920,11 @@
destination="7309"
handler=".to_730x.to_7309"
/>

<genericsetup:upgradeStep
title="add kitconcept.seo to File"
profile="design.plone.contenttypes:default"
source="7309"
destination="7310"
handler=".to_730x.to_7310"
/>
</configure>
13 changes: 13 additions & 0 deletions src/design/plone/contenttypes/upgrades/to_730x.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,16 @@ def to_7309(context):
ps.unsetLastVersionForProfile("eea.api.taxonomy:default")
logger.info("Install blocksfield")
installOrReinstallProduct(api.portal.get(), "collective.volto.blocksfield")


def to_7310(context):
logger.info("Enable kitconcept.seo behavior to File")
portal_types = api.portal.get_tool(name="portal_types")
behavior = "kitconcept.seo"
for ct in ["File"]:
portal_type = portal_types.get(ct, None)
if portal_type:
behaviors = list(portal_type.behaviors)
if behavior not in behaviors:
behaviors.append(behavior)
portal_type.behaviors = tuple(behaviors)
2 changes: 1 addition & 1 deletion test-6.0.x.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ extends =

[versions]
collective.volto.blocksfield = 2.2.0
collective.taxonomy = 3.1.5
collective.taxonomy = 3.1.5

0 comments on commit c46ae65

Please sign in to comment.