@mwater/visualization 5.3.2 → 5.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ColorComponent.d.ts +1 -1
- package/lib/ColorComponent.js +2 -2
- package/lib/CustomColorsContext.d.ts +0 -1
- package/lib/DateRangeComponent.js +10 -10
- package/lib/LocaleContextInjector.js +2 -2
- package/lib/MWaterAddRelatedFormComponent.js +8 -8
- package/lib/MWaterAddRelatedIndicatorComponent.d.ts +0 -1
- package/lib/MWaterAddRelatedIndicatorComponent.js +6 -6
- package/lib/MWaterAssetSystemsListComponent.d.ts +3 -3
- package/lib/MWaterAssetSystemsListComponent.js +4 -3
- package/lib/MWaterCompleteTableSelectComponent.d.ts +33 -34
- package/lib/MWaterCompleteTableSelectComponent.js +39 -38
- package/lib/MWaterCustomTablesetListComponent.d.ts +3 -3
- package/lib/MWaterCustomTablesetListComponent.js +5 -4
- package/lib/MWaterGlobalFiltersComponent.js +4 -4
- package/lib/MWaterLoaderComponent.d.ts +5 -5
- package/lib/MWaterLoaderComponent.js +1 -1
- package/lib/MWaterMetricsTableListComponent.d.ts +3 -3
- package/lib/MWaterMetricsTableListComponent.js +4 -3
- package/lib/MWaterResponsesFilterComponent.js +4 -4
- package/lib/MWaterTableSelectComponent.d.ts +1 -1
- package/lib/MWaterTableSelectComponent.js +5 -5
- package/lib/PopoverComponent.d.ts +4 -4
- package/lib/UIComponents.d.ts +5 -2
- package/lib/axes/AxisBuilder.js +42 -43
- package/lib/axes/AxisColorEditorComponent.d.ts +4 -4
- package/lib/axes/AxisColorEditorComponent.js +25 -60
- package/lib/axes/AxisComponent.d.ts +2 -3
- package/lib/axes/AxisComponent.js +20 -20
- package/lib/axes/BinsComponent.js +6 -6
- package/lib/axes/CategoryMapComponent.d.ts +2 -1
- package/lib/axes/CategoryMapComponent.js +7 -5
- package/lib/axes/ColorPaletteCollectionComponent.js +3 -3
- package/lib/axes/RangesComponent.js +12 -12
- package/lib/compressJson.js +1 -1
- package/lib/dashboards/DashboardComponent.d.ts +2 -0
- package/lib/dashboards/DashboardComponent.js +15 -8
- package/lib/dashboards/DashboardUtils.js +2 -3
- package/lib/dashboards/DashboardViewComponent.js +4 -4
- package/lib/dashboards/FontStyleEditor.js +8 -8
- package/lib/dashboards/LayoutOptionsComponent.js +101 -74
- package/lib/dashboards/SettingsModalComponent.d.ts +3 -4
- package/lib/dashboards/SettingsModalComponent.js +54 -40
- package/lib/dashboards/WidgetComponent.d.ts +0 -1
- package/lib/dashboards/WidgetComponent.js +1 -2
- package/lib/dashboards/layoutOptions.js +11 -7
- package/lib/datagrids/DatagridComponent.d.ts +1 -8
- package/lib/datagrids/DatagridComponent.js +14 -13
- package/lib/datagrids/DatagridDesignerComponent.js +18 -18
- package/lib/datagrids/DatagridQueryBuilder.d.ts +4 -4
- package/lib/datagrids/DatagridUtils.js +2 -2
- package/lib/datagrids/DatagridViewComponent.js +4 -4
- package/lib/datagrids/ExprCellComponent.js +1 -1
- package/lib/datagrids/FindReplaceModalComponent.js +17 -17
- package/lib/datagrids/OrderBysDesignerComponent.js +2 -2
- package/lib/languages.js +2 -2
- package/lib/layouts/DecoratedBlockComponent.js +2 -2
- package/lib/layouts/blocks/BlocksDisplayComponent.js +13 -13
- package/lib/layouts/blocks/BlocksLayoutManager.d.ts +2 -1
- package/lib/layouts/blocks/ClipboardPaletteItemComponent.js +3 -3
- package/lib/layouts/blocks/HorizontalBlockComponent.js +3 -3
- package/lib/layouts/blocks/blockUtils.js +4 -5
- package/lib/mWaterLoader.js +1 -1
- package/lib/maps/AddLayerComponent.js +13 -13
- package/lib/maps/AdminScopeAndDetailLevelComponent.js +5 -5
- package/lib/maps/BaseLayerDesignerComponent.js +2 -2
- package/lib/maps/BufferLayer.js +7 -7
- package/lib/maps/BufferLayerDesignerComponent.js +8 -8
- package/lib/maps/ChoroplethLayer.js +6 -6
- package/lib/maps/ChoroplethLayerDesigner.js +16 -16
- package/lib/maps/ClusterLayer.js +3 -3
- package/lib/maps/ClusterLayerDesignerComponent.js +5 -5
- package/lib/maps/DetailLevelSelectComponent.d.ts +11 -1
- package/lib/maps/DetailLevelSelectComponent.js +3 -3
- package/lib/maps/DirectMapDataSource.js +1 -2
- package/lib/maps/EditHoverOver.js +7 -5
- package/lib/maps/EditPopupComponent.js +2 -2
- package/lib/maps/GridLayer.js +5 -5
- package/lib/maps/GridLayerDesigner.js +15 -15
- package/lib/maps/LayerSwitcherComponent.js +1 -2
- package/lib/maps/LeafletMapComponent.d.ts +1 -1
- package/lib/maps/LeafletMapComponent.js +1 -1
- package/lib/maps/LegendComponent.js +1 -1
- package/lib/maps/MWaterServerLayer.d.ts +0 -1
- package/lib/maps/MWaterServerLayer.js +1 -1
- package/lib/maps/MapComponent.js +8 -8
- package/lib/maps/MapControlComponent.js +1 -1
- package/lib/maps/MapDesignerComponent.js +16 -16
- package/lib/maps/MapFiltersDesignerComponent.js +2 -2
- package/lib/maps/MapLayerViewDesignerComponent.js +8 -8
- package/lib/maps/MapUtils.js +6 -7
- package/lib/maps/MapViewComponent.js +1 -2
- package/lib/maps/MarkerSymbolSelectComponent.js +3 -3
- package/lib/maps/MarkersLayer.js +6 -7
- package/lib/maps/MarkersLayerDesignerComponent.js +22 -22
- package/lib/maps/PopupFilterJoinsEditComponent.js +4 -4
- package/lib/maps/PopupFilterJoinsUtils.js +2 -3
- package/lib/maps/RasterMapViewComponent.d.ts +3 -3
- package/lib/maps/RasterMapViewComponent.js +4 -4
- package/lib/maps/RegionSelectComponent.d.ts +1 -3
- package/lib/maps/RegionSelectComponent.js +1 -2
- package/lib/maps/ScopeAndDetailLevelComponent.js +3 -3
- package/lib/maps/TileUrlLayer.d.ts +1 -1
- package/lib/maps/TileUrlLayer.js +3 -3
- package/lib/maps/VectorMapViewComponent.js +6 -7
- package/lib/maps/ZoomLevelsComponent.js +5 -5
- package/lib/maps/mapSymbols.d.ts +1 -1
- package/lib/maps/mapSymbols.js +51 -50
- package/lib/maps/mapboxUtils.js +2 -3
- package/lib/maps/maps.d.ts +0 -1
- package/lib/maps/vectorMaps.js +14 -15
- package/lib/memoizedDebounce.js +1 -2
- package/lib/quickfilter/DateExprComponent.d.ts +4 -0
- package/lib/quickfilter/DateExprComponent.js +17 -16
- package/lib/quickfilter/IdArrayQuickfilterComponent.js +1 -1
- package/lib/quickfilter/QuickfilterUtils.js +1 -2
- package/lib/quickfilter/QuickfiltersComponent.d.ts +23 -2
- package/lib/quickfilter/QuickfiltersComponent.js +2 -2
- package/lib/quickfilter/QuickfiltersDesignComponent.js +8 -8
- package/lib/quickfilter/TextLiteralComponent.d.ts +35 -2
- package/lib/quickfilter/TextLiteralComponent.js +6 -6
- package/lib/richtext/DropdownPaletteItem.js +1 -1
- package/lib/richtext/ExprItemsHtmlConverter.js +8 -10
- package/lib/richtext/FontColorPaletteItem.js +7 -7
- package/lib/richtext/ItemsHtmlConverter.js +0 -1
- package/lib/richtext/RichTextComponent.d.ts +1 -0
- package/lib/richtext/RichTextComponent.js +33 -29
- package/lib/valueFormatter.js +18 -19
- package/lib/wellknown.js +2 -3
- package/lib/widgets/IFrameWidgetComponent.d.ts +9 -1
- package/lib/widgets/IFrameWidgetComponent.js +3 -3
- package/lib/widgets/ImageUploaderComponent.js +5 -5
- package/lib/widgets/ImageWidget.js +2 -2
- package/lib/widgets/ImageWidgetComponent.d.ts +9 -1
- package/lib/widgets/ImageWidgetComponent.js +20 -20
- package/lib/widgets/ImagelistCarouselComponent.js +1 -1
- package/lib/widgets/MapWidget.js +2 -2
- package/lib/widgets/MarkdownWidget.d.ts +1 -1
- package/lib/widgets/MarkdownWidget.js +1 -1
- package/lib/widgets/TOCWidget.js +11 -12
- package/lib/widgets/WidgetScopesViewComponent.js +1 -1
- package/lib/widgets/charts/Chart.js +1 -1
- package/lib/widgets/charts/ChartViewComponent.js +9 -9
- package/lib/widgets/charts/ChartWidgetComponent.js +4 -4
- package/lib/widgets/charts/calendar/CalendarChart.js +4 -4
- package/lib/widgets/charts/calendar/CalendarChartDesignerComponent.js +7 -7
- package/lib/widgets/charts/calendar/CalendarChartViewComponent.js +3 -3
- package/lib/widgets/charts/imagemosaic/ImageMosaicChart.d.ts +18 -5
- package/lib/widgets/charts/imagemosaic/ImageMosaicChart.js +3 -4
- package/lib/widgets/charts/imagemosaic/ImageMosaicChartDesignerComponent.js +5 -5
- package/lib/widgets/charts/imagemosaic/ImageMosaicChartViewComponent.d.ts +5 -19
- package/lib/widgets/charts/imagemosaic/ImageMosaicChartViewComponent.js +66 -70
- package/lib/widgets/charts/imagemosaic/ImagePopupComponent.js +1 -1
- package/lib/widgets/charts/layered/LayeredChart.d.ts +1 -1
- package/lib/widgets/charts/layered/LayeredChart.js +9 -9
- package/lib/widgets/charts/layered/LayeredChartCompiler.d.ts +8 -8
- package/lib/widgets/charts/layered/LayeredChartCompiler.js +15 -15
- package/lib/widgets/charts/layered/LayeredChartDesignerComponent.js +33 -33
- package/lib/widgets/charts/layered/LayeredChartLayerDesignerComponent.js +16 -16
- package/lib/widgets/charts/layered/LayeredChartUtils.js +1 -2
- package/lib/widgets/charts/layered/LayeredChartViewComponent.js +4 -4
- package/lib/widgets/charts/pivot/IntersectionDesignerComponent.js +18 -17
- package/lib/widgets/charts/pivot/PivotChart.d.ts +1 -1
- package/lib/widgets/charts/pivot/PivotChart.js +12 -4
- package/lib/widgets/charts/pivot/PivotChartDesignerComponent.d.ts +5 -5
- package/lib/widgets/charts/pivot/PivotChartDesignerComponent.js +10 -10
- package/lib/widgets/charts/pivot/PivotChartLayoutComponent.js +5 -5
- package/lib/widgets/charts/pivot/PivotChartQueryBuilder.d.ts +1 -1
- package/lib/widgets/charts/pivot/PivotChartQueryBuilder.js +5 -6
- package/lib/widgets/charts/pivot/PivotChartUtils.js +11 -12
- package/lib/widgets/charts/pivot/PivotChartViewComponent.js +9 -9
- package/lib/widgets/charts/pivot/SegmentDesignerComponent.d.ts +30 -30
- package/lib/widgets/charts/pivot/SegmentDesignerComponent.js +28 -26
- package/lib/widgets/charts/table/OrderingsComponent.js +2 -2
- package/lib/widgets/charts/table/TableChart.js +3 -3
- package/lib/widgets/charts/table/TableChartDesignerComponent.js +17 -17
- package/lib/widgets/charts/table/TableChartViewComponent.js +3 -3
- package/lib/widgets/text/ExprInsertModalComponent.d.ts +2 -3
- package/lib/widgets/text/ExprInsertModalComponent.js +2 -14
- package/lib/widgets/text/ExprItemEditorComponent.js +4 -4
- package/lib/widgets/text/ExprUpdateModalComponent.d.ts +2 -3
- package/lib/widgets/text/ExprUpdateModalComponent.js +3 -15
- package/lib/widgets/text/TextComponent.js +3 -3
- package/lib/widgets/text/TextWidget.d.ts +1 -1
- package/lib/widgets/text/TextWidgetComponent.js +11 -11
- package/lib/widgets/text/TextWidgetDesign.d.ts +2 -1
- package/lib/widgets/text/TextWidgetDesign.js +1 -2
- package/package.json +3 -3
- package/src/ColorComponent.tsx +2 -2
- package/src/DateRangeComponent.ts +10 -10
- package/src/LocaleContextInjector.tsx +1 -1
- package/src/MWaterAddRelatedFormComponent.ts +7 -7
- package/src/MWaterAddRelatedIndicatorComponent.ts +5 -5
- package/src/MWaterAssetSystemsListComponent.tsx +3 -3
- package/src/MWaterCompleteTableSelectComponent.tsx +36 -35
- package/src/MWaterCustomTablesetListComponent.tsx +4 -4
- package/src/MWaterGlobalFiltersComponent.ts +4 -4
- package/src/MWaterLoaderComponent.ts +1 -1
- package/src/MWaterMetricsTableListComponent.tsx +3 -3
- package/src/MWaterResponsesFilterComponent.ts +6 -6
- package/src/MWaterTableSelectComponent.tsx +6 -7
- package/src/axes/AxisBuilder.ts +42 -44
- package/src/axes/AxisColorEditorComponent.tsx +178 -0
- package/src/axes/AxisComponent.ts +20 -20
- package/src/axes/BinsComponent.tsx +6 -6
- package/src/axes/CategoryMapComponent.ts +10 -10
- package/src/axes/ColorPaletteCollectionComponent.tsx +3 -3
- package/src/axes/RangesComponent.ts +14 -14
- package/src/dashboards/DashboardComponent.tsx +21 -9
- package/src/dashboards/DashboardViewComponent.tsx +3 -3
- package/src/dashboards/FontStyleEditor.tsx +8 -8
- package/src/dashboards/LayoutOptionsComponent.tsx +74 -74
- package/src/dashboards/SettingsModalComponent.tsx +134 -107
- package/src/dashboards/layoutOptions.tsx +5 -1
- package/src/datagrids/DatagridComponent.ts +65 -62
- package/src/datagrids/DatagridDesignerComponent.tsx +17 -17
- package/src/datagrids/DatagridUtils.ts +2 -2
- package/src/datagrids/DatagridViewComponent.ts +3 -3
- package/src/datagrids/ExprCellComponent.ts +1 -1
- package/src/datagrids/FindReplaceModalComponent.ts +13 -13
- package/src/datagrids/OrderBysDesignerComponent.tsx +2 -2
- package/src/globals.d.ts +7 -1
- package/src/languages.ts +2 -2
- package/src/layouts/blocks/BlocksDisplayComponent.tsx +13 -13
- package/src/layouts/blocks/BlocksLayoutManager.ts +3 -2
- package/src/layouts/blocks/ClipboardPaletteItemComponent.ts +3 -3
- package/src/maps/AddLayerComponent.ts +13 -13
- package/src/maps/AdminScopeAndDetailLevelComponent.ts +5 -5
- package/src/maps/BaseLayerDesignerComponent.ts +8 -8
- package/src/maps/BufferLayer.ts +5 -5
- package/src/maps/BufferLayerDesignerComponent.ts +8 -8
- package/src/maps/ChoroplethLayer.ts +3 -3
- package/src/maps/ChoroplethLayerDesigner.tsx +16 -16
- package/src/maps/ClusterLayer.ts +3 -3
- package/src/maps/ClusterLayerDesignerComponent.ts +5 -5
- package/src/maps/DetailLevelSelectComponent.ts +3 -3
- package/src/maps/EditHoverOver.tsx +5 -5
- package/src/maps/EditPopupComponent.ts +2 -2
- package/src/maps/GridLayer.ts +5 -5
- package/src/maps/GridLayerDesigner.tsx +15 -16
- package/src/maps/MWaterServerLayer.ts +1 -1
- package/src/maps/MapComponent.ts +6 -6
- package/src/maps/MapControlComponent.ts +1 -1
- package/src/maps/MapDesignerComponent.tsx +20 -20
- package/src/maps/MapFiltersDesignerComponent.tsx +3 -3
- package/src/maps/MapLayerViewDesignerComponent.ts +9 -9
- package/src/maps/MarkerSymbolSelectComponent.ts +4 -5
- package/src/maps/MarkersLayerDesignerComponent.ts +22 -22
- package/src/maps/PopupFilterJoinsEditComponent.ts +4 -4
- package/src/maps/RasterMapViewComponent.ts +2 -2
- package/src/maps/RegionSelectComponent.ts +1 -2
- package/src/maps/ScopeAndDetailLevelComponent.ts +3 -3
- package/src/maps/TileUrlLayer.tsx +3 -3
- package/src/maps/VectorMapViewComponent.tsx +5 -5
- package/src/maps/ZoomLevelsComponent.ts +6 -6
- package/src/maps/mapSymbols.ts +49 -49
- package/src/maps/vectorMaps.tsx +2 -2
- package/src/quickfilter/DateExprComponent.ts +19 -18
- package/src/quickfilter/IdArrayQuickfilterComponent.ts +1 -1
- package/src/quickfilter/QuickfiltersComponent.ts +1 -1
- package/src/quickfilter/QuickfiltersDesignComponent.tsx +9 -9
- package/src/quickfilter/TextLiteralComponent.ts +4 -4
- package/src/richtext/DropdownPaletteItem.tsx +1 -1
- package/src/richtext/ExprItemsHtmlConverter.ts +8 -10
- package/src/richtext/ItemsHtmlConverter.ts +0 -1
- package/src/richtext/RichTextComponent.tsx +31 -31
- package/src/valueFormatter.ts +14 -14
- package/src/widgets/IFrameWidgetComponent.ts +3 -3
- package/src/widgets/ImageUploaderComponent.tsx +5 -5
- package/src/widgets/ImageWidget.ts +2 -2
- package/src/widgets/ImageWidgetComponent.ts +26 -26
- package/src/widgets/ImagelistCarouselComponent.ts +2 -2
- package/src/widgets/MapWidget.ts +1 -1
- package/src/widgets/MarkdownWidget.ts +1 -1
- package/src/widgets/TOCWidget.ts +13 -14
- package/src/widgets/WidgetScopesViewComponent.ts +1 -1
- package/src/widgets/charts/Chart.ts +1 -1
- package/src/widgets/charts/ChartViewComponent.ts +4 -4
- package/src/widgets/charts/ChartWidgetComponent.tsx +3 -3
- package/src/widgets/charts/calendar/CalendarChart.ts +4 -4
- package/src/widgets/charts/calendar/CalendarChartDesignerComponent.ts +7 -7
- package/src/widgets/charts/calendar/CalendarChartViewComponent.tsx +2 -2
- package/src/widgets/charts/imagemosaic/ImageMosaicChart.ts +25 -8
- package/src/widgets/charts/imagemosaic/ImageMosaicChartDesignerComponent.ts +5 -5
- package/src/widgets/charts/imagemosaic/ImageMosaicChartViewComponent.tsx +128 -0
- package/src/widgets/charts/layered/LayeredChart.ts +9 -9
- package/src/widgets/charts/layered/LayeredChartCompiler.ts +45 -45
- package/src/widgets/charts/layered/LayeredChartDesignerComponent.tsx +39 -39
- package/src/widgets/charts/layered/LayeredChartLayerDesignerComponent.tsx +18 -19
- package/src/widgets/charts/layered/LayeredChartViewComponent.ts +1 -1
- package/src/widgets/charts/pivot/IntersectionDesignerComponent.tsx +22 -23
- package/src/widgets/charts/pivot/PivotChart.ts +15 -5
- package/src/widgets/charts/pivot/PivotChartDesignerComponent.tsx +12 -12
- package/src/widgets/charts/pivot/PivotChartLayoutComponent.tsx +5 -5
- package/src/widgets/charts/pivot/PivotChartQueryBuilder.ts +7 -8
- package/src/widgets/charts/pivot/PivotChartViewComponent.tsx +6 -6
- package/src/widgets/charts/pivot/SegmentDesignerComponent.tsx +30 -30
- package/src/widgets/charts/table/OrderingsComponent.tsx +2 -2
- package/src/widgets/charts/table/TableChart.ts +3 -3
- package/src/widgets/charts/table/TableChartDesignerComponent.ts +16 -16
- package/src/widgets/charts/table/TableChartViewComponent.ts +2 -2
- package/src/widgets/text/{ExprInsertModalComponent.ts → ExprInsertModalComponent.tsx} +18 -20
- package/src/widgets/text/ExprItemEditorComponent.tsx +4 -4
- package/src/widgets/text/{ExprUpdateModalComponent.ts → ExprUpdateModalComponent.tsx} +18 -20
- package/src/widgets/text/TextComponent.tsx +2 -2
- package/src/widgets/text/TextWidgetComponent.tsx +10 -10
- package/src/widgets/text/TextWidgetDesign.ts +3 -1
- package/src/axes/AxisColorEditorComponent.ts +0 -210
- package/src/widgets/charts/imagemosaic/ImageMosaicChartViewComponent.ts +0 -117
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import _ from "lodash"
|
|
2
|
-
import React from "react"
|
|
3
|
-
const R = React.createElement
|
|
4
|
-
import update from "update-object"
|
|
2
|
+
import React, { useMemo } from "react"
|
|
5
3
|
import { languages } from "../languages"
|
|
6
4
|
import * as ui from "@mwater/react-library/lib/bootstrap"
|
|
7
5
|
import { default as ReactSelect } from "react-select"
|
|
@@ -12,6 +10,7 @@ import FiltersDesignerComponent from "../FiltersDesignerComponent"
|
|
|
12
10
|
import { DataSource, Schema } from "@mwater/expressions"
|
|
13
11
|
import { DashboardDesign } from "./DashboardDesign"
|
|
14
12
|
import { GlobalFiltersElementFactoryContext } from "../MWaterContextComponent"
|
|
13
|
+
import produce from "immer"
|
|
15
14
|
|
|
16
15
|
export interface SettingsModalComponentProps {
|
|
17
16
|
onDesignChange: any
|
|
@@ -23,7 +22,7 @@ interface SettingsModalComponentState {
|
|
|
23
22
|
design: DashboardDesign | null
|
|
24
23
|
}
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
/** Popup with settings for dashboard */
|
|
27
26
|
export default class SettingsModalComponent extends React.Component<
|
|
28
27
|
SettingsModalComponentProps,
|
|
29
28
|
SettingsModalComponentState
|
|
@@ -35,7 +34,7 @@ export default class SettingsModalComponent extends React.Component<
|
|
|
35
34
|
}
|
|
36
35
|
}
|
|
37
36
|
|
|
38
|
-
show(design:
|
|
37
|
+
show(design: DashboardDesign) {
|
|
39
38
|
return this.setState({ design })
|
|
40
39
|
}
|
|
41
40
|
|
|
@@ -47,18 +46,9 @@ export default class SettingsModalComponent extends React.Component<
|
|
|
47
46
|
handleCancel = () => {
|
|
48
47
|
return this.setState({ design: null })
|
|
49
48
|
}
|
|
50
|
-
handleDesignChange = (design: any) => {
|
|
51
|
-
return this.setState({ design })
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
handleFiltersChange = (filters: any) => {
|
|
55
|
-
const design = _.extend({}, this.state.design, { filters })
|
|
56
|
-
return this.handleDesignChange(design)
|
|
57
|
-
}
|
|
58
49
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
return this.handleDesignChange(design)
|
|
50
|
+
handleDesignChange = (design: DashboardDesign) => {
|
|
51
|
+
return this.setState({ design })
|
|
62
52
|
}
|
|
63
53
|
|
|
64
54
|
render() {
|
|
@@ -67,104 +57,141 @@ export default class SettingsModalComponent extends React.Component<
|
|
|
67
57
|
return null
|
|
68
58
|
}
|
|
69
59
|
|
|
70
|
-
// Get filterable tables
|
|
71
|
-
const filterableTables = DashboardUtils.getFilterableTables(this.state.design, this.props.schema)
|
|
72
|
-
|
|
73
|
-
const localeOptions = _.map(languages, (language) => {
|
|
74
|
-
return {
|
|
75
|
-
value: language.code,
|
|
76
|
-
label: language.en + " (" + language.name + ")"
|
|
77
|
-
}
|
|
78
|
-
})
|
|
79
|
-
|
|
80
60
|
return (
|
|
81
61
|
<ActionCancelModalComponent
|
|
82
62
|
size="large"
|
|
83
63
|
onCancel={this.handleCancel}
|
|
84
64
|
onAction={this.handleSave}
|
|
85
65
|
>
|
|
86
|
-
<
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
{filterableTables.length > 0 ? (
|
|
93
|
-
<QuickfiltersDesignComponent
|
|
94
|
-
design={this.state.design.quickfilters || []}
|
|
95
|
-
onDesignChange={(design: any) =>
|
|
96
|
-
this.handleDesignChange(update(this.state.design, { quickfilters: { $set: design } }))
|
|
97
|
-
}
|
|
98
|
-
schema={this.props.schema}
|
|
99
|
-
dataSource={this.props.dataSource}
|
|
100
|
-
tables={filterableTables}
|
|
101
|
-
/>
|
|
102
|
-
) : (
|
|
103
|
-
"Nothing to quickfilter. Add widgets to the dashboard"
|
|
104
|
-
)}
|
|
105
|
-
|
|
106
|
-
<h4 style={{ paddingTop: 10 }}>Filters</h4>
|
|
107
|
-
<div className="text-muted">
|
|
108
|
-
Filters are built in to the dashboard and cannot be changed by viewers of the dashboard.
|
|
109
|
-
</div>
|
|
110
|
-
|
|
111
|
-
{filterableTables.length > 0 ? (
|
|
112
|
-
<FiltersDesignerComponent
|
|
113
|
-
schema={this.props.schema}
|
|
114
|
-
dataSource={this.props.dataSource}
|
|
115
|
-
filters={this.state.design.filters}
|
|
116
|
-
onFiltersChange={this.handleFiltersChange}
|
|
117
|
-
filterableTables={filterableTables}
|
|
118
|
-
/>
|
|
119
|
-
) : (
|
|
120
|
-
"Nothing to filter. Add widgets to the dashboard"
|
|
121
|
-
)}
|
|
122
|
-
|
|
123
|
-
<GlobalFiltersElementFactoryContext.Consumer>
|
|
124
|
-
{globalFiltersElementFactory =>
|
|
125
|
-
globalFiltersElementFactory ? (
|
|
126
|
-
<div>
|
|
127
|
-
<h4 style={{ paddingTop: 10 }}>Global Filters</h4>
|
|
128
|
-
{globalFiltersElementFactory({
|
|
129
|
-
schema: this.props.schema,
|
|
130
|
-
dataSource: this.props.dataSource,
|
|
131
|
-
filterableTables,
|
|
132
|
-
globalFilters: this.state.design!.globalFilters || [],
|
|
133
|
-
onChange: this.handleGlobalFiltersChange
|
|
134
|
-
})}
|
|
135
|
-
</div>
|
|
136
|
-
) : undefined
|
|
137
|
-
}
|
|
138
|
-
</GlobalFiltersElementFactoryContext.Consumer>
|
|
139
|
-
|
|
140
|
-
<h4 style={{ paddingTop: 10 }}>Language</h4>
|
|
141
|
-
<div className="text-muted">
|
|
142
|
-
Controls the preferred language of widgets and uses specified language when available
|
|
143
|
-
</div>
|
|
144
|
-
|
|
145
|
-
<ReactSelect
|
|
146
|
-
value={_.findWhere(localeOptions, { value: this.state.design.locale || "en" }) || null}
|
|
147
|
-
options={localeOptions}
|
|
148
|
-
onChange={(locale: any) =>
|
|
149
|
-
this.handleDesignChange(update(this.state.design, { locale: { $set: locale.value } }))
|
|
150
|
-
}
|
|
151
|
-
/>
|
|
152
|
-
|
|
153
|
-
{this.state.design.implicitFiltersEnabled && (
|
|
154
|
-
<>
|
|
155
|
-
<h4 style={{ paddingTop: 10 }}>Advanced</h4>
|
|
156
|
-
<ui.Checkbox
|
|
157
|
-
value={this.state.design.implicitFiltersEnabled != null ? this.state.design.implicitFiltersEnabled : true}
|
|
158
|
-
onChange={(value: boolean) =>
|
|
159
|
-
this.handleDesignChange(update(this.state.design, { implicitFiltersEnabled: { $set: value } }))
|
|
160
|
-
}
|
|
161
|
-
>
|
|
162
|
-
Enable Implicit Filtering (leave unchecked for new dashboards)
|
|
163
|
-
</ui.Checkbox>
|
|
164
|
-
</>
|
|
165
|
-
)}
|
|
166
|
-
</div>
|
|
66
|
+
<SettingsComponent
|
|
67
|
+
design={this.state.design}
|
|
68
|
+
onDesignChange={this.handleDesignChange}
|
|
69
|
+
schema={this.props.schema}
|
|
70
|
+
dataSource={this.props.dataSource}
|
|
71
|
+
/>
|
|
167
72
|
</ActionCancelModalComponent>
|
|
168
73
|
)
|
|
169
74
|
}
|
|
170
75
|
}
|
|
76
|
+
|
|
77
|
+
interface SettingsComponentProps {
|
|
78
|
+
schema: Schema
|
|
79
|
+
dataSource: DataSource
|
|
80
|
+
design: DashboardDesign
|
|
81
|
+
onDesignChange: (design: DashboardDesign) => void
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** Settings component for dashboard that is used in the settings modal */
|
|
85
|
+
function SettingsComponent(props: SettingsComponentProps) {
|
|
86
|
+
const { design, onDesignChange, schema, dataSource } = props
|
|
87
|
+
|
|
88
|
+
// Get filterable tables
|
|
89
|
+
const filterableTables = DashboardUtils.getFilterableTables(design, schema)
|
|
90
|
+
|
|
91
|
+
const localeOptions = useMemo(() => {
|
|
92
|
+
return _.map(languages, (language) => {
|
|
93
|
+
return {
|
|
94
|
+
value: language.code,
|
|
95
|
+
label: language.en + " (" + language.name + ")"
|
|
96
|
+
}
|
|
97
|
+
})
|
|
98
|
+
}, [languages])
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<div style={{ paddingBottom: 200 }}>
|
|
102
|
+
<h4>{T`Quick Filters`}</h4>
|
|
103
|
+
<div className="text-muted">
|
|
104
|
+
{T`Quick filters are shown to the user as a dropdown at the top of the dashboard and can be used to filter data of widgets.`}
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
{filterableTables.length > 0 ? (
|
|
108
|
+
<QuickfiltersDesignComponent
|
|
109
|
+
design={design.quickfilters || []}
|
|
110
|
+
onDesignChange={(quickfilters) => {
|
|
111
|
+
onDesignChange(produce(design, draft => {
|
|
112
|
+
draft.quickfilters = quickfilters
|
|
113
|
+
}))
|
|
114
|
+
}}
|
|
115
|
+
schema={schema}
|
|
116
|
+
dataSource={dataSource}
|
|
117
|
+
tables={filterableTables}
|
|
118
|
+
/>
|
|
119
|
+
) : (
|
|
120
|
+
T`Nothing to quickfilter. Add widgets to the dashboard`
|
|
121
|
+
)}
|
|
122
|
+
|
|
123
|
+
<h4 style={{ paddingTop: 10 }}>{T`Filters`}</h4>
|
|
124
|
+
<div className="text-muted">
|
|
125
|
+
{T`Filters are built in to the dashboard and cannot be changed by viewers of the dashboard.`}
|
|
126
|
+
</div>
|
|
127
|
+
|
|
128
|
+
{filterableTables.length > 0 ? (
|
|
129
|
+
<FiltersDesignerComponent
|
|
130
|
+
schema={schema}
|
|
131
|
+
dataSource={dataSource}
|
|
132
|
+
filters={design.filters}
|
|
133
|
+
onFiltersChange={(filters) => {
|
|
134
|
+
onDesignChange(produce(design, draft => {
|
|
135
|
+
draft.filters = filters
|
|
136
|
+
}))
|
|
137
|
+
}}
|
|
138
|
+
filterableTables={filterableTables}
|
|
139
|
+
/>
|
|
140
|
+
) : (
|
|
141
|
+
T`Nothing to filter. Add widgets to the dashboard`
|
|
142
|
+
)}
|
|
143
|
+
|
|
144
|
+
<GlobalFiltersElementFactoryContext.Consumer>
|
|
145
|
+
{globalFiltersElementFactory =>
|
|
146
|
+
globalFiltersElementFactory ? (
|
|
147
|
+
<div>
|
|
148
|
+
<h4 style={{ paddingTop: 10 }}>{T`Global Filters`}</h4>
|
|
149
|
+
{globalFiltersElementFactory({
|
|
150
|
+
schema,
|
|
151
|
+
dataSource,
|
|
152
|
+
filterableTables,
|
|
153
|
+
globalFilters: design.globalFilters || [],
|
|
154
|
+
onChange: (globalFilters) => {
|
|
155
|
+
onDesignChange(produce(design, draft => {
|
|
156
|
+
draft.globalFilters = globalFilters
|
|
157
|
+
}))
|
|
158
|
+
}
|
|
159
|
+
})}
|
|
160
|
+
</div>
|
|
161
|
+
) : undefined
|
|
162
|
+
}
|
|
163
|
+
</GlobalFiltersElementFactoryContext.Consumer>
|
|
164
|
+
|
|
165
|
+
<h4 style={{ paddingTop: 10 }}>{T`Language`}</h4>
|
|
166
|
+
<div className="text-muted">
|
|
167
|
+
{T`Controls the preferred language of widgets and uses specified language when available`}
|
|
168
|
+
</div>
|
|
169
|
+
|
|
170
|
+
<ReactSelect
|
|
171
|
+
value={_.findWhere(localeOptions, { value: design.locale || "en" }) || null}
|
|
172
|
+
options={localeOptions}
|
|
173
|
+
onChange={(locale: any) =>
|
|
174
|
+
onDesignChange(produce(design, draft => {
|
|
175
|
+
draft.locale = locale.value
|
|
176
|
+
}))
|
|
177
|
+
}
|
|
178
|
+
/>
|
|
179
|
+
|
|
180
|
+
{design.implicitFiltersEnabled && (
|
|
181
|
+
<>
|
|
182
|
+
<h4 style={{ paddingTop: 10 }}>{T`Advanced`}</h4>
|
|
183
|
+
<ui.Checkbox
|
|
184
|
+
value={design.implicitFiltersEnabled != null ? design.implicitFiltersEnabled : true}
|
|
185
|
+
onChange={(value: boolean) =>
|
|
186
|
+
onDesignChange(produce(design, draft => {
|
|
187
|
+
draft.implicitFiltersEnabled = value
|
|
188
|
+
}))
|
|
189
|
+
}
|
|
190
|
+
>
|
|
191
|
+
{T`Enable Implicit Filtering (leave unchecked for new dashboards)`}
|
|
192
|
+
</ui.Checkbox>
|
|
193
|
+
</>
|
|
194
|
+
)}
|
|
195
|
+
</div>
|
|
196
|
+
)
|
|
197
|
+
}
|
|
@@ -508,9 +508,13 @@ ${scope} .mwater-visualization-text-widget-style-footer {
|
|
|
508
508
|
}
|
|
509
509
|
|
|
510
510
|
/** --- Chart styles --- */
|
|
511
|
+
${scope} {
|
|
512
|
+
--chart-text-color: ${layoutOptions.chartFont.color};
|
|
513
|
+
}
|
|
514
|
+
|
|
511
515
|
${scope} .bb text {
|
|
512
516
|
font-size: ${layoutOptions.chartFont.size}px;
|
|
513
|
-
fill:
|
|
517
|
+
fill: var(--chart-text-color);
|
|
514
518
|
font-family: ${expandFontFamily(layoutOptions.chartFont.family)};
|
|
515
519
|
font-weight: ${layoutOptions.chartFont.weight};
|
|
516
520
|
}
|
|
@@ -17,6 +17,7 @@ import FindReplaceModalComponent from "./FindReplaceModalComponent"
|
|
|
17
17
|
import DatagridDataSource from "./DatagridDataSource"
|
|
18
18
|
import { DatagridDesign, JsonQLFilter } from ".."
|
|
19
19
|
import { format as d3Format } from "d3-format"
|
|
20
|
+
import { LocaleContext } from "@mwater/expressions-ui"
|
|
20
21
|
|
|
21
22
|
export interface DatagridComponentProps {
|
|
22
23
|
/** schema to use */
|
|
@@ -39,10 +40,10 @@ export interface DatagridComponentProps {
|
|
|
39
40
|
|
|
40
41
|
/** Check if a value is editable by testing if underlying expression is editable */
|
|
41
42
|
canEditExpr?: (tableId: string, rowId: any, expr: Expr) => Promise<boolean>
|
|
42
|
-
|
|
43
|
+
|
|
43
44
|
/** Update cell values by updating set of expressions and values */
|
|
44
45
|
updateExprValues?: (tableId: string, rowUpdates: RowUpdate[]) => Promise<void>
|
|
45
|
-
|
|
46
|
+
|
|
46
47
|
/** Called when row is clicked with (tableId, rowId) */
|
|
47
48
|
onRowClick?: (tableId: string, rowId: any) => void
|
|
48
49
|
|
|
@@ -109,7 +110,7 @@ export default class DatagridComponent extends React.Component<
|
|
|
109
110
|
}
|
|
110
111
|
|
|
111
112
|
loadRowCount() {
|
|
112
|
-
if(!this.props.design.showNumRows) {
|
|
113
|
+
if (!this.props.design.showNumRows) {
|
|
113
114
|
return
|
|
114
115
|
}
|
|
115
116
|
let filters = this.props.filters || []
|
|
@@ -117,15 +118,15 @@ export default class DatagridComponent extends React.Component<
|
|
|
117
118
|
// Compile quickfilters
|
|
118
119
|
filters = filters.concat(this.getQuickfilterFilters())
|
|
119
120
|
this.props.datagridDataSource.countRows(this.props.design,
|
|
120
|
-
filters,
|
|
121
|
+
filters,
|
|
121
122
|
(error: any, numRows: any) => {
|
|
122
123
|
if (error) {
|
|
123
124
|
console.error(error)
|
|
124
|
-
alert(T
|
|
125
|
+
alert(T`Error loading data`)
|
|
125
126
|
return
|
|
126
127
|
}
|
|
127
128
|
console.log(numRows)
|
|
128
|
-
this.setState({numRows})
|
|
129
|
+
this.setState({ numRows })
|
|
129
130
|
})
|
|
130
131
|
}
|
|
131
132
|
|
|
@@ -163,7 +164,7 @@ export default class DatagridComponent extends React.Component<
|
|
|
163
164
|
if (this.state.cellEditingEnabled) {
|
|
164
165
|
return this.setState({ cellEditingEnabled: false })
|
|
165
166
|
} else {
|
|
166
|
-
if (confirm(T
|
|
167
|
+
if (confirm(T`Turn on cell editing? This will allow you to edit the live data and is an advanced feature.`)) {
|
|
167
168
|
return this.setState({ cellEditingEnabled: true })
|
|
168
169
|
}
|
|
169
170
|
}
|
|
@@ -240,7 +241,7 @@ export default class DatagridComponent extends React.Component<
|
|
|
240
241
|
const label = [
|
|
241
242
|
R("i", { className: this.state.cellEditingEnabled ? "fa fa-fw fa-check-square" : "fa fa-fw fa-square-o" }),
|
|
242
243
|
" ",
|
|
243
|
-
T
|
|
244
|
+
T`Cell Editing`
|
|
244
245
|
]
|
|
245
246
|
|
|
246
247
|
return R(
|
|
@@ -268,7 +269,7 @@ export default class DatagridComponent extends React.Component<
|
|
|
268
269
|
},
|
|
269
270
|
R("span", { className: "fas fa-cog" }),
|
|
270
271
|
" ",
|
|
271
|
-
T
|
|
272
|
+
T`Settings`
|
|
272
273
|
)
|
|
273
274
|
}
|
|
274
275
|
|
|
@@ -284,7 +285,7 @@ export default class DatagridComponent extends React.Component<
|
|
|
284
285
|
className: "btn btn-link btn-sm",
|
|
285
286
|
onClick: () => this.findReplaceModal!.show()
|
|
286
287
|
},
|
|
287
|
-
T
|
|
288
|
+
T`Find/Replace`
|
|
288
289
|
)
|
|
289
290
|
}
|
|
290
291
|
|
|
@@ -295,7 +296,7 @@ export default class DatagridComponent extends React.Component<
|
|
|
295
296
|
R(
|
|
296
297
|
"div",
|
|
297
298
|
{ style: { float: "right" } },
|
|
298
|
-
this.props.design.showNumRows && this.state.numRows ? R("small", {className: 'text-muted text-sm'}, `${d3Format(',')(this.state.numRows)} rows`): undefined,
|
|
299
|
+
this.props.design.showNumRows && this.state.numRows ? R("small", { className: 'text-muted text-sm' }, `${d3Format(',')(this.state.numRows)} rows`) : undefined,
|
|
299
300
|
this.renderFindReplace(),
|
|
300
301
|
this.renderCellEdit(),
|
|
301
302
|
this.renderEditButton(),
|
|
@@ -303,7 +304,7 @@ export default class DatagridComponent extends React.Component<
|
|
|
303
304
|
"a",
|
|
304
305
|
{ key: "refresh", className: "btn btn-link btn-sm", onClick: this.handleRefreshData },
|
|
305
306
|
R("span", { className: "fas fa-sync" }),
|
|
306
|
-
R("span", { className: "hide-600px" },
|
|
307
|
+
R("span", { className: "hide-600px" }, T`Refresh`)
|
|
307
308
|
),
|
|
308
309
|
this.props.extraTitleButtonsElem
|
|
309
310
|
),
|
|
@@ -381,56 +382,58 @@ export default class DatagridComponent extends React.Component<
|
|
|
381
382
|
// Compile quickfilters
|
|
382
383
|
filters = filters.concat(this.getQuickfilterFilters())
|
|
383
384
|
|
|
384
|
-
return R(
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
385
|
+
return R(LocaleContext.Provider, { value: this.props.design.locale || "en" },
|
|
386
|
+
R(
|
|
387
|
+
"div",
|
|
388
|
+
{
|
|
389
|
+
style: {
|
|
390
|
+
width: "100%",
|
|
391
|
+
height: "100%",
|
|
392
|
+
position: "relative",
|
|
393
|
+
paddingTop: 40 + (this.state.quickfiltersHeight || 0)
|
|
394
|
+
}
|
|
395
|
+
},
|
|
396
|
+
this.renderTitleBar(),
|
|
397
|
+
this.renderQuickfilter(),
|
|
398
|
+
|
|
399
|
+
this.renderEditor(),
|
|
400
|
+
this.renderFindReplaceModal(filters),
|
|
401
|
+
|
|
402
|
+
R(AutoSizeComponent, { injectWidth: true, injectHeight: true } as any, (size: any) => {
|
|
403
|
+
// Clean before displaying
|
|
404
|
+
const design = new DatagridUtils(this.props.schema).cleanDesign(this.props.design)
|
|
405
|
+
|
|
406
|
+
if (!new DatagridUtils(this.props.schema).validateDesign(design)) {
|
|
407
|
+
return R(DatagridViewComponent, {
|
|
408
|
+
ref: (view: DatagridViewComponent | null) => {
|
|
409
|
+
this.datagridView = view
|
|
410
|
+
},
|
|
411
|
+
width: size.width - 1, // minus 1 px to test if it solves the jitter with scroll
|
|
412
|
+
height: size.height - 1,
|
|
413
|
+
pageSize: 100,
|
|
414
|
+
schema: this.props.schema,
|
|
415
|
+
dataSource: this.props.dataSource,
|
|
416
|
+
datagridDataSource: this.props.datagridDataSource,
|
|
417
|
+
design,
|
|
418
|
+
filters,
|
|
419
|
+
onDesignChange: this.props.onDesignChange,
|
|
420
|
+
onRowClick: this.props.onRowClick,
|
|
421
|
+
onRowDoubleClick: this.props.onRowDoubleClick,
|
|
422
|
+
canEditExpr: this.state.cellEditingEnabled ? this.props.canEditExpr : undefined,
|
|
423
|
+
updateExprValues: this.state.cellEditingEnabled ? this.props.updateExprValues : undefined,
|
|
424
|
+
refreshKey: this.state.refreshKey
|
|
425
|
+
})
|
|
426
|
+
} else if (this.props.onDesignChange) {
|
|
427
|
+
return R(
|
|
428
|
+
"div",
|
|
429
|
+
{ style: { textAlign: "center", marginTop: size.height / 2 } },
|
|
430
|
+
R("a", { className: "btn btn-link", onClick: this.handleEdit }, T`Click Here to Configure`)
|
|
431
|
+
)
|
|
432
|
+
} else {
|
|
433
|
+
return null
|
|
434
|
+
}
|
|
435
|
+
})
|
|
436
|
+
)
|
|
434
437
|
)
|
|
435
438
|
}
|
|
436
439
|
}
|
|
@@ -68,7 +68,7 @@ export default class DatagridDesignerComponent extends React.Component<DatagridD
|
|
|
68
68
|
tabs: [
|
|
69
69
|
{
|
|
70
70
|
id: "columns",
|
|
71
|
-
label: T
|
|
71
|
+
label: T`Columns`,
|
|
72
72
|
elem: R(ColumnsDesignerComponent, {
|
|
73
73
|
schema: this.props.schema,
|
|
74
74
|
dataSource: this.props.dataSource,
|
|
@@ -79,7 +79,7 @@ export default class DatagridDesignerComponent extends React.Component<DatagridD
|
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
81
|
id: "filter",
|
|
82
|
-
label: T
|
|
82
|
+
label: T`Filter`,
|
|
83
83
|
// Here because of modal scroll issue
|
|
84
84
|
elem: R(
|
|
85
85
|
"div",
|
|
@@ -113,7 +113,7 @@ export default class DatagridDesignerComponent extends React.Component<DatagridD
|
|
|
113
113
|
},
|
|
114
114
|
{
|
|
115
115
|
id: "order",
|
|
116
|
-
label: T
|
|
116
|
+
label: T`Sorting`,
|
|
117
117
|
elem: R(
|
|
118
118
|
"div",
|
|
119
119
|
{ style: { marginBottom: 200 } },
|
|
@@ -128,7 +128,7 @@ export default class DatagridDesignerComponent extends React.Component<DatagridD
|
|
|
128
128
|
},
|
|
129
129
|
{
|
|
130
130
|
id: "quickfilters",
|
|
131
|
-
label: T
|
|
131
|
+
label: T`Quickfilters`,
|
|
132
132
|
elem: R(
|
|
133
133
|
"div",
|
|
134
134
|
{ style: { marginBottom: 200 } },
|
|
@@ -144,7 +144,7 @@ export default class DatagridDesignerComponent extends React.Component<DatagridD
|
|
|
144
144
|
},
|
|
145
145
|
{
|
|
146
146
|
id: "options",
|
|
147
|
-
label: T
|
|
147
|
+
label: T`Options`,
|
|
148
148
|
elem: R(
|
|
149
149
|
"div",
|
|
150
150
|
{ style: { marginBottom: 200 } },
|
|
@@ -162,7 +162,7 @@ export default class DatagridDesignerComponent extends React.Component<DatagridD
|
|
|
162
162
|
return R(
|
|
163
163
|
"div",
|
|
164
164
|
null,
|
|
165
|
-
R("label", null, T
|
|
165
|
+
R("label", null, T`Data Source:`),
|
|
166
166
|
R(TableSelectComponent, {
|
|
167
167
|
schema: this.props.schema,
|
|
168
168
|
value: this.props.design.table,
|
|
@@ -196,7 +196,7 @@ function DatagridOptionsComponent(props: DatagridOptionsComponentProps) {
|
|
|
196
196
|
props.onDesignChange({ ...props.design, showRowNumbers })
|
|
197
197
|
}
|
|
198
198
|
>
|
|
199
|
-
{T
|
|
199
|
+
{T`Show row numbers`}
|
|
200
200
|
</ui.Checkbox>
|
|
201
201
|
<ui.Checkbox
|
|
202
202
|
value={props.design.showNumRows}
|
|
@@ -204,9 +204,9 @@ function DatagridOptionsComponent(props: DatagridOptionsComponentProps) {
|
|
|
204
204
|
props.onDesignChange({ ...props.design, showNumRows })
|
|
205
205
|
}
|
|
206
206
|
>
|
|
207
|
-
{T
|
|
207
|
+
{T`Show number of rows`}
|
|
208
208
|
</ui.Checkbox>
|
|
209
|
-
<ui.FormGroup label={T
|
|
209
|
+
<ui.FormGroup label={T`Language`} hint={T`Preferred language of the datagrid`}>
|
|
210
210
|
<ReactSelect
|
|
211
211
|
value={localeOptions.find(opt => opt.value == (props.design.locale || "en")) || null}
|
|
212
212
|
options={localeOptions}
|
|
@@ -261,7 +261,7 @@ class ColumnsDesignerComponent extends React.Component<ColumnsDesignerComponentP
|
|
|
261
261
|
type: "expr",
|
|
262
262
|
width: 150,
|
|
263
263
|
expr: { type: "id", table: this.props.table },
|
|
264
|
-
label: T
|
|
264
|
+
label: T`Unique Id`
|
|
265
265
|
})
|
|
266
266
|
return this.props.onColumnsChange(columns)
|
|
267
267
|
}
|
|
@@ -327,7 +327,7 @@ class ColumnsDesignerComponent extends React.Component<ColumnsDesignerComponentP
|
|
|
327
327
|
onClick: this.handleAddDefaultColumns
|
|
328
328
|
},
|
|
329
329
|
R("span", { className: "fas fa-plus" }),
|
|
330
|
-
" " + T
|
|
330
|
+
" " + T`Add Default Columns`
|
|
331
331
|
),
|
|
332
332
|
R(
|
|
333
333
|
"button",
|
|
@@ -338,7 +338,7 @@ class ColumnsDesignerComponent extends React.Component<ColumnsDesignerComponentP
|
|
|
338
338
|
onClick: this.handleRemoveAllColumns
|
|
339
339
|
},
|
|
340
340
|
R("span", { className: "fas fa-times" }),
|
|
341
|
-
" " + T
|
|
341
|
+
" " + T`Remove All Columns`
|
|
342
342
|
)
|
|
343
343
|
),
|
|
344
344
|
|
|
@@ -359,7 +359,7 @@ class ColumnsDesignerComponent extends React.Component<ColumnsDesignerComponentP
|
|
|
359
359
|
onClick: this.handleAddColumn
|
|
360
360
|
},
|
|
361
361
|
R("span", { className: "fas fa-plus" }),
|
|
362
|
-
" " + T
|
|
362
|
+
" " + T`Add Column`
|
|
363
363
|
),
|
|
364
364
|
|
|
365
365
|
R(
|
|
@@ -371,7 +371,7 @@ class ColumnsDesignerComponent extends React.Component<ColumnsDesignerComponentP
|
|
|
371
371
|
onClick: this.handleAddIdColumn
|
|
372
372
|
},
|
|
373
373
|
R("span", { className: "fas fa-plus" }),
|
|
374
|
-
" " + T
|
|
374
|
+
" " + T`Add Unique Id (advanced)`
|
|
375
375
|
)
|
|
376
376
|
)
|
|
377
377
|
)
|
|
@@ -468,7 +468,7 @@ class ColumnDesignerComponent extends React.Component<ColumnDesignerComponentPro
|
|
|
468
468
|
"a",
|
|
469
469
|
{ className: "btn btn-sm btn-link", onClick: this.handleSplitEnumset },
|
|
470
470
|
R("i", { className: "fa fa-chain-broken" }),
|
|
471
|
-
" " + T
|
|
471
|
+
" " + T`Split by options`
|
|
472
472
|
)
|
|
473
473
|
break
|
|
474
474
|
case "geometry":
|
|
@@ -476,7 +476,7 @@ class ColumnDesignerComponent extends React.Component<ColumnDesignerComponentPro
|
|
|
476
476
|
"a",
|
|
477
477
|
{ className: "btn btn-sm btn-link", onClick: this.handleSplitGeometry },
|
|
478
478
|
R("i", { className: "fa fa-chain-broken" }),
|
|
479
|
-
" " + T
|
|
479
|
+
" " + T`Split by lat/lng`
|
|
480
480
|
)
|
|
481
481
|
break
|
|
482
482
|
}
|
|
@@ -499,7 +499,7 @@ class ColumnDesignerComponent extends React.Component<ColumnDesignerComponentPro
|
|
|
499
499
|
return R(
|
|
500
500
|
"div",
|
|
501
501
|
{ className: "mb-3" },
|
|
502
|
-
R("label", { className: "text-muted" }, T
|
|
502
|
+
R("label", { className: "text-muted" }, T`Format`),
|
|
503
503
|
": ",
|
|
504
504
|
R(
|
|
505
505
|
"select",
|
|
@@ -50,11 +50,11 @@ export default class DatagridUtils {
|
|
|
50
50
|
|
|
51
51
|
validateDesign(design: DatagridDesign) {
|
|
52
52
|
if (!design.table) {
|
|
53
|
-
return
|
|
53
|
+
return T`Missing table`
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
if (!design.columns || !design.columns[0]) {
|
|
57
|
-
return
|
|
57
|
+
return T`No columns`
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
// Validate column exprs
|