diff options
author | Stas Vilchik <stas-vilchik@users.noreply.github.com> | 2017-03-27 12:04:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-27 12:04:48 +0200 |
commit | 7d963d84f40ee3db3b51c557fb596aa9febf82bb (patch) | |
tree | 7f761f198fae4ad898f4dd98703923921520098b /server/sonar-web/src/main/js/apps/permission-templates | |
parent | 48699b502c866ea5a309c57f8ad5e737d1933280 (diff) | |
download | sonarqube-7d963d84f40ee3db3b51c557fb596aa9febf82bb.tar.gz sonarqube-7d963d84f40ee3db3b51c557fb596aa9febf82bb.zip |
optimize js bundles (#1855)
Diffstat (limited to 'server/sonar-web/src/main/js/apps/permission-templates')
5 files changed, 17 insertions, 9 deletions
diff --git a/server/sonar-web/src/main/js/apps/permission-templates/components/ActionsCell.js b/server/sonar-web/src/main/js/apps/permission-templates/components/ActionsCell.js index 1741a96ca90..f43f135ab7f 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/components/ActionsCell.js +++ b/server/sonar-web/src/main/js/apps/permission-templates/components/ActionsCell.js @@ -19,7 +19,7 @@ */ import React from 'react'; import { Link } from 'react-router'; -import difference from 'lodash/difference'; +import { difference } from 'lodash'; import Backbone from 'backbone'; import { PermissionTemplateType, CallbackType } from '../propTypes'; import QualifierIcon from '../../../components/shared/qualifier-icon'; diff --git a/server/sonar-web/src/main/js/apps/permission-templates/components/Defaults.js b/server/sonar-web/src/main/js/apps/permission-templates/components/Defaults.js index 2d13657c8a4..a3b3b0675bf 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/components/Defaults.js +++ b/server/sonar-web/src/main/js/apps/permission-templates/components/Defaults.js @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import React from 'react'; -import sortBy from 'lodash/sortBy'; +import { sortBy } from 'lodash'; import { translate } from '../../../helpers/l10n'; import { PermissionTemplateType } from '../propTypes'; diff --git a/server/sonar-web/src/main/js/apps/permission-templates/components/Template.js b/server/sonar-web/src/main/js/apps/permission-templates/components/Template.js index 974ef4834f4..c4a0a7d5fdc 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/components/Template.js +++ b/server/sonar-web/src/main/js/apps/permission-templates/components/Template.js @@ -19,7 +19,7 @@ */ import React from 'react'; import Helmet from 'react-helmet'; -import debounce from 'lodash/debounce'; +import { debounce } from 'lodash'; import TemplateHeader from './TemplateHeader'; import TemplateDetails from './TemplateDetails'; import HoldersList from '../../permissions/shared/components/HoldersList'; diff --git a/server/sonar-web/src/main/js/apps/permission-templates/routes.js b/server/sonar-web/src/main/js/apps/permission-templates/routes.js index 497a7817a42..d44e8735ad3 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/routes.js +++ b/server/sonar-web/src/main/js/apps/permission-templates/routes.js @@ -17,9 +17,17 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import React from 'react'; -import { IndexRoute } from 'react-router'; -import AppContainer from './components/AppContainer'; -import forSingleOrganization from '../organizations/forSingleOrganization'; +const routes = [ + { + getIndexRoute(_, callback) { + require.ensure([], require => { + const AppContainer = require('./components/AppContainer').default; + const forSingleOrganization = require('../organizations/forSingleOrganization').default; + const component = forSingleOrganization(AppContainer); + callback(null, { component }); + }); + } + } +]; -export default <IndexRoute component={forSingleOrganization(AppContainer)} />; +export default routes; diff --git a/server/sonar-web/src/main/js/apps/permission-templates/utils.js b/server/sonar-web/src/main/js/apps/permission-templates/utils.js index 3b634820b5b..ec3be9d776c 100644 --- a/server/sonar-web/src/main/js/apps/permission-templates/utils.js +++ b/server/sonar-web/src/main/js/apps/permission-templates/utils.js @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import sortBy from 'lodash/sortBy'; +import { sortBy } from 'lodash'; export const PERMISSIONS_ORDER = ['user', 'codeviewer', 'issueadmin', 'admin', 'scan']; |