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 28, 2024
1 parent 6f78dc5 commit a55c7d1
Show file tree
Hide file tree
Showing 88 changed files with 2,794 additions and 4,074 deletions.
24 changes: 14 additions & 10 deletions _config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,27 @@ SilverStripe\Admin\Forms\UsedOnTable:
Name: assetadminthumbnails
---
SilverStripe\Core\Injector\Injector:
# This ThumbnailGenerator is used for upload fields despite its name.
# It generates thumbnails because there aren't expected to be many loaded on any given page load
SilverStripe\AssetAdmin\Model\ThumbnailGenerator.assetadmin:
class: SilverStripe\AssetAdmin\Model\ThumbnailGenerator
properties:
Generates: true
# This ThumbnailGenerator is used for asset admin.
# It doesn't generate thumbnails (other than on upload) because we expect lots of images
# on any given page load.
# Setting `Generates: false` to prevent trying to generate new thumbnails when loading asset admin
# if the thumbnail generation criteria change, because that would massively slow down the CMS.
SilverStripe\AssetAdmin\Model\ThumbnailGenerator.assetadminopen:
class: SilverStripe\AssetAdmin\Model\ThumbnailGenerator
properties:
Generates: false
SilverStripe\AssetAdmin\Controller\AssetAdmin:
properties:
ThumbnailGenerator: '%$SilverStripe\AssetAdmin\Model\ThumbnailGenerator.assetadmin'
SilverStripe\AssetAdmin\Controller\AssetAdminOpen:
properties:
ThumbnailGenerator: '%$SilverStripe\AssetAdmin\Model\ThumbnailGenerator.assetadminopen'
---
Name: assetadminfield
After:
Expand All @@ -47,13 +61,3 @@ Name: assetadminmodals
SilverStripe\Admin\ModalController:
extensions:
- SilverStripe\AssetAdmin\Extensions\RemoteFileModalExtension
---
Name: asset-admin-graphql-thumbnails
Only:
moduleexists: 'silverstripe/graphql'
---
SilverStripe\Core\Injector\Injector:
SilverStripe\AssetAdmin\Model\ThumbnailGenerator.graphql:
class: SilverStripe\AssetAdmin\Model\ThumbnailGenerator
properties:
Generates: false
10 changes: 0 additions & 10 deletions _config/graphql.yml

This file was deleted.

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

This file was deleted.

23 changes: 0 additions & 23 deletions _graphql/interfaces.yml

This file was deleted.

39 changes: 0 additions & 39 deletions _graphql/mutations.yml

This file was deleted.

4 changes: 0 additions & 4 deletions _graphql/queries.yml

This file was deleted.

5 changes: 0 additions & 5 deletions _graphql/types/DescendantFileCount.yml

This file was deleted.

37 changes: 0 additions & 37 deletions _graphql/types/File.yml

This file was deleted.

24 changes: 0 additions & 24 deletions _graphql/types/FileFilterInput.yml

This file was deleted.

7 changes: 0 additions & 7 deletions _graphql/types/FileInput.yml

This file was deleted.

5 changes: 0 additions & 5 deletions _graphql/types/FileUsage.yml

This file was deleted.

40 changes: 0 additions & 40 deletions _graphql/types/Folder.yml

This file was deleted.

7 changes: 0 additions & 7 deletions _graphql/types/FolderInput.yml

This file was deleted.

12 changes: 0 additions & 12 deletions _graphql/types/PublicationNotice.yml

This file was deleted.

11 changes: 0 additions & 11 deletions _graphql/unions.yml

This file was deleted.

31 changes: 1 addition & 30 deletions client/dist/js/TinyMCE_sslink-file.js

Large diffs are not rendered by default.

31 changes: 1 addition & 30 deletions client/dist/js/TinyMCE_ssmedia.js

Large diffs are not rendered by default.

31 changes: 1 addition & 30 deletions client/dist/js/bundle.js

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions client/src/boot/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import AssetAdminRouter from 'containers/AssetAdmin/AssetAdminRouter';
import applyTransform from 'boot/applyTransform';
import registerReducers from 'boot/registerReducers';
import registerComponents from 'boot/registerComponents';
import registerQueries from 'boot/registerQueries';
import { joinUrlPaths } from 'lib/urls';

document.addEventListener('DOMContentLoaded', () => {
Expand Down Expand Up @@ -37,7 +36,5 @@ document.addEventListener('DOMContentLoaded', () => {
],
});

registerQueries();

registerReducers();
});
16 changes: 0 additions & 16 deletions client/src/boot/registerQueries.js

This file was deleted.

10 changes: 8 additions & 2 deletions client/src/components/BulkActions/tests/BulkActions-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ test('BulkActions canApply() shows an action button when canApply returns true',
callback: () => true,
},
],
items: [{ applies: true }]
items: [{ applies: true }],
onClearSelection: () => {},
onSelectAll: () => {},
}}
/>
);
Expand All @@ -59,7 +61,9 @@ test('BulkActions canApply() shows an action button when canApply returns false'
callback: () => true,
},
],
items: [{ applies: false }]
items: [{ applies: false }],
onClearSelection: () => {},
onSelectAll: () => {},
}}
/>
);
Expand All @@ -83,6 +87,8 @@ test('BulkActions getOptionsByValue() should return the option which matches the
},
],
items: [{ applies: true }],
onClearSelection: () => {},
onSelectAll: () => {},
}}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ test('GalleryItem getThumbnailStyles() should return backgroundImage with the co
expect(thumbnail.classList).toContain('gallery-item__thumbnail--small');
});

test('GalleryItem getThumbnailStyles() should return backgroundImage with the correct data-url when thumbnail is included in graphql body', () => {
test('GalleryItem getThumbnailStyles() should return backgroundImage with the correct data-url when thumbnail is included in json response', () => {
const { container } = render(
<GalleryItem {...makeProps({
item: {
Expand Down
12 changes: 4 additions & 8 deletions client/src/components/UploadField/UploadField.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ class UploadField extends Component {
*/
renderDropzone() {
const { AssetDropzone } = this.props;
if (!this.props.data.createFileEndpoint) {
if (!this.props.data.endpoints.createFile) {
return null;
}
const dimensions = {
Expand All @@ -423,8 +423,8 @@ class UploadField extends Component {
const maxFilesize = this.getMaxFilesize();

const dropzoneOptions = {
url: this.props.data.createFileEndpoint.url,
method: this.props.data.createFileEndpoint.method,
url: this.props.data.endpoints.createFile.url,
method: this.props.data.endpoints.createFile.method,
paramName: 'Upload',
maxFiles,
maxFilesize,
Expand Down Expand Up @@ -575,16 +575,12 @@ UploadField.propTypes = {
disabled: PropTypes.bool,
data: PropTypes.shape({
files: PropTypes.arrayOf(fileShape),
createFileEndpoint: PropTypes.shape({
url: PropTypes.string.isRequired,
method: PropTypes.string.isRequired,
payloadFormat: PropTypes.string.isRequired,
}),
multi: PropTypes.bool,
parentid: PropTypes.number,
canUpload: PropTypes.bool,
canAttach: PropTypes.bool,
maxFiles: PropTypes.number,
endpoints: PropTypes.object,
}),
UploadFieldItem: PropTypes.elementType,
AssetDropzone: PropTypes.elementType,
Expand Down
Loading

0 comments on commit a55c7d1

Please sign in to comment.