Skip to content

Commit

Permalink
Merge branch 'master' of github.com:metabase/metabase into issue-7709
Browse files Browse the repository at this point in the history
  • Loading branch information
tlrobinson committed Jun 19, 2018
2 parents 1f63785 + 8b8c7e5 commit 347a42a
Show file tree
Hide file tree
Showing 73 changed files with 1,555 additions and 886 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Metabase is the easy, open source way for everyone in your company to ask questi
[![Latest Release](https://img.shields.io/github/release/metabase/metabase.svg?label=latest%20release)](https://github.com/metabase/metabase/releases)
[![GitHub license](https://img.shields.io/badge/license-AGPL-05B8CC.svg)](https://raw.githubusercontent.com/metabase/metabase/master/LICENSE.txt)
[![Circle CI](https://circleci.com/gh/metabase/metabase.svg?style=svg&circle-token=3ccf0aa841028af027f2ac9e8df17ce603e90ef9)](https://circleci.com/gh/metabase/metabase)
[![Gitter chat](https://badges.gitter.im/metabase/metabase.png)](https://gitter.im/metabase/metabase)

# Features
- 5 minute [setup](http://metabase.com/docs/latest/setting-up-metabase.html) (We're not kidding)
Expand Down Expand Up @@ -95,6 +96,8 @@ To get started with a development installation of the Metabase, follow the instr

Then take a look at our [Contribution Guide](docs/contributing.md) for information about our process and where you can fit in!

Talk to other contributors [in our Gitter room](https://gitter.im/metabase/metabase).

# Extending and Deep Integrations

Metabase also allows you to hit our Query API directly from Javascript to integrate the simple analytics we provide with your own application or third party services to do things like:
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/metabase-lib/lib/metadata/Field.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
isString,
isSummable,
isCategory,
isLocation,
isDimension,
isMetric,
isPK,
Expand Down Expand Up @@ -59,6 +60,9 @@ export default class Field extends Base {
isString() {
return isString(this);
}
isLocation() {
return isLocation(this);
}
isSummable() {
return isSummable(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from "prop-types";

import LoadingAndErrorWrapper from "metabase/components/LoadingAndErrorWrapper.jsx";

import FilterList from "metabase/query_builder/components/filters/FilterList.jsx";
import FilterList from "metabase/query_builder/components/FilterList.jsx";
import AggregationWidget from "metabase/query_builder/components/AggregationWidget.jsx";

import Query from "metabase/lib/query";
Expand Down Expand Up @@ -31,11 +31,7 @@ export default class QueryDiff extends Component {
/>
)}
{filters.length > 0 && (
<FilterList
filters={filters}
tableMetadata={tableMetadata}
maxDisplayValues={Infinity}
/>
<FilterList filters={filters} maxDisplayValues={Infinity} />
)}
</div>
)}
Expand Down
14 changes: 6 additions & 8 deletions frontend/src/metabase/admin/permissions/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -656,31 +656,29 @@ export const getDatabasesPermissionsGrid = createSelector(
},
);

import Collections, { getCollectionsById } from "metabase/entities/collections";
import Collections from "metabase/entities/collections";

const getCollectionId = (state, props) => props && props.collectionId;
const getSingleCollectionPermissionsMode = (state, props) =>
(props && props.singleCollectionMode) || false;

const getCollections = createSelector(
[
Collections.selectors.getList,
Collections.selectors.getExpandedCollectionsById,
getCollectionId,
getSingleCollectionPermissionsMode,
],
(collections, collectionId, singleMode) => {
if (!collections) {
return null;
}
const collectionsById = getCollectionsById(collections);
(collectionsById, collectionId, singleMode) => {
if (collectionId && collectionsById[collectionId]) {
if (singleMode) {
return [collectionsById[collectionId]];
} else {
return collectionsById[collectionId].children;
}
} else {
} else if (collectionsById["root"]) {
return [collectionsById["root"]];
} else {
return null;
}
},
);
Expand Down
13 changes: 10 additions & 3 deletions frontend/src/metabase/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,15 @@ import { getStore } from "./store";

import { refreshSiteSettings } from "metabase/redux/settings";

// router
import { Router, useRouterHistory } from "react-router";
import { createHistory } from "history";
import { syncHistoryWithStore } from "react-router-redux";

// drag and drop
import HTML5Backend from "react-dnd-html5-backend";
import { DragDropContextProvider } from "react-dnd";

// remove trailing slash
const BASENAME = window.MetabaseRoot.replace(/\/+$/, "");

Expand All @@ -58,9 +63,11 @@ function _init(reducers, getRoutes, callback) {

ReactDOM.render(
<Provider store={store}>
<ThemeProvider theme={theme}>
<Router history={history}>{routes}</Router>
</ThemeProvider>
<DragDropContextProvider backend={HTML5Backend} context={{ window }}>
<ThemeProvider theme={theme}>
<Router history={history}>{routes}</Router>
</ThemeProvider>
</DragDropContextProvider>
</Provider>,
document.getElementById("root"),
);
Expand Down
26 changes: 15 additions & 11 deletions frontend/src/metabase/components/CheckBox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ import { normal as defaultColors } from "metabase/lib/colors";
export default class CheckBox extends Component {
static propTypes = {
checked: PropTypes.bool,
indeterminate: PropTypes.bool,
onChange: PropTypes.func,
color: PropTypes.oneOf(Object.keys(defaultColors)),
size: PropTypes.number, // TODO - this should probably be a concrete set of options
padding: PropTypes.number, // TODO - the component should pad itself properly based on the size
noIcon: PropTypes.bool,
};

static defaultProps = {
Expand All @@ -31,15 +33,16 @@ export default class CheckBox extends Component {
}

render() {
const { checked, color, padding, size } = this.props;
const { checked, indeterminate, color, padding, size, noIcon } = this.props;

const themeColor = defaultColors[color];
const checkedColor = defaultColors[color];
const uncheckedColor = "#ddd";

const checkboxStyle = {
width: size,
height: size,
backgroundColor: checked ? themeColor : "white",
border: `2px solid ${checked ? themeColor : "#ddd"}`,
backgroundColor: checked ? checkedColor : "white",
border: `2px solid ${checked ? checkedColor : uncheckedColor}`,
};
return (
<div
Expand All @@ -52,13 +55,14 @@ export default class CheckBox extends Component {
style={checkboxStyle}
className="flex align-center justify-center rounded"
>
{checked && (
<Icon
style={{ color: checked ? "white" : themeColor }}
name="check"
size={size - padding * 2}
/>
)}
{(checked || indeterminate) &&
!noIcon && (
<Icon
style={{ color: checked ? "white" : uncheckedColor }}
name={indeterminate ? "dash" : "check"}
size={size - padding * 2}
/>
)}
</div>
</div>
);
Expand Down
Loading

0 comments on commit 347a42a

Please sign in to comment.