-
-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 🎉 feat: address dropdowns * chore: add types * chore: fix types * 🎉 feat: working import & crud * Format code with prettier * 🎉 feat: working AddressPostalSelect * Format code with prettier * 🎉 feat: bug fixes & improvements * 🎉 feat: add all instances of postal/address search * Format code with prettier * 🔨 chore: 1 migration Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
- Loading branch information
1 parent
4e156e0
commit 1c16a6f
Showing
32 changed files
with
310 additions
and
134 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
apps/api/prisma/migrations/20221101091651_address_values/migration.sql
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
-- AlterEnum | ||
ALTER TYPE "ValueType" ADD VALUE 'ADDRESS'; | ||
|
||
-- CreateTable | ||
CREATE TABLE "AddressValue" ( | ||
"id" TEXT NOT NULL, | ||
"valueId" TEXT NOT NULL, | ||
"county" TEXT, | ||
"postal" TEXT, | ||
|
||
CONSTRAINT "AddressValue_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "AddressValue" ADD CONSTRAINT "AddressValue_valueId_fkey" FOREIGN KEY ("valueId") REFERENCES "Value"("id") ON DELETE CASCADE ON UPDATE CASCADE; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ const validPaths = [ | |
"penal_code_group", | ||
"qualification", | ||
"call_type", | ||
"address", | ||
]; | ||
|
||
@Middleware() | ||
|
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
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
28 changes: 28 additions & 0 deletions
28
apps/client/src/components/admin/values/manage-modal/AddressFields.tsx
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { TextField } from "@snailycad/ui"; | ||
import { useFormikContext } from "formik"; | ||
|
||
export function AddressFields() { | ||
const { values, errors, setFieldValue } = useFormikContext<any>(); | ||
|
||
return ( | ||
<> | ||
<TextField | ||
label="Postal" | ||
isOptional | ||
name="postal" | ||
onChange={(value) => setFieldValue("postal", value)} | ||
value={values.postal} | ||
errorMessage={errors.postal as string} | ||
/> | ||
|
||
<TextField | ||
label="County" | ||
isOptional | ||
name="county" | ||
onChange={(value) => setFieldValue("county", value)} | ||
value={values.county} | ||
errorMessage={errors.county as string} | ||
/> | ||
</> | ||
); | ||
} |
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
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
Oops, something went wrong.