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

Allow to set a custom comment for when a result is out of range #2369

Merged
merged 9 commits into from
Sep 1, 2023
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 @@ -4,6 +4,7 @@ Changelog
2.5.0 (unreleased)
------------------

- #2369 Allow to set a custom comment for when a result is out of range
- #2367 Contact catalog
- #2366 Add fallback to sample client field value
- #2365 New function for interim fields formatting
Expand Down
5 changes: 4 additions & 1 deletion src/bika/lims/browser/fields/resultrangefield.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@
("warn_max", _('Max warn')),
("hidemin", _('< Min')),
("hidemax", _('> Max')),
("rangecomment", _('Range Comment')),
("rangecomment", _(
u"label_specs_rangecomment",
default=u"Out of range comment"
)),
)


Expand Down
40 changes: 29 additions & 11 deletions src/bika/lims/browser/widgets/analysisspecificationwidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,35 +88,53 @@ def __init__(self, context, request):
"sortable": False}),
("warn_min", {
"title": _("Min warn"),
"sortable": False}),
"sortable": False,
"type": "numeric",
}),
("min_operator", {
"title": _("Min operator"),
"type": "choices",
"sortable": False}),
"sortable": False,
}),
("min", {
"title": _("Min"),
"sortable": False}),
"sortable": False,
"type": "numeric",
}),
("max_operator", {
"title": _("Max operator"),
"type": "choices",
"sortable": False}),
"sortable": False,
}),
("max", {
"title": _("Max"),
"sortable": False}),
"sortable": False,
"type": "numeric",
}),
("warn_max", {
"title": _("Max warn"),
"sortable": False}),
"sortable": False,
"type": "numeric",
}),
("hidemin", {
"title": _("< Min"),
"sortable": False}),
"sortable": False,
"type": "numeric",
}),
("hidemax", {
"title": _("> Max"),
"sortable": False}),
"sortable": False,
"type": "numeric",
}),
("rangecomment", {
"title": _("Range comment"),
"title": _(
u"label_specs_rangecomment",
default=u"Out of range comment"
),
"sortable": False,
"type": "remarks",
"toggle": False}),
"type": "string",
"size": "30",
}),
))

self.review_states = [
Expand Down
21 changes: 14 additions & 7 deletions src/bika/lims/content/analysisspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,20 @@
widget=AnalysisSpecificationWidget(
label=_("Specifications"),
description=_(
"'Min' and 'Max' values indicate a valid results range. Any "
"result outside this results range will raise an alert. 'Min "
"warn' and 'Max warn' values indicate a shoulder range. Any "
"result outside the results range but within the shoulder "
"range will raise a less severe alert. If the result is out of "
"range, the value set for '< Min' or '< Max' will be displayed "
"in lists and results reports instead of the real result.")
u"description_analysisspec_resultsrange",
default=u"'Min' and 'Max' values indicate a valid results "
u"range. Any result outside this results range will "
u"raise an alert.<br/>"
u"'Min warn' and 'Max warn' values indicate a "
u"shoulder range. Any result outside the results "
u"range but within the shoulder range will raise a "
u"less severe alert.<br/>"
u"If the result is out of range, the value set for "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

somehow the description in the UI is cropped at this point (Maybe because of the starting single quote in the next line?).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot reproduce 🤔 . It is displayed correctly to me:

Captura de 2023-09-01 14-39-34

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even when I shrink the window:

Captura de 2023-09-01 14-41-27

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, it does not seem like a browser issue, because the text is even cropped in the HTML:

Add Analysis Specification — SENAITE LIMS 2023-09-01 2 PM-45-27

It appears to me even for new created sites when adding a new specification.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Umm..

Captura de 2023-09-01 15-10-28

These are my versions:

Captura de 2023-09-01 15-11-27

u"'&lt; Min' or '&gt; Max' will be displayed in lists "
u"and results reports instead of the real result. In "
u"such case, the value set for 'Out of range comment' "
u"will be displayed in results report as well"
)
),
),
))
Expand Down
2 changes: 1 addition & 1 deletion src/senaite/core/browser/static/bundles/senaite.core.css

Large diffs are not rendered by default.

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions webpack/app/scss/forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ form.senaite-form,
form[name='analysisrequest_add_form'],
form[action*='-controlpanel'],
form[name='sampleheader_form'],
form[name='listing_form'],
form[name='edit_form'] {
form[name='edit_form'] :not(.ajax-contents-table) div > {
input, select {
width: auto;
}
Expand Down