Skip to content

Commit

Permalink
Merge pull request #51 from plone/contentbrowserwidget
Browse files Browse the repository at this point in the history
Implement new `ContentBrowserWidget`
  • Loading branch information
petschki authored Sep 20, 2024
2 parents d4f598f + 524054c commit 0594749
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 18 deletions.
6 changes: 4 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
root = true


[*] # For All Files
[*]
# Default settings for all files.
# Unix-style newlines with a newline ending every file
end_of_line = lf
insert_final_newline = true
Expand All @@ -33,7 +34,8 @@ indent_size = 4
# 2 space indentation
indent_size = 2

[*.{json,jsonl,js,jsx,ts,tsx,css,less,scss}] # Frontend development
[*.{json,jsonl,js,jsx,ts,tsx,css,less,scss}]
# Frontend development
# 2 space indentation
indent_size = 2
max_line_length = 80
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ jobs:
uses: plone/meta/.github/workflows/qa.yml@main
test:
uses: plone/meta/.github/workflows/test.yml@main
with:

py-versions: '["3.10", "3.12"]'
coverage:
uses: plone/meta/.github/workflows/coverage.yml@main
dependencies:
Expand Down Expand Up @@ -57,6 +60,13 @@ jobs:
# os_dependencies = "git libxml2 libxslt"
##

##
# To test against a specific matrix of python versions
# when running tests jobs, add in .meta.toml:
# [github]
# py_versions = "['3.12', '3.11']"
##


##
# Specify additional jobs in .meta.toml:
Expand Down
8 changes: 7 additions & 1 deletion .meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
# See the inline comments on how to expand/tweak this configuration file
[meta]
template = "default"
commit-id = "6e36bcc4"
commit-id = "5d22fbf8"

[pyproject]
dependencies_ignores = "['plone.formwidget.contenttree']"

[tox]
constraints_file = "https://dist.plone.org/release/6.1-dev/constraints.txt"

[github]
py_versions = "[\"3.10\", \"3.12\"]"
11 changes: 11 additions & 0 deletions dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Generated from:
# https://github.com/plone/meta/tree/main/config/default
# See the inline comments on how to expand/tweak this configuration file
version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
2 changes: 2 additions & 0 deletions news/51.breaking
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Implement new `ContentBrowserWidget` with `pat-contentbrowser` support.
[petschki]
4 changes: 2 additions & 2 deletions plone/app/relationfield/behavior.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from plone.app.z3cform.widget import RelatedItemsFieldWidget
from plone.app.z3cform.widgets.contentbrowser import ContentBrowserFieldWidget
from plone.autoform import directives as form
from plone.autoform.interfaces import IFormFieldProvider
from plone.base import PloneMessageFactory as _
Expand All @@ -23,7 +23,7 @@ class IRelatedItems(model.Schema):
)
form.widget(
"relatedItems",
RelatedItemsFieldWidget,
ContentBrowserFieldWidget,
vocabulary="plone.app.vocabularies.Catalog",
pattern_options={
"recentlyUsed": True # Just turn on. Config in plone.app.widgets.
Expand Down
14 changes: 11 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ target-version = ["py38"]
##

[tool.codespell]
ignore-words-list = "discreet,"
ignore-words-list = "discreet,assertin,"
skip = "*.po,"
##
# Add extra configuration options in .meta.toml:
Expand Down Expand Up @@ -119,6 +119,7 @@ Zope = [
'Products.CMFCore', 'Products.CMFDynamicViewFTI',
]
python-dateutil = ['dateutil']
pytest-plone = ['pytest', 'zope.pytestlayer', 'plone.testing', 'plone.app.testing']
ignore-packages = ['plone.formwidget.contenttree']

##
Expand All @@ -134,20 +135,27 @@ ignore-packages = ['plone.formwidget.contenttree']
[tool.check-manifest]
ignore = [
".editorconfig",
".flake8",
".meta.toml",
".pre-commit-config.yaml",
"tox.ini",
".flake8",
"dependabot.yml",
"mx.ini",
"tox.ini",

]

##
# Add extra configuration options in .meta.toml:
# [pyproject]
# check_manifest_ignores = """
# "*.map.js",
# "*.pyc",
# """
# check_manifest_extra_lines = """
# ignore-bad-ideas = [
# "some/test/file/PKG-INFO",
# ]
# """
##


Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from setuptools import setup


version = "3.0.6.dev0"
version = "4.0.0.dev0"

long_description = (
f"{Path('README.rst').read_text()}\n{Path('CHANGES.rst').read_text()}"
Expand All @@ -20,14 +20,15 @@
classifiers=[
"Development Status :: 5 - Production/Stable",
"Framework :: Plone",
"Framework :: Plone :: 6.0",
"Framework :: Plone :: 6.1",
"Framework :: Plone :: Core",
"License :: OSI Approved :: GNU General Public License (GPL)",
"Programming Language :: Python",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries :: Python Modules",
],
keywords="dexterity relations plone zc.relation",
Expand Down
20 changes: 12 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ set_env =
##
deps =
zope.testrunner
-c https://dist.plone.org/release/6.0-dev/constraints.txt
-c https://dist.plone.org/release/6.1-dev/constraints.txt

##
# Specify additional deps in .meta.toml:
# [tox]
Expand Down Expand Up @@ -151,12 +151,13 @@ set_env =
deps =
coverage
zope.testrunner
-c https://dist.plone.org/release/6.0-dev/constraints.txt
-c https://dist.plone.org/release/6.1-dev/constraints.txt

commands =
coverage run --branch --source plone.app.relationfield {envbindir}/zope-testrunner --quiet --all --test-path={toxinidir} -s plone.app.relationfield {posargs}
coverage report -m --format markdown
coverage xml
coverage html
extras =
test

Expand All @@ -168,8 +169,8 @@ deps =
twine
build
towncrier
-c https://dist.plone.org/release/6.0-dev/constraints.txt
-c https://dist.plone.org/release/6.1-dev/constraints.txt

commands =
# fake version to not have to install the package
# we build the change log as news entries might break
Expand All @@ -182,6 +183,9 @@ commands =
description = ensure there are no cyclic dependencies
use_develop = true
skip_install = false
# Here we must always constrain the package deps to what is already installed,
# otherwise we simply get the latest from PyPI, which may not work.
constrain_package_deps = true
set_env =

##
Expand All @@ -196,8 +200,8 @@ allowlist_externals =
deps =
pipdeptree
pipforester
-c https://dist.plone.org/release/6.0-dev/constraints.txt
-c https://dist.plone.org/release/6.1-dev/constraints.txt

commands =
# Generate the full dependency tree
sh -c 'pipdeptree -j > forest.json'
Expand Down

0 comments on commit 0594749

Please sign in to comment.