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 merge requests found
......@@ -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">
......
......@@ -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'
}
}
......
......@@ -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))
......
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