Skip to content

Commit

Permalink
Merge branch 'master' into release-0.15.1
Browse files Browse the repository at this point in the history
  • Loading branch information
agilliland committed Mar 9, 2016
2 parents 15d1656 + 74575ec commit 1d614ef
Show file tree
Hide file tree
Showing 142 changed files with 7,425 additions and 4,633 deletions.
1 change: 1 addition & 0 deletions .dir-locals.el
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
(qp-expect-with-engines 1)
(query-with-temp-db 1)
(resolve-private-fns 1)
(select 1)
(symbol-macrolet 1)
(sync-in-context 2)
(upd 2)
Expand Down
28 changes: 17 additions & 11 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parser": "babel-eslint",
"rules": {
"strict": [2, "never"],
"no-undef": 2,
"no-unused-vars": [1, {"vars": "all", "args": "none", "varsIgnorePattern": "React|PropTypes|Component"}],
"quotes": 0,
Expand All @@ -21,24 +21,30 @@
"no-multi-spaces": 0,
"no-mixed-spaces-and-tabs": 0,
"no-alert": 0,
"no-console": 0,
"dot-notation": 0,
"space-unary-ops": 0,
"semi": 0,
"no-console": 0,
"global-strict": 0,
"new-cap": 0,
"strict": [2, "never"]
},
"plugins": [
"react"
],
"ecmaFeatures": {
"jsx": true
"no-fallthrough": 0,
"no-case-declarations": 0,
"react/prop-types": 0,
"react/no-is-mounted": 0,
"react/no-did-mount-set-state": 0,
"react/no-did-update-set-state": 0,
"react/display-name": 0
},
"globals": {
"angular": false
},
"env": {
"browser": true
}
"browser": true,
"es6": true
},
"parser": "babel-eslint",
"plugins": [
"react"
],
"extends": ["eslint:recommended", "plugin:react/recommended"]
}
6 changes: 6 additions & 0 deletions ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
If this is a bug report, please fill in the blanks:

