Skip to content

Commit

Permalink
Extended REsultOptions with time series column metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejmets committed Sep 4, 2024
1 parent c7adb2f commit f290805
Showing 1 changed file with 48 additions and 6 deletions.
54 changes: 48 additions & 6 deletions src/bika/lims/content/abstractbaseanalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,19 +641,15 @@
schemata="Result Options",
widget=StringWidget(
label=_("Graph Title"),
description=_(
"Title that appears above the time series graph"
)
description=_("Title that appears above the time series graph")
)
)
GraphXAxisTitle = StringField(
"GraphXAxisTitle",
schemata="Result Options",
widget=StringWidget(
label=_("Graph X-Axis Title"),
description=_(
"Title that appears on the X-Axis of the time series graph"
)
description=_("Title that appears on the X-Axis of the time series graph")
)
)
GraphYAxisTitle = StringField(
Expand All @@ -666,6 +662,51 @@
)
)
)
TimeSeriesColumns = RecordsField(
"TimeSeriesColumns",
schemata="Result Options",
subfields=(
"ColumnType",
"ColumnTitle",
"ColumnDataType",
),
subfield_labels={'ColumnType': _("Column Type"),
'ColumnTitle': _("Column Title"),
'ColumnDataType': _("Column Data Type"),
},
subfield_validators={},
subfield_types={'ColumnType': "string",
'ColumnTitle': "string",
'ColumnDataType': "string",
},
subfield_sizes={'ColumnType': 1,
# 'ColumnTitle': 25,
'ColumnDataType': 1,
},
subfield_maxlength={'ColumnType': 1,
'ColumnTitle': 25,
'ColumnDataType': 1,
},
subfield_vocabularies={
"ColumnType": DisplayList((
('index', _('Index')),
('data', _('Data')),
('average', _('Average')),
)),
"ColumnDataType": DisplayList((
('float', _('Float')),
('number', _('Number')),
('date', _('Date')),
)),
},
widget=RecordsWidget(
label=_("Time Series Columns"),
description=_(
"List of possible final results. When set, no custom result is "
"allowed on results entry and user has to choose from these values"
),
)
)

# TODO Remove ResultOptionsType field. It was Replaced by ResultType
ResultOptionsType = StringField(
Expand Down Expand Up @@ -839,6 +880,7 @@
GraphTitle,
GraphXAxisTitle,
GraphYAxisTitle,
TimeSeriesColumns,
ResultOptionsType,
ResultOptionsSorting,
Hidden,
Expand Down

0 comments on commit f290805

Please sign in to comment.