From dcdab222e2450f012310428502fcb757b4bd466d Mon Sep 17 00:00:00 2001 From: Raissa North Date: Wed, 17 Jan 2018 11:19:19 +1300 Subject: [PATCH] FIX Update editorconfig to apply to composer.json, update spacing in composer.json, make comment for initRequest() clearer --- .editorconfig | 9 +++++- README.md | 2 +- composer.json | 39 +++++++++++++++-------- src/Forms/GridFieldQueuedExportButton.php | 2 +- src/Jobs/GenerateCSVJob.php | 5 +-- 5 files changed, 38 insertions(+), 19 deletions(-) diff --git a/.editorconfig b/.editorconfig index 47ae637..3ef7d71 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,8 +10,15 @@ indent_style = space insert_final_newline = true trim_trailing_whitespace = true -[{*.yml,package.json}] +[*.md] +trim_trailing_whitespace = false + +[*.{yml,js,json,css,scss,feature}] indent_size = 2 +indent_style = space + +[composer.json] +indent_size = 4 # The indent size used in the package.json file cannot be changed: # https://github.com/npm/npm/pull/3180#issuecomment-16336516 diff --git a/README.md b/README.md index a1391b2..f0e7396 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ when more than 1000 records need to be exported. The module should be able to ex **Note:** For SilverStripe 3.x, please use the [1.x release line](https://github.com/silverstripe/silverstripe-gridfieldqueuedexport/tree/1.0). -## Installation via Composer +## Installation To install run `composer require silverstripe/gridfieldqueuedexport`. diff --git a/composer.json b/composer.json index 56d61c3..b44bae0 100644 --- a/composer.json +++ b/composer.json @@ -1,21 +1,32 @@ { - "name": "silverstripe/gridfieldqueuedexport", - "description": "Export large data sets from your GridField in the SilverStripe CMS interface through async jobs", - "type": "silverstripe-vendormodule", - "keywords": ["silverstripe", "queuedjobs", "export", "csv", "gridfield", "cwp"], - "license": "BSD-3-Clause", - "minimum-stability": "dev", - "require": { - "silverstripe/framework": "^4", + "name": "silverstripe/gridfieldqueuedexport", + "description": "Export large data sets from your GridField in the SilverStripe CMS interface through async jobs", + "type": "silverstripe-vendormodule", + "keywords": [ + "silverstripe", + "queuedjobs", + "export", + "csv", + "gridfield", + "cwp" + ], + "license": "BSD-3-Clause", + "minimum-stability": "dev", + "require": { + "silverstripe/framework": "^4", "symbiote/silverstripe-queuedjobs": "^4" - }, - "extra": { + }, + "require-dev": { + "phpunit/phpunit": "^5.7", + "squizlabs/php_codesniffer": "^3.0" + }, + "extra": { "expose": [ "client" ], - "branch-alias": { - "dev-master": "2.x-dev" - } - } + "branch-alias": { + "dev-master": "2.x-dev" + } + } } diff --git a/src/Forms/GridFieldQueuedExportButton.php b/src/Forms/GridFieldQueuedExportButton.php index 312e46e..d26148c 100644 --- a/src/Forms/GridFieldQueuedExportButton.php +++ b/src/Forms/GridFieldQueuedExportButton.php @@ -203,7 +203,7 @@ public function checkExport($gridField, $request = null) } } elseif ($job->JobStatus == QueuedJob::STATUS_BROKEN) { $data->ErrorMessage = _t( - 'SilverStripe\\GridfieldQueuedExport\\GridFieldQueuedExportButton.ERROR_GENERAL', + __CLASS__.'.ERROR_GENERAL', 'Sorry, but there was an error exporting the CSV' ); } elseif ($job->JobStatus == QueuedJob::STATUS_CANCELLED) { diff --git a/src/Jobs/GenerateCSVJob.php b/src/Jobs/GenerateCSVJob.php index 16fe038..00374c4 100644 --- a/src/Jobs/GenerateCSVJob.php +++ b/src/Jobs/GenerateCSVJob.php @@ -270,8 +270,9 @@ public function setup() } /** - * Normally Director::handleRequest will register an HTTPRequest service. If that hasn't happened yet, we will - * register one instead. Also register a new controller if one hasn't been pushed yet. + * Normally Director::handleRequest will register an HTTPRequest service (when routing via frontend controllers). + * If that hasn't happened yet, we will register one instead (e.g. for unit testing, or when running from the command + * line). Also register a new controller if one hasn't been pushed yet. */ protected function initRequest() {