From: Stas Vilchik Date: Mon, 22 Dec 2014 14:35:06 +0000 (+0100) Subject: Merge remote-tracking branch 'origin/branch-5.0' X-Git-Tag: latest-silver-master-#65~431 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a068b8f33a3f94ee93b18379d4c3673c35202011;p=sonarqube.git Merge remote-tracking branch 'origin/branch-5.0' Conflicts: server/sonar-web/src/main/js/tests/e2e/views/issues.jade --- a068b8f33a3f94ee93b18379d4c3673c35202011 diff --cc server/sonar-web/Gruntfile.coffee index 45c4af59a1f,5a58fcb119e..736f83885b8 --- a/server/sonar-web/Gruntfile.coffee +++ b/server/sonar-web/Gruntfile.coffee @@@ -174,13 -172,9 +174,13 @@@ module.exports = (grunt) - name: 'coding-rules/app' out: '<%= pkg.assets %>build/js/coding-rules/app.js' + codingRulesOld: options: + name: 'coding-rules-old/app' + out: '<%= pkg.assets %>build/js/coding-rules-old/app.js' + issues: options: - name: 'issues/app' - out: '<%= pkg.assets %>build/js/issues/app.js' + name: 'issues/app-new' + out: '<%= pkg.assets %>build/js/issues/app-new.js' measures: options: name: 'measures/app' diff --cc server/sonar-web/src/main/coffee/issues/app-new.coffee index 00000000000,9ae6f8b3604..c40aeee41de mode 000000,100644..100644 --- a/server/sonar-web/src/main/coffee/issues/app-new.coffee +++ b/server/sonar-web/src/main/coffee/issues/app-new.coffee @@@ -1,0 -1,130 +1,130 @@@ + requirejs.config + baseUrl: "#{baseUrl}/js" + + paths: + 'backbone': 'third-party/backbone' + 'backbone.marionette': 'third-party/backbone.marionette' + 'handlebars': 'third-party/handlebars' + + shim: + 'backbone.marionette': + deps: ['backbone'] + exports: 'Marionette' + 'backbone': + exports: 'Backbone' + 'handlebars': + exports: 'Handlebars' + + + requirejs [ + 'backbone', 'backbone.marionette' + + 'issues/models/state' + 'issues/layout' + 'issues/models/issues' - 'issues/models/facets' ++ 'components/navigator/models/facets' + 'issues/models/filters' + + 'issues/controller' + 'issues/router' + + 'issues/workspace-list-view' + 'issues/workspace-header-view' + + 'issues/facets-view' + 'issues/filters-view' + + 'issues/help-view' + + 'common/handlebars-extensions' + ], ( + Backbone, Marionette + + State + Layout + Issues + Facets + Filters + + Controller + Router + + WorkspaceListView + WorkspaceHeaderView + + FacetsView + FiltersView + + HelpView + ) -> + + $ = jQuery + App = new Marionette.Application + issuesAppProcess = window.process.addBackgroundProcess() + + + App.addInitializer -> + @layout = new Layout() + $('.issues').empty().append @layout.render().el + + + App.addInitializer -> + @state = new State() - @issues = new Issues() ++ @list = new Issues() + @facets = new Facets() + @filters = new Filters() + + + App.addInitializer -> + @controller = new Controller app: @ + + + App.addInitializer -> + @issuesView = new WorkspaceListView + app: @ - collection: @issues ++ collection: @list + @layout.workspaceListRegion.show @issuesView + @issuesView.bindScrollEvents() + + + App.addInitializer -> + @workspaceHeaderView = new WorkspaceHeaderView + app: @ - collection: @issues ++ collection: @list + @layout.workspaceHeaderRegion.show @workspaceHeaderView + + + App.addInitializer -> + @facetsView = new FacetsView + app: @ + collection: @facets + @layout.facetsRegion.show @facetsView + + + App.addInitializer -> + @filtersView = new FiltersView + app: @ + collection: @filters + @layout.filtersRegion.show @filtersView + + + App.addInitializer -> + $(window).on 'keypress', (e) => + tagName = e.target.tagName + unless tagName == 'INPUT' || tagName == 'SELECT' || tagName == 'TEXTAREA' + code = e.keyCode || e.which + if code == 63 + @helpView = new HelpView app: @ + @helpView.render() + + + App.addInitializer -> + @controller.fetchFilters().done => + key.setScope 'list' + @router = new Router app: @ + Backbone.history.start() + window.process.finishBackgroundProcess issuesAppProcess + + + l10nXHR = window.requestMessages() + jQuery.when(l10nXHR).done -> App.start() diff --cc server/sonar-web/src/main/js/tests/e2e/views/issues.jade index a57ceebd728,6279abc6c7e..aba0a7cfe3f --- a/server/sonar-web/src/main/js/tests/e2e/views/issues.jade +++ b/server/sonar-web/src/main/js/tests/e2e/views/issues.jade @@@ -1,9 -1,7 +1,9 @@@ extends ./layouts/main block header - script(data-main='/js/issues/app-new', src='../js/require.js') + script(src='../js/require.js') + script. - window.waitForMocks('/js/issues/app.js'); ++ window.waitForMocks('/js/issues/app-new.js'); block body #content diff --cc server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/search.html.erb index 5d8052da4dd,7be788685c1..0a1423d24f2 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/search.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/search.html.erb @@@ -1,5 -1,5 +1,5 @@@ <% content_for :script do %> - + <% end %> -
+