diff --git a/backend/composer/services/cs_ingestion/cs_ingestion_services.py b/backend/composer/services/cs_ingestion/cs_ingestion_services.py index f4bc4d14..a540cfeb 100644 --- a/backend/composer/services/cs_ingestion/cs_ingestion_services.py +++ b/backend/composer/services/cs_ingestion/cs_ingestion_services.py @@ -339,10 +339,10 @@ def get_circuit_type(statement: Dict): if statement[CIRCUIT_TYPE]: if len(statement[CIRCUIT_TYPE]) > 1: logger_service.add_anomaly(LoggableAnomaly(statement[ID], None, f'Multiple circuit types found')) - return CIRCUIT_TYPE_MAPPING.get(statement[CIRCUIT_TYPE][0], CircuitType.UNKNOWN) + return CIRCUIT_TYPE_MAPPING.get(statement[CIRCUIT_TYPE][0], None) else: logger_service.add_anomaly(LoggableAnomaly(statement[ID], None, f'No circuit type found.')) - return CircuitType.UNKNOWN + return None def get_phenotype(statement: Dict) -> Optional[Phenotype]: diff --git a/backend/composer/services/cs_ingestion/helpers.py b/backend/composer/services/cs_ingestion/helpers.py index ee42fbc7..7016e6ad 100644 --- a/backend/composer/services/cs_ingestion/helpers.py +++ b/backend/composer/services/cs_ingestion/helpers.py @@ -1,8 +1,7 @@ import logging -from typing import Optional, Dict from composer.enums import CircuitType -from composer.models import AnatomicalEntity, ConnectivityStatement +from composer.models import AnatomicalEntity ID = "id" ORIGINS = "origins" @@ -26,7 +25,7 @@ "http://uri.interlex.org/tgbugs/uris/readable/ProjectionPhenotype": CircuitType.PROJECTION, "http://uri.interlex.org/tgbugs/uris/readable/MotorPhenotype": CircuitType.MOTOR, "http://uri.interlex.org/tgbugs/uris/readable/SensoryPhenotype": CircuitType.SENSORY, - "": CircuitType.UNKNOWN + "": None } VALIDATION_ERRORS = "validation_errors" diff --git a/frontend/src/Pages/StatementDetails.tsx b/frontend/src/Pages/StatementDetails.tsx index ac8652a6..59d0424a 100644 --- a/frontend/src/Pages/StatementDetails.tsx +++ b/frontend/src/Pages/StatementDetails.tsx @@ -116,7 +116,7 @@ const StatementDetails = () => { //TODO add logic for isDisabled // TODO add an extra check for invalid state; - const isDisabled = statement?.state === statementStates.Exported; + const isDisabled = statement?.state === statementStates.Exported || statement?.state === statementStates.Invalid; return ( {loading && ( diff --git a/frontend/src/helpers/helpers.ts b/frontend/src/helpers/helpers.ts index 65cc289a..304df2e9 100644 --- a/frontend/src/helpers/helpers.ts +++ b/frontend/src/helpers/helpers.ts @@ -132,7 +132,7 @@ export const StatementsLabels = { [statementStates.Exported]: "Exported", [statementStates.InProgress]: "In progress", [statementStates.Invalid]: "invalid", - [statementStates.NpoApproved]: "NPO approved", + [statementStates.NpoApproved]: "NPO approval", [statementStates.Rejected]: "Reject", [statementStates.Revise]: "Revise", [statementStates.ToBeReviewed]: "To be reviewed", diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml index 7a573af1..9b2b1d3d 100644 --- a/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -162,6 +162,7 @@ paths: - rejected - revise - to_be_reviewed + - invalid explode: true style: form - in: query