* I am using the _____ browser.
* My computer's OS is _____.
* My database is _____.
* My Metabase version is _____.
3 changes: 2 additions & 1 deletion OSX/Metabase/Backend/MetabaseTask.m
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ - (void)launch {
self.task.launchPath = JREPath();
self.task.environment = @{@"MB_DB_FILE": DBPath(),
@"MB_JETTY_PORT": @(self.port)};
self.task.arguments = @[@"-jar", UberjarPath()];
self.task.arguments = @[@"-Djava.awt.headless=true",
@"-jar", UberjarPath()];

__weak MetabaseTask *weakSelf = self;
self.task.terminationHandler = ^(NSTask *task){
Expand Down
2 changes: 2 additions & 0 deletions PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Before we can merge your pull request, you'll need to sign our [Contributor License Agreement](https://docs.google.com/a/metabase.com/forms/d/1oV38o7b9ONFSwuzwmERRMi9SYrhYeOrkbmNaq9pOJ_E/viewform)
(unless it's a tiny documentation change). Fill this out when you get a chance, and let us know in the PR! :100:
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[![Circle CI](https://circleci.com/gh/metabase/metabase.svg?style=svg&circle-token=3ccf0aa841028af027f2ac9e8df17ce603e90ef9)](https://circleci.com/gh/metabase/metabase)
[![Dependencies Status](https://jarkeeper.com/metabase/metabase/status.png)](https://jarkeeper.com/metabase/metabase)
[![Leiningen Dependencies Status](https://jarkeeper.com/metabase/metabase/status.png)](https://jarkeeper.com/metabase/metabase)
[![NPM Dependencies Status](https://david-dm.org/metabase/metabase.svg)](https://david-dm.org/metabase/metabase)

# Overview

Expand Down
2 changes: 1 addition & 1 deletion bin/docker/run_metabase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ fi


# Launch the application
java -Dlogfile.path=target/log -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -jar /app/metabase.jar
exec java -Dlogfile.path=target/log -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -jar /app/metabase.jar
4 changes: 3 additions & 1 deletion bin/reflection-linter
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env bash

warnings=`lein check 2>&1 | grep Reflection | grep metabase`
echo -e "\e[1;34mChecking for reflection warnings. This may take a few minutes, so sit tight...\e[0m"

warnings=`lein check-reflection-warnings 2>&1 | grep Reflection | grep metabase | uniq`

if [ ! -z "$warnings" ]; then
echo -e "\e[1;31mYour code has cased introduced some reflection warnings.\e[0m 😞"
Expand Down
2 changes: 1 addition & 1 deletion bin/version
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

VERSION="v0.15.1"
VERSION="v0.16.0-snapshot"

# dynamically pull more interesting stuff from latest git commit
HASH=$(git show-ref --head --hash=7 head) # first 7 letters of hash should be enough; that's what GitHub uses
Expand Down
4 changes: 2 additions & 2 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ test:
# 1) runs unit tests w/ Postgres local DB. Runs against H2, SQL Server
# 2) runs unit tests w/ MySQL local DB. Runs against H2, Postgres, SQLite
# 3) runs unit tests w/ H2 local DB. Runs against H2, Redshift, Druid
# 4) runs Eastwood linter & Bikeshed linter && ./bin/reflection-linter
# 4) runs Eastwood linter, Bikeshed linter, docstring-checker & ./bin/reflection-linter
# 5) runs JS linter + JS test
# 6) runs lein uberjar. (We don't run bin/build because we're not really concerned about `npm install` (etc) in this test, which runs elsewhere)
- case $CIRCLE_NODE_INDEX in 0) ENGINES=h2,mongo,mysql,bigquery lein test ;; 1) ENGINES=h2,sqlserver MB_DB_TYPE=postgres MB_DB_DBNAME=circle_test MB_DB_PORT=5432 MB_DB_USER=ubuntu MB_DB_HOST=localhost lein test ;; 2) ENGINES=h2,postgres,sqlite MB_DB_TYPE=mysql MB_DB_DBNAME=circle_test MB_DB_PORT=3306 MB_DB_USER=ubuntu MB_DB_HOST=localhost lein test ;; 3) ENGINES=h2,redshift,druid lein test ;; 4) lein eastwood 2>&1 | grep -v Reflection && lein bikeshed 2>&1 | grep -v Reflection && ./bin/reflection-linter ;; 5) npm install && npm run lint && npm run build && npm run test ;; 6) lein uberjar ;; esac:
- case $CIRCLE_NODE_INDEX in 0) ENGINES=h2,mongo,mysql,bigquery lein test ;; 1) ENGINES=h2,sqlserver MB_DB_TYPE=postgres MB_DB_DBNAME=circle_test MB_DB_PORT=5432 MB_DB_USER=ubuntu MB_DB_HOST=localhost lein test ;; 2) ENGINES=h2,postgres,sqlite MB_DB_TYPE=mysql MB_DB_DBNAME=circle_test MB_DB_PORT=3306 MB_DB_USER=ubuntu MB_DB_HOST=localhost lein test ;; 3) ENGINES=h2,redshift,druid lein test ;; 4) lein eastwood && lein bikeshed && lein docstring-checker && ./bin/reflection-linter ;; 5) npm install && npm run lint && npm run build && npm run test ;; 6) lein uberjar ;; esac:
parallel: true
deployment:
master:
Expand Down
2 changes: 1 addition & 1 deletion deploy/aws-eb-docker/run_metabase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ export MB_DB_PORT=$RDS_PORT
# TODO: dynamically determine type, probably using the port number
export MB_DB_TYPE=postgres

