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

Combining Vue Simulator Versioning PRs #337

Open
wants to merge 39 commits into
base: main
Choose a base branch
from

Conversation

aryanndwi123
Copy link
Contributor

@aryanndwi123 aryanndwi123 commented Jul 16, 2024

Fixes #372

Describe the changes you have made in this PR -

Combining all the PRs related to Vue simulator versioning

Screenshots of the changes (If any) -

#332 - Enable the Main simulator to dynamically load the Vue simulator.

#327 - build: script modification for different builds.

#327 - chore: adding versioned directory(v0 and v1).

Key Achievements:

  • Versioning Directories:

    • Implemented separate version-specific directories (v0, v1, etc.) to manage multiple versions of the Vue simulator, allowing for independent development and maintenance of each version.
  • Modifying the Build Script:

    • Customized the build process by creating version-specific Vite configuration files (vite.config.v0.ts, vite.config.v1.ts) to ensure proper building and output management for each simulator version.
  • Bash Script for Multi-Version Builds:

    • Developed a bash script to automate the building of multiple simulator versions, making it easier to manage and deploy all versions simultaneously.
  • Hot-Swapping Vue Simulator Versions:

    • Enabled dynamic version switching of the Vue simulator from the main CircuitVerse repository based on the simver query parameter, allowing users to seamlessly switch between different versions.
  • Dynamic Script Injection:

    • Implemented an HTML script injection mechanism using createHtmlPlugin in Vite, ensuring that the correct version-specific script tags are dynamically inserted into the index.html during the build process.
  • Storing Simulator Version in Circuit Data:

    • Added a field in the circuit_data to store the simulator version, enabling circuits to be loaded with the appropriate simulator version based on their creation version.
  • Redirecting to Correct Simulator Version:

    • Implemented logic to redirect users to the correct simulator version based on the stored simulatorVersion in circuit_data, ensuring compatibility and functionality.
  • Creation of index-cv.html:

    • Created a separate index-cv.html to serve as the entry point for the main repository, while the default index.html continues to serve the cv-frontend-vue repository, maintaining stability during development.
  • Setting v0 as Default Simulator:

    • Configured the development environment to use v0 as the default simulator version, ensuring consistency during the development process.
  • Fixing Circuit Preview Image Issue:

    • Resolved the bug where circuit preview images were not displaying in the Vue simulator by adding image attachment functionality during the circuit creation process.
  • Version-Specific Links for Launching Circuits:

    • Updated the launch button links to dynamically include the correct simulator version, ensuring users are directed to the appropriate version of the simulator when accessing a circuit.

Future Work:

  • Writing comprehensive tests for all Ruby on Rails code.
  • Designing and implementing UI/UX for version switching.
  • Creating a dialog box to appear when switching versions.
  • Enabling embed mode for circuits of different versions.
  • Automatically configuring Netlify deployments to point to /simulatorvue

Note: Please check Allow edits from maintainers. if you would like us to assist in the PR.

Summary by CodeRabbit

  • New Features

    • Introduced a new build automation script for managing multiple version builds.
    • Added a foundational HTML structure for the "CircuitVerse" web application.
    • Implemented a context menu for user interactions, enhancing usability.
    • Created various dialog components for exporting projects, managing custom shortcuts, and importing files.
    • Developed a dynamic dropdown menu for user actions and navigation.
    • Enhanced theme management with a user-friendly interface for applying and customizing themes.
  • Bug Fixes

    • Resolved issues with the visibility and functionality of navigation elements.
  • Documentation

    • Updated documentation to reflect new components and functionalities.
  • Style

    • Improved styling for navigation and dialog components for better user experience.

Copy link

netlify bot commented Jul 16, 2024

Deploy Preview for circuitverse ready!

Name Link
🔨 Latest commit e92d95b
🔍 Latest deploy log https://app.netlify.com/sites/circuitverse/deploys/66d4769e0e965500086d8653
😎 Deploy Preview https://deploy-preview-337--circuitverse.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ESLint found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

// const { activeCircuit } = toRefs(simulatorStore)
name = name || 'Untitled'
name = stripTags(name)
scopeList[id].name = name

Check warning

Code scanning / CodeQL

Prototype-polluting assignment Medium

This assignment may alter Object.prototype if a malicious '__proto__' string is injected from
user controlled input
.
scope.backups[scope.backups.length - 1] !== backup
) {
scope.backups.push(backup)
scope.history = []

Check warning

Code scanning / CodeQL

Prototype-polluting assignment Medium

This assignment may alter Object.prototype if a malicious '__proto__' string is injected from
user controlled input
.
) {
scope.backups.push(backup)
scope.history = []
scope.timeStamp = new Date().getTime()

Check warning

Code scanning / CodeQL

Prototype-polluting assignment Medium

This assignment may alter Object.prototype if a malicious '__proto__' string is injected from
user controlled input
.
*/
function loadModule(data, scope) {
// Create circuit element
var obj = new modules[rectifyObjectType(data.objectType)](

Check failure

Code scanning / CodeQL

Unvalidated dynamic method call High

Invocation of method with
user-controlled
name may dispatch to unexpected target and cause an exception.
@JoshVarga JoshVarga added the GSOC'24 PR's for GSoC'24 label Jul 28, 2024
Copy link
Contributor

coderabbitai bot commented Sep 1, 2024

Walkthrough

The changes introduce a new build automation script, multiple Vue components for user interaction, and structured JSON files for configuration and data management. Key updates include a responsive navigation bar, various dialog boxes for project management, and enhanced user interface elements for circuit simulation. The overall structure emphasizes modularity and reusability across components, facilitating a more organized and efficient development process.

Changes

Files Change Summary
build.sh, package.json New build script automates version-specific builds; package.json updated to use this script.
index-cv.html, index.html, netlify.toml New HTML structure for the application; updated paths and redirects for version management.
v0/src/App.vue, v0/src/components/... Multiple new Vue components added for UI elements, including dialogs and panels for user interaction.
v0/src/assets/constants/... New JSON files introduced for navigation data, user data, button configurations, and theme settings.
v0/src/components/Navbar/..., v0/src/components/Extra.vue New navigation and layout components created to improve user experience and organization.
v0/src/components/DialogBox/..., v0/src/components/Panels/... Various dialog and panel components added for managing project properties and circuit elements.
v0/src/components/Shared/..., v0/src/components/Logo.vue New shared components for dropdowns, help buttons, and logo integration into the navigation.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Navbar
    participant DialogBox
    participant ProjectStore

    User->>Navbar: Clicks on project
    Navbar->>DialogBox: Opens project dialog
    DialogBox->>ProjectStore: Fetches project data
    ProjectStore-->>DialogBox: Returns project data
    DialogBox-->>User: Displays project options
Loading

🐰 In a world of circuits and code,
I hop along this bright new road.
With panels and buttons, oh what a sight,
Building dreams both day and night.
So let’s celebrate with a joyful cheer,
For changes have come, let’s give a big cheer! 🎉


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GSOC'24 PR's for GSoC'24
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Combining all the PRs into one for running tests
2 participants