Merge "Create Service object"
authorSébastien Determe <sebastien.determe@intl.att.com>
Mon, 18 Nov 2019 10:56:42 +0000 (10:56 +0000)
committerGerrit Code Review <gerrit@onap.org>
Mon, 18 Nov 2019 10:56:42 +0000 (10:56 +0000)
17 files changed:
pom.xml
src/main/script/SelectNpmRepo.groovy
ui-react/package.json
ui-react/src/LoopUI.js
ui-react/src/components/dialogs/ConfigurationPolicy/ConfigurationPolicyModal.test.js
ui-react/src/components/dialogs/Loop/DeployLoopModal.js [moved from ui-react/src/components/dialogs/DeployLoop.js with 95% similarity]
ui-react/src/components/dialogs/Loop/DeployLoopModal.test.js [moved from ui-react/src/components/dialogs/DeployLoop.test.js with 82% similarity]
ui-react/src/components/dialogs/Loop/LoopPropertiesModal.js [moved from ui-react/src/components/dialogs/LoopProperties.js with 96% similarity]
ui-react/src/components/dialogs/Loop/LoopPropertiesModal.test.js [moved from ui-react/src/components/dialogs/LoopProperties.test.js with 83% similarity]
ui-react/src/components/dialogs/Loop/OpenLoopModal.js [moved from ui-react/src/components/dialogs/OpenLoop/OpenLoopModal.js with 100% similarity]
ui-react/src/components/dialogs/Loop/OpenLoopModal.test.js [moved from ui-react/src/components/dialogs/OpenLoop/OpenLoopModal.test.js with 100% similarity]
ui-react/src/components/dialogs/Loop/__snapshots__/DeployLoopModal.test.js.snap [moved from ui-react/src/components/dialogs/__snapshots__/DeployLoop.test.js.snap with 95% similarity]
ui-react/src/components/dialogs/Loop/__snapshots__/LoopPropertiesModal.test.js.snap [moved from ui-react/src/components/dialogs/__snapshots__/LoopProperties.test.js.snap with 94% similarity]
ui-react/src/components/dialogs/Loop/__snapshots__/OpenLoopModal.test.js.snap [moved from ui-react/src/components/dialogs/OpenLoop/__snapshots__/OpenLoopModal.test.js.snap with 100% similarity]
ui-react/src/components/dialogs/UserInfoModal.js [moved from ui-react/src/components/dialogs/UserInfo.js with 98% similarity]
ui-react/src/components/dialogs/UserInfoModal.test.js [moved from ui-react/src/components/dialogs/UserInfo.test.js with 92% similarity]
ui-react/src/components/dialogs/__snapshots__/UserInfoModal.test.js.snap [moved from ui-react/src/components/dialogs/__snapshots__/UserInfo.test.js.snap with 97% similarity]

diff --git a/pom.xml b/pom.xml
index cbb21dc..4545974 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -33,7 +33,7 @@
        <parent>
                <groupId>org.onap.oparent</groupId>
                <artifactId>oparent</artifactId>
-               <version>2.0.0</version>
+               <version>2.1.0</version>
        </parent>
 
        <description>
                                                </goals>
                                                <phase>deploy</phase>
                                                <configuration>
-                                                       <arguments>run-script publish</arguments>
+                                                       <arguments>publish</arguments>
                                                </configuration>
                                        </execution>
                                </executions>
                                        <target>13</target>
                                </configuration>
                        </plugin>
+                       <plugin>
+                               <groupId>org.sonarsource.scanner.maven</groupId>
+                               <artifactId>sonar-maven-plugin</artifactId>
+                               <version>3.7.0.1746</version>
+                       </plugin>
                </plugins>
        </build>
 </project>
index 08a2cb0..92371cf 100644 (file)
@@ -28,7 +28,7 @@ println project.properties['clamp.project.version'];
 if ( project.properties['clamp.project.version'].endsWith("-SNAPSHOT") ) {
     project.properties['npm.publish.url']="https://nexus3.onap.org/repository/npm.snapshot/"
 } else {
-    project.properties['npm.publish.url']="https://nexus3.onap.org/repository/npm.release/"
+    project.properties['npm.publish.url']="https://nexus3.onap.org/repository/npm.snapshot/"
 } 
 
