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

feat(candid-ui): default values #13

Merged
merged 14 commits into from Jun 22, 2023

Conversation

ENJATZ
Copy link
Contributor

@ENJATZ ENJATZ commented Jun 2, 2023

Improved the candid-ui by adding props that allows the form to be pre-filled with data. This aims to achieve the desired functionality from ICDevs Bounty #50.

The candid-ui can now be rendered and passed the following props:

  • options:
    • defaultValues: a stringified json which equals the same parsed data provided by the form when sending a request
    • hideMethodsIdl: used to hide the methods args idl (false by default).

Whenever a user fills the candid-ui with valid data, a filled CustomEvent is being sent. In this case, event.detail contains the parsed data of the request and can be used as defaultValues.

Also added a .prettierrc to maintain the same code style across all files.

An active implementation of this merge request can be seen in the following repository: https://github.com/ENJATZ/customer-service-dapp or at link: https://u4mx2-ziaaa-aaaap-qbgva-cai.icp0.io.

Examples of pre-filled candid-ui:

@dfinity-droid-prod
Copy link

Dear @ENJATZ,

This repository does not accept external contributions yet.

We are therefore closing this Pull Request, thank you for your understanding.

— The DFINITY Foundation

@krpeacock krpeacock reopened this Jun 2, 2023
@dfinity-droid-prod
Copy link

Dear @ENJATZ,

This repository does not accept external contributions yet.

We are therefore closing this Pull Request, thank you for your understanding.

— The DFINITY Foundation

Copy link
Collaborator

@krpeacock krpeacock left a comment

Choose a reason for hiding this comment

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

Approved - just need to get CI fixed

@luismompohanden luismompohanden requested a review from a team as a code owner June 22, 2023 15:25
@luismompohanden luismompohanden merged commit e595409 into dfinity:main Jun 22, 2023
@dfinity-droid-prod
Copy link

Dear @ENJATZ,

In order to potentially merge your code in this open-source repository and therefore proceed with your contribution, we need to have your approval on DFINITY's CLA1.

If you decide to agree with it, please visit this issue and read the instructions there.

— The DFINITY Foundation

Footnotes

  1. Contributor License Agreement

@dfinity-droid-prod
Copy link

Dear @ENJATZ,

In order to potentially merge your code in this open-source repository and therefore proceed with your contribution, we need to have your approval on DFINITY's CLA1.

If you decide to agree with it, please visit this issue and read the instructions there.

— The DFINITY Foundation

Footnotes

  1. Contributor License Agreement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants