Skip to content

Commit

Permalink
Remove hardcoded Drogon field/case selection
Browse files Browse the repository at this point in the history
  • Loading branch information
HansKallekleiv committed Nov 1, 2023
1 parent a18e3c4 commit 2fa6baf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 24 deletions.
25 changes: 2 additions & 23 deletions backend/src/backend/primary/routers/explore.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,30 +57,9 @@ async def get_cases(
sumo_discovery = SumoExplore(authenticated_user.get_sumo_access_token())
case_info_arr = await sumo_discovery.get_cases(field_identifier=field_identifier)

print(case_info_arr)

# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# Sumo Explorer + Drogon + SMRY data is still a work in progress!
# Present the single DROGON case that we know to be good as the first item, also prefixing it with "GOOD"
ret_arr: List[CaseInfo] = []
if field_identifier == "DROGON":
for case_info in case_info_arr:
if case_info.uuid == "10f41041-2c17-4374-a735-bb0de62e29dc":
ret_arr.insert(
0,
CaseInfo(
uuid=case_info.uuid,
name=f"GOOD -- {case_info.name}",
status=case_info.status,
user=case_info.user,
),
)
else:
ret_arr.append(
CaseInfo(uuid=case_info.uuid, name=case_info.name, status=case_info.status, user=case_info.user)
)
else:
ret_arr = [CaseInfo(uuid=ci.uuid, name=ci.name, status=ci.status, user=ci.user) for ci in case_info_arr]

ret_arr = [CaseInfo(uuid=ci.uuid, name=ci.name, status=ci.status, user=ci.user) for ci in case_info_arr]

return ret_arr

Expand Down
1 change: 0 additions & 1 deletion backend/src/services/sumo_access/sumo_explore.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ async def get_fields(self) -> List[FieldInfo]:
field_idents.append(field.get("identifier"))

field_idents = sorted(list(set(field_idents)))
field_idents.insert(0, field_idents.pop(field_idents.index("DROGON")))
return [FieldInfo(identifier=field_ident) for field_ident in field_idents]

async def get_cases(self, field_identifier: str) -> List[CaseInfo]:
Expand Down

0 comments on commit 2fa6baf

Please sign in to comment.