Skip to content

Commit

Permalink
fixed issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ridz1208 committed Dec 2, 2024
1 parent 0e295ae commit 3406c63
Show file tree
Hide file tree
Showing 11 changed files with 3,891 additions and 8,786 deletions.
12,444 changes: 3,719 additions & 8,725 deletions modules/biobank/js/biobankIndex.js

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions modules/biobank/jsx/barcodePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,29 +424,29 @@ class BarcodePage extends Component {

BarcodePage.propTypes = {
data: PropTypes.shape({
containers: PropTypes.array.isRequired,
specimens: PropTypes.array.isRequired,
pools: PropTypes.array.isRequired,
}).isRequired,
containers: PropTypes.array,
specimens: PropTypes.array,
pools: PropTypes.array,
}),
options: PropTypes.shape({
container: PropTypes.shape({
dimensions: PropTypes.object,
stati: PropTypes.object,
}).isRequired,
}).isRequired,
updateContainer: PropTypes.func.isRequired,
updateSpecimen: PropTypes.func.isRequired,
printLabel: PropTypes.func.isRequired,
increaseCoordinate: PropTypes.func.isRequired,
createSpecimens: PropTypes.func.isRequired,
loading: PropTypes.bool.isRequired,
history: PropTypes.object.isRequired,
specimen: PropTypes.object.isRequired,
}),
}),
updateContainer: PropTypes.func,
updateSpecimen: PropTypes.func,
printLabel: PropTypes.func,
increaseCoordinate: PropTypes.func,
createSpecimens: PropTypes.func,
loading: PropTypes.bool,
history: PropTypes.object,
specimen: PropTypes.object,
container: PropTypes.shape({
statusId: PropTypes.number.isRequired,
statusId: PropTypes.number,
parentContainerId: PropTypes.number,
coordinate: PropTypes.string,
}).isRequired,
}),
};

export default BarcodePage;
4 changes: 3 additions & 1 deletion modules/biobank/jsx/biobankIndex.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import {Component} from 'react';
import {BrowserRouter, Route, Switch} from 'react-router-dom';
import PropTypes from 'prop-types';
import Swal from 'sweetalert2';

import BiobankFilter from './filter';
import BarcodePage from './barcodePage';

import {clone, isEmpty, get, getStream, post} from './helpers.js';

/**
* The main React entrypoint for the biobank module. This component
* renders the index page.
*/
class BiobankIndex extends React.Component {
class BiobankIndex extends Component {
/**
* Constructor
*/
Expand Down
2 changes: 1 addition & 1 deletion modules/biobank/jsx/containerDisplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function ContainerDisplay(props) {
const {
barcodes,
coordinates,
current,
current = {},
data,
dimensions,
editable,
Expand Down
24 changes: 12 additions & 12 deletions modules/biobank/jsx/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,18 @@ class BiobankFilter extends Component {
}

BiobankFilter.propTypes = {
data: PropTypes.object.isRequired,
options: PropTypes.object.isRequired,
saveBatchEdit: PropTypes.func.isRequired,
createPool: PropTypes.func.isRequired,
createSpecimens: PropTypes.func.isRequired,
updateSpecimens: PropTypes.func.isRequired,
editSpecimens: PropTypes.func.isRequired,
history: PropTypes.object.isRequired,
increaseCoordinate: PropTypes.func.isRequired,
loading: PropTypes.bool.isRequired,
createContainers: PropTypes.func.isRequired,
setData: PropTypes.func.isRequired,
data: PropTypes.object,
options: PropTypes.object,
saveBatchEdit: PropTypes.func,
createPool: PropTypes.func,
createSpecimens: PropTypes.func,
updateSpecimens: PropTypes.func,
editSpecimens: PropTypes.func,
history: PropTypes.object,
increaseCoordinate: PropTypes.func,
loading: PropTypes.bool,
createContainers: PropTypes.func,
setData: PropTypes.func,
};

export default BiobankFilter;
2 changes: 1 addition & 1 deletion modules/biobank/jsx/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ Header.propTypes = {
typeId: PropTypes.number.isRequired,
}).isRequired,
}).isRequired,
data: PropTypes.obj.isRequired,
data: PropTypes.obj,
setContainer: PropTypes.func.isRequired,
updateContainer: PropTypes.func.isRequired,
edit: PropTypes.func.isRequired,
Expand Down
2 changes: 1 addition & 1 deletion modules/biobank/jsx/processForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const SpecimenProcessForm = (props) => {
processStage,
typeId,
options,
errors,
errors = {},
edit,
} = props;

Expand Down
2 changes: 1 addition & 1 deletion modules/biobank/php/specimen.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ class Specimen implements
*/
public function getProjectIds() : array
{
return $this->projectIds;
return $this->projectIds ?? [];
}

/**
Expand Down
3 changes: 3 additions & 0 deletions modules/biobank/php/specimendao.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,8 @@ class SpecimenDAO extends \LORIS\Data\ProvisionerInstance
$projInsert['SpecimenID'] = $specimen->getId();
}

$this->_saveProject($specimen, $data);

return $this->getInstanceFromId($specimen->getId());
}

Expand Down Expand Up @@ -644,6 +646,7 @@ class SpecimenDAO extends \LORIS\Data\ProvisionerInstance
'Quantity' => $specimen->getQuantity(),
'UnitID' => $specimen->getUnitId(),
'SessionID' => $specimen->getSessionId(),
'SampleNumber' => $specimen->getSampleNumber(),
];

// I'd prefer a better way of doing this, but for now this is the simplest
Expand Down
Loading

0 comments on commit 3406c63

Please sign in to comment.