From 2c782bf4765d258e7901f8f34712e1af2e877f64 Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:17:32 +0000 Subject: [PATCH 001/141] edit_file --- frontend/pages/_document.js | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/frontend/pages/_document.js b/frontend/pages/_document.js index af632100..54be7681 100644 --- a/frontend/pages/_document.js +++ b/frontend/pages/_document.js @@ -1,13 +1,14 @@ -import { Html, Head, Main, NextScript } from "next/document"; - -export default function Document() { - return ( - - - -
- - - - ); -} +import { Html, Head, Main, NextScript } from "next/document"; +import { FC } from "react"; +const Document: FC = () => { + return ( + + + +
+ + + + ); +}; +export default Document; \ No newline at end of file From 874398c08b5cf7667627c95cca5353f6815d7b86 Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:17:33 +0000 Subject: [PATCH 002/141] change_file_extension # Commit trail: -> 2c782bf4765d258e7901f8f34712e1af2e877f64: edit_file --- frontend/pages/{_document.js => _document.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename frontend/pages/{_document.js => _document.ts} (100%) diff --git a/frontend/pages/_document.js b/frontend/pages/_document.ts similarity index 100% rename from frontend/pages/_document.js rename to frontend/pages/_document.ts From c59b4ab31647cc24f08e3457978af1da5fcaaba5 Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:17:37 +0000 Subject: [PATCH 003/141] edit_file --- frontend/components/fonts/index.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/frontend/components/fonts/index.js b/frontend/components/fonts/index.js index 30b4f487..24a702fc 100644 --- a/frontend/components/fonts/index.js +++ b/frontend/components/fonts/index.js @@ -1,7 +1,14 @@ import { Inter } from "@next/font/google"; -const font = Inter({ weight: "800", subsets: ["latin"] }); -const fontBold = Inter({ weight: "900", subsets: ["latin"] }); -const fontLight = Inter({ weight: "700", subsets: ["latin"] }); +type FontWeight = "700" | "800" | "900"; -export { font, fontBold, fontLight }; +interface FontOptions { + weight: FontWeight; + subsets: string[]; +} + +const font: FontOptions = Inter({ weight: "800", subsets: ["latin"] }); +const fontBold: FontOptions = Inter({ weight: "900", subsets: ["latin"] }); +const fontLight: FontOptions = Inter({ weight: "700", subsets: ["latin"] }); + +export { font, fontBold, fontLight }; \ No newline at end of file From c746beef3f05ef2f584b18402f53fb3f6cdba5df Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:17:38 +0000 Subject: [PATCH 004/141] change_file_extension # Commit trail: -> c59b4ab31647cc24f08e3457978af1da5fcaaba5: edit_file --- frontend/components/fonts/{index.js => index.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename frontend/components/fonts/{index.js => index.ts} (100%) diff --git a/frontend/components/fonts/index.js b/frontend/components/fonts/index.ts similarity index 100% rename from frontend/components/fonts/index.js rename to frontend/components/fonts/index.ts From 3edb9bd03c9379a7ae5270d1eca6af9cfebcc335 Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:17:39 +0000 Subject: [PATCH 005/141] edit_file --- frontend/pages/_app.js | 43 +++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/frontend/pages/_app.js b/frontend/pages/_app.js index f776283c..73e5c3d1 100644 --- a/frontend/pages/_app.js +++ b/frontend/pages/_app.js @@ -1,20 +1,25 @@ -import "@/styles/globals.css"; - -import Layout from "components/Layouts/Layout"; - -import { Inter } from "@next/font/google"; - -const font = Inter({ weight: "800", subsets: ["latin"] }); -const fontBold = Inter({ weight: "900", subsets: ["latin"] }); -const fontLight = Inter({ weight: "700", subsets: ["latin"] }); - -function App(props) { - const getLayout = - props.Component.getLayout || - (() => {}); - - return getLayout(props); -} - -export default App; +import "@/styles/globals.css"; + +import Layout from "components/Layouts/Layout"; + +import { Inter } from "@next/font/google"; + +const font: Inter = Inter({ weight: "800", subsets: ["latin"] }); +const fontBold: Inter = Inter({ weight: "900", subsets: ["latin"] }); +const fontLight: Inter = Inter({ weight: "700", subsets: ["latin"] }); + +interface AppProps { + Component: React.ComponentType & { getLayout?: (props: any) => JSX.Element }; + pageProps: any; +} + +function App(props: AppProps): JSX.Element { + const getLayout = + props.Component.getLayout || + (() => {}); + + return getLayout(props); +} + +export default App; export { font, fontBold, fontLight }; \ No newline at end of file From fee15fefd702a87c5beabe4f3d044ca3e2edbe12 Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:17:40 +0000 Subject: [PATCH 006/141] change_file_extension # Commit trail: -> 3edb9bd03c9379a7ae5270d1eca6af9cfebcc335: edit_file --- frontend/pages/{_app.js => _app.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename frontend/pages/{_app.js => _app.ts} (100%) diff --git a/frontend/pages/_app.js b/frontend/pages/_app.ts similarity index 100% rename from frontend/pages/_app.js rename to frontend/pages/_app.ts From 0df83c12394794d8de042172640421a44f9f93e2 Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:17:41 +0000 Subject: [PATCH 007/141] edit_file --- frontend/next.config.js | 67 +++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 32 deletions(-) diff --git a/frontend/next.config.js b/frontend/next.config.js index 58863662..2de6e9ea 100644 --- a/frontend/next.config.js +++ b/frontend/next.config.js @@ -1,32 +1,35 @@ -/** @type {import('next').NextConfig} */ - -const nextConfig = { - reactStrictMode: true, - webpack(config) { - const fileLoaderRule = config.module.rules.find((rule) => - rule.test?.test?.(".svg") - ); - - config.module.rules.push( - { - ...fileLoaderRule, - test: /\.svg$/i, - resourceQuery: /url/, - }, - { - test: /\.svg$/i, - issuer: /\.[jt]sx?$/, - resourceQuery: { not: /url/ }, - use: ["@svgr/webpack"], - } - ); - fileLoaderRule.exclude = /\.svg$/i; - return config; - }, - env: { - NEXT_PUBLIC_SERVER: "https://content.wallstreetlocal.com", - }, - output: "standalone", -}; - -module.exports = nextConfig; +import { NextConfig } from 'next'; +import { Configuration, RuleSetRule } from 'webpack'; + +const nextConfig: NextConfig = { + reactStrictMode: true, + webpack(config: Configuration) { + const fileLoaderRule = config.module?.rules?.find((rule) => + (rule as RuleSetRule).test?.test?.(".svg") + ) as RuleSetRule; + + config.module?.rules?.push( + { + ...fileLoaderRule, + test: /\.svg$/i, + resourceQuery: /url/, + }, + { + test: /\.svg$/i, + issuer: /\.[jt]sx?$/, + resourceQuery: { not: /url/ }, + use: ["@svgr/webpack"], + } + ); + if (fileLoaderRule) { + fileLoaderRule.exclude = /\.svg$/i; + } + return config; + }, + env: { + NEXT_PUBLIC_SERVER: "https://content.wallstreetlocal.com", + }, + output: "standalone", +}; + +export default nextConfig; \ No newline at end of file From e17817119a66009f9f44600ed2c1fee214b1b07f Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:17:42 +0000 Subject: [PATCH 008/141] change_file_extension # Commit trail: -> 0df83c12394794d8de042172640421a44f9f93e2: edit_file --- frontend/{next.config.js => next.config.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename frontend/{next.config.js => next.config.ts} (100%) diff --git a/frontend/next.config.js b/frontend/next.config.ts similarity index 100% rename from frontend/next.config.js rename to frontend/next.config.ts From 3805e94222d13eb4c72bda491681446a01aba1d5 Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:17:44 +0000 Subject: [PATCH 009/141] edit_file --- frontend/redux/store.js | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/frontend/redux/store.js b/frontend/redux/store.js index d6f57e3b..036f028d 100644 --- a/frontend/redux/store.js +++ b/frontend/redux/store.js @@ -1,18 +1,19 @@ -import { configureStore } from "@reduxjs/toolkit"; -import { createWrapper } from "next-redux-wrapper"; - -import { filerSlice } from "./filerSlice"; - -const makeStore = () => - configureStore({ - reducer: { - [filerSlice.name]: filerSlice.reducer, - }, - middleware: (getDefaultMiddleware) => - getDefaultMiddleware({ - serializableCheck: false, - }), - devTools: true, - }); - -export const wrapper = createWrapper(makeStore); +import { configureStore, EnhancedStore } from "@reduxjs/toolkit"; +import { createWrapper, Context, MakeStore } from "next-redux-wrapper"; +import { AnyAction, MiddlewareArray } from "@reduxjs/toolkit"; +import { filerSlice } from "./filerSlice"; +interface StoreState { + [key: string]: any; +} +const makeStore: MakeStore> = (context: Context) => + configureStore({ + reducer: { + [filerSlice.name]: filerSlice.reducer, + }, + middleware: (getDefaultMiddleware) => + getDefaultMiddleware({ + serializableCheck: false, + }) as MiddlewareArray, + devTools: true, + }); +export const wrapper = createWrapper>(makeStore); \ No newline at end of file From df1fc01d330dd5b63206d9d3d25ca4a26d019780 Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:17:45 +0000 Subject: [PATCH 010/141] change_file_extension # Commit trail: -> 3805e94222d13eb4c72bda491681446a01aba1d5: edit_file --- frontend/redux/{store.js => store.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename frontend/redux/{store.js => store.ts} (100%) diff --git a/frontend/redux/store.js b/frontend/redux/store.ts similarity index 100% rename from frontend/redux/store.js rename to frontend/redux/store.ts From 9c4a316f5ebd6dc81c8445db13720ca684131bf8 Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:19:56 +0000 Subject: [PATCH 011/141] edit_file --- frontend/redux/filerSlice.js | 1326 +++++++++++++++++----------------- 1 file changed, 667 insertions(+), 659 deletions(-) diff --git a/frontend/redux/filerSlice.js b/frontend/redux/filerSlice.js index d91fb74d..06062408 100644 --- a/frontend/redux/filerSlice.js +++ b/frontend/redux/filerSlice.js @@ -1,659 +1,667 @@ -import { createSlice, createSelector } from "@reduxjs/toolkit"; -import { HYDRATE } from "next-redux-wrapper"; - -const initialDate = new Date(); -const initialHeaders = [ - { - display: "Ticker", - sort: "ticker", - accessor: "ticker_str", - active: true, - tooltip: - "This is a unique series of letters assigned to a security for trading purposes", - }, - { - display: "Name", - sort: "name", - accessor: "name", - active: false, - tooltip: "The name of the stock.", - }, - { - display: "Class", - sort: "class", - accessor: "class", - active: false, - tooltip: - "This refers to the rights of a stockholder, including things like voting and dividends.", - }, - { - display: "Sector", - sort: "sector", - accessor: "sector", - active: false, - tooltip: "The broader industry category to which the stock belongs.", - }, - { - display: "CUSIP", - sort: "cusip", - accessor: "cusip", - active: false, - tooltip: - "A unique identifier assigned to each registered security in the United States and Canada.", - }, - { - display: "Shares Held", - sort: "shares_held", - accessor: "shares_held_str", - active: false, - tooltip: "The number of shares held, or the principal amount of the stock.", - }, - { - display: "Market Value", - sort: "market_value", - accessor: "market_value_str", - active: true, - tooltip: "The value for the shares of the stock the filer owns.", - }, - { - display: "% Portfolio", - sort: "portfolio_percent", - accessor: "portfolio_str", - active: true, - tooltip: - "The value of this stock's shares divided by the total value of the portfolio, expressed in percent. ( Value of Shares / Value of Portfolio )", - }, - { - display: "% Ownership", - sort: "ownership_percent", - accessor: "ownership_str", - active: false, - tooltip: - "The number of shares owned, divided by the current total of shares outstanding, expressed in percent. This value is only accurate the most value of shares outstanding. ( Shares Owned / Shares Existing )", - }, - { - display: "Sold Date", - sort: "sold_time", - accessor: "sold_str", - active: false, - tooltip: - "The date the stock was sold, taken by retrieving the report date of the last SEC filing said stock showed up on. This is only accurate up to the quarter.", - }, - { - display: "Buy Date", - sort: "buy_time", - accessor: "buy_str", - active: false, - tooltip: - "The date the stock was bought, according to the report date of the first SEC filing it appeared on. This is only accurate up to the quarter, and only the most recent bought date is shown.", - }, - { - display: "Price Paid", - sort: "buy_price", - accessor: "buy_price_str", - active: true, - tooltip: - "The price paid for the stock, estimated by taking a close price most near the quarter from which the stock was first reported.", - }, - { - display: "Recent Price", - sort: "recent_price", - accessor: "recent_price_str", - active: true, - tooltip: - "The recent price of the stock. This may be a couple days delayed.", - }, - { - display: "% Gain", - sort: "gain_percent", - accessor: "gain_str", - active: true, - tooltip: - "The price paid for the stock subtracted from the recent price, and then divided by price paid, expressed in percent. ( ( Recent Price - Price Paid ) / Price Paid )", - }, - { - display: "Industry", - sort: "industry", - accessor: "industry", - active: false, - tooltip: - "The specific sector or category of the economy in which the stock's company operates.", - }, - { - display: "Report Date", - sort: "report", - accessor: "report_str", - active: false, - tooltip: - "The report date listed on the SEC filing this stock was taken from.", - }, -]; -const initialComparisons = initialHeaders.map((h) => { - switch (h.sort) { - case "buy_price": - return { ...h, active: false }; - case "recent_price": - return { ...h, active: false }; - case "gain_percent": - return { ...h, active: false }; - default: - return h; - } -}); -const initialSort = { - sort: "ticker", - type: "string", - set: true, - na: false, - sold: false, - reverse: true, - pagination: 100, - limit: 100, - count: 0, - offset: 0, -}; -const initialState = { - cik: "", - value: [], - headers: initialHeaders, - tab: "stocks", - sort: initialSort, - filings: [], - timeline: { - comparisons: [ - { - type: "primary", - access: "", - filing: { - time: 0, - date: "", - }, - report: { - time: 0, - date: "", - }, - headers: initialComparisons, - sort: initialSort, - stocks: [], - }, - { - type: "secondary", - access: "", - filingTime: 0, - reportTime: 0, - filingDate: "", - reportDate: "", - headers: initialComparisons, - sort: initialSort, - stocks: [], - }, - ], - open: false, - }, - difference: { - headers: initialComparisons, - sort: initialSort, - stocks: [], - }, - dates: [ - { - year: initialDate.getFullYear(), - month: initialDate.getMonth(), - day: initialDate.getDate(), - timestamp: initialDate.getTime() / 1000, - open: false, - accessor: initialDate.toLocaleDateString(), - }, - ], -}; - -export const filerSlice = createSlice({ - name: "filer", - initialState, - reducers: { - setCik(state, action) { - Object.keys(initialState).map((k) => { - state[k] = initialState[k]; - }); - state.cik = action.payload; - - return state; - }, - setTab(state, action) { - const payload = action.payload; - state.tab = payload; - - return state; - }, - activateHeader(state, action) { - const headers = state.headers; - const payload = action.payload; - state.headers = headers.map((h) => - h.accessor === payload ? { ...h, active: !h.active } : h - ); - - return state; - }, - sortHeader(state, action) { - const payload = action.payload; - let type = "string"; - switch (payload.sort) { - case "name": - case "sector": - case "industry": - case "class": - case "cusip": - type = "string"; - break; - case "shares_held": - case "market_value": - case "portfolio_percent": - case "ownership_percent": - case "gain_percent": - case "recent_price": - case "buy_price": - case "report": - case "buy": - case "sold_time": - type = "number"; - break; - case "buy": - case "report": - case "sold_time": - type = "date"; - break; - default: - type = typeof payload.sort === "number" ? "number" : "string"; - break; - } - state.sort = { ...state.sort, ...payload, type: type }; - return state; - }, - sortActive(state) { - const sort = state.sort; - const set = sort.set; - state.sort = { ...sort, set: !set }; - - return state; - }, - addHeader(state, action) { - const payload = action.payload; - const headers = state.headers; - - headers.push({ - ...payload, - active: true, - }); - - state.headers = headers; - return state; - }, - editHeader(state, action) { - const payload = action.payload; - const headers = state.headers.map((h) => - h.accessor === payload.accessor ? { ...h, display: payload.display } : h - ); - - state.headers = headers; - return state; - }, - removeHeader(state, action) { - const payload = action.payload; - const headers = state.headers.filter((h) => h.accessor !== payload); - - state.headers = headers; - return state; - }, - setHeaders(state, action) { - const payload = action.payload; - state.headers = payload; - - return state; - }, - sortSold(state) { - const sort = state.sort; - const sold = sort.sold; - state.sort = { ...sort, sold: !sold }; - - return state; - }, - sortNa(state) { - const sort = state.sort; - const na = sort.na; - state.sort = { ...sort, na: !na }; - - return state; - }, - setStocks(state, action) { - const stocks = action.payload; - state.value = stocks; - return state; - }, - updateStocks(state, action) { - const payload = action.payload; - const field = payload.field; - const values = payload.values; - - let stocks = state.value; - stocks = stocks.map((stock) => { - const cusip = stock.cusip; - const value = values[cusip]; - - return { ...stock, [field]: value }; - }); - - state.value = stocks; - return state; - }, - addDate(state, action) { - const dates = state.dates; - dates.push(action.payload); - state.dates = dates; - - return state; - }, - removeDate(state, action) { - const accessor = action.payload; - const dates = state.dates; - state.dates = dates.filter((date) => date.accessor !== accessor); - return state; - }, - editDate(state, action) { - const payload = action.payload; - const dates = state.dates.map((date) => { - if (payload.accessor === date.accessor) { - let newDate = new Date(date.year, date.month, date.day); - switch (payload.type) { - case "year": - newDate.setFullYear(payload.value); - break; - case "month": - newDate.setMonth(payload.value); - break; - case "day": - newDate.setDate(payload.value); - break; - case "date": - newDate = new Date(payload.value); - break; - default: - break; - } - return { - year: newDate.getFullYear(), - month: newDate.getMonth(), - day: newDate.getDate(), - timestamp: newDate.getTime() / 1000, - open: true, - accessor: date.accessor, - }; - } else return date; - }); - state.dates = dates; - return state; - }, - updateDates(state, action) { - const payload = action.payload; - - // const over = payload.over; - // const accessor = payload.accessor; - // const active = dates.find((d) => d.accessor === accessor); - - // const activeIndex = dates.findIndex((d) => d.accessor === accessor); - // const overIndex = dates.findIndex((d) => d.accessor === over); - - // arrayMove() - - // dates.splice(activeIndex, 1); - // dates.splice(overIndex, 0, active); - - state.dates = payload; - return state; - }, - openDate(state, action) { - const payload = action.payload; - const accessor = payload.accessor; - const dates = state.dates.map((date) => - date.accessor === accessor ? { ...date, open: payload.open } : date - ); - state.dates = dates; - return state; - }, - newDate(state) { - const dates = state.dates; - const latestDate = dates.at(-1) || { - year: initialDate.getFullYear(), - month: initialDate.getMonth(), - day: initialDate.getDate(), - timestamp: initialDate.getTime() / 1000, - open: false, - accessor: initialDate.toLocaleDateString(), - }; - const newDate = new Date(latestDate.accessor); - newDate.setDate(newDate.getDate() + 1); - - dates.push({ - year: newDate.getFullYear(), - month: newDate.getMonth(), - day: newDate.getDate(), - timestamp: newDate.getTime() / 1000, - open: false, - accessor: newDate.toLocaleDateString(), - }); - - state.dates = dates; - return state; - }, - setPagination(state, action) { - state.sort.pagination = action.payload; - return state; - }, - setCount(state, action) { - const sort = state.sort; - const payload = action.payload; - const pagination = sort.pagination; - - if (pagination < 0) { - state.sort.pagination = payload > 100 ? 100 : payload; - } - - state.sort.count = payload; - return state; - }, - setFilingCount(state, action) { - const payload = action.payload; - const type = payload.type; - const count = payload.count; - - const comparisons = state.timeline.comparisons.map((c) => - c.type === type - ? { - ...c, - sort: { ...c.sort, pagination: count > 100 ? 100 : count, count }, - } - : c - ); - - state.timeline.comparisons = comparisons; - return state; - }, - setOffset(state, action) { - const payload = action.payload; - if (payload >= 0) { - state.sort.offset = Number(payload); - } - return state; - }, - setFilings(state, action) { - const payload = action.payload; - - state.filings = payload; - return state; - }, - setPrimary(state, action) { - const payload = action.payload; - - const comparisons = state.timeline.comparisons; - const primary = comparisons[0]; - state.timeline.comparisons[0] = { ...primary, ...payload }; - - return state; - }, - setSecondary(state, action) { - const payload = action.payload; - - const comparisons = state.timeline.comparisons; - const secondary = comparisons[1]; - state.timeline.comparisons[1] = { ...secondary, ...payload }; - - return state; - }, - setComparison(state, action) { - const payload = action.payload; - const type = payload.type; - const access = payload.access; - - const filing = state.filings.find((f) => f.access_number == access); - const filingDate = new Date(filing.filing_date * 1000); - const reportDate = new Date(filing.report_date * 1000); - const filingTime = filingDate.getTime() / 1000; - const reportTime = reportDate.getTime(); - const filingStr = filingDate.toLocaleDateString(); - const reportStr = reportDate.toLocaleDateString(); - const marketValue = new Intl.NumberFormat().format(filing.market_value); - const filingStocks = filing.stocks; - - const comparisonIndex = state.timeline.comparisons.findIndex( - (c) => c.type == type - ); - const comparison = state.timeline.comparisons[comparisonIndex]; - - state.timeline.comparisons[comparisonIndex] = { - ...comparison, - access, - filing: { - time: filingTime, - date: filingStr, - }, - report: { - time: reportTime, - date: reportStr, - }, - stocks: filingStocks, - value: marketValue, - }; - return state; - }, - setOpen(state) { - const open = state.timeline.open; - - state.timeline.open = !open; - return state; - }, - editComparison(state, action) { - const payload = action.payload; - const type = payload.type; - - const comparison = payload; - const comparisons = state.timeline.comparisons.map((c) => { - return c.type == type ? { ...c, ...comparison } : c; - }); - - state.timeline.comparisons = comparisons; - return state; - }, - editSort(state, action) { - const payload = action.payload; - const type = payload.type; - delete payload.type; - - const comparisons = state.timeline.comparisons.map((c) => { - return c.type == type ? { ...c, sort: { ...c.sort, ...payload } } : c; - }); - - state.timeline.comparisons = comparisons; - return state; - }, - editDifference(state, action) { - const payload = action.payload; - const difference = state.difference; - - state.difference = { ...difference, ...payload }; - return state; - }, - - [HYDRATE]: (state, action) => { - return { - ...state, - ...action.payload, - }; - }, - }, -}); - -export const selectCik = (state) => state.filer.cik; -export const selectTab = (state) => state.filer.tab; -export const selectSort = (state) => state.filer.sort; -export const selectActive = (state) => state.filer.sort.set; -export const selectSold = (state) => state.filer.sort.sold; -export const selectNa = (state) => state.filer.sort.na; -export const selectHeaders = (state) => state.filer.headers; -export const selectStocks = createSelector( - [(state) => state.filer.value], - (stocks) => stocks -); -export const selectDates = createSelector( - [(state) => state.filer.dates], - (dates) => - dates.map((d) => { - return { ...d, id: d.accessor }; - }) -); -export const selectPagination = createSelector( - [(state) => state.filer.sort], - (sort) => { - return { limit: sort.pagination, offset: sort.offset, count: sort.count }; - } -); -export const selectTimeline = (state) => state.filer.timeline; -export const selectFilings = (state) => state.filer.filings; -export const selectPrimary = (state) => state.filer.timeline.comparisons[0]; -export const selectSecondary = (state) => state.filer.timeline.comparisons[1]; -export const selectDifference = (state) => state.filer.difference; - -export const { - setCik, - setTab, - activateHeader, - addHeader, - editHeader, - sortHeader, - sortActive, - sortSold, - sortNa, - updateStocks, - setStocks, - sortStocks, - addDate, - setHeaders, - removeHeader, - removeDate, - editDate, - openDate, - updateDates, - newDate, - setPagination, - setCount, - setFilingCount, - setOffset, - setPrimary, - setSecondary, - setFilings, - editComparison, - editSort, - setComparison, - setOpen, - editDifference, -} = filerSlice.actions; - -export default filerSlice.reducer; +import { createSlice, createSelector, PayloadAction } from "@reduxjs/toolkit"; +import { HYDRATE } from "next-redux-wrapper"; +const initialDate: Date = new Date(); +interface Header { + display: string; + sort: string; + accessor: string; + active: boolean; + tooltip: string; +} +const initialHeaders: Header[] = [ + { + display: "Ticker", + sort: "ticker", + accessor: "ticker_str", + active: true, + tooltip: + "This is a unique series of letters assigned to a security for trading purposes", + }, + { + display: "Name", + sort: "name", + accessor: "name", + active: false, + tooltip: "The name of the stock.", + }, + { + display: "Class", + sort: "class", + accessor: "class", + active: false, + tooltip: + "This refers to the rights of a stockholder, including things like voting and dividends.", + }, + { + display: "Sector", + sort: "sector", + accessor: "sector", + active: false, + tooltip: "The broader industry category to which the stock belongs.", + }, + { + display: "CUSIP", + sort: "cusip", + accessor: "cusip", + active: false, + tooltip: + "A unique identifier assigned to each registered security in the United States and Canada.", + }, + { + display: "Shares Held", + sort: "shares_held", + accessor: "shares_held_str", + active: false, + tooltip: "The number of shares held, or the principal amount of the stock.", + }, + { + display: "Market Value", + sort: "market_value", + accessor: "market_value_str", + active: true, + tooltip: "The value for the shares of the stock the filer owns.", + }, + { + display: "% Portfolio", + sort: "portfolio_percent", + accessor: "portfolio_str", + active: true, + tooltip: + "The value of this stock's shares divided by the total value of the portfolio, expressed in percent. ( Value of Shares / Value of Portfolio )", + }, + { + display: "% Ownership", + sort: "ownership_percent", + accessor: "ownership_str", + active: false, + tooltip: + "The number of shares owned, divided by the current total of shares outstanding, expressed in percent. This value is only accurate the most value of shares outstanding. ( Shares Owned / Shares Existing )", + }, + { + display: "Sold Date", + sort: "sold_time", + accessor: "sold_str", + active: false, + tooltip: + "The date the stock was sold, taken by retrieving the report date of the last SEC filing said stock showed up on. This is only accurate up to the quarter.", + }, + { + display: "Buy Date", + sort: "buy_time", + accessor: "buy_str", + active: false, + tooltip: + "The date the stock was bought, according to the report date of the first SEC filing it appeared on. This is only accurate up to the quarter, and only the most recent bought date is shown.", + }, + { + display: "Price Paid", + sort: "buy_price", + accessor: "buy_price_str", + active: true, + tooltip: + "The price paid for the stock, estimated by taking a close price most near the quarter from which the stock was first reported.", + }, + { + display: "Recent Price", + sort: "recent_price", + accessor: "recent_price_str", + active: true, + tooltip: + "The recent price of the stock. This may be a couple days delayed.", + }, + { + display: "% Gain", + sort: "gain_percent", + accessor: "gain_str", + active: true, + tooltip: + "The price paid for the stock subtracted from the recent price, and then divided by price paid, expressed in percent. ( ( Recent Price - Price Paid ) / Price Paid )", + }, + { + display: "Industry", + sort: "industry", + accessor: "industry", + active: false, + tooltip: + "The specific sector or category of the economy in which the stock's company operates.", + }, + { + display: "Report Date", + sort: "report", + accessor: "report_str", + active: false, + tooltip: + "The report date listed on the SEC filing this stock was taken from.", + }, +]; +const initialComparisons: Header[] = initialHeaders.map((h) => { + switch (h.sort) { + case "buy_price": + return { ...h, active: false }; + case "recent_price": + return { ...h, active: false }; + case "gain_percent": + return { ...h, active: false }; + default: + return h; + } +}); +interface Sort { + sort: string; + type: string; + set: boolean; + na: boolean; + sold: boolean; + reverse: boolean; + pagination: number; + limit: number; + count: number; + offset: number; +} +const initialSort: Sort = { + sort: "ticker", + type: "string", + set: true, + na: false, + sold: false, + reverse: true, + pagination: 100, + limit: 100, + count: 0, + offset: 0, +}; +interface Filing { + time: number; + date: string; +} +interface Comparison { + type: string; + access: string; + filing: Filing; + report: Filing; + headers: Header[]; + sort: Sort; + stocks: any[]; +} +interface Timeline { + comparisons: Comparison[]; + open: boolean; +} +interface DateState { + year: number; + month: number; + day: number; + timestamp: number; + open: boolean; + accessor: string; +} +interface State { + cik: string; + value: any[]; + headers: Header[]; + tab: string; + sort: Sort; + filings: any[]; + timeline: Timeline; + difference: { + headers: Header[]; + sort: Sort; + stocks: any[]; + }; + dates: DateState[]; +} +const initialState: State = { + cik: "", + value: [], + headers: initialHeaders, + tab: "stocks", + sort: initialSort, + filings: [], + timeline: { + comparisons: [ + { + type: "primary", + access: "", + filing: { + time: 0, + date: "", + }, + report: { + time: 0, + date: "", + }, + headers: initialComparisons, + sort: initialSort, + stocks: [], + }, + { + type: "secondary", + access: "", + filing: { + time: 0, + date: "", + }, + report: { + time: 0, + date: "", + }, + headers: initialComparisons, + sort: initialSort, + stocks: [], + }, + ], + open: false, + }, + difference: { + headers: initialComparisons, + sort: initialSort, + stocks: [], + }, + dates: [ + { + year: initialDate.getFullYear(), + month: initialDate.getMonth(), + day: initialDate.getDate(), + timestamp: initialDate.getTime() / 1000, + open: false, + accessor: initialDate.toLocaleDateString(), + }, + ], +}; +export const filerSlice = createSlice({ + name: "filer", + initialState, + reducers: { + setCik(state, action: PayloadAction) { + Object.keys(initialState).map((k) => { + state[k] = initialState[k]; + }); + state.cik = action.payload; + return state; + }, + setTab(state, action: PayloadAction) { + const payload = action.payload; + state.tab = payload; + return state; + }, + activateHeader(state, action: PayloadAction) { + const headers = state.headers; + const payload = action.payload; + state.headers = headers.map((h) => + h.accessor === payload ? { ...h, active: !h.active } : h + ); + return state; + }, + sortHeader(state, action: PayloadAction<{ sort: string }>) { + const payload = action.payload; + let type = "string"; + switch (payload.sort) { + case "name": + case "sector": + case "industry": + case "class": + case "cusip": + type = "string"; + break; + case "shares_held": + case "market_value": + case "portfolio_percent": + case "ownership_percent": + case "gain_percent": + case "recent_price": + case "buy_price": + case "report": + case "buy": + case "sold_time": + type = "number"; + break; + case "buy": + case "report": + case "sold_time": + type = "date"; + break; + default: + type = typeof payload.sort === "number" ? "number" : "string"; + break; + } + state.sort = { ...state.sort, ...payload, type: type }; + return state; + }, + sortActive(state) { + const sort = state.sort; + const set = sort.set; + state.sort = { ...sort, set: !set }; + return state; + }, + addHeader(state, action: PayloadAction
) { + const payload = action.payload; + const headers = state.headers; + headers.push({ + ...payload, + active: true, + }); + state.headers = headers; + return state; + }, + editHeader(state, action: PayloadAction<{ accessor: string; display: string }>) { + const payload = action.payload; + const headers = state.headers.map((h) => + h.accessor === payload.accessor ? { ...h, display: payload.display } : h + ); + state.headers = headers; + return state; + }, + removeHeader(state, action: PayloadAction) { + const payload = action.payload; + const headers = state.headers.filter((h) => h.accessor !== payload); + state.headers = headers; + return state; + }, + setHeaders(state, action: PayloadAction) { + const payload = action.payload; + state.headers = payload; + return state; + }, + sortSold(state) { + const sort = state.sort; + const sold = sort.sold; + state.sort = { ...sort, sold: !sold }; + return state; + }, + sortNa(state) { + const sort = state.sort; + const na = sort.na; + state.sort = { ...sort, na: !na }; + return state; + }, + setStocks(state, action: PayloadAction) { + const stocks = action.payload; + state.value = stocks; + return state; + }, + updateStocks(state, action: PayloadAction<{ field: string; values: Record }>) { + const payload = action.payload; + const field = payload.field; + const values = payload.values; + let stocks = state.value; + stocks = stocks.map((stock) => { + const cusip = stock.cusip; + const value = values[cusip]; + return { ...stock, [field]: value }; + }); + state.value = stocks; + return state; + }, + addDate(state, action: PayloadAction) { + const dates = state.dates; + dates.push(action.payload); + state.dates = dates; + return state; + }, + removeDate(state, action: PayloadAction) { + const accessor = action.payload; + const dates = state.dates; + state.dates = dates.filter((date) => date.accessor !== accessor); + return state; + }, + editDate(state, action: PayloadAction<{ accessor: string; type: string; value: any }>) { + const payload = action.payload; + const dates = state.dates.map((date) => { + if (payload.accessor === date.accessor) { + let newDate = new Date(date.year, date.month, date.day); + switch (payload.type) { + case "year": + newDate.setFullYear(payload.value); + break; + case "month": + newDate.setMonth(payload.value); + break; + case "day": + newDate.setDate(payload.value); + break; + case "date": + newDate = new Date(payload.value); + break; + default: + break; + } + return { + year: newDate.getFullYear(), + month: newDate.getMonth(), + day: newDate.getDate(), + timestamp: newDate.getTime() / 1000, + open: true, + accessor: date.accessor, + }; + } else return date; + }); + state.dates = dates; + return state; + }, + updateDates(state, action: PayloadAction) { + const payload = action.payload; + state.dates = payload; + return state; + }, + openDate(state, action: PayloadAction<{ accessor: string; open: boolean }>) { + const payload = action.payload; + const accessor = payload.accessor; + const dates = state.dates.map((date) => + date.accessor === accessor ? { ...date, open: payload.open } : date + ); + state.dates = dates; + return state; + }, + newDate(state) { + const dates = state.dates; + const latestDate = dates.at(-1) || { + year: initialDate.getFullYear(), + month: initialDate.getMonth(), + day: initialDate.getDate(), + timestamp: initialDate.getTime() / 1000, + open: false, + accessor: initialDate.toLocaleDateString(), + }; + const newDate = new Date(latestDate.accessor); + newDate.setDate(newDate.getDate() + 1); + dates.push({ + year: newDate.getFullYear(), + month: newDate.getMonth(), + day: newDate.getDate(), + timestamp: newDate.getTime() / 1000, + open: false, + accessor: newDate.toLocaleDateString(), + }); + state.dates = dates; + return state; + }, + setPagination(state, action: PayloadAction) { + state.sort.pagination = action.payload; + return state; + }, + setCount(state, action: PayloadAction) { + const sort = state.sort; + const payload = action.payload; + const pagination = sort.pagination; + if (pagination < 0) { +4821 state.sort.pagination = payload > 100 ? 100 : payload; + } + state.sort.count = payload; + return state; + }, + setFilingCount(state, action: PayloadAction<{ type: string; count: number }>) { + const payload = action.payload; + const type = payload.type; + const count = payload.count; + const comparisons = state.timeline.comparisons.map((c) => + c.type === type + ? { + ...c, + sort: { ...c.sort, pagination: count > 100 ? 100 : count, count }, + } + : c + ); + state.timeline.comparisons = comparisons; + return state; + }, + setOffset(state, action: PayloadAction) { + const payload = action.payload; + if (payload >= 0) { + state.sort.offset = Number(payload); + } + return state; + }, + setFilings(state, action: PayloadAction) { + const payload = action.payload; + state.filings = payload; + return state; + }, + setPrimary(state, action: PayloadAction>) { + const payload = action.payload; + const comparisons = state.timeline.comparisons; + const primary = comparisons[0]; + state.timeline.comparisons[0] = { ...primary, ...payload }; + return state; + }, + setSecondary(state, action: PayloadAction>) { + const payload = action.payload; + const comparisons = state.timeline.comparisons; + const secondary = comparisons[1]; + state.timeline.comparisons[1] = { ...secondary, ...payload }; + return state; + }, + setComparison(state, action: PayloadAction<{ type: string; access: string }>) { + const payload = action.payload; + const type = payload.type; + const access = payload.access; + const filing = state.filings.find((f) => f.access_number == access); + const filingDate = new Date(filing.filing_date * 1000); + const reportDate = new Date(filing.report_date * 1000); + const filingTime = filingDate.getTime() / 1000; + const reportTime = reportDate.getTime(); + const filingStr = filingDate.toLocaleDateString(); + const reportStr = reportDate.toLocaleDateString(); + const marketValue = new Intl.NumberFormat().format(filing.market_value); + const filingStocks = filing.stocks; + const comparisonIndex = state.timeline.comparisons.findIndex( + (c) => c.type == type + ); + const comparison = state.timeline.comparisons[comparisonIndex]; + state.timeline.comparisons[comparisonIndex] = { + ...comparison, + access, + filing: { + time: filingTime, + date: filingStr, + }, + report: { + time: reportTime, + date: reportStr, + }, + stocks: filingStocks, + value: marketValue, + }; + return state; + }, + setOpen(state) { + const open = state.timeline.open; + state.timeline.open = !open; + return state; + }, + editComparison(state, action: PayloadAction>) { + const payload = action.payload; + const type = payload.type; + const comparison = payload; + const comparisons = state.timeline.comparisons.map((c) => { + return c.type == type ? { ...c, ...comparison } : c; + }); + state.timeline.comparisons = comparisons; + return state; + }, + editSort(state, action: PayloadAction<{ type: string; [key: string]: any }>) { + const payload = action.payload; + const type = payload.type; + delete payload.type; + const comparisons = state.timeline.comparisons.map((c) => { + return c.type == type ? { ...c, sort: { ...c.sort, ...payload } } : c; + }); + state.timeline.comparisons = comparisons; + return state; + }, + editDifference(state, action: PayloadAction>) { + const payload = action.payload; + const difference = state.difference; + state.difference = { ...difference, ...payload }; + return state; + }, + [HYDRATE]: (state, action: PayloadAction) => { + return { + ...state, + ...action.payload, + }; + }, + }, +}); +export const selectCik = (state: { filer: State }) => state.filer.cik; +export const selectTab = (state: { filer: State }) => state.filer.tab; +export const selectSort = (state: { filer: State }) => state.filer.sort; +export const selectActive = (state: { filer: State }) => state.filer.sort.set; +export const selectSold = (state: { filer: State }) => state.filer.sort.sold; +export const selectNa = (state: { filer: State }) => state.filer.sort.na; +export const selectHeaders = (state: { filer: State }) => state.filer.headers; +export const selectStocks = createSelector( + [(state: { filer: State }) => state.filer.value], + (stocks) => stocks +); +export const selectDates = createSelector( + [(state: { filer: State }) => state.filer.dates], + (dates) => + dates.map((d) => { + return { ...d, id: d.accessor }; + }) +); +export const selectPagination = createSelector( + [(state: { filer: State }) => state.filer.sort], + (sort) => { + return { limit: sort.pagination, offset: sort.offset, count: sort.count }; + } +); +export const selectTimeline = (state: { filer: State }) => state.filer.timeline; +export const selectFilings = (state: { filer: State }) => state.filer.filings; +export const selectPrimary = (state: { filer: State }) => state.filer.timeline.comparisons[0]; +export const selectSecondary = (state: { filer: State }) => state.filer.timeline.comparisons[1]; +export const selectDifference = (state: { filer: State }) => state.filer.difference; +export const { + setCik, + setTab, + activateHeader, + addHeader, + editHeader, + sortHeader, + sortActive, + sortSold, + sortNa, + updateStocks, + setStocks, + addDate, + setHeaders, + removeHeader, + removeDate, + editDate, + openDate, + updateDates, + newDate, + setPagination, + setCount, + setFilingCount, + setOffset, + setPrimary, + setSecondary, + setFilings, + editComparison, + editSort, + setComparison, + setOpen, + editDifference, +} = filerSlice.actions; +export default filerSlice.reducer; \ No newline at end of file From 35b78135680afdf23aec6a14158e9b237b856545 Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:19:57 +0000 Subject: [PATCH 012/141] change_file_extension # Commit trail: -> 9c4a316f5ebd6dc81c8445db13720ca684131bf8: edit_file --- frontend/redux/{filerSlice.js => filerSlice.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename frontend/redux/{filerSlice.js => filerSlice.ts} (100%) diff --git a/frontend/redux/filerSlice.js b/frontend/redux/filerSlice.ts similarity index 100% rename from frontend/redux/filerSlice.js rename to frontend/redux/filerSlice.ts From 8f67a7958255c32a788b2d103be1737873481f6c Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:20:27 +0000 Subject: [PATCH 013/141] edit_file --- frontend/pages/about/contact.jsx | 98 ++++++++++++++++---------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/frontend/pages/about/contact.jsx b/frontend/pages/about/contact.jsx index d9c4b37b..254d143a 100644 --- a/frontend/pages/about/contact.jsx +++ b/frontend/pages/about/contact.jsx @@ -1,49 +1,49 @@ -import styles from "@/styles/Contact.module.css"; - -import Head from "next/head"; -import { font } from "@fonts"; - -import MailSVG from "@/images/envelope.svg"; -import DiscordSVG from "@/images/discord.svg"; -import LinkedInSVG from "@/images/linkedin.svg"; - -export default function Contact() { - return ( - <> - - wallstreetlocal | Contact - -
-

