Skip to content

Commit

Permalink
using changeSelections action as it has same function setMySelections…
Browse files Browse the repository at this point in the history
… for inputQA
  • Loading branch information
hudajkhan committed May 22, 2019
1 parent a95e45f commit 4af062e
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 20 deletions.
6 changes: 0 additions & 6 deletions src/actions/index.js
Expand Up @@ -33,12 +33,6 @@ export const changeSelections = item => ({
payload: item
})

//InputLOC uses the same action, trying a different one to keep functionality separate
export const changeQASelections = item => ({
type: 'CHANGE_QA_SELECTIONS',
payload: item
})

export const getLD = inputs => ({
type: 'GENERATE_LD',
payload: inputs
Expand Down
4 changes: 2 additions & 2 deletions src/components/editor/InputLookupQA.jsx
Expand Up @@ -5,7 +5,7 @@ import PropTypes from 'prop-types'
import Swagger from 'swagger-client'
import { connect } from 'react-redux'
import { getProperty } from '../../reducers/index'
import { changeQASelections, setItems, removeItem } from '../../actions/index'
import { changeSelections } from '../../actions/index'

const AsyncTypeahead = asyncContainer( Typeahead )

Expand Down Expand Up @@ -197,7 +197,7 @@ const mapStateToProps = ( state, props ) => {

const mapDispatchToProps = dispatch => ( {
handleSelectedChange( selected ) {
dispatch( changeQASelections( selected ) )
dispatch( changeSelections( selected ) )
}
} )

Expand Down
2 changes: 0 additions & 2 deletions src/reducers/index.js
Expand Up @@ -107,8 +107,6 @@ const selectorReducer = (state={}, action) => {
return removeMyItem(state, action)
case 'REMOVE_ALL_CONTENT':
return removeAllContent(state, action)
case 'CHANGE_QA_SELECTIONS':
return setMySelections(state, action)
default:
return state
}
Expand Down
10 changes: 0 additions & 10 deletions src/reducers/inputs.js
Expand Up @@ -66,14 +66,4 @@ export const removeMyItem = (state, action) => {
return obj[key]
}, newState)
return newState
}

//Instead of adding items based on selection replace with what is currently in the state
export const replaceMyItems = (state, action) => {
let newState = Object.assign({}, state)
newState[action.payload.rtId][action.payload.uri].items = []
action.payload.items.map((row) => {
newState[action.payload.rtId][action.payload.uri].items.push(row)
})
return newState
}

0 comments on commit 4af062e

Please sign in to comment.