tractatus/public
TheFlow e83f8e9883 feat(admin): add publish/unpublish workflow UI to dashboard
SUMMARY:
Implemented admin UI for document publishing workflow, enabling admins
to publish internal documents to public visibility with category selection
and unpublish documents with audit trail reasoning.

CHANGES:

1. Enhanced Document List View (loadDocuments):
   - Added visibility badges (public/internal/confidential/archived)
   - Added workflow status badges (draft/review/published)
   - Added conditional Publish button (internal + not published)
   - Added conditional Unpublish button (public + published)
   - Improved layout with category display

2. Publish Modal (openPublishModal):
   - Category selection dropdown (7 categories)
   - Display order input (optional)
   - Form validation (category required)
   - Integration with POST /api/documents/:id/publish

3. Unpublish Modal (openUnpublishModal):
   - Required reason textarea (audit trail)
   - Document context display (title, visibility, category)
   - Integration with POST /api/documents/:id/unpublish

4. Badge Helper Functions:
   - getVisibilityBadge(visibility) - colored badges
   - getStatusBadge(status) - workflow state badges

5. Event Delegation:
   - Added openPublishModal, closePublishModal handlers
   - Added openUnpublishModal, closeUnpublishModal handlers

INTEGRATION:
✓ Uses existing API endpoints (tested syntax)
✓ CSP compliant (no inline styles/handlers)
✓ Follows event delegation pattern
✓ Proper form validation and error handling

TESTING:
✓ JavaScript syntax validated (node -c)
✓ CSP compliance verified (0 violations)
✓ Server accessibility confirmed (HTTP 200)

NEXT STEPS (Optional):
- Create dedicated drafts dashboard page (from SCHEDULED_TASKS.md)
- Add bulk publish operations
- Implement review workflow state transitions

FRAMEWORK COMPLIANCE:
Addresses SCHEDULED_TASKS.md item "Admin UI for Publish Workflow"
Maintains CSP compliance (inst_008)

🤖 Generated with Claude Code (https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-19 13:42:47 +13:00
..
.well-known security: comprehensive security audit and hardening 2025-10-10 05:34:40 +13:00
about style(ui): update theme, branding, and GitHub repository links 2025-10-19 12:48:29 +13:00
admin style(ui): update theme, branding, and GitHub repository links 2025-10-19 12:48:29 +13:00
css fix(csp): achieve 100% CSP compliance - zero violations 2025-10-19 13:32:24 +13:00
demos style(ui): update theme, branding, and GitHub repository links 2025-10-19 12:48:29 +13:00
downloads docs: regenerate PDFs and update documentation metadata 2025-10-14 10:53:48 +13:00
fonts fix(csp): clean all public-facing pages - 75 violations fixed (66%) 2025-10-19 13:17:50 +13:00
images fix(csp): clean all public-facing pages - 75 violations fixed (66%) 2025-10-19 13:17:50 +13:00
js feat(admin): add publish/unpublish workflow UI to dashboard 2025-10-19 13:42:47 +13:00
koha style(ui): update theme, branding, and GitHub repository links 2025-10-19 12:48:29 +13:00
locales fix(csp): clean all public-facing pages - 75 violations fixed (66%) 2025-10-19 13:17:50 +13:00
about.html fix(csp): clean all public-facing pages - 75 violations fixed (66%) 2025-10-19 13:17:50 +13:00
api-reference.html style(ui): update theme, branding, and GitHub repository links 2025-10-19 12:48:29 +13:00
architecture.html fix(csp): clean all public-facing pages - 75 violations fixed (66%) 2025-10-19 13:17:50 +13:00
blog-post.html style(ui): update theme, branding, and GitHub repository links 2025-10-19 12:48:29 +13:00
blog.html style(ui): update theme, branding, and GitHub repository links 2025-10-19 12:48:29 +13:00
case-submission.html fix(csp): clean all public-facing pages - 75 violations fixed (66%) 2025-10-19 13:17:50 +13:00
check-version.html style(ui): update theme, branding, and GitHub repository links 2025-10-19 12:48:29 +13:00
docs-viewer.html style(ui): update theme, branding, and GitHub repository links 2025-10-19 12:48:29 +13:00
docs.html fix(mobile): implement navigation toggle for document viewer 2025-10-19 12:41:48 +13:00
faq.html style(ui): update theme, branding, and GitHub repository links 2025-10-19 12:48:29 +13:00
favicon-new.svg fix(csp): clean all public-facing pages - 75 violations fixed (66%) 2025-10-19 13:17:50 +13:00
favicon.ico feat: implement Rule Manager and Project Manager admin systems 2025-10-11 17:16:51 +13:00
favicon.svg feat: comprehensive documentation improvements and GitHub integration 2025-10-09 14:33:14 +13:00
implementer.html fix(csp): clean all public-facing pages - 75 violations fixed (66%) 2025-10-19 13:17:50 +13:00
index.html fix(csp): clean all public-facing pages - 75 violations fixed (66%) 2025-10-19 13:17:50 +13:00
koha.html style(ui): update theme, branding, and GitHub repository links 2025-10-19 12:48:29 +13:00
leader.html fix(csp): clean all public-facing pages - 75 violations fixed (66%) 2025-10-19 13:17:50 +13:00
manifest.json style(ui): update theme, branding, and GitHub repository links 2025-10-19 12:48:29 +13:00
media-inquiry.html fix(csp): clean all public-facing pages - 75 violations fixed (66%) 2025-10-19 13:17:50 +13:00
media-triage-transparency.html style(ui): update theme, branding, and GitHub repository links 2025-10-19 12:48:29 +13:00
privacy.html style(ui): update theme, branding, and GitHub repository links 2025-10-19 12:48:29 +13:00
researcher.html fix(csp): clean all public-facing pages - 75 violations fixed (66%) 2025-10-19 13:17:50 +13:00
service-worker.js style(ui): update theme, branding, and GitHub repository links 2025-10-19 12:48:29 +13:00
version.json style(ui): update theme, branding, and GitHub repository links 2025-10-19 12:48:29 +13:00