diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2015-04-01 17:03:16 +0200 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2015-04-02 15:01:33 +0200 |
commit | 8666875cd28c95a2489098bf11933f44f44c06e7 (patch) | |
tree | 3e4f31eeb63d5965e49c0fccc3bfdab7fe6224b8 /server/sonar-web | |
parent | 4fb25fded2c5bf3404185b6d495e0176c6f1092b (diff) | |
download | sonarqube-8666875cd28c95a2489098bf11933f44f44c06e7.tar.gz sonarqube-8666875cd28c95a2489098bf11933f44f44c06e7.zip |
remove dashboard2 prototype
Diffstat (limited to 'server/sonar-web')
21 files changed, 0 insertions, 1123 deletions
diff --git a/server/sonar-web/Gruntfile.coffee b/server/sonar-web/Gruntfile.coffee index b61210f7459..3d2718f5575 100644 --- a/server/sonar-web/Gruntfile.coffee +++ b/server/sonar-web/Gruntfile.coffee @@ -222,10 +222,6 @@ module.exports = (grunt) -> name: 'drilldown/app' out: '<%= grunt.option("assetsDir") || pkg.assets %>build/js/drilldown/app.js' - dashboard: options: - name: 'dashboard/app' - out: '<%= grunt.option("assetsDir") || pkg.assets %>build/js/dashboard/app.js' - sourceViewer: options: name: 'source-viewer/app' out: '<%= grunt.option("assetsDir") || pkg.assets %>build/js/source-viewer/app.js' @@ -298,9 +294,6 @@ module.exports = (grunt) -> '<%= grunt.option("assetsDir") || pkg.assets %>js/templates/libraries.js': [ '<%= pkg.sources %>hbs/libraries/**/*.hbs' ] - '<%= grunt.option("assetsDir") || pkg.assets %>js/templates/dashboard.js': [ - '<%= pkg.sources %>hbs/dashboard/**/*.hbs' - ] '<%= grunt.option("assetsDir") || pkg.assets %>js/templates/analysis-reports.js': [ '<%= pkg.sources %>hbs/analysis-reports/**/*.hbs' ] diff --git a/server/sonar-web/src/main/coffee/dashboard/app.coffee b/server/sonar-web/src/main/coffee/dashboard/app.coffee deleted file mode 100644 index 0adc2ec6377..00000000000 --- a/server/sonar-web/src/main/coffee/dashboard/app.coffee +++ /dev/null @@ -1,65 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2014 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - -requirejs.config - baseUrl: "#{baseUrl}/js" - - -requirejs [ - 'dashboard/collections/widgets' - 'dashboard/views/widgets-view' - 'dashboard/mockjax' -], ( - Widgets - WidgetsView -) -> - - $ = jQuery - App = new Marionette.Application() - App.dashboard = window.did - App.resource = window.resource - App.state = new Backbone.Model configure: false - - - App.saveDashboard = -> - layout = @widgetsView.getLayout() - data = - did: App.dashboard.id - layout: layout - $.post "#{baseUrl}/api/dashboards/save", data - - - App.addInitializer -> - @widgetsView = new WidgetsView - collection: @widgets - dashboard: @dashboard - el: $('#dashboard') - app: @ - @widgetsView.render(); - - - requestDetails = -> - $.get "#{baseUrl}/api/dashboards/show", key: App.dashboard, (data) -> - App.dashboard = new Backbone.Model _.omit data, 'widgets' - App.widgets = new Widgets data.widgets - - - $.when(requestDetails(), window.requestMessages()).done -> App.start() - diff --git a/server/sonar-web/src/main/coffee/dashboard/collections/widgets.coffee b/server/sonar-web/src/main/coffee/dashboard/collections/widgets.coffee deleted file mode 100644 index 1bdf752c60f..00000000000 --- a/server/sonar-web/src/main/coffee/dashboard/collections/widgets.coffee +++ /dev/null @@ -1,33 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2014 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - -define [ - 'dashboard/models/widget' -], ( - Widget -) -> - - class extends Backbone.Collection - model: Widget - - - comparator: (model) -> - model.get('row') - diff --git a/server/sonar-web/src/main/coffee/dashboard/mockjax.coffee b/server/sonar-web/src/main/coffee/dashboard/mockjax.coffee deleted file mode 100644 index a557c7c354f..00000000000 --- a/server/sonar-web/src/main/coffee/dashboard/mockjax.coffee +++ /dev/null @@ -1,172 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2014 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - -define ['third-party/jquery.mockjax'], -> - - jQuery.mockjaxSettings.contentType = 'text/json'; - jQuery.mockjaxSettings.responseTime = 250; - - jQuery.mockjax - url: "#{baseUrl}/api/dashboards/details" - responseText: JSON.stringify - name: 'Helicopter View' - description: '' - shared: true - layout: '50%-50%' - - canManageWidgets: true - - widgets: [ - { - id: 1 - key: 'measure_filter_list' - name: 'Measure Filter as List' - properties: [ - { - key: 'filter' - value: 48 - } - ] - layout: { - column: 1 - row: 1 - } - } - { - id: 2 - key: 'my_reviews' - name: 'My Unresolved Issues' - properties: [ - { - key: 'numberOfLines' - value: 5 - } - ] - layout: { - column: 1 - row: 2 - } - } - { - id: 3 - key: 'hotspot_most_violated_rules' - name: 'Most Violated Rules' - properties: [ - { - key: 'numberOfLines' - value: 5 - } - ] - layout: { - column: 2 - row: 1 - } - } - ] - - jQuery.mockjax - url: "#{baseUrl}/api/dashboards/widgets" - responseText: JSON.stringify - widgets: [ - { - key: 'action_plans' - name: 'Action Plans' - description: 'Shows all the open action plans of the project.' - } - { - key: 'complexity' - name: 'Complexity' - description: 'Reports on complexity, average complexity and complexity distribution.' - } - { - key: 'custom_measures' - name: 'Custom Measures' - description: 'Displays a list of selected measures.' - category: '' - } - ] - - - jQuery.mockjax - url: "#{baseUrl}/api/dashboards/configure_widget" - responseText: JSON.stringify - "widget": { - "key": "measure_filter_list", - "properties": [ - { - "key": "filter", - "value": 48, - "type": "FILTER", - "optional": false, - "options": { - "39": "My favourites" - "86": "Nemo & Dory" - "36": "New recent issues by developer" - "37": "New recent violations by project" - "54": "Projects" - "50": "Projects Activity since last version" - "38": "Projects Treemap" - "49": "Projects by license" - "100": "Projects not analyzed since 2 days" - "82": "Quality Gate" - "57": "Super Heroes with new issues" - "32": "Super Heroes" - "48": "Teams" - } - }, - { - "key": "pageSize", - "type": "INTEGER", - "defaultValue": "30", - "optional": true - }, - { - "key": "displayFilterDescription", - "type": "BOOLEAN", - "defaultValue": "false", - "optional": true - } - ] - } - - - jQuery.mockjax - url: "#{baseUrl}/api/dashboards/save_widget" - responseText: JSON.stringify - widget: { - key: 'measure_filter_list' - name: 'Measure Filter as List' - properties: [ - { - key: 'filter' - value: 48 - } - ] - layout: { - column: 1 - row: 1 - } - } - - - jQuery.mockjax - url: "#{baseUrl}/api/dashboards/save" - responseText: JSON.stringify - status: 'ok' diff --git a/server/sonar-web/src/main/coffee/dashboard/models/widget.coffee b/server/sonar-web/src/main/coffee/dashboard/models/widget.coffee deleted file mode 100644 index 687547dce0e..00000000000 --- a/server/sonar-web/src/main/coffee/dashboard/models/widget.coffee +++ /dev/null @@ -1,38 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2014 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - -define -> - - - class extends Backbone.Model - - defaults: -> - col: 1 - row: 0 - props: [] - configured: false - - - mergeProperties: (properties) -> - props = @get 'properties' - props = properties.map (prop) -> - data = _.findWhere props, key: prop.key - _.extend prop, data - @set 'properties', props diff --git a/server/sonar-web/src/main/coffee/dashboard/views/widget-view.coffee b/server/sonar-web/src/main/coffee/dashboard/views/widget-view.coffee deleted file mode 100644 index a70426181b3..00000000000 --- a/server/sonar-web/src/main/coffee/dashboard/views/widget-view.coffee +++ /dev/null @@ -1,103 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2014 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - -define [ - 'templates/dashboard' -], ( - Templates -) -> - - $ = jQuery - - - class extends Marionette.ItemView - template: Templates['widget'] - className: 'block' - - - events: - 'click .js-edit-widget': 'editWidget' - 'click .js-cancel-edit-widget': 'cancelEditWidget' - 'submit .js-edit-widget-form': 'saveWidget' - - - initialize: (options) -> -# @listenTo options.app.state, 'change', @render - if @model.get 'configured' - @requestContent() - - - onRender: -> - @$el.data 'id', @model.id - if @options.app.state.get 'configure' - @$el.prop 'draggable', true - - - requestContent: -> - payload = id: @model.get 'key' - if @options.app.resource - payload.resource = @options.app.resource - if @model.has 'componentId' - payload.resource = @model.get 'componentId' - _.extend payload, @getWidgetProps() - $.get "#{baseUrl}/widget/show", payload, (html) => - @model.set 'html', html - @render() - - - getWidgetProps: -> - properties = @model.get 'props' - r = {} - properties.forEach (prop) -> - r[prop.key] = prop.val if prop.val? - r - - - editWidget: -> - $.get "#{baseUrl}/api/dashboards/configure_widget", id: @model.get('key'), (data) => - @model.mergeProperties data.widget.properties - @showEditForm() - - - showEditForm: (render = true) -> - @render() if render - @$('.widget_props').removeClass 'hidden' - @$('.configure_widget').addClass 'hidden' - - - cancelEditWidget: -> - @$('.widget_props').addClass 'hidden' - @$('.configure_widget').removeClass 'hidden' - - - saveWidget: (e) -> - e.preventDefault() - data = id: @model.id - @$('.js-edit-widget-form').serializeArray().forEach (p) -> - data[p.name] = p.value - $.post "#{baseUrl}/api/dashboards/save_widget", data, (data) => - @model.set data.widget - @requestContent() - - - serializeData: -> - _.extend super, - baseUrl: baseUrl - state: @options.app.state.toJSON() diff --git a/server/sonar-web/src/main/coffee/dashboard/views/widgets-view.coffee b/server/sonar-web/src/main/coffee/dashboard/views/widgets-view.coffee deleted file mode 100644 index fe7aa8fb20f..00000000000 --- a/server/sonar-web/src/main/coffee/dashboard/views/widgets-view.coffee +++ /dev/null @@ -1,136 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2014 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - -define [ - 'templates/dashboard' - 'dashboard/models/widget' - 'dashboard/views/widget-view' -], ( - Templates - Widget - WidgetView -) -> - - $ = jQuery - - - class extends Marionette.CompositeView - template: Templates['widgets'] - itemView: WidgetView - itemViewContainer: '.dashboard-column' - - - events: - 'click .js-configure-widgets': 'configureWidgets' - 'click .js-back-to-dashboard': 'stopConfigureWidgets' - 'click .js-add-widget': 'addWidget' - - - initialize: (options) -> - @listenTo options.app.state, 'change', @render - - - itemViewOptions: -> - app: @options.app - - - appendHtml: (compositeView, itemView) -> - column = itemView.model.get('col') - 1 - row = itemView.model.get 'row' - $container = @getItemViewContainer compositeView - $column = $container.eq column - children = $column.children() - if children.size() <= row - $column.append itemView.el - else - children.eq(row).before itemView.el - - - onRender: -> - @initializeDragging() if @options.app.state.get 'configure' - - - initializeDragging: -> - blocks = @$('.block') - columnHandle = @$('.column-handle') - draggable = null - - onDragLeave = (e) -> - $(e.currentTarget).removeClass 'block-hover' - - onDrop = (e) => - e.preventDefault() - draggable.detach().insertBefore $(e.currentTarget) - onDragLeave e - @options.app.saveDashboard() - - blocks.on 'selectstart', -> - @dragDrop() - false - blocks.on 'dragstart', (e) -> - e.originalEvent.dataTransfer.setData 'Text', 'drag' - draggable = $(@) - columnHandle.show() - blocks.on 'dragover', (e) -> - if draggable.data('id') != $(@).data('id') - e.preventDefault() - $(e.currentTarget).addClass 'block-hover' - blocks.on 'drop', onDrop - blocks.on 'dragleave', onDragLeave - - columnHandle.on 'dragover', (e) -> - e.preventDefault() - $(e.currentTarget).addClass 'block-hover' - columnHandle.on 'drop', onDrop - columnHandle.on 'dragleave', onDragLeave - - - configureWidgets: -> - @options.app.state.set configure: true - unless @options.app.state.has 'widgets' - $.get "#{baseUrl}/api/dashboards/widgets", (data) => - @options.app.state.set widgets: data.widgets - - - stopConfigureWidgets: -> - @options.app.state.set configure: false - - - getLayout: -> - layout = $('.dashboard-column').map( -> - blocks = $(@).find '.block' - blocks.map( -> $(@).data('id')).get().join(',') - ).get().join(';') - - - addWidget: (e) -> - key = $(e.currentTarget).data 'key' - widgetData = _.findWhere @options.app.state.get('widgets'), key: key - widget = new Widget widgetData - @collection.add widget - widgetView = @children.findByModel widget - widgetView.editWidget() - - - serializeData: -> - _.extend super, - dashboard: @options.dashboard.toJSON() - manageDashboardsUrl: "#{baseUrl}/dashboards" - state: @options.app.state.toJSON() diff --git a/server/sonar-web/src/main/hbs/dashboard/_widget-props.hbs b/server/sonar-web/src/main/hbs/dashboard/_widget-props.hbs deleted file mode 100644 index 68595b6a500..00000000000 --- a/server/sonar-web/src/main/hbs/dashboard/_widget-props.hbs +++ /dev/null @@ -1,43 +0,0 @@ -<form class="js-edit-widget-form"> - <table class="table width100"> - <tbody> - {{! <% if !widget.java_definition.global && @dashboard.global %> }} - - {{#each properties}} - <tr> - <td class="form-key-cell"> - {{t 'widget' ../key 'property' key 'name'}} - {{#unless optional}}*{{/unless}} - </td> - <td class="form-val-cell"> - {{#eq type "FILTER"}} - <select name="{{key}}"> - {{#each options}} - <option value="{{@key}}" {{#eq @key ../value}}selected{{/eq}}>{{this}}</option> - {{/each}} - </select> - <a href="{{baseUrl}}/measures/manage">Edit my filters</a> - {{/eq}} - {{#eq type "INTEGER"}} - <input value="{{value}}" name="{{key}}" type="text" size="10"> - {{/eq}} - {{#eq type "BOOLEAN"}} - <input type="checkbox" name="{{key}}"> - {{/eq}} - - {{#if defaultValue}} - <div class="form-val-note">Default: {{defaultValue}}</div> - {{/if}} - </td> - </tr> - {{/each}} - - <tr> - <td colspan="2"> - <input type="submit" value="Save"> - <a class="js-cancel-edit-widget">Cancel</a> - </td> - </tr> - </tbody> - </table> -</form> diff --git a/server/sonar-web/src/main/hbs/dashboard/widget.hbs b/server/sonar-web/src/main/hbs/dashboard/widget.hbs deleted file mode 100644 index 844c3ec0c4e..00000000000 --- a/server/sonar-web/src/main/hbs/dashboard/widget.hbs +++ /dev/null @@ -1,28 +0,0 @@ -{{#if state.configure}} - - <div class="widget-header"> - <div class="widget-actions"> - {{#notEmpty properties}}<a class="js-edit-widget">Edit</a>{{/notEmpty}} - <a class="js-delete-widget">Delete</a> - </div> - <div class="widget-handle">{{name}}</div> - </div> - - <div class="widget_props hidden"> - {{> '_widget-props'}} - </div> - - <div class="configure_widget"> - <div class="transparent"></div> - <div class="widget"> - {{#if html}}{{{html}}}{{else}}<i class="spinner spinner-margin"></i>{{/if}} - </div> - </div> - -{{else}} - - <div class="widget"> - {{#if html}}{{{html}}}{{else}}<i class="spinner spinner-margin"></i>{{/if}} - </div> - -{{/if}} diff --git a/server/sonar-web/src/main/hbs/dashboard/widgets.hbs b/server/sonar-web/src/main/hbs/dashboard/widgets.hbs deleted file mode 100644 index 62a85c46aa5..00000000000 --- a/server/sonar-web/src/main/hbs/dashboard/widgets.hbs +++ /dev/null @@ -1,117 +0,0 @@ -<div class="line-block"> - <div class="noprint button-group"> - {{#unless state.configure}} - <button class="js-configure-widgets">{{t 'dashboard.configure_widgets'}}</button> - {{else}} - <button class="js-back-to-dashboard">{{t 'dashboard.back_to_dashboard'}}</button> - {{/unless}} - <a class="button" href="{{manageDashboardsUrl}}">{{t 'dashboard.manage_dashboards'}}</a> - </div> -</div> - -{{#if state.configure}} - <div id="configure"> - {{#notEmpty state.widgets}} - <div id="widget_defs"> - <table class="width100"> - <tbody> - <tr style="line-height: 20px;text-align: right"> - <td valign="top"> - <ul class="horizontal widget_categs" id="widget-filters"> - <li>Category:</li> - <li class="selected"> - <a id="widget-filter-none">Any</a> - </li> - <li> - <a id="widget-filter-Design">Design</a> - </li> - <li> - <a id="widget-filter-Filters">Filters</a> - </li> - <li> - <a id="widget-filter-Global">Global</a> - </li> - <li> - <a id="widget-filter-History">History</a> - </li> - <li> - <a id="widget-filter-Hotspots">Hotspots</a> - </li> - <li> - <a id="widget-filter-Issues">Issues</a> - </li> - <li> - <a id="widget-filter-Technical%20Debt">Technical Debt</a> - </li> - <li> - <a id="widget-filter-Tests">Tests</a> - </li> - </ul> - <td nowrap="" valign="top"> - Search: - <input id="filter-widget-box" name="filter-widget-box" size="10" type="text" disabled> - </td> - </tr> - </tbody> - </table> - - {{#each state.widgets}} - <div class="widget_def" style="display: inline-block;"> - <p><b>{{name}}</b></p> - <p>{{description}}</p> - <p><button class="js-add-widget" data-key="{{key}}">Add Widget</button></p> - </div> - {{/each}} - </div> - {{else}} - <i class="spinner spinner-margin"></i> - {{/notEmpty}} - - <div id="edit-layout"> - - <div class="select-layout "> - <a href="/dashboard/set_layout?did=51&layout=100%25" - onclick="var f = document.createElement('form'); f.style.display = 'none'; this.parentNode.appendChild(f); f.method = 'POST'; f.action = this.href;f.submit();return false;" - title="100%"><img alt="Layout100" src="/images/layout100.png?1406710293"></a> - </div> - - <div class="select-layout selected"> - <a href="/dashboard/set_layout?did=51&layout=50%25-50%25" - onclick="var f = document.createElement('form'); f.style.display = 'none'; this.parentNode.appendChild(f); f.method = 'POST'; f.action = this.href;f.submit();return false;" - title="50%-50%"><img alt="Layout5050" src="/images/layout5050.png?1406710293"></a> - </div> - - <div class="select-layout "> - <a href="/dashboard/set_layout?did=51&layout=30%25-70%25" - onclick="var f = document.createElement('form'); f.style.display = 'none'; this.parentNode.appendChild(f); f.method = 'POST'; f.action = this.href;f.submit();return false;" - title="30%-70%"><img alt="Layout3070" src="/images/layout3070.png?1406710293"></a> - </div> - - <div class="select-layout "> - <a href="/dashboard/set_layout?did=51&layout=70%25-30%25" - onclick="var f = document.createElement('form'); f.style.display = 'none'; this.parentNode.appendChild(f); f.method = 'POST'; f.action = this.href;f.submit();return false;" - title="70%-30%"><img alt="Layout7030" src="/images/layout7030.png?1406710293"></a> - </div> - - <div class="select-layout "> - <a href="/dashboard/set_layout?did=51&layout=33%25-33%25-33%25" - onclick="var f = document.createElement('form'); f.style.display = 'none'; this.parentNode.appendChild(f); f.method = 'POST'; f.action = this.href;f.submit();return false;" - title="33%-33%-33%"><img alt="Layout333333" src="/images/layout333333.png?1406710293"></a> - </div> - - </div> - </div> -{{/if}} - -{{#eq dashboard.layout '50%-50%'}} - <div class="dashboard-column-wrapper" style="width: 50%;margin: 0 -1px 0 0;"> - <div class="dashboard-column" style="margin: 0 5px 0 0;"> - - </div> - </div> - <div class="dashboard-column-wrapper" style="width: 50%;margin: 0 -1px 0 0;"> - <div class="dashboard-column" style="margin: 0 0 0 5px;"> - - </div> - </div> -{{/eq}} diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard2/_configure_widget.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard2/_configure_widget.html.erb deleted file mode 100644 index e2ceea91e73..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard2/_configure_widget.html.erb +++ /dev/null @@ -1,55 +0,0 @@ -<% - switch_to_widget_resource(widget) - widget_body=widget_body(widget) - default_layout=(widget.layout=='DEFAULT') -%> - -<div class="widget-header"> - <div class="widget-actions"> - <% if widget.java_definition.isEditable() || (!widget.java_definition.global && @dashboard.global) %> - <a class="link-action" onclick="portal.editWidget(<%= widget.id -%>);return false;"><%= message('edit') -%></a> - <% end %> - <a class="link-action" onclick="portal.deleteWidget(this);return false;"><%= message('delete') -%></a> - </div> - <div class="widget-handle"> - <%= h message('widget.' + widget.java_definition.getId() + '.name', :default => widget.java_definition.getTitle()) -%> - </div> -</div> - -<div class="widget_props" id="widget_props_<%= widget.id -%>" style="<%= 'display:none' if widget.configured -%>"> - <%= render :partial => 'widget_properties', :locals => {:widget => widget} -%> -</div> - -<%= render :partial => 'widget_title', :locals => {:widget => widget} -%> -<div id="widget_<%= widget.id -%>" class="configure_widget <%= h widget.java_definition.getId() -%>" style="height:100%;<%= 'display:none;' if !widget.configured -%>"> - <div class="transparent"></div> - <% if !widget_body %> - <div class="block"> - <% if default_layout %> - <div class="widget"> - <span class="empty_widget"><%= message('widget.error_occurred_please_read_logs', :params => [widget.key]) -%></span> - <div class="clear"></div> - </div> - <% else %> - <span class="empty_widget"><%= message('widget.error_occurred_please_read_logs', :params => [widget.key]) -%></span> - <% end %> - </div> - <% elsif widget_body.include? '<' %> - <% - - if default_layout - %> - <div class="widget"> - <% end %> - <%= widget_body -%> - <% if default_layout %> - <div class="clear"></div> - </div> - <% end %> - <% else %> - <div class="widget"><p><%= message('no_data') -%></p></div> - <% end %> - <div style="clear: both;"></div> -</div> - -<% restore_global_resource %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard2/_header.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard2/_header.html.erb deleted file mode 100644 index b078b0a5d43..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard2/_header.html.erb +++ /dev/null @@ -1,34 +0,0 @@ -<% if logged_in? || @snapshot %> -<div class="line-block"> - - <% if logged_in? %> - <div class="noprint button-group"> - <% if back %> - <%= link_to message('dashboard.back_to_dashboard'), dashboard_action(:index), :class => 'button' -%> - <% else %> - <% if @dashboard.editable_by?(current_user) %> - <%= link_to message('dashboard.configure_widgets'), dashboard_action(:configure), :class => 'button' -%> - <% end %> - <% end %> - <%= link_to message('dashboard.manage_dashboards'), {:controller => :dashboards, :action => :index, :resource => (@resource.id if @resource) }, :class => 'button' -%> - </div> - <% end %> - - <% if @snapshot %> - <div id="snapshot_title"> - <h4> - <%= "Version #{@snapshot.version} - " if @snapshot.version.present? -%><%= l @snapshot.created_at -%> - <% if @snapshot.project_snapshot.periods? %> - <% period_options = period_select_option_tags(@snapshot, 'small') %> - <% if period_options %> - <form method="GET" action="<%= url_for :controller => :dashboard, :action => :index, :id => @resource.id -%>" style="display: inline" class="spacer-left"> - <input type="hidden" name="did" value="<%= @dashboard.id -%>"/> - <%= dropdown_tag 'period', period_options, {:width => '250px'}, {:id => 'select-comparison', :onchange => 'submit()'} -%> - </form> - <% end %> - <% end %> - </h4> - </div> - <% end %> -</div> -<% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard2/_widget.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard2/_widget.html.erb deleted file mode 100644 index b706fd19076..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard2/_widget.html.erb +++ /dev/null @@ -1,48 +0,0 @@ -<% - switch_to_widget_resource(widget) - widget_body=widget_body(widget) - default_layout=(widget.java_definition.getWidgetLayout().name()=='DEFAULT') -%> - -<% if !widget.configured %> -<div class="block"> - <div class="widget"> - <span class="empty_widget"> - <a class="note" href="<%= url_for(dashboard_action(:configure)) -%>"><%= message('dashboard.please_configure_the_widget_x', :params => widget.java_definition.getTitle()) -%></a> - </span> - <div class="clear"></div> - </div> -</div> - -<% elsif !widget_body %> - <div class="block"> - <% if default_layout %> - <div class="widget"> - <span class="empty_widget"><%= message('widget.error_occurred_please_read_logs', :params => [widget.key]) -%></span> - <div class="clear"></div> - </div> - <% else %> - <span class="empty_widget"><%= message('widget.error_occurred_please_read_logs', :params => [widget.key]) -%></span> - <% end %> - </div> - -<% elsif widget_body.include?('<') %> - <div class="block" id="block_<%= widget.id -%>"> - <%= render :partial => 'widget_title', :locals => {:widget => widget} -%> - - <div class="<%= h widget.key -%>" style="height:100%;"> - <% if default_layout %> - <div class="widget"> - <%= widget_body -%> - <div class="clear"></div> - </div> - <% else %> - <%= widget_body -%> - <% end %> - - <div style="clear: both;"></div> - </div> - </div> -<% end %> - -<% restore_global_resource %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard2/_widget_definition.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard2/_widget_definition.html.erb deleted file mode 100644 index c0ab98601ff..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard2/_widget_definition.html.erb +++ /dev/null @@ -1,10 +0,0 @@ - <div class="widget_def" id="def_<%= definition.id.tr('_', '') -%>"> - <p><b><%= h message("widget.#{definition.id}.name", :default => definition.title) -%></b></p> - - <p><%= h message("widget.#{definition.id}.description", :default => definition.description) -%></p> - - <% form_tag dashboard_action(:add_widget, :widget => definition.id) do -%> - <input type="hidden" name="category" value="<%= category -%>"> - <input type="submit" value="<%= message('dashboard.add_widget') -%>" id="add-widget-<%= u(definition.id) -%>"> - <% end -%> - </div>
\ No newline at end of file diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard2/_widget_definitions.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard2/_widget_definitions.html.erb deleted file mode 100644 index 64ed279cc23..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard2/_widget_definitions.html.erb +++ /dev/null @@ -1,27 +0,0 @@ -<table class="width100"> - <tr style="line-height: 20px;text-align: right"> - <td valign="top"> - <ul class="horizontal widget_categs" id="widget-filters"> - <li>Category:</li> - <li class="<%= 'selected' if category.blank? -%>"> - <a href="#" onClick="return filterWidgetsByCategory('')" id="widget-filter-none"><%= message('any') -%></a> - </li> - <% @widget_categories.each do |c| %> - <li class="<%= 'selected' if category==c -%>"> - <a href="#" onClick="return filterWidgetsByCategory('<%= escape_javascript(c) -%>')" id="widget-filter-<%= u(c) -%>"><%= h(c) -%></a> - </li> - <% end %> - </ul> - <%= image_tag 'loading.gif', :style => 'vertical-align: top; display: none', :id => 'filter-widgets-loading' -%> - </td> - <td nowrap valign="top"> - Search: - <input id="filter-widget-box" name="filter-widget-box" size="10" onKeyUp="filtersWidgetsByContent(this.value);" type="text"/> - </td> - </tr> -</table> - -<% @widget_definitions.each do |definition| %> - <%= render :partial => 'widget_definition', :locals => {:definition => definition, :dashboard => @dashboard, :resource => @resource, :category => category} %> -<% end %> - diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard2/_widget_properties.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard2/_widget_properties.html.erb deleted file mode 100644 index ae419530933..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard2/_widget_properties.html.erb +++ /dev/null @@ -1,67 +0,0 @@ -<form onsubmit="$j.ajax({ - url: '<%= ApplicationController.root_context-%>/dashboard/save_widget?wid=<%=widget.id-%>&id=<%= params[:id] -%>', - type: 'post', - data: $j(this).serialize(), - error: function(request) - { - $j('#error<%=widget.id-%>').text(request.responseText); - $j('#error<%=widget.id-%>').show(); - } - }); - return false;" - method="post" - action="<%= ApplicationController.root_context-%>/dashboard/save_widget?wid=<%=widget.id-%>"> - <div id="error<%= widget.id -%>" class="error" style="display: none"></div> - <table class="table width100"> - <tbody> - - <% if !widget.java_definition.global && @dashboard.global %> - <tr> - <td class="form-key-cell"><%= message('widget.resource_id') %> <em class="mandatory">*</em></td> - <td class="form-val-cell" id="row_resource"> - <%= resource_select_tag 'resource_id', { - :resource_type_property => 'supportsGlobalDashboards', - :selected_resource => widget.resource, - :width => '250px', - :html_id => "widget-#{widget.id}-select-prj-#{widget.key.parameterize}", - :html_class => "widget-select-prj-#{widget.key.parameterize}" - } -%> - </td> - </tr> - <% end %> - - <% widget.java_definition.getWidgetProperties().each do |property_def| %> - <tr> - <td class="form-key-cell"><%= message("widget." + widget.key + ".property." + property_def.key() + ".name", :default => property_def.key()) -%><%= " *" unless property_def.optional() -%></td> - <td class="form-val-cell" id="row_<%= property_def.key() -%>"> - <%= property_value_field(property_def, widget.property_text_value(property_def.key()), widget) -%> - <div class="form-val-note"> - <% - # Old key used for retro-compatibility - property_description = message("widget." + widget.key + ".param." + property_def.key(), :default => '') - property_description = message("widget." + widget.key + ".property." + property_def.key() + ".desc", :default => property_def.description()) unless property_description != '' - -%> - - <% unless property_description.blank? -%> - <div><%= property_description -%></div> - <% end %> - <% if !property_def.defaultValue.blank? || property_def.type.name == PropertyType::TYPE_BOOLEAN -%> - <div><%= message('default') %>: <%= h(default_value property_def) -%></div> - <% end -%> - </div> - </td> - </tr> - <% end %> - - <tr> - <td colspan="2"> - <%= submit_tag message('save'), :id => "widget-#{widget.id}-save-#{widget.key.parameterize}", :class => "widget-save-#{widget.key.parameterize}" -%> - <% if widget.configured %> - <a href="#" onClick="portal.cancelEditWidget(<%= widget.id -%>);return false;"><%= message('cancel') -%></a> - <% end %> - </td> - </tr> - </tbody> - </table> - <%= hidden_field_tag "widgetid", "", :class => "widgetid" %> -</form> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard2/_widget_title.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard2/_widget_title.html.erb deleted file mode 100644 index 0c9fb7ae468..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard2/_widget_title.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<% unless widget_title(widget).blank? %> - <div class="widget-title" id="widget_title_<%= widget.id -%>"><%= widget_title(widget) -%></div> -<% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard2/configure.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard2/configure.html.erb deleted file mode 100644 index 30c43cc9aa0..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard2/configure.html.erb +++ /dev/null @@ -1,105 +0,0 @@ -<div id="dashboard"> - <%= render :partial => 'header', :locals => {:back => true} %> - - <div id="configure"> - <div id="widget_defs"> - <%= render :partial => 'widget_definitions', :locals => {:category => @category} -%> - </div> - - <div id="edit-layout"> - <% {'100%', 'layout100.png', - '50%-50%', 'layout5050.png', - '30%-70%', 'layout3070.png', - '70%-30%', 'layout7030.png', - '33%-33%-33%', 'layout333333.png' - }.each_pair do |layout, picto| %> - <div class="select-layout <%= 'selected' if @dashboard.layout==layout -%>"> - <%= link_to image_tag(picto), dashboard_action(:set_layout, :layout => layout), :method => :post, :title => layout %> - </div> - <% end %> - </div> - </div> - - <% - columns=@dashboard.column_layout.split('-') - for index in 1..columns.size() - %> - <div class="dashboard-column-wrapper" style="width: <%= columns[index-1] -%>;margin: 0 -1px 0 0;"> - <div class="dashboard-column" id="dashboard-column-<%= index -%>" style="margin: 0 <%= index<columns.size() ? "5px" : "0px" -%> 0 <%= index>1 ? "5px" : "0px" -%>;"> - <% - @dashboard.widgets.select { |widget| widget.column_index==index && widget.java_definition }.sort_by { |widget| widget.row_index }.each do |widget| - %> - <div class="block" id="block_<%= widget.id -%>"> - <%= render :partial => 'configure_widget', :locals => {:widget => widget} %> - </div> - <% - end - %> - <div class="column-handle" style="display: none"></div> - </div> - </div> - <% end %> -</div> - -<script type="text/javascript"> - <!-- - var options = { - editorEnabled: true, - column: 'dashboard-column', - columnHandle: 'column-handle', - block: 'block', - hoverClass: 'block-hover', - dashboardState: 'dashboardstate', - highlightDuration: 2000, - highlightStartColor: '#cae3f2', - highlightEndColor: '#ffffff', - saveUrl: '<%= url_for dashboard_action(:set_dashboard) -%>' - }; - var portal; - function init_dashboard() { - portal = new Portal(options); - <% if params[:highlight] %> - portal.highlightWidget(<%= escape_javascript(params[:highlight]) -%>); - <% end %> - } - $j(document).ready(function(){init_dashboard();}); - - function filterWidgetsByCategory(category) { - $j('#filter-widgets-loading').show(); - $j.ajax ({ url: '<%= add_category_to_url(url_for dashboard_action(:widget_definitions)) -%>' + encodeURIComponent(category), - success: function(responseHTML){$j('#widget_defs').html(responseHTML);}, - error:function(error){alert('error');} - }); - return false; - } - - var widgetContents = [ - <% - number_of_widgets = @widget_definitions.size() - @widget_definitions.each_with_index do |definition, index| - widget_id = "def_#{definition.id.tr('_', '')}" - widget_title = message("widget.#{definition.id}.name", :default => definition.title).downcase - widget_description = message("widget.#{definition.id}.description", :default => definition.description).downcase - %> - { id:"<%= widget_id -%>", c:"<%= widget_title.gsub(/\r\n?/, " ") -%> <%= widget_description.gsub(/\r\n?/, " ") -%>" } <%= "," unless index==number_of_widgets-1 -%> - <% end %> - ]; - - function filtersWidgetsByContent(text) { - var userInput = text.toLowerCase(); - widgetContents.forEach(function (widget) { - var element = $j('#'+widget.id); - if (element != null) { - if (widget.c.indexOf(userInput) != -1) { - element.show(); - } else { - element.hide(); - } - } - }); - return false; - } - //--> - - $j('#filter-widget-box').focus(); -</script> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard2/empty.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard2/empty.html.erb deleted file mode 100644 index 7a4ace5fc08..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard2/empty.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -<div class="page"> - <% if @resource and !@snapshot %> - <p class="alert alert-warning"><%= message('provisioning.no_analysis') -%></p> - <% end %> -</div> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard2/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard2/index.html.erb deleted file mode 100644 index b754d099d30..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard2/index.html.erb +++ /dev/null @@ -1,15 +0,0 @@ -<% content_for :script do %> - <script data-main="<%= ApplicationController.root_context -%>/js/dashboard/app" src="<%= ApplicationController.root_context -%>/js/require.js"></script> -<% end %> - -<div id="dashboard"> - <i class="spinner"></i> -</div> - -<script> - window.did = '<%= @dashboard.id -%>'; - <% if @resource %> - window.resource = '<%= @resource.key -%>'; - <% end %> - jQuery('html').addClass('dashboard-page'); -</script> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard2/no_dashboard.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard2/no_dashboard.html.erb deleted file mode 100644 index 8802eb19301..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard2/no_dashboard.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -<% content_for :script do %> - <script data-main="<%= ApplicationController.root_context -%>/js/dashboard/file-app" src="<%= ApplicationController.root_context -%>/js/require.js"></script> -<% end %> - -<div class="marginbottom10"></div> -<div id="accordion-panel"></div> - -<script type="text/javascript"> - window.fileKey = '<%= @file.key -%>'; - window.metric = '<%= @metric -%>'; - document.getElementById('crumbs').remove(); -</script> |