Skip to content

Commit

Permalink
fix: added regexes in UI
Browse files Browse the repository at this point in the history
  • Loading branch information
anantjain45823 committed Sep 15, 2024
1 parent 9c7c5fe commit e34eff3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"cloud": ["cloud"],
"warehouse": ["cloud"]
},
"isAudienceSupported": true,
"supportsBlankAudienceCreation": true,
"syncBehaviours": ["mirror"],
"disableJsonMapper": true,
Expand Down
8 changes: 4 additions & 4 deletions src/configurations/destinations/amazon_audience/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"configSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"required": ["advertiserId"],
"required": ["authServer"],
"properties": {
"authServer": {
"type": "string",
Expand All @@ -25,18 +25,18 @@
"type": "boolean",
"default": false
},
"dataSourceCountry": {
"dataSourceCountry": {
"type": "array",
"items": {
"type": "object",
"properties": {
"country": {
"type": "string",
"pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,5})$"
"pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$"
}
}
}
},
} ,
"connectionMode": {
"type": "object",
"properties": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"preRequisites": {
"fields": [
{
"configKey": "rudderAdvertiserId",
"configKey": "rudderAccountId",
"exists": true
}
]
Expand Down Expand Up @@ -95,13 +95,17 @@
"type": "textInput",
"label": "Type External Audience Id to use while creating Audience",
"placeholder": "Default: Rudderstack Audience",
"regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,50})$",
"regexErrorMessage": "Invalid External Audience Id",
"default": "Rudderstack Audience"
},
{
"configKey": "ttl",
"type": "textInput",
"label": "Time To Live",
"placeholder": "Default: 34300800(13 Months)",
"regexErrorMessage": "ttl should be in number",
"regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^[0-9]\\d*$",
"note": [
"Refer below link for more info",
{
Expand Down
5 changes: 3 additions & 2 deletions test/data/validation/destinations/amazon_audience.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
"testTitle": "With missing accountId",
"config": {
"rudderAccountId": "test-host",
"audienceId": "test-audience-id"
"audienceId": "test-audience-id",
"advertiserId": ""
},
"result": false,
"err": [" must have required property 'advertiserId'"]
"err": ["advertiserId must match pattern \"(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,50})$\""]
}
]

0 comments on commit e34eff3

Please sign in to comment.