Skip to content

Commit

Permalink
Merge branch 'master' of github.com:metabase/metabase into distributi…
Browse files Browse the repository at this point in the history
…on-drill
  • Loading branch information
tlrobinson committed May 14, 2018
2 parents f19ebeb + 860da8a commit 13adf1b
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export default class MetadataTable extends Component {
}

return (
<div className="MetadataTable px3 flex-full">
<div className="MetadataTable px3">
<div className="MetadataTable-title flex flex-column bordered rounded">
<Input
className="AdminInput TableEditor-table-name text-bold border-bottom rounded-top"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const SettingHeader = ({ setting }) => (
<div className="text-grey-4 text-bold text-uppercase">
{setting.display_name}
</div>
<div className="text-grey-4 my1">
<div className="text-grey-4 text-measure my1">
{setting.description}
{setting.note && <div>{setting.note}</div>}
</div>
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/metabase/auth/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ export const logout = createThunkAction(LOGOUT, function() {
MetabaseAnalytics.trackEvent("Auth", "Logout");

dispatch(push("/auth/login"));

// refresh to ensure all application state is cleared
window.location.reload();
};
});

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/metabase/components/AdminLayout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default class AdminLayout extends Component {
<AdminHeader ref="header" title={title} />
<div className="MetadataEditor-main flex flex-row flex-full mt2">
{sidebar}
<div className="px2 flex-full">{children}</div>
<div className="px2 full">{children}</div>
</div>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,12 @@ export class NewQueryOptions extends Component {

return (
<div className="full-height flex">
<div className="wrapper wrapper--trim lg-wrapper--trim xl-wrapper--trim flex-full px4 mt4 mb2 align-center">
<div className="wrapper wrapper--trim lg-wrapper--trim xl-wrapper--trim px4 mt4 mb2 align-center">
<div
className="flex align-center justify-center"
style={{ minHeight: "100%" }}
>
<ol className="flex-full Grid Grid--guttersXl Grid--full sm-Grid--normal">
<ol className="Grid Grid--guttersXl Grid--full sm-Grid--normal">
{showMetricOption && (
<li className="Grid-cell">
<NewQueryOption
Expand Down
10 changes: 5 additions & 5 deletions src/metabase/query_processor/middleware/parameters/dates.clj
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,15 @@
;; e.g. past30days = past 30 days, not including partial data for today ({:include-current false})
;; past30days~ = past 30 days, *including* partial data for today ({:include-current true})
{:parser (regex->parser #"past([0-9]+)(day|week|month|year)s(~?)", [:int-value :unit :include-current?])
:range (fn [{:keys [unit int-value unit-range to-period]} dt]
:range (fn [{:keys [unit int-value unit-range to-period include-current?]} dt]
(unit-range (t/minus dt (to-period int-value))
(t/minus dt (to-period 1))))
(t/minus dt (to-period (if (seq include-current?) 0 1)))))
:filter (fn [{:keys [unit int-value include-current?]} field]
["TIME_INTERVAL" field (- int-value) unit {:include-current (boolean (seq include-current?))}])}

{:parser (regex->parser #"next([0-9]+)(day|week|month|year)s" [:int-value :unit])
:range (fn [{:keys [unit int-value unit-range to-period]} dt]
(unit-range (t/plus dt (to-period 1))
{:parser (regex->parser #"next([0-9]+)(day|week|month|year)s(~?)" [:int-value :unit :include-current?])
:range (fn [{:keys [unit int-value unit-range to-period include-current?]} dt]
(unit-range (t/plus dt (to-period (if (seq include-current?) 0 1)))
(t/plus dt (to-period int-value))))
:filter (fn [{:keys [unit int-value]} field]
["TIME_INTERVAL" field int-value unit])}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,25 @@
(expect {:end "2016-04-18"} (test-date->range "~2016-04-18"))

(expect {:end "2016-06-06", :start "2016-06-04"} (test-date->range "past3days"))
(expect {:end "2016-06-07", :start "2016-06-04"} (test-date->range "past3days~"))
(expect {:end "2016-06-06", :start "2016-05-31"} (test-date->range "past7days"))
(expect {:end "2016-06-06", :start "2016-05-08"} (test-date->range "past30days"))
(expect {:end "2016-05-31", :start "2016-04-01"} (test-date->range "past2months"))
(expect {:end "2016-06-30", :start "2016-04-01"} (test-date->range "past2months~"))
(expect {:end "2016-05-31", :start "2015-05-01"} (test-date->range "past13months"))
(expect {:end "2015-12-31", :start "2015-01-01"} (test-date->range "past1years"))
(expect {:end "2016-12-31", :start "2015-01-01"} (test-date->range "past1years~"))
(expect {:end "2015-12-31", :start "2000-01-01"} (test-date->range "past16years"))

(expect {:end "2016-06-10", :start "2016-06-08"} (test-date->range "next3days"))
(expect {:end "2016-06-10", :start "2016-06-07"} (test-date->range "next3days~"))
(expect {:end "2016-06-14", :start "2016-06-08"} (test-date->range "next7days"))
(expect {:end "2016-07-07", :start "2016-06-08"} (test-date->range "next30days"))
(expect {:end "2016-08-31", :start "2016-07-01"} (test-date->range "next2months"))
(expect {:end "2016-08-31", :start "2016-06-01"} (test-date->range "next2months~"))
(expect {:end "2017-07-31", :start "2016-07-01"} (test-date->range "next13months"))
(expect {:end "2017-12-31", :start "2017-01-01"} (test-date->range "next1years"))
(expect {:end "2017-12-31", :start "2016-01-01"} (test-date->range "next1years~"))
(expect {:end "2032-12-31", :start "2017-01-01"} (test-date->range "next16years"))

(expect {:end "2016-06-07", :start "2016-06-07"} (test-date->range "thisday"))
Expand Down

0 comments on commit 13adf1b

Please sign in to comment.