From 4be5b8bf9d9ebaf798e5e3a67da7006d0863c3c5 Mon Sep 17 00:00:00 2001 From: David Glick Date: Tue, 5 Nov 2024 21:58:51 -0800 Subject: [PATCH 1/4] Rename default distribution to volto --- src/plone/volto/distributions.zcml | 6 +++--- .../content/content/__metadata__.json | 0 .../content/content/plone_site_root/data.json | 0 .../{default => volto}/content/discussions.json | 0 .../{default => volto}/content/principals.json | 0 .../{default => volto}/content/redirects.json | 0 .../{default => volto}/content/relations.json | 0 .../{default => volto}/content/translations.json | 0 .../distributions/{default => volto}/image.png | Bin .../distributions/{default => volto}/profiles.json | 0 .../distributions/{default => volto}/schema.json | 0 11 files changed, 3 insertions(+), 3 deletions(-) rename src/plone/volto/distributions/{default => volto}/content/content/__metadata__.json (100%) rename src/plone/volto/distributions/{default => volto}/content/content/plone_site_root/data.json (100%) rename src/plone/volto/distributions/{default => volto}/content/discussions.json (100%) rename src/plone/volto/distributions/{default => volto}/content/principals.json (100%) rename src/plone/volto/distributions/{default => volto}/content/redirects.json (100%) rename src/plone/volto/distributions/{default => volto}/content/relations.json (100%) rename src/plone/volto/distributions/{default => volto}/content/translations.json (100%) rename src/plone/volto/distributions/{default => volto}/image.png (100%) rename src/plone/volto/distributions/{default => volto}/profiles.json (100%) rename src/plone/volto/distributions/{default => volto}/schema.json (100%) diff --git a/src/plone/volto/distributions.zcml b/src/plone/volto/distributions.zcml index 6b75af5..bb62bbd 100644 --- a/src/plone/volto/distributions.zcml +++ b/src/plone/volto/distributions.zcml @@ -6,10 +6,10 @@ > diff --git a/src/plone/volto/distributions/default/content/content/__metadata__.json b/src/plone/volto/distributions/volto/content/content/__metadata__.json similarity index 100% rename from src/plone/volto/distributions/default/content/content/__metadata__.json rename to src/plone/volto/distributions/volto/content/content/__metadata__.json diff --git a/src/plone/volto/distributions/default/content/content/plone_site_root/data.json b/src/plone/volto/distributions/volto/content/content/plone_site_root/data.json similarity index 100% rename from src/plone/volto/distributions/default/content/content/plone_site_root/data.json rename to src/plone/volto/distributions/volto/content/content/plone_site_root/data.json diff --git a/src/plone/volto/distributions/default/content/discussions.json b/src/plone/volto/distributions/volto/content/discussions.json similarity index 100% rename from src/plone/volto/distributions/default/content/discussions.json rename to src/plone/volto/distributions/volto/content/discussions.json diff --git a/src/plone/volto/distributions/default/content/principals.json b/src/plone/volto/distributions/volto/content/principals.json similarity index 100% rename from src/plone/volto/distributions/default/content/principals.json rename to src/plone/volto/distributions/volto/content/principals.json diff --git a/src/plone/volto/distributions/default/content/redirects.json b/src/plone/volto/distributions/volto/content/redirects.json similarity index 100% rename from src/plone/volto/distributions/default/content/redirects.json rename to src/plone/volto/distributions/volto/content/redirects.json diff --git a/src/plone/volto/distributions/default/content/relations.json b/src/plone/volto/distributions/volto/content/relations.json similarity index 100% rename from src/plone/volto/distributions/default/content/relations.json rename to src/plone/volto/distributions/volto/content/relations.json diff --git a/src/plone/volto/distributions/default/content/translations.json b/src/plone/volto/distributions/volto/content/translations.json similarity index 100% rename from src/plone/volto/distributions/default/content/translations.json rename to src/plone/volto/distributions/volto/content/translations.json diff --git a/src/plone/volto/distributions/default/image.png b/src/plone/volto/distributions/volto/image.png similarity index 100% rename from src/plone/volto/distributions/default/image.png rename to src/plone/volto/distributions/volto/image.png diff --git a/src/plone/volto/distributions/default/profiles.json b/src/plone/volto/distributions/volto/profiles.json similarity index 100% rename from src/plone/volto/distributions/default/profiles.json rename to src/plone/volto/distributions/volto/profiles.json diff --git a/src/plone/volto/distributions/default/schema.json b/src/plone/volto/distributions/volto/schema.json similarity index 100% rename from src/plone/volto/distributions/default/schema.json rename to src/plone/volto/distributions/volto/schema.json From 08910f8ba8071c9b9368c9b99d4ac48aac7e9a1e Mon Sep 17 00:00:00 2001 From: David Glick Date: Wed, 6 Nov 2024 12:27:19 -0800 Subject: [PATCH 2/4] Upgrade step --- news/161.bugfix | 1 + src/plone/volto/profiles/default/metadata.xml | 2 +- src/plone/volto/upgrades.py | 12 ++++++++++++ src/plone/volto/upgrades.zcml | 11 +++++++++++ 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 news/161.bugfix diff --git a/news/161.bugfix b/news/161.bugfix new file mode 100644 index 0000000..b03d9f4 --- /dev/null +++ b/news/161.bugfix @@ -0,0 +1 @@ +Rename `default` distribution to `volto`. @davisagli diff --git a/src/plone/volto/profiles/default/metadata.xml b/src/plone/volto/profiles/default/metadata.xml index d2a32ce..d08f418 100644 --- a/src/plone/volto/profiles/default/metadata.xml +++ b/src/plone/volto/profiles/default/metadata.xml @@ -1,6 +1,6 @@ - 1017 + 1018 profile-plone.restapi:blocks diff --git a/src/plone/volto/upgrades.py b/src/plone/volto/upgrades.py index 96dd269..daaddcc 100644 --- a/src/plone/volto/upgrades.py +++ b/src/plone/volto/upgrades.py @@ -1,6 +1,7 @@ from copy import deepcopy from OFS.interfaces import IOrderedContainer from plone import api +from plone.base.interfaces import IPloneSiteRoot from plone.registry import field from plone.registry.interfaces import IRegistry from plone.registry.record import Record @@ -143,3 +144,14 @@ def add_block_types_index(context): if index % 250 == 0: logger.info(f"Reindexed {index}/{total} objects") transaction.commit() + + +def rename_distribution(context): + from plone.distribution.api.distribution import get_creation_report + portal = getUtility(IPloneSiteRoot) + report = get_creation_report(portal) + if report is not None: + if report.name == "default": + report.name = "volto" + if report.answers.get("distribution") == "default": + report.answers["distribution"] = "volto" diff --git a/src/plone/volto/upgrades.zcml b/src/plone/volto/upgrades.zcml index 99f92d9..b5da40c 100644 --- a/src/plone/volto/upgrades.zcml +++ b/src/plone/volto/upgrades.zcml @@ -75,4 +75,15 @@ /> + + + + From 4c097e343ef0255a11c2ca90ab875ecc2fd6b53a Mon Sep 17 00:00:00 2001 From: David Glick Date: Wed, 6 Nov 2024 12:40:24 -0800 Subject: [PATCH 3/4] fix tests --- Makefile | 2 +- src/plone/volto/testing.py | 2 +- src/plone/volto/upgrades.py | 1 + tests/conftest.py | 2 +- tests/distribution/test_registration.py | 2 +- tests/setup/test_setup_install.py | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 092b11e..92652f0 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ ifeq ($(PYTHON_VERSION_OK),0) endif # Set distributions still in development -DISTRIBUTIONS="default" +DISTRIBUTIONS="volto" all: build diff --git a/src/plone/volto/testing.py b/src/plone/volto/testing.py index 054fab3..d5f4304 100644 --- a/src/plone/volto/testing.py +++ b/src/plone/volto/testing.py @@ -32,7 +32,7 @@ class BaseFixture(PloneDistributionFixture): PACKAGE_NAME = "plone.volto" - SITES = (("default", ANSWERS),) + SITES = (("volto", ANSWERS),) _distribution_products = ( ("plone.app.contenttypes", {"loadZCML": True}), ("plone.app.caching", {"loadZCML": True}), diff --git a/src/plone/volto/upgrades.py b/src/plone/volto/upgrades.py index daaddcc..703a18c 100644 --- a/src/plone/volto/upgrades.py +++ b/src/plone/volto/upgrades.py @@ -148,6 +148,7 @@ def add_block_types_index(context): def rename_distribution(context): from plone.distribution.api.distribution import get_creation_report + portal = getUtility(IPloneSiteRoot) report = get_creation_report(portal) if report is not None: diff --git a/tests/conftest.py b/tests/conftest.py index 6fdaf91..3d31873 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -40,7 +40,7 @@ @pytest.fixture def distribution_name() -> str: """Distribution name.""" - return "default" + return "volto" @pytest.fixture diff --git a/tests/distribution/test_registration.py b/tests/distribution/test_registration.py index 45497d7..c505983 100644 --- a/tests/distribution/test_registration.py +++ b/tests/distribution/test_registration.py @@ -20,7 +20,7 @@ def test_distribution_class(self): @pytest.mark.parametrize( "attr,expected", [ - ["title", "Plone Site"], + ["title", "Plone Site (Volto)"], [ "description", "A Plone Site to be used with a Volto frontend", diff --git a/tests/setup/test_setup_install.py b/tests/setup/test_setup_install.py index 977e41b..b2ac0bf 100644 --- a/tests/setup/test_setup_install.py +++ b/tests/setup/test_setup_install.py @@ -16,7 +16,7 @@ def test_browserlayer(self, browser_layers): def test_latest_version(self, profile_last_version): """Test latest version of default profile.""" - assert profile_last_version(f"{PACKAGE_NAME}:default") == "1017" + assert profile_last_version(f"{PACKAGE_NAME}:default") == "1018" @pytest.mark.parametrize( "portal_type,behavior", From b592f9930b6e4751983a3135bbdb23443ad9022a Mon Sep 17 00:00:00 2001 From: David Glick Date: Thu, 7 Nov 2024 10:20:06 -0800 Subject: [PATCH 4/4] Fix build --- mx.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mx.ini b/mx.ini index 541cf57..68c580b 100644 --- a/mx.ini +++ b/mx.ini @@ -6,7 +6,7 @@ [settings] main-package = -e .[test] version-overrides = - plone.volto==5.0.0a1.dev0 + plone.volto==5.0.0b2.dev0 [plone.distribution] url = https://github.com/plone/plone.distribution.git