From 8fda824a616cac29840b3c760e9ba4d4c1d9574e Mon Sep 17 00:00:00 2001 From: Gil Forcada Codinachs Date: Sun, 8 Oct 2023 11:21:02 +0200 Subject: [PATCH 01/55] feat(robot): port tests to playwright They should be easier to write and more stable. --- .../app/contenttypes/tests/robot/keywords.txt | 67 +++++++----------- .../test_collection_creator_criterion.robot | 27 ++------ .../test_collection_location_criterion.robot | 51 +++++--------- ...st_collection_review_state_criterion.robot | 27 ++------ ...test_collection_short_name_criterion.robot | 39 +++++------ .../test_collection_type_criterion.robot | 29 +++----- .../tests/robot/test_folderlisting.robot | 69 +++++++++---------- 7 files changed, 113 insertions(+), 196 deletions(-) diff --git a/plone/app/contenttypes/tests/robot/keywords.txt b/plone/app/contenttypes/tests/robot/keywords.txt index 2f204e59..2706a278 100644 --- a/plone/app/contenttypes/tests/robot/keywords.txt +++ b/plone/app/contenttypes/tests/robot/keywords.txt @@ -34,11 +34,10 @@ a event a file [Arguments] ${title} Go to ${PLONE_URL}/++add++File - Wait until page contains Add File - Input text name=form.widgets.title ${title} + Fill text name=form.widgets.title ${title} Choose File name=form.widgets.file ${PATH_TO_TEST_FILES}/file.pdf - Wait For Then Click Element css=#form-buttons-save - Wait until page contains Item created + Click css=#form-buttons-save + Get text body contains Item created a folder [Arguments] ${title} @@ -48,11 +47,10 @@ a folder a image [Arguments] ${title} Go to ${PLONE_URL}/++add++Image - Wait until page contains Add Image - Input text name=form.widgets.title ${title} + Fill text name=form.widgets.title ${title} Choose File name=form.widgets.image ${PATH_TO_TEST_FILES}/image.png - Wait For Then Click Element css=#form-buttons-save - Wait until page contains Item created error=Image could not be created. + Click css=#form-buttons-save + Get text body contains Item created a link [Arguments] ${title} @@ -63,10 +61,9 @@ a link a news item [Arguments] ${title} Go to ${PLONE_URL}/++add++News Item - Wait until page contains Add News Item - Input text name=form.widgets.IDublinCore.title ${title} - Wait For Then Click Element css=#form-buttons-save - Wait until page contains Item created + Fill text css=[name="form.widgets.IDublinCore.title"] ${title} + Click css=#form-buttons-save + Get text body contains Item created # ---------------------------------------------------------------------------- @@ -75,17 +72,15 @@ a news item the content area should contain [Arguments] ${text} - Element Should Contain id=content ${text} + Get text id=content contains ${text} the content area should not contain [Arguments] ${text} - Element Should Not Contain id=content ${text} + Get Text id=content != ${text} the collection should contain [Arguments] ${title} - Wait until page contains element xpath=//*[@id='content-core'] - Page should contain element //*[@id='content-core']//article//a[contains(text(), '${title}')] limit=1 - + Get Element //*[@id='content-core']//article//a[contains(text(), '${title}')] the collection should not contain [Arguments] ${title} @@ -101,34 +96,22 @@ fill date field Click Element xpath=//div[@data-fieldname="${fieldid}"]//div[contains(@class, 'picker__day')][contains(text(), "${day}")] I set the criteria ${type} in row ${number} to the option '${label}' - [Documentation] A couple of times we shift the focus so the input sticks, and wait a bit, - ... to make the test more stable. ${criteria_row} = Convert to String .querystring-criteria-wrapper:nth-child(${number}) - Wait until page contains element css=${criteria_row} .querystring-criteria-${type} .select2-choice - Click Element css=${criteria_row} .querystring-criteria-${type} .select2-choice - Sleep 1.5 - Set Focus To Element css=body - Wait until element is visible css=#select2-drop input - Input Text css=#select2-drop input ${label} - Sleep 1.5 - Set Focus To Element css=body - Wait until element is visible css=#select2-drop .select2-match - Click Element css=#select2-drop .select2-match - Sleep 1.5 - Set Focus To Element css=body + Click css=${criteria_row} .querystring-criteria-${type} .select2-choice + Fill Text css=#select2-drop input ${label} + Click xpath=//*[@id="select2-drop"]//*[@class="select2-match"] I set the criteria ${type} in row ${number} to the options '${label}' - ${criteria_row} = Convert to String .querystring-criteria-wrapper:nth-child(${number}) - Wait until page contains element css=${criteria_row} .querystring-criteria-${type} .select2-choices - Click Element css=${criteria_row} .querystring-criteria-${type} .select2-choices - Wait until page contains element css=.select2-input.select2-focused - Input text css=.select2-input.select2-focused ${label}\n -# Click Element xpath=//div[@class='select2-result-label']/descendant-or-self::*[contains(text(), '${label}')] + ${criteria_row} = Convert to String .querystring-criteria-wrapper:nth-child(1) + Click css=${criteria_row} .querystring-criteria-value .select2-choices + Fill text css=.select2-input.select2-focused ${label}\n + Click css=.select2-highlighted + Get text css=${criteria_row} .select2-search-choice contains ${label} + [Documentation] Chrome needs some more time + Sleep .1s I set the criteria ${type} in row ${number} to the text '${label}' ${criteria_row} = Convert to String .querystring-criteria-wrapper:nth-child(${number}) - Input text css=${criteria_row} .querystring-criteria-value input ${label}\t - [Documentation] Shift the focus so the input sticks, and wait a bit - Sleep 1.5 - Set Focus To Element css=.querystring-sortreverse - Sleep 1.5 + Fill text css=${criteria_row} .querystring-criteria-value input ${label} + Click css=.autotoc-level-1.active + Sleep 1s diff --git a/plone/app/contenttypes/tests/robot/test_collection_creator_criterion.robot b/plone/app/contenttypes/tests/robot/test_collection_creator_criterion.robot index b957e869..88533654 100644 --- a/plone/app/contenttypes/tests/robot/test_collection_creator_criterion.robot +++ b/plone/app/contenttypes/tests/robot/test_collection_creator_criterion.robot @@ -1,18 +1,7 @@ -# ============================================================================ -# Tests for the Collection Creator Criterion -# ============================================================================ -# -# $ bin/robot-server --reload-path src/plone.app.contenttypes plone.app.contenttypes.testing.PLONE_APP_CONTENTTYPES_ROBOT_TESTING -# -# $ bin/robot src/plone.app.contenttypes/plone/app/contenttypes/tests/robot/test_collection_creator_criterion.robot -# -# ============================================================================ - -*** Settings ***************************************************************** - -Resource plone/app/robotframework/keywords.robot -Resource plone/app/robotframework/saucelabs.robot -Resource plone/app/robotframework/selenium.robot +*** Settings *** + +Resource plone/app/robotframework/browser.robot +Resource plone/app/robotframework/user.robot Resource keywords.txt Library Remote ${PLONE_URL}/RobotRemote @@ -20,7 +9,6 @@ Library Remote ${PLONE_URL}/RobotRemote Test Setup Run Keywords Plone test setup Test Teardown Run keywords Plone test teardown - *** Test cases *************************************************************** Scenario: Test Creator Criterions @@ -49,11 +37,10 @@ a test user document I set the collection's creator criterion to the current logged in user Go to ${PLONE_URL}/my-collection/edit - Wait until page contains Edit Collection + Get Text body contains Edit Collection I set the criteria index in row 1 to the option 'Creator' I set the criteria operator in row 1 to the option 'Current' - Sleep 1 - Click Button Save - Wait until page contains Changes saved + Click "Save" + Get Text body contains Changes saved diff --git a/plone/app/contenttypes/tests/robot/test_collection_location_criterion.robot b/plone/app/contenttypes/tests/robot/test_collection_location_criterion.robot index eb2dc752..2ce5421f 100644 --- a/plone/app/contenttypes/tests/robot/test_collection_location_criterion.robot +++ b/plone/app/contenttypes/tests/robot/test_collection_location_criterion.robot @@ -1,18 +1,6 @@ -# ============================================================================ -# Tests for the Collection Location Criterion -# ============================================================================ -# -# $ bin/robot-server --reload-path src/plone.app.contenttypes plone.app.contenttypes.testing.PLONE_APP_CONTENTTYPES_ROBOT_TESTING -# -# $ bin/robot src/plone.app.contenttypes/plone/app/contenttypes/tests/robot/test_collection_location_criterion.robot -# -# ============================================================================ - -*** Settings ***************************************************************** - -Resource plone/app/robotframework/keywords.robot -Resource plone/app/robotframework/saucelabs.robot -Resource plone/app/robotframework/selenium.robot +*** Settings *** + +Resource plone/app/robotframework/browser.robot Resource keywords.txt Variables variables.py @@ -21,11 +9,9 @@ Test Setup Run Keywords Plone test setup Test Teardown Run keywords Plone test teardown -*** Test cases *************************************************************** +*** Test cases *** Scenario: Test Relative Location Criterion - [Documentation] This sometimes fails with: - ... Element locator 'css=#select2-drop input' did not match any elements after 30 seconds Given I am logged in as site owner And a document Document outside Folder And a folder 'my-folder' with a document 'Document within Folder' @@ -36,9 +22,6 @@ Scenario: Test Relative Location Criterion Scenario: Test Absolute Location Criterion - [Documentation] This sometimes fails with: - ... Element locator 'css=#select2-drop input' did not match any elements after 30 seconds - ... Or with: Element 'id=content' should not contain text 'Document outside Folder' but it did. Given I am logged in as site owner And a document Document outside Folder And a folder 'my-folder' with a document 'Document within Folder' @@ -52,14 +35,14 @@ Scenario: Test Absolute Location Criterion a folder '${folder-id}' with a document '${document-title}' Go to ${PLONE_URL}/++add++Folder - Wait until page contains element name=form.widgets.IDublinCore.title - Input text name=form.widgets.IDublinCore.title ${folder-id} - Click Button Save + # Wait until page contains element name=form.widgets.IDublinCore.title + Fill text xpath=//*[@name="form.widgets.IDublinCore.title"] ${folder-id} + Click "Save" Go to ${PLONE_URL}/${folder-id}/++add++Document - Wait until page contains element name=form.widgets.IDublinCore.title - Input text name=form.widgets.IDublinCore.title ${document-title} - Click Button Save - Wait until page contains Item created + # Wait until page contains element name=form.widgets.IDublinCore.title + Fill text xpath=//*[@name="form.widgets.IDublinCore.title"] ${document-title} + Click "Save" + # Wait until page contains Item created I set the collection's location criterion to Advanced Mode I set the criteria operator in row 1 to the option 'Advanced Mode' @@ -67,7 +50,7 @@ I set the collection's location criterion to Advanced Mode I set the collection's relative location criterion to [Arguments] ${criterion} Go to ${PLONE_URL}/my-collection/edit - Wait until page contains Edit Collection + # Wait until page contains Edit Collection I set the criteria index in row 1 to the option 'Location' @@ -76,13 +59,13 @@ I set the collection's relative location criterion to I set the criteria operator in row 1 to the option 'Relative path' I set the criteria value in row 1 to the text '${criterion}' - Click Button Save - Wait until page contains Changes saved + Click "Save" + # Wait until page contains Changes saved I set the collection's absolute location criterion to [Arguments] ${criterion} Go to ${PLONE_URL}/my-collection/edit - Wait until page contains Edit Collection + # Wait until page contains Edit Collection I set the criteria index in row 1 to the option 'Location' @@ -91,5 +74,5 @@ I set the collection's absolute location criterion to I set the criteria operator in row 1 to the option 'Absolute path' I set the criteria value in row 1 to the text '${criterion}' - Click Button Save - Wait until page contains Changes saved + Click "Save" + # Wait until page contains Changes saved diff --git a/plone/app/contenttypes/tests/robot/test_collection_review_state_criterion.robot b/plone/app/contenttypes/tests/robot/test_collection_review_state_criterion.robot index 719d7f97..bd4b7fe2 100644 --- a/plone/app/contenttypes/tests/robot/test_collection_review_state_criterion.robot +++ b/plone/app/contenttypes/tests/robot/test_collection_review_state_criterion.robot @@ -1,25 +1,15 @@ -# ============================================================================ -# Tests for the Collection Type Criterion -# ============================================================================ -# -# $ bin/robot-server --reload-path src/plone.app.contenttypes plone.app.contenttypes.testing.PLONE_APP_CONTENTTYPES_ROBOT_TESTING -# -# $ bin/robot src/plone.app.contenttypes/plone/app/contenttypes/tests/robot/test_collection_review_state_criterion.robot -# -# ============================================================================ - -*** Settings ***************************************************************** - -Resource plone/app/robotframework/keywords.robot -Resource plone/app/robotframework/saucelabs.robot -Resource plone/app/robotframework/selenium.robot +*** Settings *** + +Resource plone/app/robotframework/browser.robot Resource keywords.txt +Variables variables.py + Test Setup Run Keywords Plone test setup Test Teardown Run keywords Plone test teardown -*** Test cases *************************************************************** +*** Test cases *** Scenario: Test Review state Criterion Given I am logged in as site owner @@ -45,12 +35,9 @@ a private document I set the collection's review state criterion to [Arguments] ${criterion} Go to ${PLONE_URL}/my-collection/edit - Wait until page contains Edit Collection I set the criteria index in row 1 to the option 'Review state' I set the criteria operator in row 1 to the option 'Any' I set the criteria value in row 1 to the options '${criterion}' - Sleep 1 - Click Button Save - Wait until page contains Changes saved + Click "Save" diff --git a/plone/app/contenttypes/tests/robot/test_collection_short_name_criterion.robot b/plone/app/contenttypes/tests/robot/test_collection_short_name_criterion.robot index cf09f277..97246a9f 100644 --- a/plone/app/contenttypes/tests/robot/test_collection_short_name_criterion.robot +++ b/plone/app/contenttypes/tests/robot/test_collection_short_name_criterion.robot @@ -1,25 +1,15 @@ -# ============================================================================ -# Tests for the Collection Short Name Criterion -# ============================================================================ -# -# $ bin/robot-server --reload-path src/plone.app.contenttypes plone.app.contenttypes.testing.PLONE_APP_CONTENTTYPES_ROBOT_TESTING -# -# $ bin/robot src/plone.app.contenttypes/plone/app/contenttypes/tests/robot/test_collection_short_name_criterion.robot -# -# ============================================================================ - -*** Settings ***************************************************************** - -Resource plone/app/robotframework/keywords.robot -Resource plone/app/robotframework/saucelabs.robot -Resource plone/app/robotframework/selenium.robot +*** Settings *** + +Resource plone/app/robotframework/browser.robot Resource keywords.txt +Variables variables.py + Test Setup Run Keywords Plone test setup Test Teardown Run keywords Plone test teardown -*** Test cases *************************************************************** +*** Test cases *** Test Short name (id) Criterion Given I am logged in as site owner @@ -36,12 +26,19 @@ Test Short name (id) Criterion I set the collection short name (id) criterion to [Arguments] ${criterion} Go to ${PLONE_URL}/my-collection/edit - Wait until page contains Edit Collection I set the criteria index in row 1 to the option 'Short name' - I set the criteria operator in row 1 to the option 'Is' + #I set the criteria operator in row 1 to the option 'Is' + + ${criteria_row} = Convert to String .querystring-criteria-wrapper:nth-child(1) + Click css=${criteria_row} .querystring-criteria-operator .select2-choice + Fill Text css=#select2-drop input Is + Click css=.select2-highlighted + + I set the criteria value in row 1 to the text '${criterion}' + [Documentation] Chrome needs some more time + Sleep .1s - Sleep 1 - Click Button Save - Wait until page contains Changes saved + Click "Save" + Get text body contains Changes saved diff --git a/plone/app/contenttypes/tests/robot/test_collection_type_criterion.robot b/plone/app/contenttypes/tests/robot/test_collection_type_criterion.robot index d7a2bbf6..774a798d 100644 --- a/plone/app/contenttypes/tests/robot/test_collection_type_criterion.robot +++ b/plone/app/contenttypes/tests/robot/test_collection_type_criterion.robot @@ -1,25 +1,14 @@ -# ============================================================================ -# Tests for the Collection Type Criterion -# ============================================================================ -# -# $ bin/robot-server --reload-path src/plone.app.contenttypes plone.app.contenttypes.testing.PLONE_APP_CONTENTTYPES_ROBOT_TESTING -# -# $ bin/robot src/plone.app.contenttypes/plone/app/contenttypes/tests/robot/test_collection_type_criterion.robot -# -# ============================================================================ - -*** Settings ***************************************************************** - -Resource plone/app/robotframework/keywords.robot -Resource plone/app/robotframework/saucelabs.robot -Resource plone/app/robotframework/selenium.robot +*** Settings *** + +Resource plone/app/robotframework/browser.robot Resource keywords.txt +Variables variables.py + Test Setup Run Keywords Plone test setup Test Teardown Run keywords Plone test teardown - -*** Test cases *************************************************************** +*** Test cases *** Test Type Criterion Given I am logged in as site owner @@ -36,12 +25,10 @@ Test Type Criterion I set the collection's type criterion to [Arguments] ${criterion} Go to ${PLONE_URL}/my-collection/edit - Wait until page contains Edit Collection I set the criteria index in row 1 to the option 'Type' I set the criteria operator in row 1 to the option 'Any' I set the criteria value in row 1 to the options '${criterion}' - Sleep 1 - Click Button Save - Wait until page contains Changes saved + Click "Save" + Get text body contains Changes saved diff --git a/plone/app/contenttypes/tests/robot/test_folderlisting.robot b/plone/app/contenttypes/tests/robot/test_folderlisting.robot index a64f535d..2cfb53fa 100644 --- a/plone/app/contenttypes/tests/robot/test_folderlisting.robot +++ b/plone/app/contenttypes/tests/robot/test_folderlisting.robot @@ -1,18 +1,13 @@ *** Settings *** -Resource plone/app/robotframework/keywords.robot -Resource plone/app/robotframework/saucelabs.robot -Resource plone/app/robotframework/selenium.robot +Resource plone/app/robotframework/browser.robot Resource keywords.txt Variables variables.py - Test Setup Run Keywords Setup Testcontent Plone test setup Test Teardown Run keywords Plone test teardown -*** Variables *** - *** Test cases *** Scenario: Test folder listing view @@ -101,7 +96,7 @@ Listing should list contained content in detail the content area should contain this is a test document the content area should contain Test News Item the content area should contain this is a test news item - Page Should Contain Element //img[@title="Test News Item"] 2 + Get Element Count //img[@title="Test News Item"] == 2 the content area should contain Test Event the content area should contain this is a test event the content area should contain Test Collection @@ -111,29 +106,29 @@ Listing should list contained content in detail the content area should contain Test File the content area should contain file.pdf the content area should contain Test Image - Page Should Contain Element //img[@title="Test Image"] 3 + Get Element Count //img[@title="Test Image"] == 2 the content area should contain Test Album the content area should contain Test Album Image 1 - Page Should Contain Element //img[@title="Test Album Image 1"] 2 + Get Element Count //img[@title="Test Album Image 1"] == 2 the content area should contain Test Album Image 2 - Page Should Contain Element //img[@title="Test Album Image 2"] 2 + Get Element Count //img[@title="Test Album Image 2"] == 2 the content area should contain Test Album Image 3 - Page Should Contain Element //img[@title="Test Album Image 3"] 2 + Get Element Count //img[@title="Test Album Image 3"] == 2 the content area should contain Test Sub Album the content area should contain Test Sub Album Image 1 - Page Should Contain Element //img[@title="Test Sub Album Image 1"] 1 + Get Element Count //img[@title="Test Sub Album Image 1"] == 1 the content area should contain Test Sub Album Image 2 - Page Should Contain Element //img[@title="Test Sub Album Image 2"] 1 + Get Element Count //img[@title="Test Sub Album Image 2"] == 1 the content area should contain Test Sub Album Image 3 - Page Should Contain Element //img[@title="Test Sub Album Image 3"] 1 + Get Element Count //img[@title="Test Sub Album Image 3"] == 1 Album should list contained images and albums the content area should contain Test Album Image 1 - Page Should Contain Element //img[@title="Test Album Image 1"] 2 + Get Element Count //img[@title="Test Album Image 1"] == 1 the content area should contain Test Album Image 2 - Page Should Contain Element //img[@title="Test Album Image 2"] 2 + Get Element Count //img[@title="Test Album Image 2"] == 1 the content area should contain Test Album Image 3 - Page Should Contain Element //img[@title="Test Album Image 3"] 2 + Get Element Count //img[@title="Test Album Image 3"] == 1 the content area should contain Test Sub Album @@ -159,7 +154,7 @@ Listing should list all content in detail the content area should contain this is a test document the content area should contain Test News Item the content area should contain this is a test news item - Page Should Contain Element //img[@title="Test News Item"] 2 + Get Element Count //img[@title="Test News Item"] == 2 the content area should contain Test Event the content area should contain this is a test event the content area should contain Test Collection @@ -169,39 +164,39 @@ Listing should list all content in detail the content area should contain Test File the content area should contain file.pdf the content area should contain Test Image - Page Should Contain Element //img[@title="Test Image"] 3 + Get Element Count //img[@title="Test Image"] == 2 the content area should contain Test Album the content area should contain Test Album Image 1 - Page Should Contain Element //img[@title="Test Album Image 1"] 2 + Get Element Count //img[@title="Test Album Image 1"] == 2 the content area should contain Test Album Image 2 - Page Should Contain Element //img[@title="Test Album Image 2"] 2 + Get Element Count //img[@title="Test Album Image 2"] == 2 the content area should contain Test Album Image 3 - Page Should Contain Element //img[@title="Test Album Image 3"] 2 + Get Element Count //img[@title="Test Album Image 3"] == 2 the content area should contain Test Sub Album the content area should contain Test Sub Album Image 1 - Page Should Contain Element //img[@title="Test Sub Album Image 1"] 2 + Get Element Count //img[@title="Test Sub Album Image 1"] == 2 the content area should contain Test Sub Album Image 2 - Page Should Contain Element //img[@title="Test Sub Album Image 2"] 2 + Get Element Count //img[@title="Test Sub Album Image 2"] == 2 the content area should contain Test Sub Album Image 3 - Page Should Contain Element //img[@title="Test Sub Album Image 3"] 2 + Get Element Count //img[@title="Test Sub Album Image 3"] == 2 Album should list all images and albums the content area should contain Test Image - Page Should Contain Element //div[contains(@class, "card-image")]//img[@title="Test Image"] 1 + Get Element Count //div[contains(@class, "card-image")]//img[@title="Test Image"] == 1 the content area should contain Test News Item - Page Should Contain Element //div[contains(@class, "card-image")]//img[@title="Test News Item"] 1 + Get Element Count //div[contains(@class, "card-image")]//img[@title="Test News Item"] == 1 the content area should contain Test Album Image 1 - Page Should Contain Element //div[contains(@class, "card-image")]//img[@title="Test Album Image 1"] 1 + Get Element Count //div[contains(@class, "card-image")]//img[@title="Test Album Image 1"] == 1 the content area should contain Test Album Image 2 - Page Should Contain Element //div[contains(@class, "card-image")]//img[@title="Test Album Image 2"] 1 + Get Element Count //div[contains(@class, "card-image")]//img[@title="Test Album Image 2"] == 1 the content area should contain Test Album Image 3 - Page Should Contain Element //div[contains(@class, "card-image")]//img[@title="Test Album Image 3"] 1 + Get Element Count //div[contains(@class, "card-image")]//img[@title="Test Album Image 3"] == 1 the content area should contain Test Sub Album Image 1 - Page Should Contain Element //div[contains(@class, "card-image")]//img[@title="Test Sub Album Image 1"] 1 + Get Element Count //div[contains(@class, "card-image")]//img[@title="Test Sub Album Image 1"] == 1 the content area should contain Test Sub Album Image 2 - Page Should Contain Element //div[contains(@class, "card-image")]//img[@title="Test Sub Album Image 2"] 1 + Get Element Count //div[contains(@class, "card-image")]//img[@title="Test Sub Album Image 2"] == 1 the content area should contain Test Sub Album Image 3 - Page Should Contain Element //div[contains(@class, "card-image")]//img[@title="Test Sub Album Image 3"] 1 + Get Element Count //div[contains(@class, "card-image")]//img[@title="Test Sub Album Image 3"] == 1 the content area should contain Test Album the content area should contain Test Sub Album @@ -230,8 +225,6 @@ I go to I disable dropdown navigation Go to ${PLONE_URL}/@@navigation-controlpanel - Input Text name=form.widgets.navigation_depth 1 - Set Focus To Element css=#form-buttons-save - Wait Until Element Is Visible css=#form-buttons-save - Click Button Save - Wait until page contains Changes saved + Fill Text css=[name="form.widgets.navigation_depth"] 1 + Click "Save" + Get Text body contains Changes saved From ec17b68497c5285282b1c7fe793bd162673cdd88 Mon Sep 17 00:00:00 2001 From: Gil Forcada Codinachs Date: Sun, 8 Oct 2023 18:38:49 +0200 Subject: [PATCH 02/55] Add news entry --- news/3813.bugfix | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 news/3813.bugfix diff --git a/news/3813.bugfix b/news/3813.bugfix new file mode 100644 index 00000000..7b6bc3f3 --- /dev/null +++ b/news/3813.bugfix @@ -0,0 +1,2 @@ +Port robot tests to playwright. +[gforcada] From 3cbf488682d639c5e2d912c1a8b911bfa1240d28 Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Sat, 7 Oct 2023 00:38:33 +0200 Subject: [PATCH 03/55] Preparing release 3.0.3 [ci skip] --- CHANGES.rst | 10 ++++++++++ news/7723aeaf.internal | 2 -- 2 files changed, 10 insertions(+), 2 deletions(-) delete mode 100644 news/7723aeaf.internal diff --git a/CHANGES.rst b/CHANGES.rst index 61f1f758..5d89134f 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -8,6 +8,16 @@ Changelog .. towncrier release notes start +3.0.3 (2023-10-07) +------------------ + +Internal: + + +- Update configuration files. + [plone devs] (7723aeaf) + + 3.0.3 (2023-05-22) ------------------ diff --git a/news/7723aeaf.internal b/news/7723aeaf.internal deleted file mode 100644 index c08f5399..00000000 --- a/news/7723aeaf.internal +++ /dev/null @@ -1,2 +0,0 @@ -Update configuration files. -[plone devs] From 7ddcef92407aaed0ef5313a4766e9d4987b39cba Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Sat, 7 Oct 2023 00:38:50 +0200 Subject: [PATCH 04/55] Back to development: 3.0.4 [ci skip] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 03e62fdf..d48a8e1d 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ import os -version = "3.0.3" +version = "3.0.4.dev0" def read(*rnames): From c92e75ffc7473d84af8b204735821e8347aeaf42 Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Sat, 7 Oct 2023 00:40:59 +0200 Subject: [PATCH 05/55] Revert "Preparing release 3.0.3" This reverts commit 4f70ac7076f43713a6257d41bd6e91fe68eac2c0. 3.0.3 was released half a year ago. The tag was there, but the 'back to development' commit was missing. Let me make a new 3.0.4 release. --- CHANGES.rst | 10 ---------- news/7723aeaf.internal | 2 ++ 2 files changed, 2 insertions(+), 10 deletions(-) create mode 100644 news/7723aeaf.internal diff --git a/CHANGES.rst b/CHANGES.rst index 5d89134f..61f1f758 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -8,16 +8,6 @@ Changelog .. towncrier release notes start -3.0.3 (2023-10-07) ------------------- - -Internal: - - -- Update configuration files. - [plone devs] (7723aeaf) - - 3.0.3 (2023-05-22) ------------------ diff --git a/news/7723aeaf.internal b/news/7723aeaf.internal new file mode 100644 index 00000000..c08f5399 --- /dev/null +++ b/news/7723aeaf.internal @@ -0,0 +1,2 @@ +Update configuration files. +[plone devs] From 91b85aeab1682b57fcc37f8257f7d6feab883641 Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Sat, 7 Oct 2023 00:42:10 +0200 Subject: [PATCH 06/55] Preparing release 3.0.4 [ci skip] --- CHANGES.rst | 10 ++++++++++ news/7723aeaf.internal | 2 -- setup.py | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) delete mode 100644 news/7723aeaf.internal diff --git a/CHANGES.rst b/CHANGES.rst index 61f1f758..e61f99fc 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -8,6 +8,16 @@ Changelog .. towncrier release notes start +3.0.4 (2023-10-07) +------------------ + +Internal: + + +- Update configuration files. + [plone devs] (7723aeaf) + + 3.0.3 (2023-05-22) ------------------ diff --git a/news/7723aeaf.internal b/news/7723aeaf.internal deleted file mode 100644 index c08f5399..00000000 --- a/news/7723aeaf.internal +++ /dev/null @@ -1,2 +0,0 @@ -Update configuration files. -[plone devs] diff --git a/setup.py b/setup.py index d48a8e1d..16e2bf6e 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ import os -version = "3.0.4.dev0" +version = "3.0.4" def read(*rnames): From 4dda6f525c6ab28461fcd79dc31d8fb8a1c1a967 Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Sat, 7 Oct 2023 00:42:37 +0200 Subject: [PATCH 07/55] Back to development: 3.0.5 [ci skip] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 16e2bf6e..5ddf6af5 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ import os -version = "3.0.4" +version = "3.0.5.dev0" def read(*rnames): From a17f77cb984439b728a91a6e526a609f11c0c8a6 Mon Sep 17 00:00:00 2001 From: 1letter <1letter@gmx.de> Date: Thu, 19 Oct 2023 14:27:20 +0200 Subject: [PATCH 08/55] Fix link_redirect_view --- plone/app/contenttypes/browser/link_redirect_view.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plone/app/contenttypes/browser/link_redirect_view.py b/plone/app/contenttypes/browser/link_redirect_view.py index eee881ca..e048730a 100644 --- a/plone/app/contenttypes/browser/link_redirect_view.py +++ b/plone/app/contenttypes/browser/link_redirect_view.py @@ -6,6 +6,7 @@ from Products.Five.browser import BrowserView from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from urllib.parse import urlparse +from zope.component import getMultiAdapter from zope.component import getUtility @@ -111,10 +112,16 @@ def absolute_target_url(self): if "resolveuid" in url: uid = url.split("/")[-1] obj = uuidToObject(uid) + + portal_state = getMultiAdapter( + (self.context, self.request), name="plone_portal_state" + ) + portal_url = portal_state.portal_url() + if obj: url = "/".join(obj.getPhysicalPath()[2:]) if not url.startswith("/"): - url = "/" + url + url = f"{portal_url}/{url}" if not url.startswith(("http://", "https://")): url = self.request["SERVER_URL"] + url From 66e8e416aa243ab3bba61ea083c2328d24bbc169 Mon Sep 17 00:00:00 2001 From: 1letter <1letter@gmx.de> Date: Thu, 19 Oct 2023 14:27:24 +0200 Subject: [PATCH 09/55] Add News --- news/671.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/671.bugfix diff --git a/news/671.bugfix b/news/671.bugfix new file mode 100644 index 00000000..00b5b905 --- /dev/null +++ b/news/671.bugfix @@ -0,0 +1 @@ +Fix link_redirect_view, respect vhm vs none-vhm url schemes @1letter \ No newline at end of file From 827b70a43c1fa8102dd314af0cdd3dedd9befc6f Mon Sep 17 00:00:00 2001 From: 1letter <1letter@gmx.de> Date: Thu, 19 Oct 2023 14:53:37 +0200 Subject: [PATCH 10/55] Fix Test --- plone/app/contenttypes/tests/test_link.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plone/app/contenttypes/tests/test_link.py b/plone/app/contenttypes/tests/test_link.py index dd306c27..3d3ac8bd 100644 --- a/plone/app/contenttypes/tests/test_link.py +++ b/plone/app/contenttypes/tests/test_link.py @@ -375,4 +375,10 @@ def test_resolve_uid_to_absolute_target(self): doc1 = self.portal["doc1"] uid = IUUID(doc1) self.link.remoteUrl = f"${{portal_url}}/resolveuid/{uid}" - self.assertEqual(view.absolute_target_url(), "http://nohost/doc1") + + portal_state = getMultiAdapter( + (self.link, self.request), name="plone_portal_state" + ) + portal_url = portal_state.portal_url() + + self.assertEqual(view.absolute_target_url(), f"{portal_url}/doc1") From d3b2a0fd46c111c044d2b3e18bfbd34ccbc42474 Mon Sep 17 00:00:00 2001 From: 1letter <1letter@gmx.de> Date: Thu, 19 Oct 2023 15:30:47 +0200 Subject: [PATCH 11/55] Fix path construction --- plone/app/contenttypes/browser/link_redirect_view.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plone/app/contenttypes/browser/link_redirect_view.py b/plone/app/contenttypes/browser/link_redirect_view.py index e048730a..7c2b9272 100644 --- a/plone/app/contenttypes/browser/link_redirect_view.py +++ b/plone/app/contenttypes/browser/link_redirect_view.py @@ -1,3 +1,4 @@ +from plone import api from plone.app.contenttypes.utils import replace_link_variables_by_paths from plone.app.uuid.utils import uuidToObject from plone.base.interfaces import ITypesSchema @@ -116,10 +117,16 @@ def absolute_target_url(self): portal_state = getMultiAdapter( (self.context, self.request), name="plone_portal_state" ) + + portal = portal_state.portal() portal_url = portal_state.portal_url() + path_pieces = tuple( + set(portal.getPhysicalPath()) ^ set(obj.getPhysicalPath()) + ) + if obj: - url = "/".join(obj.getPhysicalPath()[2:]) + url = "/".join(path_pieces) if not url.startswith("/"): url = f"{portal_url}/{url}" if not url.startswith(("http://", "https://")): From 063fbe09c749d3c6dc59a5159f3539ea8ebaca63 Mon Sep 17 00:00:00 2001 From: 1letter <1letter@gmx.de> Date: Thu, 19 Oct 2023 15:37:22 +0200 Subject: [PATCH 12/55] Simplify url constrction in link_redirect_view --- .../contenttypes/browser/link_redirect_view.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/plone/app/contenttypes/browser/link_redirect_view.py b/plone/app/contenttypes/browser/link_redirect_view.py index 7c2b9272..9fbfedd3 100644 --- a/plone/app/contenttypes/browser/link_redirect_view.py +++ b/plone/app/contenttypes/browser/link_redirect_view.py @@ -113,22 +113,7 @@ def absolute_target_url(self): if "resolveuid" in url: uid = url.split("/")[-1] obj = uuidToObject(uid) - - portal_state = getMultiAdapter( - (self.context, self.request), name="plone_portal_state" - ) - - portal = portal_state.portal() - portal_url = portal_state.portal_url() - - path_pieces = tuple( - set(portal.getPhysicalPath()) ^ set(obj.getPhysicalPath()) - ) - - if obj: - url = "/".join(path_pieces) - if not url.startswith("/"): - url = f"{portal_url}/{url}" + url = obj.absolute_url() if not url.startswith(("http://", "https://")): url = self.request["SERVER_URL"] + url From d69be298d5ab239c4b8054ec30c81ce32d20a213 Mon Sep 17 00:00:00 2001 From: 1letter <1letter@gmx.de> Date: Thu, 19 Oct 2023 15:42:35 +0200 Subject: [PATCH 13/55] remove unused imports --- plone/app/contenttypes/browser/link_redirect_view.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/plone/app/contenttypes/browser/link_redirect_view.py b/plone/app/contenttypes/browser/link_redirect_view.py index 9fbfedd3..5c57fa62 100644 --- a/plone/app/contenttypes/browser/link_redirect_view.py +++ b/plone/app/contenttypes/browser/link_redirect_view.py @@ -1,4 +1,3 @@ -from plone import api from plone.app.contenttypes.utils import replace_link_variables_by_paths from plone.app.uuid.utils import uuidToObject from plone.base.interfaces import ITypesSchema @@ -7,7 +6,6 @@ from Products.Five.browser import BrowserView from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from urllib.parse import urlparse -from zope.component import getMultiAdapter from zope.component import getUtility From fac87422242b20092ead80b4f8786c876a93c183 Mon Sep 17 00:00:00 2001 From: 1letter <1letter@gmx.de> Date: Fri, 20 Oct 2023 09:24:32 +0200 Subject: [PATCH 14/55] Make resolution of uid more robust --- .../browser/link_redirect_view.py | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/plone/app/contenttypes/browser/link_redirect_view.py b/plone/app/contenttypes/browser/link_redirect_view.py index 5c57fa62..d6747feb 100644 --- a/plone/app/contenttypes/browser/link_redirect_view.py +++ b/plone/app/contenttypes/browser/link_redirect_view.py @@ -25,6 +25,21 @@ ] +def get_uid_from_path(url=None): + if not url: + return None + + paths = url.split("/") + uid = None + if "resolveuid" in paths: + ri = paths.index("resolveuid") + if ri + 1 != len(paths): + uid = paths[ri + 1] + if uid == "": + uid = None + return uid + + class LinkRedirectView(BrowserView): index = ViewPageTemplateFile("templates/link.pt") @@ -109,9 +124,13 @@ def absolute_target_url(self): url = "/".join([context_state.canonical_object_url(), url]) else: if "resolveuid" in url: - uid = url.split("/")[-1] + uid = get_uid_from_path(url) obj = uuidToObject(uid) + if obj is None: + # uid can't resolve, return the url + return url url = obj.absolute_url() + if not url.startswith(("http://", "https://")): url = self.request["SERVER_URL"] + url From dbce8aa8b39df7525a3b6e5c33d7b6dfcba5e90f Mon Sep 17 00:00:00 2001 From: 1letter <1letter@gmx.de> Date: Fri, 20 Oct 2023 09:25:06 +0200 Subject: [PATCH 15/55] Update Tests - tests for get_uid_from_path --- plone/app/contenttypes/tests/test_link.py | 66 +++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/plone/app/contenttypes/tests/test_link.py b/plone/app/contenttypes/tests/test_link.py index 3d3ac8bd..2287972a 100644 --- a/plone/app/contenttypes/tests/test_link.py +++ b/plone/app/contenttypes/tests/test_link.py @@ -1,4 +1,5 @@ from datetime import datetime +from plone.app.contenttypes.browser.link_redirect_view import get_uid_from_path from plone.app.contenttypes.interfaces import ILink from plone.app.contenttypes.testing import ( # noqa PLONE_APP_CONTENTTYPES_FUNCTIONAL_TESTING, @@ -230,6 +231,67 @@ def test_ftp_type(self): self.assertTrue(view()) self._assert_redirect(self.link.remoteUrl) + def test_get_uid_from_path(self): + url = None + uid = get_uid_from_path(url) + self.assertIsNone(uid) + + url = "http://nohost" + uid = get_uid_from_path(url) + self.assertIsNone(uid) + + url = "http://nohost/test1" + uid = get_uid_from_path(url) + self.assertIsNone(uid) + + url = "http://nohost/test1/resolveuid" + uid = get_uid_from_path(url) + self.assertIsNone(uid) + + url = "http://nohost/test1/resolveuid/" + uid = get_uid_from_path(url) + self.assertIsNone(uid) + + url = "http://nohost/test1/resolveuid123/" + uid = get_uid_from_path(url) + self.assertIsNone(uid) + + url = "http://nohost/test1/resolveuid/123" + uid = get_uid_from_path(url) + self.assertEqual(uid, "123") + + url = "http://nohost/test1/resolveuid/123/" + uid = get_uid_from_path(url) + self.assertEqual(uid, "123") + + url = "http://nohost/test1/resolveuid/123/test" + uid = get_uid_from_path(url) + self.assertEqual(uid, "123") + + url = "resolveuid/123" + uid = get_uid_from_path(url) + self.assertEqual(uid, "123") + + url = "resolveuid/123/" + uid = get_uid_from_path(url) + self.assertEqual(uid, "123") + + url = "resolveuid/123/abc" + uid = get_uid_from_path(url) + self.assertEqual(uid, "123") + + url = "/resolveuid/123" + uid = get_uid_from_path(url) + self.assertEqual(uid, "123") + + url = "/resolveuid/123/" + uid = get_uid_from_path(url) + self.assertEqual(uid, "123") + + url = "/resolveuid/123/abc" + uid = get_uid_from_path(url) + self.assertEqual(uid, "123") + def _publish(self, obj): portal_workflow = getToolByName(self.portal, "portal_workflow") portal_workflow.doActionFor(obj, "publish") @@ -382,3 +444,7 @@ def test_resolve_uid_to_absolute_target(self): portal_url = portal_state.portal_url() self.assertEqual(view.absolute_target_url(), f"{portal_url}/doc1") + + # check not resolvable uid + self.link.remoteUrl = "/resolveuid/abc123" + self.assertEqual(view.absolute_target_url(), "/resolveuid/abc123") From 1a31e896f03b3f59f20345e3d5bdd283b84f6695 Mon Sep 17 00:00:00 2001 From: 1letter <1letter@gmx.de> Date: Fri, 20 Oct 2023 10:36:19 +0200 Subject: [PATCH 16/55] Calculate a fragment of path - Make resolution of uid more robust - calculate a fragment of anchor if available --- .../browser/link_redirect_view.py | 40 +++++++++++++++---- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/plone/app/contenttypes/browser/link_redirect_view.py b/plone/app/contenttypes/browser/link_redirect_view.py index d6747feb..645ee5b4 100644 --- a/plone/app/contenttypes/browser/link_redirect_view.py +++ b/plone/app/contenttypes/browser/link_redirect_view.py @@ -25,19 +25,42 @@ ] -def get_uid_from_path(url=None): +def normalize_uid_from_path(url=None): + """ + Args: + url (string): a path or orl + + Returns: + tuple: tuple of (uid, fragment) a fragment is an anchor id e.g. #head1 + """ + uid = None + fragment = None + if not url: - return None + return uid, fragment + # resolve uid paths = url.split("/") - uid = None - if "resolveuid" in paths: - ri = paths.index("resolveuid") + paths_lower = [_item.lower() for _item in paths] + + if "resolveuid" in paths_lower: + ri = paths_lower.index("resolveuid") if ri + 1 != len(paths): uid = paths[ri + 1] if uid == "": uid = None - return uid + + if not uid: + return uid, fragment + + # resolve fragment + parts = urlparse(uid) + + uid = parts.path + + fragment = f"#{parts.fragment}" if parts.fragment else None + + return uid, fragment class LinkRedirectView(BrowserView): @@ -124,12 +147,15 @@ def absolute_target_url(self): url = "/".join([context_state.canonical_object_url(), url]) else: if "resolveuid" in url: - uid = get_uid_from_path(url) + uid, fragment = normalize_uid_from_path(url) obj = uuidToObject(uid) if obj is None: # uid can't resolve, return the url return url + url = obj.absolute_url() + if fragment is not None: + url = f"{url}{fragment}" if not url.startswith(("http://", "https://")): url = self.request["SERVER_URL"] + url From b1fc119be29f8e9b3f84ea521842ec6cca071b31 Mon Sep 17 00:00:00 2001 From: 1letter <1letter@gmx.de> Date: Fri, 20 Oct 2023 10:36:24 +0200 Subject: [PATCH 17/55] Update tests --- plone/app/contenttypes/tests/test_link.py | 93 ++++++++++++++++++----- 1 file changed, 75 insertions(+), 18 deletions(-) diff --git a/plone/app/contenttypes/tests/test_link.py b/plone/app/contenttypes/tests/test_link.py index 2287972a..702e4d99 100644 --- a/plone/app/contenttypes/tests/test_link.py +++ b/plone/app/contenttypes/tests/test_link.py @@ -1,5 +1,5 @@ from datetime import datetime -from plone.app.contenttypes.browser.link_redirect_view import get_uid_from_path +from plone.app.contenttypes.browser.link_redirect_view import normalize_uid_from_path from plone.app.contenttypes.interfaces import ILink from plone.app.contenttypes.testing import ( # noqa PLONE_APP_CONTENTTYPES_FUNCTIONAL_TESTING, @@ -231,66 +231,116 @@ def test_ftp_type(self): self.assertTrue(view()) self._assert_redirect(self.link.remoteUrl) - def test_get_uid_from_path(self): + def test_normalize_uid_from_path(self): url = None - uid = get_uid_from_path(url) + uid, fragment = normalize_uid_from_path(url) self.assertIsNone(uid) + self.assertIsNone(fragment) url = "http://nohost" - uid = get_uid_from_path(url) + uid, fragment = normalize_uid_from_path(url) self.assertIsNone(uid) + self.assertIsNone(fragment) url = "http://nohost/test1" - uid = get_uid_from_path(url) + uid, fragment = normalize_uid_from_path(url) self.assertIsNone(uid) + self.assertIsNone(fragment) url = "http://nohost/test1/resolveuid" - uid = get_uid_from_path(url) + uid, fragment = normalize_uid_from_path(url) self.assertIsNone(uid) + self.assertIsNone(fragment) url = "http://nohost/test1/resolveuid/" - uid = get_uid_from_path(url) + uid, fragment = normalize_uid_from_path(url) self.assertIsNone(uid) + self.assertIsNone(fragment) url = "http://nohost/test1/resolveuid123/" - uid = get_uid_from_path(url) + uid, fragment = normalize_uid_from_path(url) self.assertIsNone(uid) + self.assertIsNone(fragment) url = "http://nohost/test1/resolveuid/123" - uid = get_uid_from_path(url) + uid, fragment = normalize_uid_from_path(url) self.assertEqual(uid, "123") + self.assertIsNone(fragment) + + url = "http://nohost/test1/resolveuid/123#my-id" + uid, fragment = normalize_uid_from_path(url) + self.assertEqual(uid, "123") + self.assertEqual(fragment, "#my-id") url = "http://nohost/test1/resolveuid/123/" - uid = get_uid_from_path(url) + uid, fragment = normalize_uid_from_path(url) self.assertEqual(uid, "123") + self.assertIsNone(fragment) + + url = "http://nohost/test1/resolveuid/123#my-id/" + uid, fragment = normalize_uid_from_path(url) + self.assertEqual(uid, "123") + self.assertEqual(fragment, "#my-id") url = "http://nohost/test1/resolveuid/123/test" - uid = get_uid_from_path(url) + uid, fragment = normalize_uid_from_path(url) self.assertEqual(uid, "123") + self.assertIsNone(fragment) url = "resolveuid/123" - uid = get_uid_from_path(url) + uid, fragment = normalize_uid_from_path(url) self.assertEqual(uid, "123") + self.assertIsNone(fragment) + + url = "resolveuid/123#my-id" + uid, fragment = normalize_uid_from_path(url) + self.assertEqual(uid, "123") + self.assertEqual(fragment, "#my-id") url = "resolveuid/123/" - uid = get_uid_from_path(url) + uid, fragment = normalize_uid_from_path(url) + self.assertEqual(uid, "123") + self.assertIsNone(fragment) + + url = "resolveuid/123#my-id/" + uid, fragment = normalize_uid_from_path(url) self.assertEqual(uid, "123") + self.assertEqual(fragment, "#my-id") url = "resolveuid/123/abc" - uid = get_uid_from_path(url) + uid, fragment = normalize_uid_from_path(url) self.assertEqual(uid, "123") + self.assertIsNone(fragment) url = "/resolveuid/123" - uid = get_uid_from_path(url) + uid, fragment = normalize_uid_from_path(url) + self.assertEqual(uid, "123") + self.assertIsNone(fragment) + + url = "/resolveuid/123#my-id" + uid, fragment = normalize_uid_from_path(url) self.assertEqual(uid, "123") + self.assertEqual(fragment, "#my-id") url = "/resolveuid/123/" - uid = get_uid_from_path(url) + uid, fragment = normalize_uid_from_path(url) + self.assertEqual(uid, "123") + self.assertIsNone(fragment) + + url = "/resolveuid/123#my-id/" + uid, fragment = normalize_uid_from_path(url) self.assertEqual(uid, "123") + self.assertEqual(fragment, "#my-id") url = "/resolveuid/123/abc" - uid = get_uid_from_path(url) + uid, fragment = normalize_uid_from_path(url) + self.assertEqual(uid, "123") + self.assertIsNone(fragment) + + url = "/resolveUid/123#my-id" + uid, fragment = normalize_uid_from_path(url) self.assertEqual(uid, "123") + self.assertEqual(fragment, "#my-id") def _publish(self, obj): portal_workflow = getToolByName(self.portal, "portal_workflow") @@ -436,15 +486,22 @@ def test_resolve_uid_to_absolute_target(self): ) doc1 = self.portal["doc1"] uid = IUUID(doc1) - self.link.remoteUrl = f"${{portal_url}}/resolveuid/{uid}" portal_state = getMultiAdapter( (self.link, self.request), name="plone_portal_state" ) portal_url = portal_state.portal_url() + # check an internal link + self.link.remoteUrl = f"${{portal_url}}/resolveuid/{uid}" self.assertEqual(view.absolute_target_url(), f"{portal_url}/doc1") + # check an internal link with fragment + self.link.remoteUrl = f"${{portal_url}}/resolveuid/{uid}#autotoc-item-autotoc-1" + self.assertEqual( + view.absolute_target_url(), f"{portal_url}/doc1#autotoc-item-autotoc-1" + ) + # check not resolvable uid self.link.remoteUrl = "/resolveuid/abc123" self.assertEqual(view.absolute_target_url(), "/resolveuid/abc123") From 9a14cbba1c77218ec02121f119f1f4455bc74ecd Mon Sep 17 00:00:00 2001 From: 1letter <1letter@gmx.de> Date: Fri, 20 Oct 2023 15:11:22 +0200 Subject: [PATCH 18/55] Update 671.bugfix add empty line at the end of news file --- news/671.bugfix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news/671.bugfix b/news/671.bugfix index 00b5b905..074ab236 100644 --- a/news/671.bugfix +++ b/news/671.bugfix @@ -1 +1 @@ -Fix link_redirect_view, respect vhm vs none-vhm url schemes @1letter \ No newline at end of file +Fix link_redirect_view, respect vhm vs none-vhm url schemes @1letter From bafecede689bd7e686e8872923a22c39f73640fc Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Wed, 25 Oct 2023 12:42:18 +0200 Subject: [PATCH 19/55] Preparing release 3.0.5 [ci skip] --- CHANGES.rst | 9 +++++++++ news/671.bugfix | 1 - setup.py | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) delete mode 100644 news/671.bugfix diff --git a/CHANGES.rst b/CHANGES.rst index e61f99fc..d711d938 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -8,6 +8,15 @@ Changelog .. towncrier release notes start +3.0.5 (2023-10-25) +------------------ + +Bug fixes: + + +- Fix link_redirect_view, respect vhm vs none-vhm url schemes @1letter (#671) + + 3.0.4 (2023-10-07) ------------------ diff --git a/news/671.bugfix b/news/671.bugfix deleted file mode 100644 index 074ab236..00000000 --- a/news/671.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix link_redirect_view, respect vhm vs none-vhm url schemes @1letter diff --git a/setup.py b/setup.py index 5ddf6af5..ee50aa6d 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ import os -version = "3.0.5.dev0" +version = "3.0.5" def read(*rnames): From c7788946188b9f17c2778f7f4381d42065ebee62 Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Wed, 25 Oct 2023 12:42:36 +0200 Subject: [PATCH 20/55] Back to development: 3.0.6 [ci skip] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ee50aa6d..67a3f08b 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ import os -version = "3.0.5" +version = "3.0.6.dev0" def read(*rnames): From 3480124e0ddd7ab1bf119be59114b587809ae77a Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Mon, 6 Nov 2023 17:30:43 +0100 Subject: [PATCH 21/55] pre commit autoupdate --- .pre-commit-config.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5ef2b819..80600f5a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,7 +7,7 @@ ci: repos: - repo: https://github.com/asottile/pyupgrade - rev: v3.4.0 + rev: v3.15.0 hooks: - id: pyupgrade args: [--py38-plus] @@ -16,11 +16,11 @@ repos: hooks: - id: isort - repo: https://github.com/psf/black - rev: 23.3.0 + rev: 23.10.1 hooks: - id: black - repo: https://github.com/collective/zpretty - rev: 3.1.0a2 + rev: 3.1.0 hooks: - id: zpretty @@ -32,11 +32,11 @@ repos: # """ ## - repo: https://github.com/PyCQA/flake8 - rev: 6.0.0 + rev: 6.1.0 hooks: - id: flake8 - repo: https://github.com/codespell-project/codespell - rev: v2.2.4 + rev: v2.2.6 hooks: - id: codespell additional_dependencies: @@ -58,12 +58,12 @@ repos: hooks: - id: pyroma - repo: https://github.com/mgedmin/check-python-versions - rev: "0.21.2" + rev: "0.22.0" hooks: - id: check-python-versions args: ['--only', 'setup.py,pyproject.toml'] - repo: https://github.com/collective/i18ndude - rev: "6.0.0" + rev: "6.1.0" hooks: - id: i18ndude From 31340360dc6fb6ae3e9c3e42577b383168b17491 Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Mon, 6 Nov 2023 17:32:28 +0100 Subject: [PATCH 22/55] Fixed spelling errors. --- CHANGES.rst | 2 +- docs/README.rst | 2 +- plone/app/contenttypes/browser/configure.zcml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index d711d938..5156f68e 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -789,7 +789,7 @@ New features: Bug fixes: -- Add translation namesspace and i18n:translate to the dexterity schema +- Add translation namespace and i18n:translate to the dexterity schema definitions for the content types that have extra field defined on top of the behavior composition. Otherwise no translations can be picked up. [fredvd] diff --git a/docs/README.rst b/docs/README.rst index c734665e..b3af8b62 100644 --- a/docs/README.rst +++ b/docs/README.rst @@ -122,7 +122,7 @@ You have several options: -You could alternatively override the peroperty ``model_file`` of the type-definition with a empty string and use the property ``schema`` to provide your custom python-schema. +You could alternatively override the property ``model_file`` of the type-definition with a empty string and use the property ``schema`` to provide your custom python-schema. For more complex features you should always consider create custom behaviors and/or write your own content-types since that will most likely give you more flexibility and less problem when you want to upgrade to a newer version in the future. diff --git a/plone/app/contenttypes/browser/configure.zcml b/plone/app/contenttypes/browser/configure.zcml index ae346417..b3e2c7ba 100644 --- a/plone/app/contenttypes/browser/configure.zcml +++ b/plone/app/contenttypes/browser/configure.zcml @@ -97,7 +97,7 @@ Date: Mon, 4 Dec 2023 18:32:59 +0000 Subject: [PATCH 23/55] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 23.10.1 → 23.11.0](https://github.com/psf/black/compare/23.10.1...23.11.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 80600f5a..edaec49f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,7 @@ repos: hooks: - id: isort - repo: https://github.com/psf/black - rev: 23.10.1 + rev: 23.11.0 hooks: - id: black - repo: https://github.com/collective/zpretty From 9d1b689952988b1fd8ee88986adae05e3ba03c02 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 1 Jan 2024 18:28:59 +0000 Subject: [PATCH 24/55] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pycqa/isort: 5.12.0 → 5.13.2](https://github.com/pycqa/isort/compare/5.12.0...5.13.2) - [github.com/psf/black: 23.11.0 → 23.12.1](https://github.com/psf/black/compare/23.11.0...23.12.1) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index edaec49f..c35f27e3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,11 +12,11 @@ repos: - id: pyupgrade args: [--py38-plus] - repo: https://github.com/pycqa/isort - rev: 5.12.0 + rev: 5.13.2 hooks: - id: isort - repo: https://github.com/psf/black - rev: 23.11.0 + rev: 23.12.1 hooks: - id: black - repo: https://github.com/collective/zpretty From 5e0d48b25e413b86971518bc396d49b4a0b63771 Mon Sep 17 00:00:00 2001 From: Gil Forcada Codinachs Date: Sat, 20 Jan 2024 15:52:24 +0100 Subject: [PATCH 25/55] Configuring with plone/meta --- .editorconfig | 7 ++-- .flake8 | 2 +- .github/workflows/meta.yml | 56 ++++++++++++++++++++++++---- .gitignore | 7 +++- .meta.toml | 4 +- .pre-commit-config.yaml | 20 +++++++++- news/6e36bcc4.internal | 2 + pyproject.toml | 32 ++++++++++++++-- tox.ini | 76 ++++++++++++++++++++++++++++++++++---- 9 files changed, 180 insertions(+), 26 deletions(-) create mode 100644 news/6e36bcc4.internal diff --git a/.editorconfig b/.editorconfig index 919b4116..fa698fb1 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,5 +1,5 @@ # Generated from: -# https://github.com/plone/meta/tree/master/config/default +# https://github.com/plone/meta/tree/main/config/default # See the inline comments on how to expand/tweak this configuration file # # EditorConfig Configuration file, for more details see: @@ -29,13 +29,14 @@ max_line_length = off # 4 space indentation indent_size = 4 -[*.{yml,zpt,pt,dtml,zcml}] +[*.{yml,zpt,pt,dtml,zcml,html,xml}] # 2 space indentation indent_size = 2 -[*.{json,jsonl,js,jsx,ts,tsx,css,less,scss,html}] # Frontend development +[*.{json,jsonl,js,jsx,ts,tsx,css,less,scss}] # Frontend development # 2 space indentation indent_size = 2 +max_line_length = 80 [{Makefile,.gitmodules}] # Tab indentation (no size specified, but view as 4 spaces) diff --git a/.flake8 b/.flake8 index 7ef4f64d..38918f42 100644 --- a/.flake8 +++ b/.flake8 @@ -1,5 +1,5 @@ # Generated from: -# https://github.com/plone/meta/tree/master/config/default +# https://github.com/plone/meta/tree/main/config/default # See the inline comments on how to expand/tweak this configuration file [flake8] doctests = 1 diff --git a/.github/workflows/meta.yml b/.github/workflows/meta.yml index 4748f0f4..b8edec02 100644 --- a/.github/workflows/meta.yml +++ b/.github/workflows/meta.yml @@ -1,5 +1,5 @@ # Generated from: -# https://github.com/plone/meta/tree/master/config/default +# https://github.com/plone/meta/tree/main/config/default # See the inline comments on how to expand/tweak this configuration file name: Meta on: @@ -13,16 +13,56 @@ on: - main workflow_dispatch: +## +# To set environment variables for all jobs, add in .meta.toml: +# [github] +# env = """ +# debug: 1 +# image-name: 'org/image' +# image-tag: 'latest' +# """ +## + jobs: qa: - uses: plone/meta/.github/workflows/qa.yml@master + uses: plone/meta/.github/workflows/qa.yml@main test: - uses: plone/meta/.github/workflows/test.yml@master + uses: plone/meta/.github/workflows/test.yml@main coverage: - uses: plone/meta/.github/workflows/coverage.yml@master + uses: plone/meta/.github/workflows/coverage.yml@main dependencies: - uses: plone/meta/.github/workflows/dependencies.yml@master - release-ready: - uses: plone/meta/.github/workflows/release_ready.yml@master + uses: plone/meta/.github/workflows/dependencies.yml@main + release_ready: + uses: plone/meta/.github/workflows/release_ready.yml@main circular: - uses: plone/meta/.github/workflows/circular.yml@master + uses: plone/meta/.github/workflows/circular.yml@main + +## +# To modify the list of default jobs being created add in .meta.toml: +# [github] +# jobs = [ +# "qa", +# "test", +# "coverage", +# "dependencies", +# "release_ready", +# "circular", +# ] +## + +## +# To request that some OS level dependencies get installed +# when running tests/coverage jobs, add in .meta.toml: +# [github] +# os_dependencies = "git libxml2 libxslt" +## + + +## +# Specify additional jobs in .meta.toml: +# [github] +# extra_lines = """ +# another: +# uses: org/repo/.github/workflows/file.yml@main +# """ +## diff --git a/.gitignore b/.gitignore index 81594fde..486392f6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,18 @@ # Generated from: -# https://github.com/plone/meta/tree/master/config/default +# https://github.com/plone/meta/tree/main/config/default # See the inline comments on how to expand/tweak this configuration file # python related *.egg-info *.pyc *.pyo +# translation related +*.mo + # tools related build/ .coverage +.*project coverage.xml dist/ docs/_build @@ -31,6 +35,7 @@ lib64 parts/ pyvenv.cfg var/ +local.cfg # mxdev /instance/ diff --git a/.meta.toml b/.meta.toml index d3ded7c0..61f3065e 100644 --- a/.meta.toml +++ b/.meta.toml @@ -1,9 +1,9 @@ # Generated from: -# https://github.com/plone/meta/tree/master/config/default +# https://github.com/plone/meta/tree/main/config/default # See the inline comments on how to expand/tweak this configuration file [meta] template = "default" -commit-id = "7723aeaf" +commit-id = "6e36bcc4" [pyproject] codespell_ignores = "oder,ist,crate" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c35f27e3..caf34e5b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,5 @@ # Generated from: -# https://github.com/plone/meta/tree/master/config/default +# https://github.com/plone/meta/tree/main/config/default # See the inline comments on how to expand/tweak this configuration file ci: autofix_prs: false @@ -35,6 +35,14 @@ repos: rev: 6.1.0 hooks: - id: flake8 + +## +# Add extra configuration options in .meta.toml: +# [pre_commit] +# flake8_extra_lines = """ +# _your own configuration lines_ +# """ +## - repo: https://github.com/codespell-project/codespell rev: v2.2.6 hooks: @@ -67,6 +75,16 @@ repos: hooks: - id: i18ndude + +## +# Add extra configuration options in .meta.toml: +# [pre_commit] +# i18ndude_extra_lines = """ +# _your own configuration lines_ +# """ +## + + ## # Add extra configuration options in .meta.toml: # [pre_commit] diff --git a/news/6e36bcc4.internal b/news/6e36bcc4.internal new file mode 100644 index 00000000..c08f5399 --- /dev/null +++ b/news/6e36bcc4.internal @@ -0,0 +1,2 @@ +Update configuration files. +[plone devs] diff --git a/pyproject.toml b/pyproject.toml index e4468843..b129b8f3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,9 @@ # Generated from: -# https://github.com/plone/meta/tree/master/config/default +# https://github.com/plone/meta/tree/main/config/default # See the inline comments on how to expand/tweak this configuration file +[build-system] +requires = ["setuptools>=68.2"] + [tool.towncrier] directory = "news/" filename = "CHANGES.rst" @@ -37,12 +40,36 @@ directory = "tests" name = "Tests" showcontent = true +## +# Add extra configuration options in .meta.toml: +# [pyproject] +# towncrier_extra_lines = """ +# extra_configuration +# """ +## + [tool.isort] profile = "plone" +## +# Add extra configuration options in .meta.toml: +# [pyproject] +# isort_extra_lines = """ +# extra_configuration +# """ +## + [tool.black] target-version = ["py38"] +## +# Add extra configuration options in .meta.toml: +# [pyproject] +# black_extra_lines = """ +# extra_configuration +# """ +## + [tool.codespell] ignore-words-list = "discreet,oder,ist,crate" skip = "*.po," @@ -92,7 +119,7 @@ Zope = [ 'Products.CMFCore', 'Products.CMFDynamicViewFTI', ] python-dateutil = ['dateutil'] -ignore-packages = ['ZServer', 'plone.app.event', 'Products.CMFPlone',] +ignore-packages = ['ZServer', 'plone.app.event', 'Products.CFMPlone',] ## # Add extra configuration options in .meta.toml: @@ -102,7 +129,6 @@ ignore-packages = ['ZServer', 'plone.app.event', 'Products.CMFPlone',] # "gitpython = ['git']", # "pygithub = ['github']", # ] -# """ ## [tool.check-manifest] diff --git a/tox.ini b/tox.ini index 030fd749..5cc50c67 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ # Generated from: -# https://github.com/plone/meta/tree/master/config/default +# https://github.com/plone/meta/tree/main/config/default # See the inline comments on how to expand/tweak this configuration file [tox] # We need 4.4.0 for constrain_package_deps. @@ -32,6 +32,21 @@ commands = echo "Unrecognized environment name {envname}" false +## +# Add extra configuration options in .meta.toml: +# [tox] +# testenv_options = """ +# basepython = /usr/bin/python3.8 +# """ +## + +[testenv:init] +description = Prepare environment +skip_install = true +commands = + echo "Initial setup complete" + + [testenv:format] description = automatically reformat code skip_install = true @@ -56,9 +71,9 @@ description = check if the package defines all its dependencies skip_install = true deps = build - z3c.dependencychecker==2.11 + z3c.dependencychecker==2.14.3 commands = - python -m build --sdist --no-isolation + python -m build --sdist dependencychecker [testenv:dependencies-graph] @@ -77,11 +92,35 @@ description = run the distribution tests use_develop = true skip_install = false constrain_package_deps = true -set_env = ROBOT_BROWSER=headlesschrome +set_env = + ROBOT_BROWSER=headlesschrome + +## +# Specify extra test environment variables in .meta.toml: +# [tox] +# test_environment_variables = """ +# PIP_EXTRA_INDEX_URL=https://my-pypi.my-server.com/ +# """ +# +# Set constrain_package_deps .meta.toml: +# [tox] +# constrain_package_deps = "false" +## deps = zope.testrunner -c https://dist.plone.org/release/6.0-dev/constraints.txt + +## +# Specify additional deps in .meta.toml: +# [tox] +# test_deps_additional = "-esources/plonegovbr.portal_base[test]" +# +# Specify a custom constraints file in .meta.toml: +# [tox] +# constraints_file = "https://my-server.com/constraints.txt" +## commands = + rfbrowser init zope-testrunner --all --test-path={toxinidir} -s plone.app.contenttypes {posargs} extras = test @@ -100,14 +139,26 @@ description = get a test coverage report use_develop = true skip_install = false constrain_package_deps = true -set_env = ROBOT_BROWSER=headlesschrome +set_env = + ROBOT_BROWSER=headlesschrome + +## +# Specify extra test environment variables in .meta.toml: +# [tox] +# test_environment_variables = """ +# PIP_EXTRA_INDEX_URL=https://my-pypi.my-server.com/ +# """ +## deps = coverage zope.testrunner -c https://dist.plone.org/release/6.0-dev/constraints.txt + commands = + rfbrowser init coverage run --branch --source plone.app.contenttypes {envbindir}/zope-testrunner --quiet --all --test-path={toxinidir} -s plone.app.contenttypes {posargs} coverage report -m --format markdown + coverage xml extras = test @@ -120,24 +171,35 @@ deps = build towncrier -c https://dist.plone.org/release/6.0-dev/constraints.txt + commands = # fake version to not have to install the package # we build the change log as news entries might break # the README that is displayed on PyPI towncrier build --version=100.0.0 --yes - python -m build --sdist --no-isolation + python -m build --sdist twine check dist/* [testenv:circular] description = ensure there are no cyclic dependencies use_develop = true skip_install = false +set_env = + +## +# Specify extra test environment variables in .meta.toml: +# [tox] +# test_environment_variables = """ +# PIP_EXTRA_INDEX_URL=https://my-pypi.my-server.com/ +# """ +## allowlist_externals = sh deps = pipdeptree pipforester -c https://dist.plone.org/release/6.0-dev/constraints.txt + commands = # Generate the full dependency tree sh -c 'pipdeptree -j > forest.json' @@ -151,6 +213,6 @@ commands = # Add extra configuration options in .meta.toml: # [tox] # extra_lines = """ -# my_other_environment +# _your own configuration lines_ # """ ## From 0e51aa585668c69ec86d0521588c66ce124ca32f Mon Sep 17 00:00:00 2001 From: Gil Forcada Codinachs Date: Sat, 20 Jan 2024 16:01:29 +0100 Subject: [PATCH 26/55] chore: adjust dependencies --- setup.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 67a3f08b..47f7776d 100644 --- a/setup.py +++ b/setup.py @@ -59,7 +59,6 @@ def read(*rnames): "plone.app.lockingbehavior", "plone.behavior >= 1.3.0", "plone.app.z3cform>=1.1.0", - "zope.deprecation", "plone.base", "Products.BTreeFolder2", "Products.GenericSetup", @@ -81,7 +80,7 @@ def read(*rnames): "plone.supermodel", "plone.z3cform", "z3c.form", - "zope.contentprovider", + "Zope", ], extras_require={ "test": [ @@ -91,7 +90,6 @@ def read(*rnames): "plone.testing", "plone.browserlayer", "plone.uuid", - "zope.viewlet", "robotsuite", ], }, From 5bea2c7b0ffec86be824736c0f776795f597d913 Mon Sep 17 00:00:00 2001 From: Gil Forcada Codinachs Date: Sun, 21 Jan 2024 09:56:50 +0100 Subject: [PATCH 27/55] chore: typo --- .meta.toml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.meta.toml b/.meta.toml index 61f3065e..9a7ab5ce 100644 --- a/.meta.toml +++ b/.meta.toml @@ -7,4 +7,4 @@ commit-id = "6e36bcc4" [pyproject] codespell_ignores = "oder,ist,crate" -dependencies_ignores = "['ZServer', 'plone.app.event', 'Products.CFMPlone',]" +dependencies_ignores = "['ZServer', 'plone.app.event', 'Products.CMFPlone',]" diff --git a/pyproject.toml b/pyproject.toml index b129b8f3..7f6cc189 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -119,7 +119,7 @@ Zope = [ 'Products.CMFCore', 'Products.CMFDynamicViewFTI', ] python-dateutil = ['dateutil'] -ignore-packages = ['ZServer', 'plone.app.event', 'Products.CFMPlone',] +ignore-packages = ['ZServer', 'plone.app.event', 'Products.CMFPlone',] ## # Add extra configuration options in .meta.toml: From 146ee89ad5ae31660db769f40343de44e443c1fd Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 18:32:29 +0000 Subject: [PATCH 28/55] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 23.12.1 → 24.1.1](https://github.com/psf/black/compare/23.12.1...24.1.1) - [github.com/PyCQA/flake8: 6.1.0 → 7.0.0](https://github.com/PyCQA/flake8/compare/6.1.0...7.0.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index caf34e5b..f857b483 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,7 @@ repos: hooks: - id: isort - repo: https://github.com/psf/black - rev: 23.12.1 + rev: 24.1.1 hooks: - id: black - repo: https://github.com/collective/zpretty @@ -32,7 +32,7 @@ repos: # """ ## - repo: https://github.com/PyCQA/flake8 - rev: 6.1.0 + rev: 7.0.0 hooks: - id: flake8 From 366fdfde0ce01d44c20ff7322ee4289d61ca7d9e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 18:34:21 +0000 Subject: [PATCH 29/55] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- plone/app/contenttypes/tests/test_event.py | 36 +++++++++---------- plone/app/contenttypes/tests/test_link.py | 18 +++++----- .../app/contenttypes/tests/test_news_item.py | 30 ++++++++-------- 3 files changed, 42 insertions(+), 42 deletions(-) diff --git a/plone/app/contenttypes/tests/test_event.py b/plone/app/contenttypes/tests/test_event.py index 2ce96911..528059a9 100644 --- a/plone/app/contenttypes/tests/test_event.py +++ b/plone/app/contenttypes/tests/test_event.py @@ -91,24 +91,24 @@ def setUp(self): def test_add_event(self): self.browser.open(self.portal_url) self.browser.getLink("Event").click() - self.browser.getControl( - name="form.widgets.IDublinCore.title" - ).value = "My event" - self.browser.getControl( - name="form.widgets.IDublinCore.description" - ).value = "This is my event." - self.browser.getControl( - name="form.widgets.IRichTextBehavior.text" - ).value = "Lorem Ipsum" - self.browser.getControl( - name="form.widgets.IEventBasic.start" - ).value = "2013-01-01" - self.browser.getControl( - name="form.widgets.IEventBasic.end" - ).value = "2013-01-12" - self.browser.getControl( - name="form.widgets.IShortName.id" - ).value = "my-special-event" + self.browser.getControl(name="form.widgets.IDublinCore.title").value = ( + "My event" + ) + self.browser.getControl(name="form.widgets.IDublinCore.description").value = ( + "This is my event." + ) + self.browser.getControl(name="form.widgets.IRichTextBehavior.text").value = ( + "Lorem Ipsum" + ) + self.browser.getControl(name="form.widgets.IEventBasic.start").value = ( + "2013-01-01" + ) + self.browser.getControl(name="form.widgets.IEventBasic.end").value = ( + "2013-01-12" + ) + self.browser.getControl(name="form.widgets.IShortName.id").value = ( + "my-special-event" + ) self.browser.getControl("Save").click() self.assertTrue(self.browser.url.endswith("my-special-event/view")) diff --git a/plone/app/contenttypes/tests/test_link.py b/plone/app/contenttypes/tests/test_link.py index 702e4d99..dabdd9a8 100644 --- a/plone/app/contenttypes/tests/test_link.py +++ b/plone/app/contenttypes/tests/test_link.py @@ -379,15 +379,15 @@ def test_add_link(self): self.browser.open(self.portal_url) self.browser.getLink("Link").click() self.browser.getControl(name="form.widgets.IDublinCore.title").value = "My link" - self.browser.getControl( - name="form.widgets.IDublinCore.description" - ).value = "This is my link." - self.browser.getControl( - name="form.widgets.IShortName.id" - ).value = "my-special-link" - self.browser.getControl( - name="form.widgets.remoteUrl.external" - ).value = "https://plone.org" + self.browser.getControl(name="form.widgets.IDublinCore.description").value = ( + "This is my link." + ) + self.browser.getControl(name="form.widgets.IShortName.id").value = ( + "my-special-link" + ) + self.browser.getControl(name="form.widgets.remoteUrl.external").value = ( + "https://plone.org" + ) self.browser.getControl("Save").click() self.assertTrue(self.browser.url.endswith("my-special-link/view")) diff --git a/plone/app/contenttypes/tests/test_news_item.py b/plone/app/contenttypes/tests/test_news_item.py index 9bab672b..09ff40de 100644 --- a/plone/app/contenttypes/tests/test_news_item.py +++ b/plone/app/contenttypes/tests/test_news_item.py @@ -112,16 +112,16 @@ def setUp(self): def test_add_news_item(self): self.browser.open(self.portal_url) self.browser.getLink("News Item").click() - self.browser.getControl( - name="form.widgets.IDublinCore.title" - ).value = "My news item" - self.browser.getControl( - name="form.widgets.IDublinCore.description" - ).value = "This is my news item." + self.browser.getControl(name="form.widgets.IDublinCore.title").value = ( + "My news item" + ) + self.browser.getControl(name="form.widgets.IDublinCore.description").value = ( + "This is my news item." + ) self.browser.getControl(name="form.widgets.IShortName.id").value = "" - self.browser.getControl( - name="form.widgets.IRichTextBehavior.text" - ).value = "Lorem Ipsum" + self.browser.getControl(name="form.widgets.IRichTextBehavior.text").value = ( + "Lorem Ipsum" + ) self.browser.getControl("Save").click() self.assertTrue(self.browser.url.endswith("my-news-item/view")) @@ -132,12 +132,12 @@ def test_add_news_item(self): def test_add_news_item_with_shortname(self): self.browser.open(self.portal_url) self.browser.getLink("News Item").click() - self.browser.getControl( - name="form.widgets.IDublinCore.title" - ).value = "My news item" - self.browser.getControl( - name="form.widgets.IShortName.id" - ).value = "my-special-news" + self.browser.getControl(name="form.widgets.IDublinCore.title").value = ( + "My news item" + ) + self.browser.getControl(name="form.widgets.IShortName.id").value = ( + "my-special-news" + ) self.browser.getControl("Save").click() self.assertTrue(self.browser.url.endswith("my-special-news/view")) From 23aa11bb443b3d7a0e201aa418f28c829214c55d Mon Sep 17 00:00:00 2001 From: Peter Mathis Date: Wed, 15 Nov 2023 11:48:35 +0100 Subject: [PATCH 30/55] Fix folder listing template when `plone.eventlocation` behavior is disabled for Events --- news/679.bugfix | 2 ++ .../contenttypes/browser/templates/listing.pt | 2 +- plone/app/contenttypes/tests/test_folder.py | 25 +++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 news/679.bugfix diff --git a/news/679.bugfix b/news/679.bugfix new file mode 100644 index 00000000..56ae4847 --- /dev/null +++ b/news/679.bugfix @@ -0,0 +1,2 @@ +Fix folder listing template when `plone.eventlocation` behavior is disabled for Events. +[petschki] diff --git a/plone/app/contenttypes/browser/templates/listing.pt b/plone/app/contenttypes/browser/templates/listing.pt index 9e2d7553..25076d62 100644 --- a/plone/app/contenttypes/browser/templates/listing.pt +++ b/plone/app/contenttypes/browser/templates/listing.pt @@ -93,7 +93,7 @@ - — diff --git a/plone/app/contenttypes/tests/test_folder.py b/plone/app/contenttypes/tests/test_folder.py index 440eb6c2..47c048f5 100644 --- a/plone/app/contenttypes/tests/test_folder.py +++ b/plone/app/contenttypes/tests/test_folder.py @@ -1,3 +1,5 @@ +from datetime import datetime +from datetime import timedelta from plone.app.contenttypes.browser.folder import FolderView from plone.app.contenttypes.interfaces import IFolder from plone.app.contenttypes.testing import ( # noqa @@ -232,3 +234,26 @@ def test_list_item_wout_title(self): # And also in tabular view self.browser.open(self.folder_url + "/tabular_view") self.assertIn("doc_wout_title", self.browser.contents) + + def test_event_wout_location(self): + # deactivate "plone.eventlocation" from Event behaviors + event_fti = self.portal.portal_types.get("Event") + if not event_fti: + return + event_behaviors = list(event_fti.behaviors) + event_behaviors.remove("plone.eventlocation") + event_fti.behaviors = tuple(event_behaviors) + + self.folder.invokeFactory( + "Event", + id="event_wout_location", + title="Event without location", + start=datetime.now() + timedelta(days=1), + ) + + import transaction + + transaction.commit() + + self.browser.open(self.folder_url + "/listing_view") + self.assertIn("Event without location", self.browser.contents) From 0e5dbeae03ccc6e58b2b74ffce7b52ae19f72191 Mon Sep 17 00:00:00 2001 From: "Jens W. Klein" Date: Mon, 19 Feb 2024 10:58:38 +0100 Subject: [PATCH 31/55] Update plone/app/contenttypes/browser/templates/listing.pt --- plone/app/contenttypes/browser/templates/listing.pt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plone/app/contenttypes/browser/templates/listing.pt b/plone/app/contenttypes/browser/templates/listing.pt index 25076d62..9ad3df22 100644 --- a/plone/app/contenttypes/browser/templates/listing.pt +++ b/plone/app/contenttypes/browser/templates/listing.pt @@ -93,7 +93,7 @@ - — From 0303e5eaa7a6d18220b21e9757c8ed5ae181a7b7 Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Fri, 15 Mar 2024 11:30:26 +0100 Subject: [PATCH 32/55] Preparing release 3.0.6 [ci skip] --- CHANGES.rst | 17 +++++++++++++++++ news/679.bugfix | 2 -- news/6e36bcc4.internal | 2 -- setup.py | 2 +- 4 files changed, 18 insertions(+), 5 deletions(-) delete mode 100644 news/679.bugfix delete mode 100644 news/6e36bcc4.internal diff --git a/CHANGES.rst b/CHANGES.rst index 5156f68e..bf7fc568 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -8,6 +8,23 @@ Changelog .. towncrier release notes start +3.0.6 (2024-03-15) +------------------ + +Bug fixes: + + +- Fix folder listing template when `plone.eventlocation` behavior is disabled for Events. + [petschki] (#679) + + +Internal: + + +- Update configuration files. + [plone devs] (6e36bcc4) + + 3.0.5 (2023-10-25) ------------------ diff --git a/news/679.bugfix b/news/679.bugfix deleted file mode 100644 index 56ae4847..00000000 --- a/news/679.bugfix +++ /dev/null @@ -1,2 +0,0 @@ -Fix folder listing template when `plone.eventlocation` behavior is disabled for Events. -[petschki] diff --git a/news/6e36bcc4.internal b/news/6e36bcc4.internal deleted file mode 100644 index c08f5399..00000000 --- a/news/6e36bcc4.internal +++ /dev/null @@ -1,2 +0,0 @@ -Update configuration files. -[plone devs] diff --git a/setup.py b/setup.py index 47f7776d..681e1a82 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ import os -version = "3.0.6.dev0" +version = "3.0.6" def read(*rnames): From 6dfa09af099c40fa31b3422a2fbdb48aa454a22a Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Fri, 15 Mar 2024 11:30:46 +0100 Subject: [PATCH 33/55] Back to development: 3.0.7 [ci skip] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 681e1a82..431652db 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ import os -version = "3.0.6" +version = "3.0.7.dev0" def read(*rnames): From 59a351d1146dbcb8312c95dee640c27ccd88ac8d Mon Sep 17 00:00:00 2001 From: Johannes Raggam Date: Fri, 24 Nov 2023 18:59:06 +0100 Subject: [PATCH 34/55] Fix ILeadImageBehavior and IRichTextBehavior interfaces were the name change was forgotten. --- CHANGES.rst | 4 ++-- docs/README.rst | 4 ++-- news/681.bugfix | 2 ++ plone/app/contenttypes/behaviors/viewlets.py | 6 +++--- plone/app/contenttypes/indexers.py | 4 ++-- 5 files changed, 11 insertions(+), 9 deletions(-) create mode 100644 news/681.bugfix diff --git a/CHANGES.rst b/CHANGES.rst index bf7fc568..b637b736 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -473,7 +473,7 @@ Bug fixes: New features: -- Support ILeadImage behavior when display collection album view. +- Support ILeadImageBehavior when display collection album view. [rodfersou] (#524) - Add more log-messages during migration from AT to DX. [pbauer] (#526) @@ -552,7 +552,7 @@ Bug fixes: Breaking changes: -- ILeadImage and IRichText behaviors now have proper "Marker"-Interfaces. +- ILeadImageBehavior and IRichTextBehavior behaviors now have proper "Marker"-Interfaces. As this was only possible by renaming the schema adapter to *Behavior* to not break with implementations inside the collective, the FTI-behavior-definition has changed: diff --git a/docs/README.rst b/docs/README.rst index b3af8b62..84ad8b02 100644 --- a/docs/README.rst +++ b/docs/README.rst @@ -79,7 +79,7 @@ You have several options: - + @@ -91,7 +91,7 @@ You have several options: your.package.content:folder.xml - + diff --git a/news/681.bugfix b/news/681.bugfix new file mode 100644 index 00000000..31d52626 --- /dev/null +++ b/news/681.bugfix @@ -0,0 +1,2 @@ +Fix ILeadImageBehavior and IRichTextBehavior interfaces were the name change was forgotten. +[thet] diff --git a/plone/app/contenttypes/behaviors/viewlets.py b/plone/app/contenttypes/behaviors/viewlets.py index eb38dbb2..8fe6a8de 100644 --- a/plone/app/contenttypes/behaviors/viewlets.py +++ b/plone/app/contenttypes/behaviors/viewlets.py @@ -1,4 +1,4 @@ -from plone.app.contenttypes.behaviors.leadimage import ILeadImage +from plone.app.contenttypes.behaviors.leadimage import ILeadImageBehavior from plone.app.layout.viewlets import ViewletBase @@ -6,5 +6,5 @@ class LeadImageViewlet(ViewletBase): """A simple viewlet which renders leadimage""" def update(self): - self.context = ILeadImage(self.context) - self.available = True if self.context.image else False + behavior = ILeadImageBehavior(self.context) + self.available = True if behavior.image else False diff --git a/plone/app/contenttypes/indexers.py b/plone/app/contenttypes/indexers.py index a4e49517..973dfe83 100644 --- a/plone/app/contenttypes/indexers.py +++ b/plone/app/contenttypes/indexers.py @@ -1,6 +1,6 @@ from Acquisition import aq_base from logging import getLogger -from plone.app.contenttypes.behaviors.richtext import IRichText +from plone.app.contenttypes.behaviors.richtext import IRichTextBehavior from plone.app.contenttypes.interfaces import ICollection from plone.app.contenttypes.interfaces import IDocument from plone.app.contenttypes.interfaces import IFile @@ -40,7 +40,7 @@ def _unicode_save_string_concat(*args): def SearchableText(obj): text = "" - richtext = IRichText(obj, None) + richtext = IRichTextBehavior(obj, None) if richtext: textvalue = richtext.text if IRichTextValue.providedBy(textvalue): From a92a8e59e4a4a117114431a3666133c5d88ffd31 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 1 Apr 2024 19:51:23 +0000 Subject: [PATCH 35/55] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v3.15.0 → v3.15.2](https://github.com/asottile/pyupgrade/compare/v3.15.0...v3.15.2) - [github.com/psf/black: 24.1.1 → 24.3.0](https://github.com/psf/black/compare/24.1.1...24.3.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f857b483..0a5e9d06 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,7 +7,7 @@ ci: repos: - repo: https://github.com/asottile/pyupgrade - rev: v3.15.0 + rev: v3.15.2 hooks: - id: pyupgrade args: [--py38-plus] @@ -16,7 +16,7 @@ repos: hooks: - id: isort - repo: https://github.com/psf/black - rev: 24.1.1 + rev: 24.3.0 hooks: - id: black - repo: https://github.com/collective/zpretty From 4257395d0211a5f0aeecfff2520e0d1a9d3a1250 Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Thu, 25 Apr 2024 21:33:48 +0200 Subject: [PATCH 36/55] Preparing release 3.0.7 [ci skip] --- CHANGES.rst | 10 ++++++++++ news/681.bugfix | 2 -- setup.py | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) delete mode 100644 news/681.bugfix diff --git a/CHANGES.rst b/CHANGES.rst index b637b736..45ccc56a 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -8,6 +8,16 @@ Changelog .. towncrier release notes start +3.0.7 (2024-04-25) +------------------ + +Bug fixes: + + +- Fix ILeadImageBehavior and IRichTextBehavior interfaces were the name change was forgotten. + [thet] (#681) + + 3.0.6 (2024-03-15) ------------------ diff --git a/news/681.bugfix b/news/681.bugfix deleted file mode 100644 index 31d52626..00000000 --- a/news/681.bugfix +++ /dev/null @@ -1,2 +0,0 @@ -Fix ILeadImageBehavior and IRichTextBehavior interfaces were the name change was forgotten. -[thet] diff --git a/setup.py b/setup.py index 431652db..ca88943a 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ import os -version = "3.0.7.dev0" +version = "3.0.7" def read(*rnames): From 7bb60704766ce3c4f28ede6d1c9bd4134a265e15 Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Thu, 25 Apr 2024 21:34:22 +0200 Subject: [PATCH 37/55] Back to development: 3.0.8 [ci skip] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ca88943a..a8674d57 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ import os -version = "3.0.7" +version = "3.0.8.dev0" def read(*rnames): From 1e560166bcc087db6e83974eddcdf067b5698d3b Mon Sep 17 00:00:00 2001 From: "Jens W. Klein" Date: Thu, 2 May 2024 17:55:56 +0200 Subject: [PATCH 38/55] Removed p.a.widgets moved DeprecationWarning --- news/690.bugfix | 1 + plone/app/contenttypes/behaviors/collection.py | 2 +- plone/app/contenttypes/behaviors/richtext.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 news/690.bugfix diff --git a/news/690.bugfix b/news/690.bugfix new file mode 100644 index 00000000..18633629 --- /dev/null +++ b/news/690.bugfix @@ -0,0 +1 @@ +Fixed p.a.widgets `moved` DeprecationWarning [jensens] \ No newline at end of file diff --git a/plone/app/contenttypes/behaviors/collection.py b/plone/app/contenttypes/behaviors/collection.py index 2e97c06a..ee64cdb9 100644 --- a/plone/app/contenttypes/behaviors/collection.py +++ b/plone/app/contenttypes/behaviors/collection.py @@ -1,5 +1,5 @@ from plone.app.contenttypes import _ -from plone.app.z3cform.widget import QueryStringFieldWidget +from plone.app.z3cform.widgets.querystring import QueryStringFieldWidget from plone.autoform import directives as form from plone.autoform.interfaces import IFormFieldProvider from plone.base.interfaces.syndication import IFeed diff --git a/plone/app/contenttypes/behaviors/richtext.py b/plone/app/contenttypes/behaviors/richtext.py index adc38d5f..840311c6 100644 --- a/plone/app/contenttypes/behaviors/richtext.py +++ b/plone/app/contenttypes/behaviors/richtext.py @@ -2,7 +2,7 @@ from plone.app.contenttypes import _ from plone.app.dexterity.textindexer import searchable from plone.app.textfield import RichText as RichTextField -from plone.app.z3cform.widget import RichTextFieldWidget +from plone.app.z3cform.widgets.richtext import RichTextFieldWidget from plone.autoform import directives as form from plone.autoform.interfaces import IFormFieldProvider from plone.autoform.view import WidgetsView From c00ff3d36c29688b96dcd038fc424e457a159609 Mon Sep 17 00:00:00 2001 From: ale-rt Date: Tue, 30 Apr 2024 17:01:47 +0200 Subject: [PATCH 39/55] Support using the file template on objects that have no file attributes. Closes #688 --- news/688.bugfix | 1 + .../contenttypes/browser/templates/file.pt | 131 ++++++++++-------- 2 files changed, 73 insertions(+), 59 deletions(-) create mode 100644 news/688.bugfix diff --git a/news/688.bugfix b/news/688.bugfix new file mode 100644 index 00000000..5279988e --- /dev/null +++ b/news/688.bugfix @@ -0,0 +1 @@ +Support using the file template on objects that have no file attributes. [ale-rt] diff --git a/plone/app/contenttypes/browser/templates/file.pt b/plone/app/contenttypes/browser/templates/file.pt index 845af29c..6da3fc03 100644 --- a/plone/app/contenttypes/browser/templates/file.pt +++ b/plone/app/contenttypes/browser/templates/file.pt @@ -12,75 +12,88 @@ -
+ + +
-
- -
+
+ +
- + - + -
- Filename -
+
+ Filename +
- + -
+
-
- Download -
+
+ Download +
+ + + + +

