Skip to content

Commit c2c6fe7

Browse files
committed
feat: Add tooltip to interactive toggle
1 parent d2b68a6 commit c2c6fe7

6 files changed

Lines changed: 128 additions & 80 deletions

File tree

app/configurator/components/chart-configurator.tsx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { t, Trans } from "@lingui/macro";
22
import {
33
Box,
44
Button,
5+
Tooltip,
56
CircularProgress,
67
IconButton,
78
Menu,
@@ -489,7 +490,23 @@ const InteractiveDataFilterCheckbox = ({
489490
}}
490491
{...props}
491492
control={<Switch checked={checked} onChange={() => toggle()} />}
492-
label={<Trans id="controls.filters.interactive.toggle">Interactive</Trans>}
493+
label={
494+
<Tooltip
495+
enterDelay={600}
496+
arrow
497+
title={
498+
<span>
499+
<Trans id="controls.filters.interactive.tooltip">
500+
Allow users to change filters
501+
</Trans>
502+
</span>
503+
}
504+
>
505+
<Typography variant="caption">
506+
<Trans id="controls.filters.interactive.toggle">Interactive</Trans>
507+
</Typography>
508+
</Tooltip>
509+
}
493510
/>
494511
);
495512
};

app/configurator/components/filters.tsx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,9 +353,20 @@ const MultiFilterContent = ({
353353
componentsProps={{ typography: { variant: "caption" } }}
354354
control={<Switch {...interactiveFilterProps} />}
355355
label={
356-
<Trans id="controls.filters.interactive.toggle">
357-
Interactive
358-
</Trans>
356+
<Tooltip
357+
enterDelay={600}
358+
title={
359+
<span>
360+
<Trans id="controls.filters.interactive.tooltip">
361+
Allow users to change filters
362+
</Trans>
363+
</span>
364+
}
365+
>
366+
<Trans id="controls.filters.interactive.toggle">
367+
Interactive
368+
</Trans>
369+
</Tooltip>
359370
}
360371
/>
361372
) : null}

app/locales/de/messages.po

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ msgstr ""
1313
"Language-Team: \n"
1414
"Plural-Forms: \n"
1515

16-
#: app/configurator/components/chart-configurator.tsx:674
16+
#: app/configurator/components/chart-configurator.tsx:691
1717
msgid "Add filter"
1818
msgstr "Filter hinzufügen"
1919

20-
#: app/configurator/components/chart-configurator.tsx:647
20+
#: app/configurator/components/chart-configurator.tsx:664
2121
msgid "Drag filters to reorganize"
2222
msgstr "Ziehen Sie die Filter per Drag & Drop, um sie neu zu organisieren"
2323

24-
#: app/configurator/components/chart-configurator.tsx:644
24+
#: app/configurator/components/chart-configurator.tsx:661
2525
msgid "Move filter down"
2626
msgstr "Filter nach unten verschieben"
2727

28-
#: app/configurator/components/chart-configurator.tsx:641
28+
#: app/configurator/components/chart-configurator.tsx:658
2929
msgid "Move filter up"
3030
msgstr "Filter nach oben verschieben"
3131

@@ -115,7 +115,7 @@ msgstr "Teilen"
115115
msgid "chart.map.layers.area"
116116
msgstr "Flächen"
117117

118-
#: app/configurator/components/chart-configurator.tsx:727
118+
#: app/configurator/components/chart-configurator.tsx:744
119119
#: app/configurator/components/chart-options-selector.tsx:992
120120
#: app/configurator/components/field-i18n.ts:31
121121
msgid "chart.map.layers.base"
@@ -301,7 +301,7 @@ msgstr "Beschreibung hinzufügen"
301301
msgid "controls.dimensionvalue.none"
302302
msgstr "Kein Filter"
303303

304-
#: app/configurator/components/filters.tsx:417
304+
#: app/configurator/components/filters.tsx:428
305305
msgid "controls.filter.nb-elements"
306306
msgstr "{0} von {1}"
307307

@@ -313,20 +313,25 @@ msgstr "Alle auswählen"
313313
msgid "controls.filter.select.none"
314314
msgstr "Alle abwählen"
315315

316-
#: app/configurator/components/chart-configurator.tsx:492
317-
#: app/configurator/components/filters.tsx:356
316+
#: app/configurator/components/chart-configurator.tsx:506
317+
#: app/configurator/components/filters.tsx:366
318318
msgid "controls.filters.interactive.toggle"
319319
msgstr "Interaktive"
320320

