e2corporation commented on PR #2886:
URL: 
https://github.com/apache/incubator-devlake/pull/2886#issuecomment-1232690758

   > Wouldn't it be better to define the properties of the field like this:
   > 
   > ```
   > ...
   > {
   >     "authentication": "token",
   >     "fields": [
   >         {
   >             "name": "name",
   >             "label": "Connection Name",
   >             "placeholder": "eg.GitLab",
   >             "enable": true,
   >             "required": true,
   >             "readonly": false
   >         },
   >         {
   >             "name": "endpoint",
   >             "label": "Endpoint URL",
   >             "placeholder": "eg. https://gitlab.com/api/v4/";
   >         },
   >         {
   >             "name": "token",
   >             "label": "Access Token",
   >             "placeholder": "eg. ff9d1ad0e5c04f1f98fa"
   >         }
   >     ]
   > }
   > ...
   > ```
   > 
   > This has at least the following benefits:
   > 
   > * Focus on all properties of a field when defining fields, rather than 
defining them in scattered places.
   > * The form of the fileds array can solve the sorting problem of the 
fields, and the way of using the JSON object is likely to cause the problem of 
the traversal order.
   > 
   > In addition, do you need to add some other attributes to the field, such as
   > 
   > * showType, which represents front-end display components, such as input, 
select, checkbox, etc.
   > * validation, which represents standard validation rules, including 
regular validation, length validation, etc.
   > * multiple, which means that it is a multiple format, such as the PAT of 
the GitHub plugin, you can fill in multiple.
   > 
   > There is some information in this issue #2846
   
   I thought about this as well, and I agree to a certain extent and may 
re-configure the json files to be this way. The JSON schema is still being 
evaluated and worked on. For now it's easier on the user to edit 3 separate 
objects than 1 config object with 2nd level keys for everything. Additionally, 
it let's me construct the existing Variable Configurations without having to 
reduce the object configuration and transform it again into the structure I 
need.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to