diff --git a/package-lock.json b/package-lock.json index 2c643b3b3..34b8ae016 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "cohort360_react", - "version": "2.21.1", + "version": "2.21.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "cohort360_react", - "version": "2.21.1", + "version": "2.21.2", "dependencies": { "@apollo/client": "^3.7.10", "@apollo/react-hooks": "^4.0.0", diff --git a/package.json b/package.json index 5e5d9f09e..3bbd8233e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cohort360_react", - "version": "2.21.1", + "version": "2.21.2", "private": true, "dependencies": { "@apollo/client": "^3.7.10", diff --git a/src/components/CreationCohort/DiagramView/components/TemporalConstraintCard/TemporalConstraintCard.tsx b/src/components/CreationCohort/DiagramView/components/TemporalConstraintCard/TemporalConstraintCard.tsx index 5bef3bf87..3e9a2ad3f 100644 --- a/src/components/CreationCohort/DiagramView/components/TemporalConstraintCard/TemporalConstraintCard.tsx +++ b/src/components/CreationCohort/DiagramView/components/TemporalConstraintCard/TemporalConstraintCard.tsx @@ -1,5 +1,5 @@ import React, { useState, useEffect } from 'react' -import { Button, Badge } from '@mui/material' +import { Button, Badge, Tooltip } from '@mui/material' import { buildCohortCreation, deleteTemporalConstraint } from 'state/cohortCreation' import { useAppSelector, useAppDispatch } from 'state' @@ -89,16 +89,20 @@ const TemporalConstraint: React.FC = () => { ) : ( - + + + + + )} {modalIsOpen && } diff --git a/src/components/CreationCohort/DiagramView/components/TemporalConstraintCard/components/EventSequenceTable/EventSequenceTable.tsx b/src/components/CreationCohort/DiagramView/components/TemporalConstraintCard/components/EventSequenceTable/EventSequenceTable.tsx index e046ebdc9..72a769227 100644 --- a/src/components/CreationCohort/DiagramView/components/TemporalConstraintCard/components/EventSequenceTable/EventSequenceTable.tsx +++ b/src/components/CreationCohort/DiagramView/components/TemporalConstraintCard/components/EventSequenceTable/EventSequenceTable.tsx @@ -132,7 +132,8 @@ const EventSequenceTable: React.FC<{ temporalConstraints: TemporalConstraintsTyp - {!temporalConstraints || temporalConstraints.length === 0 ? ( + {!temporalConstraints || + temporalConstraints.filter((constraints) => !constraints.idList.includes('All' as never)).length === 0 ? ( diff --git a/src/components/CreationCohort/DiagramView/components/TemporalConstraintCard/components/TemporalConstraintConfig/TemporalConstraintConfig.tsx b/src/components/CreationCohort/DiagramView/components/TemporalConstraintCard/components/TemporalConstraintConfig/TemporalConstraintConfig.tsx index d32277c72..16a5b448f 100644 --- a/src/components/CreationCohort/DiagramView/components/TemporalConstraintCard/components/TemporalConstraintConfig/TemporalConstraintConfig.tsx +++ b/src/components/CreationCohort/DiagramView/components/TemporalConstraintCard/components/TemporalConstraintConfig/TemporalConstraintConfig.tsx @@ -61,7 +61,7 @@ const TemporalConstraintConfig: React.FC<{ const [noSelectedConstraintError, setNoSelectedConstraintError] = useState(false) const [incorrectTimingError, setIncorrectTimingError] = useState(false) - const getSelectableCriteria = (firstCriteriaSelected: any) => { + const getSelectableCriteria = (firstCriteriaSelected: number | null) => { const mainGroupCriteriaIds = criteriaGroup[0].criteriaIds // remove criteria types that cannot be part of a temporal constraint @@ -82,7 +82,9 @@ const TemporalConstraintConfig: React.FC<{ }, [] as number[]) // retrieves criteria that are not forbidden - const selectableCriteria = selectableCriteriaTypes.filter((criteria) => !forbiddenCriteriaIds.includes(criteria.id)) + const selectableCriteria = selectableCriteriaTypes + .filter((criteria) => !forbiddenCriteriaIds.includes(criteria.id)) + .filter((criteria) => criteria.id !== firstCriteriaSelected) return selectableCriteria }