<description>
This is the MAVEN project that builds everything for ONAP CLAMP.
Docker engine is normally requires to perfom all possible tasks (including integration tests)
-
+
It can build:
- The ONAP CLAMP JAR that contains CLAMP back-end code.
- The DOCKER images for:
- The CLAMP backend, JAVA unit testing
- The CLAMP backend, JAVA integration tests (with Spring + docker mariadb database + docker policy/dcae emulator written in python)
- The CLAMP frontend, Javascrip tests (NodeJS(NPM) + JEST + Enzyme fro React)
-
+
The test coverage for dev's can be found after a "clean install" build in:
- Clamp backend: target/jacoco-dev.exec (unit tests + integration tests merged)
or separately target/coverage-reports/jacoco.exec and target/coverage-reports/jacoco-it.exec
<python.http.proxy.param />
<tomcat.version>9.0.27</tomcat.version>
<ui.react.src>ui-react</ui.react.src>
+ <ui.react.lib.src>ui-react-lib</ui.react.lib.src>
<npm.publish.url>https://nexus3.onap.org/repository/npm.release/</npm.publish.url>
</properties>
</testResource>
</testResources>
<resources>
- <!-- For AAF folder maven should not try to filter Keystores/Truststores ... Otherwise
+ <!-- For AAF folder maven should not try to filter Keystores/Truststores ... Otherwise
they will be broken and unreadable -->
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>${ui.react.src}</directory>
+ <excludes>
+ <exclude>node_modules</exclude>
+ </excludes>
<includes>
<include>src/**</include>
<include>public/**</include>
<filtering>true</filtering>
<targetPath>${project.build.directory}/${ui.react.src}</targetPath>
</resource>
+ <resource>
+ <directory>${ui.react.src}</directory>
+ <includes>
+ <include>src/**</include>
+ </includes>
+ <excludes>
+ <exclude>**/__snapshots__/**</exclude>
+ <exclude>**/**.test.js</exclude>
+ </excludes>
+ <filtering>true</filtering>
+ <targetPath>${project.build.directory}/${ui.react.lib.src}</targetPath>
+ </resource>
+ <resource>
+ <directory>${ui.react.lib.src}</directory>
+ <includes>
+ <include>**</include>
+ </includes>
+ <excludes>
+ <exclude>node_modules/**</exclude>
+ <exclude>package-lock.json</exclude>
+ </excludes>
+ <filtering>true</filtering>
+ <targetPath>${project.build.directory}/${ui.react.lib.src}</targetPath>
+ </resource>
</resources>
<plugins>
</executions>
</plugin>
- <!-- Read the swagger.json file and the definition from SwaggerConfig.java; generate
+ <!-- Read the swagger.json file and the definition from SwaggerConfig.java; generate
a list of .adoc files containing the APIs info in more structured way -->
<plugin>
<groupId>io.github.swagger2markup</groupId>
</executions>
</plugin>
- <!-- Run the generated asciidoc through Asciidoctor to generate other documentation
+ <!-- Run the generated asciidoc through Asciidoctor to generate other documentation
types, such as PDFs or HTML5 -->
<plugin>
<groupId>org.asciidoctor</groupId>
<tag>${project.docker.latesttagtimestamp.version}</tag>
<tag>${project.docker.latesttag.version}</tag>
</tags>
- <!-- A relative path is looked up in ${project.basedir}/src/main/docker by
+ <!-- A relative path is looked up in ${project.basedir}/src/main/docker by
default -->
<dockerFile>backend/Dockerfile</dockerFile>
<assembly>
<tag>${project.docker.latesttagtimestamp.version}</tag>
<tag>${project.docker.latesttag.version}</tag>
</tags>
- <!-- A relative path is looked up in ${project.basedir}/src/main/docker by
+ <!-- A relative path is looked up in ${project.basedir}/src/main/docker by
default -->
<dockerFile>frontend/Dockerfile</dockerFile>
<assembly>
<version>1.8.0</version>
<configuration>
<installDirectory>${project.build.directory}/${ui.react.src}</installDirectory>
- <workingDirectory>${project.build.directory}/${ui.react.src}</workingDirectory>
</configuration>
<executions>
<execution>
</goals>
<phase>generate-sources</phase>
<configuration>
- <nodeVersion>v12.13.0</nodeVersion>
- <npmVersion>6.13.0</npmVersion>
+ <nodeVersion>v12.13.0</nodeVersion>
+ <npmVersion>6.13.0</npmVersion>
</configuration>
</execution>
<execution>
</goals>
<phase>compile</phase>
<configuration>
+ <workingDirectory>${project.build.directory}/${ui.react.src}</workingDirectory>
<arguments>install</arguments>
</configuration>
</execution>
<phase>test</phase>
<configuration>
<arguments>run-script test:coverage</arguments>
+ <workingDirectory>${project.build.directory}/${ui.react.src}</workingDirectory>
+ </configuration>
+ </execution>
+ <execution>
+ <id>npm_install_lib</id>
+ <goals>
+ <goal>npm</goal>
+ </goals>
+ <phase>deploy</phase>
+ <configuration>
+ <workingDirectory>${project.build.directory}/${ui.react.lib.src}</workingDirectory>
+ <arguments>install</arguments>
+ </configuration>
+ </execution>
+ <execution>
+ <id>npm_build_lib</id>
+ <goals>
+ <goal>npm</goal>
+ </goals>
+ <phase>deploy</phase>
+ <configuration>
+ <workingDirectory>${project.build.directory}/${ui.react.lib.src}</workingDirectory>
+ <arguments>run build</arguments>
</configuration>
</execution>
<execution>
</goals>
<phase>deploy</phase>
<configuration>
+ <workingDirectory>${project.build.directory}/${ui.react.lib.src}</workingDirectory>
<arguments>publish</arguments>
</configuration>
</execution>
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CLAMP
+ * ================================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights
+ * reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END============================================
+ * ===================================================================
+ *
+ */
+
+export { default as ConfigurationPolicyModal } from './src/components/dialogs/ConfigurationPolicy/ConfigurationPolicyModal';
+export { default as DeployLoopModal } from './src/components/dialogs/Loop/DeployLoopModal';
+export { default as LoopActionService } from './src/api/LoopActionService';
+export { default as LoopCache } from './src/api/LoopCache';
+export { default as LoopComponentConverter } from './src/components/loop_viewer/svg/LoopComponentConverter';
+export { default as LoopLogs } from './src/components/loop_viewer/logs/LoopLogs';
+export { default as LoopPropertiesModal } from './src/components/dialogs/Loop/LoopPropertiesModal';
+export { default as LoopService } from './src/api/LoopService';
+export { default as LoopStatus } from './src/components/loop_viewer/status/LoopStatus';
+export { default as LoopSvg } from './src/components/loop_viewer/svg/LoopSvg';
+export { default as LoopUI } from './src/LoopUI';
+export { default as MenuBar } from './src/components/menu/MenuBar';
+export { default as NotFound } from './src/NotFound';
+export { default as OpenLoopModal } from './src/components/dialogs/Loop/OpenLoopModal';
+export { default as OperationalPolicyModal } from './src/components/dialogs/OperationalPolicy/OperationalPolicyModal';
+export { default as PerformActions } from './src/components/dialogs/PerformActions';
+export { default as RefreshStatus } from './src/components/dialogs/RefreshStatus';
+export { default as TemplateMenuService } from './src/api/TemplateMenuService';
+export { default as UserInfoModal } from './src/components/dialogs/UserInfoModal';
+export { default as UserService } from './src/api/UserService';
+export { default as ViewBlueprintMicroServiceTemplatesModal } from './src/components/dialogs/Tosca/ViewBlueprintMicroServiceTemplatesModal';
+export { default as ViewToscaPolicyModal } from './src/components/dialogs/Tosca/ViewToscaPolicyModal';
--- /dev/null
+{
+ "name": "onap-clamp-ui-lib",
+ "version": "${project.version}",
+ "description": "ONAP CLAMP UI Reactjs Component Library",
+ "author": "ONAP Clamp Team",
+ "license": "Apache-2.0",
+ "main": "dist/index.js",
+ "module": "dist/esindex.js",
+ "scripts": {
+ "build": "rollup -c"
+ },
+ "files": [
+ "dist"
+ ],
+ "peerDependencies": {
+ "@json-editor/json-editor": "1.4.0-beta.0",
+ "@material-ui/core": "4.6.0",
+ "@material-ui/icons": "4.5.1",
+ "bootstrap-css-only": "4.3.1",
+ "material-table": "1.53.0",
+ "react": "16.9.0",
+ "react-bootstrap": "1.0.0-beta.14",
+ "react-dom": "16.9.0",
+ "react-router-dom": "5.0.1",
+ "react-scripts": "3.1.1",
+ "react-select": "3.0.8",
+ "rollup": "^1.29.1",
+ "styled-components": "4.3.2"
+ },
+ "devDependencies": {
+ "@babel/cli": "7.7.5",
+ "@babel/core": "7.7.5",
+ "@babel/helper-plugin-utils": "7.0.0",
+ "@babel/plugin-external-helpers": "^7.7.4",
+ "@babel/plugin-proposal-class-properties": "7.5.5",
+ "@babel/plugin-transform-runtime": "7.7.6",
+ "@babel/preset-env": "7.5.5",
+ "@babel/preset-react": "7.0.0",
+ "rollup": "1.29.1",
+ "@rollup/plugin-commonjs": "^11.0.1",
+ "@rollup/plugin-image": "2.0.0",
+ "@rollup/plugin-node-resolve": "7.0.0",
+ "@rollup/plugin-replace": "2.2.1",
+ "@rollup/plugin-url": "4.0.0",
+ "@svgr/rollup": "5.1.0",
+ "babel-plugin-external-helpers": "6.22.0",
+ "rollup-plugin-babel": "4.3.3",
+ "rollup-plugin-peer-deps-external": "2.2.0",
+ "rollup-plugin-postcss": "2.0.3"
+ }
+}
--- /dev/null
+import babel from 'rollup-plugin-babel'
+import commonjs from '@rollup/plugin-commonjs'
+import postcss from 'rollup-plugin-postcss'
+import resolve from '@rollup/plugin-node-resolve'
+import external from 'rollup-plugin-peer-deps-external'
+import img from '@rollup/plugin-image'
+
+import pkg from './package.json'
+
+export default {
+ input: './libIndex.js',
+ output: [
+ {
+ file: pkg.main,
+ format: 'cjs',
+ sourcemap: true
+ },
+ {
+ file: pkg.module,
+ format: 'es',
+ sourcemap: true
+ }
+ ],
+ plugins: [
+ img(),
+ external(),
+ postcss({
+ modules: true
+ }),
+ babel({
+ exclude: 'node_modules/**',
+ presets: [
+
+ "@babel/preset-env", {},
+ "@babel/preset-react", {}
+ ],
+ plugins: [
+ [
+ "@babel/plugin-proposal-class-properties",
+ {
+ "loose": true
+ }
+ ]
+ ]
+ }),
+ resolve({ preferBuiltins: true, mainFields: ['browser'] })
+ ]
+}
import Navbar from 'react-bootstrap/Navbar';
import logo from './logo.png';
import { GlobalClampStyle } from './theme/globalStyle.js';
+import OnapConstants from './utils/OnapConstants';
import LoopSvg from './components/loop_viewer/svg/LoopSvg';
import LoopLogs from './components/loop_viewer/logs/LoopLogs';
export default class LoopUI extends React.Component {
- static defaultLoopName="Empty (NO loop loaded yet)";
-
state = {
userName: null,
- loopName: LoopUI.defaultLoopName,
+ loopName: OnapConstants.defaultLoopName,
loopCache: new LoopCache({}),
showAlert: false
};
}
closeLoop() {
- this.setState({ loopCache: new LoopCache({}), loopName: LoopUI.defaultLoopName });
+ this.setState({ loopCache: new LoopCache({}), loopName: OnapConstants.defaultLoopName });
this.props.history.push('/');
}
import React from 'react';
import { shallow } from 'enzyme';
import LoopUI from './LoopUI';
+import OnapConstants from './utils/OnapConstants';
import LoopCache from './api/LoopCache';
import LoopActionService from './api/LoopActionService';
const instance = component.instance();
instance.closeLoop();
- expect(component.state('loopName')).toEqual("Empty (NO loop loaded yet)");
+ expect(component.state('loopName')).toEqual(OnapConstants.defaultLoopName);
expect(historyMock.push.mock.calls[0]).toEqual([ '/']);
})
import React from 'react';
import styled from 'styled-components';
import LoopCache from '../../../api/LoopCache';
-import { withRouter } from "react-router";
+import { withRouter } from "react-router-dom";
import LoopService from '../../../api/LoopService';
import LoopComponentConverter from './LoopComponentConverter';
import Nav from 'react-bootstrap/Nav';
import Navbar from 'react-bootstrap/Navbar';
import NavDropdown from 'react-bootstrap/NavDropdown';
-import LoopUI from '../../LoopUI';
+import OnapConstants from '../../utils/OnapConstants';
import 'bootstrap-css-only/css/bootstrap.min.css';
import styled from 'styled-components';
import { Link } from 'react-router-dom';
};
componentWillReceiveProps(newProps) {
- if (newProps.loopName !== LoopUI.defaultLoopName) {
+ if (newProps.loopName !== OnapConstants.defaultLoopName) {
this.setState({ disabled: false });
} else {
this.setState({ disabled: true });
"$$typeof": Symbol(react.forward_ref),
"attrs": Array [],
"componentStyle": ComponentStyle {
- "componentId": "sc-eNQAEJ",
+ "componentId": "sc-bdVaJa",
"isStatic": false,
"rules": Array [
"
"displayName": "Styled(Link)",
"foldedComponentIds": Array [],
"render": [Function],
- "styledComponentId": "sc-eNQAEJ",
+ "styledComponentId": "sc-bdVaJa",
"target": [Function],
"toString": [Function],
"warnTooManyClasses": [Function],
"$$typeof": Symbol(react.forward_ref),
"attrs": Array [],
"componentStyle": ComponentStyle {
- "componentId": "sc-eNQAEJ",
+ "componentId": "sc-bdVaJa",
"isStatic": false,
"rules": Array [
"
"displayName": "Styled(Link)",
"foldedComponentIds": Array [],
"render": [Function],
- "styledComponentId": "sc-eNQAEJ",
+ "styledComponentId": "sc-bdVaJa",
"target": [Function],
"toString": [Function],
"warnTooManyClasses": [Function],
"$$typeof": Symbol(react.forward_ref),
"attrs": Array [],
"componentStyle": ComponentStyle {
- "componentId": "sc-eNQAEJ",
+ "componentId": "sc-bdVaJa",
"isStatic": false,
"rules": Array [
"
"displayName": "Styled(Link)",
"foldedComponentIds": Array [],
"render": [Function],
- "styledComponentId": "sc-eNQAEJ",
+ "styledComponentId": "sc-bdVaJa",
"target": [Function],
"toString": [Function],
"warnTooManyClasses": [Function],
"$$typeof": Symbol(react.forward_ref),
"attrs": Array [],
"componentStyle": ComponentStyle {
- "componentId": "sc-eNQAEJ",
+ "componentId": "sc-bdVaJa",
"isStatic": false,
"rules": Array [
"
"displayName": "Styled(Link)",
"foldedComponentIds": Array [],
"render": [Function],
- "styledComponentId": "sc-eNQAEJ",
+ "styledComponentId": "sc-bdVaJa",
"target": [Function],
"toString": [Function],
"warnTooManyClasses": [Function],
"$$typeof": Symbol(react.forward_ref),
"attrs": Array [],
"componentStyle": ComponentStyle {
- "componentId": "sc-eNQAEJ",
+ "componentId": "sc-bdVaJa",
"isStatic": false,
"rules": Array [
"
"displayName": "Styled(Link)",
"foldedComponentIds": Array [],
"render": [Function],
- "styledComponentId": "sc-eNQAEJ",
+ "styledComponentId": "sc-bdVaJa",
"target": [Function],
"toString": [Function],
"warnTooManyClasses": [Function],
"$$typeof": Symbol(react.forward_ref),
"attrs": Array [],
"componentStyle": ComponentStyle {
- "componentId": "sc-eNQAEJ",
+ "componentId": "sc-bdVaJa",
"isStatic": false,
"rules": Array [
"
"displayName": "Styled(Link)",
"foldedComponentIds": Array [],
"render": [Function],
- "styledComponentId": "sc-eNQAEJ",
+ "styledComponentId": "sc-bdVaJa",
"target": [Function],
"toString": [Function],
"warnTooManyClasses": [Function],
"$$typeof": Symbol(react.forward_ref),
"attrs": Array [],
"componentStyle": ComponentStyle {
- "componentId": "sc-eNQAEJ",
+ "componentId": "sc-bdVaJa",
"isStatic": false,
"rules": Array [
"
"displayName": "Styled(Link)",
"foldedComponentIds": Array [],
"render": [Function],
- "styledComponentId": "sc-eNQAEJ",
+ "styledComponentId": "sc-bdVaJa",
"target": [Function],
"toString": [Function],
"warnTooManyClasses": [Function],
"$$typeof": Symbol(react.forward_ref),
"attrs": Array [],
"componentStyle": ComponentStyle {
- "componentId": "sc-eNQAEJ",
+ "componentId": "sc-bdVaJa",
"isStatic": false,
"rules": Array [
"
"displayName": "Styled(Link)",
"foldedComponentIds": Array [],
"render": [Function],
- "styledComponentId": "sc-eNQAEJ",
+ "styledComponentId": "sc-bdVaJa",
"target": [Function],
"toString": [Function],
"warnTooManyClasses": [Function],
"$$typeof": Symbol(react.forward_ref),
"attrs": Array [],
"componentStyle": ComponentStyle {
- "componentId": "sc-eNQAEJ",
+ "componentId": "sc-bdVaJa",
"isStatic": false,
"rules": Array [
"
"displayName": "Styled(Link)",
"foldedComponentIds": Array [],
"render": [Function],
- "styledComponentId": "sc-eNQAEJ",
+ "styledComponentId": "sc-bdVaJa",
"target": [Function],
"toString": [Function],
"warnTooManyClasses": [Function],
"$$typeof": Symbol(react.forward_ref),
"attrs": Array [],
"componentStyle": ComponentStyle {
- "componentId": "sc-eNQAEJ",
+ "componentId": "sc-bdVaJa",
"isStatic": false,
"rules": Array [
"
"displayName": "Styled(Link)",
"foldedComponentIds": Array [],
"render": [Function],
- "styledComponentId": "sc-eNQAEJ",
+ "styledComponentId": "sc-bdVaJa",
"target": [Function],
"toString": [Function],
"warnTooManyClasses": [Function],
"$$typeof": Symbol(react.forward_ref),
"attrs": Array [],
"componentStyle": ComponentStyle {
- "componentId": "sc-eNQAEJ",
+ "componentId": "sc-bdVaJa",
"isStatic": false,
"rules": Array [
"
"displayName": "Styled(Link)",
"foldedComponentIds": Array [],
"render": [Function],
- "styledComponentId": "sc-eNQAEJ",
+ "styledComponentId": "sc-bdVaJa",
"target": [Function],
"toString": [Function],
"warnTooManyClasses": [Function],
"$$typeof": Symbol(react.forward_ref),
"attrs": Array [],
"componentStyle": ComponentStyle {
- "componentId": "sc-eNQAEJ",
+ "componentId": "sc-bdVaJa",
"isStatic": false,
"rules": Array [
"
"displayName": "Styled(Link)",
"foldedComponentIds": Array [],
"render": [Function],
- "styledComponentId": "sc-eNQAEJ",
+ "styledComponentId": "sc-bdVaJa",
"target": [Function],
"toString": [Function],
"warnTooManyClasses": [Function],
"$$typeof": Symbol(react.forward_ref),
"attrs": Array [],
"componentStyle": ComponentStyle {
- "componentId": "sc-eNQAEJ",
+ "componentId": "sc-bdVaJa",
"isStatic": false,
"rules": Array [
"
"displayName": "Styled(Link)",
"foldedComponentIds": Array [],
"render": [Function],
- "styledComponentId": "sc-eNQAEJ",
+ "styledComponentId": "sc-bdVaJa",
"target": [Function],
"toString": [Function],
"warnTooManyClasses": [Function],
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CLAMP
+ * ================================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights
+ * reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END============================================
+ * ===================================================================
+ *
+ */
+
+// Maintain a list of ONAP CLAMP UI "constants" that can be used by any componenet within CLAMP
+
+const OnapConstants = {
+ defaultLoopName: "Empty (NO loop loaded yet)"
+};
+
+export default OnapConstants;