diff options
Diffstat (limited to 'ui-react/src/components/dialogs/ConfigurationPolicy')
-rw-r--r-- | ui-react/src/components/dialogs/ConfigurationPolicy/ConfigurationPolicyModal.js | 12 | ||||
-rw-r--r-- | ui-react/src/components/dialogs/ConfigurationPolicy/ConfigurationPolicyModal.test.js | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/ui-react/src/components/dialogs/ConfigurationPolicy/ConfigurationPolicyModal.js b/ui-react/src/components/dialogs/ConfigurationPolicy/ConfigurationPolicyModal.js index b0f601ec2..3fa0c0ca2 100644 --- a/ui-react/src/components/dialogs/ConfigurationPolicy/ConfigurationPolicyModal.js +++ b/ui-react/src/components/dialogs/ConfigurationPolicy/ConfigurationPolicyModal.js @@ -38,7 +38,7 @@ export default class ConfigurationPolicyModal extends React.Component { show: true, loopCache: this.props.loopCache, jsonEditor: null, - componentName: this.props.match.params.componentName + policyName: this.props.match.params.policyName }; constructor(props, context) { @@ -59,8 +59,8 @@ export default class ConfigurationPolicyModal extends React.Component { } else { console.info("NO validation errors found in config policy data"); - this.state.loopCache.updateMicroServiceProperties(this.state.componentName, editorData[0]); - LoopService.setMicroServiceProperties(this.state.loopCache.getLoopName(), this.state.loopCache.getMicroServiceForName(this.state.componentName)).then(resp => { + this.state.loopCache.updateMicroServiceProperties(this.state.policyName, editorData[0]); + LoopService.setMicroServiceProperties(this.state.loopCache.getLoopName(), this.state.loopCache.getMicroServiceForName(this.state.policyName)).then(resp => { this.setState({ show: false }); this.props.history.push('/'); this.props.loadLoopFunction(this.state.loopCache.getLoopName()); @@ -78,12 +78,12 @@ export default class ConfigurationPolicyModal extends React.Component { } renderJsonEditor() { - console.debug("Rendering ConfigurationPolicyModal ", this.state.componentName); - var toscaModel = this.state.loopCache.getMicroServiceJsonRepresentationForName(this.state.componentName); + console.debug("Rendering ConfigurationPolicyModal ", this.state.policyName); + var toscaModel = this.state.loopCache.getMicroServiceJsonRepresentationForName(this.state.policyName); if (toscaModel == null) { return; } - var editorData = this.state.loopCache.getMicroServicePropertiesForName(this.state.componentName); + var editorData = this.state.loopCache.getMicroServicePropertiesForName(this.state.policyName); JSONEditor.defaults.options.theme = 'bootstrap4'; //JSONEditor.defaults.options.iconlib = 'bootstrap2'; diff --git a/ui-react/src/components/dialogs/ConfigurationPolicy/ConfigurationPolicyModal.test.js b/ui-react/src/components/dialogs/ConfigurationPolicy/ConfigurationPolicyModal.test.js index 4fa08e680..4d527b71c 100644 --- a/ui-react/src/components/dialogs/ConfigurationPolicy/ConfigurationPolicyModal.test.js +++ b/ui-react/src/components/dialogs/ConfigurationPolicy/ConfigurationPolicyModal.test.js @@ -48,7 +48,7 @@ describe('Verify ConfigurationPolicyModal', () => { }] }); const historyMock = { push: jest.fn() }; - const matchMock = { params:{ componentName: "TCA_h2NMX_v1_0_ResourceInstanceName1_tca" } } + const matchMock = { params:{ policyName: "TCA_h2NMX_v1_0_ResourceInstanceName1_tca" } } const flushPromises = () => new Promise(setImmediate); it('Test handleClose', () => { @@ -73,7 +73,7 @@ describe('Verify ConfigurationPolicyModal', () => { expect(handleSave).toHaveBeenCalledTimes(1); expect(component.state('show')).toEqual(false); - expect(component.state('componentName')).toEqual("TCA_h2NMX_v1_0_ResourceInstanceName1_tca"); + expect(component.state('policyName')).toEqual("TCA_h2NMX_v1_0_ResourceInstanceName1_tca"); expect(historyMock.push.mock.calls[0]).toEqual([ '/']); }); });
\ No newline at end of file |