Skip to content

Commit b466f14

Browse files
authored
Use existing boolean transformation and fix dropdown placement (#3328)
1 parent 86e545e commit b466f14

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

src/components/explore/ProportionExplorerView.svelte

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@
131131
$store.productDimensions.normalizationType
132132
);
133133
$: selectAllCategories = $store.activeBuckets.length === bucketOptions.length;
134+
$: showKeySelector = probeKeys && probeKeys.length > 1;
134135
</script>
135136

136137
<style>
@@ -168,15 +169,15 @@
168169
/>
169170
</div>
170171

171-
<div class="body-control-row body-control-row--stretch">
172+
<div class="body-control-row">
172173
<div class="body-control-set">
173174
<label class="body-control-set--label">Metric Type</label>
174175
<ProportionMetricTypeControl
175176
{metricType}
176177
on:selection={makeSelection('metricType')}
177178
/>
178179
</div>
179-
{#if probeKeys && probeKeys.length > 1}
180+
{#if showKeySelector}
180181
<div class="body-control-set">
181182
<label class="body-control-set--label">Key</label>
182183
<ProbeKeySelector options={probeKeys} bind:currentKey />

src/config/glean-base.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export const SUPPORTED_METRICS = [
2929
'labeled_custom_distribution',
3030
'labeled_timing_distribution',
3131
'boolean',
32+
'labeled_boolean',
3233
];
3334

3435
export default {
@@ -92,6 +93,7 @@ export default {
9293
// Common probe view mappings for Glean metrics
9394
probeView: {
9495
boolean: 'categorical',
96+
labeled_boolean: 'categorical',
9597
counter: 'linear',
9698
custom_distribution_exponential: 'log',
9799
custom_distribution_linear: 'linear',
@@ -194,7 +196,7 @@ export default {
194196
let labels = {
195197
...appStore.getState().probe.labels,
196198
};
197-
if (metricType === 'boolean') {
199+
if (metricType === 'boolean' || metricType === 'labeled_boolean') {
198200
const dataAndLabels =
199201
transformBooleanHistogramToCategoricalHistogram(data);
200202
data = dataAndLabels.data;
@@ -254,7 +256,7 @@ export default {
254256
let etc = {};
255257

256258
// filter out true/false aggregate results in boolean metrics. See: https://github.com/mozilla/glam/pull/1525#discussion_r694135079
257-
if (metricType === 'boolean') {
259+
if (metricType === 'boolean' || metricType === 'labeled_boolean') {
258260
// eslint-disable-next-line no-param-reassign
259261
data = data.filter((di) => di.client_agg_type === '');
260262
}

0 commit comments

Comments
 (0)