Skip to content
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

Feature/2.2 text editor for tools export button functionality #230

Open
wants to merge 56 commits into
base: develop
Choose a base branch
from

Conversation

Derin4
Copy link

@Derin4 Derin4 commented Jan 28, 2025

Description

Implementations of Task 6: Implement Export Functionality

Provide a concise summary of the changes in this PR. Include the motivation behind these changes and any relevant context.
Provide a concise summary of the changes in this PR. Include the motivation behind these changes and any relevant context.
Enabling user export document generated in the Quiz generation. An export button is created alongside an export SVG icon with a transparent background that matches the design seen on the Figma design template. The export button displays a dropdown with three buttons of export format. Each button is responsible for the export of the markdownContent (the quiz generated) in the respective format.

Related Issue

No related Issue

If this PR addresses an issue, link to it here.

Type of Change

It does not relate to any issue

Please select the type(s) of change that apply and delete those that do not.

  • [*] New feature: A non-breaking change that adds functionality.

Proposed Solution

##Describe your code changes in detail. Explain how you implemented your solution and any design decisions you made.
An ExportButton component was created in the tabButton folder of the component folder. The ExportButton was exported is rendered on the UI in the QuizResponse component. Two different packages were used for the implementation of the export functionality: "jsPDF" package is used for PDF export, and "file-saver" package is used for plain text and HTML export.
Both packages were installed using npm on the terminal.
The Export button alongside it's SVG icon is contained in a single div element. It toggles onClick, displaying a dropdown div element that contains three buttons for the implementation of the three export formats.
A handler function is created for each export format button which is called onClick of the respective button. The handler function handles the export of the markdownContent. The markdownContent is accessed from the redux store using the useSelector hook. The markdownContent is formatted to display properly on the UI. A cleanText function was also created which takes in the text as its parameter, which is used to remove some display issues seen while testing.

How to Test

Provide instructions on how to test these changes. Include details on test configurations, test cases, and expected outcomes.
Login into the Marvel AI platform with the test credential, follow the steps to the point of generating a quiz. The export button is placed at the top of the markdown window. Toggle the export button to display and close the dropdown. Click any of the buttons on the dropdown to export the generate quiz in the preferred format.

Provide instructions on how to test these changes. Include details on test configurations, test cases, and expected outcomes.

Unit Tests

List the unit tests added or modified to verify your changes.

Documentation Updates

Indicate whether documentation needs to be updated due to this PR.

  • Yes
  • No

If yes, describe what documentation updates are needed and link to the relevant documentation.

Checklist

  • [*] I have performed a self-review of my code.
  • [*] I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • [*] I have added tests that prove my fix is effective or that my feature works.
  • [*] New and existing unit tests pass locally with my changes.
  • Any dependent changes have been merged and published in downstream modules.

Additional Information

Add any other information that might be useful for the reviewers.

batradev and others added 30 commits January 17, 2025 22:08
- Develop converters for Quiz, Flashcards, Worksheet, and Syllabus tools
- Update Firestore structure to store original JSON and converted Markdown
- Initialize editorState.editHistory with initial version
- Handle edge cases like empty responses and special character escaping
- Ensure no back-conversion from Markdown to JSON
- Integrate converters into the tool generation flow
- Test Markdown generation for all tool types
…s-task2

feat(conversion): implement tool-specific JSON-to-Markdown converters
@liamohkay liamohkay deleted the feature/2.2-text-editor-for-tools-export-button-functionality branch February 8, 2025 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants