From 78399879f0432eaf72627754217f7a9b244c071f Mon Sep 17 00:00:00 2001 From: Sabina Talipova Date: Wed, 18 Oct 2023 09:11:49 +1300 Subject: [PATCH] MNT Remove TODO comments --- client/src/components/UploadField/UploadField.js | 1 - .../src/components/UploadField/UploadFieldItem.scss | 1 - client/src/containers/AssetAdmin/AssetAdmin.js | 13 +------------ .../src/containers/Editor/LegacyPopoverField.scss | 1 - client/src/containers/Gallery/Gallery.js | 6 ------ client/src/containers/HistoryList/HistoryItem.js | 1 - client/src/containers/HistoryList/HistoryList.js | 5 +---- client/src/containers/TableView/TableView.js | 1 - client/src/entwine/TinyMCE_ssmedia.js | 4 ---- .../src/entwine/UploadField/UploadFieldEntwine.js | 1 - client/src/state/files/moveFilesMutation.js | 4 ---- client/src/state/gallery/GalleryReducer.js | 2 -- code/Controller/AssetAdmin.php | 5 ----- code/Extensions/RemoteFileModalExtension.php | 3 --- code/Forms/FileFormFactory.php | 1 - tests/behat/src/FixtureContext.php | 2 -- 16 files changed, 2 insertions(+), 49 deletions(-) diff --git a/client/src/components/UploadField/UploadField.js b/client/src/components/UploadField/UploadField.js index 3cb53f31d..b0501915a 100644 --- a/client/src/components/UploadField/UploadField.js +++ b/client/src/components/UploadField/UploadField.js @@ -226,7 +226,6 @@ class UploadField extends Component { return; } - // @todo - Should successful uploads be moved to another state? this.props.actions.uploadField.succeedUpload(this.props.id, file._queuedId, json[0]); } diff --git a/client/src/components/UploadField/UploadFieldItem.scss b/client/src/components/UploadField/UploadFieldItem.scss index 6f40de1f5..b9e364bf8 100644 --- a/client/src/components/UploadField/UploadFieldItem.scss +++ b/client/src/components/UploadField/UploadFieldItem.scss @@ -98,7 +98,6 @@ $uploadfield-item-label-height: 40px; // ACTIONS // Hidden checkbox is controlled via it's label -// @todo - need this? .uploadfield-item__remove-btn { margin: 0; } diff --git a/client/src/containers/AssetAdmin/AssetAdmin.js b/client/src/containers/AssetAdmin/AssetAdmin.js index 824ee0514..4bb24ed71 100644 --- a/client/src/containers/AssetAdmin/AssetAdmin.js +++ b/client/src/containers/AssetAdmin/AssetAdmin.js @@ -283,8 +283,6 @@ class AssetAdmin extends Component { this.handleOpenFile(response.record.id); } - // TODO Update GraphQL store with new model, - // see https://github.com/silverstripe/silverstripe-graphql/issues/14 return this.props.actions.files.readFiles() .then(() => { // open the containing folder, since folder edit mode isn't desired @@ -477,9 +475,6 @@ class AssetAdmin extends Component { */ handleUnpublish(fileIds) { return this.doUnpublish(fileIds).then((response) => { - // TODO Update GraphQL store with new model or update apollo and use new API - // see https://github.com/silverstripe/silverstripe-graphql/issues/14 - // see https://dev-blog.apollodata.com/apollo-clients-new-imperative-store-api-6cb69318a1e3 const { fileId } = this.props; this.props.actions.files.readFiles() .then(() => { @@ -536,8 +531,7 @@ class AssetAdmin extends Component { } handleUpload() { - // TODO Update GraphQL store with new model, - // see https://github.com/silverstripe/silverstripe-graphql/issues/14 + // noop } handleUploadQueue() { @@ -558,7 +552,6 @@ class AssetAdmin extends Component { } handleMoveFilesSuccess(folderId, fileIds) { - // TODO Refactor "queued files" into separate visual area and remove coupling here const files = this.props.queuedFiles.items.filter((file) => ( fileIds.includes(file.id) )); @@ -570,8 +563,6 @@ class AssetAdmin extends Component { }); this.props.actions.gallery.deselectFiles(); - // TODO Update GraphQL store with new model, - // see https://github.com/silverstripe/silverstripe-graphql/issues/14 this.props.actions.files.readFiles(); } @@ -799,7 +790,6 @@ function mapStateToProps(state, ownProps) { const { formSchema } = state.assetAdmin.modal; return { securityId: state.config.SecurityID, - // TODO Refactor "queued files" into separate visual area and remove coupling here queuedFiles: state.assetAdmin.queuedFiles, showSearch: state.assetAdmin.displaySearch.isOpen, type: (formSchema && formSchema.type) || ownProps.type, @@ -812,7 +802,6 @@ function mapDispatchToProps(dispatch) { gallery: bindActionCreators(galleryActions, dispatch), toasts: bindActionCreators(toastsActions, dispatch), displaySearch: bindActionCreators(displaySearchActions, dispatch), - // TODO Refactor "queued files" into separate visual area and remove coupling here queuedFiles: bindActionCreators(queuedFilesActions, dispatch), confirmDeletion: bindActionCreators(confirmDeletionActions, dispatch) }, diff --git a/client/src/containers/Editor/LegacyPopoverField.scss b/client/src/containers/Editor/LegacyPopoverField.scss index 9ea0749c5..9477d0824 100644 --- a/client/src/containers/Editor/LegacyPopoverField.scss +++ b/client/src/containers/Editor/LegacyPopoverField.scss @@ -40,7 +40,6 @@ // Unable to use classes within the popover, so we use elements to style ul { - // TODO remove important by removing nesting of lists padding-left: 0 !important; list-style-type: none; margin-left: -#{$popover-body-padding-x} + 1px; // minus border diff --git a/client/src/containers/Gallery/Gallery.js b/client/src/containers/Gallery/Gallery.js index 601a65935..ce2412f76 100644 --- a/client/src/containers/Gallery/Gallery.js +++ b/client/src/containers/Gallery/Gallery.js @@ -127,19 +127,16 @@ class Gallery extends Component { } if (filters.lastEditedFrom && filters.lastEditedTo) { - // TODO Date localisation messages.push(i18n._t( 'AssetAdmin.SEARCHRESULTSMESSAGEEDITEDBETWEEN', 'last edited between \'{lastEditedFrom}\' and \'{lastEditedTo}\'' )); } else if (filters.lastEditedFrom) { - // TODO Date localisation messages.push(i18n._t( 'AssetAdmin.SEARCHRESULTSMESSAGEEDITEDFROM', 'last edited after \'{lastEditedFrom}\'' )); } else if (filters.lastEditedTo) { - // TODO Date localisation messages.push(i18n._t( 'AssetAdmin.SEARCHRESULTSMESSAGEEDITEDTO', 'last edited before \'{lastEditedTo}\'' @@ -147,7 +144,6 @@ class Gallery extends Component { } if (filters.appCategory) { - // TODO Category name localisation messages.push(i18n._t( 'AssetAdmin.SEARCHRESULTSMESSAGECATEGORY', 'categorised as \'{appCategory}\'' @@ -402,8 +398,6 @@ class Gallery extends Component { this.props.actions.queuedFiles.succeedUpload(fileXhr._queuedId, json[0]); - // TODO Update GraphQL store with new model, - // see https://github.com/silverstripe/silverstripe-graphql/issues/14 if (this.props.onSuccessfulUpload) { this.props.onSuccessfulUpload(json); } diff --git a/client/src/containers/HistoryList/HistoryItem.js b/client/src/containers/HistoryList/HistoryItem.js index 51288e31e..708e6ce7b 100644 --- a/client/src/containers/HistoryList/HistoryItem.js +++ b/client/src/containers/HistoryList/HistoryItem.js @@ -25,7 +25,6 @@ class HistoryItem extends Component { } return ( - // @todo wrap the contents in an `` tag // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
  • { this.api({ diff --git a/client/src/containers/TableView/TableView.js b/client/src/containers/TableView/TableView.js index 2976fdb15..e6cbadca6 100644 --- a/client/src/containers/TableView/TableView.js +++ b/client/src/containers/TableView/TableView.js @@ -131,7 +131,6 @@ class TableView extends Component { columnMetadata: this.getColumnConfig(), useGriddleStyles: false, onRowClick: this.handleRowClick, - // TODO will need to request upstream to stop their internal sorting to show folders first results: this.props.files, customNoDataComponent: this.renderNoItemsNotice, }; diff --git a/client/src/entwine/TinyMCE_ssmedia.js b/client/src/entwine/TinyMCE_ssmedia.js index ea1f5c5e0..e4b86ec82 100644 --- a/client/src/entwine/TinyMCE_ssmedia.js +++ b/client/src/entwine/TinyMCE_ssmedia.js @@ -271,10 +271,6 @@ jQuery.entwine('ss', ($) => { _handleInsert(data, file) { let result = false; this.setData(Object.assign({}, data, file)); - - // Sometimes AssetAdmin.js handleSubmitEditor() can't find the file - // @todo Ensure that we always return a file for any valid ID - // in case of any errors, better to catch them than let them go silent try { let category = null; diff --git a/client/src/entwine/UploadField/UploadFieldEntwine.js b/client/src/entwine/UploadField/UploadFieldEntwine.js index ec0e78208..3d053c6d0 100644 --- a/client/src/entwine/UploadField/UploadFieldEntwine.js +++ b/client/src/entwine/UploadField/UploadFieldEntwine.js @@ -68,7 +68,6 @@ jQuery.entwine('ss', ($) => { const UploadField = this.getComponent(); - // TODO: rework entwine so that react has control of holder let root = this.getReactRoot(); if (!root) { root = createRoot(this.getContainer()); diff --git a/client/src/state/files/moveFilesMutation.js b/client/src/state/files/moveFilesMutation.js index 02003c3af..e82f0588f 100644 --- a/client/src/state/files/moveFilesMutation.js +++ b/client/src/state/files/moveFilesMutation.js @@ -23,10 +23,6 @@ const config = { fileIds, }, update: () => { - // todo: - // Refactor this once Apollo GraphQL adds support - // for invalidating specific queries in the cache. - // Context: https://github.com/silverstripe/silverstripe-asset-admin/issues/809 window.ss.apolloClient.resetStore(); } }), diff --git a/client/src/state/gallery/GalleryReducer.js b/client/src/state/gallery/GalleryReducer.js index c928426b3..aadea114c 100644 --- a/client/src/state/gallery/GalleryReducer.js +++ b/client/src/state/gallery/GalleryReducer.js @@ -12,8 +12,6 @@ const initialState = { concatenateSelect: false, loading: false, /** - * @todo Use lowercase identifiers once we can map them in the silverstripe/graphql module - * * @type {array} sorters */ sorters: [ diff --git a/code/Controller/AssetAdmin.php b/code/Controller/AssetAdmin.php index 63ebdf3c6..94be57162 100644 --- a/code/Controller/AssetAdmin.php +++ b/code/Controller/AssetAdmin.php @@ -310,7 +310,6 @@ public function apiCreateFile(HTTPRequest $request) return null; } - // TODO Allow batch uploads $fileClass = File::get_class_for_file_extension(File::get_file_extension($tmpFile['name'])); /** @var File $file */ $file = Injector::inst()->create($fileClass); @@ -570,8 +569,6 @@ protected function getNameGenerator($filename) } /** - * @todo Implement on client - * * @param bool $unlinked * @return ArrayList */ @@ -899,8 +896,6 @@ public function schema(HTTPRequest $request): HTTPResponse } // Get schema for history form - // @todo Eventually all form scaffolding will be based on context rather than record ID - // See https://github.com/silverstripe/silverstripe-framework/issues/6362 $itemID = $request->param('ItemID'); $version = $request->param('OtherItemID'); $form = $this->getFileHistoryForm([ diff --git a/code/Extensions/RemoteFileModalExtension.php b/code/Extensions/RemoteFileModalExtension.php index 283993258..d2bd74826 100644 --- a/code/Extensions/RemoteFileModalExtension.php +++ b/code/Extensions/RemoteFileModalExtension.php @@ -104,7 +104,6 @@ public function remoteEditFormSchema(HTTPRequest $request) } catch (NetworkException | RequestException | InvalidRemoteUrlException $exception) { $errors = ValidationResult::create() ->addError($exception->getMessage()); - // @todo - Don't create dummy form (pass $form = null) $form = Form::create(null, 'Form', FieldList::create(), FieldList::create()); $code = $exception->getCode(); @@ -121,8 +120,6 @@ public function remoteEditFormSchema(HTTPRequest $request) /** * Generate schema for the given form based on the X-Formschema-Request header value * - * @todo de-dupe this logic with LeftAndMain::getSchemaResponse() - * * @param string $schemaID ID for this schema. Required. * @param Form $form Required for 'state' or 'schema' response * @param ValidationResult $errors Required for 'error' response diff --git a/code/Forms/FileFormFactory.php b/code/Forms/FileFormFactory.php index 23020a033..89975d85c 100644 --- a/code/Forms/FileFormFactory.php +++ b/code/Forms/FileFormFactory.php @@ -216,7 +216,6 @@ protected function getFormFields(RequestHandler $controller = null, $formName, $ $fields->unshift(LiteralField::create('UnembedableMessage', $unembedableMsg)); } } - // @todo move specs to a component/class, so it can update specs when a File is replaced $fields->insertAfter( 'TitleHeader', LiteralField::create('FileSpecs', $this->getSpecsMarkup($record)) diff --git a/tests/behat/src/FixtureContext.php b/tests/behat/src/FixtureContext.php index 7fd16bbdb..2e7656038 100644 --- a/tests/behat/src/FixtureContext.php +++ b/tests/behat/src/FixtureContext.php @@ -89,7 +89,6 @@ public function iShouldSeeTheForm($not, $id, $timeout = 3) */ public function iShouldSeeTheFileStatusFlag() { - // TODO This should wait for any XHRs and React rendering to finish $this->getMainContext()->getSession()->wait( 1000, "window.jQuery && window.jQuery('.editor__status-flag').length > 0" @@ -106,7 +105,6 @@ public function iShouldSeeTheFileStatusFlag() */ public function iShouldNotSeeTheFileStatusFlag() { - // TODO Flakey assertion, since the status flag might not be loaded via XHR yet $page = $this->getMainContext()->getSession()->getPage(); $flag = $page->find('css', '.editor__status-flag'); Assert::assertNull($flag, "File editor status flag should not be present");