diff --git a/Gruntfile.js b/Gruntfile.js index 36ac5e1c..16f7be03 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -36,7 +36,7 @@ module.exports = function (grunt) { tasks: ['wiredep'] }, js: { - files: ['<%= yeoman.app %>/scripts/{,*/}*.js'], + files: ['<%= yeoman.app %>/scripts/{,*/}*.js', '<%= yeoman.app %>/admin_components/**/*.js'], tasks: ['newer:jshint:all'], options: { livereload: '<%= connect.options.livereload %>' diff --git a/app/admin_components/adf-services/dreamfactory-services.js b/app/admin_components/adf-services/dreamfactory-services.js index be49dcc6..6aa50c46 100644 --- a/app/admin_components/adf-services/dreamfactory-services.js +++ b/app/admin_components/adf-services/dreamfactory-services.js @@ -350,7 +350,7 @@ angular.module('dfServices', ['ngRoute', 'dfUtility']) }; }]) - .directive('dfServiceDetails', ['MOD_SERVICES_ASSET_PATH', '$q', 'dfApplicationData', 'dfNotify', 'dfObjectService', function (MOD_SERVICES_ASSET_PATH, $q, dfApplicationData, dfNotify, dfObjectService) { + .directive('dfServiceDetails', ['MOD_SERVICES_ASSET_PATH', '$q', '$http', 'dfApplicationData', 'dfNotify', 'dfObjectService', 'INSTANCE_URL', function (MOD_SERVICES_ASSET_PATH, $q, $http, dfApplicationData, dfNotify, dfObjectService, INSTANCE_URL) { return { @@ -504,6 +504,32 @@ angular.module('dfServices', ['ngRoute', 'dfUtility']) return data; }; + + scope.testServiceConnection = function () { + + var url = INSTANCE_URL.url + '/' + scope.serviceInfo.name + '/_schema'; + + var messageOptions = { + module: 'Services', + provider: 'dreamfactory' + }; + + $http.get(url).then(function (response) { + messageOptions.type = 'success'; + messageOptions.message = 'Test connection succeeded.'; + dfNotify.success(messageOptions); + + }, function (reject) { + messageOptions.type = 'error'; + messageOptions.message = reject.data.error.message; + dfNotify.error(messageOptions); + }); + }; + + scope.isServiceTypeDatabase = function () { + return scope.selectedSchema.group == 'Database'; + }; + scope.saveService = function () { // merge data from UI into current edit record diff --git a/app/admin_components/adf-services/views/df-service-details.html b/app/admin_components/adf-services/views/df-service-details.html index 42b6ebff..6a473898 100644 --- a/app/admin_components/adf-services/views/df-service-details.html +++ b/app/admin_components/adf-services/views/df-service-details.html @@ -44,6 +44,10 @@ type="submit" value="Save and Close" data-ng-click="selections.saveAndClose=true"/> + Test Connection Info Config Service Definition Close \ No newline at end of file + Info Config Service Definition Test Connection Close \ No newline at end of file diff --git a/dist/index.html b/dist/index.html index 1c6a03f4..e066c4e1 100644 --- a/dist/index.html +++ b/dist/index.html @@ -2,7 +2,7 @@ You are using an outdated browser. Please upgrade your browser to improve your experience.
You are using an outdated browser. Please upgrade your browser to improve your experience.