Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ridz1208 committed Nov 26, 2024
1 parent 60b2f0c commit 4645a8a
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 22 deletions.
2 changes: 1 addition & 1 deletion modules/biobank/jsx/containerDisplay.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import {useEffect} from 'react';
import PropTypes from 'prop-types';
import Swal from 'sweetalert2';

Expand Down Expand Up @@ -438,6 +437,7 @@ ContainerDisplay.propTypes = {
container: PropTypes.shape({
id: PropTypes.number.isRequired,
parentContainerId: PropTypes.number,
childContainerIds: PropTypes.array,
coordinate: PropTypes.string.isRequired,
}).isRequired,
selectedCoordinate: PropTypes.string.isRequired,
Expand Down
2 changes: 1 addition & 1 deletion modules/biobank/jsx/containerParentForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {clone} from './helpers';
* Fetches data from Loris backend and displays a form allowing
* to specimen a biobank file attached to a specific instrument
*
* @param props The component's props
* @param {object} props The component's props
*/
function ContainerParentForm(props) {
const {data, current, options} = props;
Expand Down
2 changes: 1 addition & 1 deletion modules/biobank/jsx/customFields.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
/**
* Biobank Custom Attribute Fields
*
* @param props The component's props.
* @param {object} props The component's props.
*/
function CustomFields(props) {
const {options, errors, fields, object} = props;
Expand Down
23 changes: 12 additions & 11 deletions modules/biobank/jsx/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import ContainerParentForm from './containerParentForm';
/**
* Biobank Globals Component
*
* @param props The component's props
* @param {object} props - The component's props
*/
function Globals(props) {
const {current, data, editable, options, specimen, container} = props;
Expand Down Expand Up @@ -414,10 +414,11 @@ Globals.propTypes = {
parentContainerId: PropTypes.number,
typeId: PropTypes.number.isRequired,
coordinate: PropTypes.string,
statusId: PropTypes.number, // Added
temperature: PropTypes.number, // Added
statusId: PropTypes.number,
temperature: PropTypes.number,
lotNumber: PropTypes.string,
expirationDate: PropTypes.string,
comments: PropTypes.string,
}).isRequired,
specimen: PropTypes.shape({
poolId: PropTypes.number,
Expand All @@ -432,7 +433,7 @@ Globals.propTypes = {
parentSpecimenBarcodes: PropTypes.arrayOf(PropTypes.string),
}).isRequired,
}).isRequired,

data: PropTypes.shape({
pools: PropTypes.array.isRequired,
containers: PropTypes.arrayOf(
Expand All @@ -449,7 +450,7 @@ Globals.propTypes = {
})
).isRequired,
}).isRequired,

editable: PropTypes.shape({
containerType: PropTypes.func.isRequired,
fTCycle: PropTypes.func.isRequired,
Expand All @@ -459,7 +460,7 @@ Globals.propTypes = {
temperature: PropTypes.func.isRequired, // Added
status: PropTypes.func.isRequired, // Added
}).isRequired,

options: PropTypes.shape({
specimen: PropTypes.shape({
typeUnits: PropTypes.string,
Expand Down Expand Up @@ -509,7 +510,7 @@ Globals.propTypes = {
})
), // Assuming based on errors
}).isRequired,

specimen: PropTypes.shape({
typeId: PropTypes.number.isRequired,
poolId: PropTypes.number,
Expand All @@ -522,7 +523,7 @@ Globals.propTypes = {
parentSpecimenIds: PropTypes.arrayOf(PropTypes.number),
parentSpecimenBarcodes: PropTypes.arrayOf(PropTypes.string),
}).isRequired,

container: PropTypes.shape({
centerId: PropTypes.number,
shipmentBarcodes: PropTypes.arrayOf(PropTypes.string),
Expand All @@ -534,7 +535,7 @@ Globals.propTypes = {
temperature: PropTypes.number, // Added
comments: PropTypes.string, // Added
}).isRequired,

updateContainer: PropTypes.func.isRequired,
editContainer: PropTypes.func.isRequired,
setContainer: PropTypes.func.isRequired,
Expand All @@ -553,7 +554,7 @@ Globals.propTypes = {
getBarcodePathDisplay: PropTypes.func.isRequired,
setSpecimen: PropTypes.func.isRequired,
uC: PropTypes.any.isRequired, // Added based on error

errors: PropTypes.shape({
container: PropTypes.shape({
typeId: PropTypes.string,
Expand Down Expand Up @@ -584,7 +585,7 @@ function Item(props) {

Item.propTypes = {
children: PropTypes.node.isRequired,
}
};

/**
* Inline Field
Expand Down
2 changes: 1 addition & 1 deletion modules/biobank/jsx/lifeCycle.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import PropTypes from 'prop-types';
import PropTypes from 'prop-types';

/**
* LifeCycle component.
Expand Down
17 changes: 11 additions & 6 deletions modules/biobank/jsx/shipmentTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ import {get} from './helpers.js';
/**
* Returns a JSX component for the shipment tab of the module
*
* @param {object} data - the data to display
* @param {callback} setData - a callback to set data
* @param {object} options - values for select options?
* @param data.setData
* @param data.options
* @param {object} props - the parameters
* @param {object} props.data - the data to display
* @param {function} props.setData - a callback to set data
* @param {object} props.options - values for select options?
* @return {JSX}
*/
function ShipmentTab({
Expand Down Expand Up @@ -103,6 +102,7 @@ function ShipmentTab({
</td>
);
}
return <td></td>;
default:
return <td>{value}</td>;
}
Expand Down Expand Up @@ -208,6 +208,10 @@ ShipmentTab.propTypes = {

// Options prop: Configuration options for shipment, specimen, container, etc.
options: PropTypes.shape({
shipment: PropTypes.shape({
statuses: PropTypes.object,
types: PropTypes.object,
}),
specimen: PropTypes.shape({
units: PropTypes.string.isRequired, // Added based on error
types: PropTypes.arrayOf(
Expand Down Expand Up @@ -236,6 +240,7 @@ ShipmentTab.propTypes = {
centers: PropTypes.arrayOf(PropTypes.string).isRequired,
projects: PropTypes.arrayOf(PropTypes.string).isRequired,
candidates: PropTypes.arrayOf(PropTypes.string).isRequired,
users: PropTypes.object,
sessions: PropTypes.arrayOf(PropTypes.string).isRequired,
candidateSessions: PropTypes.arrayOf(PropTypes.string).isRequired,
}).isRequired,
Expand Down Expand Up @@ -603,7 +608,7 @@ ReceiveShipment.propTypes = {
*
* @param {object} props - the parameters
* @param {object} props.log - the log
* @param {callback} props.setLog - a callback for when the log is set
* @param {function} props.setLog - a callback for when the log is set
* @param {object} props.errors - a list of errors
* @param {object} props.users - a list of selectable users
* @return {JSX}
Expand Down
8 changes: 7 additions & 1 deletion modules/biobank/jsx/specimenTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class SpecimenTab extends Component {
// check if container has be queried
if (
Object.values(data.containers)
.find((container) => container.barcode == value)
.find((container) => container.barcode == value)
) {
return <td><Link to={`/barcode=${value}`}>{value}</Link></td>;
}
Expand Down Expand Up @@ -409,6 +409,11 @@ class SpecimenTab extends Component {
SpecimenTab.propTypes = {
options: PropTypes.shape({
specimen: PropTypes.shape({
attributes: PropTypes.arrayOf(
PropTypes.shape({
label: PropTypes.string.isRequired,
})
),
units: PropTypes.string, // Added based on errors
types: PropTypes.arrayOf(
PropTypes.shape({
Expand All @@ -430,6 +435,7 @@ SpecimenTab.propTypes = {
typeContainerTypes: PropTypes.arrayOf(PropTypes.string).isRequired, // Added based on previous propTypes
}).isRequired,
container: PropTypes.shape({
types: PropTypes.obj,
typesPrimary: PropTypes.arrayOf(
PropTypes.shape({
label: PropTypes.string.isRequired,
Expand Down

0 comments on commit 4645a8a

Please sign in to comment.