Merge pull request 'Implementing_limitListing' (#26) from Implementing_limitListing into main
Deploy to S3 / deploy (push) Successful in 40s Details

Reviewed-on: #26
pull/27/head
ahmed.mujtaba 2026-08-25 07:56:35 +00:00
commit 39af6445b4
5 changed files with 30 additions and 7 deletions

4
.env.example Normal file
View File

@ -0,0 +1,4 @@
# Copy to `.env` at the repo root (gitignored) if you want plain
# `docker compose up -d --build` to interpolate ${FRONTEND_PORT} etc.
# from backend/.env. Secrets stay in backend/.env only — never commit .env.
COMPOSE_ENV_FILES=./backend/.env

14
.gitignore vendored
View File

@ -34,13 +34,13 @@ __pycache__/
venv/
env/
# Environment / secrets — app secrets only in backend/.env (never commit it).
# Root .env is a Compose pointer (COMPOSE_ENV_FILES) with no secrets; keep it.
backend/.env
# Environment / secrets — NEVER commit real .env files
.env
**/.env
.env.*
!.env
**/.env.*
!.env.example
!backend/.env.example
!**/.env.example
!frontend/.env.development
!frontend/.env.production
@ -71,3 +71,7 @@ tests/**
# Paper form source documents (Annexure A/E/J) — reference material, not code.
# Root-anchored: backend/candidate_forms/ is the forms domain package and IS tracked.
/candidate_forms/
frontend/dist/** */
docker.local.frontend/dist/** */
frontend/dist/index.html
frontend/dist/index.html

View File

@ -23,7 +23,7 @@
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Belleza&family=Inter:wght@400;500;600;700;800&display=swap" />
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><rect width='100' height='100' rx='22' fill='%23004d43'/><g transform='translate(14 32) scale(0.72)'><path d='M100 3.65C97.86 20.99 91.89 43.03 79.48 55.33 76 58.77 71.84 61.46 66.96 62.14 50.4 64.46 41.84 47.5 29.07 42.7 21.85 39.98 14.5 42.02 9.66 47.95 6.54 51.78 4.49 56.35 2.97 61.13 2.41 61.64 0.97 61.66 0 61.31L0 0.13C1.05 0 2.27 0.02 3.09 0.28 14.9 15.86 26.77 30.82 40.15 45.28L60.79 24.7C67.38 18.22 74.41 12.74 82.59 8.51 88.11 5.83 93.64 3.93 100 3.65Z' fill='%23ceff71'/></g></svg>" />
<script type="module" crossorigin src="/assets/index-B8pMatmW.js"></script>
<script type="module" crossorigin src="/assets/index-CsixWp5R.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index--H0MdQBQ.css">
</head>
<body>

View File

@ -48,7 +48,17 @@ function css(name) { return getComputedStyle(document.documentElement).getProper
const dpr = window.devicePixelRatio || 1;
const rect = canvas.getBoundingClientRect();
const w = rect.width || canvas.clientWidth || 600;
const h = parseInt(canvas.getAttribute('height')) || 260;
// The LOGICAL height, remembered on first setup. Reading the `height`
// attribute here instead would read back the DEVICE-pixel value written
// below (h * dpr): with dpr > 1 every redraw multiplied the canvas by dpr,
// and the ResizeObserver on the auto-height .chart-wrap fed each growth
// straight back in — canvases reached millions of px tall and the chart
// became an invisible speck at the top of a giant blank canvas.
let h = Number(canvas.dataset.baseHeight);
if (!h) {
h = parseInt(canvas.getAttribute('height')) || 260;
canvas.dataset.baseHeight = String(h);
}
canvas.width = w * dpr; canvas.height = h * dpr;
canvas.style.height = h + 'px';
const ctx = canvas.getContext('2d');

View File

@ -29,6 +29,11 @@ export default function Chart({ type, data, options, height = 260, className = '
const canvas = ref.current
if (!canvas || typeof Charts[type] !== 'function') return undefined
// setup() caches the logical height on first draw (dataset.baseHeight) so a
// redraw never reads back the device-pixel height it wrote. Clear it here so
// a changed `height` prop is picked up rather than the stale cached value.
delete canvas.dataset.baseHeight
const draw = () => {
if (canvas.isConnected && canvas.getBoundingClientRect().width > 0) {
Charts[type](canvas, data, options)