Skip to content
Draft
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
4 changes: 2 additions & 2 deletions .github/workflows/e2e_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ jobs:
- name: Cypress run
uses: cypress-io/github-action@v6
with:
build: npm run build
start: npm start
build: npm run --max_old_space_size=12288 build
start: npm --max_old_space_size=12288 start
browser: chrome
8 changes: 7 additions & 1 deletion cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import { defineConfig } from "cypress";

export default defineConfig({
pageLoadTimeout: 100000,
requestTimeout: 100000,
responseTimeout: 100000,
e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
},
experimentalStudio: true
experimentalStudio: true,
pageLoadTimeout: 100000,
requestTimeout: 100000,
responseTimeout: 100000,
},
});
2 changes: 1 addition & 1 deletion cypress/e2e/nmr1h_spec.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe('NMR 1H', () => {
cy.get('.btn-sv-bar-spctrum').click()
cy.get('.input-sv-bar-layout').click()
cy.get('.option-sv-bar-layout').should($li => {
expect($li).to.have.length(24)
expect($li).to.have.length(25)
})
cy.get('ul li:nth-child(9)').click()

Expand Down
40 changes: 40 additions & 0 deletions dist/actions/hplc_ms.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.updateCurrentPageValue = exports.selectWavelength = exports.clearIntegrationAllHplcMs = exports.clearAllPeaksHplcMs = exports.changeTic = void 0;
var _action_type = require("../constants/action_type");
const selectWavelength = payload => ({
type: _action_type.HPLC_MS.UPDATE_UVVIS_WAVE_LENGTH,
payload
});
exports.selectWavelength = selectWavelength;
const changeTic = payload => {
const isNegative = payload.target.value === 1;
const action = {
type: _action_type.HPLC_MS.SELECT_TIC_CURVE,
payload: {
isNegative
}
};
return action;
};
exports.changeTic = changeTic;
const updateCurrentPageValue = currentPageValue => ({
type: _action_type.HPLC_MS.UPDATE_CURRENT_PAGE_VALUE,
payload: {
currentPageValue
}
});
exports.updateCurrentPageValue = updateCurrentPageValue;
const clearIntegrationAllHplcMs = payload => ({
type: _action_type.HPLC_MS.CLEAR_INTEGRATION_ALL_HPLCMS,
payload
});
exports.clearIntegrationAllHplcMs = clearIntegrationAllHplcMs;
const clearAllPeaksHplcMs = payload => ({
type: _action_type.HPLC_MS.CLEAR_ALL_PEAKS_HPLCMS,
payload
});
exports.clearAllPeaksHplcMs = clearAllPeaksHplcMs;
34 changes: 13 additions & 21 deletions dist/actions/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,11 @@ const setUiViewerType = payload => ({
payload
});
exports.setUiViewerType = setUiViewerType;
const setUiSweepType = function (payload) {
let jcampIdx = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
return {
type: _action_type.UI.SWEEP.SET_TYPE,
payload,
jcampIdx
};
};
const setUiSweepType = (payload, jcampIdx = 0) => ({
type: _action_type.UI.SWEEP.SET_TYPE,
payload,
jcampIdx
});
exports.setUiSweepType = setUiSweepType;
const selectUiSweep = payload => ({
type: _action_type.UI.SWEEP.SELECT,
Expand All @@ -29,17 +26,12 @@ const scrollUiWheel = payload => ({
payload
});
exports.scrollUiWheel = scrollUiWheel;
const clickUiTarget = function (payload, onPeak) {
let voltammetryPeakIdx = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
let jcampIdx = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
let onPecker = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
return {
type: _action_type.UI.CLICK_TARGET,
payload,
onPeak,
voltammetryPeakIdx,
jcampIdx,
onPecker
};
};
const clickUiTarget = (payload, onPeak, voltammetryPeakIdx = 0, jcampIdx = 0, onPecker = false) => ({
type: _action_type.UI.CLICK_TARGET,
payload,
onPeak,
voltammetryPeakIdx,
jcampIdx,
onPecker
});
exports.clickUiTarget = clickUiTarget;
89 changes: 43 additions & 46 deletions dist/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Object.defineProperty(exports, "FN", {
return _fn.default;
}
});
exports.SpectraEditor = void 0;
exports.store = exports.SpectraEditor = void 0;
var _react = _interopRequireDefault(require("react"));
var _reactRedux = require("react-redux");
var _redux = require("redux");
Expand All @@ -32,7 +32,7 @@ var _fn = _interopRequireDefault(require("./fn"));
const sagaMiddleware = (0, _reduxSaga.default)();
const middlewares = [sagaMiddleware]; // logger

const store = (0, _redux.compose)((0, _redux.applyMiddleware)(...middlewares))(_redux.createStore)(_index.default);
const store = exports.store = (0, _redux.compose)((0, _redux.applyMiddleware)(...middlewares))(_redux.createStore)(_index.default);
sagaMiddleware.run(_index2.default);

// - - - helper - - -
Expand All @@ -44,50 +44,47 @@ const ensureQuillDelta = descs => {
};

// - - - React - - -
const SpectraEditor = _ref => {
let {
entity,
others,
cLabel,
xLabel,
yLabel,
operations,
forecast,
molSvg,
editorOnly,
descriptions,
theoryMass,
canChangeDescription,
onDescriptionChanged,
multiEntities,
multiMolSvgs,
entityFileNames,
userManualLink
} = _ref;
return /*#__PURE__*/_react.default.createElement(_reactRedux.Provider, {
store: store
}, /*#__PURE__*/_react.default.createElement(_material.StyledEngineProvider, {
injectFirst: true
}, /*#__PURE__*/_react.default.createElement(_layer_init.default, {
entity: entity,
multiEntities: multiEntities,
entityFileNames: entityFileNames,
userManualLink: userManualLink,
others: others,
cLabel: cLabel,
xLabel: xLabel,
yLabel: yLabel,
forecast: forecast,
operations: operations,
descriptions: ensureQuillDelta(descriptions),
molSvg: molSvg,
multiMolSvgs: multiMolSvgs,
editorOnly: editorOnly,
theoryMass: theoryMass,
canChangeDescription: canChangeDescription,
onDescriptionChanged: onDescriptionChanged
})));
};
const SpectraEditor = ({
entity,
others,
cLabel,
xLabel,
yLabel,
operations,
forecast,
molSvg,
editorOnly,
descriptions,
theoryMass,
canChangeDescription,
onDescriptionChanged,
multiEntities,
multiMolSvgs,
entityFileNames,
userManualLink
}) => /*#__PURE__*/_react.default.createElement(_reactRedux.Provider, {
store: store
}, /*#__PURE__*/_react.default.createElement(_material.StyledEngineProvider, {
injectFirst: true
}, /*#__PURE__*/_react.default.createElement(_layer_init.default, {
entity: entity,
multiEntities: multiEntities,
entityFileNames: entityFileNames,
userManualLink: userManualLink,
others: others,
cLabel: cLabel,
xLabel: xLabel,
yLabel: yLabel,
forecast: forecast,
operations: operations,
descriptions: ensureQuillDelta(descriptions),
molSvg: molSvg,
multiMolSvgs: multiMolSvgs,
editorOnly: editorOnly,
theoryMass: theoryMass,
canChangeDescription: canChangeDescription,
onDescriptionChanged: onDescriptionChanged
})));
exports.SpectraEditor = SpectraEditor;
SpectraEditor.propTypes = {
entity: _propTypes.default.object.isRequired,
Expand Down
17 changes: 8 additions & 9 deletions dist/components/cmd_bar/01_viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@ var _list_ui = require("../../constants/list_ui");
/* eslint-disable prefer-object-spread, react/function-component-definition */

const styles = () => Object.assign({}, _common.commonStyle);
const Viewer = _ref => {
let {
classes,
isfocusSpectrumSt,
isfocusAnalysisSt,
hideCmdAnaViewerSt,
disableCmdAnaViewerSt,
setUiViewerTypeAct
} = _ref;
const Viewer = ({
classes,
isfocusSpectrumSt,
isfocusAnalysisSt,
hideCmdAnaViewerSt,
disableCmdAnaViewerSt,
setUiViewerTypeAct
}) => {
const onViewSpectrum = () => setUiViewerTypeAct(_list_ui.LIST_UI_VIEWER_TYPE.SPECTRUM);
const onViewAnalysis = () => setUiViewerTypeAct(_list_ui.LIST_UI_VIEWER_TYPE.ANALYSIS);
return /*#__PURE__*/_react.default.createElement("span", {
Expand Down
11 changes: 5 additions & 6 deletions dist/components/cmd_bar/02_zoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ var _list_ui = require("../../constants/list_ui");
/* eslint-disable prefer-object-spread, react/function-component-definition */

const styles = () => Object.assign({}, _common.commonStyle);
const Zoom = _ref => {
let {
classes,
isfocusZoomSt,
setUiSweepTypeAct
} = _ref;
const Zoom = ({
classes,
isfocusZoomSt,
setUiSweepTypeAct
}) => {
const onSweepZoomIn = () => setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.ZOOMIN);
const onSweepZoomReset = () => setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.ZOOMRESET);
return /*#__PURE__*/_react.default.createElement("span", {
Expand Down
62 changes: 35 additions & 27 deletions dist/components/cmd_bar/03_peak.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,43 +20,49 @@ var _list_ui = require("../../constants/list_ui");
var _tri_btn = _interopRequireDefault(require("./tri_btn"));
var _edit_peak = require("../../actions/edit_peak");
var _extractPeaksEdit = require("../../helpers/extractPeaksEdit");
var _hplc_ms = require("../../actions/hplc_ms");
var _list_layout = require("../../constants/list_layout");
/* eslint-disable prefer-object-spread, function-paren-newline, no-unused-vars,
react/function-component-definition, react/require-default-props, max-len,
react/no-unused-prop-types */

const styles = () => Object.assign({}, _common.commonStyle);
const Peak = _ref => {
let {
classes,
setUiSweepTypeAct,
isFocusAddPeakSt,
disableAddPeakSt,
isFocusRmPeakSt,
disableRmPeakSt,
isFocusSetRefSt,
disableSetRefSt,
isHandleMaxAndMinPeaksSt,
cyclicVotaSt,
curveSt,
clearAllPeaksAct,
feature,
editPeakSt,
thresSt,
shiftSt,
layoutSt
} = _ref;
const Peak = ({
classes,
setUiSweepTypeAct,
isFocusAddPeakSt,
disableAddPeakSt,
isFocusRmPeakSt,
disableRmPeakSt,
isFocusSetRefSt,
disableSetRefSt,
isHandleMaxAndMinPeaksSt,
cyclicVotaSt,
curveSt,
clearAllPeaksAct,
feature,
editPeakSt,
thresSt,
shiftSt,
layoutSt,
clearAllPeaksHplcMsAct
}) => {
let onSweepPeakAdd = () => setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.PEAK_ADD);
let onSweepPeakDELETE = () => setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.PEAK_DELETE);
let onSweepAnchorShift = () => setUiSweepTypeAct(_list_ui.LIST_UI_SWEEP_TYPE.ANCHOR_SHIFT);
const {
curveIdx
} = curveSt;
const onClearAll = () => {
const dataPeaks = (0, _extractPeaksEdit.extractAutoPeaks)(feature, thresSt, shiftSt, layoutSt);
clearAllPeaksAct({
curveIdx,
dataPeaks
});
if (layoutSt === _list_layout.LIST_LAYOUT.LC_MS) {
clearAllPeaksHplcMsAct();
} else {
const dataPeaks = (0, _extractPeaksEdit.extractAutoPeaks)(feature, thresSt, shiftSt, layoutSt);
clearAllPeaksAct({
curveIdx,
dataPeaks
});
}
};
if (isHandleMaxAndMinPeaksSt) {
const {
Expand Down Expand Up @@ -141,7 +147,8 @@ const mapStateToProps = (state, props) => (
});
const mapDispatchToProps = dispatch => (0, _redux.bindActionCreators)({
setUiSweepTypeAct: _ui.setUiSweepType,
clearAllPeaksAct: _edit_peak.clearAllPeaks
clearAllPeaksAct: _edit_peak.clearAllPeaks,
clearAllPeaksHplcMsAct: _hplc_ms.clearAllPeaksHplcMs
}, dispatch);
Peak.propTypes = {
classes: _propTypes.default.object.isRequired,
Expand All @@ -160,6 +167,7 @@ Peak.propTypes = {
editPeakSt: _propTypes.default.object.isRequired,
thresSt: _propTypes.default.object.isRequired,
layoutSt: _propTypes.default.string.isRequired,
shiftSt: _propTypes.default.object.isRequired
shiftSt: _propTypes.default.object.isRequired,
clearAllPeaksHplcMsAct: _propTypes.default.func.isRequired
};
var _default = exports.default = (0, _redux.compose)((0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps), (0, _withStyles.default)(styles))(Peak);
Loading
Loading