Skip to content

Commit

Permalink
feat: add default validators (#1507)
Browse files Browse the repository at this point in the history
**Issue number:** ADDON-76440

### PR Type

**What kind of change does this PR introduce?**
* [x] Feature
* [ ] Bug Fix
* [x] Refactoring (no functional or API changes)
* [ ] Documentation Update
* [ ] Maintenance (dependency updates, CI, etc.)

## Summary
Added default validators for api_key and account in
`globalConfig.json.template` file

### Changes
Added default validator in `globalConfig.json.template` file so that
user didn't get warnings in their terminal. For not having validations
for their entities.

### User experience
No change in user experience

## Checklist

If an item doesn't apply to your changes, leave it unchecked.

* [x] I have performed a self-review of this change according to the
[development
guidelines](https://splunk.github.io/addonfactory-ucc-generator/contributing/#development-guidelines)
* [ ] Tests have been added/modified to cover the changes [(testing
doc)](https://splunk.github.io/addonfactory-ucc-generator/contributing/#build-and-test)
* [ ] Changes are documented
* [x] PR title and description follows the [contributing
principles](https://splunk.github.io/addonfactory-ucc-generator/contributing/#pull-requests)
  • Loading branch information
hetangmodi-crest authored Dec 13, 2024
1 parent 78e5d7a commit cdd3f31
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,15 @@
"field": "api_key",
"help": "API key",
"required": true,
"encrypted": true
"encrypted": true,
"validators": [
{
"type": "string",
"errorMsg": "Length of API key should be between 1 and 50",
"minLength": 1,
"maxLength": 50
}
]
}
],
"title": "Accounts"
Expand Down Expand Up @@ -108,7 +116,15 @@
},
"help": "Account to use for this input.",
"field": "account",
"required": true
"required": true,
"validators": [
{
"type": "string",
"errorMsg": "Length of account name should be between 1 and 100",
"minLength": 1,
"maxLength": 100
}
]
}
],
"inputHelperModule": "{{addon_input_name}}_helper",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,15 @@
"field": "api_key",
"help": "API key",
"required": true,
"encrypted": true
"encrypted": true,
"validators": [
{
"type": "string",
"errorMsg": "Length of API key should be between 1 and 50",
"minLength": 1,
"maxLength": 50
}
]
}
],
"title": "Accounts"
Expand Down Expand Up @@ -108,7 +116,15 @@
},
"help": "Account to use for this input.",
"field": "account",
"required": true
"required": true,
"validators": [
{
"type": "string",
"errorMsg": "Length of account name should be between 1 and 100",
"minLength": 1,
"maxLength": 100
}
]
}
],
"inputHelperModule": "demo_input_helper",
Expand Down

0 comments on commit cdd3f31

Please sign in to comment.