diff --git a/modules/jaggeryapps/ml/site/algorithm/algorithm.jag b/modules/jaggeryapps/ml/site/algorithm/algorithm.jag index 4f328a3f..9384a8bb 100644 --- a/modules/jaggeryapps/ml/site/algorithm/algorithm.jag +++ b/modules/jaggeryapps/ml/site/algorithm/algorithm.jag @@ -188,7 +188,7 @@ $( document ).ready(function() { setResponseVariable = res; }, error: function(res) { - var errorText = 'Error occurred while retrieving previously set response variable. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, notificationArea, 'warning'); } }); @@ -208,7 +208,7 @@ $( document ).ready(function() { } }, error: function(res) { - var errorText = 'Error occurred while retrieving previously set algorithm name. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, notificationArea, 'warning'); } }); @@ -228,7 +228,7 @@ $( document ).ready(function() { } }, error: function(res) { - var errorText = 'Error occurred while retrieving previously set train data fraction. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, notificationArea, 'warning'); } }); @@ -293,7 +293,7 @@ $( document ).ready(function() { window.location.href = '../parameters/parameters.jag?analysisId='+analysisId+'&projectName='+projectName+'&analysisName='+analysisName+'&algorithmName='+algorithmName+'&algorithmType='+algorithmType+'&datasetId='+datasetId+'&fromAnalysis='+fromAnalysis; }, error: function(res){ - var errorText = 'Error occurred while setting model configurations. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, notificationArea, 'warning'); } }); @@ -312,7 +312,7 @@ $( document ).ready(function() { window.location.href = '../project/projects.jag'; }, error: function(res){ - var errorText = 'Error occurred while cancelling analysis. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, notificationArea, 'warning'); } }); @@ -340,7 +340,7 @@ function loadDatasetFeatures(setResponseVariable) { } }, error: function(res) { - var errorText = 'Error occurred while retrieving dataset features. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, notificationArea, 'warning'); } }); diff --git a/modules/jaggeryapps/ml/site/analysis/analysis.jag b/modules/jaggeryapps/ml/site/analysis/analysis.jag index 4d02f0c1..15c29ee3 100644 --- a/modules/jaggeryapps/ml/site/analysis/analysis.jag +++ b/modules/jaggeryapps/ml/site/analysis/analysis.jag @@ -306,7 +306,7 @@ } }, error: function(res) { - var errorText = 'Error occurred while retrieving analysis models. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -390,7 +390,7 @@ handleNotification(successText, '#notification-area', 'success'); }, error : function(res){ - var errorText = 'Error occurred while publishing model to registry. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -421,7 +421,7 @@ algorithmName = res; }, error : function(res){ - var errorText = 'Error occurred while retrieving analysis name. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -438,7 +438,7 @@ algorithmType = res; }, error : function(res){ - var errorText = 'Error occurred while retrieving algorithm type. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -464,7 +464,7 @@ $('#accordion').pageMe({pagerSelector:'#pagination-list', childSelector:'.panel', showPrevNext:true, hidePageNumbers:false, perPage:panelsPerPage}); }, error : function(res){ - var errorText = 'Error occurred while deleting model. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); diff --git a/modules/jaggeryapps/ml/site/analysis/view-model.jag b/modules/jaggeryapps/ml/site/analysis/view-model.jag index 8b22fcaa..5ae072da 100644 --- a/modules/jaggeryapps/ml/site/analysis/view-model.jag +++ b/modules/jaggeryapps/ml/site/analysis/view-model.jag @@ -264,7 +264,7 @@ $( document ).ready(function() { numericalFeatureNames = res; }, error : function(res){ - var errorText = 'Error occurred while retrieving numerical feature names. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -282,7 +282,7 @@ $( document ).ready(function() { responseVariable = res; }, error : function(res){ - var errorText = 'Error occurred while retrieving response variable. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -404,7 +404,7 @@ $( document ).ready(function() { } }, error: function(res){ - var errorText = 'Error occurred while retrieving model summary. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); diff --git a/modules/jaggeryapps/ml/site/data/createdataset.jag b/modules/jaggeryapps/ml/site/data/createdataset.jag index 50d4c5ab..5b605449 100644 --- a/modules/jaggeryapps/ml/site/data/createdataset.jag +++ b/modules/jaggeryapps/ml/site/data/createdataset.jag @@ -253,7 +253,7 @@ $( document ).ready(function() { window.location = baseUrl + '/ml/site/data/datasets.jag'; }, error : function(res){ - var errorText = 'Error occurred while creating dataset. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); diff --git a/modules/jaggeryapps/ml/site/data/createversion.jag b/modules/jaggeryapps/ml/site/data/createversion.jag index 3d801d9d..6f2fd42b 100644 --- a/modules/jaggeryapps/ml/site/data/createversion.jag +++ b/modules/jaggeryapps/ml/site/data/createversion.jag @@ -278,7 +278,7 @@ $( document ).ready(function() { window.location = baseUrl + '/ml/site/data/datasets.jag'; }, error : function(res){ - var errorText = 'Error occurred while creating dataset version. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); diff --git a/modules/jaggeryapps/ml/site/data/datasets.jag b/modules/jaggeryapps/ml/site/data/datasets.jag index 2e7717be..4e9a0e42 100644 --- a/modules/jaggeryapps/ml/site/data/datasets.jag +++ b/modules/jaggeryapps/ml/site/data/datasets.jag @@ -351,7 +351,7 @@ function loadDatasets() { } }, error : function(res){ - var errorText = 'Error occurred while retrieving datasets. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -370,7 +370,7 @@ function deleteDataset(datasetId) { loadDatasets(); }, error : function(res){ - var errorText = 'Error occurred while deleting dataset. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -390,7 +390,7 @@ function deleteDatasetVersion(versionId) { loadDatasets(); }, error : function(res){ - var errorText = 'Error occurred while deleting dataset version. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); diff --git a/modules/jaggeryapps/ml/site/data/explore.jag b/modules/jaggeryapps/ml/site/data/explore.jag index 80dfcbd3..71697191 100644 --- a/modules/jaggeryapps/ml/site/data/explore.jag +++ b/modules/jaggeryapps/ml/site/data/explore.jag @@ -453,7 +453,7 @@ $( document ).ready(function() { categoricalFeatureNames = res; }, error : function(res) { - var errorText = 'Error occurred while retrieving categorical feature names. '+res.status+' '+res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -469,7 +469,7 @@ $( document ).ready(function() { numericalFeatureNames = res; }, error : function(res) { - var errorText = 'Error occurred while retrieving numerical feature names. '+res.status+' '+res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -620,7 +620,7 @@ function drawPlotsAjax() { $("#scatterPlotTitle").html(numFeatureIndependent + " vs. " + numFeatureDependent); }, error : function(res){ - var errorText = 'Error occurred while retrieving scatter plot data. '+res.status+' '+res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -645,7 +645,7 @@ function drawPlotsAjax() { drawHistogram(jsonObj, "#histogramIndependent"); }, error : function(res){ - var errorText = 'Error occurred while retrieving summary data for independent variable. '+res.status+' '+res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -670,7 +670,7 @@ function drawPlotsAjax() { drawHistogram(jsonObj, "#histogramDependent"); }, error : function(res){ - var errorText = 'Error occurred while retrieving summary data for dependent variable. '+res.status+' '+res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -767,7 +767,7 @@ function drawParallelSets() { vis.datum(res).call(chart); }, error : function(res){ - var errorText = 'Error occurred while retrieving data for parallel sets. '+res.status+' '+res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -964,7 +964,7 @@ function drawTrellisChart() { // array for parsets dimensions with categorical feature names }, error : function(res){ - var errorText = 'Error occurred while retrieving data for trellis chart. '+res.status+' '+res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); diff --git a/modules/jaggeryapps/ml/site/explore/explore.jag b/modules/jaggeryapps/ml/site/explore/explore.jag index 721e030e..65df8e24 100644 --- a/modules/jaggeryapps/ml/site/explore/explore.jag +++ b/modules/jaggeryapps/ml/site/explore/explore.jag @@ -453,7 +453,7 @@ $( document ).ready(function() { projectId = res['id']; }, error: function(res){ - var errorText = 'Error occurred while retrieving project info. '+res.status+' '+res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -473,7 +473,7 @@ $( document ).ready(function() { userName = res['userName']; }, error: function(res){ - var errorText = 'Error occurred while retrieving analysis info. '+res.status+' '+res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -490,7 +490,7 @@ $( document ).ready(function() { categoricalFeatureNames = res; }, error : function(res){ - var errorText = 'Error occurred while retrieving categorical feature names. '+res.status+' '+res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -506,7 +506,7 @@ $( document ).ready(function() { numericalFeatureNames = res; }, error : function(res){ - var errorText = 'Error occurred while retrieving numerical feature names. '+res.status+' '+res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -571,7 +571,7 @@ $( document ).ready(function() { window.location.href = '../project/projects.jag'; }, error: function(res){ - var errorText = 'Error occurred while cancelling analysis. '+res.status+' '+res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -689,7 +689,7 @@ function drawPlotsAjax() { $("#scatterPlotTitle").html(numFeatureIndependent + " vs. " + numFeatureDependent); }, error : function(res){ - var errorText = 'Error occurred while retrieving scatter plot data. '+res.status+' '+res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -714,7 +714,7 @@ function drawPlotsAjax() { drawHistogram(jsonObj, "#histogramIndependent"); }, error : function(res){ - var errorText = 'Error occurred while retrieving summary data for independent variable. '+res.status+' '+res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -739,7 +739,7 @@ function drawPlotsAjax() { drawHistogram(jsonObj, "#histogramDependent"); }, error : function(res){ - var errorText = 'Error occurred while retrieving summary data for dependent variable. '+res.status+' '+res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -836,7 +836,7 @@ function drawParallelSets() { vis.datum(res).call(chart); }, error : function(res){ - var errorText = 'Error occurred while retrieving data for parallel sets. '+res.status+' '+res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -1033,7 +1033,7 @@ function drawTrellisChart() { // array for parsets dimensions with categorical feature names }, error : function(res){ - var errorText = 'Error occurred while retrieving data for trellis chart. '+res.status+' '+res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); diff --git a/modules/jaggeryapps/ml/site/model/model.jag b/modules/jaggeryapps/ml/site/model/model.jag index 9d15494f..ec10de57 100644 --- a/modules/jaggeryapps/ml/site/model/model.jag +++ b/modules/jaggeryapps/ml/site/model/model.jag @@ -171,7 +171,7 @@ $( document ).ready(function() { modelName = res['name']; }, error: function(res){ - var errorText = 'Error occurred while creating model. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -190,7 +190,7 @@ $( document ).ready(function() { modelId = res['id']; }, error: function(res){ - var errorText = 'Error occurred while retrieving model info. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -207,7 +207,7 @@ $( document ).ready(function() { window.location.href = '../analysis/analysis.jag?analysisId='+analysisId+'&analysisName='+analysisName+'&projectName='+projectName+'&datasetId='+datasetId; }, error: function(res){ - var errorText = 'Error occurred while submitting model build job. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -232,7 +232,7 @@ $( document ).ready(function() { window.location.href = '../project/projects.jag'; }, error: function(res){ - var errorText = 'Error occurred while cancelling analysis. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -257,7 +257,7 @@ function loadDatasetVersions() { }); }, error: function(res) { //TODO: display error - var errorText = 'Error occurred while retrieving dataset versions. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); diff --git a/modules/jaggeryapps/ml/site/parameters/parameters.jag b/modules/jaggeryapps/ml/site/parameters/parameters.jag index 52d2423c..34e79a41 100644 --- a/modules/jaggeryapps/ml/site/parameters/parameters.jag +++ b/modules/jaggeryapps/ml/site/parameters/parameters.jag @@ -211,7 +211,7 @@ $( document ).ready(function() { } }, error: function(res) { - var errorText = 'Error occurred while retrieving previously set hyper-parameters. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -240,7 +240,7 @@ $( document ).ready(function() { } }, error: function(res) { - var errorText = 'Error occurred while retrieving hyper-parameters. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -295,7 +295,7 @@ $( document ).ready(function() { jsonData = "[".concat(jsonData,"]"); }, error: function(res) { - var errorText = 'Error occurred while retrieving hyper-parameters. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -312,7 +312,7 @@ $( document ).ready(function() { window.location.href = '../model/model.jag?analysisId='+analysisId+'&projectName='+projectName+'&analysisName='+analysisName+'&datasetId='+datasetId+'&algorithmName='+algorithmName+'&algorithmName='+algorithmName+'&algorithmType='+algorithmType+'&fromAnalysis='+fromAnalysis; }, error: function(res){ - var errorText = 'Error occurred while retrieving previously set hyper-parameters. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -332,7 +332,7 @@ $( document ).ready(function() { window.location.href = '../project/projects.jag'; }, error: function(res){ - var errorText = 'Error occurred while cancelling analysis. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); diff --git a/modules/jaggeryapps/ml/site/predict/predict.jag b/modules/jaggeryapps/ml/site/predict/predict.jag index b58b835d..72f07b99 100644 --- a/modules/jaggeryapps/ml/site/predict/predict.jag +++ b/modules/jaggeryapps/ml/site/predict/predict.jag @@ -201,7 +201,7 @@ responseVariable = data; }, error: function(res) { - var errorText = 'Error occurred while retrieving response variable. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -241,7 +241,7 @@ }; }, error: function(res) { - var errorText = 'Error occurred while retrieving feature names. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -282,7 +282,7 @@ $("#prediction").html(predictionNotification); }, error : function(res){ - var errorText = 'Error occurred while predicting response variable. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); diff --git a/modules/jaggeryapps/ml/site/preprocess/preprocess.jag b/modules/jaggeryapps/ml/site/preprocess/preprocess.jag index b2b3ae35..2553dd33 100644 --- a/modules/jaggeryapps/ml/site/preprocess/preprocess.jag +++ b/modules/jaggeryapps/ml/site/preprocess/preprocess.jag @@ -194,7 +194,7 @@ $( document ).ready(function() { window.location.href = '../explore/explore.jag?projectName='+projectName+'&analysisName='+analysisName+'&analysisId='+analysisId+'&datasetId='+datasetId+'&fromAnalysis='+fromAnalysis; }, error: function(res){ - var errorText = 'Error occurred while setting customized features. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -213,7 +213,7 @@ $( document ).ready(function() { window.location.href = '../project/projects.jag'; }, error: function(res){ - var errorText = 'Error occurred while cancelling analysis. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -248,7 +248,7 @@ $( document ).ready(function() { $('#datasetTable tbody').append(tableData); }, error : function(res){ - var errorText = 'Error occurred while retrieving dataset features. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); diff --git a/modules/jaggeryapps/ml/site/project/compare.jag b/modules/jaggeryapps/ml/site/project/compare.jag index 644fb059..01ec377c 100644 --- a/modules/jaggeryapps/ml/site/project/compare.jag +++ b/modules/jaggeryapps/ml/site/project/compare.jag @@ -441,7 +441,7 @@ } }, error: function(res) { - var errorText = 'Error occurred while retrieving project models. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); diff --git a/modules/jaggeryapps/ml/site/project/create_project.jag b/modules/jaggeryapps/ml/site/project/create_project.jag index f0d5cd2c..2bcd0068 100644 --- a/modules/jaggeryapps/ml/site/project/create_project.jag +++ b/modules/jaggeryapps/ml/site/project/create_project.jag @@ -247,7 +247,7 @@ $( document ).ready(function() { window.location.href = './projects.jag'; }, error : function(res){ - var errorText = 'Error occurred while creating project. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText; handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -270,7 +270,7 @@ $( document ).ready(function() { }); }, error: function(res) { //TODO: display error - var errorText = 'Error occurred while retrieving datasets. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); diff --git a/modules/jaggeryapps/ml/site/project/projects.jag b/modules/jaggeryapps/ml/site/project/projects.jag index 38663281..19c108c3 100644 --- a/modules/jaggeryapps/ml/site/project/projects.jag +++ b/modules/jaggeryapps/ml/site/project/projects.jag @@ -255,7 +255,7 @@ console.log("Analysis created."); }, error : function(res){ - var errorText = 'Error occurred while creating analysis. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText; handleNotification(errorText, notificationArea, 'warning'); isError = true; } @@ -274,7 +274,7 @@ analysisId = res['id']; }, error: function(res){ - var errorText = 'Error occurred while retrieving analysis ID. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, notificationArea, 'warning'); isError = true; } @@ -295,7 +295,7 @@ window.location.href = '../preprocess/preprocess.jag?projectName='+projectName+'&analysisName='+analysisName+'&analysisId='+analysisId+'&datasetId='+datasetId; }, error: function(res){ - var errorText = 'Error occurred while setting default impute options. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, notificationArea, 'warning'); isError = true; } @@ -502,7 +502,7 @@ } }, error: function(res) { - var errorText = 'Error occurred while retrieving projects. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -531,7 +531,7 @@ loadProjects(); }, error : function(res){ - var errorText = 'Error occurred while deleting project. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, '#notification-area', 'warning'); } }); @@ -552,7 +552,7 @@ loadProjects(); }, error: function(res){ - var errorText = 'Error occurred while deleting analysis. ' + res.status + ' ' + res.statusText; + var errorText = res.responseText handleNotification(errorText, notificationArea, 'warning'); } });