Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate senaite.core.spotlight #1517

Merged
merged 6 commits into from
Feb 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Changelog

**Added**

- #1517 Integrate senaite.core.spotlight
- #1516 Consider analyses with result options or string in duplicate valid range
- #1515 Moved Setup View into Core
- #1506 Specification non-compliant viewlet in Sample
Expand Down
14 changes: 14 additions & 0 deletions bika/lims/profiles/default/actions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,20 @@
</property>
<property name="visible">True</property>
</object>
<!-- Search -->
<object name="spotlight_search" meta_type="CMF Action" i18n:domain="plone">
<property name="title" i18n:translate="">Search</property>
<property name="description" i18n:translate=""/>
<property name="url_expr">string:${globals_view/navigationRootUrl}/spotlight</property>
<property name="link_target"/>
<property name="icon_expr"/>
<property name="available_expr"/>
<property name="permissions">
<element value="View"/>
</property>
<property name="visible">True</property>
</object>
<!-- Audit Log -->
<object name="auditlog" meta_type="CMF Action" i18n:domain="plone">
<property name="title" i18n:translate="">Audit Log</property>
<property name="description" i18n:translate=""/>
Expand Down
21 changes: 20 additions & 1 deletion bika/lims/upgrade/v01_03_003.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -610,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
Expand Down Expand Up @@ -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.listInstallableProfiles():
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)
5 changes: 3 additions & 2 deletions buildout.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -43,6 +43,7 @@ develop = .

[sources]
senaite.core.listing = git git://github.com/senaite/senaite.core.listing.git [email protected]:senaite/senaite.core.listing.git branch=master
senaite.core.spotlight = git git://github.com/senaite/senaite.core.spotlight.git [email protected]:senaite/senaite.core.spotlight.git branch=master
senaite.core.supermodel = git git://github.com/senaite/senaite.core.supermodel.git [email protected]:senaite/senaite.core.supermodel.git branch=master

[instance]
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down