From afd43ee41f8498e85fd7bdea7e5be49371883d1c Mon Sep 17 00:00:00 2001 From: ujjwal-ab Date: Fri, 28 Jul 2023 18:36:05 +0530 Subject: [PATCH] fix: update readme and add preview image --- oscontrib/README.md | 19 +- oscontrib/configurationSettings.svg | 2003 ++++++++++++++++++++ oscontrib/connectionSettings.svg | 2653 +++++++++++++++++++++++++++ oscontrib/inputFile.json | 73 - scripts/configGenerator.py | 3 +- scripts/template-db-config.json | 2 +- scripts/template-ui-config.json | 16 + test/configData/db-config.json | 4 +- test/configData/inputData.json | 100 +- test/configData/ui-config.json | 75 +- 10 files changed, 4815 insertions(+), 133 deletions(-) create mode 100644 oscontrib/configurationSettings.svg create mode 100644 oscontrib/connectionSettings.svg delete mode 100644 oscontrib/inputFile.json diff --git a/oscontrib/README.md b/oscontrib/README.md index ae371e297..d20a3eb3f 100644 --- a/oscontrib/README.md +++ b/oscontrib/README.md @@ -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. @@ -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 diff --git a/oscontrib/configurationSettings.svg b/oscontrib/configurationSettings.svg new file mode 100644 index 000000000..7320927d5 --- /dev/null +++ b/oscontrib/configurationSettings.svg @@ -0,0 +1,2003 @@ + + + + diff --git a/oscontrib/connectionSettings.svg b/oscontrib/connectionSettings.svg new file mode 100644 index 000000000..bc16c42f6 --- /dev/null +++ b/oscontrib/connectionSettings.svg @@ -0,0 +1,2653 @@ + + + + diff --git a/oscontrib/inputFile.json b/oscontrib/inputFile.json deleted file mode 100644 index 5682d88d8..000000000 --- a/oscontrib/inputFile.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "displayName": "aNewDest", - "formFields": [ - { - "type": "", - "label": "", - "configKey": "key1", - "required": true, - "regex": "", - "placeholder": "", - "secret": false, - "preRequisites": { - "fields": [ - { - "configKey": "", - "value": "" - } - ] - } - }, - { - "type": "", - "label": "", - "configKey": "key3", - "required": true, - "regex": "", - "placeholder": "", - "secret": false, - "preRequisites": { - "fields": [ - { - "configKey": "", - "value": "" - } - ] - } - }, - { - "type": "", - "label": "", - "configKey": "key2", - "required": "false", - "regex": "", - "placeholder": "", - "secret": false, - "preRequisites": { - "fields": [ - { - "configKey": "", - "value": "" - } - ] - } - }, - { - "type": "", - "label": "", - "configKey": "key4", - "required": "false", - "regex": "", - "placeholder": "", - "secret": false, - "preRequisites": { - "fields": [ - { - "configKey": "", - "value": "" - } - ] - } - } - ] -} diff --git a/scripts/configGenerator.py b/scripts/configGenerator.py index 94cce318f..1a1fdaf4d 100644 --- a/scripts/configGenerator.py +++ b/scripts/configGenerator.py @@ -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 @@ -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) diff --git a/scripts/template-db-config.json b/scripts/template-db-config.json index e319257b7..0e8f50817 100644 --- a/scripts/template-db-config.json +++ b/scripts/template-db-config.json @@ -19,7 +19,7 @@ "cordova", "warehouse" ], - "supportedConnectionModes": {}, + "supportedConnectionModes": [], "destConfig": { "defaultConfig": [] }, diff --git a/scripts/template-ui-config.json b/scripts/template-ui-config.json index a60aeba73..33539a767 100644 --- a/scripts/template-ui-config.json +++ b/scripts/template-ui-config.json @@ -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": [] + } + ] } ] }, diff --git a/test/configData/db-config.json b/test/configData/db-config.json index 57860343b..346399176 100644 --- a/test/configData/db-config.json +++ b/test/configData/db-config.json @@ -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 } diff --git a/test/configData/inputData.json b/test/configData/inputData.json index 3afea4a04..1c29954cf 100644 --- a/test/configData/inputData.json +++ b/test/configData/inputData.json @@ -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" } ] } diff --git a/test/configData/ui-config.json b/test/configData/ui-config.json index 803b69b93..e0cd5415e 100644 --- a/test/configData/ui-config.json +++ b/test/configData/ui-config.json @@ -18,21 +18,35 @@ "configKey": "key1", "regex": "^(.{1,100})$", "placeholder": "value1", - "secret": false, - "preRequisites": { "fields": [{ "configKey": "", "value": "" }] } + "secret": false }, { "type": "textInput", - "label": "Label3", - "configKey": "key3", + "label": "Label2", + "configKey": "key2", "regex": "^(.{1,100})$", - "placeholder": "value3", - "secret": false, - "preRequisites": { "fields": [{ "configKey": "", "value": "" }] } + "placeholder": "value2", + "secret": false } ] } ] + }, + { + "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": [] + } + ] } ] }, @@ -49,22 +63,51 @@ "title": "Configure settings", "fields": [ { - "type": "textInput", - "label": "Label2", - "configKey": "key2", - "regex": "^(.{1,100})$", - "placeholder": "value2", - "secret": false, - "preRequisites": { "fields": [{ "configKey": "", "value": "" }] } + "type": "checkbox", + "label": "Label3", + "note": "Any additional note for this field", + "configKey": "key3", + "default": true }, { "type": "textInput", "label": "Label4", "configKey": "key4", - "regex": "^(.{1,100})$", + "regex": "^(.{0,100})$", "placeholder": "value4", "secret": false, - "preRequisites": { "fields": [{ "configKey": "", "value": "" }] } + "preRequisites": { "fields": [{ "configKey": "key3", "value": true }] } + }, + { + "type": "singleSelect", + "configKey": "key5", + "label": "Label5", + "note": "Any additional note for this field", + "options": [ + { "label": "optionLabel1", "value": "optionKey1" }, + { "label": "optionLabel2", "value": "optionKey2" }, + { "label": "optionLabel3", "value": "optionKey3" } + ], + "default": "optionKey2" + }, + { + "type": "multiSelect", + "label": "Label6", + "configKey": "key6", + "note": "Any additional note for this field", + "options": [ + { "label": "optionLabel1", "value": "optionKey1" }, + { "label": "optionLabel2", "value": "optionKey2" } + ], + "default": ["optionKey1"] + }, + { + "type": "tagInput", + "label": "Label7", + "configKey": "key7", + "note": "Any additional note for this field", + "tagKey": "tagKey1", + "placeholder": "e.g: Credit card visit" } ] }