diff --git a/resources/frontend_client/app/setup/partials/setup_connection.html b/resources/frontend_client/app/setup/partials/setup_connection.html index 458bc791758e6e706a98de4a2afe11333498b574..3ee270bb013be66b520df2517f891c9542545072 100644 --- a/resources/frontend_client/app/setup/partials/setup_connection.html +++ b/resources/frontend_client/app/setup/partials/setup_connection.html @@ -15,8 +15,8 @@ <div class="p4"> <div> <ul class="Connection-enginePicker"> - <li class="Connection-engine" ng-repeat="engine in engines" ng-click="setConnectionEngine(engine)" ng-class="{'Connection-engineSelected': connection.engine == engine }"> - {{engine}} + <li class="Connection-engine" ng-repeat="engine in engines" ng-click="setConnectionEngine(engine.id)" ng-class="{'Connection-engineSelected': connection.engine == engine.id }"> + {{engine.name}} </li> </ul> <div ng-show="connection.engine != undefined"> diff --git a/resources/frontend_client/app/setup/setup.controllers.js b/resources/frontend_client/app/setup/setup.controllers.js index d6fb5cbe54433f9a565033fc67877ba4658de615..853cc16549ead0cc830956e17cad83b552f7da5c 100644 --- a/resources/frontend_client/app/setup/setup.controllers.js +++ b/resources/frontend_client/app/setup/setup.controllers.js @@ -73,16 +73,14 @@ SetupControllers.controller('SetupIntro', ['$scope', '$location', '$timeout', 'i SetupControllers.controller('SetupConnection', ['$scope', '$routeParams', '$location', 'Metabase', function($scope, $routeParams, $location, Metabase) { - var defaultPorts = {'MySql': 3306, 'Postgres': 5432, 'Mongo': 27017, "RedShift": 5439, 'Druid': 8083} + // TODO - we should be getting all this info from the api - var connectionEngines = { - 'Postgres': "postgres", - }; + var defaultPorts = {'MySql': 3306, 'Postgres': 5432, 'Mongo': 27017, "RedShift": 5439, 'Druid': 8083} $scope.engines = [ - 'Postgres', - 'MySQl', - 'H2' + {'id': 'postgres', 'name':'Postgres'}, + {'id': 'h2', 'name':'H2'}, + {'id': 'mysql', 'name':'MySQL'} ]; $scope.connection = {}; @@ -108,7 +106,7 @@ SetupControllers.controller('SetupConnection', ['$scope', '$routeParams', '$loca $scope.connection = { host: "localhost", port: defaultPorts[connectionType], - engine: 'Postgres' + engine: 'postgres' } } diff --git a/src/metabase/api/meta/db.clj b/src/metabase/api/meta/db.clj index 3e57770b7ad87196b716ecddc70cc1e6e1421f84..017b30ad87df9e81ebe653e9a02b76be6518872e 100644 --- a/src/metabase/api/meta/db.clj +++ b/src/metabase/api/meta/db.clj @@ -23,6 +23,7 @@ (defendpoint POST "/" [:as {{:keys [org name engine details] :as body} :body}] (require-params org name engine details) + (check (contains? (set (map first driver/available-drivers)) engine) [400 "Invalid engine type specified."]) (check-403 (org-can-write org)) (ins Database :organization_id org :name name :engine engine :details details))