From 94f071db567852f119c79f783bbce0163cbd4aa6 Mon Sep 17 00:00:00 2001 From: Bradley Erickson Date: Thu, 12 Mar 2026 09:33:40 -0400 Subject: [PATCH 1/7] fixed coloring and typos on dashboard --- VERSION | 2 +- modules/wo_bulk_essay_analysis/VERSION | 2 +- .../wo_bulk_essay_analysis/assets/scripts.js | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/VERSION b/VERSION index 42ec10d5..8a8cff7e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.0+2026.03.06T16.07.48.997Z.0bfff3a0.berickson.20260303.copy.paste.reducer +0.1.0+2026.03.12T13.33.40.392Z.377c68ef.berickson.20260312.small.fixes diff --git a/modules/wo_bulk_essay_analysis/VERSION b/modules/wo_bulk_essay_analysis/VERSION index 42ec10d5..8a8cff7e 100644 --- a/modules/wo_bulk_essay_analysis/VERSION +++ b/modules/wo_bulk_essay_analysis/VERSION @@ -1 +1 @@ -0.1.0+2026.03.06T16.07.48.997Z.0bfff3a0.berickson.20260303.copy.paste.reducer +0.1.0+2026.03.12T13.33.40.392Z.377c68ef.berickson.20260312.small.fixes diff --git a/modules/wo_bulk_essay_analysis/wo_bulk_essay_analysis/assets/scripts.js b/modules/wo_bulk_essay_analysis/wo_bulk_essay_analysis/assets/scripts.js index 6ed6589c..e9895ae1 100644 --- a/modules/wo_bulk_essay_analysis/wo_bulk_essay_analysis/assets/scripts.js +++ b/modules/wo_bulk_essay_analysis/wo_bulk_essay_analysis/assets/scripts.js @@ -32,7 +32,7 @@ function createBinnedPasteEventsBadge (document) { const mediumPastes = lengthBins.medium_21_200 ?? 0; const largePastes = lengthBins.long_201_plus ?? 0; const largeColor = largePastes > 0 ? 'warning' : 'secondary'; - const mediumColor = mediumPastes > 0 ? 'warning' : 'seconday'; + const mediumColor = mediumPastes > 0 ? 'warning' : 'secondary'; return createDashComponent( DASH_HTML_COMPONENTS, @@ -40,7 +40,7 @@ function createBinnedPasteEventsBadge (document) { { children: [ createPasteBadge(`${smallPastes} small (<20)`, 'secondary'), - createPasteBadge(`${mediumPastes} medium (21-200)`,mediumColor), + createPasteBadge(`${mediumPastes} medium (21-200)`, mediumColor), createPasteBadge(`${largePastes} large (201+)`, largeColor) ], className: 'd-inline' @@ -54,7 +54,7 @@ function createPasteMetricComponent (document, metricId) { switch (metricId) { case 'paste_events': - return createPasteBadge(`${pasteCount} pastes`, pasteCount > 0 ? 'secondary' : 'light', 'me-1'); + return createPasteBadge(`${pasteCount} pastes`, pasteCount > 0 ? 'warning' : 'secondary', 'me-1'); case 'paste_bins': return createBinnedPasteEventsBadge(document); case 'total_paste_chars': From b17c2ec8cd2b1cf803a50c9d74a86bf6629b3421 Mon Sep 17 00:00:00 2001 From: Bradley Erickson Date: Thu, 12 Mar 2026 12:12:02 -0400 Subject: [PATCH 2/7] updated portfolio diff to include config file so we can reuse the same build on different servers --- VERSION | 2 +- learning_observer/VERSION | 2 +- learning_observer/learning_observer/routes.py | 23 ++++++++++++++++-- modules/portfolio_diff/next.config.mjs | 7 +++++- modules/portfolio_diff/src/app/layout.js | 7 ++++++ .../src/app/students/compare/page.js | 7 ++---- .../StudentDetail/SingleEssayModel.js | 7 ++---- .../StudentDetail/StudentDetailGrowth.js | 7 ++---- .../components/StudentDetail/index.js | 7 ++---- .../app/students/components/StudentsIndex.js | 7 ++---- modules/portfolio_diff/src/app/utils/ws.js | 24 +++++++++++++++++-- 11 files changed, 68 insertions(+), 32 deletions(-) diff --git a/VERSION b/VERSION index 8a8cff7e..1a2c91d0 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.0+2026.03.12T13.33.40.392Z.377c68ef.berickson.20260312.small.fixes +0.1.0+2026.03.12T16.12.02.223Z.94f071db.berickson.20260312.small.fixes diff --git a/learning_observer/VERSION b/learning_observer/VERSION index 20ad2997..1a2c91d0 100644 --- a/learning_observer/VERSION +++ b/learning_observer/VERSION @@ -1 +1 @@ -0.1.0+2026.02.27T21.25.37.849Z.3207a114.berickson.20260220.dami.portfolio.pr +0.1.0+2026.03.12T16.12.02.223Z.94f071db.berickson.20260312.small.fixes diff --git a/learning_observer/learning_observer/routes.py b/learning_observer/learning_observer/routes.py index 763ea621..7d67f02d 100644 --- a/learning_observer/learning_observer/routes.py +++ b/learning_observer/learning_observer/routes.py @@ -480,8 +480,22 @@ async def _nextjs_handler(request): sub_url = request.match_info.get('tail') if sub_url is None: return aiohttp.web.FileResponse(os.path.join(path, 'index.html')) - # TODO will this handle multi-layered sub-urls? /foo/bar - return aiohttp.web.FileResponse(os.path.join(path, f'{sub_url}.html')) + # Normalize the subpath and ensure it stays in the exported Next.js folder. + # This allows exported assets like `runtime-config.js` to be served directly. + relative_path = sub_url.lstrip('/') + file_path = os.path.normpath(os.path.join(path, relative_path)) + if os.path.commonpath([os.path.abspath(file_path), os.path.abspath(path)]) != os.path.abspath(path): + raise aiohttp.web.HTTPNotFound() + + if os.path.isfile(file_path): + return aiohttp.web.FileResponse(file_path) + + # Handle extension-less routes exported as html files. + html_path = os.path.normpath(os.path.join(path, f'{relative_path}.html')) + if os.path.commonpath([os.path.abspath(html_path), os.path.abspath(path)]) != os.path.abspath(path): + raise aiohttp.web.HTTPNotFound() + + return aiohttp.web.FileResponse(html_path) return _nextjs_handler @@ -501,6 +515,11 @@ def register_nextjs_routes(app): tail_path = page_path + '{tail:.*}' app.router.add_get(tail_path, create_nextjs_handler(full_path)) + # Some exported apps resolve local assets under an `/_next` prefix. + # Mirror those requests back to the same exported directory. + next_prefixed_tail_path = f'/_next{page_path}' + '{tail:.*}' + app.router.add_get(next_prefixed_tail_path, create_nextjs_handler(full_path)) + def register_wsgi_routes(app): ''' diff --git a/modules/portfolio_diff/next.config.mjs b/modules/portfolio_diff/next.config.mjs index 0f9816ce..bfb66e10 100644 --- a/modules/portfolio_diff/next.config.mjs +++ b/modules/portfolio_diff/next.config.mjs @@ -1,6 +1,11 @@ /** @type {import('next').NextConfig} */ +const basePath = "/_next/wo_portfolio_diff/portfolio_diff"; + const nextConfig = { - basePath: "/_next/wo_portfolio_diff/portfolio_diff", + basePath, + env: { + NEXT_PUBLIC_BASE_PATH: basePath, + }, eslint: { ignoreDuringBuilds: true, }, diff --git a/modules/portfolio_diff/src/app/layout.js b/modules/portfolio_diff/src/app/layout.js index a588683e..132deb55 100644 --- a/modules/portfolio_diff/src/app/layout.js +++ b/modules/portfolio_diff/src/app/layout.js @@ -1,5 +1,6 @@ import Navbar from "./components/Navbar"; import { CourseIdProvider } from "@/app/providers/CourseIdProvider"; +import Script from "next/script"; import "./globals.css"; export const metadata = { @@ -11,6 +12,12 @@ export default function RootLayout({ children }) { return ( + +