java -Dlogfile.path=target/log -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -jar /app/metabase.jar
exec java -Dlogfile.path=target/log -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -jar /app/metabase.jar
9 changes: 1 addition & 8 deletions docs/developers-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ when testing since they are impossible to run locally (such as Redshift and Bigq

Run the linters:

lein eastwood && lein bikeshed
lein eastwood && lein bikeshed && lein docstring-checker && ./bin/reflection-linter


#### Developing with Emacs
Expand All @@ -159,13 +159,6 @@ You'll probably want to tell Emacs to store customizations in a different file.
(load-file custom-file))
```

#### Checking for Out-of-Date Dependencies

lein ancient # list all out-of-date dependencies
lein ancient latest lein-ring # list latest version of artifact lein-ring

Will give you a list of out-of-date dependencies.

## Documentation

#### Instant Cheatsheet
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/admin/databases/components/DatabaseList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default class DatabaseList extends Component {
)
:
<tr>
<td colspan={4}>
<td colSpan={4}>
<LoadingSpinner />
<h3>Loading ...</h3>
</td>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/admin/people/components/EditUserForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default class EditUserForm extends Component {
for (var fieldName in this.refs) {
let node = ReactDOM.findDOMNode(this.refs[fieldName]);
if (node.required && MetabaseUtils.isEmpty(node.value)) isValid = false;
};
}

if(isValid !== valid) {
this.setState({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default class SettingsEmailForm extends Component {
validationErrors[element.key] = this.validateElement(validation, formData[element.key], element);
if (validationErrors[element.key]) valid = false;
}, this);
};
}
}, this);

if (this.state.valid !== valid || !_.isEqual(this.state.validationErrors, validationErrors)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default class SettingsSlackForm extends Component {
validationErrors[element.key] = this.validateElement(validation, formData[element.key], element);
if (validationErrors[element.key]) valid = false;
}, this);
};
}
}, this);

if (this.state.valid !== valid || !_.isEqual(this.state.validationErrors, validationErrors)) {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/card/card.controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ CardControllers.controller('CardDetail', [
MetabaseAnalytics.trackEvent('QueryBuilder', 'Run Query', dataset_query.type);

// HACK: prevent SQL editor from losing focus
try { ace.edit("id_sql").focus() } catch (e) {};
try { ace.edit("id_sql").focus() } catch (e) {}
}

function loadTableInfo(tableId) {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/CreateDashboardModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export default class CreateDashboardModal extends Component {
fieldName="name"
errors={this.state.errors}>
<input className="Form-input
full" name="name" placeholder="What is the name of your dashboard?" value={this.state.name} onChange={this.setName} autofocus />
full" name="name" placeholder="What is the name of your dashboard?" value={this.state.name} onChange={this.setName} autoFocus />
</FormField>

<FormField
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/components/Icon.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/*eslint-disable react/no-danger */

import React, { Component, PropTypes } from "react";
import RetinaImage from "react-retina-image";

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/NewsletterForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default class NewsletterForm extends Component {
Get infrequent emails about new releases and feature updates.
</div>

<form onSubmit={this.subscribeUser.bind(this)} novalidate>
<form onSubmit={this.subscribeUser.bind(this)} noValidate>
<div>
{ !submitted ?
<div className="">
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/ProfileLink.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,4 @@ export default class ProfileLink extends Component {
</OnClickOut>
);
}
};
}
2 changes: 1 addition & 1 deletion frontend/src/components/SaveQuestionModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export default class SaveQuestionModal extends Component {
displayName="Name"
fieldName="name"
errors={this.state.errors}>
<input className="Form-input full" name="name" placeholder="What is the name of your card?" value={this.state.details.name} onChange={(e) => this.onChange("name", e.target.value)} autofocus/>
<input className="Form-input full" name="name" placeholder="What is the name of your card?" value={this.state.details.name} onChange={(e) => this.onChange("name", e.target.value)} autoFocus/>
</FormField>

<FormField
Expand Down
13 changes: 0 additions & 13 deletions frontend/src/directives.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from "react";
import ReactDOM from "react-dom";

import { Provider } from 'react-redux';
import { DevTools, DebugPanel } from 'redux-devtools/lib/react';

/* Directives */
var MetabaseDirectives = angular.module('metabase.directives', []);
Expand Down Expand Up @@ -30,18 +29,6 @@ MetabaseDirectives.directive('mbReduxComponent', ['$timeout', function ($timeout
return {
restrict: 'A',
link: function (scope, element, attr) {
if (scope.monitor) {
var win = window.open(null, "redux-devtools", "menubar=no,location=no,resizable=yes,scrollbars=no,status=no");
win.location.reload();
setTimeout(function() {
ReactDOM.render(
<DebugPanel top right bottom left >
<DevTools store={scope.store} monitor={scope.monitor} />
</DebugPanel>
, win.document.body);
}, 10);
}

ReactDOM.render(
<Provider store={scope.store}>
<scope.Component {...scope.props} />
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/home/components/Activity.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export default class Activity extends Component {
case "user-joined":
description.summary = "joined!";
break;
};
}

return description;
}
Expand Down Expand Up @@ -237,7 +237,7 @@ export default class Activity extends Component {
case "segment-delete":
description.body = item.details.revision_message;
break;
};
}

return description;
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/cookies.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var MetabaseCookies = {
mb_cookies.scope.$broadcast('appstate:login', sessionId);

} else {
var sessionId = mb_cookies.ipCookie(METABASE_SESSION_COOKIE);
sessionId = mb_cookies.ipCookie(METABASE_SESSION_COOKIE);

// delete the current session cookie
mb_cookies.ipCookie.remove(METABASE_SESSION_COOKIE);
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/lib/pulse.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ export function channelIsValid(channel, channelSpec) {
}
switch (channel.schedule_type) {
case "monthly": if (channel.schedule_frame != null &&
channel.schedule_hour != null) { return true };
channel.schedule_hour != null) { return true }
// these cases intentionally fall though
case "weekly": if (channel.schedule_day == null) { return false };
case "daily": if (channel.schedule_hour == null) { return false };
case "weekly": if (channel.schedule_day == null) { return false }
case "daily": if (channel.schedule_hour == null) { return false }
case "hourly": break;
default: return false;
}
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/lib/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ const MetabaseSettings = {
} else {
return description;
}

return description;
}
}

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function populateQueryOptions(table) {
});

return table;
};
}

function addFkTargets(field, tables) {
if (field.target != null) {
Expand Down
31 changes: 14 additions & 17 deletions frontend/src/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,27 @@ var MetabaseUtils = {

if (!complexity) {
return generatePassword(len, false);

} else {

function isStrongEnough(password) {
var uc = password.match(/([A-Z])/g);
var lc = password.match(/([a-z])/g);
var di = password.match(/([\d])/g);
var sc = password.match(/([!@#\$%\^\&*\)\(+=._-{}])/g);

return (uc && uc.length >= (complexity.upper || 0) &&
lc && lc.length >= (complexity.lower || 0) &&
di && di.length >= (complexity.digit || 0) &&
sc && sc.length >= (complexity.special || 0));
}

let password="",
tries=0;
let password = "";
let tries = 0;
while(!isStrongEnough(password) && tries < 100) {
password = generatePassword(len, false, /[\w\d\?\-]/);
tries++;
}

return password;
}

function isStrongEnough(password) {
var uc = password.match(/([A-Z])/g);
var lc = password.match(/([a-z])/g);
var di = password.match(/([\d])/g);
var sc = password.match(/([!@#\$%\^\&*\)\(+=._-{}])/g);

return (uc && uc.length >= (complexity.upper || 0) &&
lc && lc.length >= (complexity.lower || 0) &&
di && di.length >= (complexity.digit || 0) &&
sc && sc.length >= (complexity.special || 0));
}
},

isEmpty: function(str) {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pulse/components/CardPicker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default class CardPicker extends Component {
if (card.dataset_query.query.aggregation[0] === "rows") {
error = "Raw data cannot be included in pulses";
}
} catch (e) {};
} catch (e) {}
if (card.display === "pin_map" || card.display === "state" || card.display === "country") {
error = "Maps cannot be included in pulses";
}
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/pulse/components/PulseCardPreview.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/*eslint-disable react/no-danger */

import React, { Component, PropTypes } from "react";

import Icon from "metabase/components/Icon.jsx";
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/query_builder/QueryVisualization.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export default class QueryVisualization extends Component {
} else {
if (window.OSX) {
return (
<a classname="mx1" title="Download this data" onClick={function() {
<a className="mx1" title="Download this data" onClick={function() {
window.OSX.saveCSV(JSON.stringify(card.dataset_query));
}}>
<Icon name='download' width="16px" height="16px" />
Expand Down
Loading

0 comments on commit 1d614ef

Please sign in to comment.