diff --git a/frontend/src/components/listings/MyListingGrid.tsx b/frontend/src/components/listings/MyListingGrid.tsx
index 5fc1b065..b26ae742 100644
--- a/frontend/src/components/listings/MyListingGrid.tsx
+++ b/frontend/src/components/listings/MyListingGrid.tsx
@@ -72,14 +72,14 @@ const MyListingGrid = ({ userId }: MyListingGridProps) => {
};
fetchListings();
- }, [userId]);
+ }, [userId, auth.currentUser?.username]);
return listingInfos === null ? (
-
+
+
@
{user.username}
{user.permissions && (
-
+
{getRoleName(user.permissions)}
)}
-
+
Joined on{" "}
{user.created_at
? formatJoinDate(user.created_at)
@@ -243,128 +244,30 @@ export const RenderProfile = (props: RenderProfileProps) => {
{isEditing ? (
-
+
) : (
{user.bio ? (
{user.bio}
) : (
-
+
No bio set. Edit your profile to add a bio.
)}
@@ -382,14 +285,14 @@ export const RenderProfile = (props: RenderProfileProps) => {
{user.stripe_connect_account_id &&
!user.stripe_connect_onboarding_completed ? (
-
+
Your Stripe account setup is not complete. Please resolve
outstanding requirements to begin selling robots. It may take
some time for Stripe to process your info between submissions.
) : user.stripe_connect_onboarding_completed ? (
-
- Stripe account setup complete.
+
+ You are set up to sell robots on K-Scale.
) : (
You must complete seller onboarding to sell robots
@@ -421,12 +324,17 @@ export const RenderProfile = (props: RenderProfileProps) => {
) : (
-
navigate(ROUTES.SELL.DASHBOARD.path)}
- variant="outline"
+
- Seller Dashboard
-
+
navigate(ROUTES.SELL.DASHBOARD.path)}
+ variant="outline"
+ >
+ Seller Dashboard
+
+
)}
@@ -438,15 +346,15 @@ export const RenderProfile = (props: RenderProfileProps) => {
- Your Listings
+ Your Bot Listings
- Upvoted
+ Upvoted Bots
diff --git a/frontend/src/components/pages/SellerDashboard.tsx b/frontend/src/components/pages/SellerDashboard.tsx
index 287f4569..e2ed6284 100644
--- a/frontend/src/components/pages/SellerDashboard.tsx
+++ b/frontend/src/components/pages/SellerDashboard.tsx
@@ -45,7 +45,7 @@ export default function SellerDashboard() {
Seller Dashboard
-
Account Status
+
Account Status
@@ -53,7 +53,7 @@ export default function SellerDashboard() {
-
+
void;
+ setFirstName: (value: string) => void;
+ setLastName: (value: string) => void;
+ setBio: (value: string) => void;
+ setIsEditing: (value: boolean) => void;
+ handleSubmit: (event: React.FormEvent) => Promise;
+}
+
+const EditProfileForm: React.FC = ({
+ username,
+ firstName,
+ lastName,
+ bio,
+ isCheckingUsername,
+ isUsernameChanged,
+ isUsernameAvailable,
+ usernameError,
+ isSubmitting,
+ setUsername,
+ setFirstName,
+ setLastName,
+ setBio,
+ setIsEditing,
+ handleSubmit,
+}) => {
+ return (
+
+
+
+
+ Username
+
+
+ Changing your username will change the URL for all your posted
+ listings.
+
+
setUsername(e.target.value)}
+ className="mt-1 block w-full"
+ />
+ {isCheckingUsername && (
+
Checking username...
+ )}
+ {!isCheckingUsername && isUsernameChanged && (
+
+ {usernameError ||
+ (isUsernameAvailable
+ ? "Username is available"
+ : "Username is not available")}
+
+ )}
+
+
+
+
+
+
+ Bio
+
+ setBio(e.target.value)}
+ className="mt-1 block w-full rounded-md border-gray-11 shadow-sm focus:border-primary-9 focus:ring focus:ring-primary-9 focus:ring-opacity-50"
+ rows={3}
+ />
+
+
+ {isSubmitting ? (
+
+
+
+ ) : (
+
+ setIsEditing(false)}
+ >
+ Cancel
+
+
+ Save Changes
+
+
+ )}
+
+
+ );
+};
+
+export default EditProfileForm;
diff --git a/store/app/main.py b/store/app/main.py
index 0b50cd83..467dfde0 100644
--- a/store/app/main.py
+++ b/store/app/main.py
@@ -3,7 +3,7 @@
import logging
from contextlib import asynccontextmanager
from pathlib import Path
-from typing import AsyncGenerator, Awaitable, Callable
+from typing import AsyncGenerator
import uvicorn
from fastapi import Depends, FastAPI, HTTPException, Request, status
@@ -12,7 +12,6 @@
from fastapi.openapi.utils import get_openapi
from fastapi.responses import HTMLResponse, JSONResponse
from fastapi.security import APIKeyCookie, APIKeyHeader
-from starlette.responses import Response
from store.app.db import create_tables
from store.app.errors import (
@@ -34,18 +33,6 @@
from store.app.routers.users import router as users_router
from store.utils import get_cors_origins
-# Configure logging
-logger = logging.getLogger(__name__)
-logger.setLevel(logging.INFO)
-
-# Add a console handler if one doesn't exist
-if not logger.handlers:
- console_handler = logging.StreamHandler()
- console_handler.setLevel(logging.INFO)
- formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
- console_handler.setFormatter(formatter)
- logger.addHandler(console_handler)
-
@asynccontextmanager
async def lifespan(app: FastAPI) -> AsyncGenerator[None, None]:
@@ -81,17 +68,8 @@ async def lifespan(app: FastAPI) -> AsyncGenerator[None, None]:
)
-@app.middleware("http")
-async def log_requests(request: Request, call_next: Callable[[Request], Awaitable[Response]]) -> Response:
- logger.info(f"Request: {request.method} {request.url}")
- response = await call_next(request)
- logger.info(f"Response status: {response.status_code}")
- return response
-
-
@app.exception_handler(ValueError)
async def value_error_exception_handler(request: Request, exc: ValueError) -> JSONResponse:
- logger.error(f"ValueError: {str(exc)}")
return JSONResponse(
status_code=status.HTTP_400_BAD_REQUEST,
content={"message": "The request was invalid.", "detail": str(exc)},
@@ -100,7 +78,6 @@ async def value_error_exception_handler(request: Request, exc: ValueError) -> JS
@app.exception_handler(ItemNotFoundError)
async def item_not_found_exception_handler(request: Request, exc: ItemNotFoundError) -> JSONResponse:
- logger.error(f"ItemNotFoundError: {str(exc)}")
return JSONResponse(
status_code=status.HTTP_400_BAD_REQUEST,
content={"message": "Item not found.", "detail": str(exc)},
@@ -109,7 +86,6 @@ async def item_not_found_exception_handler(request: Request, exc: ItemNotFoundEr
@app.exception_handler(InternalError)
async def internal_error_exception_handler(request: Request, exc: InternalError) -> JSONResponse:
- logger.error(f"InternalError: {str(exc)}")
return JSONResponse(
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
content={"message": "Internal error.", "detail": str(exc)},
@@ -118,7 +94,6 @@ async def internal_error_exception_handler(request: Request, exc: InternalError)
@app.exception_handler(NotAuthenticatedError)
async def not_authenticated_exception_handler(request: Request, exc: NotAuthenticatedError) -> JSONResponse:
- logger.error(f"NotAuthenticatedError: {str(exc)}")
return JSONResponse(
status_code=status.HTTP_401_UNAUTHORIZED,
content={"message": "Not authenticated.", "detail": str(exc)},
@@ -127,7 +102,6 @@ async def not_authenticated_exception_handler(request: Request, exc: NotAuthenti
@app.exception_handler(NotAuthorizedError)
async def not_authorized_exception_handler(request: Request, exc: NotAuthorizedError) -> JSONResponse:
- logger.error(f"NotAuthorizedError: {str(exc)}")
return JSONResponse(
status_code=status.HTTP_403_FORBIDDEN,
content={"message": "Not authorized.", "detail": str(exc)},
@@ -136,7 +110,6 @@ async def not_authorized_exception_handler(request: Request, exc: NotAuthorizedE
@app.exception_handler(BadArtifactError)
async def bad_artifact_exception_handler(request: Request, exc: BadArtifactError) -> JSONResponse:
- logger.error(f"BadArtifactError: {str(exc)}")
return JSONResponse(
status_code=status.HTTP_400_BAD_REQUEST,
content={"message": f"Bad artifact: {exc}", "detail": str(exc)},