]> source.dussan.org Git - sonarqube.git/commitdiff
Invalidate browser cache for issues app
authorStas Vilchik <vilchiks@gmail.com>
Mon, 22 Dec 2014 12:33:56 +0000 (13:33 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Mon, 22 Dec 2014 12:33:56 +0000 (13:33 +0100)
server/sonar-web/Gruntfile.coffee
server/sonar-web/src/main/coffee/issues/app-new.coffee [new file with mode: 0644]
server/sonar-web/src/main/coffee/issues/app.coffee [deleted file]
server/sonar-web/src/main/js/tests/e2e/views/issues.jade
server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/search.html.erb

index c1940e2533bd2272fec09e04add3e816821eff2b..5a58fcb119e33e3e24214849464c87276fdbba10 100644 (file)
@@ -173,8 +173,8 @@ module.exports = (grunt) ->
         out: '<%= pkg.assets %>build/js/coding-rules/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 --git a/server/sonar-web/src/main/coffee/issues/app-new.coffee b/server/sonar-web/src/main/coffee/issues/app-new.coffee
new file mode 100644 (file)
index 0000000..9ae6f8b
--- /dev/null
@@ -0,0 +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'
+  '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()
+    @facets = new Facets()
+    @filters = new Filters()
+
+
+  App.addInitializer ->
+    @controller = new Controller app: @
+
+
+  App.addInitializer ->
+    @issuesView = new WorkspaceListView
+      app: @
+      collection: @issues
+    @layout.workspaceListRegion.show @issuesView
+    @issuesView.bindScrollEvents()
+
+
+  App.addInitializer ->
+    @workspaceHeaderView = new WorkspaceHeaderView
+      app: @
+      collection: @issues
+    @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 --git a/server/sonar-web/src/main/coffee/issues/app.coffee b/server/sonar-web/src/main/coffee/issues/app.coffee
deleted file mode 100644 (file)
index 9ae6f8b..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-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'
-  '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()
-    @facets = new Facets()
-    @filters = new Filters()
-
-
-  App.addInitializer ->
-    @controller = new Controller app: @
-
-
-  App.addInitializer ->
-    @issuesView = new WorkspaceListView
-      app: @
-      collection: @issues
-    @layout.workspaceListRegion.show @issuesView
-    @issuesView.bindScrollEvents()
-
-
-  App.addInitializer ->
-    @workspaceHeaderView = new WorkspaceHeaderView
-      app: @
-      collection: @issues
-    @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()
index b16896ffe534ee5d68835b3a69832d8fcb46a0b6..6279abc6c7e58406a7550f562152ba5fd83a212f 100644 (file)
@@ -1,7 +1,7 @@
 extends ./layouts/main
 
 block header
-  script(data-main='/js/issues/app', src='../js/require.js')
+  script(data-main='/js/issues/app-new', src='../js/require.js')
 
 block body
   #content
index 3643c2080737ddadb05ce4b14095a8fc6419a9af..7be788685c10454ff828c1b8546c38b8e2198395 100644 (file)
@@ -1,5 +1,5 @@
 <% content_for :script do %>
-  <script data-main="<%= ApplicationController.root_context -%>/js/issues/app" src="<%= ApplicationController.root_context -%>/js/require.js"></script>
+  <script data-main="<%= ApplicationController.root_context -%>/js/issues/app-new" src="<%= ApplicationController.root_context -%>/js/require.js"></script>
 <% end %>
 
 <div class="issues"></div>