Donation and Links

-
-
- {/* Info */} -
- - - 100anonyo@gmail.com - -
-
- - zipped1 -
-
- - - anonyo-noor-272540249 - -
-
- -
-
- - ); -} +import styles from "@/styles/Contact.module.css"; + +import Head from "next/head"; +import { font } from "@fonts"; + +import MailSVG from "@/images/envelope.svg"; +import DiscordSVG from "@/images/discord.svg"; +import LinkedInSVG from "@/images/linkedin.svg"; + +export default function Contact(): JSX.Element { + return ( + <> + + wallstreetlocal | Contact + +
+

Donation and Links

+
+
+ {/* Info */} +
+ + + 100anonyo@gmail.com + +
+
+ + zipped1 +
+
+ + + anonyo-noor-272540249 + +
+
+ +
+
+ + ); +} \ No newline at end of file From 4ebcc5934c6a5c3c7cd348118f91cdb3a965fd22 Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:20:28 +0000 Subject: [PATCH 014/141] change_file_extension # Commit trail: -> 8f67a7958255c32a788b2d103be1737873481f6c: edit_file --- frontend/pages/about/{contact.jsx => contact.tsx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename frontend/pages/about/{contact.jsx => contact.tsx} (100%) diff --git a/frontend/pages/about/contact.jsx b/frontend/pages/about/contact.tsx similarity index 100% rename from frontend/pages/about/contact.jsx rename to frontend/pages/about/contact.tsx From c88a651a922c3923f28317321c267b08dd093060 Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:20:29 +0000 Subject: [PATCH 015/141] edit_file --- frontend/pages/recommended/searched.jsx | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/frontend/pages/recommended/searched.jsx b/frontend/pages/recommended/searched.jsx index 5e77d7cc..b9a0e11e 100644 --- a/frontend/pages/recommended/searched.jsx +++ b/frontend/pages/recommended/searched.jsx @@ -8,14 +8,31 @@ import axios from "axios"; import { font } from "@fonts"; import { convertTitle } from "components/Filer/Info"; -const headers = [ +interface Header { + display: string; + accessor: string; +} + +interface Filer { + name: string; + cik: string; + market_value: string; + date: string; + [key: string]: any; +} + +interface SearchedProps { + filers: Filer[]; +} + +const headers: Header[] = [ { display: "Name", accessor: "name" }, { display: "CIK", accessor: "cik" }, { display: "Assets Under Management", accessor: "market_value" }, { display: "Last Updated", accessor: "date" }, ]; -const Searched = (props) => { +const Searched: React.FC = (props) => { return ( <> @@ -112,4 +129,4 @@ export async function getServerSideProps() { }; } -export default Searched; +export default Searched; \ No newline at end of file From f9c98b3909cb58542e9676e387fb16f4a9fc0951 Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:20:30 +0000 Subject: [PATCH 016/141] change_file_extension # Commit trail: -> c88a651a922c3923f28317321c267b08dd093060: edit_file --- frontend/pages/recommended/{searched.jsx => searched.tsx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename frontend/pages/recommended/{searched.jsx => searched.tsx} (100%) diff --git a/frontend/pages/recommended/searched.jsx b/frontend/pages/recommended/searched.tsx similarity index 100% rename from frontend/pages/recommended/searched.jsx rename to frontend/pages/recommended/searched.tsx From 148631be4fb438d63429f18a3704bcbca9f13362 Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:20:31 +0000 Subject: [PATCH 017/141] edit_file --- frontend/components/Footer/Footer.jsx | 76 +++++++++++++-------------- 1 file changed, 37 insertions(+), 39 deletions(-) diff --git a/frontend/components/Footer/Footer.jsx b/frontend/components/Footer/Footer.jsx index 1b44bf3f..a78b7e18 100644 --- a/frontend/components/Footer/Footer.jsx +++ b/frontend/components/Footer/Footer.jsx @@ -1,39 +1,37 @@ -import styles from "./Footer.module.css"; - -import Link from "next/link"; -import { font, fontLight } from "@fonts"; - -const Footer = () => { - return ( -
-
- - - wallstreet - - - {" "} - local - - -
- - - wallstreetlocal is free and open-source, please consider donating. - - -
- ); -}; - -export default Footer; +import styles from "./Footer.module.css"; +import Link from "next/link"; +import { font, fontLight } from "@fonts"; +import React from "react"; +const Footer: React.FC = () => { + return ( +
+
+ + + wallstreet + + + {" "} + local + + +
+ + + wallstreetlocal is free and open-source, please consider donating. + + +
+ ); +}; +export default Footer; \ No newline at end of file From f2df9a57fbf970d6262472455416d7f516c7bb76 Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:20:32 +0000 Subject: [PATCH 018/141] change_file_extension # Commit trail: -> 148631be4fb438d63429f18a3704bcbca9f13362: edit_file --- frontend/components/Footer/{Footer.jsx => Footer.tsx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename frontend/components/Footer/{Footer.jsx => Footer.tsx} (100%) diff --git a/frontend/components/Footer/Footer.jsx b/frontend/components/Footer/Footer.tsx similarity index 100% rename from frontend/components/Footer/Footer.jsx rename to frontend/components/Footer/Footer.tsx From f845bd8c9465b588f987af1403de1b4c7ccfc541 Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:20:33 +0000 Subject: [PATCH 019/141] edit_file --- frontend/pages/recommended/top.jsx | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/frontend/pages/recommended/top.jsx b/frontend/pages/recommended/top.jsx index ff759693..157a24c0 100644 --- a/frontend/pages/recommended/top.jsx +++ b/frontend/pages/recommended/top.jsx @@ -8,14 +8,31 @@ import axios from "axios"; import { font } from "@fonts"; import { convertTitle } from "components/Filer/Info"; -const headers = [ +interface Header { + display: string; + accessor: string; +} + +interface Filer { + name: string; + cik: string; + market_value: string; + date: string; + [key: string]: any; +} + +interface TopProps { + filers: Filer[]; +} + +const headers: Header[] = [ { display: "Name", accessor: "name" }, { display: "CIK", accessor: "cik" }, { display: "Assets Under Management", accessor: "market_value" }, { display: "Last Updated", accessor: "date" }, ]; -const Top = (props) => { +const Top: React.FC = (props) => { return ( <> @@ -122,4 +139,4 @@ export async function getServerSideProps() { }; } -export default Top; +export default Top; \ No newline at end of file From f0762d3b189569f71270e5eb54fe39b11451efc6 Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:20:35 +0000 Subject: [PATCH 020/141] change_file_extension # Commit trail: -> f845bd8c9465b588f987af1403de1b4c7ccfc541: edit_file --- frontend/pages/recommended/{top.jsx => top.tsx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename frontend/pages/recommended/{top.jsx => top.tsx} (100%) diff --git a/frontend/pages/recommended/top.jsx b/frontend/pages/recommended/top.tsx similarity index 100% rename from frontend/pages/recommended/top.jsx rename to frontend/pages/recommended/top.tsx From 621a042084b77dc26eeaca7af201bd27fd0904d6 Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:20:36 +0000 Subject: [PATCH 021/141] edit_file --- frontend/pages/filers/[cik].jsx | 200 ++++++++++++++++---------------- 1 file changed, 100 insertions(+), 100 deletions(-) diff --git a/frontend/pages/filers/[cik].jsx b/frontend/pages/filers/[cik].jsx index ce401e99..af5d03b6 100644 --- a/frontend/pages/filers/[cik].jsx +++ b/frontend/pages/filers/[cik].jsx @@ -1,100 +1,100 @@ -import axios from "axios"; - -import { Provider } from "react-redux"; -import { wrapper } from "@/redux/store"; - -import Layout from "components/Layouts/Layout"; -import Info from "components/Filer/Info"; -import Other from "components/Filer/Other"; -import Building from "components/Filer/Building"; - -const Filer = (props) => { - const query = props.query; - const cik = props.cik; - - const continuous = props.continuous; - const persist = props.persist; - const tab = props.tab; - - console.log(cik); - - if (query.building || persist) { - return ; - } - - if (query.ok || query.continuous || continuous) { - return ; - } - - if (query.error) { - return ; - } -}; - -const server = process.env.NEXT_PUBLIC_SERVER; -export async function getServerSideProps(context) { - const cik = context.query.cik || null; - const continuous = context.query.continuous || null; - const persist = context.query.persist || null; - const tab = context.query.tab || "stocks"; - - const query = { - ok: false, - building: false, - continuous: false, - error: false, - }; - - await axios - .get(server + "/filers/query", { - params: { cik }, - validateStatus: (status) => status < 500, - }) - .then((r) => { - switch (r?.status) { - case 302: - query.continuous = true; - break; - case 201: - case 409: - query.building = true; - break; - case 200: - query.ok = true; - break; - default: - query.error = true; - break; - } - }) - .catch((e) => { - console.error(e); - query.error = true; - }); - - return { - props: { - query, - cik, - tab, - persist, - continuous, - }, - }; -} - -Filer.getLayout = function getLayout({ Component, ...rest }) { - const { store, props } = wrapper.useWrappedStore(rest); - const { cik } = props.pageProps; - const reduxStore = { ...store, filer: { ...store.filer, cik: cik } }; - - return ( - - - - - - ); -}; - -export default Filer; +import axios from "axios"; +import { Provider } from "react-redux"; +import { wrapper } from "@/redux/store"; +import Layout from "components/Layouts/Layout"; +import Info from "components/Filer/Info"; +import Other from "components/Filer/Other"; +import Building from "components/Filer/Building"; +import { GetServerSideProps } from "next"; +import { FC } from "react"; +interface Query { + ok: boolean; + building: boolean; + continuous: boolean; + error: boolean; +} +interface FilerProps { + query: Query; + cik: string | null; + continuous: boolean | null; + persist: boolean | null; + tab: string; +} +const Filer: FC = (props) => { + const query = props.query; + const cik = props.cik; + const continuous = props.continuous; + const persist = props.persist; + const tab = props.tab; + console.log(cik); + if (query.building || persist) { + return ; + } + if (query.ok || query.continuous || continuous) { + return ; + } + if (query.error) { + return ; + } +}; +const server = process.env.NEXT_PUBLIC_SERVER; +export const getServerSideProps: GetServerSideProps = async (context) => { + const cik = context.query.cik || null; + const continuous = context.query.continuous || null; + const persist = context.query.persist || null; + const tab = context.query.tab || "stocks"; + const query: Query = { + ok: false, + building: false, + continuous: false, + error: false, + }; + await axios + .get(server + "/filers/query", { + params: { cik }, + validateStatus: (status) => status < 500, + }) + .then((r) => { + switch (r?.status) { + case 302: + query.continuous = true; + break; + case 201: + case 409: + query.building = true; + break; + case 200: + query.ok = true; + break; + default: + query.error = true; + break; + } + }) + .catch((e) => { + console.error(e); + query.error = true; + }); + return { + props: { + query, + cik, + tab, + persist, + continuous, + }, + }; +}; +Filer.getLayout = function getLayout({ Component, ...rest }) { + const { store, props } = wrapper.useWrappedStore(rest); + const { cik } = props.pageProps; + const reduxStore = { ...store, filer: { ...store.filer, cik: cik } }; + return ( + + + + + + ); +}; +export default Filer; \ No newline at end of file From 2df85c523f39a1284313c57767be4744ca0ea8df Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:20:37 +0000 Subject: [PATCH 022/141] change_file_extension # Commit trail: -> 621a042084b77dc26eeaca7af201bd27fd0904d6: edit_file --- frontend/pages/filers/{[cik].jsx => [cik].tsx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename frontend/pages/filers/{[cik].jsx => [cik].tsx} (100%) diff --git a/frontend/pages/filers/[cik].jsx b/frontend/pages/filers/[cik].tsx similarity index 100% rename from frontend/pages/filers/[cik].jsx rename to frontend/pages/filers/[cik].tsx From d6220d22bcface1e7741a4ca02cccf78b8ef4b77 Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:20:38 +0000 Subject: [PATCH 023/141] edit_file --- frontend/components/Expand/Expand.jsx | 51 +++++++++++++++------------ 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/frontend/components/Expand/Expand.jsx b/frontend/components/Expand/Expand.jsx index 87c93275..f9887088 100644 --- a/frontend/components/Expand/Expand.jsx +++ b/frontend/components/Expand/Expand.jsx @@ -1,23 +1,28 @@ -import { useState } from "react"; -import styles from "./Expand.module.css"; - -import ExpandSVG from "@/public/static/expand.svg"; - -const Expand = ({ onClick, expandState }) => { - const [clickState, setClick] = useState(false); - const click = expandState ? expandState : clickState; - - return ( - - ); -}; - -export default Expand; +import { useState } from "react"; +import styles from "./Expand.module.css"; +import ExpandSVG from "@/public/static/expand.svg"; +import { FC } from "react"; + +interface ExpandProps { + onClick: () => void; + expandState?: boolean; +} + +const Expand: FC = ({ onClick, expandState }) => { + const [clickState, setClick] = useState(false); + const click = expandState ? expandState : clickState; + + return ( + + ); +}; + +export default Expand; \ No newline at end of file From b91346432b9b354b590ac3205f9bc4609b9597c2 Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:20:39 +0000 Subject: [PATCH 024/141] change_file_extension # Commit trail: -> d6220d22bcface1e7741a4ca02cccf78b8ef4b77: edit_file --- frontend/components/Expand/{Expand.jsx => Expand.tsx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename frontend/components/Expand/{Expand.jsx => Expand.tsx} (100%) diff --git a/frontend/components/Expand/Expand.jsx b/frontend/components/Expand/Expand.tsx similarity index 100% rename from frontend/components/Expand/Expand.jsx rename to frontend/components/Expand/Expand.tsx From 35b6faf351bbcf8070f52666deb8e603fdef221a Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:20:40 +0000 Subject: [PATCH 025/141] edit_file --- frontend/components/Loading/Loading.jsx | 28 ++++++++++++++----------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/frontend/components/Loading/Loading.jsx b/frontend/components/Loading/Loading.jsx index ca034ccf..8f316ea9 100644 --- a/frontend/components/Loading/Loading.jsx +++ b/frontend/components/Loading/Loading.jsx @@ -1,12 +1,16 @@ -import styles from "./Loading.module.css"; -import LoadingSVG from "@/public/static/loading.svg"; - -const Loading = (props) => { - return ( -
- -
- ); -}; - -export default Loading; +import styles from "./Loading.module.css"; +import LoadingSVG from "@/public/static/loading.svg"; + +interface LoadingProps { + className?: string; +} + +const Loading: React.FC = (props) => { + return ( +
+ +
+ ); +}; + +export default Loading; \ No newline at end of file From 00bfc67c78795d7a7076255bc87d1733ecb2600b Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:20:41 +0000 Subject: [PATCH 026/141] change_file_extension # Commit trail: -> 35b6faf351bbcf8070f52666deb8e603fdef221a: edit_file --- frontend/components/Loading/{Loading.jsx => Loading.tsx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename frontend/components/Loading/{Loading.jsx => Loading.tsx} (100%) diff --git a/frontend/components/Loading/Loading.jsx b/frontend/components/Loading/Loading.tsx similarity index 100% rename from frontend/components/Loading/Loading.jsx rename to frontend/components/Loading/Loading.tsx From 0b8374fdb439e707e06cd1710c48b7b60af4596a Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:20:42 +0000 Subject: [PATCH 027/141] edit_file --- frontend/pages/index.jsx | 356 ++++++++++++++++++++------------------- 1 file changed, 180 insertions(+), 176 deletions(-) diff --git a/frontend/pages/index.jsx b/frontend/pages/index.jsx index 83666030..a4de2e98 100644 --- a/frontend/pages/index.jsx +++ b/frontend/pages/index.jsx @@ -1,176 +1,180 @@ -"use server"; - -import styles from "@/styles/Home.module.css"; - -import axios from "axios"; - -import Head from "next/head"; -import Image from "next/image"; - -import { font, fontLight, fontBold } from "@fonts"; - -import Layout from "components/Layouts/Home"; -import Search from "components/Search/Homepage/Search"; -import Recommended from "components/Recommended/Recommended"; -import Health from "components/Health/Health"; -import Hero from "@/images/hero.jpg"; -import FolderIcon from "@/images/folder.svg"; -import FileIcon from "@/images/file.svg"; -import BookIcon from "@/images/book.svg"; - -export default function Home(props) { - return ( - <> - - - wallstreetlocal | Advice from the world's biggest investors - - - - - - -
-
- landing skyscraper -
-
- -
- - Nothing to search? See filers sorted by popularity and value in - the top right corner. - - - Thousands of filings from the world's biggest investors. - - - Wall Street's stock portfolio, for free. - -
-
- -
-
- - Explore historical stock data, directly from the SEC. - -