321-
#: app/configurator/components/filters.tsx:398
321+
#: app/configurator/components/chart-configurator.tsx:499
322+
#: app/configurator/components/filters.tsx:360
323+
msgid "controls.filters.interactive.tooltip"
324+
msgstr "Erlauben Sie Benutzern, Filter zu ändern"
325+
326+
#: app/configurator/components/filters.tsx:409
322327
msgid "controls.filters.select.refresh-colors"
323328
msgstr "Farben auffrischen"
324329

325-
#: app/configurator/components/filters.tsx:382
330+
#: app/configurator/components/filters.tsx:393
326331
msgid "controls.filters.select.reset-colors"
327332
msgstr "Farben zurücksetzen"
328333

329-
#: app/configurator/components/filters.tsx:375
334+
#: app/configurator/components/filters.tsx:386
330335
msgid "controls.filters.select.selected-filters"
331336
msgstr "Ausgewählte Filter"
332337

@@ -436,7 +441,7 @@ msgstr "Suche zurücksetzen"
436441
msgid "controls.section.additional-information"
437442
msgstr "Zusätzliche Informationen"
438443

439-
#: app/configurator/components/chart-configurator.tsx:563
444+
#: app/configurator/components/chart-configurator.tsx:580
440445
msgid "controls.section.chart.options"
441446
msgstr "Diagramm-Einstellungen"
442447

@@ -448,7 +453,7 @@ msgstr "Spalten"
448453
msgid "controls.section.columnstyle"
449454
msgstr "Spaltenstil"
450455

451-
#: app/configurator/components/chart-configurator.tsx:581
456+
#: app/configurator/components/chart-configurator.tsx:598
452457
msgid "controls.section.data.filters"
453458
msgstr "Filter"
454459

@@ -506,7 +511,7 @@ msgstr "Tabellenoptionen"
506511
msgid "controls.section.title.warning"
507512
msgstr "Fügen Sie einen Titel oder eine Beschreibung hinzu"
508513

509-
#: app/configurator/components/chart-configurator.tsx:555
514+
#: app/configurator/components/chart-configurator.tsx:572
510515
#: app/configurator/components/chart-type-selector.tsx:131
511516
#: app/configurator/table/table-chart-configurator.tsx:123
512517
msgid "controls.select.chart.type"
@@ -559,16 +564,16 @@ msgstr "Dimension auswählen"
559564
msgid "controls.select.measure"
560565
msgstr "Messwert auswählen"
561566

562-
#: app/configurator/components/filters.tsx:369
563-
#: app/configurator/components/filters.tsx:785
567+
#: app/configurator/components/filters.tsx:380
568+
#: app/configurator/components/filters.tsx:796
564569
msgid "controls.set-filters"
565570
msgstr "Filter bearbeiten"
566571

567-
#: app/configurator/components/filters.tsx:793
572+
#: app/configurator/components/filters.tsx:804
568573
msgid "controls.set-filters-caption"
569574
msgstr "Für beste Ergebnisse wählen Sie nicht mehr als 7 Werte für die Visualisierung aus"
570575

571-
#: app/configurator/components/filters.tsx:832
576+
#: app/configurator/components/filters.tsx:843
572577
msgid "controls.set-values-apply"
573578
msgstr "Filter anwenden"
574579

@@ -942,7 +947,7 @@ msgid "publication.share.mail.subject"
942947
msgstr "visualize.admin.ch"
943948

944949
#: app/configurator/components/dataset-browse.tsx:378
945-
#: app/configurator/components/filters.tsx:802
950+
#: app/configurator/components/filters.tsx:813
946951
msgid "select.controls.filters.search"
947952
msgstr "Suche"
948953

app/locales/en/messages.po

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ msgstr ""
1313
"Language-Team: \n"
1414
"Plural-Forms: \n"
1515

16-
#: app/configurator/components/chart-configurator.tsx:674
16+
#: app/configurator/components/chart-configurator.tsx:691
1717
msgid "Add filter"
1818
msgstr "Add filter"
1919

20-
#: app/configurator/components/chart-configurator.tsx:647
20+
#: app/configurator/components/chart-configurator.tsx:664
2121
msgid "Drag filters to reorganize"
2222
msgstr "Drag filters to reorganize"
2323

24-
#: app/configurator/components/chart-configurator.tsx:644
24+
#: app/configurator/components/chart-configurator.tsx:661
2525
msgid "Move filter down"
2626
msgstr "Move filter down"
2727

28-
#: app/configurator/components/chart-configurator.tsx:641
28+
#: app/configurator/components/chart-configurator.tsx:658
2929
msgid "Move filter up"
3030
msgstr "Move filter up"
3131

@@ -115,7 +115,7 @@ msgstr "Share"
115115
msgid "chart.map.layers.area"
116116
msgstr "Areas"
117117

