Skip to content

Commit 8145d39

Browse files
author
Adrian Herrmann
committed
fix after merge
1 parent 7fbd300 commit 8145d39

59 files changed

Lines changed: 3421 additions & 929 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

dist/actions/curve.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@ const selectCurve = payload => ({
1010
payload
1111
});
1212
exports.selectCurve = selectCurve;
13-
const setAllCurves = payload => ({
13+
const setAllCurves = (payload, meta) => ({
1414
type: _action_type.CURVE.SET_ALL_CURVES,
15-
payload
15+
payload,
16+
...(meta && typeof meta === 'object' ? {
17+
meta
18+
} : {})
1619
});
1720
exports.setAllCurves = setAllCurves;
1821
const toggleShowAllCurves = payload => ({

dist/actions/integration.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Object.defineProperty(exports, "__esModule", {
44
value: true
55
});
6-
exports.sweepIntegration = exports.setIntegrationFkr = exports.clearIntegrationAll = void 0;
6+
exports.sweepIntegration = exports.splitIntegration = exports.setIntegrationFkr = exports.removeVisualSplitLine = exports.clearIntegrationAll = exports.addVisualSplitLine = void 0;
77
var _action_type = require("../constants/action_type");
88
const sweepIntegration = payload => ({
99
type: _action_type.INTEGRATION.SWEEP,
@@ -19,6 +19,21 @@ const clearIntegrationAll = payload => ({
1919
type: _action_type.INTEGRATION.CLEAR_ALL,
2020
payload
2121
});
22+
exports.clearIntegrationAll = clearIntegrationAll;
23+
const splitIntegration = payload => ({
24+
type: _action_type.INTEGRATION.SPLIT,
25+
payload
26+
});
27+
exports.splitIntegration = splitIntegration;
28+
const addVisualSplitLine = payload => ({
29+
type: _action_type.INTEGRATION.ADD_VISUAL_SPLIT,
30+
payload
31+
});
32+
exports.addVisualSplitLine = addVisualSplitLine;
33+
const removeVisualSplitLine = payload => ({
34+
type: _action_type.INTEGRATION.RM_VISUAL_SPLIT,
35+
payload
36+
});
2237

2338
// eslint-disable-line
24-
exports.clearIntegrationAll = clearIntegrationAll;
39+
exports.removeVisualSplitLine = removeVisualSplitLine;

dist/actions/ui.js

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,37 @@
33
Object.defineProperty(exports, "__esModule", {
44
value: true
55
});
6-
exports.setUiViewerType = exports.setUiSweepType = exports.selectUiSweep = exports.scrollUiWheel = exports.restoreSweepExtent = exports.clickUiTarget = void 0;
6+
exports.setUiViewerType = exports.setUiSweepType = exports.selectUiSweep = exports.scrollUiWheel = exports.restoreSweepExtent = exports.displaySubViewerAt = exports.clickUiTarget = void 0;
77
var _action_type = require("../constants/action_type");
8-
const setUiViewerType = payload => ({
9-
type: _action_type.UI.VIEWER.SET_TYPE,
10-
payload
11-
});
12-
exports.setUiViewerType = setUiViewerType;
13-
const setUiSweepType = (payload, jcampIdx = 0) => ({
8+
var _list_ui = require("../constants/list_ui");
9+
var _integration_draft = require("../helpers/integration_draft.js");
10+
// eslint-disable-line import/extensions
11+
12+
const keepIntegrationMode = (jcampIdx = 0) => ({
1413
type: _action_type.UI.SWEEP.SET_TYPE,
15-
payload,
14+
payload: _list_ui.LIST_UI_SWEEP_TYPE.INTEGRATION_ADD,
1615
jcampIdx
1716
});
17+
const setUiViewerType = payload => {
18+
if (!(0, _integration_draft.confirmCancelPendingIntegration)()) {
19+
return keepIntegrationMode();
20+
}
21+
return {
22+
type: _action_type.UI.VIEWER.SET_TYPE,
23+
payload
24+
};
25+
};
26+
exports.setUiViewerType = setUiViewerType;
27+
const setUiSweepType = (payload, jcampIdx = 0) => {
28+
if (payload !== _list_ui.LIST_UI_SWEEP_TYPE.INTEGRATION_ADD && !(0, _integration_draft.confirmCancelPendingIntegration)()) {
29+
return keepIntegrationMode(jcampIdx);
30+
}
31+
return {
32+
type: _action_type.UI.SWEEP.SET_TYPE,
33+
payload,
34+
jcampIdx
35+
};
36+
};
1837
exports.setUiSweepType = setUiSweepType;
1938
const selectUiSweep = payload => ({
2039
type: _action_type.UI.SWEEP.SELECT,
@@ -31,17 +50,26 @@ const restoreSweepExtent = payload => ({
3150
payload
3251
});
3352
exports.restoreSweepExtent = restoreSweepExtent;
34-
const clickUiTarget = (payload, onPeak, voltammetryPeakIdx, jcampIdx, onPecker) => {
53+
const clickUiTarget = (payload, onPeak, voltammetryPeakIdx, jcampIdx, onPecker, sourceHint) => {
3554
const action = {
3655
type: _action_type.UI.CLICK_TARGET,
3756
payload,
3857
onPeak,
3958
voltammetryPeakIdx: voltammetryPeakIdx ?? 0,
40-
onPecker: onPecker ?? false
59+
onPecker: onPecker ?? false,
60+
sourceHint: sourceHint ?? null
4161
};
4262
if (Number.isFinite(jcampIdx)) {
4363
action.jcampIdx = jcampIdx;
4464
}
4565
return action;
4666
};
47-
exports.clickUiTarget = clickUiTarget;
67+
exports.clickUiTarget = clickUiTarget;
68+
const displaySubViewerAt = payload => ({
69+
type: _action_type.UI.SUB_VIEWER.DISPLAY_VIEWER_AT,
70+
payload: payload == null ? {
71+
x: null,
72+
y: null
73+
} : payload
74+
});
75+
exports.displaySubViewerAt = displaySubViewerAt;

dist/app.js

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "FN", {
1010
return _fn.default;
1111
}
1212
});
13-
exports.SpectraEditor = void 0;
13+
exports.store = exports.SpectraEditor = void 0;
1414
var _react = _interopRequireDefault(require("react"));
1515
var _reactRedux = require("react-redux");
1616
var _redux = require("redux");
@@ -33,8 +33,13 @@ var _jsxRuntime = require("react/jsx-runtime");
3333
const sagaMiddleware = (0, _reduxSaga.default)();
3434
const middlewares = [sagaMiddleware]; // logger
3535

36-
const store = (0, _redux.compose)((0, _redux.applyMiddleware)(...middlewares))(_redux.createStore)(_index.default);
37-
sagaMiddleware.run(_index2.default);
36+
const store = exports.store = (0, _redux.compose)((0, _redux.applyMiddleware)(...middlewares))(_redux.createStore)(_index.default);
37+
try {
38+
sagaMiddleware.run(_index2.default);
39+
} catch (error) {
40+
// Keep startup failure visible without crashing silently.
41+
console.error('[SpectraEditor] Failed to start sagas', error); // eslint-disable-line no-console
42+
}
3843

3944
// - - - helper - - -
4045
const ensureQuillDelta = descs => {
@@ -45,6 +50,10 @@ const ensureQuillDelta = descs => {
4550
};
4651

4752
// - - - React - - -
53+
// LC/MS: when `onLcmsPageRequest` is set, the host (e.g. ELN) must reload `multiEntities`
54+
// with MS data for the requested RT/polarity. Triggers include `user_click`, `initial`,
55+
// and `tic_polarity` (TIC polarity dropdown). The standalone demo in `src/index.js`
56+
// implements a local mock via `buildLcmsStandaloneMultiEntities`.
4857
const SpectraEditor = ({
4958
entity,
5059
others,
@@ -64,7 +73,8 @@ const SpectraEditor = ({
6473
entityFileNames,
6574
userManualLink,
6675
curveIdx,
67-
sweepExtent
76+
sweepExtent,
77+
onLcmsPageRequest
6878
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRedux.Provider, {
6979
store: store,
7080
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.StyledEngineProvider, {
@@ -88,7 +98,8 @@ const SpectraEditor = ({
8898
editorOnly: editorOnly,
8999
exactMass: exactMass,
90100
canChangeDescription: canChangeDescription,
91-
onDescriptionChanged: onDescriptionChanged
101+
onDescriptionChanged: onDescriptionChanged,
102+
onLcmsPageRequest: onLcmsPageRequest
92103
})
93104
})
94105
});
@@ -111,6 +122,7 @@ SpectraEditor.propTypes = {
111122
editorOnly: _propTypes.default.bool,
112123
canChangeDescription: _propTypes.default.bool,
113124
onDescriptionChanged: _propTypes.default.func,
125+
onLcmsPageRequest: _propTypes.default.func,
114126
userManualLink: _propTypes.default.object,
115127
exactMass: _propTypes.default.string
116128
};
@@ -119,8 +131,8 @@ SpectraEditor.defaultProps = {
119131
others: [],
120132
addOthersCb: false
121133
},
122-
multiEntities: false,
123-
entityFileNames: false,
134+
multiEntities: [],
135+
entityFileNames: [],
124136
cLabel: '',
125137
xLabel: '',
126138
yLabel: '',
@@ -132,5 +144,6 @@ SpectraEditor.defaultProps = {
132144
multiMolSvgs: [],
133145
editorOnly: false,
134146
canChangeDescription: false,
135-
userManualLink: {}
147+
userManualLink: {},
148+
onLcmsPageRequest: null
136149
};

dist/components/cmd_bar/01_viewer.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,13 @@ const Viewer = ({
4040
className: "txt-sv-tp",
4141
children: "Spectrum Viewer"
4242
}),
43-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_common.MuButton, {
44-
className: (0, _classnames.default)((0, _common.focusStyle)(isfocusSpectrumSt, classes), 'btn-sv-bar-spctrum'),
45-
onClick: onViewSpectrum,
46-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TimelineOutlined.default, {
47-
className: classes.icon
43+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
44+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_common.MuButton, {
45+
className: (0, _classnames.default)((0, _common.focusStyle)(isfocusSpectrumSt, classes), 'btn-sv-bar-spctrum'),
46+
onClick: onViewSpectrum,
47+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TimelineOutlined.default, {
48+
className: classes.icon
49+
})
4850
})
4951
})
5052
}), hideCmdAnaViewerSt || disableCmdAnaViewerSt ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {

dist/components/cmd_bar/03_peak.js

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ var _list_ui = require("../../constants/list_ui");
2020
var _tri_btn = _interopRequireDefault(require("./tri_btn"));
2121
var _edit_peak = require("../../actions/edit_peak");
2222
var _extractPeaksEdit = require("../../helpers/extractPeaksEdit");
23+
var _hplc_ms = require("../../actions/hplc_ms");
24+
var _list_layout = require("../../constants/list_layout");
2325
var _jsxRuntime = require("react/jsx-runtime");
2426
/* eslint-disable prefer-object-spread, function-paren-newline, no-unused-vars,
2527
react/function-component-definition, react/require-default-props, max-len,
@@ -36,27 +38,32 @@ const Peak = ({
3638
isFocusSetRefSt,
3739
disableSetRefSt,
3840
isHandleMaxAndMinPeaksSt,
39-
cyclicVotaSt,
41+
cyclicVoltaState,
4042
curveSt,
4143
clearAllPeaksAct,
4244
feature,
4345
editPeakSt,
4446
thresSt,
4547
shiftSt,
46-
layoutSt
48+
layoutSt,
49+
clearAllPeaksHplcMsAct
4750
}) => {
4851
let onSweepPeakAdd = () => setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.PEAK_ADD);
49-
let onSweepPeakDELETE = () => setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.PEAK_DELETE);
52+
let onSweepPeakDelete = () => setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.PEAK_DELETE);
5053
let onSweepAnchorShift = () => setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.ANCHOR_SHIFT);
5154
const {
5255
curveIdx
5356
} = curveSt;
5457
const onClearAll = () => {
55-
const dataPeaks = (0, _extractPeaksEdit.extractAutoPeaks)(feature, thresSt, shiftSt, layoutSt);
56-
clearAllPeaksAct({
57-
curveIdx,
58-
dataPeaks
59-
});
58+
if (layoutSt === _list_layout.LIST_LAYOUT.LC_MS) {
59+
clearAllPeaksHplcMsAct();
60+
} else {
61+
const dataPeaks = (0, _extractPeaksEdit.extractAutoPeaks)(feature, thresSt, shiftSt, layoutSt);
62+
clearAllPeaksAct({
63+
curveIdx,
64+
dataPeaks
65+
});
66+
}
6067
};
6168
const showAddPeak = !disableAddPeakSt;
6269
const showRmPeak = !disableRmPeakSt;
@@ -68,18 +75,18 @@ const Peak = ({
6875
if (isHandleMaxAndMinPeaksSt) {
6976
const {
7077
spectraList
71-
} = cyclicVotaSt;
78+
} = cyclicVoltaState;
7279
const spectra = spectraList[curveIdx];
7380
if (spectra) {
7481
const {
7582
isWorkMaxPeak
7683
} = spectra;
7784
if (isWorkMaxPeak) {
7885
onSweepPeakAdd = () => setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.CYCLIC_VOLTA_ADD_MAX_PEAK, curveIdx);
79-
onSweepPeakDELETE = () => setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.CYCLIC_VOLTA_RM_MAX_PEAK, curveIdx);
86+
onSweepPeakDelete = () => setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.CYCLIC_VOLTA_RM_MAX_PEAK, curveIdx);
8087
} else {
8188
onSweepPeakAdd = () => setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.CYCLIC_VOLTA_ADD_MIN_PEAK, curveIdx);
82-
onSweepPeakDELETE = () => setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.CYCLIC_VOLTA_RM_MIN_PEAK, curveIdx);
89+
onSweepPeakDelete = () => setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.CYCLIC_VOLTA_RM_MIN_PEAK, curveIdx);
8390
}
8491
onSweepAnchorShift = () => setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.CYCLIC_VOLTA_SET_REF, curveIdx);
8592
}
@@ -157,7 +164,7 @@ const mapStateToProps = (state, props) => (
157164
isFocusSetRefSt: state.ui.sweepType === _list_ui.LIST_UI_SWEEP_TYPE.ANCHOR_SHIFT || state.ui.sweepType === _list_ui.LIST_UI_SWEEP_TYPE.CYCLIC_VOLTA_SET_REF,
158165
disableSetRefSt: _cfg.default.btnCmdSetRef(state.layout),
159166
isHandleMaxAndMinPeaksSt: !_cfg.default.hidePanelCyclicVolta(state.layout),
160-
cyclicVotaSt: state.cyclicvolta,
167+
cyclicVoltaState: state.cyclicvolta,
161168
curveSt: state.curve,
162169
editPeakSt: state.editPeak.present,
163170
thresSt: state.threshold.list[state.curve.curveIdx],
@@ -166,7 +173,8 @@ const mapStateToProps = (state, props) => (
166173
});
167174
const mapDispatchToProps = dispatch => (0, _redux.bindActionCreators)({
168175
setUiSweepTypeAct: _ui.setUiSweepType,
169-
clearAllPeaksAct: _edit_peak.clearAllPeaks
176+
clearAllPeaksAct: _edit_peak.clearAllPeaks,
177+
clearAllPeaksHplcMsAct: _hplc_ms.clearAllPeaksHplcMs
170178
}, dispatch);
171179
Peak.propTypes = {
172180
classes: _propTypes.default.object.isRequired,
@@ -178,13 +186,14 @@ Peak.propTypes = {
178186
disableSetRefSt: _propTypes.default.bool.isRequired,
179187
setUiSweepTypeAct: _propTypes.default.func.isRequired,
180188
isHandleMaxAndMinPeaksSt: _propTypes.default.bool.isRequired,
181-
cyclicVotaSt: _propTypes.default.object.isRequired,
189+
cyclicVoltaState: _propTypes.default.object.isRequired,
182190
curveSt: _propTypes.default.object.isRequired,
183191
clearAllPeaksAct: _propTypes.default.func.isRequired,
184192
feature: _propTypes.default.object.isRequired,
185193
editPeakSt: _propTypes.default.object.isRequired,
186194
thresSt: _propTypes.default.object.isRequired,
187195
layoutSt: _propTypes.default.string.isRequired,
188-
shiftSt: _propTypes.default.object.isRequired
196+
shiftSt: _propTypes.default.object.isRequired,
197+
clearAllPeaksHplcMsAct: _propTypes.default.func.isRequired
189198
};
190199
var _default = exports.default = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps), (0, _withStyles.default)(styles))(Peak);

0 commit comments

Comments
 (0)