-
-
-
- {!!incidentResults &&
}
+
+
+ {isIncidentView && }
+ {isIncidentView && !!incidentResults && (
+
+ )}
+
+ {isOfficerView && }
+ {isOfficerView && !!officerSearchResult && (
+
+ )}
)
})
+
+const officerSearchResult: Officer[] = [
+ {
+ id: 1,
+ first_name: "John",
+ last_name: "Doe",
+ race: "White",
+ ethnicity: "Non-Hispanic",
+ gender: "Male",
+ rank: Rank.CAPTAIN,
+ star: "123456",
+ date_of_birth: new Date("01/01/1980")
+ },
+ {
+ id: 1,
+ first_name: "John",
+ last_name: "Doe",
+ race: "White",
+ ethnicity: "Non-Hispanic",
+ gender: "Male",
+ rank: Rank.CAPTAIN,
+ star: "123456",
+ date_of_birth: new Date("01/01/1980")
+ },
+ {
+ id: 1,
+ first_name: "John",
+ last_name: "Doe",
+ race: "White",
+ ethnicity: "Non-Hispanic",
+ gender: "Male",
+ rank: Rank.CAPTAIN,
+ star: "123456",
+ date_of_birth: new Date("01/01/1980")
+ },
+ {
+ id: 1,
+ first_name: "John",
+ last_name: "Doe",
+ race: "White",
+ ethnicity: "Non-Hispanic",
+ gender: "Male",
+ rank: Rank.CAPTAIN,
+ star: "123456",
+ date_of_birth: new Date("01/01/1980")
+ },
+ {
+ id: 1,
+ first_name: "John",
+ last_name: "Doe",
+ race: "White",
+ ethnicity: "Non-Hispanic",
+ gender: "Male",
+ rank: Rank.CAPTAIN,
+ star: "123456",
+ date_of_birth: new Date("01/01/1980")
+ },
+ {
+ id: 1,
+ first_name: "John",
+ last_name: "Doe",
+ race: "White",
+ ethnicity: "Non-Hispanic",
+ gender: "Male",
+ rank: Rank.CAPTAIN,
+ star: "123456",
+ date_of_birth: new Date("01/01/1980")
+ },
+ {
+ id: 1,
+ first_name: "John",
+ last_name: "Doe",
+ race: "White",
+ ethnicity: "Non-Hispanic",
+ gender: "Male",
+ rank: Rank.CAPTAIN,
+ star: "123456",
+ date_of_birth: new Date("01/01/1980")
+ },
+ {
+ id: 1,
+ first_name: "John",
+ last_name: "Doe",
+ race: "White",
+ ethnicity: "Non-Hispanic",
+ gender: "Male",
+ rank: Rank.CAPTAIN,
+ star: "123456",
+ date_of_birth: new Date("01/01/1980")
+ }
+]
diff --git a/frontend/pages/search/search.module.css b/frontend/pages/search/search.module.css
index b4d0173b4..aa0f0af05 100644
--- a/frontend/pages/search/search.module.css
+++ b/frontend/pages/search/search.module.css
@@ -1,12 +1,7 @@
.searchPageContainer {
- display: flex;
-}
-
-.searchPageDisplay {
- display: flex;
- flex-direction: column;
-}
-
-.searchPageDisplay > * {
- min-height: 50%;
+ max-height: 85vh;
+ overflow: auto;
+ display: grid;
+ grid-template-columns: 1fr 5fr;
+ grid-template-rows: repeat(2, 1fr);
}
diff --git a/frontend/shared-components/data-table/data-table-subcomps.tsx b/frontend/shared-components/data-table/data-table-subcomps.tsx
index 99e5f1e4a..68172cad7 100644
--- a/frontend/shared-components/data-table/data-table-subcomps.tsx
+++ b/frontend/shared-components/data-table/data-table-subcomps.tsx
@@ -39,9 +39,9 @@ const PageButton = (props: PageButtonProps) => {
const { icon, onclick, disabled } = props
return (
-
+
)
}
type PageNavigatorProps = {
@@ -76,42 +76,14 @@ const PageNavigator = (props: PageNavigatorProps) => {
return (
)
}
diff --git a/frontend/shared-components/data-table/data-table.module.css b/frontend/shared-components/data-table/data-table.module.css
index c36b26dd9..22b9415d8 100644
--- a/frontend/shared-components/data-table/data-table.module.css
+++ b/frontend/shared-components/data-table/data-table.module.css
@@ -12,7 +12,15 @@
text-align: center;
}
-.dataFooter,
+.dataFooter {
+ background-color: var(--lightBlue);
+ display: flex;
+ justify-content: space-between;
+ padding-left: var(--size100);
+ padding-right: var(--size80);
+ padding-top: var(--size4);
+ padding-bottom: var(--size4);
+}
.dataHeader {
background-color: var(--lightBlue);
}
@@ -123,3 +131,8 @@
-webkit-appearance: none;
margin: 0;
}
+
+.recordCount {
+ font-weight: bold;
+ font-size: var(--size18);
+}
diff --git a/frontend/shared-components/data-table/data-table.tsx b/frontend/shared-components/data-table/data-table.tsx
index b24a3c1cf..190c78fc1 100644
--- a/frontend/shared-components/data-table/data-table.tsx
+++ b/frontend/shared-components/data-table/data-table.tsx
@@ -2,7 +2,7 @@ import { faArrowDown, faArrowUp } from "@fortawesome/free-solid-svg-icons"
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
import React, { useState } from "react"
import { Column, defaultColumn, useFilters, usePagination, useSortBy, useTable } from "react-table"
-import { Incident } from "../../helpers/api/api"
+import { Incident, Officer } from "../../helpers/api/api"
import { SavedResultsType, SavedSearchType } from "../../models"
import { EditButton, PageNavigator } from "./data-table-subcomps"
import styles from "./data-table.module.css"
@@ -10,7 +10,7 @@ import styles from "./data-table.module.css"
interface DataTableProps {
tableName: string
columns: Column
[]
- data: Incident[] | SavedSearchType[] | SavedResultsType[] | undefined
+ data: Incident[] | SavedSearchType[] | SavedResultsType[] | Officer[] | undefined
}
export function DataTable(props: DataTableProps) {
@@ -60,11 +60,8 @@ export function DataTable(props: DataTableProps) {
}
return (
-
-
+
+ {/*
*/}
{headerGroups.map((headerGroup) => (
diff --git a/frontend/shared-components/error-alert-dialog/error-alert-dialog.module.css b/frontend/shared-components/error-alert-dialog/error-alert-dialog.module.css
new file mode 100644
index 000000000..9581061d0
--- /dev/null
+++ b/frontend/shared-components/error-alert-dialog/error-alert-dialog.module.css
@@ -0,0 +1,24 @@
+.errorAlertDialogContainer {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ padding: var(--size10) var(--size20) var(--size10) var(--size20);
+ border: 2px solid black;
+ border-radius: 5px;
+ /* height: 50%; */
+}
+
+.innerErrorAlertDialogContainer {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ justify-content: center;
+ padding: var(--size20);
+ border: 3px solid red;
+ border-radius: 5px;
+}
+
+.errorAlertDescription {
+ margin: 0 var(--size10) 0 var(--size10);
+}
diff --git a/frontend/shared-components/error-alert-dialog/error-alert-dialog.tsx b/frontend/shared-components/error-alert-dialog/error-alert-dialog.tsx
new file mode 100644
index 000000000..e2939bcda
--- /dev/null
+++ b/frontend/shared-components/error-alert-dialog/error-alert-dialog.tsx
@@ -0,0 +1,30 @@
+import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
+import PrimaryButton from "../primary-button/primary-button"
+import styles from "./error-alert-dialog.module.css"
+import { faExclamationTriangle } from "@fortawesome/free-solid-svg-icons"
+import { SearchResultsTypes, alertContent } from "../../models"
+
+interface ErrorAlertDialogProps {
+ setError: Function
+ searchResultType: SearchResultsTypes
+}
+
+export default function ErrorAlertDialog(props: ErrorAlertDialogProps) {
+ const { errorAlertDialogContainer, innerErrorAlertDialogContainer, errorAlertDescription } =
+ styles
+ const { searchResultType } = props
+ return (
+
+
+
+
+
{alertContent[searchResultType]}
+
Please revise search or explore map
+
+
+
props.setError(false)}>
+ Return
+
+
+ )
+}
diff --git a/frontend/shared-components/primary-button/primary-button.module.css b/frontend/shared-components/primary-button/primary-button.module.css
index 4321e4f49..dd5cbcd7c 100644
--- a/frontend/shared-components/primary-button/primary-button.module.css
+++ b/frontend/shared-components/primary-button/primary-button.module.css
@@ -12,6 +12,7 @@
font-size: var(--size16);
font-weight: 500;
cursor: pointer;
+ padding: var(--size14);
}
.primaryButton:focus,
.primaryButton:hover {
diff --git a/frontend/shared-components/primary-input/primary-input.module.css b/frontend/shared-components/primary-input/primary-input.module.css
index e944887a6..849d8a99b 100644
--- a/frontend/shared-components/primary-input/primary-input.module.css
+++ b/frontend/shared-components/primary-input/primary-input.module.css
@@ -25,3 +25,9 @@
.inputField[type="number"] {
-moz-appearance: textfield;
}
+
+.primarInputContent {
+ font-size: var(--size12);
+ margin-top: var(--size4);
+ margin-bottom: var(--size4);
+}
diff --git a/frontend/shared-components/primary-input/primary-input.tsx b/frontend/shared-components/primary-input/primary-input.tsx
index 6bb991462..0f1355cd6 100644
--- a/frontend/shared-components/primary-input/primary-input.tsx
+++ b/frontend/shared-components/primary-input/primary-input.tsx
@@ -3,9 +3,17 @@ import React from "react"
import { useFormContext } from "react-hook-form"
import { FormLevelError } from ".."
import { getTitleCaseFromCamel } from "../../helpers"
-import { PrimaryInputNames, primaryInputValidation, TooltipTypes } from "../../models"
+import {
+ primaryInputContent,
+ PrimaryInputNames,
+ primaryInputValidation,
+ SearchTypes,
+ TooltipTypes
+} from "../../models"
import InfoTooltip, { InfoTooltipProps } from "../info-tooltip/info-tooltip"
import styles from "./primary-input.module.css"
+import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
+import { faInfoCircle } from "@fortawesome/free-solid-svg-icons"
interface PrimaryInputProps {
inputName: PrimaryInputNames
@@ -30,7 +38,7 @@ export default function PrimaryInput({
register,
formState: { errors }
} = useFormContext()
- const { inputContainer, inputField } = styles
+ const { inputContainer, inputField, primarInputContent } = styles
const {
errorMessage: defaultErrorMessage,
pattern,
@@ -71,6 +79,14 @@ export default function PrimaryInput({
defaultValue={defaultValue}
{...register(inputName, { required: isRequired, pattern })}
/>
+ {primaryInputContent[inputName] ? (
+
+ {" "}
+ {primaryInputContent[inputName]}
+
+ ) : (
+ <>>
+ )}
{!isValid && (
The national index of police incidents
-
+