- The Securities and Exchange Commission (SEC) keeps record of every - company in the United States. Companies whose holdings surpass $100 - million though, are required to file a special type of form: the 13F - form. This form, filed quarterly, discloses the filer's holdings, - providing transparency into their investment activities and allowing - the public and other market participants to monitor them. -

-

- The problem though, is that these holdings are often cumbersome to - access, and valuable analysis is often hidden behind a paywall. - Through wallstreetlocal, the SEC's 13F filers become more - accessible and open. -

- {/*
-
- -
- - Stock Data - - - Stocks from over 20 years, matched with external data to create - accurate, consistent, and useful analysis. - -
-
-
- -
- - SEC Filings - - - Filings directly from the SEC, served in an accessible format. - Over 20 years of coverage. - -
-
-
- -
- - Free Forever - - - The entire backlog of the SEC, free and without quotas. - -
-
-
*/} -
- - ); -} - -const server = process.env.NEXT_PUBLIC_SERVER; -export async function getServerSideProps() { - const health = await axios - .get(server + "/health") - .then((r) => r.status === 200) - .then(() => true) - .catch(() => false); - return { - props: { - health, - }, - }; -} - -Home.getLayout = ({ Component, pageProps }) => ( - - - -); +"use server"; + +import styles from "@/styles/Home.module.css"; + +import axios from "axios"; + +import Head from "next/head"; +import Image from "next/image"; + +import { font, fontLight, fontBold } from "@fonts"; + +import Layout from "components/Layouts/Home"; +import Search from "components/Search/Homepage/Search"; +import Recommended from "components/Recommended/Recommended"; +import Health from "components/Health/Health"; +import Hero from "@/images/hero.jpg"; +import FolderIcon from "@/images/folder.svg"; +import FileIcon from "@/images/file.svg"; +import BookIcon from "@/images/book.svg"; + +interface HomeProps { + health: boolean; +} + +export default function Home(props: HomeProps) { + return ( + <> + + + wallstreetlocal | Advice from the world's biggest investors + + + + + + +
+
+ landing skyscraper +
+
+ +
+ + Nothing to search? See filers sorted by popularity and value in + the top right corner. + + + Thousands of filings from the world's biggest investors. + + + Wall Street's stock portfolio, for free. + +
+
+ +
+
+ + Explore historical stock data, directly from the SEC. + +

+ The Securities and Exchange Commission (SEC) keeps record of every + company in the United States. Companies whose holdings surpass $100 + million though, are required to file a special type of form: the 13F + form. This form, filed quarterly, discloses the filer's holdings, + providing transparency into their investment activities and allowing + the public and other market participants to monitor them. +

+

+ The problem though, is that these holdings are often cumbersome to + access, and valuable analysis is often hidden behind a paywall. + Through wallstreetlocal, the SEC's 13F filers become more + accessible and open. +

+ {/*
+
+ +
+ + Stock Data + + + Stocks from over 20 years, matched with external data to create + accurate, consistent, and useful analysis. + +
+
+
+ +
+ + SEC Filings + + + Filings directly from the SEC, served in an accessible format. + Over 20 years of coverage. + +
+
+
+ +
+ + Free Forever + + + The entire backlog of the SEC, free and without quotas. + +
+
+
*/} +
+ + ); +} + +const server = process.env.NEXT_PUBLIC_SERVER; +export async function getServerSideProps() { + const health = await axios + .get(server + "/health") + .then((r) => r.status === 200) + .then(() => true) + .catch(() => false); + return { + props: { + health, + }, + }; +} + +Home.getLayout = ({ Component, pageProps }: { Component: any; pageProps: any }) => ( + + + +); \ No newline at end of file From 868ca4426d8aeac15caec67080e1bec01ab447b8 Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:20:43 +0000 Subject: [PATCH 028/141] change_file_extension # Commit trail: -> 0b8374fdb439e707e06cd1710c48b7b60af4596a: edit_file --- frontend/pages/{index.jsx => index.tsx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename frontend/pages/{index.jsx => index.tsx} (100%) diff --git a/frontend/pages/index.jsx b/frontend/pages/index.tsx similarity index 100% rename from frontend/pages/index.jsx rename to frontend/pages/index.tsx From 1d464e7708f6cdbca7f9a4b7df02872ca11aeca3 Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:20:44 +0000 Subject: [PATCH 029/141] edit_file --- frontend/components/Headers/Header/Header.jsx | 127 ++++++++++-------- 1 file changed, 72 insertions(+), 55 deletions(-) diff --git a/frontend/components/Headers/Header/Header.jsx b/frontend/components/Headers/Header/Header.jsx index 2a98c6d9..f3984711 100644 --- a/frontend/components/Headers/Header/Header.jsx +++ b/frontend/components/Headers/Header/Header.jsx @@ -1,55 +1,72 @@ -import styles from "./Header.module.css"; - -import { font } from "@fonts"; - -import { useSortable } from "@dnd-kit/sortable"; -import { CSS } from "@dnd-kit/utilities"; - -const Header = (props) => { - const header = props.header; - const activate = props.activate; - const fixed = props.fixed || false; - - const count = props.count; - const onMouseEnter = props.onMouseEnter; - const onMouseLeave = props.onMouseLeave; - - const { - attributes, - listeners, - setNodeRef, - transform, - transition, - isDragging, - } = useSortable({ id: header.accessor }); - const style = fixed - ? {} - : { - transform: CSS.Transform.toString(transform), - transition, - }; - - return ( - - ); -}; - -export default Header; +import styles from "./Header.module.css"; + +import { font } from "@fonts"; + +import { useSortable } from "@dnd-kit/sortable"; +import { CSS } from "@dnd-kit/utilities"; + +import React from "react"; + +interface HeaderProps { + header: HeaderType; + activate: () => void; + fixed?: boolean; + count?: number; + onMouseEnter?: () => void; + onMouseLeave?: () => void; +} + +interface HeaderType { + accessor: string; + display: string; + active: boolean; +} + +const Header: React.FC = (props) => { + const header = props.header; + const activate = props.activate; + const fixed = props.fixed || false; + + const count = props.count; + const onMouseEnter = props.onMouseEnter; + const onMouseLeave = props.onMouseLeave; + + const { + attributes, + listeners, + setNodeRef, + transform, + transition, + isDragging, + } = useSortable({ id: header.accessor }); + const style = fixed + ? {} + : { + transform: CSS.Transform.toString(transform), + transition, + }; + + return ( + + ); +}; + +export default Header; \ No newline at end of file From e6ce53fc5c4b88905e74ccd73e9c6a7fef7d15a9 Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:20:45 +0000 Subject: [PATCH 030/141] change_file_extension # Commit trail: -> 1d464e7708f6cdbca7f9a4b7df02872ca11aeca3: edit_file --- frontend/components/Headers/Header/{Header.jsx => Header.tsx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename frontend/components/Headers/Header/{Header.jsx => Header.tsx} (100%) diff --git a/frontend/components/Headers/Header/Header.jsx b/frontend/components/Headers/Header/Header.tsx similarity index 100% rename from frontend/components/Headers/Header/Header.jsx rename to frontend/components/Headers/Header/Header.tsx From 4d99272e5b775636ddce82787f632d20df8c38aa Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:20:46 +0000 Subject: [PATCH 031/141] edit_file --- frontend/components/Filer/Other.jsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/frontend/components/Filer/Other.jsx b/frontend/components/Filer/Other.jsx index d5e6b636..207cc0dd 100644 --- a/frontend/components/Filer/Other.jsx +++ b/frontend/components/Filer/Other.jsx @@ -1,15 +1,17 @@ import Head from "next/head"; import Error from "next/error"; - -const Other = () => { +import { FC } from "react"; +enum StatusCode { + NotFound = 404, +} +const Other: FC = () => { return ( <> 404 - Filer not found - + ); }; - -export default Other; +export default Other; \ No newline at end of file From fc4e0f21b923626c0529617980053bb396f153aa Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:20:47 +0000 Subject: [PATCH 032/141] change_file_extension # Commit trail: -> 4d99272e5b775636ddce82787f632d20df8c38aa: edit_file --- frontend/components/Filer/{Other.jsx => Other.tsx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename frontend/components/Filer/{Other.jsx => Other.tsx} (100%) diff --git a/frontend/components/Filer/Other.jsx b/frontend/components/Filer/Other.tsx similarity index 100% rename from frontend/components/Filer/Other.jsx rename to frontend/components/Filer/Other.tsx From 5c129fffa652191b5cc3ced2a8903f88b84c7f3b Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:20:48 +0000 Subject: [PATCH 033/141] edit_file --- frontend/components/Header/Header.jsx | 41 ++++++++++++++------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/frontend/components/Header/Header.jsx b/frontend/components/Header/Header.jsx index ad1c935d..4b9e672c 100644 --- a/frontend/components/Header/Header.jsx +++ b/frontend/components/Header/Header.jsx @@ -1,36 +1,41 @@ import styles from "./Header.module.css"; import { useState, useEffect } from "react"; - import useSWR from "swr"; import axios from "axios"; - import Head from "next/head"; - import { useDispatch } from "react-redux"; import { setCik, setTab } from "@/redux/filerSlice"; - import { font } from "@fonts"; - import Expand from "components/Expand/Expand"; import Source from "components/Source/Source"; import Building from "components/Progress/Building/Building"; import { convertTitle } from "components/Filer/Info"; - const server = process.env.NEXT_PUBLIC_SERVER; -const fetcher = (url, cik) => +interface HeaderProps { + cik: string; + tab: string; +} +interface FilerInfo { + name?: string; + status?: number; + cik?: string; + tickers?: string[]; + financials?: { + description?: string; + }; +} +const fetcher = (url: string, cik: string) => axios .get(url, { params: { cik: cik } }) .then((r) => r.data) .catch((e) => console.error(e)); - -const Header = (props) => { +const Header: React.FC = (props) => { const cik = props.cik; const tab = props.tab; const dispatch = useDispatch(); - const { data } = useSWR( cik ? [server + "/filers/info", cik] : null, - ([url, cik]) => fetcher(url, cik), + ([url, cik]: [string, string]) => fetcher(url, cik), { revalidateOnFocus: false, revalidateOnReconnect: false, @@ -40,15 +45,12 @@ const Header = (props) => { } ); const [expand, setExpand] = useState(false); - useEffect(() => { dispatch(setCik(cik ? cik : "")); dispatch(setTab(tab)); }, [cik]); - - const info = data?.filer || null; + const info: FilerInfo | null = data?.filer || null; const name = info?.name ? convertTitle(info.name) : ""; - return ( <> @@ -65,7 +67,7 @@ const Header = (props) => { > {name} - {info?.status > 0 ? : null} + {info?.status && info.status > 0 ? : null}
{ ].join(" ")} > {info?.cik}{" "} - {info?.tickers.length ? `(${info?.tickers.join(", ")})` : ""} + {info?.tickers && info.tickers.length ? `(${info.tickers.join(", ")})` : ""}
@@ -95,7 +97,7 @@ const Header = (props) => { @@ -109,5 +111,4 @@ const Header = (props) => { ); }; - -export default Header; +export default Header; \ No newline at end of file From 6463df042bd6ad0d4c5d0fd0f2f2eba3700cb923 Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:20:50 +0000 Subject: [PATCH 034/141] change_file_extension # Commit trail: -> 5c129fffa652191b5cc3ced2a8903f88b84c7f3b: edit_file --- frontend/components/Header/{Header.jsx => Header.tsx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename frontend/components/Header/{Header.jsx => Header.tsx} (100%) diff --git a/frontend/components/Header/Header.jsx b/frontend/components/Header/Header.tsx similarity index 100% rename from frontend/components/Header/Header.jsx rename to frontend/components/Header/Header.tsx From 2d200b4da030d95eb3331fdca805123a93b379ef Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:20:51 +0000 Subject: [PATCH 035/141] edit_file --- frontend/components/Filer/Building.jsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/frontend/components/Filer/Building.jsx b/frontend/components/Filer/Building.jsx index cead202c..61cecffb 100644 --- a/frontend/components/Filer/Building.jsx +++ b/frontend/components/Filer/Building.jsx @@ -3,7 +3,14 @@ import Head from "next/head"; import Progress from "components/Progress/Progress"; import Recommended from "components/Recommended/Recommended"; -const Building = (props) => { +import { FC } from "react"; + +interface BuildingProps { + cik?: string | null; + persist: boolean; +} + +const Building: FC = (props) => { const cik = props.cik || null; const persist = props.persist; return ( @@ -17,4 +24,4 @@ const Building = (props) => { ); }; -export default Building; +export default Building; \ No newline at end of file From 9e2690dd05f163cc26abc3b2669f82e7e7aaadfe Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:20:52 +0000 Subject: [PATCH 036/141] change_file_extension # Commit trail: -> 2d200b4da030d95eb3331fdca805123a93b379ef: edit_file --- frontend/components/Filer/{Building.jsx => Building.tsx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename frontend/components/Filer/{Building.jsx => Building.tsx} (100%) diff --git a/frontend/components/Filer/Building.jsx b/frontend/components/Filer/Building.tsx similarity index 100% rename from frontend/components/Filer/Building.jsx rename to frontend/components/Filer/Building.tsx From ab4f84f768b2f9456df4716a7440852bd38acf26 Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:20:53 +0000 Subject: [PATCH 037/141] edit_file --- frontend/pages/about/resources.jsx | 387 ++++++++++++++--------------- 1 file changed, 193 insertions(+), 194 deletions(-) diff --git a/frontend/pages/about/resources.jsx b/frontend/pages/about/resources.jsx index 9c4111a7..49c33651 100644 --- a/frontend/pages/about/resources.jsx +++ b/frontend/pages/about/resources.jsx @@ -1,194 +1,193 @@ -import styles from "@/styles/Resources.module.css"; - -import Head from "next/head"; -import Link from "next/link"; -import { font } from "@fonts"; - -export default function Resources() { - return ( - <> - - wallstreetlocal | Resources - {" "} -
-
-

