-
Notifications
You must be signed in to change notification settings - Fork 11
feat: mock data generator #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Caution Review failedThe pull request is closed. WalkthroughA new "Mock Data Generator" feature was added to the application, introducing a dedicated mode accessible via the main UI. This feature allows users to define or select JSON schemas, generate mock data using faker.js, and view or copy the results in JSON or CSV formats. The UI includes schema presets, a schema editor, output view toggling (JSON/table), and integrated markdown documentation. Supporting CSS styles were introduced for the new components, including dark mode variants. The JavaScript logic was extended to handle schema parsing, data generation, view switching, copy functionality, and documentation rendering. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UI (HTML)
participant JS Logic
participant Faker.js
participant Marked.js
User->>UI (HTML): Selects "Mock Data" mode
UI (HTML)->>JS Logic: Triggers switchMode("mockgen")
JS Logic->>UI (HTML): Shows mockgen-section
User->>UI (HTML): Selects schema preset or edits schema
User->>UI (HTML): Enters record count
User->>UI (HTML): Clicks "Generate"
UI (HTML)->>JS Logic: Calls generateMockData()
JS Logic->>Faker.js: Generates mock data from schema
JS Logic->>UI (HTML): Updates output (JSON/table), stats
User->>UI (HTML): Switches to Docs tab
UI (HTML)->>JS Logic: Calls renderMockgenDocs()
JS Logic->>Marked.js: Converts markdown to HTML
JS Logic->>UI (HTML): Displays docs preview
User->>UI (HTML): Clicks "Copy JSON/CSV"
UI (HTML)->>JS Logic: Calls copyMockOutput(format)
JS Logic->>UI (HTML): Copies data to clipboard
Poem
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Summary by CodeRabbit