Repository navigation
refactor(ui): extract modular Jinja2 templates into templates directory - #56
Closed
abhirajadhikary06 wants to merge 1 commit into
Closed
abhirajadhikary06 wants to merge 1 commit into
abhirajadhikary06 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactors the Developer Portal frontend by decomposing the monolithic Python string templates into a clean, dedicated
src/obliq_api/templates/directory with individual HTML template files per interface.This improves maintainability, enables syntax highlighting and linting for frontend templates, and integrates standard
fastapi.templating.Jinja2Templates.Changes by File
1. New Modular Templates (
src/obliq_api/templates/)base.html:promptAuthToken()).window.addEventListener('offline')).apiFetch(), token persistence inlocalStorage, and auth indicators).keys.html:base.html.Active,Expiring,Revoked), scopes, expiry dates, and action buttons.usage.html:base.htmlwith Chart.js (chart.umd.min.js).docs.html:base.html.@obliq/client), Python (httpx), and cURL.2. Router Integration (
src/obliq_api/api/ui/router.py)fastapi.templating.Jinja2Templatespointing tosrc/obliq_api/templates/./dashboard/keys,/dashboard/usage,/dashboard/docs) to returnTemplateResponse(request=request, name="...").3. Backward Compatibility Layer (
src/obliq_api/api/ui/templates.py)KEYS_PAGE_HTML,USAGE_PAGE_HTML, andDOCS_PAGE_HTMLusing Jinja2 so that any existing scripts or test fixtures importing these constants continue to function without breaking changes.Type of Change
refactor: Non-breaking code refactoring / frontend cleanupui: Modular HTML template decompositionVerification & Testing
pytest tests/unit/: All 10 unit tests pass cleanly (2.62s).ruff check .: 100% clean, 0 lint warnings.ruff format --check .: Cleanly formatted./dashboard,/dashboard/keys,/dashboard/usage, and/dashboard/docsrender HTTP 200/307.