Repository: hipster-labs/generator-jhipster-react Branch: master Commit: 0a25d7f55229 Files: 74 Total size: 173.0 KB Directory structure: gitextract_jhdj0bxz/ ├── .editorconfig ├── .eslintignore ├── .eslintrc.json ├── .gitattributes ├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── generators/ │ ├── app/ │ │ ├── index.js │ │ └── prompts.js │ └── client/ │ ├── USAGE │ ├── files.js │ ├── index.js │ ├── prompts.js │ └── templates/ │ ├── _.babelrc │ ├── _.editorconfig │ ├── _.eslintrc.json │ ├── _package.json │ ├── _postcss.config.js │ ├── src/ │ │ └── main/ │ │ └── webapp/ │ │ ├── 404.html │ │ ├── app/ │ │ │ ├── app.js │ │ │ ├── app.scss │ │ │ ├── config/ │ │ │ │ ├── constants.js │ │ │ │ ├── devtools.js │ │ │ │ ├── promise-middleware.js │ │ │ │ ├── store.js │ │ │ │ ├── theme.js │ │ │ │ └── translation.js │ │ │ ├── index.js │ │ │ ├── modules/ │ │ │ │ ├── account/ │ │ │ │ │ ├── password/ │ │ │ │ │ │ └── password.js │ │ │ │ │ └── settings/ │ │ │ │ │ └── settings.js │ │ │ │ ├── administration/ │ │ │ │ │ ├── audits/ │ │ │ │ │ │ └── audits.js │ │ │ │ │ ├── configuration/ │ │ │ │ │ │ └── configuration.js │ │ │ │ │ ├── docs/ │ │ │ │ │ │ └── docs.js │ │ │ │ │ ├── gateway/ │ │ │ │ │ │ └── gateway.js │ │ │ │ │ ├── health/ │ │ │ │ │ │ ├── health-detail/ │ │ │ │ │ │ │ ├── health-detail.js │ │ │ │ │ │ │ ├── health-modal.js │ │ │ │ │ │ │ └── index.js │ │ │ │ │ │ └── health.js │ │ │ │ │ ├── logs/ │ │ │ │ │ │ └── logs.js │ │ │ │ │ ├── metrics/ │ │ │ │ │ │ ├── metrics-detail/ │ │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ │ ├── metrics-detail.js │ │ │ │ │ │ │ └── metrics-modal.js │ │ │ │ │ │ └── metrics.js │ │ │ │ │ └── user-management/ │ │ │ │ │ └── user-management.js │ │ │ │ ├── home/ │ │ │ │ │ ├── home.js │ │ │ │ │ ├── home.scss │ │ │ │ │ └── index.js │ │ │ │ └── login/ │ │ │ │ ├── index.js │ │ │ │ ├── login-modal.js │ │ │ │ └── login.js │ │ │ ├── reducers/ │ │ │ │ ├── account.js │ │ │ │ ├── administration.js │ │ │ │ ├── authentication.js │ │ │ │ ├── index.js │ │ │ │ └── locale.js │ │ │ ├── routes.js │ │ │ └── shared/ │ │ │ ├── components/ │ │ │ │ ├── footer/ │ │ │ │ │ └── footer.js │ │ │ │ ├── header/ │ │ │ │ │ ├── header.js │ │ │ │ │ └── header.scss │ │ │ │ └── private-route/ │ │ │ │ └── private-route.js │ │ │ ├── interceptors/ │ │ │ │ └── axios.js │ │ │ ├── util/ │ │ │ │ ├── global-style.js │ │ │ │ └── log-util.js │ │ │ └── variables.scss │ │ ├── index.html │ │ ├── robots.txt │ │ └── swagger-ui/ │ │ └── _index.html │ └── webpack/ │ ├── webpack.common.js │ ├── webpack.dev.js │ └── webpack.prod.js ├── gulpfile.js ├── package.json └── test/ └── app.js ================================================ FILE CONTENTS ================================================ ================================================ FILE: .editorconfig ================================================ root = true [*] indent_style = space indent_size = 2 charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false ================================================ FILE: .eslintignore ================================================ generators/**/templates travis ================================================ FILE: .eslintrc.json ================================================ { "env": { "node": true, "es6": true }, "extends": ["airbnb-base"], "rules": { "indent": [2, 2], "linebreak-style": 0, "eol-last": 2, "quotes": [2, "single"], "semi": [2, "always"], "eqeqeq": [2, "smart"], "no-use-before-define": [2, "nofunc"], "no-unused-vars": [2, {"vars": "local", "args": "none"}], "no-multi-str": 2, "no-irregular-whitespace": 2, "comma-dangle": "off", "max-len": "off", "func-names": "off", "class-methods-use-this": "off", "no-underscore-dangle": "off", "no-plusplus": "off", "no-multi-assign": "off", "no-param-reassign": "off", "no-shadow": "off" } } ================================================ FILE: .gitattributes ================================================ * text=auto ================================================ FILE: .gitignore ================================================ node_modules coverage .DS_Store .vscode/ .idea *.iml *.ipr *.iws atlassian-ide-plugin.xml /.project test/temp/ *debug.log* .vscode yarn.lock ================================================ FILE: .travis.yml ================================================ language: node_js node_js: - v6 ================================================ FILE: LICENSE ================================================ Copyright 2016 Deepu KS (http://deepu105.github.io) (http://deepu105.github.io) 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. ================================================ FILE: README.md ================================================ # DEPRECATED This module is now integrated into `generator-jhipster` repository as React support is now planned in the core generator. Work is being done on https://github.com/jhipster/generator-jhipster/tree/jh-react See [this issue](https://github.com/jhipster/generator-jhipster/issues/6044) for details # generator-jhipster-react [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] > A Jhipster based generator to create awesome react + spring boot applications jhipster-react logo ## Installation TODO: - Migrate Account modules - Migrate Admin modules - support no i18n properly - support no-sass option - Add entity sub generator - Add import-jdl sub generator - Migrate protractor tests - Add generator tests - Add generator travis builds First, install [Yeoman](http://yeoman.io) and [JHipster](http://jhipster.github.io/), then install generator-jhipster-react using [npm](https://www.npmjs.com/) (we assume you have pre-installed [node.js](https://nodejs.org/)). ```bash npm install -g yo npm install -g generator-jhipster ``` Clone [JHipster](https://github.com/jhipster/generator-jhipster) and run `npm link` inside it. Clone this project and run `npm link` and `npm link generator-jhipster` inside it. Now all the projects are pointing to latest master versions Now generate your new awesome project: ```bash yo jhipster-react ``` Make sure to run `npm link generator-jhipster-react` within the generated project if you are regenerating it again. As this is a generator which runs on top of [JHipster](http://jhipster.github.io/), we expect you have [JHipster and its related tools already installed](http://jhipster.github.io/installation.html). This generator requires Jhipster version 4.1 or greater in order to work ## Development-mode Frontend is working through [webpack-dev-server](webpack-dev-server-url) proxy mode feature in order to have an ability to use both frontend & backend server simultaneously. All requests from frontend would be proxied to backend server. To start frontend server please run the following command: ```bash yarn start ``` ## Contributing Contributions are welcome. we follow the same contribution guidelines as JHipster, [check it out here](https://github.com/jhipster/generator-jhipster/blob/master/CONTRIBUTING.md) ## License Apache-2.0 © [Deepu KS](http://deepu105.github.io) [webpack-dev-server-url]: https://webpack.github.io/docs/webpack-dev-server.html [npm-image]: https://badge.fury.io/js/generator-jhipster-react.svg [npm-url]: https://npmjs.org/package/generator-jhipster-react [travis-image]: https://travis-ci.org/deepu105/generator-jhipster-react.svg?branch=master [travis-url]: https://travis-ci.org/deepu105/generator-jhipster-react [daviddm-image]: https://david-dm.org/hipster-labs/generator-jhipster-react.svg?theme=shields.io [daviddm-url]: https://david-dm.org/hipster-labs/generator-jhipster-react ================================================ FILE: generators/app/index.js ================================================ const util = require('util'); const generator = require('yeoman-generator'); const chalk = require('chalk'); const BaseGenerator = require('generator-jhipster/generators/generator-base'); const cleanup = require('generator-jhipster/generators/cleanup'); const prompts = require('./prompts'); const packagejs = require('../../package.json'); const constants = require('generator-jhipster/generators/generator-constants'); const JhipsterGenerator = generator.extend({}); util.inherits(JhipsterGenerator, BaseGenerator); module.exports = JhipsterGenerator.extend({ constructor: function (...args) { // eslint-disable-line object-shorthand generator.apply(this, args); this.configOptions = {}; // This adds support for a `--skip-server` flag this.option('skip-server', { desc: 'Skip the server-side application generation', type: Boolean, defaults: false }); // This adds support for a `--skip-user-management` flag this.option('skip-user-management', { desc: 'Skip the user management module during app generation', type: Boolean, defaults: false }); // This adds support for a `--[no-]i18n` flag this.option('i18n', { desc: 'Disable or enable i18n when skipping client side generation, has no effect otherwise', type: Boolean, defaults: true }); // This adds support for a `--with-entities` flag this.option('with-entities', { desc: 'Regenerate the existing entities if any', type: Boolean, defaults: false }); // This adds support for a `--skip-checks` flag this.option('skip-checks', { desc: 'Check the status of the required tools', type: Boolean, defaults: false }); // This adds support for a `--npm` flag this.option('npm', { desc: 'Use npm instead of yarn', type: Boolean, defaults: false }); this.currentQuestion = 0; this.totalQuestions = constants.QUESTIONS; this.skipServer = this.configOptions.skipServer = this.options['skip-server'] || this.config.get('skipServer'); this.skipUserManagement = this.configOptions.skipUserManagement = this.options['skip-user-management'] || this.config.get('skipUserManagement'); this.jhiPrefix = this.configOptions.jhiPrefix || this.config.get('jhiPrefix') || this.options['jhi-prefix']; this.withEntities = this.options['with-entities']; this.skipChecks = this.options['skip-checks']; this.useYarn = this.configOptions.useYarn = !this.options.npm; this.isDebugEnabled = this.configOptions.isDebugEnabled = this.options.debug; }, initializing: { displayLogo() { this.printJHipsterLogo(); }, checkJava() { this.checkJava(); }, checkNode() { this.checkNode(); }, checkGit() { this.checkGit(); }, checkGitConnection() { this.checkGitConnection(); }, checkYarn() { this.checkYarn(); }, validate() { if (this.skipServer && this.skipClient) { this.error(chalk.red(`You can not pass both ${chalk.yellow('--skip-client')} and ${chalk.yellow('--skip-server')} together`)); } }, setupconsts() { this.applicationType = this.config.get('applicationType'); if (!this.applicationType) { this.applicationType = 'monolith'; } this.baseName = this.config.get('baseName'); this.jhipsterVersion = packagejs.version; if (this.jhipsterVersion === undefined) { this.jhipsterVersion = this.config.get('jhipsterVersion'); } this.otherModules = this.config.get('otherModules'); this.testFrameworks = this.config.get('testFrameworks'); this.enableTranslation = this.config.get('enableTranslation'); this.nativeLanguage = this.config.get('nativeLanguage'); this.languages = this.config.get('languages'); const configFound = this.baseName !== undefined && this.applicationType !== undefined; if (configFound) { this.existingProject = true; // If translation is not defined, it is enabled by default if (this.enableTranslation === undefined) { this.enableTranslation = true; } } this.clientPackageManager = this.config.get('clientPackageManager'); if (!this.clientPackageManager) { if (this.useYarn) { this.clientPackageManager = 'yarn'; } else { this.clientPackageManager = 'npm'; } } } }, prompting: { askForInsightOptIn: prompts.askForInsightOptIn, askForApplicationType: prompts.askForApplicationType, askForModuleName: prompts.askForModuleName, }, configuring: { setup() { this.configOptions.skipI18nQuestion = true; this.configOptions.baseName = this.baseName; this.configOptions.logo = false; this.configOptions.otherModules = this.otherModules; this.configOptions.lastQuestion = this.currentQuestion; this.generatorType = 'app'; if (this.applicationType === 'microservice') { this.skipClient = true; this.generatorType = 'server'; this.skipUserManagement = this.configOptions.skipUserManagement = true; } if (this.applicationType === 'uaa') { this.skipClient = true; this.generatorType = 'server'; this.skipUserManagement = this.configOptions.skipUserManagement = false; this.authenticationType = this.configOptions.authenticationType = 'uaa'; } if (this.skipClient) { // defaults to use when skipping client this.generatorType = 'server'; this.configOptions.enableTranslation = this.options.i18n; } if (this.skipServer) { this.generatorType = 'client'; // defaults to use when skipping server } this.configOptions.clientPackageManager = this.clientPackageManager; }, composeServer() { if (this.skipServer) return; this.composeWith(require.resolve('generator-jhipster/generators/server'), { 'client-hook': !this.skipClient, configOptions: this.configOptions, force: this.options.force }); }, composeClient() { if (this.skipClient) return; this.composeWith(require.resolve('../client'), { 'skip-install': this.options['skip-install'], configOptions: this.configOptions, force: this.options.force }); }, askFori18n: prompts.askFori18n }, default: { askForTestOpts: prompts.askForTestOpts, setSharedConfigOptions() { this.configOptions.lastQuestion = this.currentQuestion; this.configOptions.totalQuestions = this.totalQuestions; this.configOptions.testFrameworks = this.testFrameworks; this.configOptions.enableTranslation = this.enableTranslation; this.configOptions.nativeLanguage = this.nativeLanguage; this.configOptions.languages = this.languages; this.configOptions.clientPackageManager = this.clientPackageManager; }, /* insight() { const insight = this.insight(); insight.trackWithEvent('generator', 'app'); insight.track('app/applicationType', this.applicationType); insight.track('app/testFrameworks', this.testFrameworks); insight.track('app/otherModules', this.otherModules); insight.track('app/clientPackageManager', this.clientPackageManager); },*/ composeLanguages() { if (this.skipI18n) return; this.composeLanguagesSub(this, this.configOptions, this.generatorType); }, saveConfig() { this.config.set('jhipsterVersion', packagejs.version); this.config.set('applicationType', this.applicationType); this.config.set('baseName', this.baseName); this.config.set('testFrameworks', this.testFrameworks); this.config.set('jhiPrefix', this.jhiPrefix); this.config.set('otherModules', this.otherModules); if (this.skipClient) this.config.set('skipClient', true); if (this.skipServer) this.config.set('skipServer', true); if (this.skipUserManagement) this.config.set('skipUserManagement', true); this.config.set('enableTranslation', this.enableTranslation); if (this.enableTranslation) { this.config.set('nativeLanguage', this.nativeLanguage); this.config.set('languages', this.languages); } this.config.set('clientPackageManager', this.clientPackageManager); } }, writing: { cleanup() { cleanup.cleanupOldFiles(this, this.javaDir, this.testDir); }, // regenerateEntities() { // if (this.withEntities) { // this.getExistingEntities().forEach((entity) => { // this.composeWith(require.resolve('../entity'), { // regenerate: true, // 'skip-install': true, // force: this.options.force, // debug: this.isDebugEnabled, // arguments: [entity.name] // }); // }); // } // } }, /* end: { localInstall() { if (this.skipClient) { if (this.otherModules === undefined) { this.otherModules = []; } // Generate a package.json file containing the current version // of the generator as dependency this.template('_skipClientApp.package.json', 'package.json'); if (!this.options['skip-install']) { if (this.clientPackageManager === 'yarn') { this.log(chalk.bold(`\nInstalling generator-jhipster@${this.jhipsterVersion} locally using yarn`)); this.spawnCommand('yarn', ['install']); } else if (this.clientPackageManager === 'npm') { this.log(chalk.bold(`\nInstalling generator-jhipster@${this.jhipsterVersion} locally using npm`)); this.npmInstall(); } } } } }*/ }); ================================================ FILE: generators/app/prompts.js ================================================ const chalk = require('chalk'); module.exports = { askForInsightOptIn, askForApplicationType, askForModuleName, askFori18n, askForTestOpts }; function askForInsightOptIn() { if (this.existingProject) return; // const done = this.async(); // const insight = this.insight(); // this.prompt({ // when: () => insight.optOut === undefined, // type: 'confirm', // name: 'insight', // message: `May ${chalk.cyan('JHipster')} anonymously report usage statistics to improve the tool over time?`, // default: true // }).then((prompt) => { // if (prompt.insight !== undefined) { // insight.optOut = !prompt.insight; // } // done(); // }); } function askForApplicationType() { if (this.existingProject) return; const DEFAULT_APPTYPE = 'monolith'; if (this.skipServer) { this.applicationType = this.configOptions.applicationType = DEFAULT_APPTYPE; return; } const done = this.async(); this.prompt({ type: 'list', name: 'applicationType', message: response => this.getNumberedQuestion('Which *type* of application would you like to create?', true), choices: [ { value: DEFAULT_APPTYPE, name: 'Monolithic application (recommended for simple projects)' }, { value: 'microservice', name: 'Microservice application' }, { value: 'gateway', name: 'Microservice gateway' }, // { // value: 'uaa', // name: '[BETA] JHipster UAA server (for microservice OAuth2 authentication)' // } ], default: DEFAULT_APPTYPE }).then((prompt) => { this.applicationType = this.configOptions.applicationType = prompt.applicationType; done(); }); } function askForModuleName() { if (this.existingProject) return; this.askModuleName(this); this.configOptions.lastQuestion = this.currentQuestion; this.configOptions.totalQuestions = this.totalQuestions; } function askFori18n() { this.currentQuestion = this.configOptions.lastQuestion; this.totalQuestions = this.configOptions.totalQuestions; if (this.skipI18n || this.existingProject) return; this.aski18n(this); } function askForTestOpts() { if (this.existingProject) return; const choices = []; const defaultChoice = []; if (!this.skipServer) { // all server side test frameworks should be added here choices.push( { name: 'Gatling', value: 'gatling' }, { name: 'Cucumber', value: 'cucumber' } ); } if (!this.skipClient) { // all client side test frameworks should be added here choices.push( { name: 'Protractor', value: 'protractor' } ); } const done = this.async(); this.prompt({ type: 'checkbox', name: 'testFrameworks', message: response => this.getNumberedQuestion('Besides JUnit and Karma, which testing frameworks would you like to use?', true), choices, default: defaultChoice }).then((prompt) => { this.testFrameworks = prompt.testFrameworks; done(); }); } ================================================ FILE: generators/client/USAGE ================================================ Description: Creates a new JHipster React client side application based on the selected options Example: yo jhipster-react:client This will create an React client app ================================================ FILE: generators/client/files.js ================================================ const mkdirp = require('mkdirp'); const constants = require('generator-jhipster/generators/generator-constants'); /* Constants use throughout */ const MAIN_SRC_DIR = constants.CLIENT_MAIN_SRC_DIR; // const TEST_SRC_DIR = constants.CLIENT_TEST_SRC_DIR; const REACT_DIR = constants.ANGULAR_DIR; /** * The default is to use a file path string. It implies use of the template method. * For any other config an object { file:.., method:.., template:.. } can be used */ const files = { common: [ { templates: [ '_package.json', '_.eslintrc.json', '_.babelrc', '_.editorconfig', 'webpack/webpack.common.js', 'webpack/webpack.dev.js', 'webpack/webpack.prod.js' ] } ], sass: [ { condition: generator => generator.useSass, templates: [ { file: '_postcss.config.js', method: 'copy' } ] } ], image: [ { path: MAIN_SRC_DIR, templates: [ { file: 'static/images/logo-jhipster-react.svg', method: 'copy' } ] } ], swagger: [ { path: MAIN_SRC_DIR, templates: [ 'swagger-ui/_index.html', { file: 'swagger-ui/images/_throbber.gif', method: 'copy' } ] } ], commonWeb: [ { path: MAIN_SRC_DIR, templates: [ { file: 'favicon.ico', method: 'copy' }, 'robots.txt', '404.html', 'index.html' ] } ], reactApp: [ { path: REACT_DIR, templates: [ 'app.js', 'index.js', 'routes.js', 'config/constants.js', 'config/theme.js', 'config/devtools.js', 'config/promise-middleware.js', 'config/store.js' ] }, { condition: generator => generator.enableTranslation, path: REACT_DIR, templates: [ 'config/translation.js' ] }, { condition: generator => generator.useSass, path: REACT_DIR, templates: [ { file: 'app.scss', method: 'copy' } ] }, // { // condition: generator => generator.authenticationType === 'oauth2' || generator.authenticationType === 'jwt' || generator.authenticationType === 'uaa', // path: REACT_DIR, // templates: [ // 'blocks/interceptor/_auth.interceptor.js' // ] // }, // { // condition: generator => !generator.skipServer, // path: REACT_DIR, // templates: [ // 'blocks/interceptor/_auth-expired.interceptor.js' // ] // } ], reactMain: [ { path: REACT_DIR, templates: [ // home module 'modules/home/index.js', { file: 'modules/home/home.js', method: 'processJsx' }, // login module 'modules/login/index.js', { file: 'modules/login/login.js', method: 'processJsx' }, { file: 'modules/login/login-modal.js', method: 'processJsx' } ] }, { condition: generator => generator.useSass, path: REACT_DIR, templates: [ 'modules/home/home.scss', ] } ], reducers: [ { path: REACT_DIR, templates: [ // home module 'reducers/index.js', 'reducers/administration.js', 'reducers/authentication.js' ] }, { condition: generator => generator.enableTranslation, path: REACT_DIR, templates: [ 'reducers/locale.js' ] } ], // accountModule: [ // { // path: REACT_DIR, // templates: [ // 'account/_index.js', // { file: 'account/_account.route.js', method: 'processJsx' }, // { file: 'account/activate/_activate.route.js', method: 'processJsx' }, // { file: 'account/activate/_activate.component.js', method: 'processJsx' }, // { file: 'account/password/_password.route.js', method: 'processJsx' }, // { file: 'account/password/_password.component.js', method: 'processJsx' }, // { file: 'account/register/_register.route.js', method: 'processJsx' }, // { file: 'account/register/_register.component.js', method: 'processJsx' }, // { file: 'account/password-reset/init/_password-reset-init.route.js', method: 'processJsx' }, // { file: 'account/password-reset/init/_password-reset-init.component.js', method: 'processJsx' }, // { file: 'account/password-reset/finish/_password-reset-finish.route.js', method: 'processJsx' }, // { file: 'account/password-reset/finish/_password-reset-finish.component.js', method: 'processJsx' }, // { file: 'account/settings/_settings.route.js', method: 'processJsx' }, // { file: 'account/settings/_settings.component.js', method: 'processJsx' } // ] // }, // { // condition: generator => generator.authenticationType === 'session', // path: REACT_DIR, // templates: [ // { file: 'account/sessions/_sessions.route.js', method: 'processJsx' }, // 'account/sessions/_session.model.js', // { file: 'account/sessions/_sessions.component.js', method: 'processJsx' } // ] // }, // { // condition: generator => generator.enableSocialSignIn, // path: REACT_DIR, // templates: [ // { file: 'account/social/_social.route.js', method: 'processJsx' }, // { file: 'account/social/_social-register.component.js', method: 'processJsx' }, // { file: 'account/social/_social-register.component.html', method: 'processHtml' }, // { file: 'shared/social/_social.component.js', method: 'processJsx' }, // { file: 'shared/social/_social.component.html', method: 'processHtml' }, // 'shared/social/_social.service.js' // ] // }, // { // condition: generator => generator.enableSocialSignIn && generator.authenticationType === 'jwt', // path: REACT_DIR, // templates: [ // { file: 'account/social/_social-auth.component.js', method: 'processJsx' }, // ] // }, // { // condition: generator => generator.useSass, // path: REACT_DIR, // templates: [ // 'account/password/_password-strength-bar.scss' // ] // }, // { // condition: generator => !generator.useSass, // path: REACT_DIR, // templates: [ // 'account/password/_password-strength-bar.css' // ] // } // ], adminModule: [ { path: REACT_DIR, templates: [ // admin modules { file: 'modules/administration/audits/audits.js', method: 'processJsx' }, { file: 'modules/administration/configuration/configuration.js', method: 'processJsx' }, { file: 'modules/administration/docs/docs.js', method: 'processJsx' }, { file: 'modules/administration/health/health.js', method: 'processJsx' }, { file: 'modules/administration/health/health-detail/health-detail.js', method: 'processJsx' }, { file: 'modules/administration/health/health-detail/health-modal.js', method: 'processJsx' }, { file: 'modules/administration/health/health-detail/index.js', method: 'processJsx' }, { file: 'modules/administration/logs/logs.js', method: 'processJsx' }, { file: 'modules/administration/metrics/metrics.js', method: 'processJsx' }, { file: 'modules/administration/metrics/metrics-detail/metrics-detail.js', method: 'processJsx' }, { file: 'modules/administration/metrics/metrics-detail/metrics-modal.js', method: 'processJsx' }, { file: 'modules/administration/metrics/metrics-detail/index.js', method: 'processJsx' }, ] }, // { // condition: generator => generator.websocket === 'spring-websocket', // path: REACT_DIR, // templates: [ // { file: 'modules/administration/tracker/Tracker.js', method: 'processJsx' } // ] // }, { condition: generator => !generator.skipUserManagement, path: REACT_DIR, templates: [ { file: 'modules/administration/user-management/user-management.js', method: 'processJsx' }, // { file: 'modules/administration/user-management/UserManagementDetail.js', method: 'processJsx' }, // { file: 'modules/administration/user-management/UserManagementDialog.js', method: 'processJsx' }, // { file: 'modules/administration/user-management/UserManagementDeleteDialog.js', method: 'processJsx' } ] }, { condition: generator => generator.applicationType === 'gateway', path: REACT_DIR, templates: [ { file: 'modules/administration/gateway/gateway.js', method: 'processJsx' } ] } ], angularShared: [ { path: REACT_DIR, templates: [ // layouts 'shared/components/footer/footer.js', 'shared/components/header/header.js', 'shared/components/private-route/private-route.js', // interceptors 'shared/interceptors/axios.js', // util 'shared/util/global-style.js', 'shared/util/log-util.js' ] }, { condition: generator => generator.useSass, path: REACT_DIR, templates: [ 'shared/components/header/header.scss', 'shared/variables.scss' ] }, // { // condition: generator => generator.enableTranslation, // path: REACT_DIR, // templates: [ // 'shared/language/_language.pipe.js', // 'shared/language/_language.constants.js', // 'shared/language/_language.helper.js' // ] // }, // { // condition: generator => !generator.skipUserManagement, // path: REACT_DIR, // templates: [ // 'shared/user/_user.model.js', // 'shared/user/_user.service.js' // ] // } ], // angularAuthService: [ // { // path: REACT_DIR, // templates: [ // 'shared/auth/_auth.service.js', // 'shared/auth/_csrf.service.js', // 'shared/auth/_state-storage.service.js', // 'shared/auth/_principal.service.js', // 'shared/auth/_has-any-authority.directive.js', // 'shared/auth/_account.service.js', // 'shared/auth/_user-route-access-service.js' // ] // }, // { // condition: generator => generator.authenticationType === 'oauth2', // path: REACT_DIR, // templates: [ // 'shared/auth/_auth-oauth2.service.js' // ] // }, // { // condition: generator => generator.authenticationType === 'jwt' || generator.authenticationType === 'uaa', // path: REACT_DIR, // templates: [ // 'shared/auth/_auth-jwt.service.js' // ] // }, // { // condition: generator => generator.authenticationType === 'session', // path: REACT_DIR, // templates: [ // 'shared/auth/_auth-session.service.js' // ] // } // ], // clientTestFw: [ // { // path: TEST_SRC_DIR, // templates: [ // '_karma.conf.js', // 'spec/_entry.js', // 'spec/_test.module.js', // 'spec/app/account/activate/_activate.component.spec.js', // 'spec/app/account/password/_password.component.spec.js', // 'spec/app/account/password/_password-strength-bar.component.spec.js', // 'spec/app/account/password-reset/init/_password-reset-init.component.spec.js', // 'spec/app/account/password-reset/finish/_password-reset-finish.component.spec.js', // 'spec/app/account/register/_register.component.spec.js', // 'spec/app/account/settings/_settings.component.spec.js', // 'spec/app/admin/health/_health.component.spec.js', // 'spec/app/admin/audits/_audits.component.spec.js', // 'spec/helpers/_spyobject.js', // 'spec/helpers/_mock-account.service.js', // 'spec/helpers/_mock-principal.service.js', // 'spec/helpers/_mock-route.service.js' // ] // }, // { // condition: generator => generator.authenticationType === 'session', // path: TEST_SRC_DIR, // templates: [ // 'spec/app/account/sessions/_sessions.component.spec.js', // ] // }, // { // condition: generator => generator.enableTranslation, // path: TEST_SRC_DIR, // templates: [ // 'spec/helpers/_mock-language.service.js' // ] // }, // { // condition: generator => generator.websocket === 'spring-websocket', // path: TEST_SRC_DIR, // templates: [ // 'spec/helpers/_mock-tracker.service.js' // ] // }, // { // condition: generator => generator.protractorTests, // path: TEST_SRC_DIR, // templates: [ // 'e2e/account/_account.spec.js', // 'e2e/admin/_administration.spec.js', // '_protractor.conf.js' // ] // } // ] }; module.exports = { writeFiles, files }; function writeFiles() { mkdirp(MAIN_SRC_DIR); // write React files this.writeFilesToDisk(files, this, false); } ================================================ FILE: generators/client/index.js ================================================ const util = require('util'); const generator = require('yeoman-generator'); const chalk = require('chalk'); const _ = require('lodash'); const BaseGenerator = require('generator-jhipster/generators/generator-base'); const constants = require('generator-jhipster/generators/generator-constants'); const prompts = require('./prompts'); const writeFiles = require('./files').writeFiles; const packagejs = require('../../package.json'); const JhipsterClientGenerator = generator.extend({}); util.inherits(JhipsterClientGenerator, BaseGenerator); /* Constants used throughout */ const QUESTIONS = constants.CLIENT_QUESTIONS; module.exports = JhipsterClientGenerator.extend({ constructor: function (...args) { // eslint-disable-line object-shorthand generator.apply(this, args); this.configOptions = this.options.configOptions || {}; // This adds support for a `--protractor` flag this.option('protractor', { desc: 'Enable protractor tests', type: Boolean, defaults: false }); // This adds support for a `--auth` flag this.option('auth', { desc: 'Provide authentication type for the application', type: String }); // This adds support for a `--build` flag this.option('build', { desc: 'Provide build tool for the application', type: String }); // This adds support for a `--websocket` flag this.option('websocket', { desc: 'Provide websocket option for the application', type: String }); // This adds support for a `--dev-db` flag this.option('dev-db', { desc: 'Provide development DB option for the application', type: String }); // This adds support for a `--db` flag this.option('db', { desc: 'Provide DB type for the application', type: String }); // This adds support for a `--social` flag this.option('social', { desc: 'Provide development DB option for the application', type: Boolean, default: false }); // This adds support for a `--search-engine` flag this.option('search-engine', { desc: 'Provide development DB option for the application', type: String }); // This adds support for a `--search-engine` flag this.option('hb-cache', { desc: 'Provide hibernate cache option for the application', type: String }); // This adds support for a `--jhi-prefix` flag this.option('jhi-prefix', { desc: 'Add prefix before services, controllers and states name', type: String, defaults: 'jhi' }); // This adds support for a `--skip-user-management` flag this.option('skip-user-management', { desc: 'Skip the user management module during app generation', type: Boolean, defaults: false }); // This adds support for a `--npm` flag this.option('npm', { desc: 'Use npm instead of yarn', type: Boolean, defaults: false }); this.skipServer = this.configOptions.skipServer || this.config.get('skipServer'); this.skipUserManagement = this.configOptions.skipUserManagement || this.options['skip-user-management'] || this.config.get('skipUserManagement'); this.authenticationType = this.options.auth; this.buildTool = this.options.build; this.websocket = this.options.websocket; this.devDatabaseType = this.options['dev-db']; this.databaseType = this.options.db; this.enableSocialSignIn = this.options.social; this.searchEngine = this.options['search-engine']; this.hibernateCache = this.options['hb-cache']; this.otherModules = this.configOptions.otherModules || []; this.jhiPrefix = this.configOptions.jhiPrefix || this.config.get('jhiPrefix') || this.options['jhi-prefix']; this.jhiPrefixCapitalized = _.upperFirst(this.jhiPrefix); this.testFrameworks = []; if (this.options.protractor) this.testFrameworks.push('protractor'); this.currentQuestion = this.configOptions.lastQuestion ? this.configOptions.lastQuestion : 0; this.totalQuestions = this.configOptions.totalQuestions ? this.configOptions.totalQuestions : QUESTIONS; this.baseName = this.configOptions.baseName; this.logo = this.configOptions.logo; this.useYarn = this.configOptions.useYarn = !this.options.npm; this.clientPackageManager = this.configOptions.clientPackageManager; this.isDebugEnabled = this.configOptions.isDebugEnabled || this.options.debug; // TODO chnage to process JSX this.processJsx = (source, dest, generator, opt, template) => { this.copyTemplate(source, dest, 'stripJs', generator, opt, template); }; }, initializing: { displayLogo() { if (this.logo) { this.printJHipsterLogo(); } }, setupClientconsts() { // Make constants available in templates this.MAIN_SRC_DIR = constants.CLIENT_MAIN_SRC_DIR; this.TEST_SRC_DIR = constants.CLIENT_TEST_SRC_DIR; this.serverPort = this.config.get('serverPort') || this.configOptions.serverPort || 8080; this.applicationType = this.config.get('applicationType') || this.configOptions.applicationType; if (!this.applicationType) { this.applicationType = 'monolith'; } this.clientFramework = this.config.get('clientFramework') || 'react'; this.useSass = this.config.get('useSass'); this.enableTranslation = this.config.get('enableTranslation'); // this is enabled by default to avoid conflicts for existing applications this.nativeLanguage = this.config.get('nativeLanguage'); this.languages = this.config.get('languages'); this.messageBroker = this.config.get('messageBroker'); this.packagejs = packagejs; const baseName = this.config.get('baseName'); if (baseName) { this.baseName = baseName; } const clientConfigFound = this.useSass !== undefined; if (clientConfigFound) { // If translation is not defined, it is enabled by default if (this.enableTranslation === undefined) { this.enableTranslation = true; } if (this.nativeLanguage === undefined) { this.nativeLanguage = 'en'; } if (this.languages === undefined) { this.languages = ['en', 'fr']; } this.existingProject = true; } if (!this.clientPackageManager) { if (this.useYarn) { this.clientPackageManager = 'yarn'; } else { this.clientPackageManager = 'npm'; } } } }, prompting: { askForModuleName: prompts.askForModuleName, askForClientSideOpts: prompts.askForClientSideOpts, askFori18n: prompts.askFori18n, setSharedConfigOptions() { this.configOptions.lastQuestion = this.currentQuestion; this.configOptions.totalQuestions = this.totalQuestions; this.configOptions.clientFramework = 'angular2'; // Hack to get server side to generate webpack stuff accordingly this.configOptions.useSass = this.useSass; } }, configuring: { insight() { const insight = this.insight(); insight.trackWithEvent('generator', 'client'); insight.track('app/clientFramework', this.clientFramework); insight.track('app/useSass', this.useSass); insight.track('app/enableTranslation', this.enableTranslation); insight.track('app/nativeLanguage', this.nativeLanguage); insight.track('app/languages', this.languages); }, configureGlobal() { // Application name modified, using each technology's conventions this.camelizedBaseName = _.camelCase(this.baseName); this.angularAppName = this.getAngularAppName(); this.angular2AppName = this.getAngular2AppName(); this.capitalizedBaseName = _.upperFirst(this.baseName); this.dasherizedBaseName = _.kebabCase(this.baseName); this.lowercaseBaseName = this.baseName.toLowerCase(); if (!this.nativeLanguage) { // set to english when translation is set to false this.nativeLanguage = 'en'; } }, saveConfig() { this.config.set('clientFramework', this.clientFramework); this.config.set('useSass', this.useSass); this.config.set('enableTranslation', this.enableTranslation); if (this.enableTranslation && !this.configOptions.skipI18nQuestion) { this.config.set('nativeLanguage', this.nativeLanguage); this.config.set('languages', this.languages); } this.config.set('clientPackageManager', this.clientPackageManager); } }, default: { getSharedConfigOptions() { if (this.configOptions.hibernateCache) { this.hibernateCache = this.configOptions.hibernateCache; } if (this.configOptions.websocket !== undefined) { this.websocket = this.configOptions.websocket; } if (this.configOptions.databaseType) { this.databaseType = this.configOptions.databaseType; } if (this.configOptions.devDatabaseType) { this.devDatabaseType = this.configOptions.devDatabaseType; } if (this.configOptions.prodDatabaseType) { this.prodDatabaseType = this.configOptions.prodDatabaseType; } if (this.configOptions.messageBroker !== undefined) { this.messageBroker = this.configOptions.messageBroker; } if (this.configOptions.searchEngine !== undefined) { this.searchEngine = this.configOptions.searchEngine; } if (this.configOptions.buildTool) { this.buildTool = this.configOptions.buildTool; } if (this.configOptions.enableSocialSignIn !== undefined) { this.enableSocialSignIn = this.configOptions.enableSocialSignIn; } if (this.configOptions.authenticationType) { this.authenticationType = this.configOptions.authenticationType; } if (this.configOptions.testFrameworks) { this.testFrameworks = this.configOptions.testFrameworks; } this.protractorTests = this.testFrameworks.indexOf('protractor') !== -1; if (this.configOptions.enableTranslation !== undefined) { this.enableTranslation = this.configOptions.enableTranslation; } if (this.configOptions.nativeLanguage !== undefined) { this.nativeLanguage = this.configOptions.nativeLanguage; } if (this.configOptions.languages !== undefined) { this.languages = this.configOptions.languages; } if (this.configOptions.uaaBaseName !== undefined) { this.uaaBaseName = this.configOptions.uaaBaseName; } // Make dist dir available in templates if (this.configOptions.buildTool === 'maven') { this.BUILD_DIR = 'target/'; } else { this.BUILD_DIR = 'build/'; } this.DIST_DIR = this.BUILD_DIR + constants.CLIENT_DIST_DIR; }, composeLanguages() { if (this.configOptions.skipI18nQuestion) return; this.composeLanguagesSub(this, this.configOptions, 'client'); } }, writing() { return writeFiles.call(this); }, install() { const logMsg = `To install your dependencies manually, run: ${chalk.yellow.bold(`${this.clientPackageManager} install`)}`; const injectDependenciesAndConstants = (err) => { if (err) { this.warning('Install of dependencies failed!'); this.log(logMsg); } }; const installConfig = { bower: false, npm: this.clientPackageManager !== 'yarn', yarn: this.clientPackageManager === 'yarn', callback: injectDependenciesAndConstants }; if (this.options['skip-install']) { this.log(logMsg); } else { this.installDependencies(installConfig); } }, end() { this.log(chalk.green.bold('\nClient application generated successfully.\n')); const logMsg = `Start your Webpack development server with:\n ${chalk.yellow.bold(`${this.clientPackageManager} start`)}\n`; this.log(chalk.green(logMsg)); } }); ================================================ FILE: generators/client/prompts.js ================================================ module.exports = { askForModuleName, askForClientSideOpts, askFori18n }; function askForModuleName() { if (this.baseName) return; this.askModuleName(this); } function askForClientSideOpts() { if (this.existingProject) return; const done = this.async(); const prompts = [ { type: 'confirm', name: 'useSass', message: response => this.getNumberedQuestion('Would you like to use the LibSass stylesheet preprocessor for your CSS?', true), default: true } ]; this.prompt(prompts).then((props) => { this.useSass = props.useSass; done(); }); } function askFori18n() { if (this.existingProject || this.configOptions.skipI18nQuestion) return; this.aski18n(this); } ================================================ FILE: generators/client/templates/_.babelrc ================================================ { "presets": ["react", "es2015", "stage-1"], "plugins": [ ["babel-plugin-module-alias", [ { "src": "./src/main/webapp/i18n", "expose": "i18n" } ]] ], "env": { "dev-watch": { "presets": ["react-hmre"] } } } ================================================ FILE: generators/client/templates/_.editorconfig ================================================ # EditorConfig helps developers define and maintain consistent # coding styles between different editors and IDEs # editorconfig.org root = true [*] # Change these settings to your own preference indent_style = space indent_size = 4 # We recommend you to keep these unchanged end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.js] indent_style = space indent_size = 2 [*.md] trim_trailing_whitespace = false [{package,bower}.json] indent_style = space indent_size = 2 ================================================ FILE: generators/client/templates/_.eslintrc.json ================================================ { "extends": [ "airbnb", "plugin:ava/recommended" ], "parser": "babel-eslint", "plugins": [ "ava" ], "env": { "browser": true, "node": true, "mocha": true }, "ecmaFeatures": { "jsx": true, "es6": true, "classes": true }, "rules": { "comma-dangle": [1, "never"], "no-underscore-dangle" : "off", "react/jsx-filename-extension": "off", "max-len": [1, 180, 4], "jsx-a11y/no-marquee" : "off", "jsx-a11y/no-static-element-interactions" : "off", "no-plusplus": "off", // TODO to be removed after review "no-nested-ternary": "off", "arrow-body-style": "off", "no-named-as-default": "off", "react/jsx-no-bind": "off", "react/prefer-stateless-function": "off", "react/forbid-prop-types": "off", "react/no-array-index-key": "off", "no-param-reassign": "off", "no-unused-vars": "off" } } ================================================ FILE: generators/client/templates/_package.json ================================================ { "name": "react-client", "version": "0.0.0", "description": "React client app", "private": true, "cacheDirectories": [ "node_modules" ], "dependencies": { "axios": "^0.15.3", "counterpart": "^0.17.2", "deep-equal": "^1.0.1", "flexboxgrid": "^6.3.1", "lodash.debounce": "4.0.8", "material-ui": "^0.17.0", "react": "^15.3.1", "react-bootstrap": "^0.30.8", "react-dom": "^15.3.1", "react-interpolate-component": "^0.10.0", "react-redux": "^5.0.2", "react-router": "^3.0.2", "react-router-bootstrap": "^0.23.1", "react-router-redux": "^4.0.2", "react-tap-event-plugin": "^2.0.1", "react-translate-component": "^0.13.2", "redux": "^3.5.2", "swagger-ui": "2.2.10" }, "devDependencies": { "babel": "^6.5.2", "babel-core": "^6.17.0", "babel-eslint": "^7.1.1", "babel-loader": "^6.2.5", "babel-plugin-module-alias": "^1.2.0", "babel-plugin-react-transform": "^2.0.2", "babel-preset-es2015": "^6.6.0", "babel-preset-react": "^6.5.0", "babel-preset-react-hmre": "^1.1.1", "babel-preset-stage-1": "^6.22.0", "copy-webpack-plugin": "4.0.1", "cross-env": "^3.1.4", "css-loader": "^0.26.1", "enzyme": "^2.2.0", "eslint": "^3.1.1", "eslint-config-airbnb": "^14.0.0", "eslint-plugin-ava": "^4.0.1", "eslint-plugin-import": "^2.2.0", "eslint-plugin-jsx-a11y": "^4.0.0", "eslint-plugin-react": "^6.9.0", "expect": "^1.16.0", "extract-text-webpack-plugin": "^2.0.0-rc.3", "file-loader": "0.10.0", "html-webpack-plugin": "^2.15.0", "http-proxy-middleware": "^0.17.3", "image-webpack-loader": "3.2.0", "jsdom-global": "^2.1.1", "json-loader": "^0.5.4", "mocha": "^3.2.0", "node-sass": "4.5.0", "postcss-loader": "1.3.0", "react-addons-test-utils": "^15.0.0", "redux-devtools": "^3.2.0", "redux-devtools-dock-monitor": "^1.1.1", "redux-devtools-log-monitor": "^1.0.9", "sass-loader": "6.0.0", "stripcomment-loader": "^0.1.0", "style-loader": "^0.13.1", "webpack": "^2.2.1", "webpack-dev-server": "2.3.0", "webpack-merge": "2.6.1" }, "engines": { "node": ">=6.9.0" }, "scripts": { "lint": "eslint src webpack", "lint:fix": "eslint src webpack --fix", "start": "<%= clientPackageManager %> run webpack:dev", "webpack:dev": "cross-env NODE_ENV=dev-watch webpack-dev-server --config webpack/webpack.dev.js --progress --inline --hot --profile --port=8000 --open", "webpack:build": "<%= clientPackageManager %> run webpack:build:dev", "webpack:build:dev": "webpack --config webpack/webpack.dev.js", "webpack:prod": "cross-env NODE_ENV=production webpack --config webpack/webpack.prod.js", "test": "cross-env NODE_ENV=test mocha", <%_ if (protractorTests) { _%> "e2e": "protractor <%= TEST_SRC_DIR %>protractor.conf.js", "postinstall": "webdriver-manager update && <%= clientPackageManager %> run webpack:build" <%_ } else { _%> "postinstall": "<%= clientPackageManager %> run webpack:build" <%_ } _%> } } ================================================ FILE: generators/client/templates/_postcss.config.js ================================================ module.exports = { plugins: [] }; ================================================ FILE: generators/client/templates/src/main/webapp/404.html ================================================ Page Not Found

Page Not Found

Sorry, but the page you were trying to view does not exist.

================================================ FILE: generators/client/templates/src/main/webapp/app/app.js ================================================ import 'flexboxgrid/dist/flexboxgrid.css'; import React, { Component, PropTypes } from 'react'; import { connect } from 'react-redux'; import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'; import { locales } from './config/translation'; import appTheme from './config/theme'; import { setLocale } from './reducers/locale'; import { getSession, logout } from './reducers/authentication'; import Header from './shared/components/header/header'; import Footer from './shared/components/footer/footer'; import './app.scss'; export class App extends Component { static propTypes = { isAuthenticated: PropTypes.bool, currentLocale: PropTypes.string.isRequired, getSession: PropTypes.func.isRequired, setLocale: PropTypes.func.isRequired, logout: PropTypes.func.isRequired, children: PropTypes.node }; static defaultProps = { isAuthenticated: false, children: null }; constructor(props) { super(props); this.handleLogout = this.handleLogout.bind(this); } componentDidMount() { this.props.getSession(); } handleLogout() { this.props.logout(); } render() { return (
{this.props.children}
); } } export default connect( store => ({ isAuthenticated: store.authentication.isAuthenticated, currentLocale: store.locale.currentLocale }), { getSession, setLocale, logout } )(App); ================================================ FILE: generators/client/templates/src/main/webapp/app/app.scss ================================================ @import 'shared/variables'; body { background: #fafafa; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; color: $text-color; margin: 0; } * { -moz-box-sizing: border-box; box-sizing: border-box; &:after, &::before { -moz-box-sizing: border-box; box-sizing: border-box; } } a { text-decoration: none; &:hover { text-decoration: underline; } } /* ========================================================================== Browser Upgrade Prompt ========================================================================== */ .browserupgrade { margin: 0.2em 0; background: #ccc; color: #000; padding: 0.2em 0; } /* ========================================================================== Generic styles ========================================================================== */ /* other generic styles */ .vertical { flex-direction: column; } .card { padding: 1.5%; margin-top: 20px; border: none; } .error { color: white; background-color: red; } .pad { padding: 10px; } .break { white-space: normal; word-break:break-all; } .voffset { margin-top: 2px; } .voffset1 { margin-top: 5px; } .voffset2 { margin-top: 10px; } .voffset3 { margin-top: 15px; } .voffset4 { margin-top: 30px; } .voffset5 { margin-top: 40px; } .voffset6 { margin-top: 60px; } .voffset7 { margin-top: 80px; } .voffset8 { margin-top: 100px; } .voffset9 { margin-top: 150px; } .readonly { background-color: #eee; opacity: 1; } /* ========================================================================== make sure browsers use the pointer cursor for anchors, even with no href ========================================================================== */ a:hover { cursor: pointer; } .hand { cursor: pointer; } button.anchorBtn { background: none; border: none; padding: 0; align-items: initial; text-align: initial; width: 100%; } a.anchorBtn:hover { text-decoration: none; } /* ========================================================================== Metrics and Health styles ========================================================================== */ #threadDump .popover, #healthCheck .popover { top: inherit; display: block; font-size: 10px; max-width: 1024px; } #healthCheck .popover { margin-left: -50px; } .health-details { min-width: 400px; } /* ========================================================================== start Password strength bar style ========================================================================== */ ul#strengthBar { display:inline; list-style:none; margin:0; margin-left:15px; padding:0; vertical-align:2px; } .point:last { margin:0 !important; } .point { background:#DDD; border-radius:2px; display:inline-block; height:5px; margin-right:1px; width:20px; } /* ========================================================================== entity tables helpers ========================================================================== */ /* Remove Bootstrap padding from the element http://stackoverflow.com/questions/19562903/remove-padding-from-columns-in-bootstrap-3 */ @mixin no-padding($side) { @if $side == 'all' { .no-padding { padding: 0 !important; } } @else { .no-padding-#{$side} { padding-#{$side}: 0 !important; } } } @include no-padding("left"); @include no-padding("right"); @include no-padding("top"); @include no-padding("bottom"); @include no-padding("all"); /* bootstrap 3 input-group 100% width http://stackoverflow.com/questions/23436430/bootstrap-3-input-group-100-width */ .width-min { width: 1% !important; } /* Makes toolbar not wrap on smaller screens http://www.sketchingwithcss.com/samplechapter/cheatsheet.html#right */ .flex-btn-group-container { display: -webkit-flex; display: flex; -webkit-flex-direction: row; flex-direction: row; -webkit-justify-content: flex-end; justify-content: flex-end; } .jh-table > { tbody > tr > td { /* Align text in td verifically (top aligned by Bootstrap) */ vertical-align: middle; } thead > tr > th > { .glyphicon-sort, .glyphicon-sort-by-attributes, .glyphicon-sort-by-attributes-alt { /* less visible sorting icons */ opacity: 0.5; &:hover { /* full visible sorting icons and pointer when mouse is over them */ opacity: 1; cursor: pointer; } } } } /* jhipster-needle-css-add-main JHipster will add new css style */ ================================================ FILE: generators/client/templates/src/main/webapp/app/config/constants.js ================================================ const config = { version: '0.0.1-SNAPSHOT' }; export default config; ================================================ FILE: generators/client/templates/src/main/webapp/app/config/devtools.js ================================================ import React from 'react'; /* eslint-disable */ import { createDevTools } from 'redux-devtools'; import LogMonitor from 'redux-devtools-log-monitor'; import DockMonitor from 'redux-devtools-dock-monitor'; /* eslint-enable */ // You can toggle visibility of devTools with ctrl + H // and change their position with ctrl + Q export default createDevTools( ); ================================================ FILE: generators/client/templates/src/main/webapp/app/config/promise-middleware.js ================================================ import axios from 'axios'; import { logError } from '../shared/util/log-util'; export default function promiseMiddleware({ dispatch, getState }) { return next => (action) => { if (typeof action === 'function') { return action(dispatch, getState); } const { promise, types, afterSuccess, ...rest } = action; if (!action.promise) { return next(action); } const [REQUEST, SUCCESS, FAILURE] = types; next({ ...rest, type: REQUEST }); const onFulfilled = (result) => { next({ ...rest, result, type: SUCCESS }); if (afterSuccess) { afterSuccess(dispatch, getState, result); } }; const onRejected = (error) => { next({ ...rest, error, type: FAILURE }); }; return promise(axios) .then(onFulfilled, onRejected) .catch((error) => { logError('MIDDLEWARE ERROR:', error); onRejected(error); }); }; } ================================================ FILE: generators/client/templates/src/main/webapp/app/config/store.js ================================================ import { createStore, applyMiddleware, compose } from 'redux'; import reducer from '../reducers'; import DevTools from './devtools'; import promiseMiddleware from './promise-middleware'; const middlewares = process.env.NODE_ENV === 'development' ? [applyMiddleware(promiseMiddleware), DevTools.instrument()] : [applyMiddleware(promiseMiddleware)]; const initialize = (initialState = {}) => { const store = createStore(reducer, initialState, compose(...middlewares)); if (module.hot) { // Enable Webpack hot module replacement for reducers // TODO : see if reducers can be moved to feature modules and still get HMR working module.hot.accept('../reducers', () => { /* eslint-disable */ const nextReducer = require('../reducers'); /* eslint-enable */ store.replaceReducer(nextReducer); }); } return store; }; export default initialize; ================================================ FILE: generators/client/templates/src/main/webapp/app/config/theme.js ================================================ import { cyan500, cyan700, pinkA200, grey100, grey300, grey400, grey500, white, darkBlack, fullBlack } from 'material-ui/styles/colors'; import getMuiTheme from 'material-ui/styles/getMuiTheme'; export default getMuiTheme({ palette: { primary1Color: cyan500, primary2Color: cyan700, primary3Color: grey400, accent1Color: pinkA200, accent2Color: grey100, accent3Color: grey500, textColor: darkBlack, alternateTextColor: white, canvasColor: white, borderColor: grey300, pickerHeaderColor: cyan500, shadowColor: fullBlack } }); ================================================ FILE: generators/client/templates/src/main/webapp/app/config/translation.js ================================================ import counterpart from 'counterpart'; import { setLocale } from '../reducers/locale'; const mergeTranslations = (requireContext) => { const merged = {}; requireContext.keys().forEach((key) => { Object.assign(merged, requireContext(key)); }); return merged; }; /* eslint-disable */ const translations = { <%_ languages.forEach((lang, index) => { _%> <%= lang %>: mergeTranslations(require.context('i18n/<%= lang %>', false, /.json$/))<%= index !== languages.length - 1 ? ',' : '' %> <%_ }); _%> }; /* eslint-enable */ let currentLocale; const savedLocale = localStorage.getItem('locale') || '<%= nativeLanguage %>'; export const locales = Object.keys(translations); export const registerLocales = (store) => { locales.forEach((key) => { counterpart.registerTranslations(key, translations[key]); }); store.subscribe(() => { const previousLocale = currentLocale; currentLocale = store.getState().locale.currentLocale; if (previousLocale !== currentLocale) { localStorage.setItem('locale', currentLocale); counterpart.setLocale(currentLocale); } }); store.dispatch(setLocale(savedLocale)); return savedLocale; }; ================================================ FILE: generators/client/templates/src/main/webapp/app/index.js ================================================ import React from 'react'; import { render } from 'react-dom'; import { Provider } from 'react-redux'; import { bindActionCreators } from 'redux'; import { hashHistory, Router } from 'react-router'; import { syncHistoryWithStore } from 'react-router-redux'; import injectTapEventPlugin from 'react-tap-event-plugin'; import getRoutes from './routes'; import DevTools from './config/devtools'; import initStore from './config/store'; import { registerLocales } from './config/translation'; import setupAxiosInterceptors from './shared/interceptors/axios'; import { redirectToLoginWithMessage, clearAuthToken, logout } from './reducers/authentication'; // Needed for onTouchTap // http://stackoverflow.com/a/34015469/988941 injectTapEventPlugin(); const devTools = process.env.NODE_ENV === 'development' ? : null; const store = initStore(); const history = syncHistoryWithStore(hashHistory, store); registerLocales(store); const actions = bindActionCreators({ redirectToLoginWithMessage, logout }, store.dispatch); setupAxiosInterceptors(() => actions.redirectToLoginWithMessage('login.error.unauthorized'), clearAuthToken); render(
{devTools}
, document.getElementById('root') ); ================================================ FILE: generators/client/templates/src/main/webapp/app/modules/account/password/password.js ================================================ ================================================ FILE: generators/client/templates/src/main/webapp/app/modules/account/settings/settings.js ================================================ ================================================ FILE: generators/client/templates/src/main/webapp/app/modules/administration/audits/audits.js ================================================ import React, { Component } from 'react'; import { connect } from 'react-redux'; import Translate from 'react-translate-component'; import { Table, TableBody, TableHeader, TableHeaderColumn, TableRow, TableRowColumn } from 'material-ui/Table'; import { getAudits } from '../../../reducers/administration'; export class AuditsPage extends Component { constructor(props) { super(props); this.getAuditList = this.getAuditList.bind(this); } componentDidMount() { this.props.getAudits(); } getAuditList() { if (!this.props.isFetching) { this.props.getAudits(); } } render() { const showCheckboxes = false; const { audits, isFetching } = this.props; return (

Audits

FIX ME pagination and filter by date and sorting
Timestamp Principal Address Type {audits.map((row, index) => ( {row.timestamp} {row.principal} {row.data.remoteAddress} {row.type} ))}
); } } export default connect( ({ administration }) => ({ audits: administration.audits, isFetching: administration.isFetching }), { getAudits } )(AuditsPage); ================================================ FILE: generators/client/templates/src/main/webapp/app/modules/administration/configuration/configuration.js ================================================ import React, { Component } from 'react'; import { connect } from 'react-redux'; import { Table, TableBody, TableHeader, TableHeaderColumn, TableRow, TableRowColumn } from 'material-ui/Table'; import TextField from 'material-ui/TextField'; import { getConfigurations, getEnv } from '../../../reducers/administration'; export class ConfigurationPage extends Component { constructor(props) { super(props); this.getConfigurationList = this.getConfigurationList.bind(this); } componentDidMount() { this.props.getConfigurations(); this.props.getEnv(); } getConfigurationList() { if (!this.props.isFetching) { this.props.getConfigurations(); this.props.getEnv(); } } render() { const showCheckboxes = false; const { configuration, isFetching } = this.props; const configProps = (configuration && configuration.configProps) ? configuration.configProps : {}; const env = (configuration && configuration.env) ? configuration.env : {}; return (

Configuration

FIX ME add search function
Prefix Properties {Object.keys(configProps).map((configPropKey, configPropIndex) => ( {configProps[configPropKey].prefix} {Object.keys(configProps[configPropKey].properties).map((propKey, propIndex) => (

{propKey} {JSON.stringify(configProps[configPropKey].properties[propKey])}

))}
))}

{Object.keys(env).map((envKey, envIndex) => (

{envKey}

Prefix Properties {env[envKey] ? typeof env[envKey] === 'object' ? Object.keys(env[envKey]).map((propKey, propIndex) => ( {propKey} {JSON.stringify(env[envKey][propKey])} )) : ( {JSON.stringify(env[envKey])} ) : ''}
))}
); } } export default connect( ({ administration }) => ({ configuration: administration.configuration, isFetching: administration.isFetching }), { getConfigurations, getEnv } )(ConfigurationPage); ================================================ FILE: generators/client/templates/src/main/webapp/app/modules/administration/docs/docs.js ================================================ import React, { Component } from 'react'; import Translate from 'react-translate-component'; export class DocsPage extends Component { render() { return (