Skip to content
Snippets Groups Projects
Commit 91c767e7 authored by Allen Gilliland's avatar Allen Gilliland
Browse files

Merge pull request #219 from metabase/ag-postgres-not-Postgres

postgres not Postgres
parents 46922492 613b05c3
No related branches found
No related tags found
No related merge requests found
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
<div class="p4"> <div class="p4">
<div> <div>
<ul class="Connection-enginePicker"> <ul class="Connection-enginePicker">
<li class="Connection-engine" ng-repeat="engine in engines" ng-click="setConnectionEngine(engine)" ng-class="{'Connection-engineSelected': connection.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}} {{engine.name}}
</li> </li>
</ul> </ul>
<div ng-show="connection.engine != undefined"> <div ng-show="connection.engine != undefined">
......
...@@ -73,16 +73,14 @@ SetupControllers.controller('SetupIntro', ['$scope', '$location', '$timeout', 'i ...@@ -73,16 +73,14 @@ SetupControllers.controller('SetupIntro', ['$scope', '$location', '$timeout', 'i
SetupControllers.controller('SetupConnection', ['$scope', '$routeParams', '$location', 'Metabase', function($scope, $routeParams, $location, Metabase) { 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 = { var defaultPorts = {'MySql': 3306, 'Postgres': 5432, 'Mongo': 27017, "RedShift": 5439, 'Druid': 8083}
'Postgres': "postgres",
};
$scope.engines = [ $scope.engines = [
'Postgres', {'id': 'postgres', 'name':'Postgres'},
'MySQl', {'id': 'h2', 'name':'H2'},
'H2' {'id': 'mysql', 'name':'MySQL'}
]; ];
$scope.connection = {}; $scope.connection = {};
...@@ -108,7 +106,7 @@ SetupControllers.controller('SetupConnection', ['$scope', '$routeParams', '$loca ...@@ -108,7 +106,7 @@ SetupControllers.controller('SetupConnection', ['$scope', '$routeParams', '$loca
$scope.connection = { $scope.connection = {
host: "localhost", host: "localhost",
port: defaultPorts[connectionType], port: defaultPorts[connectionType],
engine: 'Postgres' engine: 'postgres'
} }
} }
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
(defendpoint POST "/" [:as {{:keys [org name engine details] :as body} :body}] (defendpoint POST "/" [:as {{:keys [org name engine details] :as body} :body}]
(require-params org name engine details) (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)) (check-403 (org-can-write org))
(ins Database :organization_id org :name name :engine engine :details details)) (ins Database :organization_id org :name name :engine engine :details details))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment