Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#132 Add support for the select parameter type #133

Merged
merged 5 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ extension-manager-integration-test-java/.settings/org.eclipse.jdt.ui.prefs li

registry/package-lock.json linguist-generated=true
extension-manager-integration-test-java/testing-extension/package-lock.json linguist-generated=true

pkg/parameterValidator/parameterValidator.js linguist-generated=true
kaklakariada marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@
"vmArgs": [
"-Djava.util.logging.config.file=src/test/resources/logging.properties"
]
},
"[json]": {
"editor.tabSize": 2
}
}
2 changes: 1 addition & 1 deletion dependencies.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 18 additions & 1 deletion doc/changes/changes_0.5.1.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# Extension Manager 0.5.1, released 2023-??-??

Code name:
Code name: Support `select` parameter type

## Summary

This release adds support for the `select` parameter type.

## Features

* #132: Added support for the `select` parameter type

## Documentation

* #129: Improved description of deployment process
Expand Down Expand Up @@ -37,3 +43,14 @@ Code name:

* Updated `com.exasol:project-keeper-maven-plugin:2.9.10` to `2.9.11`
* Updated `org.apache.maven.plugins:maven-enforcer-plugin:3.3.0` to `3.4.0`

### ParameterValidator

#### Compile Dependency Updates

* Updated `@exasol/extension-parameter-validator:0.2.1` to `0.3.0`

#### Development Dependency Updates

* Updated `typescript:5.1.6` to `5.2.2`
* Updated `esbuild:0.18.16` to `0.19.2`
208 changes: 104 additions & 104 deletions pkg/parameterValidator/package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions pkg/parameterValidator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
"clean": "tsc --build --clean && rm -f parameterValidator.js"
},
"dependencies": {
"@exasol/extension-parameter-validator": "0.2.1"
"@exasol/extension-parameter-validator": "0.3.0"
},
"devDependencies": {
"esbuild": "0.18.16",
"typescript": "5.1.6"
"esbuild": "0.19.2",
"typescript": "5.2.2"
}
}
}
18 changes: 16 additions & 2 deletions pkg/parameterValidator/parameterValidator.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions pkg/parameterValidator/parameterValidator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,18 @@ func (suite *ParameterValidatorSuite) TestValidateParameters() {
definitions: []interface{}{map[string]interface{}{"id": "param1", "name": "My param", "type": "boolean"}},
params: []extensionAPI.ParameterValue{{Name: "param1", Value: "true"}},
expected: []ValidationResult{}},
{name: "valid select parameter",
definitions: []interface{}{map[string]interface{}{"id": "param1", "name": "My param", "type": "select", "options": []interface{}{map[string]string{"id": "a", "name": "Value a"}, map[string]string{"id": "b", "name": "Value b"}}}},
params: []extensionAPI.ParameterValue{{Name: "param1", Value: "a"}},
expected: []ValidationResult{}},
{name: "invalid select parameter",
definitions: []interface{}{map[string]interface{}{"id": "param1", "name": "My param", "type": "select", "options": []interface{}{map[string]string{"id": "a", "name": "Value a"}, map[string]string{"id": "b", "name": "Value b"}}}},
params: []extensionAPI.ParameterValue{{Name: "param1", Value: "c"}},
expected: []ValidationResult{{Success: false, Message: `Failed to validate parameter 'My param': The value is not allowed. Possible values are 'a', 'b'.`}}},
{name: "unknown parameter type",
definitions: []interface{}{map[string]interface{}{"id": "param1", "name": "My param", "type": "unknown"}},
params: []extensionAPI.ParameterValue{{Name: "param1", Value: "c"}},
expected: []ValidationResult{{Success: false, Message: `Failed to validate parameter 'My param': unsupported parameter type 'unknown'`}}},
}

for _, t := range tests {
Expand Down
Loading