Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Jan 1, 2024
1 parent ddf3cef commit b55ae34
Show file tree
Hide file tree
Showing 6 changed files with 190 additions and 140 deletions.
148 changes: 87 additions & 61 deletions client/dist/js/bundle.js

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

25 changes: 14 additions & 11 deletions client/src/boot/registerTransforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,20 @@ export default () => {
}
);

Injector.transform(
'cms-element-editor',
(updater) => {
// Add GraphQL query for reading elements on a page for the ElementEditor
updater.component(
'ElementList',
readBlocksForAreaQuery,
'PageElements'
);
}
);
const globalUseGraphqQL = false;
if (globalUseGraphqQL) {
Injector.transform(
'cms-element-editor',
(updater) => {
// Add GraphQL query for reading elements on a page for the ElementEditor
updater.component(
'ElementList',
readBlocksForAreaQuery,
'PageElements'
);
}
);
}

Injector.transform(
'cms-element-adder',
Expand Down
5 changes: 5 additions & 0 deletions client/src/components/ElementEditor/AddElementPopover.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,19 @@ import { inject } from 'lib/Injector';
import { elementTypeType } from 'types/elementTypeType';
import i18n from 'i18n';
import backend from 'lib/Backend';
import { ElementEditorContext } from 'components/ElementEditor/ElementEditor';

/**
* The AddElementPopover component used in the context of an ElementEditor shows the
* available elements that can be added to an ElementalArea.
*/
class AddElementPopover extends Component {

constructor(props) {
super(props);

this.handleToggle = this.handleToggle.bind(this);
AddElementPopover.contextType = ElementEditorContext;
}

/**
Expand Down Expand Up @@ -61,6 +64,8 @@ class AddElementPopover extends Component {
})
.then(() => {
// todo call read blocks from area endpoint (areaID)
const { fetchBlocks } = this.context;
fetchBlocks();
})
.then(() => {
const preview = window.jQuery('.cms-preview');
Expand Down
Loading

0 comments on commit b55ae34

Please sign in to comment.