From 4a4206b1fecb7faffccfab63adf4b3e49429ea2f Mon Sep 17 00:00:00 2001 From: Ramon Bartl Date: Tue, 4 Feb 2020 10:55:17 +0100 Subject: [PATCH 1/5] Integrate senaite.core.spotlight --- bika/lims/profiles/default/actions.xml | 14 ++++++++++++++ buildout.cfg | 5 +++-- setup.py | 1 + 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/bika/lims/profiles/default/actions.xml b/bika/lims/profiles/default/actions.xml index 343fe75bf8..d97df2ef56 100644 --- a/bika/lims/profiles/default/actions.xml +++ b/bika/lims/profiles/default/actions.xml @@ -158,6 +158,20 @@ True + + + Search + + string:${globals_view/navigationRootUrl}/spotlight + + + + + + + True + + Audit Log diff --git a/buildout.cfg b/buildout.cfg index ee218ccf59..a164fc0609 100644 --- a/buildout.cfg +++ b/buildout.cfg @@ -8,12 +8,12 @@ # [buildout] -extends = http://dist.plone.org/release/4.3.18/versions.cfg +extends = http://dist.plone.org/release/4.3.19/versions.cfg index = https://pypi.python.org/simple/ find-links = - http://dist.plone.org/release/4.3.18 + http://dist.plone.org/release/4.3.19 http://dist.plone.org/thirdparty parts = @@ -43,6 +43,7 @@ develop = . [sources] senaite.core.listing = git git://github.com/senaite/senaite.core.listing.git pushurl=git@github.com:senaite/senaite.core.listing.git branch=master +senaite.core.spotlight = git git://github.com/senaite/senaite.core.spotlight.git pushurl=git@github.com:senaite/senaite.core.spotlight.git branch=master senaite.core.supermodel = git git://github.com/senaite/senaite.core.supermodel.git pushurl=git@github.com:senaite/senaite.core.supermodel.git branch=master [instance] diff --git a/setup.py b/setup.py index e1a8b819d0..9a4adf0b89 100644 --- a/setup.py +++ b/setup.py @@ -76,6 +76,7 @@ 'zopyx.txng3.ext==3.4.0', "senaite.core.supermodel>=1.2.0", "senaite.core.listing>=1.1.0", + "senaite.core.spotlight", # Python 2.x is not supported by WeasyPrint v43 'WeasyPrint==0.42.3', # tinycss2 >= 1.0.0 does not support Python 2.x anymore From cb78405a393620ca26e09bad5cb99949015fd211 Mon Sep 17 00:00:00 2001 From: Ramon Bartl Date: Tue, 4 Feb 2020 11:16:47 +0100 Subject: [PATCH 2/5] Changelog updated --- CHANGES.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.rst b/CHANGES.rst index e5776a9dc4..27d19a4dda 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -7,6 +7,7 @@ Changelog **Added** +- #1517 Integrate senaite.core.spotlight - #1515 Moved Setup View into Core - #1506 Specification non-compliant viewlet in Sample - #1506 Sample results ranges out-of-date viewlet in Sample From 77c220fa6c82ae7a117e3f47102f6c4129230032 Mon Sep 17 00:00:00 2001 From: Ramon Bartl Date: Tue, 4 Feb 2020 21:55:14 +0100 Subject: [PATCH 3/5] Added upgrade step --- bika/lims/upgrade/v01_03_003.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/bika/lims/upgrade/v01_03_003.py b/bika/lims/upgrade/v01_03_003.py index 8e62a7b119..85665fb5b7 100644 --- a/bika/lims/upgrade/v01_03_003.py +++ b/bika/lims/upgrade/v01_03_003.py @@ -299,6 +299,10 @@ def upgrade(tool): # https://github.com/senaite/senaite.core/pull/1506 update_samples_result_ranges(portal) + # Try to install the spotlight add-on + # https://github.com/senaite/senaite.core/pull/1517 + install_senaite_core_spotlight(portal) + logger.info("{0} upgraded to version {1}".format(product, version)) return True @@ -651,3 +655,18 @@ def update_analyses_results_range(sample): if analysis_rr: analysis = api.get_object(analysis) analysis.setResultsRange(analysis_rr) + + +def install_senaite_core_spotlight(portal): + """Install the senaite.core.spotlight addon + """ + qi = api.get_tool("portal_quickinstaller") + profile = "senaite.core.spotlight" + if profile not in qi.listInstallableProfile(): + logger.error("Profile '{}' not found. Forgot to run buildout?" + .format(profile)) + return + if qi.isProductInstalled(profile): + logger.info("'{}' is installed".format(profile)) + return + qi.installProduct(profile) From c2ca7e81a016d45c434b463d303a379d24e24d7f Mon Sep 17 00:00:00 2001 From: Ramon Bartl Date: Tue, 4 Feb 2020 22:08:00 +0100 Subject: [PATCH 4/5] typo fixed --- bika/lims/upgrade/v01_03_003.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bika/lims/upgrade/v01_03_003.py b/bika/lims/upgrade/v01_03_003.py index 85665fb5b7..67ade02f68 100644 --- a/bika/lims/upgrade/v01_03_003.py +++ b/bika/lims/upgrade/v01_03_003.py @@ -614,7 +614,7 @@ def update_samples_result_ranges(portal): if num and num % 1000 == 0: logger.info("{}/{} samples processed ...".format(num, total)) transaction.commit() - logger.info("Changes commited") + logger.info("Changes committed") sample = api.get_object(brain) # Check if the ResultsRange field from sample contains values already From 6bc07133ba469b8234d4f001b74c4c7b61e2c30c Mon Sep 17 00:00:00 2001 From: Ramon Bartl Date: Tue, 4 Feb 2020 22:36:19 +0100 Subject: [PATCH 5/5] typo fixed --- bika/lims/upgrade/v01_03_003.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bika/lims/upgrade/v01_03_003.py b/bika/lims/upgrade/v01_03_003.py index 67ade02f68..89e491fc97 100644 --- a/bika/lims/upgrade/v01_03_003.py +++ b/bika/lims/upgrade/v01_03_003.py @@ -662,7 +662,7 @@ def install_senaite_core_spotlight(portal): """ qi = api.get_tool("portal_quickinstaller") profile = "senaite.core.spotlight" - if profile not in qi.listInstallableProfile(): + if profile not in qi.listInstallableProfiles(): logger.error("Profile '{}' not found. Forgot to run buildout?" .format(profile)) return