diff --git a/frontend/src/metabase/components/LoadingAndErrorWrapper.jsx b/frontend/src/metabase/components/LoadingAndErrorWrapper.jsx index ac74ad40eea53d137af819c07fac8cca236a0b2c..03920fc6879f1c1bb9cadff328814ec14137a937 100644 --- a/frontend/src/metabase/components/LoadingAndErrorWrapper.jsx +++ b/frontend/src/metabase/components/LoadingAndErrorWrapper.jsx @@ -62,11 +62,9 @@ export default class LoadingAndErrorWrapper extends Component { } loadingInterval = () => { - this.cycleLoadingMessage() - } - - cycleLoadingScenes = () => { - + if (this.props.loading) { + this.cycleLoadingMessage() + } } getChildren() { diff --git a/frontend/src/metabase/xray/containers/TableXRay.jsx b/frontend/src/metabase/xray/containers/TableXRay.jsx index 8e98312718d9e82e9ba99664e1f3492e5c613c85..0bd19ac21c39137bdbc735dc55444c06a6049a76 100644 --- a/frontend/src/metabase/xray/containers/TableXRay.jsx +++ b/frontend/src/metabase/xray/containers/TableXRay.jsx @@ -11,7 +11,7 @@ import CostSelect from 'metabase/xray/components/CostSelect' import Constituent from 'metabase/xray/components/Constituent' import { - getTableConstituents, + getConstituents, getFeatures, getLoadingStatus, getError @@ -42,7 +42,7 @@ type Props = { const mapStateToProps = state => ({ xray: getFeatures(state), - constituents: getTableConstituents(state), + constituents: getConstituents(state), isLoading: getLoadingStatus(state), error: getError(state) }) diff --git a/frontend/src/metabase/xray/selectors.js b/frontend/src/metabase/xray/selectors.js index bc0285e7c2ae40298511cba74bbb3647ac5165e7..69e6365b312e34e32cb61e3c624c4aa8124ccfc1 100644 --- a/frontend/src/metabase/xray/selectors.js +++ b/frontend/src/metabase/xray/selectors.js @@ -13,27 +13,11 @@ export const getXray = (state) => export const getFeatures = (state) => state.xray.xray && state.xray.xray.features -/* TODO - these can be collapsed into getConstituents */ -export const getTableConstituents = (state) => { - return state.xray.xray && ( - Object.keys(state.xray.xray.constituents).map(key => - state.xray.xray.constituents[key] - ) - ) -} -export const getSegmentConstituents = (state) => - state.xray.xray && ( - Object.keys(state.xray.xray.constituents).map(key => - state.xray.xray.constituents[key] - ) - ) - -export const getConstituents = (state) => - state.xray.xray && ( - Object.keys(state.xray.xray.constituents).map(key => - state.xray.xray.constituents[key] - ) - ) + +export const getConstituents = createSelector( + [getXray], + (xray) => xray && Object.values(xray.constituents) +) export const getComparison = (state) => state.xray.comparison @@ -123,8 +107,6 @@ export const getTableItem = (state, index = 1) => createSelector( } )(state) -export const getComparisonForField = createSelector - // see if xrays are enabled. unfortunately enabled can equal null so its enabled if its not false export const getXrayEnabled = state => { const enabled = state.settings.values && state.settings.values['enable_xrays']