+ There is no file uploaded. +

+
From f9808b8a807c0a1a8d57a200bb62d591def05db3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 6 May 2024 19:52:58 +0000 Subject: [PATCH 40/55] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 24.3.0 → 24.4.2](https://github.com/psf/black/compare/24.3.0...24.4.2) - [github.com/collective/i18ndude: 6.1.0 → 6.2.0](https://github.com/collective/i18ndude/compare/6.1.0...6.2.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0a5e9d06..d60054bd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,7 @@ repos: hooks: - id: isort - repo: https://github.com/psf/black - rev: 24.3.0 + rev: 24.4.2 hooks: - id: black - repo: https://github.com/collective/zpretty @@ -71,7 +71,7 @@ repos: - id: check-python-versions args: ['--only', 'setup.py,pyproject.toml'] - repo: https://github.com/collective/i18ndude - rev: "6.1.0" + rev: "6.2.0" hooks: - id: i18ndude From d3652c8238a14a10628bf17d47286965a966e08d Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Thu, 30 May 2024 20:24:23 +0200 Subject: [PATCH 41/55] Preparing release 3.0.8 [ci skip] --- CHANGES.rst | 10 ++++++++++ news/688.bugfix | 1 - news/690.bugfix | 1 - setup.py | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) delete mode 100644 news/688.bugfix delete mode 100644 news/690.bugfix diff --git a/CHANGES.rst b/CHANGES.rst index 45ccc56a..75369dfc 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -8,6 +8,16 @@ Changelog .. towncrier release notes start +3.0.8 (2024-05-30) +------------------ + +Bug fixes: + + +- Support using the file template on objects that have no file attributes. [ale-rt] (#688) +- Fixed p.a.widgets `moved` DeprecationWarning [jensens] (#690) + + 3.0.7 (2024-04-25) ------------------ diff --git a/news/688.bugfix b/news/688.bugfix deleted file mode 100644 index 5279988e..00000000 --- a/news/688.bugfix +++ /dev/null @@ -1 +0,0 @@ -Support using the file template on objects that have no file attributes. [ale-rt] diff --git a/news/690.bugfix b/news/690.bugfix deleted file mode 100644 index 18633629..00000000 --- a/news/690.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fixed p.a.widgets `moved` DeprecationWarning [jensens] \ No newline at end of file diff --git a/setup.py b/setup.py index a8674d57..626a29bd 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ import os -version = "3.0.8.dev0" +version = "3.0.8" def read(*rnames): From d0b6872bb8418bdd65fa995d7dc121f088bfbb24 Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Thu, 30 May 2024 20:24:45 +0200 Subject: [PATCH 42/55] Back to development: 3.0.9 [ci skip] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 626a29bd..510d4eca 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ import os -version = "3.0.8" +version = "3.0.9.dev0" def read(*rnames): From 1838f1c1e1c8cccce39fc0735831d542ef5d5d9e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 3 Jun 2024 19:59:31 +0000 Subject: [PATCH 43/55] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/codespell-project/codespell: v2.2.6 → v2.3.0](https://github.com/codespell-project/codespell/compare/v2.2.6...v2.3.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d60054bd..da56023f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -44,7 +44,7 @@ repos: # """ ## - repo: https://github.com/codespell-project/codespell - rev: v2.2.6 + rev: v2.3.0 hooks: - id: codespell additional_dependencies: From 152dd17258511abdfb022022a07d9e5c8bfe38ca Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Thu, 6 Jun 2024 22:07:08 +0200 Subject: [PATCH 44/55] Configuring with plone/meta --- .editorconfig | 6 ++++-- .github/workflows/meta.yml | 7 +++++++ .meta.toml | 2 +- dependabot.yml | 11 +++++++++++ pyproject.toml | 13 ++++++++++--- tox.ini | 12 ++++++++---- 6 files changed, 41 insertions(+), 10 deletions(-) create mode 100644 dependabot.yml diff --git a/.editorconfig b/.editorconfig index fa698fb1..5b3c112c 100644 --- a/.editorconfig +++ b/.editorconfig @@ -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 @@ -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 diff --git a/.github/workflows/meta.yml b/.github/workflows/meta.yml index b8edec02..c9848bcb 100644 --- a/.github/workflows/meta.yml +++ b/.github/workflows/meta.yml @@ -57,6 +57,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: diff --git a/.meta.toml b/.meta.toml index 9a7ab5ce..bcd1aff6 100644 --- a/.meta.toml +++ b/.meta.toml @@ -3,7 +3,7 @@ # See the inline comments on how to expand/tweak this configuration file [meta] template = "default" -commit-id = "6e36bcc4" +commit-id = "a89af8f2" [pyproject] codespell_ignores = "oder,ist,crate" diff --git a/dependabot.yml b/dependabot.yml new file mode 100644 index 00000000..bbd3ab05 --- /dev/null +++ b/dependabot.yml @@ -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" diff --git a/pyproject.toml b/pyproject.toml index 7f6cc189..35e47cbb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -71,7 +71,7 @@ target-version = ["py38"] ## [tool.codespell] -ignore-words-list = "discreet,oder,ist,crate" +ignore-words-list = "discreet,assertin,oder,ist,crate" skip = "*.po," ## # Add extra configuration options in .meta.toml: @@ -134,13 +134,15 @@ ignore-packages = ['ZServer', 'plone.app.event', 'Products.CMFPlone',] [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] @@ -148,6 +150,11 @@ ignore = [ # "*.map.js", # "*.pyc", # """ +# check_manifest_extra_lines = """ +# ignore-bad-ideas = [ +# "some/test/file/PKG-INFO", +# ] +# """ ## diff --git a/tox.ini b/tox.ini index 5cc50c67..e46028c0 100644 --- a/tox.ini +++ b/tox.ini @@ -109,7 +109,7 @@ set_env = deps = zope.testrunner -c https://dist.plone.org/release/6.0-dev/constraints.txt - + ## # Specify additional deps in .meta.toml: # [tox] @@ -153,12 +153,13 @@ deps = coverage zope.testrunner -c https://dist.plone.org/release/6.0-dev/constraints.txt - + commands = rfbrowser init coverage run --branch --source plone.app.contenttypes {envbindir}/zope-testrunner --quiet --all --test-path={toxinidir} -s plone.app.contenttypes {posargs} coverage report -m --format markdown coverage xml + coverage html extras = test @@ -171,7 +172,7 @@ deps = build towncrier -c https://dist.plone.org/release/6.0-dev/constraints.txt - + commands = # fake version to not have to install the package # we build the change log as news entries might break @@ -184,6 +185,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 = ## @@ -199,7 +203,7 @@ deps = pipdeptree pipforester -c https://dist.plone.org/release/6.0-dev/constraints.txt - + commands = # Generate the full dependency tree sh -c 'pipdeptree -j > forest.json' From d820fdc6134a9f203c4a2e4d7a8cf42e24d13dcd Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Thu, 6 Jun 2024 23:16:26 +0200 Subject: [PATCH 45/55] No longer set portal_properties.site_properties.visible_ids on site creation. The ``portal_properties`` tools is deprecated, ``visible_ids`` was not set as real property, and usage of ``visible_ids`` was largely removed in Plone 5.0 already. You already can no longer set ``visible ids`` in the Editing control panel, nor in the member preferences. The only remaining use for ``visible_ids``, if set to true, was to show the page ids on the 'select default page' form. --- news/125.bugfix | 5 +++++ .../browser/templates/full_view_item.pt | 1 - plone/app/contenttypes/setuphandlers.py | 21 ------------------- setup.py | 1 - 4 files changed, 5 insertions(+), 23 deletions(-) create mode 100644 news/125.bugfix diff --git a/news/125.bugfix b/news/125.bugfix new file mode 100644 index 00000000..22b6b61c --- /dev/null +++ b/news/125.bugfix @@ -0,0 +1,5 @@ +No longer set ``portal_properties.site_properties.visible_ids`` on site creation. +The ``portal_properties`` tools is deprecated, ``visible_ids`` was not set as real property, and usage of ``visible_ids`` was largely removed in Plone 5.0 already. +You already can no longer set ``visible ids`` in the Editing control panel, nor in the member preferences. +The only remaining use for ``visible_ids``, if set to true, was to show the page ids on the 'select default page' form. +[maurits] diff --git a/plone/app/contenttypes/browser/templates/full_view_item.pt b/plone/app/contenttypes/browser/templates/full_view_item.pt index 208207d2..e17e5790 100644 --- a/plone/app/contenttypes/browser/templates/full_view_item.pt +++ b/plone/app/contenttypes/browser/templates/full_view_item.pt @@ -57,7 +57,6 @@ dummy python: plone_layout.mark_view(view); portal_url portal_state/portal_url; checkPermission nocall: context/portal_membership/checkPermission; - site_properties context/portal_properties/site_properties; ">
diff --git a/plone/app/contenttypes/setuphandlers.py b/plone/app/contenttypes/setuphandlers.py index f1b88145..d312d862 100644 --- a/plone/app/contenttypes/setuphandlers.py +++ b/plone/app/contenttypes/setuphandlers.py @@ -9,7 +9,6 @@ from plone.base.utils import unrestricted_construct_instance from plone.dexterity.fti import IDexterityFTI from plone.dexterity.utils import createContent -from plone.i18n.normalizer.interfaces import IURLNormalizer from plone.portlets.interfaces import ILocalPortletAssignmentManager from plone.portlets.interfaces import IPortletManager from plone.registry.interfaces import IRegistry @@ -131,25 +130,6 @@ def _setup_calendar(portal, locale): portal_calendar.firstweekday = first -def _setup_visible_ids(portal, target_language, locale): - portal_properties = getToolByName(portal, "portal_properties") - site_properties = portal_properties.site_properties - - # See if we have a URL normalizer - normalizer = queryUtility(IURLNormalizer, name=target_language) - if normalizer is None: - normalizer = queryUtility(IURLNormalizer) - - # If we get a script other than Latn we enable visible_ids - if locale.id.script is not None: - if locale.id.script.lower() != "latn": - site_properties.visible_ids = True - - # If we have a normalizer it is safe to disable the visible ids - if normalizer is not None: - site_properties.visible_ids = False - - def _setup_constrains(container, allowed_types): behavior = ISelectableConstrainTypes(container) behavior.setConstrainTypesMode(constrains.ENABLED) @@ -361,7 +341,6 @@ def setup_various(context): portal = getSite() target_language, is_combined_language, locale = _get_locales_info(portal) _setup_calendar(portal, locale) - _setup_visible_ids(portal, target_language, locale) # install explicitly the plone.app.event if HAS_EVENT: diff --git a/setup.py b/setup.py index 510d4eca..e0953ea7 100644 --- a/setup.py +++ b/setup.py @@ -71,7 +71,6 @@ def read(*rnames): "plone.autoform", "plone.event", "plone.folder", - "plone.i18n", "plone.indexer", "plone.memoize", "plone.portlets", From f66191da40f2255f1b2075052d9507e97d96df66 Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Fri, 7 Jun 2024 18:05:08 +0200 Subject: [PATCH 46/55] Preparing release 3.0.9 [ci skip] --- CHANGES.rst | 13 +++++++++++++ news/125.bugfix | 5 ----- setup.py | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) delete mode 100644 news/125.bugfix diff --git a/CHANGES.rst b/CHANGES.rst index 75369dfc..cfccebc6 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -8,6 +8,19 @@ Changelog .. towncrier release notes start +3.0.9 (2024-06-07) +------------------ + +Bug fixes: + + +- No longer set ``portal_properties.site_properties.visible_ids`` on site creation. + The ``portal_properties`` tools is deprecated, ``visible_ids`` was not set as real property, and usage of ``visible_ids`` was largely removed in Plone 5.0 already. + You already can no longer set ``visible ids`` in the Editing control panel, nor in the member preferences. + The only remaining use for ``visible_ids``, if set to true, was to show the page ids on the 'select default page' form. + [maurits] (#125) + + 3.0.8 (2024-05-30) ------------------ diff --git a/news/125.bugfix b/news/125.bugfix deleted file mode 100644 index 22b6b61c..00000000 --- a/news/125.bugfix +++ /dev/null @@ -1,5 +0,0 @@ -No longer set ``portal_properties.site_properties.visible_ids`` on site creation. -The ``portal_properties`` tools is deprecated, ``visible_ids`` was not set as real property, and usage of ``visible_ids`` was largely removed in Plone 5.0 already. -You already can no longer set ``visible ids`` in the Editing control panel, nor in the member preferences. -The only remaining use for ``visible_ids``, if set to true, was to show the page ids on the 'select default page' form. -[maurits] diff --git a/setup.py b/setup.py index e0953ea7..63a7431f 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ import os -version = "3.0.9.dev0" +version = "3.0.9" def read(*rnames): From 396a9350c602399eac37d5bb453045393c3e15ae Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Fri, 7 Jun 2024 18:05:26 +0200 Subject: [PATCH 47/55] Back to development: 3.0.10 [ci skip] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 63a7431f..43f94e02 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ import os -version = "3.0.9" +version = "3.0.10.dev0" def read(*rnames): From 8f490ad80bab7d6b750c56cfdb8a5962c3d1017e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 2 Jul 2024 01:39:52 +0000 Subject: [PATCH 48/55] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v3.15.2 → v3.16.0](https://github.com/asottile/pyupgrade/compare/v3.15.2...v3.16.0) - [github.com/PyCQA/flake8: 7.0.0 → 7.1.0](https://github.com/PyCQA/flake8/compare/7.0.0...7.1.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index da56023f..3479cc26 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,7 +7,7 @@ ci: repos: - repo: https://github.com/asottile/pyupgrade - rev: v3.15.2 + rev: v3.16.0 hooks: - id: pyupgrade args: [--py38-plus] @@ -32,7 +32,7 @@ repos: # """ ## - repo: https://github.com/PyCQA/flake8 - rev: 7.0.0 + rev: 7.1.0 hooks: - id: flake8 From 5d955251873e4764146f01a77085d0a1080f4cbe Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 20:32:57 +0000 Subject: [PATCH 49/55] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v3.16.0 → v3.17.0](https://github.com/asottile/pyupgrade/compare/v3.16.0...v3.17.0) - [github.com/psf/black: 24.4.2 → 24.8.0](https://github.com/psf/black/compare/24.4.2...24.8.0) - [github.com/PyCQA/flake8: 7.1.0 → 7.1.1](https://github.com/PyCQA/flake8/compare/7.1.0...7.1.1) - [github.com/collective/i18ndude: 6.2.0 → 6.2.1](https://github.com/collective/i18ndude/compare/6.2.0...6.2.1) --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3479cc26..14603265 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,7 +7,7 @@ ci: repos: - repo: https://github.com/asottile/pyupgrade - rev: v3.16.0 + rev: v3.17.0 hooks: - id: pyupgrade args: [--py38-plus] @@ -16,7 +16,7 @@ repos: hooks: - id: isort - repo: https://github.com/psf/black - rev: 24.4.2 + rev: 24.8.0 hooks: - id: black - repo: https://github.com/collective/zpretty @@ -32,7 +32,7 @@ repos: # """ ## - repo: https://github.com/PyCQA/flake8 - rev: 7.1.0 + rev: 7.1.1 hooks: - id: flake8 @@ -71,7 +71,7 @@ repos: - id: check-python-versions args: ['--only', 'setup.py,pyproject.toml'] - repo: https://github.com/collective/i18ndude - rev: "6.2.0" + rev: "6.2.1" hooks: - id: i18ndude From 136d4868253cbdb74978af6997c3039c686b42de Mon Sep 17 00:00:00 2001 From: "Jens W. Klein" Date: Fri, 19 May 2023 16:39:06 +0200 Subject: [PATCH 50/55] do not enable plone.allowdiscussion by default --- news/665.bugfix | 2 ++ plone/app/contenttypes/profiles/default/types/Collection.xml | 1 - plone/app/contenttypes/profiles/default/types/Document.xml | 1 - plone/app/contenttypes/profiles/default/types/File.xml | 1 - plone/app/contenttypes/profiles/default/types/Folder.xml | 1 - plone/app/contenttypes/profiles/default/types/Image.xml | 1 - plone/app/contenttypes/profiles/default/types/Link.xml | 1 - plone/app/contenttypes/profiles/default/types/News_Item.xml | 1 - 8 files changed, 2 insertions(+), 7 deletions(-) create mode 100644 news/665.bugfix diff --git a/news/665.bugfix b/news/665.bugfix new file mode 100644 index 00000000..92cc4db3 --- /dev/null +++ b/news/665.bugfix @@ -0,0 +1,2 @@ +Do not enable plone.allowdiscussion by default, it is a core add-on now. +[@jensens] \ No newline at end of file diff --git a/plone/app/contenttypes/profiles/default/types/Collection.xml b/plone/app/contenttypes/profiles/default/types/Collection.xml index 05c04bab..9b0e322d 100644 --- a/plone/app/contenttypes/profiles/default/types/Collection.xml +++ b/plone/app/contenttypes/profiles/default/types/Collection.xml @@ -36,7 +36,6 @@ > - diff --git a/plone/app/contenttypes/profiles/default/types/Document.xml b/plone/app/contenttypes/profiles/default/types/Document.xml index 76da466b..d72793d5 100644 --- a/plone/app/contenttypes/profiles/default/types/Document.xml +++ b/plone/app/contenttypes/profiles/default/types/Document.xml @@ -35,7 +35,6 @@ purge="false" > - diff --git a/plone/app/contenttypes/profiles/default/types/File.xml b/plone/app/contenttypes/profiles/default/types/File.xml index a9b9211b..e9974159 100644 --- a/plone/app/contenttypes/profiles/default/types/File.xml +++ b/plone/app/contenttypes/profiles/default/types/File.xml @@ -38,7 +38,6 @@ - diff --git a/plone/app/contenttypes/profiles/default/types/Folder.xml b/plone/app/contenttypes/profiles/default/types/Folder.xml index e4236288..4d37fbca 100644 --- a/plone/app/contenttypes/profiles/default/types/Folder.xml +++ b/plone/app/contenttypes/profiles/default/types/Folder.xml @@ -36,7 +36,6 @@ > - diff --git a/plone/app/contenttypes/profiles/default/types/Image.xml b/plone/app/contenttypes/profiles/default/types/Image.xml index 90b223c8..cc069e93 100644 --- a/plone/app/contenttypes/profiles/default/types/Image.xml +++ b/plone/app/contenttypes/profiles/default/types/Image.xml @@ -37,7 +37,6 @@ - diff --git a/plone/app/contenttypes/profiles/default/types/Link.xml b/plone/app/contenttypes/profiles/default/types/Link.xml index 33fa21f4..581f98dd 100644 --- a/plone/app/contenttypes/profiles/default/types/Link.xml +++ b/plone/app/contenttypes/profiles/default/types/Link.xml @@ -34,7 +34,6 @@ - diff --git a/plone/app/contenttypes/profiles/default/types/News_Item.xml b/plone/app/contenttypes/profiles/default/types/News_Item.xml index 0ddebb6f..a706f5c9 100644 --- a/plone/app/contenttypes/profiles/default/types/News_Item.xml +++ b/plone/app/contenttypes/profiles/default/types/News_Item.xml @@ -37,7 +37,6 @@ - From 346c64e9d08d72426caefc3b89af0688fe6816fb Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Thu, 13 Jun 2024 21:39:06 +0200 Subject: [PATCH 51/55] tox: use 6.1 constraints. --- .meta.toml | 3 +++ tox.ini | 12 ++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.meta.toml b/.meta.toml index bcd1aff6..20de3903 100644 --- a/.meta.toml +++ b/.meta.toml @@ -8,3 +8,6 @@ commit-id = "a89af8f2" [pyproject] codespell_ignores = "oder,ist,crate" dependencies_ignores = "['ZServer', 'plone.app.event', 'Products.CMFPlone',]" + +[tox] +constraints_file = "https://dist.plone.org/release/6.1-dev/constraints.txt" diff --git a/tox.ini b/tox.ini index e46028c0..69ef3271 100644 --- a/tox.ini +++ b/tox.ini @@ -108,7 +108,7 @@ 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: @@ -152,7 +152,7 @@ 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 = rfbrowser init @@ -160,6 +160,7 @@ commands = coverage report -m --format markdown coverage xml coverage html + coverage html extras = test @@ -171,7 +172,7 @@ 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 @@ -188,6 +189,9 @@ 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 +# 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 = ## @@ -202,7 +206,7 @@ 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 From 3143cb63b689573624d90806f8997600146b66f7 Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Tue, 13 Aug 2024 19:36:07 +0200 Subject: [PATCH 52/55] Bumped version for breaking release. [ci skip] --- news/{665.bugfix => 665.breaking} | 1 + setup.py | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) rename news/{665.bugfix => 665.breaking} (63%) diff --git a/news/665.bugfix b/news/665.breaking similarity index 63% rename from news/665.bugfix rename to news/665.breaking index 92cc4db3..b9f41951 100644 --- a/news/665.bugfix +++ b/news/665.breaking @@ -1,2 +1,3 @@ Do not enable plone.allowdiscussion by default, it is a core add-on now. +This is for Plone 6.1, so is a breaking change. [@jensens] \ No newline at end of file diff --git a/setup.py b/setup.py index 43f94e02..db558550 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ import os -version = "3.0.10.dev0" +version = "4.0.0.dev0" def read(*rnames): @@ -24,16 +24,15 @@ def read(*rnames): "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Plone", - "Framework :: Plone :: 6.0", + "Framework :: Plone :: 6.1", "Framework :: Plone :: Core", "Framework :: Zope :: 5", "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", "Operating System :: OS Independent", "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", ], keywords="plone content types dexterity", author="Plone Foundation", @@ -44,7 +43,7 @@ def read(*rnames): namespace_packages=["plone", "plone.app"], include_package_data=True, zip_safe=False, - python_requires=">=3.8", + python_requires=">=3.10", install_requires=[ "setuptools", "plone.app.contentmenu", From 224ec3c2d5863d582340db7cb17e9859b3cd3c74 Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Tue, 3 Sep 2024 13:20:28 +0200 Subject: [PATCH 53/55] Preparing release 4.0.0 [ci skip] --- CHANGES.rst | 11 +++++++++++ news/665.breaking | 3 --- setup.py | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) delete mode 100644 news/665.breaking diff --git a/CHANGES.rst b/CHANGES.rst index cfccebc6..deafacf0 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -8,6 +8,17 @@ Changelog .. towncrier release notes start +4.0.0 (2024-09-03) +------------------ + +Breaking changes: + + +- Do not enable plone.allowdiscussion by default, it is a core add-on now. + This is for Plone 6.1, so is a breaking change. + [@jensens] (#665) + + 3.0.9 (2024-06-07) ------------------ diff --git a/news/665.breaking b/news/665.breaking deleted file mode 100644 index b9f41951..00000000 --- a/news/665.breaking +++ /dev/null @@ -1,3 +0,0 @@ -Do not enable plone.allowdiscussion by default, it is a core add-on now. -This is for Plone 6.1, so is a breaking change. -[@jensens] \ No newline at end of file diff --git a/setup.py b/setup.py index db558550..a1f90560 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ import os -version = "4.0.0.dev0" +version = "4.0.0" def read(*rnames): From 169ef1cc54e100b30f898f8f50cd95e4f2e072eb Mon Sep 17 00:00:00 2001 From: Maurits van Rees Date: Tue, 3 Sep 2024 13:20:47 +0200 Subject: [PATCH 54/55] Back to development: 4.0.1 [ci skip] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a1f90560..2b47eed8 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ import os -version = "4.0.0" +version = "4.0.1.dev0" def read(*rnames): From b92d781fb21655c7640d53b694a44d0074645529 Mon Sep 17 00:00:00 2001 From: 1letter <1letter@gmx.de> Date: Sun, 15 Sep 2024 10:52:28 +0200 Subject: [PATCH 55/55] fix merge conflict --- tox.ini | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tox.ini b/tox.ini index 69ef3271..c0b0ad2b 100644 --- a/tox.ini +++ b/tox.ini @@ -160,7 +160,6 @@ commands = coverage report -m --format markdown coverage xml coverage html - coverage html extras = test @@ -189,9 +188,6 @@ 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 -# 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 = ##