Browse Source

Change name format to `in.name` and update tests

bubble
Owen Conti 7 years ago
parent
commit
7a694e287a
3 changed files with 4 additions and 4 deletions
  1. +1
    -1
      src/core/components/parameters.jsx
  2. +1
    -1
      src/core/plugins/spec/selectors.js
  3. +2
    -2
      test/core/plugins/spec/selectors.js

+ 1
- 1
src/core/components/parameters.jsx View File

@@ -94,7 +94,7 @@ export default class Parameters extends Component {
<ParameterRow fn={ fn }
getComponent={ getComponent }
param={ parameter }
key={ `${parameter.get( "name" )}-${parameter.get("in")}` }
key={ `${parameter.get( "in" )}.${parameter.get("name")}` }
onChange={ this.onChange }
onChangeConsumes={this.onChangeConsumesWrapper}
specSelectors={ specSelectors }


+ 1
- 1
src/core/plugins/spec/selectors.js View File

@@ -271,7 +271,7 @@ export function parameterValues(state, pathMethod, isXml) {
let params = spec(state).getIn(["paths", ...pathMethod, "parameters"], fromJS([]))
return params.reduce( (hash, p) => {
let value = isXml && p.get("in") === "body" ? p.get("value_xml") : p.get("value")
return hash.set(`${p.get("name")}-${p.get("in")}`, value)
return hash.set(`${p.get("in")}.${p.get("name")}`, value)
}, fromJS({}))
}



+ 2
- 2
test/core/plugins/spec/selectors.js View File

@@ -43,8 +43,8 @@ describe("spec plugin - selectors", function(){

// Then
expect(paramValues.toJS()).toEqual({
"one-query": 1,
"two-query": "duos"
"query.one": 1,
"query.two": "duos"
})

})


Loading…
Cancel
Save