-
Notifications
You must be signed in to change notification settings - Fork 298
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: Consumer Parameters #1921
Feat: Consumer Parameters #1921
Conversation
@EnzoVezzaro I added some chars limit for |
Hi @LucaMilanese90 absolutely, it's just fine 👍🏽 As for the limit in name I'd add ellipses (...) on the tab headers once it reaches about 15 characters, to avoid having this crazy tab header over here. the rest seems fine. If @jamiehewitt15 doesn't have anything else to add, after these little changes we should be ready to go. |
@EnzoVezzaro I updated the placeholders with one of the examples in the docs https://docs.oceanprotocol.com/core-concepts/did-ddo#consumer-parameters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this looks good. Thanks for all the hard work and making the changes
@LucaMilanese90 can you do a rebase pls, so we can have the latest fixes from main available in the PR ? |
Thanks a lot for your work on this @LucaMilanese90 @moritzkirstein. It would be great if you can also test it in production now that it has been deployed, thank you |
Consumer Parameters for Ocean Market
This PR focuses on bringing consumer parameters as defined in the docs to Ocean Market.
We are targeting the complete flow, considering publish and edit functionalities as well as handling consumption with provided user data. This PR introduces quite a few changes that I will try to summarize below.
Related to oceanprotocol/ocean.js#1730
Proposed Changes in this PR:
1. Publish Form
Add ConsumerParameters Form sections to publish form via a new
ConsumerParameters
input elementalgorithm
type assets on Step 1Metadata
, that when checked displays a new input component to add consumer parametersAccess
, that when checked displays a new input component to add consumer parametersInputElement/ConsumerParameter
component utilizes a controlled tab component to handle display of multiple parametersselect
type parameters aKeyValueInput
component is used to specify the neededparameter.options
(similar toHeaders
in url files)FormConsumerParameter
interface that specifically handles display of consumer parameters in the publish and edit formparamter.required
is a select field withRequired
andOptional
options, trying to improve UX compared to simple checkboxDefaultInput
(input forparameter.default
) changes based on the selected parameter typetext
type parameters, will use a regular text input fieldnumber
type parameters, will use a number input fieldboolean
type parameters, will use a select input field withtrue
andfalse
as optionsselect
type parameters, will use a select input field with the options generated from specified parameter.optionstransformPublishFormToDdo
utility function2. Edit Form
Add (up to) two ConsumerParameters sections to edit form
consumerParameters
for algorithms andservice.consumerParameters
for all assetsparseConsumerParameters
utility function to@utils/ddo.ts
to be able to parse DDO consumer parameter data for display in edit form3. Asset Consumption
Add
UserCustomparameters
to consumption formstext
type parameters, will use a regular text input fieldnumber
type parameters, will use a number input fieldboolean
type parameters, will use a select input field withtrue
andfalse
as optionsselect
type parameters, will use a select input field with the options parsed from DDOselect
inputs that are not required an empty option is addedDownload.tsx
to use<Formik>
to be able to collect userdataconsumerParameter
definitions from DDO4. Misc updates / refactorings
ConsumerParameter
,ServiceExtended
andMetadataExtended
types until they are released in ocean.js (Add consumer parameter types ocean.js#1730)InputeElement/Headers
toInputeElement/KeyValueInput
to be reusable for similar purposes, e.g., the select options for consumer parameters in this PRFormInput/index.tsx
with new utility helper function to get object's properties by given string path (helper function also used for consumer parameter form sections)atoms/Tabs
component controllable by exposingselectedIndex
andonSelect
from ReactTabs