Skip to content

Commit

Permalink
API Remove GraphQL
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Aug 27, 2024
1 parent 48c64e3 commit 1c9e57d
Show file tree
Hide file tree
Showing 19 changed files with 53 additions and 765 deletions.
29 changes: 0 additions & 29 deletions _config/graphql-legacy.yml

This file was deleted.

21 changes: 0 additions & 21 deletions _config/graphql.yml

This file was deleted.

13 changes: 0 additions & 13 deletions _graphql/config.yml

This file was deleted.

17 changes: 0 additions & 17 deletions _graphql/models.yml

This file was deleted.

2 changes: 1 addition & 1 deletion client/dist/js/TinyMCE_sslink-anchor.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/dist/js/TinyMCE_sslink-internal.js

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

49 changes: 1 addition & 48 deletions client/dist/js/bundle.js

Large diffs are not rendered by default.

25 changes: 0 additions & 25 deletions client/src/boot/registerComponents.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,6 @@
import Injector from 'lib/Injector';
import AnchorSelectorField from 'components/AnchorSelectorField/AnchorSelectorField';
import readOnePageQuery from 'state/history/readOnePageQuery';
import rollbackPageMutation from 'state/history/rollbackPageMutation';

export default () => {
Injector.component.register('AnchorSelectorField', AnchorSelectorField);

Injector.transform(
'pages-history',
(updater) => {
// Add CMS page history GraphQL query to the HistoryViewer
updater.component('HistoryViewer.pages-controller-cms-content', readOnePageQuery, 'PageHistoryViewer');
}
);

Injector.transform(
'pages-history-revert',
(updater) => {
// Add CMS page revert GraphQL mutation to the HistoryViewerToolbar
updater.component(
'HistoryViewerToolbar.VersionedAdmin.HistoryViewer.SiteTree.HistoryViewerVersionDetail',
// This was using `copyToStage` incorrectly which also provides from and to stage
// arguments. The "rollback" mutation correctly handles relations and is a more consumable
// API endpoint.
rollbackPageMutation,
'PageRevertMutation'
);
}
);
};
32 changes: 14 additions & 18 deletions client/src/legacy/TinyMCE_sslink-anchor.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import i18n from 'i18n';
import TinyMCEActionRegistrar from 'lib/TinyMCEActionRegistrar';
import React from 'react';
import { createRoot } from 'react-dom/client';
import { ApolloProvider } from '@apollo/client';
import { Provider } from 'react-redux';
import jQuery from 'jquery';
import ShortcodeSerialiser from 'lib/ShortcodeSerialiser';
Expand Down Expand Up @@ -73,7 +72,6 @@ jQuery.entwine('ss', ($) => {

renderModal(isOpen) {
const store = ss.store;
const client = ss.apolloClient;
const handleHide = () => this.close();
const handleInsert = (...args) => this.handleInsert(...args);
const attrs = this.getOriginalAttributes();
Expand All @@ -87,22 +85,20 @@ jQuery.entwine('ss', ($) => {
this.setReactRoot(root);
}
root.render(
<ApolloProvider client={client}>
<Provider store={store}>
<InsertLinkInternalModal
isOpen={isOpen}
onInsert={handleInsert}
onClosed={handleHide}
title={i18n._t('CMS.LINK_ANCHOR', 'Link to an anchor on a page')}
bodyClassName="modal__dialog"
className="insert-link__dialog-wrapper--anchor"
fileAttributes={attrs}
identifier="Admin.InsertLinkAnchorModal"
requireLinkText={requireLinkText}
currentPageID={currentPageID}
/>
</Provider>
</ApolloProvider>
<Provider store={store}>
<InsertLinkInternalModal
isOpen={isOpen}
onInsert={handleInsert}
onClosed={handleHide}
title={i18n._t('CMS.LINK_ANCHOR', 'Link to an anchor on a page')}
bodyClassName="modal__dialog"
className="insert-link__dialog-wrapper--anchor"
fileAttributes={attrs}
identifier="Admin.InsertLinkAnchorModal"
requireLinkText={requireLinkText}
currentPageID={currentPageID}
/>
</Provider>
);
},

Expand Down
Loading

0 comments on commit 1c9e57d

Please sign in to comment.