Skip to content

Commit

Permalink
finalish commit
Browse files Browse the repository at this point in the history
  • Loading branch information
leftmove authored Dec 8, 2023
1 parent ea17f71 commit 891a3b8
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 106 deletions.
90 changes: 0 additions & 90 deletions backend/routers/filer.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,96 +292,6 @@ async def estimate(cik: str):
raise HTTPException(404, detail="Error fetching time estimation.")


# @router.get("/aggregate", tags=["filers"], status_code=201)
# async def migrate_filers(password: str):
# if password != os.environ["ADMIN_PASSWORD"]:
# raise HTTPException(
# 403,
# detail="Incorrect password, access is forbidden. This route is meant for admins.",
# )

# directory = "../submissions"
# count = 0
# for filename in scandir(directory):
# try:
# with open(filename, "r") as submission:
# filer = json.load(submission)

# if "submissions" in filename.name:
# filings = filer
# filer_dir = f"{directory}/{filename.name[:13]}.json"
# with open(filer_dir, "r") as submission:
# filer = json.load(submission)
# else:
# filings = filer["filings"]["recent"]

# cik = filer["cik"]
# found_filer = companies.database.find_one({"cik": filer["cik"]})

# if found_filer == None:
# name = filer["name"]
# form_types = filings["form"]
# if "13F-HR" in form_types:
# 13f = True
# print(f"Found 13F-HR filing for {name} ({count})")
# else:
# 13f = False

# new_filer = {
# "name": name,
# "cik": cik,
# "tickers": filer["tickers"],
# "exchanges": filer["exchanges"],
# "sic": filer["sic"],
# "ein": filer["ein"],
# "13f": 13f,
# "description": filer["description"],
# "sic_description": filer["sicDescription"],
# "website": filer["website"],
# "category": filer["category"],
# "phone": filer["phone"],
# "addresses": filer["addresses"],
# "former_names": filer["formerNames"],
# }
# companies.insert_one(new_filer)

# except Exception as e:
# print("Failed...", e)
# count += 1


# @router.websocket("/raw")
# async def raw(websocket: WebSocket, cik: str):
# websocket.accept()

# try:
# pipeline = [
# {"$match": {"cik": cik}},
# {"$project": {"log.logs": 1}},
# ]
# cursor = main.watch(pipeline)
# # stream = cursor.collect()
# # async with cursor as stream:
# # while stream.alive:
# # change = stream.try_next()
# # print(change)

# # asyncio.sleep(3)
# # cursor = watch_logs(pipeline)

# async with cursor as stream:
# async for change in stream:
# print(change)

# asyncio.sleep(3)
# except Exception as e:
# print(e)
# websocket.send_text("Error.")
# raise HTTPException(404, detail="Error fetching logs.")

# websocket.send_text("Connected.")


@cache(1 / 6)
@router.get("/info", tags=["filers"], status_code=200)
async def filer_info(cik: str):
Expand Down
34 changes: 21 additions & 13 deletions frontend/components/Filer/Info.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,27 @@ const Info = (props) => {
expand ? styles["sub-header-expanded"] : "",
].join(" ")}
>
<div className={styles["secondary-header"]}>
<span
className={[styles["secondary-header-desc"], font.className].join(
" "
)}
>
{info?.cik}{" "}
{info?.tickers.length ? `(${info?.tickers.join(", ")})` : ""}
</span>
{info?.data.description ? (
<Expand onClick={() => setExpand(!expand)} expandState={expand} />
) : null}
<Source cik={cik} />
<div className={styles["secondary-headers"]}>
<div className={styles["secondary-header"]}>
<span
className={[
styles["secondary-header-desc"],
font.className,
].join(" ")}
>
{info?.cik}{" "}
{info?.tickers.length ? `(${info?.tickers.join(", ")})` : ""}
</span>
</div>
<div className={styles["secondary-header"]}>
{info?.data.description ? (
<Expand
onClick={() => setExpand(!expand)}
expandState={expand}
/>
) : null}
<Source cik={cik} />
</div>
</div>
<span className={[styles["header-desc"], font.className].join(" ")}>
{info?.data?.description}
Expand Down
1 change: 0 additions & 1 deletion frontend/components/Source/Source.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

.source-button:hover {
color: var(--primary-dark);
scale: 1.1;
}

.source-light {
Expand Down
8 changes: 6 additions & 2 deletions frontend/styles/Filer.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
}

.main-header-text {
font-size: 4rem;
font-size: 3rem;
color: var(--secondary);
}

Expand All @@ -47,6 +47,11 @@
margin-bottom: 0px;
}

.secondary-headers {
display: flex;
justify-content: space-between;
}

.secondary-header {
display: flex;
justify-content: flex-start;
Expand All @@ -55,7 +60,6 @@

.secondary-header-desc {
color: var(--secondary);
margin-right: 10px;
}

.header-desc {
Expand Down

0 comments on commit 891a3b8

Please sign in to comment.