Commit 7f3b7a90 authored by Kevin Robert's avatar Kevin Robert
Browse files

Merge branch 'feature/front_backoffice' into feature/tabs

parents f143b35a fd4c13f9
......@@ -6,19 +6,17 @@ root = true
[*]
# Change these settings to your own preference
indent_style = space
indent_size = 4
max_line_length = 180
# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.{ts,tsx,js,json,css,scss,sql,ejs}]
# Change these settings to your own preference
indent_style = space
indent_size = 4
[*.{ts,tsx,js,jsx,json,css,scss,yml,html,vue}]
indent_size = 2
[*.md]
......
node_modules/
src/main/docker/
src/test/javascript/jest.conf.js
webpack/
target/
build/
node/
postcss.config.js
module.exports = {
root: true,
env: {
node: true,
},
extends: [
'plugin:vue/essential',
'eslint:recommended',
'@vue/typescript/recommended',
'@vue/prettier',
'@vue/prettier/@typescript-eslint',
],
parserOptions: {
ecmaVersion: 2020,
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
},
ignorePatterns: ['**/src/main docker/**/*.js'],
};
......@@ -69,7 +69,12 @@ out/
######################
# Visual Studio Code
######################
.vscode/
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
######################
# Maven
......
module.exports = {
'{,src/**/}*.{json,md,yml,ts,css,scss}': ['prettier --write', 'git add']
'{,src/**/,webpack/}*.{md,json,yml,html,js,ts,tsx,css,scss,vue,java}': ['prettier --write'],
};
legacy-peer-deps = true
......@@ -4,7 +4,7 @@
"packageName": "com.unantes.orientactive",
"nativeLanguage": "fr"
},
"jhipsterVersion": "6.10.3",
"jhipsterVersion": "7.0.0",
"applicationType": "monolith",
"baseName": "orientactive",
"packageName": "com.unantes.orientactive",
......@@ -43,11 +43,15 @@
"enableTranslation": true,
"nativeLanguage": "fr",
"languages": ["fr", "en"],
"blueprints": [
{
"name": "generator-jhipster-vuejs",
"version": "1.9.2"
}
]
"blueprints": [],
"skipUserManagement": false,
"withAdminUi": true,
"skipClient": false,
"skipServer": false,
"skipCheckLengthOfIdentifier": false,
"skipFakeData": false,
"pages": [],
"reactive": false,
"entities": ["Workspace", "Form", "Variable", "Screen", "Answer", "UserAction"]
}
}
......@@ -6,7 +6,7 @@ def orientationActiveBuildStep = { defaultStep ->
// les tests ne sont exécutés que la nuit
if (isTimerTriggeredJob) {
docker.image("node:12").inside("-e 'HOME=.'") {
docker.image("node:14").inside("-e 'HOME=.'") {
sh "npm install"
sh "npm run test-ci"
}
......
# orientactive
This application was generated using JHipster 6.10.3, you can find documentation and help at [https://www.jhipster.tech/documentation-archive/v6.10.3](https://www.jhipster.tech/documentation-archive/v6.10.3).
This application was generated using JHipster 7.0.0, you can find documentation and help at [https://www.jhipster.tech/documentation-archive/v7.0.0](https://www.jhipster.tech/documentation-archive/v7.0.0).
## Development
......@@ -12,15 +12,19 @@ Before you can build this project, you must install and configure the following
After installing Node, you should be able to run the following command to install development tools.
You will only need to run this command when dependencies change in [package.json](package.json).
npm install
```
npm install
```
We use npm scripts and [Webpack][] as our build system.
Run the following commands in two separate terminals to create a blissful development experience where your browser
auto-refreshes when files change on your hard drive.
./mvnw
npm start
```
./mvnw
npm start
```
Npm is also used to manage CSS and JavaScript dependencies used in this application. You can upgrade dependencies by
specifying a newer version in [package.json](package.json). You can also run `npm update` and `npm install` to manage dependencies.
......@@ -28,11 +32,11 @@ Add the `help` flag on any command to see how you can use it. For example, `npm
The `npm run` command will list all of the scripts available to run for this project.
### Service workers
### PWA Support
Service workers are commented by default, to enable them please uncomment the following code.
JHipster ships with PWA (Progressive Web App) support, and it's turned off by default. One of the main components of a PWA is a service worker.
- The service worker registering script in index.html
The service worker initialization code is commented out by default. To enable it, uncomment the following code in `src/main/webapp/index.html`:
```html
<script>
......@@ -44,45 +48,27 @@ Service workers are commented by default, to enable them please uncomment the fo
</script>
```
Note: workbox creates the respective service worker and dynamically generate the `service-worker.js`
Note: [Workbox](https://developers.google.com/web/tools/workbox/) powers JHipster's service worker. It dynamically generates the `service-worker.js` file.
### Managing dependencies
For example, to add [Leaflet][] library as a runtime dependency of your application, you would run following command:
npm install --save --save-exact leaflet
To benefit from TypeScript type definitions from [DefinitelyTyped][] repository in development, you would run following command:
npm install --save-dev --save-exact @types/leaflet
Then you would import the JS and CSS files specified in library's installation instructions so that [Webpack][] knows about them:
Edit [src/main/webapp/app/main.ts](src/main/webapp/app/main.ts) file:
```
import 'leaflet/dist/leaflet.js';
npm install --save --save-exact leaflet
```
Edit [src/main/webapp/content/scss/vendor.scss](src/main/webapp/content/scss/vendor.scss) file:
To benefit from TypeScript type definitions from [DefinitelyTyped][] repository in development, you would run following command:
```
@import '~leaflet/dist/leaflet.scss';
npm install --save-dev --save-exact @types/leaflet
```
Note: there are still few other things remaining to do for Leaflet that we won't detail here.
Then you would import the JS and CSS files specified in library's installation instructions so that [Webpack][] knows about them:
Note: There are still a few other things remaining to do for Leaflet that we won't detail here.
For further instructions on how to develop with JHipster, have a look at [Using JHipster in development][].
### Using vue-cli
You can also use [Vue CLI][] to display the project using vue UI.
For example, the following command:
vue ui
will generate open Vue Project Manager. From there, you'll be able to manage your project as any other Vue.js projects.
### Doing API-First development using openapi-generator
[OpenAPI-Generator]() is configured for this application. You can generate API code from the `src/main/resources/swagger/api.yml` definition file by running:
......@@ -103,12 +89,16 @@ Refer to [Doing API-First development][] for more details.
To build the final jar and optimize the orientactive application for production, run:
./mvnw -Pprod clean verify
```
./mvnw -Pprod clean verify
```
This will concatenate and minify the client CSS and JavaScript files. It will also modify `index.html` so it references these new files.
To ensure everything worked, run:
java -jar target/*.jar
```
java -jar target/*.jar
```
Then navigate to [http://localhost:8080](http://localhost:8080) in your browser.
......@@ -118,17 +108,25 @@ Refer to [Using JHipster in production][] for more details.
To package your application as a war in order to deploy it to an application server, run:
./mvnw -Pprod,war clean verify
```
./mvnw -Pprod,war clean verify
```
## Testing
To launch your application's tests, run:
```
./mvnw verify
```
### Client tests
Unit tests are run by [Jest][] and written with [Jasmine][]. They're located in [src/test/javascript/](src/test/javascript/) and can be run with:
Unit tests are run by [Jest][]. They're located in [src/test/javascript/](src/test/javascript/) and can be run with:
```
npm test
```
For more information, refer to the [Running tests page][].
......@@ -140,7 +138,10 @@ Sonar is used to analyse code quality. You can start a local Sonar server (acces
docker-compose -f src/main/docker/sonar.yml up -d
```
Note: we have turned off authentication in [src/main/docker/sonar.yml](src/main/docker/sonar.yml) for out of the box experience while trying out SonarQube, for real use cases turn it back on.
You can run a Sonar analysis with using the [sonar-scanner](https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner) or by using the maven plugin.
Then, run a Sonar analysis:
```
......@@ -153,7 +154,6 @@ If you need to re-run the Sonar phase, please be sure to specify at least the `i
./mvnw initialize sonar:sonar
```
or
For more information, refer to the [Code quality page][].
## Using Docker to simplify development (optional)
......@@ -161,15 +161,30 @@ For more information, refer to the [Code quality page][].
You can use Docker to improve your JHipster development experience. A number of docker-compose configuration are available in the [src/main/docker](src/main/docker) folder to launch required third party services.
For example, to start a postgresql database in a docker container, run:
```
docker-compose -f src/main/docker/postgresql.yml up -d
```
To stop it and remove the container, run:
```
docker-compose -f src/main/docker/postgresql.yml down
```
You can also fully dockerize your application and all the services that it depends on.
To achieve this, first build a docker image of your app by running:
```
./mvnw -Pprod verify jib:dockerBuild
```
Then run:
```
docker-compose -f src/main/docker/app.yml up -d
```
For more information refer to [Using Docker and Docker-Compose][], this page also contains information on the docker-compose sub-generator (`jhipster docker-compose`), which is able to generate docker configurations for one or several JHipster applications.
## Continuous Integration (optional)
......@@ -177,23 +192,21 @@ For more information refer to [Using Docker and Docker-Compose][], this page als
To configure CI for your project, run the ci-cd sub-generator (`jhipster ci-cd`), this will let you generate configuration files for a number of Continuous Integration systems. Consult the [Setting up Continuous Integration][] page for more information.
[jhipster homepage and latest documentation]: https://www.jhipster.tech
[jhipster 6.10.3 archive]: https://www.jhipster.tech/documentation-archive/v6.10.3
[using jhipster in development]: https://www.jhipster.tech/documentation-archive/v6.10.3/development/
[using docker and docker-compose]: https://www.jhipster.tech/documentation-archive/v6.10.3/docker-compose
[using jhipster in production]: https://www.jhipster.tech/documentation-archive/v6.10.3/production/
[running tests page]: https://www.jhipster.tech/documentation-archive/v6.10.3/running-tests/
[code quality page]: https://www.jhipster.tech/documentation-archive/v6.10.3/code-quality/
[setting up continuous integration]: https://www.jhipster.tech/documentation-archive/v6.10.3/setting-up-ci/
[jhipster 7.0.0 archive]: https://www.jhipster.tech/documentation-archive/v7.0.0
[using jhipster in development]: https://www.jhipster.tech/documentation-archive/v7.0.0/development/
[using docker and docker-compose]: https://www.jhipster.tech/documentation-archive/v7.0.0/docker-compose
[using jhipster in production]: https://www.jhipster.tech/documentation-archive/v7.0.0/production/
[running tests page]: https://www.jhipster.tech/documentation-archive/v7.0.0/running-tests/
[code quality page]: https://www.jhipster.tech/documentation-archive/v7.0.0/code-quality/
[setting up continuous integration]: https://www.jhipster.tech/documentation-archive/v7.0.0/setting-up-ci/
[node.js]: https://nodejs.org/
[yarn]: https://yarnpkg.org/
[webpack]: https://webpack.github.io/
[vue cli]: https://cli.vuejs.org/
[browsersync]: https://www.browsersync.io/
[jest]: https://facebook.github.io/jest/
[jasmine]: https://jasmine.github.io/2.0/introduction.html
[protractor]: https://www.protractortest.org/
[protractor]: https://angular.github.io/protractor/
[leaflet]: https://leafletjs.com/
[definitelytyped]: https://definitelytyped.org/
[openapi-generator]: https://openapi-generator.tech
[swagger-editor]: https://editor.swagger.io
[doing api-first development]: https://www.jhipster.tech/documentation-archive/v6.10.3/doing-api-first-development/
[doing api-first development]: https://www.jhipster.tech/documentation-archive/v7.0.0/doing-api-first-development/
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"https://www.puppycrawl.com/dtds/configuration_1_3.dtd">
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
<!-- Configure checker to use UTF-8 encoding -->
......@@ -9,8 +9,7 @@
<property name="fileExtensions" value=""/>
<!-- For detailed checkstyle configuration, see https://github.com/spring-io/nohttp/tree/master/nohttp-checkstyle -->
<module name="io.spring.nohttp.checkstyle.check.NoHttpCheck">
<property name="whitelist" value="http://maven.apache.org/POM/4.0.0&#10;
http://www.w3.org/2001/XMLSchema-instance&#10;http://maven.apache.org/maven-v4_0_0.xsd"/>
<property name="allowlist" value="^\Qhttp://maven.apache.org/POM/4.0.0&#10;^\Qhttp://www.w3.org/2001/XMLSchema-instance"/>
</module>
<!-- Allow suppression with comments
// CHECKSTYLE:OFF
......
'use strict';
const merge = require('webpack-merge');
const webpackMerge = require('webpack-merge').merge;
const prodEnv = require('./prod.env');
module.exports = merge(prodEnv, {
module.exports = webpackMerge(prodEnv, {
NODE_ENV: '"development"',
SERVER_API_URL: '\'\'',
SERVER_API_URL: "''",
BUILD_TIMESTAMP: `'${new Date().getTime()}'`,
// APP_VERSION is passed as an environment variable from the Gradle / Maven build tasks.
VERSION: `'${process.env.hasOwnProperty('APP_VERSION') ? process.env.APP_VERSION : 'UNKNOWN'}'`,
......
......@@ -5,63 +5,63 @@
const path = require('path');
module.exports = {
dev: {
// Paths
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {},
dev: {
// Paths
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {},
// Various Dev Server settings
host: 'localhost', // can be overwritten by process.env.HOST
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false,
errorOverlay: true,
notifyOnErrors: true,
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
// Various Dev Server settings
host: 'localhost', // can be overwritten by process.env.HOST
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false,
errorOverlay: true,
notifyOnErrors: true,
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
/**
* Source Maps
*/
/**
* Source Maps
*/
// https://webpack.js.org/configuration/devtool/#development
devtool: 'cheap-module-eval-source-map',
// https://webpack.js.org/configuration/devtool/#development
devtool: 'cheap-module-source-map',
// If you have problems debugging vue-files in devtools,
// set this to false - it *may* help
// https://vue-loader.vuejs.org/en/options.html#cachebusting
cacheBusting: true,
// If you have problems debugging vue-files in devtools,
// set this to false - it *may* help
// https://vue-loader.vuejs.org/en/options.html#cachebusting
cacheBusting: true,
cssSourceMap: true
},
cssSourceMap: true,
},
build: {
// Template for index.html
index: path.resolve(__dirname, '../target/www/index.html'),
build: {
// Template for index.html
index: path.resolve(__dirname, '../target/www/index.html'),
// Paths
assetsRoot: path.resolve(__dirname, '../target'),
assetsSubDirectory: 'static',
assetsPublicPath: '/',
// Paths
assetsRoot: path.resolve(__dirname, '../target'),
assetsSubDirectory: 'static',
assetsPublicPath: '/',
/**
* Source Maps
*/
/**
* Source Maps
*/
productionSourceMap: true,
// https://webpack.js.org/configuration/devtool/#production
devtool: '#source-map',
productionSourceMap: true,
// https://webpack.js.org/configuration/devtool/#production
devtool: 'source-map',
// Gzip off by default as many popular static hosts such as
// Surge or Netlify already gzip all static assets for you.
// Before setting to `true`, make sure to:
// npm install --save-dev compression-webpack-plugin
productionGzip: false,
productionGzipExtensions: ['js', 'css'],
// Gzip off by default as many popular static hosts such as
// Surge or Netlify already gzip all static assets for you.
// Before setting to `true`, make sure to:
// npm install --save-dev compression-webpack-plugin
productionGzip: false,
productionGzipExtensions: ['js', 'css'],
// Run the build command with an extra argument to
// View the bundle analyzer report after build finishes:
// `npm run build --report`
// Set to `true` or `false` to always turn it on or off
bundleAnalyzerReport: process.env.npm_config_report
}
// Run the build command with an extra argument to
// View the bundle analyzer report after build finishes:
// `npm run build --report`
// Set to `true` or `false` to always turn it on or off
bundleAnalyzerReport: process.env.npm_config_report,
},
};
This diff is collapsed.
{
"name": "orientactive",
"version": "0.0.0",
"description": "Description for orientactive",
"version": "0.0.1-SNAPSHOT",
"private": true,
"description": "Description for orientactive",
"license": "UNLICENSED",
"cacheDirectories": [
"node_modules"
"scripts": {
"prettier:check": "prettier --check \"{,src/**/,webpack/}*.{md,json,yml,html,js,ts,tsx,css,scss,vue,java}\"",
"prettier:format": "prettier --write \"{,src/**/,webpack/}*.{md,json,yml,html,js,ts,tsx,css,scss,vue,java}\"",
"lint": "vue-cli-service lint --no-fix",
"lint:fix": "vue-cli-service lint",
"cleanup": "rimraf target/classes/static/",
"clean-www": "rimraf target/classes/static/app/{src,target/}",
"start": "npm run webapp:dev",
"start-tls": "npm run webapp:dev -- --env.tls",
"serve": "npm run start",
"build": "npm run webapp:prod",
"jest": "jest --coverage --logHeapUsage --maxWorkers=2 --no-cache --config src/test/javascript/jest.conf.js",
"jest:update": "npm run jest -- --updateSnapshot",
"pretest": "npm run lint",
"test": "npm run jest",
"test-ci": "npm run lint && npm run jest:update",
"test:watch": "npm run jest -- --watch",
"webapp:build": "npm run clean-www && npm run webapp:build:dev",
"webapp:build:dev": "npm run webpack -- --config webpack/webpack.dev.js --progress=profile --env stats=minimal",
"webapp:build:prod": "npm run webpack -- --config webpack/webpack.prod.js --progress=profile --env stats=minimal",
"webapp:dev": "npm run webpack-dev-server -- --config webpack/webpack.dev.js --progress=profile --inline --env stats=normal",
"webapp:prod": "npm run clean-www && npm run webapp:build:prod",
"webapp:test": "npm run test",
"webpack-dev-server": "webpack serve",
"webpack": "node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js",
"docker:db:up": "docker-compose -f src/main/docker/postgresql.yml up -d",
"docker:db:down": "docker-compose -f src/main/docker/postgresql.yml down -v --remove-orphans",
"docker:others:await": "",
"predocker:others:up": "",
"docker:others:up": "",
"docker:others:down": "",
"ci:e2e:prepare:docker": "npm run docker:db:up && npm run docker:others:up && docker ps -a",
"ci:e2e:prepare": "npm run ci:e2e:prepare:docker",
"ci:e2e:teardown:docker": "npm run docker:db:down --if-present && npm run docker:others:down && docker ps -a",
"ci:e2e:teardown": "npm run ci:e2e:teardown:docker",
"backend:info": "./mvnw -ntp enforcer:display-info --batch-mode",
"backend:doc:test": "./mvnw -ntp javadoc:javadoc --batch-mode",
"backend:nohttp:test": "./mvnw -ntp checkstyle:check --batch-mode",
"java:jar": "./mvnw -ntp verify -DskipTests --batch-mode",
"java:war": "./mvnw -ntp verify -DskipTests --batch-mode -Pwar",
"java:docker": "./mvnw -ntp verify -DskipTests jib:dockerBuild",
"backend:unit:test": "./mvnw -ntp -P-webapp verify --batch-mode -Dlogging.level.ROOT=OFF -Dlogging.level.org.zalando=OFF -Dlogging.level.tech.jhipster=OFF -Dlogging.level.com.unantes.orientactive=OFF -Dlogging.level.org.springframework=OFF -Dlogging.level.org.springframework.web=OFF -Dlogging.level.org.springframework.security=OFF",
"java:jar:dev": "npm run java:jar -- -Pdev,webapp",
"java:jar:prod": "npm run java:jar -- -Pprod",
"java:war:dev": "npm run java:war -- -Pdev,webapp",
"java:war:prod": "npm run java:war -- -Pprod",
"java:docker:dev": "npm run java:docker -- -Pdev,webapp",
"java:docker:prod": "npm run java:docker -- -Pprod",
"start-app": "docker-compose -f src/main/docker/app.yml up",
"build:java": "./mvnw package -Pprod -DskipTests -Dskip.npm jib:dockerBuild",
"java": "npm run build:java && npm run start-app",
"ci:backend:test": "npm run backend:info && npm run backend:doc:test && npm run backend:nohttp:test && npm run backend:unit:test",
"ci:server:package": "npm run java:$npm_package_config_packaging:$npm_package_config_default_environment",
"ci:e2e:package": "npm run java:$npm_package_config_packaging:$npm_package_config_default_environment -- -Pe2e -Denforcer.skip=true",
"preci:e2e:server:start": "npm run docker:db:await --if-present && npm run docker:others:await --if-present",
"ci:e2e:server:start": "java -jar target/e2e.$npm_package_config_packaging --spring.profiles.active=$npm_package_config_default_environment -Dlogging.level.ROOT=OFF -Dlogging.level.org.zalando=OFF -Dlogging.level.tech.jhipster=OFF -Dlogging.level.com.unantes.orientactive=OFF -Dlogging.level.org.springframework=OFF -Dlogging.level.org.springframework.web=OFF -Dlogging.level.org.springframework.security=OFF --logging.level.org.springframework.web=ERROR",
"ci:frontend:build": "npm run webapp:build:$npm_package_config_default_environment",
"ci:frontend:test": "npm run ci:frontend:build && npm test"
},
"config": {
"backend_port": "8080",
"default_environment": "prod",
"packaging": "jar"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
],
"dependencies": {
"axios": "^0.21.1",
"date-fns": "2.14.0",
"swagger-ui-dist": "3.25.4",
"vue": "2.6.11",
"vue-class-component": "7.2.3",
"axios": "0.21.1",
"dayjs": "1.10.4",
"swagger-ui-dist": "3.45.0",
"vue": "2.6.12",
"vue-class-component": "7.2.6",
"vue-cookie": "1.1.4",
"vue-i18n": "8.17.7",
"vue-i18n": "8.24.1",
"vue-infinite-loading": "2.4.5",
"vue-meta": "^2.4.0",
"vue-property-decorator": "8.4.2",
"vue-router": "3.2.0",
"vue2-filters": "0.11.0",
"vuelidate": "0.7.5",
"vuex": "3.4.0"
"vue-property-decorator": "9.1.2",
"vue-router": "3.5.1",
"vue2-filters": "0.12.0",
"vuelidate": "0.7.6",
"vuex": "3.6.2"
},
"devDependencies": {
"@tailwindcss/line-clamp": "^0.2.0",
"@tailwindcss/postcss7-compat": "^2.0.3",
"@types/jest": "25.2.3",
"@types/node": "14.0.4",
"@types/sinon": "9.0.3",
"@types/vuelidate": "0.7.13",
"@vue/cli-plugin-typescript": "4.3.1",
"@vue/cli-service": "4.3.1",
"@vue/test-utils": "1.0.3",
"autoprefixer": "^9.8.6",
"@types/jest": "26.0.20",
"@types/node": "14.14.35",
"@types/sinon": "9.0.11",