From 94af5305a2a3647d98393e055de54dc1ca472db3 Mon Sep 17 00:00:00 2001 From: Piero Nicolli Date: Fri, 22 Dec 2023 13:01:51 +0100 Subject: [PATCH] Removed maximumSelectionSize from all fields that had it greater than 0 (#229) --- CHANGES.rst | 4 +++- src/design/plone/contenttypes/behaviors/argomenti.py | 2 -- src/design/plone/contenttypes/behaviors/contatti.py | 5 ----- .../plone/contenttypes/behaviors/dataset_correlati.py | 1 - src/design/plone/contenttypes/behaviors/evento.py | 3 --- .../plone/contenttypes/behaviors/luoghi_correlati.py | 2 -- src/design/plone/contenttypes/behaviors/luogo.py | 1 - .../plone/contenttypes/behaviors/news_additional_fields.py | 3 --- .../plone/contenttypes/behaviors/servizi_correlati.py | 1 - .../plone/contenttypes/behaviors/strutture_correlate.py | 1 - src/design/plone/contenttypes/behaviors/trasparenza.py | 2 -- src/design/plone/contenttypes/interfaces/documento.py | 7 +++---- .../plone/contenttypes/interfaces/pagina_argomento.py | 1 - src/design/plone/contenttypes/interfaces/persona.py | 2 -- .../plone/contenttypes/interfaces/punto_di_contatto.py | 1 - src/design/plone/contenttypes/interfaces/servizio.py | 4 ---- .../plone/contenttypes/interfaces/unita_organizzativa.py | 5 +---- src/design/plone/contenttypes/tests/test_ct_servizio.py | 4 ---- 18 files changed, 7 insertions(+), 42 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 28f5ece7..2137f927 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,8 +4,10 @@ Changelog 6.1.8 (unreleased) ------------------ -- Add behavior aromento to Link CT +- Add behavior argomento to Link CT [lucabel] +- Removed maximumSelectionSize from all fields that had it greater than 0 + [pnicolli] 6.1.7 (2023-12-20) diff --git a/src/design/plone/contenttypes/behaviors/argomenti.py b/src/design/plone/contenttypes/behaviors/argomenti.py index 427410bd..7678ab49 100644 --- a/src/design/plone/contenttypes/behaviors/argomenti.py +++ b/src/design/plone/contenttypes/behaviors/argomenti.py @@ -55,7 +55,6 @@ class IArgomentiSchema(model.Schema): RelatedItemsFieldWidget, vocabulary="plone.app.vocabularies.Catalog", pattern_options={ - "maximumSelectionSize": 20, "selectableTypes": ["Pagina Argomento"], }, ) @@ -93,7 +92,6 @@ class IArgomentiLink(model.Schema): RelatedItemsFieldWidget, vocabulary="plone.app.vocabularies.Catalog", pattern_options={ - "maximumSelectionSize": 20, "selectableTypes": ["Pagina Argomento"], }, ) diff --git a/src/design/plone/contenttypes/behaviors/contatti.py b/src/design/plone/contenttypes/behaviors/contatti.py index f33be26f..5d76e374 100644 --- a/src/design/plone/contenttypes/behaviors/contatti.py +++ b/src/design/plone/contenttypes/behaviors/contatti.py @@ -49,7 +49,6 @@ class IContattiUnitaOrganizzativa(model.Schema): RelatedItemsFieldWidget, vocabulary="plone.app.vocabularies.Catalog", pattern_options={ - "maximumSelectionSize": 10, "selectableTypes": ["PuntoDiContatto"], }, ) @@ -86,7 +85,6 @@ class IContattiPersona(model.Schema): RelatedItemsFieldWidget, vocabulary="plone.app.vocabularies.Catalog", pattern_options={ - "maximumSelectionSize": 10, "selectableTypes": ["PuntoDiContatto"], }, ) @@ -120,7 +118,6 @@ class IContattiServizio(model.Schema): RelatedItemsFieldWidget, vocabulary="plone.app.vocabularies.Catalog", pattern_options={ - "maximumSelectionSize": 10, "selectableTypes": ["PuntoDiContatto"], }, ) @@ -154,7 +151,6 @@ class IContattiVenue(model.Schema): RelatedItemsFieldWidget, vocabulary="plone.app.vocabularies.Catalog", pattern_options={ - "maximumSelectionSize": 10, "selectableTypes": ["PuntoDiContatto"], }, ) @@ -188,7 +184,6 @@ class IContattiEvent(model.Schema): RelatedItemsFieldWidget, vocabulary="plone.app.vocabularies.Catalog", pattern_options={ - "maximumSelectionSize": 10, "selectableTypes": ["PuntoDiContatto"], }, ) diff --git a/src/design/plone/contenttypes/behaviors/dataset_correlati.py b/src/design/plone/contenttypes/behaviors/dataset_correlati.py index ac2fe90e..fdf71d8f 100644 --- a/src/design/plone/contenttypes/behaviors/dataset_correlati.py +++ b/src/design/plone/contenttypes/behaviors/dataset_correlati.py @@ -32,7 +32,6 @@ class IDatasetCorrelati(model.Schema): vocabulary="plone.app.vocabularies.Catalog", pattern_options={ "selectableTypes": ["Dataset"], - "maximumSelectionSize": 50, }, ) diff --git a/src/design/plone/contenttypes/behaviors/evento.py b/src/design/plone/contenttypes/behaviors/evento.py index 2a280e31..65fb13ad 100644 --- a/src/design/plone/contenttypes/behaviors/evento.py +++ b/src/design/plone/contenttypes/behaviors/evento.py @@ -127,7 +127,6 @@ class IEvento(model.Schema): RelatedItemsFieldWidget, vocabulary="plone.app.vocabularies.Catalog", pattern_options={ - "maximumSelectionSize": 10, "selectableTypes": ["UnitaOrganizzativa"], }, ) @@ -136,7 +135,6 @@ class IEvento(model.Schema): RelatedItemsFieldWidget, vocabulary="plone.app.vocabularies.Catalog", pattern_options={ - "maximumSelectionSize": 10, "selectableTypes": ["Persona", "UnitaOrganizzativa", "Servizio"], }, ) @@ -145,7 +143,6 @@ class IEvento(model.Schema): RelatedItemsFieldWidget, vocabulary="plone.app.vocabularies.Catalog", pattern_options={ - "maximumSelectionSize": 10, "selectableTypes": ["Persona"], }, ) diff --git a/src/design/plone/contenttypes/behaviors/luoghi_correlati.py b/src/design/plone/contenttypes/behaviors/luoghi_correlati.py index da545131..0f171c71 100644 --- a/src/design/plone/contenttypes/behaviors/luoghi_correlati.py +++ b/src/design/plone/contenttypes/behaviors/luoghi_correlati.py @@ -30,7 +30,6 @@ class ILuoghiCorrelatiSchema(model.Schema): vocabulary="plone.app.vocabularies.Catalog", pattern_options={ "selectableTypes": ["Venue"], - "maximumSelectionSize": 50, }, ) @@ -66,7 +65,6 @@ class ILuoghiCorrelatiEvento(model.Schema): vocabulary="plone.app.vocabularies.Catalog", pattern_options={ "selectableTypes": ["Venue"], - "maximumSelectionSize": 50, }, ) diff --git a/src/design/plone/contenttypes/behaviors/luogo.py b/src/design/plone/contenttypes/behaviors/luogo.py index 753bdfd0..e36e9d22 100644 --- a/src/design/plone/contenttypes/behaviors/luogo.py +++ b/src/design/plone/contenttypes/behaviors/luogo.py @@ -171,7 +171,6 @@ class ILuogo(model.Schema): RelatedItemsFieldWidget, vocabulary="plone.app.vocabularies.Catalog", pattern_options={ - "maximumSelectionSize": 10, "selectableTypes": ["UnitaOrganizzativa"], }, ) diff --git a/src/design/plone/contenttypes/behaviors/news_additional_fields.py b/src/design/plone/contenttypes/behaviors/news_additional_fields.py index 0a20c31e..149879b1 100644 --- a/src/design/plone/contenttypes/behaviors/news_additional_fields.py +++ b/src/design/plone/contenttypes/behaviors/news_additional_fields.py @@ -97,7 +97,6 @@ class INewsAdditionalFields(model.Schema): vocabulary="plone.app.vocabularies.Catalog", pattern_options={ "selectableTypes": ["Persona"], - "maximumSelectionSize": 50, }, ) form.widget( @@ -105,7 +104,6 @@ class INewsAdditionalFields(model.Schema): RelatedItemsFieldWidget, vocabulary="plone.app.vocabularies.Catalog", pattern_options={ - "maximumSelectionSize": 10, "selectableTypes": ["News Item"], }, ) @@ -115,7 +113,6 @@ class INewsAdditionalFields(model.Schema): vocabulary="plone.app.vocabularies.Catalog", pattern_options={ "selectableTypes": ["Venue"], - "maximumSelectionSize": 50, }, ) model.fieldset( diff --git a/src/design/plone/contenttypes/behaviors/servizi_correlati.py b/src/design/plone/contenttypes/behaviors/servizi_correlati.py index 74828cbf..b7446dbe 100644 --- a/src/design/plone/contenttypes/behaviors/servizi_correlati.py +++ b/src/design/plone/contenttypes/behaviors/servizi_correlati.py @@ -34,7 +34,6 @@ class IServiziCorrelati(model.Schema): RelatedItemsFieldWidget, vocabulary="plone.app.vocabularies.Catalog", pattern_options={ - "maximumSelectionSize": 10, "selectableTypes": ["Servizio"], }, ) diff --git a/src/design/plone/contenttypes/behaviors/strutture_correlate.py b/src/design/plone/contenttypes/behaviors/strutture_correlate.py index 14c21654..63d752b6 100644 --- a/src/design/plone/contenttypes/behaviors/strutture_correlate.py +++ b/src/design/plone/contenttypes/behaviors/strutture_correlate.py @@ -33,7 +33,6 @@ class IStruttureCorrelate(model.Schema): RelatedItemsFieldWidget, vocabulary="plone.app.vocabularies.Catalog", pattern_options={ - "maximumSelectionSize": 10, "selectableTypes": ["UnitaOrganizzativa"], }, ) diff --git a/src/design/plone/contenttypes/behaviors/trasparenza.py b/src/design/plone/contenttypes/behaviors/trasparenza.py index 90b93fde..31dafdc5 100644 --- a/src/design/plone/contenttypes/behaviors/trasparenza.py +++ b/src/design/plone/contenttypes/behaviors/trasparenza.py @@ -274,7 +274,6 @@ class ITrasparenza(model.Schema): RelatedItemsFieldWidget, vocabulary="plone.app.vocabularies.Catalog", pattern_options={ - "maximumSelectionSize": 10, "selectableTypes": ["Persona"], }, ) @@ -283,7 +282,6 @@ class ITrasparenza(model.Schema): RelatedItemsFieldWidget, vocabulary="plone.app.vocabularies.Catalog", pattern_options={ - "maximumSelectionSize": 10, "selectableTypes": ["Persona"], }, ) diff --git a/src/design/plone/contenttypes/interfaces/documento.py b/src/design/plone/contenttypes/interfaces/documento.py index 3e89a07d..58979951 100644 --- a/src/design/plone/contenttypes/interfaces/documento.py +++ b/src/design/plone/contenttypes/interfaces/documento.py @@ -161,7 +161,7 @@ class IDocumento(model.Schema, IDesignPloneContentType): "dataset", RelatedItemsFieldWidget, vocabulary="plone.app.vocabularies.Catalog", - pattern_options={"maximumSelectionSize": 10, "selectableTypes": ["Dataset"]}, + pattern_options={"selectableTypes": ["Dataset"]}, ) # servizi = RelationList( @@ -183,7 +183,7 @@ class IDocumento(model.Schema, IDesignPloneContentType): # "servizi", # RelatedItemsFieldWidget, # vocabulary="plone.app.vocabularies.Catalog", - # pattern_options={"maximumSelectionSize": 20, "selectableTypes": ["Servizio"]}, + # pattern_options={"selectableTypes": ["Servizio"]}, # ) documenti_allegati = RelationList( @@ -217,7 +217,6 @@ class IDocumento(model.Schema, IDesignPloneContentType): RelatedItemsFieldWidget, vocabulary="plone.app.vocabularies.Catalog", pattern_options={ - "maximumSelectionSize": 10, "selectableTypes": ["Persona", "UnitaOrganizzativa"], }, ) @@ -234,7 +233,7 @@ class IDocumento(model.Schema, IDesignPloneContentType): "documenti_allegati", RelatedItemsFieldWidget, vocabulary="plone.app.vocabularies.Catalog", - pattern_options={"maximumSelectionSize": 10, "selectableTypes": ["Documento"]}, + pattern_options={"selectableTypes": ["Documento"]}, ) #  custom fieldsets diff --git a/src/design/plone/contenttypes/interfaces/pagina_argomento.py b/src/design/plone/contenttypes/interfaces/pagina_argomento.py index f2621ea7..9a455493 100644 --- a/src/design/plone/contenttypes/interfaces/pagina_argomento.py +++ b/src/design/plone/contenttypes/interfaces/pagina_argomento.py @@ -56,7 +56,6 @@ class IPaginaArgomento(model.Schema, IDesignPloneContentType): RelatedItemsFieldWidget, vocabulary="plone.app.vocabularies.Catalog", pattern_options={ - "maximumSelectionSize": 10, "selectableTypes": ["UnitaOrganizzativa"], }, ) diff --git a/src/design/plone/contenttypes/interfaces/persona.py b/src/design/plone/contenttypes/interfaces/persona.py index 021d96e3..2b7e5020 100644 --- a/src/design/plone/contenttypes/interfaces/persona.py +++ b/src/design/plone/contenttypes/interfaces/persona.py @@ -116,7 +116,6 @@ class IPersona(model.Schema, IDesignPloneContentType): RelatedItemsFieldWidget, vocabulary="plone.app.vocabularies.Catalog", pattern_options={ - "maximumSelectionSize": 10, "selectableTypes": ["UnitaOrganizzativa"], }, ) @@ -126,7 +125,6 @@ class IPersona(model.Schema, IDesignPloneContentType): RelatedItemsFieldWidget, vocabulary="plone.app.vocabularies.Catalog", pattern_options={ - "maximumSelectionSize": 10, "selectableTypes": ["Incarico"], }, ) diff --git a/src/design/plone/contenttypes/interfaces/punto_di_contatto.py b/src/design/plone/contenttypes/interfaces/punto_di_contatto.py index 1071241f..0639904b 100644 --- a/src/design/plone/contenttypes/interfaces/punto_di_contatto.py +++ b/src/design/plone/contenttypes/interfaces/punto_di_contatto.py @@ -78,7 +78,6 @@ class IPuntoDiContatto(model.Schema, IDesignPloneContentType): RelatedItemsFieldWidget, vocabulary="plone.app.vocabularies.Catalog", pattern_options={ - "maximumSelectionSize": 10, "selectableTypes": ["Persona"], }, ) diff --git a/src/design/plone/contenttypes/interfaces/servizio.py b/src/design/plone/contenttypes/interfaces/servizio.py index 1f53ff8a..740e1695 100644 --- a/src/design/plone/contenttypes/interfaces/servizio.py +++ b/src/design/plone/contenttypes/interfaces/servizio.py @@ -408,7 +408,6 @@ class IServizio(model.Schema, IDesignPloneContentType): RelatedItemsFieldWidget, vocabulary="plone.app.vocabularies.Catalog", pattern_options={ - "maximumSelectionSize": 10, "selectableTypes": ["UnitaOrganizzativa"], }, ) @@ -417,7 +416,6 @@ class IServizio(model.Schema, IDesignPloneContentType): RelatedItemsFieldWidget, vocabulary="plone.app.vocabularies.Catalog", pattern_options={ - "maximumSelectionSize": 10, "selectableTypes": ["Venue", "UnitaOrganizzativa"], }, ) @@ -446,7 +444,6 @@ class IServizio(model.Schema, IDesignPloneContentType): RelatedItemsFieldWidget, vocabulary="plone.app.vocabularies.Catalog", pattern_options={ - "maximumSelectionSize": 10, "selectableTypes": ["Documento", "CartellaModulistica"], # "basePath": "/", }, @@ -456,7 +453,6 @@ class IServizio(model.Schema, IDesignPloneContentType): RelatedItemsFieldWidget, vocabulary="plone.app.vocabularies.Catalog", pattern_options={ - "maximumSelectionSize": 10, "selectableTypes": ["Servizio"], # "basePath": "/", }, diff --git a/src/design/plone/contenttypes/interfaces/unita_organizzativa.py b/src/design/plone/contenttypes/interfaces/unita_organizzativa.py index 21c0dc8d..12e1bfad 100644 --- a/src/design/plone/contenttypes/interfaces/unita_organizzativa.py +++ b/src/design/plone/contenttypes/interfaces/unita_organizzativa.py @@ -144,7 +144,6 @@ class IUnitaOrganizzativa(model.Schema, IDesignPloneContentType): RelatedItemsFieldWidget, vocabulary="plone.app.vocabularies.Catalog", pattern_options={ - "maximumSelectionSize": 10, "selectableTypes": ["Documento"], }, ) @@ -152,14 +151,13 @@ class IUnitaOrganizzativa(model.Schema, IDesignPloneContentType): "persone_struttura", RelatedItemsFieldWidget, vocabulary="plone.app.vocabularies.Catalog", - pattern_options={"selectableTypes": ["Persona"], "maximumSelectionSize": 50}, + pattern_options={"selectableTypes": ["Persona"]}, ) form.widget( "legami_con_altre_strutture", RelatedItemsFieldWidget, vocabulary="plone.app.vocabularies.Catalog", pattern_options={ - "maximumSelectionSize": 10, "selectableTypes": ["UnitaOrganizzativa"], }, ) @@ -194,7 +192,6 @@ class IUnitaOrganizzativa(model.Schema, IDesignPloneContentType): RelatedItemsFieldWidget, vocabulary="plone.app.vocabularies.Catalog", pattern_options={ - "maximumSelectionSize": 10, "selectableTypes": ["Venue"], # "basePath": "/servizi", }, diff --git a/src/design/plone/contenttypes/tests/test_ct_servizio.py b/src/design/plone/contenttypes/tests/test_ct_servizio.py index 0b8935fc..884b0dca 100644 --- a/src/design/plone/contenttypes/tests/test_ct_servizio.py +++ b/src/design/plone/contenttypes/tests/test_ct_servizio.py @@ -19,7 +19,6 @@ WIDGET_PROPERTY_CHECKS = { "tassonomia_argomenti": { - "maximumSelectionSize": 20, "selectableTypes": ["Pagina Argomento"], }, "ufficio_responsabile": { @@ -30,15 +29,12 @@ "selectableTypes": ["UnitaOrganizzativa"], }, "altri_documenti": { - "maximumSelectionSize": 10, "selectableTypes": ["Documento", "CartellaModulistica"], }, "servizi_collegati": { - "maximumSelectionSize": 10, "selectableTypes": ["Servizio"], }, "dove_rivolgersi": { - "maximumSelectionSize": 10, "selectableTypes": ["Venue", "UnitaOrganizzativa"], }, }