Skip to content

Commit

Permalink
fix form and object logs in exc template (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
moritzraho authored Sep 29, 2020
1 parent e0993be commit 089f2ad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const ActionsForm = (props) => {
itemKey="name"
onSelectionChange={(name) =>
setState({
...state,
actionSelected: name,
actionResponseError: null,
actionResponse: null
Expand Down Expand Up @@ -106,7 +107,7 @@ const ActionsForm = (props) => {
<Text>Failure! See the error in your browser console.</Text>
</View>
)}
{!state.actionError && state.actionResponse && (
{!state.actionResponseError && state.actionResponse && (
<View backgroundColor={`positive`} padding={`size-100`} marginTop={`size-100`} marginBottom={`size-100`} borderRadius={`small `}>
<Text>Success! See the response content in your browser console.</Text>
</View>
Expand All @@ -131,12 +132,12 @@ const ActionsForm = (props) => {
validStr = 'invalid'
}
}
setState({ [stateJSON]: content, [stateValid]: validStr })
setState({ ...state, [stateJSON]: content, [stateValid]: validStr })
}

// invokes a the selected backend actions with input headers and params
async function invokeAction () {
setState({ actionInvokeInProgress: true })
setState({ ...state, actionInvokeInProgress: true })
const action = state.actionSelected
const headers = state.actionHeaders || {}
const params = state.actionParams || {}
Expand All @@ -162,6 +163,7 @@ const ActionsForm = (props) => {
const actionResponse = await actionWebInvoke(action, headers, params)
// store the response
setState({
...state,
actionResponse,
actionResponseError: null,
actionInvokeInProgress: false
Expand All @@ -171,6 +173,7 @@ const ActionsForm = (props) => {
// log and store any error message
console.error(e)
setState({
...state,
actionResponse: null,
actionResponseError: e.message,
actionInvokeInProgress: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import SideBar from './SideBar'
import ActionsForm from './ActionsForm'
import { Home } from './Home'
import { About } from './About'
function App (props) {

console.log(`runtime object: ${props.runtime}`)
console.log(`ims object: ${props.ims}`)
function App (props) {
console.log('runtime object:', props.runtime)
console.log('ims object:', props.ims)

// use exc runtime event handlers
// respond to configuration change events (e.g. user switches org)
Expand Down

0 comments on commit 089f2ad

Please sign in to comment.