feat(demo-admin-dashboard): Create admin controls for adding and edit…#1067
Open
CHKM001 wants to merge 1 commit into
Open
feat(demo-admin-dashboard): Create admin controls for adding and edit…#1067CHKM001 wants to merge 1 commit into
CHKM001 wants to merge 1 commit into
Conversation
…ing demo attachments
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.
PR #178 Pull Request: Create Admin Controls for Demo Attachments (Issue #14)
Description
This PR implements focused admin-dashboard tools for creating and editing demo attachments inside the
src/features/demo-admin-dashboard/folder. These changes enable maintainers to populate and manage mock UI attachment data deterministically and securely, completely isolated from production mail flows.Proposed Changes
All modifications and additions are strictly scoped within
src/features/demo-admin-dashboard/. No files outside this folder were modified.New Components & Features
AttachmentEditor.tsx: Renders the complete "Add Attachment" and "Edit Attachment" React forms with:Ctrl+Enter/⌘+Enterto submit the form when valid.120 KBgenerated from raw bytes).attachmentFixtures.ts: Contains 7 canonical demo attachment records matching various categories (document, proof, image, transaction, archive, data) along with ablankAttachmentDraftpreset.attachmentHelpers.ts: Pure helper functions for sorting, filtering, formatting, and validating drafts.Export Wiring
index.ts: Exposed the new models, helper validation utilities, and theAttachmentEditorcomponent.Documentation
ATTACHMENT_EDITOR.md: Dedicated documentation explaining API usage, metadata fields, validation constraints, and safety guidelines.Maintenance & Unit Tests
attachmentHelpers.test.ts: Created comprehensive tests checking all validation rules, helper functions, and fixture integrity.extractor.tsandextractor.test.tsto solve empty test suite problems.presets.test.tsto accommodate scenario datasets updated in subsequent feature milestones.Security & Safety Verification
This implementation strictly conforms to safety guidelines for demo datasets:
previewUrlis restricted to relative paths or#anchors. Anyhttp://orhttps://prefix is caught by validation and rejects form submission.isSafeSenderAddress, restricting addresses to@example.com,@example.org, or federation handles ending in*stealth.demo.Date.now()ornew Date()).dangerouslySetInnerHTML.Testing & Verification Results
All 634 tests in 57 test files compile and pass successfully under the dashboard feature directory:
Output:
Closes #178