118-
#: app/configurator/components/chart-configurator.tsx:727
118+
#: app/configurator/components/chart-configurator.tsx:744
119119
#: app/configurator/components/chart-options-selector.tsx:992
120120
#: app/configurator/components/field-i18n.ts:31
121121
msgid "chart.map.layers.base"
@@ -301,7 +301,7 @@ msgstr "Description"
301301
msgid "controls.dimensionvalue.none"
302302
msgstr "No Filter"
303303

304-
#: app/configurator/components/filters.tsx:417
304+
#: app/configurator/components/filters.tsx:428
305305
msgid "controls.filter.nb-elements"
306306
msgstr "{0} of {1}"
307307

@@ -313,20 +313,25 @@ msgstr "Select all"
313313
msgid "controls.filter.select.none"
314314
msgstr "Select none"
315315

316-
#: app/configurator/components/chart-configurator.tsx:492
317-
#: app/configurator/components/filters.tsx:356
316+
#: app/configurator/components/chart-configurator.tsx:506
317+
#: app/configurator/components/filters.tsx:366
318318
msgid "controls.filters.interactive.toggle"
319319
msgstr "Interactive"
320320

321-
#: app/configurator/components/filters.tsx:398
321+
#: app/configurator/components/chart-configurator.tsx:499
322+
#: app/configurator/components/filters.tsx:360
323+
msgid "controls.filters.interactive.tooltip"
324+
msgstr "Allow users to change filters"
325+
326+
#: app/configurator/components/filters.tsx:409
322327
msgid "controls.filters.select.refresh-colors"
323328
msgstr "Refresh colors"
324329

325-
#: app/configurator/components/filters.tsx:382
330+
#: app/configurator/components/filters.tsx:393
326331
msgid "controls.filters.select.reset-colors"
327332
msgstr "Reset colors"
328333

329-
#: app/configurator/components/filters.tsx:375
334+
#: app/configurator/components/filters.tsx:386
330335
msgid "controls.filters.select.selected-filters"
331336
msgstr "Selected filters"
332337

@@ -436,7 +441,7 @@ msgstr "Clear search field"
436441
msgid "controls.section.additional-information"
437442
msgstr "Additional information"
438443

439-
#: app/configurator/components/chart-configurator.tsx:563
444+
#: app/configurator/components/chart-configurator.tsx:580
440445
msgid "controls.section.chart.options"
441446
msgstr "Chart Options"
442447

@@ -448,7 +453,7 @@ msgstr "Columns"
448453
msgid "controls.section.columnstyle"
449454
msgstr "Column Style"
450455

451-
#: app/configurator/components/chart-configurator.tsx:581
456+
#: app/configurator/components/chart-configurator.tsx:598
452457
msgid "controls.section.data.filters"
453458
msgstr "Filters"
454459

@@ -506,7 +511,7 @@ msgstr "Table Options"
506511
msgid "controls.section.title.warning"
507512
msgstr "Please add a title or description."
508513

509-
#: app/configurator/components/chart-configurator.tsx:555
514+
#: app/configurator/components/chart-configurator.tsx:572
510515
#: app/configurator/components/chart-type-selector.tsx:131
511516
#: app/configurator/table/table-chart-configurator.tsx:123
512517
msgid "controls.select.chart.type"
@@ -559,16 +564,16 @@ msgstr "Select a dimension"
559564
msgid "controls.select.measure"
560565
msgstr "Select a measure"
561566

562-
#: app/configurator/components/filters.tsx:369
563-
#: app/configurator/components/filters.tsx:785
567+
#: app/configurator/components/filters.tsx:380
568+
#: app/configurator/components/filters.tsx:796
564569
msgid "controls.set-filters"
565570
msgstr "Edit filters"
566571

567-
#: app/configurator/components/filters.tsx:793
572+
#: app/configurator/components/filters.tsx:804
568573
msgid "controls.set-filters-caption"
569574
msgstr "For best results, do not select more than 7 values in the visualization."
570575

571-
#: app/configurator/components/filters.tsx:832
576+
#: app/configurator/components/filters.tsx:843
572577
msgid "controls.set-values-apply"
573578
msgstr "Apply filters"
574579

@@ -942,7 +947,7 @@ msgid "publication.share.mail.subject"
942947
msgstr "visualize.admin.ch"
943948

944949
#: app/configurator/components/dataset-browse.tsx:378
945-
#: app/configurator/components/filters.tsx:802
950+
#: app/configurator/components/filters.tsx:813
946951
msgid "select.controls.filters.search"
947952
msgstr "Search"
948953

0 commit comments

Comments
 (0)