Skip to content

Commit

Permalink
Add mui autocomplete & dashboard listing locale search
Browse files Browse the repository at this point in the history
  • Loading branch information
kaje94 committed Oct 29, 2023
1 parent 0661ecc commit 4c98b5e
Show file tree
Hide file tree
Showing 18 changed files with 367 additions and 165 deletions.
8 changes: 3 additions & 5 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,17 @@
> https://next-s3-upload.codingvalue.com/setup
> API changes
- [] purpose of passing location details in the listing create api?
- [] add a new field `hash` to image entity and have max length of 100(even though actually needed is less than 25)
- [] always sort images to make the preview image as the first image (specially in the detail screen)
- [] vehicle description needs to be at least 1000 characters?
// new!
- [] make postal code into alpha numeric (need to be able to save 00500 as a postal code)
- [] make trim as optional
- [] only return name for city api call, only return name and state code for state api call, remove id from country list & detail api call
- [] is lease field really necessary?
- [] vehicle brands have duplicate values
- [] return empty array instead of 404 if no cities or states found
- [] state city sql query should also use like instead of ==
- [] featured listing needs a country path param
- [] user phone and address null in listing details response

> Web app todo list
Expand All @@ -31,8 +30,6 @@
- [] show safety tips similar to ikman under item details description
- [] add web3 forms or similar to contact us
- [] go through all the loading screens and make sure that the parents have animate pulse class
- [] add country code as inputPrefix for phone numbers
- [] show currency as inputPrefix for price inputs
- [] avoid session?.user?.sub!
- [] verify how emtpy, unauthorized and error component redirects & links work
- [] refer create t3 structure and eslint
Expand All @@ -41,6 +38,7 @@
- [] having debouncer in search inputs in search screen causes issues when page load during typing
- [] show expiry date in listings throughout. specially when renewing listings
- [] handle when visting posted listing from different country
- [] review all dynamic usage and try to use it at higher levels that in lower level

> Need to verify
- [] loading bug when changing query (while loading type something) (Added a possible fix)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"@aws-sdk/client-s3": "^3.421.0",
"@aws-sdk/s3-request-presigner": "^3.421.0",
"@formkit/auto-animate": "^0.8.0",
"@headlessui/react": "^1.7.17",
"@hookform/resolvers": "^3.1.1",
"@mui/base": "5.0.0-beta.21",
"@t3-oss/env-nextjs": "^0.6.1",
"@tanstack/react-query": "^4.35.3",
"@types/node": "20.1.3",
Expand Down
116 changes: 87 additions & 29 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions src/app/[locale]/dashboard/listings/(list)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ import { LocalePathParam, SearchParams } from "@/utils/types";
export default async function Page({ searchParams, params }: SearchParams & LocalePathParam) {
const page = searchParams["PageNumber"] ?? "1";
const parsedSearchParams = DashboardListingFilterSchema.parse(searchParams);
const [session, listings] = await Promise.all([
const [session, listings, brands] = await Promise.all([
getSession(),
transformListingsListResponse(await api.getListings({ PageNumber: Number(page), ...parsedSearchParams })),
api.getVehicleBrands()
]);

if (listings.items?.length === 0 && page !== "1") {
Expand All @@ -26,7 +27,7 @@ export default async function Page({ searchParams, params }: SearchParams & Loca
<DashboardListingsContextProvider>
<DashboardListHeader
addNewButton={{ label: "New Advert", path: "/dashboard/new-listing" }}
filter={<DashboardAllListFilter />}
filter={<DashboardAllListFilter vehicleBrands={brands}/>}
itemCount={listings.totalCount}
/>
<DashboardAllListingsList basePath="/dashboard/listings" listings={listings} userClaims={session?.user} />
Expand Down
Loading

0 comments on commit 4c98b5e

Please sign in to comment.