diff --git a/base.cfg b/base.cfg index 89d11bfb..334c38a5 100644 --- a/base.cfg +++ b/base.cfg @@ -17,18 +17,6 @@ plone.batching = >=1.1.7 # plone.app.standardtiles = 2.3.1 # fix https://github.com/plone/plone.app.standardtiles/issues/111 pycodestyle = -# Robot Testing (see buildout.coredev[5.2]/versions.cfg) -plone.app.robotframework = 1.5.4 -robotframework = 3.1.2 -robotframework-python3 = 2.9 -robotframework-debuglibrary = 1.2.1 -robotframework-ride = 1.7.4.1 -robotframework-seleniumlibrary = 3.3.1 -robotframework-selenium2library = 3.0.0 -robotframework-selenium2screenshots = 0.8.1 -robotsuite = 2.2.1 -selenium = 3.141.0 - [versions:python27] # to get codeanalysis working build = 0.1 diff --git a/src/collective/collectionfilter/vocabularies.py b/src/collective/collectionfilter/vocabularies.py index 84fcce34..8abf7207 100644 --- a/src/collective/collectionfilter/vocabularies.py +++ b/src/collective/collectionfilter/vocabularies.py @@ -26,6 +26,7 @@ # Use this EMPTY_MARKER for your custom indexer to index empty criterions. EMPTY_MARKER = "__EMPTY__" TEXT_IDX = "SearchableText" +INTEGER_IDXS = [] GEOLOC_IDX = [ "latitude", "longitude", @@ -59,7 +60,12 @@ ] + GEOLOC_IDX # latitude/longitude is handled as a range filter ... see query.py # noqa DEFAULT_FILTER_TYPE = "single" LIST_SCALING = ["No Scaling", "Linear", "Logarithmic"] - +TRUTHY = [ + safe_encode("true"), + safe_encode("1"), + safe_encode("t"), + safe_encode("yes"), +] def translate_value(value, *args, **kwargs): return translate(_(value), context=getRequest()) @@ -71,30 +77,20 @@ def translate_messagefactory(value, *args, **kwargs): def make_bool(value): """Transform into a boolean value.""" - truthy = [ - safe_encode("true"), - safe_encode("1"), - safe_encode("t"), - safe_encode("yes"), - ] + if value is None: return if isinstance(value, bool): return value - value = safe_encode(value) - value = value.lower() - if value in truthy: - return True - else: - return False + value = safe_encode(value).lower() + return value in TRUTHY def yes_no(value): """Return i18n message for a value.""" if value: return _(u"Yes") - else: - return _(u"No") + return _(u"No") def get_yes_no_title(item, *args, **kwargs): @@ -156,6 +152,9 @@ def groupby(self): index_modifier = make_bool display_modifier = get_yes_no_title + if idx in INTEGER_IDXS: + index_modifier = int + # for portal_type or Type we have some special sauce as we need to translate via fti.i18n_domain. # noqa if it == "portal_type": display_modifier = translate_portal_type diff --git a/test-5.0.x.cfg b/test-5.0.x.cfg index 85cf5dbc..310c9f1d 100644 --- a/test-5.0.x.cfg +++ b/test-5.0.x.cfg @@ -29,4 +29,15 @@ plone.jsonserializer = 0.9.6 plone.formwidget.geolocation = < 2.2.2 # Introduced a dep on CMFPlone 5.2 -six = 1.16.0 \ No newline at end of file +six = 1.16.0 + +plone.app.robotframework = 1.5.4 +robotframework = 3.1.2 +robotframework-python3 = 2.9 +robotframework-debuglibrary = 1.2.1 +robotframework-ride = 1.7.4.1 +robotframework-seleniumlibrary = 3.3.1 +robotframework-selenium2library = 3.0.0 +robotframework-selenium2screenshots = 0.8.1 +robotsuite = 2.2.1 +selenium = 3.141.0 diff --git a/test-5.1.x.cfg b/test-5.1.x.cfg index fd6394f4..90c25cf0 100644 --- a/test-5.1.x.cfg +++ b/test-5.1.x.cfg @@ -21,4 +21,15 @@ configparser = 3.8.1 plone.formwidget.geolocation = < 2.2.2 # Introduced a dep on CMFPlone 5.2 -six = 1.16.0 \ No newline at end of file +six = 1.16.0 + +plone.app.robotframework = 1.5.4 +robotframework = 3.1.2 +robotframework-python3 = 2.9 +robotframework-debuglibrary = 1.2.1 +robotframework-ride = 1.7.4.1 +robotframework-seleniumlibrary = 3.3.1 +robotframework-selenium2library = 3.0.0 +robotframework-selenium2screenshots = 0.8.1 +robotsuite = 2.2.1 +selenium = 3.141.0 diff --git a/test-5.2.x.cfg b/test-5.2.x.cfg index dd888675..dd44bfa1 100644 --- a/test-5.2.x.cfg +++ b/test-5.2.x.cfg @@ -18,5 +18,17 @@ test-eggs = extensions += flake8-black +[versions] +plone.app.robotframework = 1.5.4 +robotframework = 3.1.2 +robotframework-python3 = 2.9 +robotframework-debuglibrary = 1.2.1 +robotframework-ride = 1.7.4.1 +robotframework-seleniumlibrary = 3.3.1 +robotframework-selenium2library = 3.0.0 +robotframework-selenium2screenshots = 0.8.1 +robotsuite = 2.2.1 +selenium = 3.141.0 + [versions:python3] coverage = >=3.7