Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Dec 31, 2023
1 parent 8ed3b94 commit a235e0e
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
14 changes: 7 additions & 7 deletions client/dist/js/bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/src/components/ElementEditor/AddElementPopover.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => ({
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/ElementEditor/ElementEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
8 changes: 4 additions & 4 deletions client/src/components/ElementEditor/ElementList.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand All @@ -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(
Expand Down
2 changes: 2 additions & 0 deletions client/src/state/editor/sortBlockMutation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a235e0e

Please sign in to comment.