-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1654 from cityofaustin/rose/move_temp_records
Move temporary records functionality to crashes list
- Loading branch information
Showing
5 changed files
with
47 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,53 @@ | ||
"use client"; | ||
import { useState, useCallback } from "react"; | ||
import Card from "react-bootstrap/Card"; | ||
import Button from "react-bootstrap/Button"; | ||
import AlignedLabel from "@/components/AlignedLabel"; | ||
import AppBreadCrumb from "@/components/AppBreadCrumb"; | ||
import CreateCrashRecordModal from "@/components/CreateCrashRecordModal"; | ||
import { FaCirclePlus } from "react-icons/fa6"; | ||
import { crashesListViewColumns } from "@/configs/crashesListViewColumns"; | ||
import { crashesListViewQueryConfig } from "@/configs/crashesListViewTable"; | ||
import TableWrapper from "@/components/TableWrapper"; | ||
const localStorageKey = "crashesListViewQueryConfig"; | ||
|
||
export default function Crashes() { | ||
const [refetch, setRefetch] = useState(false); | ||
const [showNewUserModal, setShowNewUserModal] = useState(false); | ||
const onCloseModal = () => setShowNewUserModal(false); | ||
|
||
const onSaveCallback = useCallback(() => { | ||
setRefetch((prev) => !prev); | ||
setShowNewUserModal(false); | ||
}, [setRefetch]); | ||
|
||
return ( | ||
<> | ||
<AppBreadCrumb /> | ||
<Card> | ||
<Card.Header className="fs-5 fw-bold">Crashes</Card.Header> | ||
<Card.Header className="fs-5 fw-bold d-flex justify-content-between"> | ||
Crashes | ||
<Button className="me-2" onClick={() => setShowNewUserModal(true)}> | ||
<AlignedLabel> | ||
<FaCirclePlus className="me-2" /> | ||
<span>Create crash record</span> | ||
</AlignedLabel> | ||
</Button> | ||
</Card.Header> | ||
<Card.Body> | ||
<TableWrapper | ||
columns={crashesListViewColumns} | ||
initialQueryConfig={crashesListViewQueryConfig} | ||
localStorageKey={localStorageKey} | ||
refetch={refetch} | ||
/> | ||
</Card.Body> | ||
</Card> | ||
<CreateCrashRecordModal | ||
onClose={onCloseModal} | ||
show={showNewUserModal} | ||
onSubmitCallback={onSaveCallback} | ||
/> | ||
</> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters