File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
src/dataExplorer/components Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -12,13 +12,20 @@ import SelectorTitle from 'src/dataExplorer/components/SelectorTitle'
1212
1313// Context
1414import { FluxQueryBuilderContext } from 'src/dataExplorer/context/fluxQueryBuilder'
15+ import { PersistanceContext } from 'src/dataExplorer/context/persistance'
1516
1617const FLUX_SYNC_TOOLTIP = `Flux Sync autopopulates the script editor to help you \
1718start a query. You can turn this feature on and off, but typing within this \
1819section will disable synchronization.`
1920
21+ const FLUX_SYNC_DISABLE_TEXT = `Schema Sync is no longer available because the \
22+ code block has been edited.`
23+
2024const SchemaBrowserHeading : FC = ( ) => {
2125 const { fluxSync, toggleFluxSync} = useContext ( FluxQueryBuilderContext )
26+ const { selection} = useContext ( PersistanceContext )
27+
28+ const disableToggle : boolean = selection . composition ?. diverged
2229
2330 const handleFluxSyncToggle = ( ) => {
2431 toggleFluxSync ( ! fluxSync )
@@ -37,6 +44,8 @@ const SchemaBrowserHeading: FC = () => {
3744 active = { fluxSync }
3845 onChange = { handleFluxSyncToggle }
3946 testID = "flux-sync--toggle"
47+ disabled = { disableToggle }
48+ tooltipText = { disableToggle ? FLUX_SYNC_DISABLE_TEXT : '' }
4049 />
4150 < InputLabel className = "flux-sync--label" >
4251 < SelectorTitle
You can’t perform that action at this time.
0 commit comments