From ead5c383df30c94a83ee1d7e2c869cc5b23697a2 Mon Sep 17 00:00:00 2001 From: "andre.schmid" Date: Fri, 6 Aug 2021 16:04:50 +0100 Subject: [PATCH] Fix local build of onboarding-fe MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit dox-sequence-diagram-ui/package.json: - upgrades webpack-cli to 3.3.12, the actual version 2.0.14 is not compatible or recommended with the webpack version. openecomp-ui/package.json: - upgrades webpack-cli to 3.3.12, the actual version 2.0.14 is not compatible or recommended with the webpack version. - upgrades babel-core from 6.24.0 to 6.26.0. Code and config fixes: - fixes i18n openecomp-ui/src/nfvo-utils/i18n/i18n.js. The previous code was calling an non-existent attribute of the intl-format-cache. - fixes dox-sequence-diagram-ui path in openecomp-ui/webpack.config.js. The previous path configuration was causing compilation problems in the openecomp-ui (folder not found problem). Updates README.md with used procedure to run onboarding-fe. Change-Id: I28f7b78a1f30b5f904b3f7214f72e9741253622d Issue-ID: SDC-3661 Signed-off-by: André Schmid --- dox-sequence-diagram-ui/.gitignore | 3 ++- dox-sequence-diagram-ui/package.json | 2 +- openecomp-ui/.gitignore | 1 + openecomp-ui/README.md | 40 +++++++++++++++++++------------- openecomp-ui/package.json | 4 ++-- openecomp-ui/src/nfvo-utils/i18n/i18n.js | 2 +- openecomp-ui/webpack.config.js | 5 +--- 7 files changed, 32 insertions(+), 25 deletions(-) diff --git a/dox-sequence-diagram-ui/.gitignore b/dox-sequence-diagram-ui/.gitignore index 3fb151de68..c0bda2c47a 100644 --- a/dox-sequence-diagram-ui/.gitignore +++ b/dox-sequence-diagram-ui/.gitignore @@ -5,4 +5,5 @@ dist node_modules .npmrc .history -yarn-error.log \ No newline at end of file +yarn-error.log +package-lock.json \ No newline at end of file diff --git a/dox-sequence-diagram-ui/package.json b/dox-sequence-diagram-ui/package.json index f2884eb217..dbac50aaca 100644 --- a/dox-sequence-diagram-ui/package.json +++ b/dox-sequence-diagram-ui/package.json @@ -50,7 +50,7 @@ "svg-sprite-loader": "3.7.3", "url-loader": "^1.0.1", "webpack": "^4.5.0", - "webpack-cli": "^2.0.14", + "webpack-cli": "^3.3.12", "webpack-dev-server": "^3.1.2" }, "engines": { diff --git a/openecomp-ui/.gitignore b/openecomp-ui/.gitignore index d19b3e01d6..fb12975889 100644 --- a/openecomp-ui/.gitignore +++ b/openecomp-ui/.gitignore @@ -17,3 +17,4 @@ coverage .storybook/resources yarn-error.log stats.json +package-lock.json diff --git a/openecomp-ui/README.md b/openecomp-ui/README.md index 883aeb41e3..c270802744 100644 --- a/openecomp-ui/README.md +++ b/openecomp-ui/README.md @@ -2,33 +2,41 @@ ## Setup -##### Install `nodejs`: +###Install `npm` -download nodejs from here: https://nodejs.org/en/ (take the "current" version with latest features) & install it. -##### Install `gulp` +Install npm v6. + +###Install `Node.js` + +Install node v10.17.0 (as in the pom.xml v10.17.0). + +* To manage different versions of node, is recommended to install "n" (https://github.com/tj/n). + +### Install `gulp` install gulp by running the following command `npm install --global gulp-cli` -##### Install DOX-UI +## Build + +### Install DOX-UI * pull for latest changes -* go to folder `dox-sequence-diagram-ui` -* run `npm install` -* wait for it... -* go to folder `openecomp-ui` -* run `npm install` -* create a copy of `devConfig.defaults.json` file and name it `devConfig.json` (we already configured git to ignore it so it will not be pushed) -in that file. +* go to folder `../dox-sequence-diagram-ui` +* run `npm install && npm run build` - set "proxyCatalogTarget" to the URL of the sdc-frontend; set "proxyTarget" to the URL of the sdc-onboard-backend (**pay attention, it is a JSON file**): +#### Install onboarding-fe +* go to the current project folder `openecomp-ui` +* run `npm install` +* create a copy of `devConfig.defaults.json` file and name it `devConfig.json` (it is already configured to gitignore, so it will not be pushed) +* in `devConfig.json`: + * set "proxyCatalogTarget" to the URL of the sdc-frontend; set "proxyTarget" to the URL of the sdc-onboard-backend (**pay attention, it is a JSON file**): - For example *http://\:\* + For example *http://\:\* * run `npm start` * your favorite UI will wait for you at: `http://localhost:9000/sdc1/#!/onboardVendor` - - -#### Troubleshooting +## Troubleshooting Problem | Why is this happening | Solution ------- | --------------------- | -------- +Build (npm install) error | npm/node_modules cache | If having problems with the compilation of dox-sequence-diagram-ui and openecomp-ui, delete the node_modules and package-lock.json in each respective projects folder. npm cannot reach destination | proxy | When within managed network, you should set your proxy to NPM as the following:
`npm config set proxy http://:`
`npm config set https-proxy http://:` git protocol is blocked and cannot connect | managed network rules for protocols | When within managed network, you should set globally that when git protocol is used, then it will be replaced with "https"
`git config --global url."https://".insteadOf git://` diff --git a/openecomp-ui/package.json b/openecomp-ui/package.json index 58074fa419..e19b0b1c71 100644 --- a/openecomp-ui/package.json +++ b/openecomp-ui/package.json @@ -52,7 +52,7 @@ "validator": "^4.3.0" }, "devDependencies": { - "babel-core": "^6.24.0", + "babel-core": "^6.26.0", "babel-eslint": "^8.2.1", "babel-jest": "^22.1.0", "babel-loader": "7.1.4", @@ -102,7 +102,7 @@ "svg-sprite-loader": "^3.7.3", "url-loader": "^0.5.7", "webpack": "^4.5.0", - "webpack-cli": "^2.0.14", + "webpack-cli": "^3.3.12", "webpack-dev-server": "^3.1.3", "worker-loader": "^2.0.0", "html-webpack-plugin": "^3.2.0" diff --git a/openecomp-ui/src/nfvo-utils/i18n/i18n.js b/openecomp-ui/src/nfvo-utils/i18n/i18n.js index 43a183def4..6d60daec24 100644 --- a/openecomp-ui/src/nfvo-utils/i18n/i18n.js +++ b/openecomp-ui/src/nfvo-utils/i18n/i18n.js @@ -25,7 +25,7 @@ import i18nJson from 'i18nJson'; var Intl = window.Intl || IntlObj.default, IntlMessageFormat = IntlMessageFormatObj.default, IntlRelativeFormat = IntlRelativeFormatObj.default, - createFormatCache = createFormatCacheObj.default; + createFormatCache = createFormatCacheObj; /*extract locale*/ var _locale = window.localStorage && localStorage.getItem('user_locale'); diff --git a/openecomp-ui/webpack.config.js b/openecomp-ui/webpack.config.js index f3b410e54e..be2e75efdb 100644 --- a/openecomp-ui/webpack.config.js +++ b/openecomp-ui/webpack.config.js @@ -86,10 +86,7 @@ module.exports = (env, argv) => { ], include: [ /resources/, - path.join( - __dirname, - 'node_modules/dox-sequence-diagram-ui/' - ), + path.join(__dirname, DEV ? '../dox-sequence-diagram-ui/' : 'node_modules/dox-sequence-diagram-ui/'), path.join(__dirname, 'node_modules/react-datepicker/'), path.join(__dirname, 'node_modules/react-select/'), path.join(__dirname, 'node_modules/onap-ui-common/'), -- 2.16.6