Fix: ManageUsers component missing useAuth() - caused blank admin page
The ManageUsers sub-component referenced user?.role for conditional role dropdown options but didn't call useAuth() to get the user object. This caused 'user is not defined' JS errors and blank admin pages. Browser E2E: 20/20 tests pass.
This commit is contained in:
+29
-19
@@ -1,19 +1,16 @@
|
||||
version: '3.9'
|
||||
name: timesheet
|
||||
|
||||
services:
|
||||
# ─── PostgreSQL ─────────────────────────────────────────
|
||||
db:
|
||||
image: postgres:16-alpine
|
||||
container_name: coastal-db
|
||||
restart: always
|
||||
container_name: timesheet-db
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_USER: coastal
|
||||
POSTGRES_PASSWORD: ${DB_PASSWORD:-coastal_secret}
|
||||
POSTGRES_DB: coastal_timesheet
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
ports:
|
||||
- '127.0.0.1:5432:5432'
|
||||
healthcheck:
|
||||
test: ['CMD-SHELL', 'pg_isready -U coastal -d coastal_timesheet']
|
||||
interval: 10s
|
||||
@@ -22,14 +19,17 @@ services:
|
||||
start_period: 10s
|
||||
networks:
|
||||
- coastal
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
memory: 256M
|
||||
|
||||
# ─── Backend API ────────────────────────────────────────
|
||||
backend:
|
||||
build:
|
||||
context: ../
|
||||
dockerfile: docker/backend/Dockerfile
|
||||
container_name: coastal-backend
|
||||
restart: always
|
||||
container_name: timesheet-backend
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
@@ -37,9 +37,9 @@ services:
|
||||
DATABASE_URL: postgresql://coastal:${DB_PASSWORD:-coastal_secret}@db:5432/coastal_timesheet
|
||||
JWT_SECRET: ${JWT_SECRET:-change-me-in-production-jwt-secret-2026}
|
||||
JWT_REFRESH_SECRET: ${JWT_REFRESH_SECRET:-change-me-in-production-refresh-secret-2026}
|
||||
PORT: '3001'
|
||||
NODE_ENV: ${NODE_ENV:-production}
|
||||
CORS_ORIGINS: ${CORS_ORIGINS:-http://localhost,http://localhost:3000,http://100.94.106.120:8080}
|
||||
PORT: '3004'
|
||||
NODE_ENV: production
|
||||
CORS_ORIGINS: https://ts.bizzle.cloud,http://localhost
|
||||
SMTP_HOST: ${SMTP_HOST:-}
|
||||
SMTP_PORT: ${SMTP_PORT:-587}
|
||||
SMTP_USER: ${SMTP_USER:-}
|
||||
@@ -47,28 +47,33 @@ services:
|
||||
SMTP_FROM: ${SMTP_FROM:-}
|
||||
ADMIN_EMAIL: ${ADMIN_EMAIL:-bizzle@coastalcontracting.com}
|
||||
ports:
|
||||
- '127.0.0.1:3001:3001'
|
||||
- '127.0.0.1:3004:3004'
|
||||
- '172.18.0.1:3004:3004'
|
||||
healthcheck:
|
||||
test: ['CMD', 'node', '-e', "fetch('http://localhost:3001/api/health').then(r=>{if(!r.ok)throw 1}).catch(()=>process.exit(1))"]
|
||||
test: ['CMD', 'node', '-e', "fetch('http://localhost:3004/api/health').then(r=>{if(!r.ok)throw 1}).catch(()=>process.exit(1))"]
|
||||
interval: 15s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 30s
|
||||
networks:
|
||||
- coastal
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
memory: 256M
|
||||
|
||||
# ─── Frontend (Nginx) ──────────────────────────────────
|
||||
frontend:
|
||||
build:
|
||||
context: ../
|
||||
dockerfile: docker/frontend/Dockerfile
|
||||
container_name: coastal-frontend
|
||||
restart: always
|
||||
container_name: timesheet-frontend
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
backend:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- '100.94.106.120:8080:80'
|
||||
- '127.0.0.1:8083:80'
|
||||
- '172.18.0.1:8083:80'
|
||||
volumes:
|
||||
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
|
||||
healthcheck:
|
||||
@@ -79,10 +84,15 @@ services:
|
||||
start_period: 10s
|
||||
networks:
|
||||
- coastal
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
memory: 128M
|
||||
|
||||
volumes:
|
||||
pgdata:
|
||||
driver: local
|
||||
external: true
|
||||
name: coastal_pgdata
|
||||
|
||||
networks:
|
||||
coastal:
|
||||
|
||||
Reference in New Issue
Block a user