- Resources -

- - All data used is publicly available via the SEC. The following - contains useful links and information about SEC registered - companies. - -
-
-
- - - - - (Add 13F to the filing category field to find companies that have - filed 13F filings) - -
-
- - - - - (Bulk data via the SEC) - -
-
- - - - - (Bulk data via the SEC) - -
-
- - - - - (Bulk data via the SEC) - -
-
- - - - - (Explanations for different form types) - -
-
- - - - - (Search database for companies, created by wallstreetlocal, - formatted in BSON) - -
-
- - - - - (Gist listing popular filers, taken from various sources. This is - where the popular filers page gets its list from.) - -
-
- - - - - (Gist listing top filers, taken from various sources. This is - where the top filers page gets its list from.) - -
-
- - While not all data collected and formatted by wallstreetlocal is - available by bulk because of data costs, you can download resources - for individual filers by visiting their respective pages. - -
- - ); -} +import styles from "@/styles/Resources.module.css"; +import Head from "next/head"; +import Link from "next/link"; +import { font } from "@fonts"; +import React from "react"; +export default function Resources(): JSX.Element { + return ( + <> + + wallstreetlocal | Resources + +
+
+

+ Resources +

+ + All data used is publicly available via the SEC. The following + contains useful links and information about SEC registered + companies. + +
+
+
+ + + + + (Add 13F to the filing category field to find companies that have + filed 13F filings) + +
+
+ + + + + (Bulk data via the SEC) + +
+
+ + + + + (Bulk data via the SEC) + +
+
+ + + + + (Bulk data via the SEC) + +
+
+ + + + + (Explanations for different form types) + +
+
+ + + + + (Search database for companies, created by wallstreetlocal, + formatted in BSON) + +
+
+ + + + + (Gist listing popular filers, taken from various sources. This is + where the popular filers page gets its list from.) + +
+
+ + + + + (Gist listing top filers, taken from various sources. This is + where the top filers page gets its list from.) + +
+
+ + While not all data collected and formatted by wallstreetlocal is + available by bulk because of data costs, you can download resources + for individual filers by visiting their respective pages. + +
+ + ); +} \ No newline at end of file From 40592a955c30bb377540983bf5fe8e17caae0382 Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:20:54 +0000 Subject: [PATCH 038/141] change_file_extension # Commit trail: -> ab4f84f768b2f9456df4716a7440852bd38acf26: edit_file --- frontend/pages/about/{resources.jsx => resources.tsx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename frontend/pages/about/{resources.jsx => resources.tsx} (100%) diff --git a/frontend/pages/about/resources.jsx b/frontend/pages/about/resources.tsx similarity index 100% rename from frontend/pages/about/resources.jsx rename to frontend/pages/about/resources.tsx From ca7529f3e8b65a814bd3b35b99f9e5a41e898e42 Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:20:55 +0000 Subject: [PATCH 039/141] edit_file --- frontend/components/Layouts/Mobile.jsx | 28 ++++++++++++++------------ 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/frontend/components/Layouts/Mobile.jsx b/frontend/components/Layouts/Mobile.jsx index 849c4d7b..067e20c4 100644 --- a/frontend/components/Layouts/Mobile.jsx +++ b/frontend/components/Layouts/Mobile.jsx @@ -1,13 +1,15 @@ -import styles from "@/styles/Fill.module.css"; - -import { font } from "@fonts"; - -export default function MobileLayout() { - return ( -
- - wallstreetlocal is not available on mobile just yet. - -
- ); -} +import styles from "@/styles/Fill.module.css"; + +import { font } from "@fonts"; + +import React from "react"; + +export default function MobileLayout(): JSX.Element { + return ( +
+ + wallstreetlocal is not available on mobile just yet. + +
+ ); +} \ No newline at end of file From cb1cb96b2f4388faba1408c9a034401607daee56 Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:20:56 +0000 Subject: [PATCH 040/141] change_file_extension # Commit trail: -> ca7529f3e8b65a814bd3b35b99f9e5a41e898e42: edit_file --- frontend/components/Layouts/{Mobile.jsx => Mobile.tsx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename frontend/components/Layouts/{Mobile.jsx => Mobile.tsx} (100%) diff --git a/frontend/components/Layouts/Mobile.jsx b/frontend/components/Layouts/Mobile.tsx similarity index 100% rename from frontend/components/Layouts/Mobile.jsx rename to frontend/components/Layouts/Mobile.tsx From c19d3ea71dbd6bb732c2a45310b32a17dabba951 Mon Sep 17 00:00:00 2001 From: Second Agent <123514301+second-agent[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:20:57 +0000 Subject: [PATCH 041/141] edit_file --- frontend/components/Layouts/Home.jsx | 32 +++++++++++++++------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/frontend/components/Layouts/Home.jsx b/frontend/components/Layouts/Home.jsx index 01167685..812b9323 100644 --- a/frontend/components/Layouts/Home.jsx +++ b/frontend/components/Layouts/Home.jsx @@ -1,15 +1,17 @@ -import Navigation from "components/Navigation/Navigation"; -import Footer from "components/Footer/Footer"; - -import { Analytics } from "@vercel/analytics/react"; - -export default function Layout({ children }) { - return ( - <> - -
{children}
- -