-println 'NPM repository: ' + project.properties['npm.publish.url'];
\ No newline at end of file
+println 'NPM repository: ' + project.properties['npm.publish.url'];
index 2d70e27..73598ec 100644 (file)
@@ -15,8 +15,7 @@
                "test": "jest",
                "test:watch": "jest --watch",
                "test:coverage": "jest --coverage",
-               "eject": "react-scripts eject",
-               "publish": "npm publish"
+               "eject": "react-scripts eject"
        },
        "files": [
                "src/*.js",
index 05f466b..b8fbe89 100644 (file)
@@ -36,16 +36,16 @@ import LoopCache from './api/LoopCache';
 import LoopActionService from './api/LoopActionService';
 
 import { Route } from 'react-router-dom'
-import OpenLoopModal from './components/dialogs/OpenLoop/OpenLoopModal';
+import OpenLoopModal from './components/dialogs/Loop/OpenLoopModal';
 import OperationalPolicyModal from './components/dialogs/OperationalPolicy/OperationalPolicyModal';
 import ConfigurationPolicyModal from './components/dialogs/ConfigurationPolicy/ConfigurationPolicyModal';
-import LoopProperties from './components/dialogs/LoopProperties';
-import UserInfo from './components/dialogs/UserInfo';
+import LoopPropertiesModal from './components/dialogs/Loop/LoopPropertiesModal';
+import UserInfoModal from './components/dialogs/UserInfoModal';
 import LoopService from './api/LoopService';
 import ViewToscaModal from './components/dialogs/ViewToscaModal/ViewToscaModal';
 import PerformAction from './components/dialogs/PerformActions';
 import RefreshStatus from './components/dialogs/RefreshStatus';
-import DeployLoop from './components/dialogs/DeployLoop';
+import DeployLoopModal from './components/dialogs/Loop/DeployLoopModal';
 import Alert from 'react-bootstrap/Alert';
 
 import { Link } from 'react-router-dom';
@@ -253,15 +253,15 @@ export default class LoopUI extends React.Component {
                                        render={(routeProps) => (<OperationalPolicyModal {...routeProps} loopCache={this.getLoopCache()} loadLoopFunction={this.loadLoop} showAlert={this.showAlert}/>)} />
                                <Route path="/configurationPolicyModal/:componentName" render={(routeProps) => (<ConfigurationPolicyModal {...routeProps} loopCache={this.getLoopCache()} loadLoopFunction={this.loadLoop}/>)} />
                                <Route path="/openLoop" render={(routeProps) => (<OpenLoopModal {...routeProps} loadLoopFunction={this.loadLoop} />)} />
-                               <Route path="/loopProperties" render={(routeProps) => (<LoopProperties {...routeProps} loopCache={this.getLoopCache()} loadLoopFunction={this.loadLoop}/>)} />
-                               <Route path="/userInfo" render={(routeProps) => (<UserInfo {...routeProps} />)} />
+                               <Route path="/loopProperties" render={(routeProps) => (<LoopPropertiesModal {...routeProps} loopCache={this.getLoopCache()} loadLoopFunction={this.loadLoop}/>)} />
+                               <Route path="/userInfo" render={(routeProps) => (<UserInfoModal {...routeProps} />)} />
                                <Route path="/closeLoop" render={this.closeLoop} />
                                <Route path="/submit" render={(routeProps) => (<PerformAction {...routeProps} loopAction="submit" loopCache={this.getLoopCache()} updateLoopFunction={this.updateLoopCache} showAlert={this.showAlert}/>)} />
                                <Route path="/stop" render={(routeProps) => (<PerformAction {...routeProps} loopAction="stop" loopCache={this.getLoopCache()} updateLoopFunction={this.updateLoopCache} showAlert={this.showAlert}/>)} />
                                <Route path="/restart" render={(routeProps) => (<PerformAction {...routeProps} loopAction="restart" loopCache={this.getLoopCache()} updateLoopFunction={this.updateLoopCache} showAlert={this.showAlert}/>)} />
                                <Route path="/delete" render={(routeProps) => (<PerformAction {...routeProps} loopAction="delete" loopCache={this.getLoopCache()} updateLoopFunction={this.updateLoopCache} showAlert={this.showAlert}/>)} />
                                <Route path="/undeploy" render={(routeProps) => (<PerformAction {...routeProps} loopAction="undeploy" loopCache={this.getLoopCache()} updateLoopFunction={this.updateLoopCache} showAlert={this.showAlert}/>)} />
-                               <Route path="/deploy" render={(routeProps) => (<DeployLoop {...routeProps} loopCache={this.getLoopCache()} updateLoopFunction={this.updateLoopCache} showAlert={this.showAlert}/>)} />
+                               <Route path="/deploy" render={(routeProps) => (<DeployLoopModal {...routeProps} loopCache={this.getLoopCache()} updateLoopFunction={this.updateLoopCache} showAlert={this.showAlert}/>)} />
                                <Route path="/refreshStatus" render={(routeProps) => (<RefreshStatus {...routeProps} loopCache={this.getLoopCache()} updateLoopFunction={this.updateLoopCache} showAlert={this.showAlert}/>)} />
                                <Route path="/logout" render={this.logout} />
                                <GlobalClampStyle />
index e0aa8c6..4fa08e6 100644 (file)
@@ -26,7 +26,7 @@ import ConfigurationPolicyModal from './ConfigurationPolicyModal';
 import LoopCache from '../../../api/LoopCache';
 
 
-describe('Verify DeployLoop', () => {
+describe('Verify ConfigurationPolicyModal', () => {
     beforeEach(() => {
         fetch.resetMocks();
         fetch.mockImplementation(() => {
@@ -21,8 +21,8 @@
  *
  */
 import React from 'react';
-import LoopActionService from '../../api/LoopActionService';
-import LoopService from '../../api/LoopService';
+import LoopActionService from '../../../api/LoopActionService';
+import LoopService from '../../../api/LoopService';
 import Button from 'react-bootstrap/Button';
 import Modal from 'react-bootstrap/Modal';
 import Form from 'react-bootstrap/Form';
@@ -34,7 +34,7 @@ const ModalStyled = styled(Modal)`
 const FormStyled = styled(Form.Group)`
        padding: .25rem 1.5rem;
 `
-export default class DeployLoop extends React.Component {
+export default class DeployLoopModal extends React.Component {
        state = {
                loopCache: this.props.loopCache,
                temporaryPropertiesJson: JSON.parse(JSON.stringify(this.props.loopCache.getGlobalProperties())),
  */
 import React from 'react';
 import { shallow } from 'enzyme';
-import DeployLoop from './DeployLoop';
-import LoopCache from '../../api/LoopCache';
-import LoopActionService from '../../api/LoopActionService';
-import LoopService from '../../api/LoopService';
+import DeployLoopModal from './DeployLoopModal';
+import LoopCache from '../../../api/LoopCache';
+import LoopActionService from '../../../api/LoopActionService';
+import LoopService from '../../../api/LoopService';
 
-describe('Verify DeployLoop', () => {
+describe('Verify DeployLoopModal', () => {
        const loopCache = new LoopCache({
                "name": "LOOP_Jbv1z_v1_0_ResourceInstanceName1_tca",
                "globalPropertiesJson": {
@@ -40,7 +40,7 @@ describe('Verify DeployLoop', () => {
 
        it('Test the render method', () => {
                const component = shallow(
-                       <DeployLoop loopCache={loopCache}/>
+                       <DeployLoopModal loopCache={loopCache}/>
                )
 
        expect(component).toMatchSnapshot();
@@ -48,8 +48,8 @@ describe('Verify DeployLoop', () => {
        
        it('Test handleClose', () => {
                const historyMock = { push: jest.fn() };
-               const handleClose = jest.spyOn(DeployLoop.prototype,'handleClose');
-               const component = shallow(<DeployLoop history={historyMock} loopCache={loopCache}/>)
+               const handleClose = jest.spyOn(DeployLoopModal.prototype,'handleClose');
+               const component = shallow(<DeployLoopModal history={historyMock} loopCache={loopCache}/>)
 
                component.find('[variant="secondary"]').prop('onClick')();
 
@@ -62,7 +62,7 @@ describe('Verify DeployLoop', () => {
                const historyMock = { push: jest.fn() };
                const updateLoopFunction = jest.fn();
                const showAlert = jest.fn();
-               const handleSave = jest.spyOn(DeployLoop.prototype,'handleSave');
+               const handleSave = jest.spyOn(DeployLoopModal.prototype,'handleSave');
                LoopService.updateGlobalProperties = jest.fn().mockImplementation(() => {
                        return Promise.resolve({
                                ok: true,
@@ -85,7 +85,7 @@ describe('Verify DeployLoop', () => {
                        });
                });
 
-               const component = shallow(<DeployLoop history={historyMock} 
+               const component = shallow(<DeployLoopModal history={historyMock} 
                                                loopCache={loopCache} updateLoopFunction={updateLoopFunction} showAlert={showAlert} />)
 
                component.find('[variant="primary"]').prop('onClick')();
@@ -100,7 +100,7 @@ describe('Verify DeployLoop', () => {
 
        it('Onchange event', () => {
                const event = { target: { name: "location_id", value: "testLocation"} };
-               const component = shallow(<DeployLoop loopCache={loopCache}/>);
+               const component = shallow(<DeployLoopModal loopCache={loopCache}/>);
                const forms = component.find('StateManager');
 
                component.find('[name="location_id"]').simulate('change', event);
@@ -25,12 +25,12 @@ import Button from 'react-bootstrap/Button';
 import Modal from 'react-bootstrap/Modal';
 import Form from 'react-bootstrap/Form';
 import styled from 'styled-components';
-import LoopService from '../../api/LoopService';
+import LoopService from '../../../api/LoopService';
 
 const ModalStyled = styled(Modal)`
        background-color: transparent;
 `
-export default class LoopProperties extends React.Component {
+export default class LoopPropertiesModal extends React.Component {
 
        state = {
                show: true,
  */
 import React from 'react';
 import { shallow } from 'enzyme';
-import LoopProperties from './LoopProperties';
-import LoopCache from '../../api/LoopCache';
-import LoopService from '../../api/LoopService';
+import LoopPropertiesModal from './LoopPropertiesModal';
+import LoopCache from '../../../api/LoopCache';
+import LoopService from '../../../api/LoopService';
 
-describe('Verify LoopProperties', () => {
+describe('Verify LoopPropertiesModal', () => {
        const loopCache = new LoopCache({
                "name": "LOOP_Jbv1z_v1_0_ResourceInstanceName1_tca",
                "globalPropertiesJson": {
@@ -39,7 +39,7 @@ describe('Verify LoopProperties', () => {
 
        it('Test the render method', () => {
                const component = shallow(
-                       <LoopProperties loopCache={loopCache}/>
+                       <LoopPropertiesModal loopCache={loopCache}/>
                )
                component.setState({ show: true,
                        temporaryPropertiesJson: {
@@ -62,8 +62,8 @@ describe('Verify LoopProperties', () => {
 
        it('Test handleClose', () => {
                const historyMock = { push: jest.fn() };
-               const handleClose = jest.spyOn(LoopProperties.prototype,'handleClose');
-               const component = shallow(<LoopProperties history={historyMock} loopCache={loopCache}/>)
+               const handleClose = jest.spyOn(LoopPropertiesModal.prototype,'handleClose');
+               const component = shallow(<LoopPropertiesModal history={historyMock} loopCache={loopCache}/>)
 
                component.find('[variant="secondary"]').prop('onClick')();
 
@@ -75,7 +75,7 @@ describe('Verify LoopProperties', () => {
                const flushPromises = () => new Promise(setImmediate);
                const historyMock = { push: jest.fn() };
                const loadLoopFunction = jest.fn();
-               const handleSave = jest.spyOn(LoopProperties.prototype,'handleSave');
+               const handleSave = jest.spyOn(LoopPropertiesModal.prototype,'handleSave');
                LoopService.updateGlobalProperties = jest.fn().mockImplementation(() => {
                        return Promise.resolve({
                                ok: true,
@@ -84,7 +84,7 @@ describe('Verify LoopProperties', () => {
                        });
                });
 
-               const component = shallow(<LoopProperties history={historyMock} 
+               const component = shallow(<LoopPropertiesModal history={historyMock} 
                                                loopCache={loopCache} loadLoopFunction={loadLoopFunction} />)
 
                component.find('[variant="primary"]').prop('onClick')();
@@ -98,7 +98,7 @@ describe('Verify LoopProperties', () => {
 
        it('Onchange event', () => {
                const event = {target:{name:"dcaeDeployParameters", value:"{\"location_id\": \"testLocation\",\"policy_id\": \"TCA_h2NMX_v1_0_ResourceInstanceName1_tca\"}"}};
-               const component = shallow(<LoopProperties loopCache={loopCache}/>);
+               const component = shallow(<LoopPropertiesModal loopCache={loopCache}/>);
 
                component.find('FormControl').simulate('change', event);
                component.update();
@@ -1,6 +1,6 @@
 // Jest Snapshot v1, https://goo.gl/fbAQLP
 
-exports[`Verify DeployLoop Test the render method 1`] = `
+exports[`Verify DeployLoopModal Test the render method 1`] = `
 <Styled(Bootstrap(Modal))
   onHide={[Function]}
   show={true}
@@ -1,6 +1,6 @@
 // Jest Snapshot v1, https://goo.gl/fbAQLP
 
-exports[`Verify LoopProperties Test the render method 1`] = `
+exports[`Verify LoopPropertiesModal Test the render method 1`] = `
 <Styled(Bootstrap(Modal))
   onHide={[Function]}
   show={true}
@@ -33,7 +33,7 @@ const ModalStyled = styled(Modal)`
        background-color: transparent;
 `
 
-export default class UserInfo extends React.Component {
+export default class UserInfoModal extends React.Component {
 
        constructor(props, context) {
                super(props, context);
@@ -22,9 +22,9 @@
  */
 import React from 'react';
 import { shallow } from 'enzyme';
-import UserInfo from './UserInfo';
+import UserInfoModal from './UserInfoModal';
 
-describe('Verify UserInfo', () => {
+describe('Verify UserInfoModal', () => {
 
        beforeEach(() => {
                fetch.resetMocks();
@@ -42,7 +42,7 @@ describe('Verify UserInfo', () => {
        })
 
        it('Test the render method full permission', () => {
-               const component = shallow(<UserInfo />)
+               const component = shallow(<UserInfoModal />)
                component.setState({ userInfo: {
                        "userName": "test",
                        "cldsVersion": "1.0.0",
@@ -57,7 +57,7 @@ describe('Verify UserInfo', () => {
        });
 
        it('Test the render method no permission', () => {
-               const component = shallow(<UserInfo />)
+               const component = shallow(<UserInfoModal />)
                component.setState({ userInfo: {}
                });
 
@@ -65,7 +65,7 @@ describe('Verify UserInfo', () => {
        });
 
        it('Test the render method read permission', () => {
-               const component = shallow(<UserInfo />)
+               const component = shallow(<UserInfoModal />)
                component.setState({ userInfo: {
                        "userName": "test",
                        "cldsVersion": "1.0.0",
@@ -1,6 +1,6 @@
 // Jest Snapshot v1, https://goo.gl/fbAQLP
 
-exports[`Verify UserInfo Test the render method full permission 1`] = `
+exports[`Verify UserInfoModal Test the render method full permission 1`] = `
 <Styled(Bootstrap(Modal))
   onHide={[Function]}
   show={true}