Skip to content

Commit

Permalink
adjustment to support just ETA
Browse files Browse the repository at this point in the history
  • Loading branch information
ab-smith committed Oct 7, 2024
1 parent b0b128a commit 9a5c97a
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions backend/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -867,20 +867,25 @@ def get_timeline_info(self, request):
entries = []
colorMap = {}
for ac in AppliedControl.objects.all():
if ac.start_date and ac.eta:
startDate = convert_date_to_timestamp(ac.start_date)
startDate = None
endDate = None
if ac.eta:
endDate = convert_date_to_timestamp(ac.eta)
entries.append(
{
"startDate": startDate,
"endDate": endDate,
"name": ac.name,
"description": ac.description
if ac.description
else "(no description)",
"domain": ac.folder.name,
}
)
if ac.start_date:
startDate = convert_date_to_timestamp(ac.start_date)
else:
startDate = endDate
entries.append(
{
"startDate": startDate,
"endDate": endDate,
"name": ac.name,
"description": ac.description
if ac.description
else "(no description)",
"domain": ac.folder.name,
}
)
for domain in Folder.objects.all():
colorMap[domain.name] = gen_random_html_color()
return Response({"entries": entries, "colorMap": colorMap})
Expand Down

0 comments on commit 9a5c97a

Please sign in to comment.