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

✨Add component that enable to add import #136

Merged
merged 2 commits into from
Apr 4, 2022

Conversation

AdrySky
Copy link
Contributor

@AdrySky AdrySky commented Mar 30, 2022

Description

This add new component called AddImport that manually added a string import to the code generator script.

Pull Request Type

  • Xircuits Core (Jupyterlab Related changes)
  • Xircuits Canvas (Custom RD Related changes)
  • Xircuits Component Library
  • Testing Automation
  • Documentation
  • Others (Please Specify)

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Tests

  1. In template category, use the AddImport component.
  2. Link a literal string to import_str port.
  3. Compile.
  4. Check the script and see does it add the import_str's value to the import.

Tested on?

  • Windows
  • Linux Ubuntu
  • Centos
  • Mac
  • Others (State here -> xxx )

Notes

Only allow one string import per component.

@AdrySky AdrySky added the enhancement New feature or request label Mar 30, 2022
@AdrySky AdrySky requested a review from MFA-X-AI March 30, 2022 07:23
@AdrySky AdrySky self-assigned this Mar 30, 2022
Copy link
Member

@MFA-X-AI MFA-X-AI left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!
A good addition to the codegen features. From this PR I can add literalVariable so that users can use any import external variables in their codegen. Now it's location in template is a bit odd since it's more of a general component. Might want to consider having a special section for components like these.
Note:
There was a missing self.import_str which I added.

@MFA-X-AI MFA-X-AI merged commit 3c573a9 into master Apr 4, 2022
@MFA-X-AI MFA-X-AI deleted the adry/add-import-component branch April 4, 2022 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants