Commit 800db49cae0d8120ffc60413e75be18bf86aa216
Committed by
Paulo Meireles
1 parent
f5f28ddc
Exists in
master
and in
28 other branches
[Mezuro] Adjusting mezuro to new routes
Showing
1 changed file
with
14 additions
and
14 deletions
Show diff stats
plugins/mezuro/public/javascripts/project_content.js
| ... | ... | @@ -10,7 +10,7 @@ jQuery(function (){ |
| 10 | 10 | }); |
| 11 | 11 | |
| 12 | 12 | function showProjectContent() { |
| 13 | - callAction('project_state', {}, showProjectContentFor); | |
| 13 | + callAction('project', 'project_state', {}, showProjectContentFor); | |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | function display_metric_history() { |
| ... | ... | @@ -18,14 +18,14 @@ function display_metric_history() { |
| 18 | 18 | var metric_name = jQuery(this).attr('show-metric-history'); |
| 19 | 19 | toggle_mezuro("." + metric_name); |
| 20 | 20 | metricName = metric_name; |
| 21 | - callAction('module_metrics_history', {module_name: module_name, metric_name: metric_name}, show_metrics); | |
| 21 | + callAction('module', 'module_metrics_history', {module_name: module_name, metric_name: metric_name}, show_metrics); | |
| 22 | 22 | return false; |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | function display_grade_history() { |
| 26 | 26 | var module_name = jQuery(this).attr('data-module-name'); |
| 27 | 27 | toggle_mezuro("#historical-grade"); |
| 28 | - callAction('module_grade_history', {module_name: module_name}, show_grades); | |
| 28 | + callAction('module', 'module_grade_history', {module_name: module_name}, show_grades); | |
| 29 | 29 | return false; |
| 30 | 30 | } |
| 31 | 31 | |
| ... | ... | @@ -46,8 +46,8 @@ function reloadModule(){ |
| 46 | 46 | var module_name = jQuery(this).attr('data-module-name'); |
| 47 | 47 | showLoadingProcess(false); |
| 48 | 48 | processingTree = true; |
| 49 | - callAction('project_tree', {module_name: module_name }, showProjectTree); | |
| 50 | - callAction('module_result', {module_name: module_name}, showModuleResult); | |
| 49 | + callAction('project', 'project_tree', {module_name: module_name }, showProjectTree); | |
| 50 | + callAction('module', 'module_result', {module_name: module_name}, showModuleResult); | |
| 51 | 51 | return false; |
| 52 | 52 | } |
| 53 | 53 | |
| ... | ... | @@ -59,23 +59,23 @@ function reloadProjectWithDate(date){ |
| 59 | 59 | function reloadProject(date){ |
| 60 | 60 | showLoadingProcess(true); |
| 61 | 61 | |
| 62 | - callAction('project_result', {date: date}, showProjectResult); | |
| 63 | - callAction('project_tree', {date: date}, showProjectTree); | |
| 64 | - callAction('module_result', {date: date}, showModuleResult); | |
| 62 | + callAction('project', 'project_result', {date: date}, showProjectResult); | |
| 63 | + callAction('project', 'project_tree', {date: date}, showProjectTree); | |
| 64 | + callAction('module', 'module_result', {date: date}, showModuleResult); | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | function showProjectContentFor(state){ |
| 68 | 68 | if (state == 'ERROR') { |
| 69 | 69 | jQuery('#project-state').html('ERROR'); |
| 70 | - callAction('project_error', {}, showProjectResult); | |
| 70 | + callAction('project', 'project_error', {}, showProjectResult); | |
| 71 | 71 | } |
| 72 | 72 | else if (state == 'READY') { |
| 73 | 73 | jQuery('#msg-time').html(''); |
| 74 | 74 | jQuery('#project-state').html('READY'); |
| 75 | - callAction('project_result', {}, showProjectResult); | |
| 76 | - callAction('project_tree', {}, showProjectTree); | |
| 75 | + callAction('project', 'project_result', {}, showProjectResult); | |
| 76 | + callAction('project','project_tree', {}, showProjectTree); | |
| 77 | 77 | var project_name = jQuery("#project-result").attr('data-project-name'); |
| 78 | - callAction('module_result', {module_name: project_name}, showModuleResult); | |
| 78 | + callAction('module', 'module_result', {module_name: project_name}, showModuleResult); | |
| 79 | 79 | } |
| 80 | 80 | else if (state.endsWith("ING")) { |
| 81 | 81 | jQuery('#project-state').html(state); |
| ... | ... | @@ -109,10 +109,10 @@ function showModuleResult(content){ |
| 109 | 109 | return false; |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | -function callAction(action, params, callback){ | |
| 112 | +function callAction(controller, action, params, callback){ | |
| 113 | 113 | var profile = projectContentData('profile'); |
| 114 | 114 | var content = projectContentData('content'); |
| 115 | - var endpoint = '/profile/' + profile + '/plugins/mezuro/' + action + '/' + content; | |
| 115 | + var endpoint = '/profile/' + profile + '/plugin/mezuro/' + controller + '/' + action + '/' + content; | |
| 116 | 116 | jQuery.get(endpoint, params, callback); |
| 117 | 117 | } |
| 118 | 118 | ... | ... |