Skip to content

Commit

Permalink
SCKAN-259 chore: Merge with develop
Browse files Browse the repository at this point in the history
  • Loading branch information
afonsobspinto committed Feb 15, 2024
2 parents ac0952d + 83c7201 commit 83848ce
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down
5 changes: 2 additions & 3 deletions backend/composer/services/cs_ingestion/helpers.py
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Pages/StatementDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<Grid p={6} container>
{loading && (
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/helpers/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ paths:
- rejected
- revise
- to_be_reviewed
- invalid
explode: true
style: form
- in: query
Expand Down

0 comments on commit 83848ce

Please sign in to comment.