@availity/native-form
Advanced tools
Comparing version 2.5.0 to 2.6.0
@@ -10,3 +10,4 @@ import flattenObject from './flattenObject'; | ||
params = {}, | ||
formAttributes = {} | ||
formAttributes = {}, | ||
type = 'saml' | ||
) => { | ||
@@ -16,3 +17,3 @@ const mergedOptions = Object.assign( | ||
method: 'post', | ||
action: `/ms/api/availity/internal/spaces/magneto/sso/v1/saml/${spaceId}`, | ||
action: `/ms/api/availity/internal/spc/magneto/sso/v1/${type}/${spaceId}`, | ||
target: '_blank', | ||
@@ -19,0 +20,0 @@ }, |
{ | ||
"name": "@availity/native-form", | ||
"version": "2.5.0", | ||
"version": "2.6.0", | ||
"description": "Submit JSON data via a native form, not AJAX. Useful when you need to open a new page with a POST action.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -13,3 +13,3 @@ # native form | ||
```js | ||
nativeForm(spaceId[, params[, formAttributes]]); | ||
nativeForm(spaceId[, params[, formAttributes][, type]]); | ||
``` | ||
@@ -24,3 +24,4 @@ | ||
- params: Object. Additional parameters you want sent in the post. | ||
- formAttributes: Object. Set/override the form attributes like `target`, `method`, and `action`. `method` defaults to "post", `action` will default to "\`/ms/api/availity/internal/spaces/magneto/sso/v1/saml/${spaceId}\`", and `target` will default to "_blank". Additional attributes can be defined and should be valid on an HTML form element. | ||
- formAttributes: Object. Set/override the form attributes like `target`, `method`, and `action`. `method` defaults to "post", `action` will default to "\`/ms/api/availity/internal/spc/magneto/sso/v1/saml/${spaceId}\`", and `target` will default to "_blank". Additional attributes can be defined and should be valid on an HTML form element. | ||
- type: String. Override the magneto integration type. Defaults to "saml" | ||
@@ -35,2 +36,2 @@ ### | ||
When `nativeForm` is called it wil create a native HTML form and submit it. | ||
When `nativeForm` is called it wil create a native HTML form and submit it. |
@@ -72,3 +72,3 @@ import nativeForm from '../'; | ||
expect(document.querySelector('form').getAttribute('action')).toBe( | ||
'/ms/api/availity/internal/spaces/magneto/sso/v1/saml/spaceId123' | ||
'/ms/api/availity/internal/spc/magneto/sso/v1/saml/spaceId123' | ||
); | ||
@@ -84,2 +84,9 @@ }); | ||
test('action magneto integration type should be overridable', () => { | ||
nativeForm('spaceId123', {}, {}, 'openid'); | ||
expect(document.querySelector('form').getAttribute('action')).toBe( | ||
'/ms/api/availity/internal/spc/magneto/sso/v1/openid/spaceId123' | ||
); | ||
}); | ||
test('method should be post by default', () => { | ||
@@ -86,0 +93,0 @@ nativeForm('spaceId'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9273
217
35
1