forked from metabase/metabase
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Query Builder 2.0 [WIP] (metabase#4496)
* QB modes, actions, and drill throughs. * Refactor drill throughs + misc bug fixes * Port sort action to drills * Smarter 'view this/these' name * Scalar hover state * QB actions: don't skip action selection screen unless the action is marked as 'default' * Fix flow errors * Fix drills * Show "This X's Ys" for FKs * Prevent qb from uneccesary push states * Don't show (fk) breakout fields that have already been broken out * Fix 'drill into this' unit * Cleanup timeseries footer * Cleanup qb selectors * Namespace all qb actions * Make modes dependent on previously run card * More timeseries footer cleanup * Fix table crash * Make breakout legend clickable * Fix datagrid pivot test * Flow + lint
- Loading branch information
1 parent
19fb5aa
commit ff12c03
Showing
127 changed files
with
3,436 additions
and
908 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import _ from "underscore"; | ||
|
||
import type { ExpressionName, ExpressionClause, Expression } from "metabase/meta/types/Query"; | ||
|
||
export function getExpressions(expressions: ?ExpressionClause = {}): ExpressionClause { | ||
return expressions; | ||
} | ||
|
||
export function getExpressionsList(expressions: ?ExpressionClause = {}): Array<{ name: ExpressionName, expression: Expression }> { | ||
return Object.entries(expressions).map(([name, expression]) => ({ name, expression })); | ||
} | ||
|
||
export function addExpression(expressions: ?ExpressionClause = {}, name: ExpressionName, expression: Expression): ?ExpressionClause { | ||
return { ...expressions, [name]: expression }; | ||
} | ||
export function updateExpression(expressions: ?ExpressionClause = {}, name: ExpressionName, expression: Expression, oldName?: ExpressionName): ?ExpressionClause { | ||
if (oldName != null) { | ||
expressions = removeExpression(expressions, oldName); | ||
} | ||
return addExpression(expressions, name, expression); | ||
} | ||
export function removeExpression(expressions: ?ExpressionClause = {}, name: ExpressionName): ?ExpressionClause { | ||
return _.omit(expressions, name) | ||
} | ||
export function clearExpressions(expressions: ?ExpressionClause): ?ExpressionClause { | ||
return {}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.