Skip to content

Commit

Permalink
Merge branch 'main' into prevent-leaderboard-value-wrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
bcolloran committed Jan 5, 2024
2 parents 705d7e8 + cd2a4fd commit ef3b037
Show file tree
Hide file tree
Showing 28 changed files with 325 additions and 124 deletions.
2 changes: 1 addition & 1 deletion proto/gen/rill/admin/v1/api.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proto/gen/rill/admin/v1/internal.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proto/gen/rill/runtime/v1/api.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proto/gen/rill/runtime/v1/catalog.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proto/gen/rill/runtime/v1/colors.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proto/gen/rill/runtime/v1/connectors.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proto/gen/rill/runtime/v1/export_format.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proto/gen/rill/runtime/v1/expression.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proto/gen/rill/runtime/v1/queries.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proto/gen/rill/runtime/v1/resources.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proto/gen/rill/runtime/v1/schema.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proto/gen/rill/runtime/v1/time_grain.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions proto/rill/ui/v1/dashboard.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package rill.ui.v1;
import "google/protobuf/timestamp.proto";
import "rill/runtime/v1/time_grain.proto";
import "rill/runtime/v1/queries.proto";
import "rill/runtime/v1/expression.proto";

// DashboardState represents the dashboard as seen by the user
message DashboardState {
Expand Down Expand Up @@ -56,6 +57,10 @@ message DashboardState {
DashboardTimeRange time_range = 1;
// Dimension filters applied
rill.runtime.v1.MetricsViewFilter filters = 2;
// Expression format for dimension filters
rill.runtime.v1.Expression where = 20;
// Expression format for measure filters
rill.runtime.v1.Expression having = 21;
// Selected time granularity
rill.runtime.v1.TimeGrain time_grain = 3;

Expand Down
3 changes: 3 additions & 0 deletions runtime/queries/metricsview.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,9 @@ func buildAndOrExpressions(mv *runtimev1.MetricsViewSpec, cond *runtimev1.Condit
if err != nil {
return "", nil, err
}
if strings.TrimSpace(clause) == "" {
continue
}
args = append(args, subArgs...)
clauses = append(clauses, fmt.Sprintf("(%s)", clause))
}
Expand Down
8 changes: 6 additions & 2 deletions runtime/queries/metricsview_aggregation.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,9 @@ func (q *MetricsViewAggregation) buildMetricsAggregationSQL(mv *runtimev1.Metric
if err != nil {
return "", nil, err
}
whereClause += " AND " + clause
if strings.TrimSpace(clause) != "" {
whereClause += " AND " + clause
}
args = append(args, clauseArgs...)
}
if policy != nil && policy.RowFilter != "" {
Expand All @@ -503,7 +505,9 @@ func (q *MetricsViewAggregation) buildMetricsAggregationSQL(mv *runtimev1.Metric
if err != nil {
return "", nil, err
}
havingClause = "HAVING " + havingClause
if strings.TrimSpace(havingClause) != "" {
havingClause = "HAVING " + havingClause
}
args = append(args, havingClauseArgs...)
}

Expand Down
8 changes: 6 additions & 2 deletions runtime/queries/metricsview_comparison_toplist.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,9 @@ func (q *MetricsViewComparison) buildMetricsTopListSQL(mv *runtimev1.MetricsView
if err != nil {
return "", nil, err
}
baseWhereClause += " AND " + clause
if strings.TrimSpace(clause) != "" {
baseWhereClause += " AND " + clause
}

args = append(args, clauseArgs...)
}
Expand All @@ -324,7 +326,9 @@ func (q *MetricsViewComparison) buildMetricsTopListSQL(mv *runtimev1.MetricsView
if err != nil {
return "", nil, err
}
havingClause = "HAVING " + havingClause
if strings.TrimSpace(havingClause) != "" {
havingClause = "HAVING " + havingClause
}
args = append(args, havingClauseArgs...)
}

Expand Down
4 changes: 3 additions & 1 deletion runtime/queries/metricsview_rows.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,9 @@ func (q *MetricsViewRows) buildMetricsRowsSQL(mv *runtimev1.MetricsViewSpec, dia
if err != nil {
return "", nil, err
}
whereClause += " AND " + clause
if strings.TrimSpace(clause) != "" {
whereClause += " AND " + clause
}
args = append(args, clauseArgs...)
}

Expand Down
8 changes: 6 additions & 2 deletions runtime/queries/metricsview_timeseries.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,9 @@ func (q *MetricsViewTimeSeries) buildMetricsTimeseriesSQL(olap drivers.OLAPStore
if err != nil {
return "", "", nil, err
}
whereClause += " AND " + clause
if strings.TrimSpace(clause) != "" {
whereClause += " AND " + clause
}
args = append(args, clauseArgs...)
}

Expand All @@ -308,7 +310,9 @@ func (q *MetricsViewTimeSeries) buildMetricsTimeseriesSQL(olap drivers.OLAPStore
if err != nil {
return "", "", nil, err
}
havingClause = " HAVING " + clause
if strings.TrimSpace(clause) != "" {
havingClause = " HAVING " + clause
}
args = append(args, clauseArgs...)
}

Expand Down
8 changes: 6 additions & 2 deletions runtime/queries/metricsview_toplist.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,9 @@ func (q *MetricsViewToplist) buildMetricsTopListSQL(mv *runtimev1.MetricsViewSpe
if err != nil {
return "", nil, err
}
whereClause += " AND " + clause
if strings.TrimSpace(clause) != "" {
whereClause += " AND " + clause
}
args = append(args, clauseArgs...)
}

Expand All @@ -237,7 +239,9 @@ func (q *MetricsViewToplist) buildMetricsTopListSQL(mv *runtimev1.MetricsViewSpe
if err != nil {
return "", nil, err
}
havingClause = "HAVING " + havingClause
if strings.TrimSpace(havingClause) != "" {
havingClause = " HAVING " + havingClause
}
args = append(args, havingClauseArgs...)
}

Expand Down
4 changes: 3 additions & 1 deletion runtime/queries/metricsview_totals.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ func (q *MetricsViewTotals) buildMetricsTotalsSQL(mv *runtimev1.MetricsViewSpec,
if err != nil {
return "", nil, err
}
whereClause += " AND " + clause
if strings.TrimSpace(clause) != "" {
whereClause += " AND " + clause
}
args = append(args, clauseArgs...)
}

Expand Down
12 changes: 12 additions & 0 deletions web-common/src/components/menu/core/MenuItemData.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export interface MenuItemGroupData {
name: string;
showDivider: boolean;
items: MenuItemData[];
}

export interface MenuItemData {
name: string;
label: string;
selected: boolean;
index: number;
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,16 @@ props as needed.
</div>
</Tooltip>
<SearchableFilterDropdown
let:toggleFloatingElement
on:apply
on:click-outside={toggleFloatingElement}
on:deselect-all
on:escape={toggleFloatingElement}
on:item-clicked
on:search
on:select-all
{selectableItems}
{selectedItems}
selectableGroups={[{ name: "", items: selectableItems }]}
selectedItems={[selectedItems]}
slot="floating-element"
let:toggleFloatingElement
/>
</WithTogglableFloatingElement>
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ props as needed.
<WithTogglableFloatingElement
alignment="start"
distance={8}
let:toggleFloatingElement
let:active
let:toggleFloatingElement
>
<Tooltip
activeDelay={60}
Expand All @@ -70,14 +70,14 @@ props as needed.
>
<!-- TODO: Switch to Measure colors once Theming supports it -->
<Chip
{...defaultChipColors}
{active}
extraRounded={false}
{label}
outline={true}
{active}
{...defaultChipColors}
on:click={toggleFloatingElement}
outline={true}
>
<div slot="body" class="flex gap-x-2">
<div class="flex gap-x-2" slot="body">
<div
class="font-bold text-ellipsis overflow-hidden whitespace-nowrap ml-2"
>
Expand All @@ -100,6 +100,8 @@ props as needed.
</div>
</Tooltip>
<SearchableFilterDropdown
allowMultiSelect={false}
let:toggleFloatingElement
on:apply
on:click-outside={toggleFloatingElement}
on:deselect-all
Expand All @@ -110,10 +112,8 @@ props as needed.
}}
on:search
on:select-all
{selectableItems}
{selectedItems}
allowMultiSelect={false}
selectableGroups={[{ name: "", items: selectableItems }]}
selectedItems={[selectedItems]}
slot="floating-element"
let:toggleFloatingElement
/>
</WithTogglableFloatingElement>
Loading

0 comments on commit ef3b037

Please sign in to comment.