diff --git a/client/dist/js/bundle.js b/client/dist/js/bundle.js index 4e900982..d0e9de2d 100644 --- a/client/dist/js/bundle.js +++ b/client/dist/js/bundle.js @@ -1015,7 +1015,7 @@ var AddElementPopover = function (_Component) { var popoverClassNames = (0, _classnames2.default)('element-editor-add-element', extraClass); - var globalUseGraphQL = false; + var globalUseGraphQL = true; var buttonOnClickHandler = globalUseGraphQL ? this.getElementButtonClickHandler : this.handleButtonOnClick; var buttons = elementTypes.map(function (elementType) { @@ -2144,8 +2144,8 @@ var ElementEditor = function (_PureComponent) { areaId = _props.areaId; - var globalUseGraphqQL = true; - if (globalUseGraphqQL) { + var globalUseGraphQL = true; + if (globalUseGraphQL) { handleSortBlock(sourceId, afterId, areaId).then(function () { var preview = window.jQuery('.cms-preview'); preview.entwine('ss.preview')._loadUrl(preview.find('iframe').attr('src')); @@ -2327,7 +2327,7 @@ var ElementList = function (_Component) { _createClass(ElementList, [{ key: 'fetchContentBlocks', value: function fetchContentBlocks() { - var globalUseGraphQL = false; + var globalUseGraphQL = true; if (globalUseGraphQL) { return; } @@ -2362,7 +2362,7 @@ var ElementList = function (_Component) { isDraggingOver = _props2.isDraggingOver; - var globalUseGraphQL = false; + var globalUseGraphQL = true; var contentBlocks = globalUseGraphQL ? blocks : this.state.contentBlocks; if (!contentBlocks) { @@ -2422,7 +2422,7 @@ var ElementList = function (_Component) { loading = _props3.loading, LoadingComponent = _props3.LoadingComponent; - var globalUseGraphQL = false; + var globalUseGraphQL = true; var isLoading = globalUseGraphQL ? loading : this.state.isLoading; if (isLoading) { @@ -2435,7 +2435,7 @@ var ElementList = function (_Component) { value: function render() { var blocks = this.props.blocks; - var globalUseGraphQL = false; + var globalUseGraphQL = true; var contentBlocks = globalUseGraphQL ? blocks : this.state.contentBlocks; var listClassNames = (0, _classnames2.default)('elemental-editor-list', { 'elemental-editor-list--empty': !contentBlocks || !contentBlocks.length }); diff --git a/client/src/components/ElementEditor/AddElementPopover.js b/client/src/components/ElementEditor/AddElementPopover.js index f9e6a6ef..358be502 100644 --- a/client/src/components/ElementEditor/AddElementPopover.js +++ b/client/src/components/ElementEditor/AddElementPopover.js @@ -78,7 +78,7 @@ class AddElementPopover extends Component { extraClass ); - const globalUseGraphQL = false; + const globalUseGraphQL = true; const buttonOnClickHandler = globalUseGraphQL ? this.getElementButtonClickHandler : this.handleButtonOnClick; const buttons = elementTypes.map((elementType) => ({ diff --git a/client/src/components/ElementEditor/ElementEditor.js b/client/src/components/ElementEditor/ElementEditor.js index f6e7f550..7cd00aa2 100644 --- a/client/src/components/ElementEditor/ElementEditor.js +++ b/client/src/components/ElementEditor/ElementEditor.js @@ -57,8 +57,8 @@ class ElementEditor extends PureComponent { handleDragEnd(sourceId, afterId) { const { actions: { handleSortBlock }, areaId } = this.props; - const globalUseGraphqQL = true; - if (globalUseGraphqQL) { + const globalUseGraphQL = true; + if (globalUseGraphQL) { // see sortBlockMutation.js for reference handleSortBlock(sourceId, afterId, areaId).then(() => { const preview = window.jQuery('.cms-preview'); diff --git a/client/src/components/ElementEditor/ElementList.js b/client/src/components/ElementEditor/ElementList.js index 2f481b64..9e89e564 100644 --- a/client/src/components/ElementEditor/ElementList.js +++ b/client/src/components/ElementEditor/ElementList.js @@ -25,7 +25,7 @@ class ElementList extends Component { // this will cause a re-render of the component // this callback should be passed to other components via context and get called after doing mutations fetchContentBlocks() { - const globalUseGraphQL = false; + const globalUseGraphQL = true; if (globalUseGraphQL) { return; } @@ -62,7 +62,7 @@ class ElementList extends Component { isDraggingOver, } = this.props; - const globalUseGraphQL = false; + const globalUseGraphQL = true; const contentBlocks = globalUseGraphQL ? blocks : this.state.contentBlocks; // Blocks can be either null or an empty array @@ -121,7 +121,7 @@ class ElementList extends Component { */ renderLoading() { const { loading, LoadingComponent } = this.props; - const globalUseGraphQL = false; + const globalUseGraphQL = true; const isLoading = globalUseGraphQL ? loading : this.state.isLoading; if (isLoading) { @@ -132,7 +132,7 @@ class ElementList extends Component { render() { const { blocks } = this.props; - const globalUseGraphQL = false; + const globalUseGraphQL = true; const contentBlocks = globalUseGraphQL ? blocks : this.state.contentBlocks; const listClassNames = classNames( diff --git a/client/src/state/editor/sortBlockMutation.js b/client/src/state/editor/sortBlockMutation.js index f8300178..07f3dda9 100644 --- a/client/src/state/editor/sortBlockMutation.js +++ b/client/src/state/editor/sortBlockMutation.js @@ -34,6 +34,8 @@ const config = { const variables = readBlocksConfig.options({ areaId }).variables; const cachedData = store.readQuery({ query: readBlocksQuery, variables }); + // store is apollo + // console.log(store); // Query returns a deeply nested object. Explicit reconstruction via spreads is too verbose. // This is an alternative, relatively efficient way to deep clone