From 6f5dce24487fbccfccded16dce11c09a52e8d2f5 Mon Sep 17 00:00:00 2001 From: AliceBalfanz Date: Wed, 12 Aug 2020 19:53:28 +0200 Subject: [PATCH 1/4] fix tooltip flickering - related to issue #12 --- src/renderer/components/ToolButton.tsx | 31 +++-- src/renderer/containers/DataSourcesPanel.tsx | 104 ++++++++++------- src/renderer/containers/LayersPanel.tsx | 70 +++++++----- src/renderer/containers/OperationsPanel.tsx | 37 +++--- src/renderer/containers/PlacemarksPanel.tsx | 113 +++++++++++-------- src/renderer/containers/VariablesPanel.tsx | 5 + src/renderer/containers/WorkspacePanel.tsx | 6 + 7 files changed, 220 insertions(+), 146 deletions(-) diff --git a/src/renderer/components/ToolButton.tsx b/src/renderer/components/ToolButton.tsx index 59f3930..0d2bc95 100644 --- a/src/renderer/components/ToolButton.tsx +++ b/src/renderer/components/ToolButton.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; -import { CSSProperties } from 'react'; -import { AnchorButton, IconName, Intent, PopoverPosition, Tooltip } from '@blueprintjs/core'; +import {CSSProperties} from 'react'; +import {Button, IconName, Intent, Popover, PopoverPosition, Tooltip} from '@blueprintjs/core'; export interface IToolButtonProps { onClick?: () => void; @@ -25,20 +25,27 @@ export function ToolButton(props: IToolButtonProps) { className = `${className} ${props.className}`; } const button = ( - ); if (props.tooltipContent) { return ( - {button} + + + {button} + + ); } else { return button; diff --git a/src/renderer/containers/DataSourcesPanel.tsx b/src/renderer/containers/DataSourcesPanel.tsx index 1d572de..a30e047 100644 --- a/src/renderer/containers/DataSourcesPanel.tsx +++ b/src/renderer/containers/DataSourcesPanel.tsx @@ -1,10 +1,10 @@ import * as React from 'react'; -import { CSSProperties } from 'react'; -import { connect } from 'react-redux'; -import { Cell, Column, Table, TruncatedFormat } from '@blueprintjs/table'; +import {CSSProperties} from 'react'; +import {connect} from 'react-redux'; +import {Cell, Column, Table, TruncatedFormat} from '@blueprintjs/table'; import ReactMarkdown from 'react-markdown'; -import { EcvMeta } from '../ecv-meta'; -import { DataSourceState, DataStoreNotice, DataStoreState, State } from '../state'; +import {EcvMeta} from '../ecv-meta'; +import {DataSourceState, DataStoreNotice, DataStoreState, State} from '../state'; import { AnchorButton, ButtonGroup, @@ -22,19 +22,19 @@ import { Tabs, Tag } from '@blueprintjs/core'; -import { ListBox, ListBoxSelectionMode } from '../components/ListBox'; -import { Card } from '../components/Card'; -import { ScrollablePanelContent } from '../components/ScrollableContent'; -import { ContentWithDetailsPanel } from '../components/ContentWithDetailsPanel'; -import { ToolButton } from '../components/ToolButton'; -import { TextWithLinks } from '../components/TextWithLinks'; +import {ListBox, ListBoxSelectionMode} from '../components/ListBox'; +import {Card} from '../components/Card'; +import {ScrollablePanelContent} from '../components/ScrollableContent'; +import {ContentWithDetailsPanel} from '../components/ContentWithDetailsPanel'; +import {ToolButton} from '../components/ToolButton'; +import {TextWithLinks} from '../components/TextWithLinks'; import DownloadDatasetDialog from './DownloadDataSourceDialog'; import OpenDatasetDialog from './OpenDatasetDialog'; import AddDatasetDialog from './AddDatasetDialog'; import RemoveDatasetDialog from './RemoveDatasetDialog'; import * as actions from '../actions'; import * as selectors from '../selectors'; -import { NO_DATA_SOURCES_FOUND, NO_DATA_STORES_FOUND, NO_LOCAL_DATA_SOURCES } from '../messages'; +import {NO_DATA_SOURCES_FOUND, NO_DATA_STORES_FOUND, NO_LOCAL_DATA_SOURCES} from '../messages'; import _ecvMeta from '../resources/ecv-meta.json'; @@ -206,32 +206,44 @@ class DataSourcesPanel extends React.Component + ); } else { primaryAction = ( - + ); } const actionComponent = ( - - + + {primaryAction} @@ -363,16 +375,22 @@ class DataSourcesPanel extends React.Component - - + + @@ -538,8 +556,8 @@ class DataSourcesList extends React.PureComponent {
{dataSource.id}
) : ( - {title} - )} + {title} + )} ); } diff --git a/src/renderer/containers/LayersPanel.tsx b/src/renderer/containers/LayersPanel.tsx index 15170c0..af83d08 100644 --- a/src/renderer/containers/LayersPanel.tsx +++ b/src/renderer/containers/LayersPanel.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { connect, DispatchProp } from 'react-redux'; +import {connect, DispatchProp} from 'react-redux'; import { ColorMapCategoryState, ImageLayerState, @@ -11,18 +11,18 @@ import { VariableImageLayerState, VariableState } from '../state'; -import { ButtonGroup, Checkbox, Icon, Intent, Label, Radio, RadioGroup, Slider } from '@blueprintjs/core'; -import { ListBox, ListBoxSelectionMode } from '../components/ListBox'; +import {ButtonGroup, Checkbox, Icon, Intent, Label, Radio, RadioGroup, Slider} from '@blueprintjs/core'; +import {ListBox, ListBoxSelectionMode} from '../components/ListBox'; import * as actions from '../actions'; import * as selectors from '../selectors'; -import { ContentWithDetailsPanel } from '../components/ContentWithDetailsPanel'; +import {ContentWithDetailsPanel} from '../components/ContentWithDetailsPanel'; import LayerSourcesDialog from './LayerSourcesDialog'; -import { AUTO_LAYER_ID, getLayerDisplayName, getLayerTypeIconName } from '../state-util'; -import { ScrollablePanelContent } from '../components/ScrollableContent'; -import { ViewState } from '../components/ViewState'; -import { NO_LAYER_SELECTED, NO_LAYERS_EMPTY_VIEW, NO_LAYERS_NO_VIEW } from '../messages'; -import { SubPanelHeader } from '../components/SubPanelHeader'; -import { ToolButton } from '../components/ToolButton'; +import {AUTO_LAYER_ID, getLayerDisplayName, getLayerTypeIconName} from '../state-util'; +import {ScrollablePanelContent} from '../components/ScrollableContent'; +import {ViewState} from '../components/ViewState'; +import {NO_LAYER_SELECTED, NO_LAYERS_EMPTY_VIEW, NO_LAYERS_NO_VIEW} from '../messages'; +import {SubPanelHeader} from '../components/SubPanelHeader'; +import {ToolButton} from '../components/ToolButton'; interface ILayersPanelProps { selectedVariable: VariableState | null, @@ -154,8 +154,8 @@ class LayersPanel extends React.Component= 0 && selectedLayerIndex < layerCount - 1; return ( - - - - + + + + ); diff --git a/src/renderer/containers/OperationsPanel.tsx b/src/renderer/containers/OperationsPanel.tsx index 54a47b6..d62cf0e 100644 --- a/src/renderer/containers/OperationsPanel.tsx +++ b/src/renderer/containers/OperationsPanel.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { connect, DispatchProp } from 'react-redux'; +import {connect, DispatchProp} from 'react-redux'; import { ButtonGroup, Classes, @@ -11,19 +11,19 @@ import { PopoverInteractionKind, Tag } from '@blueprintjs/core'; -import { ContentWithDetailsPanel } from '../components/ContentWithDetailsPanel'; -import { LabelWithType } from '../components/LabelWithType'; -import { ListBox, ListBoxSelectionMode } from '../components/ListBox'; -import { Card } from '../components/Card'; +import {ContentWithDetailsPanel} from '../components/ContentWithDetailsPanel'; +import {LabelWithType} from '../components/LabelWithType'; +import {ListBox, ListBoxSelectionMode} from '../components/ListBox'; +import {Card} from '../components/Card'; import OperationStepDialog from './OperationStepDialog'; -import { OperationInputState, OperationOutputState, OperationState, State, WorkspaceState } from '../state'; +import {OperationInputState, OperationOutputState, OperationState, State, WorkspaceState} from '../state'; import * as actions from '../actions'; import * as selectors from '../selectors'; -import { ScrollablePanelContent } from '../components/ScrollableContent'; -import { NO_OPERATIONS_FOUND } from '../messages'; -import { ToolButton } from '../components/ToolButton'; -import { NEW_OPERATION_STEP_DIALOG_ID } from './operation-step-dialog-ids'; -import { TextWithLinks } from '../components/TextWithLinks'; +import {ScrollablePanelContent} from '../components/ScrollableContent'; +import {NO_OPERATIONS_FOUND} from '../messages'; +import {ToolButton} from '../components/ToolButton'; +import {NEW_OPERATION_STEP_DIALOG_ID} from './operation-step-dialog-ids'; +import {TextWithLinks} from '../components/TextWithLinks'; interface IOperationsPanelProps { @@ -147,12 +147,15 @@ class OperationsPanel extends React.Component - + {canAddStepOperation ? : null}
); diff --git a/src/renderer/containers/PlacemarksPanel.tsx b/src/renderer/containers/PlacemarksPanel.tsx index 14e52bb..9d3c072 100644 --- a/src/renderer/containers/PlacemarksPanel.tsx +++ b/src/renderer/containers/PlacemarksPanel.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { createRef, CSSProperties } from 'react'; +import {createRef, CSSProperties} from 'react'; import { ButtonGroup, Checkbox, @@ -12,23 +12,23 @@ import { Popover, Position } from '@blueprintjs/core'; -import { connect, Dispatch } from 'react-redux'; -import { Placemark, PlacemarkCollection, State } from '../state'; -import { ListBox, ListBoxSelectionMode } from '../components/ListBox'; +import {connect, Dispatch} from 'react-redux'; +import {Placemark, PlacemarkCollection, State} from '../state'; +import {ListBox, ListBoxSelectionMode} from '../components/ListBox'; import * as actions from '../actions'; import * as selectors from '../selectors'; -import { ContentWithDetailsPanel } from '../components/ContentWithDetailsPanel'; +import {ContentWithDetailsPanel} from '../components/ContentWithDetailsPanel'; import LayerSourcesDialog from './LayerSourcesDialog'; -import { ScrollablePanelContent } from '../components/ScrollableContent'; -import { ViewState } from '../components/ViewState'; -import { NO_PLACE_SELECTED, NO_PLACES } from '../messages'; -import { FieldValue } from '../components/field/Field'; -import { TextField } from '../components/field/TextField'; -import { geoJsonToText, geometryGeoJsonToCsv, geometryGeoJsonToGeometryWkt, isBox } from '../../common/geometry-util'; -import { GeometryToolType } from '../components/cesium/geometry-tool'; -import { isBoolean } from '../../common/types'; -import { NumericField, NumericFieldValue } from '../components/field/NumericField'; -import { ToolButton } from '../components/ToolButton'; +import {ScrollablePanelContent} from '../components/ScrollableContent'; +import {ViewState} from '../components/ViewState'; +import {NO_PLACE_SELECTED, NO_PLACES} from '../messages'; +import {FieldValue} from '../components/field/Field'; +import {TextField} from '../components/field/TextField'; +import {geoJsonToText, geometryGeoJsonToCsv, geometryGeoJsonToGeometryWkt, isBox} from '../../common/geometry-util'; +import {GeometryToolType} from '../components/cesium/geometry-tool'; +import {isBoolean} from '../../common/types'; +import {NumericField, NumericFieldValue} from '../components/field/NumericField'; +import {ToolButton} from '../components/ToolButton'; interface IPlacemarksPanelDispatch { @@ -203,38 +203,59 @@ class PlacemarksPanel extends React.Component - - - - - - + + + + + + - + diff --git a/src/renderer/containers/VariablesPanel.tsx b/src/renderer/containers/VariablesPanel.tsx index b5ed262..d758a8b 100644 --- a/src/renderer/containers/VariablesPanel.tsx +++ b/src/renderer/containers/VariablesPanel.tsx @@ -198,21 +198,26 @@ class VariablesPanel extends React.Component ); diff --git a/src/renderer/containers/WorkspacePanel.tsx b/src/renderer/containers/WorkspacePanel.tsx index 39f569a..83f7c59 100644 --- a/src/renderer/containers/WorkspacePanel.tsx +++ b/src/renderer/containers/WorkspacePanel.tsx @@ -323,28 +323,34 @@ class WorkspacePanel extends React.PureComponent {workflowStep ? : null} {isOperationStepSelected From f3d76dedf994772aac79a1064a106b7b2da9ad0a Mon Sep 17 00:00:00 2001 From: AliceBalfanz Date: Thu, 13 Aug 2020 09:24:00 +0200 Subject: [PATCH 2/4] fix tooltip of AddStep #12 --- src/renderer/components/ToolButton.tsx | 4 ++-- src/renderer/containers/OperationsPanel.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/renderer/components/ToolButton.tsx b/src/renderer/components/ToolButton.tsx index 0d2bc95..180a95a 100644 --- a/src/renderer/components/ToolButton.tsx +++ b/src/renderer/components/ToolButton.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import {CSSProperties} from 'react'; -import {Button, IconName, Intent, Popover, PopoverPosition, Tooltip} from '@blueprintjs/core'; +import {AnchorButton, IconName, Intent, Popover, PopoverPosition, Tooltip} from '@blueprintjs/core'; export interface IToolButtonProps { onClick?: () => void; @@ -25,7 +25,7 @@ export function ToolButton(props: IToolButtonProps) { className = `${className} ${props.className}`; } const button = ( -