Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mock incident data #192

Merged
merged 8 commits into from
Oct 15, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update mock datatypes
  • Loading branch information
acharliekelly committed Oct 14, 2021
commit 28604f9f3822b3cdb4b02dc9a492dcab61d03d4f
20 changes: 19 additions & 1 deletion frontend/models/mock-data/saved-results-data.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
export const savedResultsData = [
import { IncidentTableData, incidentsColumns, formatDate } from "../incidents"

// SAVED RESULTS DATA TABLE
export interface SavedResultsType extends IncidentTableData {
searchDate: number // UNIX timestamp
}


export const resultsColumns = [
{
Header: "Search Date",
accessor: (row: any) => formatDate(row["searchDate"]),
id: "searchDate"
},
...incidentsColumns
]


// OLD FORMAT - here to avoid breaking existing components
export const savedResultsData = [{
searchDate: "2021/09/07",
dates: "2003/01/01",
incidentType: "Use of force",
Expand Down
58 changes: 53 additions & 5 deletions frontend/models/mock-data/saved-search-data.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,66 @@
// SAVED SEARCH DATA TABLE
export interface SavedSearchType {
searchDate: number, // UNIX timestamp
who: string[],
what: string,
when: number, // UNIX timestamp
where: string,
total: number,
results: number,
}

const formatDate = (unixDate: number): string => new Date(unixDate).toLocaleDateString()

export const searchesColumns = [
{
Header: "Search Date",
accessor: (row: any) => formatDate(row["searchDate"]),
id: "searchDate"
},
{
Header: "Who",
accessor: "who"
},
{
Header: "What",
accessor: "what"
},
{
Header: "When",
accessor: (row: any) => formatDate(row["when"]),
id: "when"
},
{
Header: "Where",
accessor: "where"
},
{
Header: "Results Total",
accessor: "total"
},
{
Header: "View Results",
accessor: "results"
}
]



export const savedSearchData = [
{
searchDate: "07/11/2021",
who: ["Dillon, Matt"],
searchDate: 1581007526000,
who: ["M.Dillon"],
what: "n/a",
when: "n/a",
when: 1482251257000,
where: "New York (state)",
total: 124,
results: 1
},
{
searchDate: "07/21/2021",
searchDate: 1611321729000,
who: ["n/a"],
what: "Use of Force",
when: "03/14/2008",
when: 1302852303000,
where: "Chicago, Illinois",
total: 1200,
results: 2
Expand Down