Skip to content

Commit

Permalink
fix: update readme and add preview image
Browse files Browse the repository at this point in the history
  • Loading branch information
ujjwal-ab committed Jul 28, 2023
1 parent a5a4541 commit afd43ee
Show file tree
Hide file tree
Showing 10 changed files with 4,815 additions and 133 deletions.
19 changes: 17 additions & 2 deletions oscontrib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@ Thanks for taking the time for contributing to this project!

## How you can contribute a destination to this project

To contribute a destination, you need to provide the all the required data for all the fields you want as the settings to configure the destination.
To contribute a destination, you need to provide all the required data for all the fields you want as the settings to configure the destination.

## How you can provide your destination connection setting details

You can checkout the sample input file [**here**](https://github.com/rudderlabs/rudder-integrations-config/blob/config-generator-script/oscontrib/inputFile.json):
You can checkout the sample input file [**here**](https://github.com/rudderlabs/rudder-integrations-config/blob/config-generator-script/test/configData/inputData.json):

For the above input data, the UI will look like as shown below:

![](./connectionSettings.svg)
![](./configurationSettings.svg)

In the input file, you need to provide the destination name you want to display in the UI in the displayName field.

Expand All @@ -26,6 +31,16 @@ Description of Keys inside each JSON object:
| secret | You can provide true as a value to make this field as secret or false |
| preRequisites | You can add the configKey and value if you there is a preRequiste field for this field |

The input field types that you can add are:

| type | Description |
| ------------ | ------------------------------------------------------------------------- |
| textInput | This is a simple field for adding text inputs |
| checkbox | This is used for boolean values (true or false) |
| singleSelect | This is used for choosing one of the option from a set of defined options |
| multiSelect | This is used for choosing multiple options from a set of defined options |
| tagInput | This can be used to add multiple text inputs for a field |

You can also contribute to any open-source RudderStack project. View our [**GitHub page**](https://github.com/rudderlabs) to see all the different projects.

## Getting help
Expand Down
2,003 changes: 2,003 additions & 0 deletions oscontrib/configurationSettings.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2,653 changes: 2,653 additions & 0 deletions oscontrib/connectionSettings.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
73 changes: 0 additions & 73 deletions oscontrib/inputFile.json

This file was deleted.

3 changes: 2 additions & 1 deletion scripts/configGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def generateConfigs(data) -> ConfigData:
db_config = template_db_config

db_config['displayName'] = data['displayName']
db_config['name'] = data['displayName']
formFields = data['formFields']

# Create db-config object with the same content
Expand Down Expand Up @@ -67,7 +68,7 @@ def updateUiConfig(field):


if __name__ == '__main__':
file_path = sys.argv[1] if len(sys.argv) > 1 else 'oscontrib/inputFile.json'
file_path = sys.argv[1] if len(sys.argv) > 1 else 'test/configData/inputData.json'
with open(file_path, 'r') as file:
# Load the JSON data
data = json.load(file)
Expand Down
2 changes: 1 addition & 1 deletion scripts/template-db-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"cordova",
"warehouse"
],
"supportedConnectionModes": {},
"supportedConnectionModes": [],
"destConfig": {
"defaultConfig": []
},
Expand Down
16 changes: 16 additions & 0 deletions scripts/template-ui-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,22 @@
"fields": []
}
]
},
{
"groups": [
{
"title": "Connection mode",
"note": [
"Update how you want to route events from your source to destination. ",
{
"text": "Get help deciding",
"link": "https://www.rudderstack.com/docs/destinations/rudderstack-connection-modes/"
}
],
"icon": "sliders",
"fields": []
}
]
}
]
},
Expand Down
4 changes: 2 additions & 2 deletions test/configData/db-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"cordova",
"warehouse"
],
"supportedConnectionModes": {},
"destConfig": { "defaultConfig": ["key1", "key3", "key2", "key4"] },
"supportedConnectionModes": [],
"destConfig": { "defaultConfig": ["key1", "key2", "key3", "key4", "key5", "key6", "key7"] },
"secretKeys": []
},
"options": { "isBeta": false }
Expand Down
100 changes: 62 additions & 38 deletions test/configData/inputData.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,66 +8,90 @@
"required": true,
"regex": "^(.{1,100})$",
"placeholder": "value1",
"secret": false,
"preRequisites": {
"fields": [
{
"configKey": "",
"value": ""
}
]
}
"secret": false
},
{
"type": "textInput",
"label": "Label3",
"configKey": "key3",
"label": "Label2",
"configKey": "key2",
"required": true,
"regex": "^(.{1,100})$",
"placeholder": "value3",
"secret": false,
"preRequisites": {
"fields": [
{
"configKey": "",
"value": ""
}
]
}
"placeholder": "value2",
"secret": false
},
{
"type": "textInput",
"label": "Label2",
"configKey": "key2",
"type": "checkbox",
"label": "Label3",
"required": false,
"regex": "^(.{1,100})$",
"placeholder": "value2",
"secret": false,
"preRequisites": {
"fields": [
{
"configKey": "",
"value": ""
}
]
}
"note": "Any additional note for this field",
"configKey": "key3",
"default": true
},
{
"type": "textInput",
"label": "Label4",
"configKey": "key4",
"required": false,
"regex": "^(.{1,100})$",
"regex": "^(.{0,100})$",
"placeholder": "value4",
"secret": false,
"preRequisites": {
"fields": [
{
"configKey": "",
"value": ""
"configKey": "key3",
"value": true
}
]
}
},
{
"type": "singleSelect",
"configKey": "key5",
"label": "Label5",
"note": "Any additional note for this field",
"required": false,
"options": [
{
"label": "optionLabel1",
"value": "optionKey1"
},
{
"label": "optionLabel2",
"value": "optionKey2"
},
{
"label": "optionLabel3",
"value": "optionKey3"
}
],
"default": "optionKey2"
},
{
"type": "multiSelect",
"label": "Label6",
"configKey": "key6",
"required": false,
"note": "Any additional note for this field",
"options": [
{
"label": "optionLabel1",
"value": "optionKey1"
},
{
"label": "optionLabel2",
"value": "optionKey2"
}
],
"default": ["optionKey1"]
},
{
"type": "tagInput",
"label": "Label7",
"configKey": "key7",
"required": false,
"note": "Any additional note for this field",
"tagKey": "tagKey1",
"placeholder": "e.g: Credit card visit"
}
]
}
Loading

0 comments on commit afd43ee

Please sign in to comment.