Skip to content

Commit

Permalink
Minor PR cleanup after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
illusional committed Sep 26, 2023
1 parent a6718aa commit 25ad76c
Show file tree
Hide file tree
Showing 4 changed files with 217 additions and 230 deletions.
1 change: 1 addition & 0 deletions api/routes/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from pydantic import BaseModel
from starlette.responses import StreamingResponse

from api.utils.dates import parse_date_only_string
from api.utils.db import (
Connection,
get_project_readonly_connection,
Expand Down
17 changes: 16 additions & 1 deletion regenerate_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,28 @@ def _get_openapi_version():
# require two different ways to get the version
version_cmds = ['--version', 'version']

has_timeout = False
for version_cmd in version_cmds:
command = [*OPENAPI_COMMAND, version_cmd]
try:
return subprocess.check_output(command, stderr=subprocess.PIPE, timeout=5)
return subprocess.check_output(command, stderr=subprocess.PIPE, timeout=10)

except subprocess.TimeoutExpired:
has_timeout = True
# sometimes a timeout means that it's waiting for stdin because openapi
# is misconfigured, so try the next command and then tell the user
continue

except subprocess.CalledProcessError:
continue

if has_timeout:
command = ' '.join(*OPENAPI_COMMAND, version_cmds[-1])
raise ValueError(
'Could not get version of openapi as the command timed out, this might '
f'mean openapi is misconfigured. Try running "{command}" in your terminal.'
)

raise ValueError('Could not get version of openapi')


Expand Down
16 changes: 1 addition & 15 deletions web/src/pages/billing/BillingDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ const BillingDashboard: React.FunctionComponent = () => {
const [end, setEnd] = React.useState<string>('2022-10-31')

return (
<Card fluid style={{ backgroundColor: '#EFECEA' }}>
<Card fluid style={{ padding: "20px" }}>
<div
style={{
backgroundColor: '#F5F3F2',
marginTop: 20,
paddingTop: 20,
marginBottom: 20,
Expand All @@ -20,24 +19,11 @@ const BillingDashboard: React.FunctionComponent = () => {
style={{
fontSize: 50,
marginLeft: 20,
color: '#635F5D',
}}
>
Billing Dashboard
</div>
<br />
<div
style={{
fontSize: 24,
marginBottom: 10,
marginLeft: 20,
marginTop: 5,
color: '#8E8883',
fontStyle: 'italic',
}}
>
Breakdown of proportional allocation of costs per project over time
</div>
</div>
<SeqrProportionalMapGraph start={start} end={end} />
</Card>
Expand Down
Loading

0 comments on commit 25ad76c

Please sign in to comment.