Skip to content

Commit

Permalink
Adjsuted plugin handle
Browse files Browse the repository at this point in the history
  • Loading branch information
Mosnar committed Oct 1, 2018
1 parent 4c32d9d commit 926abe6
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 53 deletions.
9 changes: 4 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Bulk Edit Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## 1.0.0 - 2018-07-12
## 1.0.1 - 2018-10-01
### Changed
- Adjusted plugin handle
## 1.0.0 - 2018-10-01
### Added
- Initial release
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "venveo/craft-bulkedit",
"description": "Bulk edit entries",
"type": "craft-plugin",
"version": "1.0.0",
"version": "1.0.1",
"keywords": [
"craft",
"cms",
Expand All @@ -11,8 +11,8 @@
"bulk edit"
],
"support": {
"docs": "https://github.com/venveo/bulk-edit/blob/master/README.md",
"issues": "https://github.com/venveo/bulk-edit/issues"
"docs": "https://github.com/venveo/craft-bulkedit/blob/master/README.md",
"issues": "https://github.com/venveo/craft-bulkedit/issues"
},
"license": "MIT",
"authors": [
Expand All @@ -31,7 +31,7 @@
},
"extra": {
"name": "Bulk Edit",
"handle": "bulkedit",
"handle": "venveo-bulk-edit",
"hasCpSettings": false,
"hasCpSection": false,
"changelogUrl": "https://raw.githubusercontent.com/venveo/craft-bulkedit/master/CHANGELOG.md",
Expand Down
9 changes: 0 additions & 9 deletions src/BulkEdit.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,6 @@
use yii\base\Event;

/**
* Craft plugins are very much like little applications in and of themselves. We’ve made
* it as simple as we can, but the training wheels are off. A little prior knowledge is
* going to be required to write a plugin.
*
* For the purposes of the plugin docs, we’re going to assume that you know PHP and SQL,
* as well as some semi-advanced concepts like object-oriented programming and PHP namespaces.
*
* https://craftcms.com/docs/plugins/introduction
*
* @author Venveo
* @package BulkEdit
* @since 1.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Craft.BulkEditModal = Garnish.Modal.extend(
},

loadFieldEditor: function(fieldIds) {
Craft.postActionRequest('bulkedit/bulk-edit/get-edit-screen', {
Craft.postActionRequest('venveo-bulk-edit/bulk-edit/get-edit-screen', {
elementIds: this.elementIds,
siteId: this.siteId,
requestId: this.requestId,
Expand Down Expand Up @@ -102,7 +102,7 @@ Craft.BulkEditModal = Garnish.Modal.extend(
this._initSpinner();
this.requestId++;

Craft.postActionRequest('bulkedit/bulk-edit/get-fields', {elementIds: elementIds, requestId: this.requestId}, function(response, textStatus) {
Craft.postActionRequest('venveo-bulk-edit/bulk-edit/get-fields', {elementIds: elementIds, requestId: this.requestId}, function(response, textStatus) {
if (textStatus === 'success') {
if (response.success) {
if (response.requestId != this.requestId) {
Expand Down Expand Up @@ -160,7 +160,7 @@ Craft.BulkEditModal = Garnish.Modal.extend(
this.$container.find('.submit').attr('disabled', 'disabled');
this.$container.find('.submit').addClass('disabled')
const formValues = this.$container.find('#bulk-edit-values-modal').serializeArray();
Craft.postActionRequest('bulkedit/bulk-edit/save-context', formValues, function(response) {
Craft.postActionRequest('venveo-bulk-edit/bulk-edit/save-context', formValues, function(response) {
this.hide();
}.bind(this));
},
Expand Down
2 changes: 1 addition & 1 deletion src/assetbundles/bulkeditscreen/BulkEditScreenAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class BulkEditScreenAsset extends AssetBundle
public function init()
{
// define the path that your publishable resources live
$this->sourcePath = "@venveo/bulkedit/assetbundles/bulkeditscreen/dist";
$this->sourcePath = '@venveo/bulkedit/assetbundles/bulkeditscreen/dist';

// define the dependencies
$this->depends = [
Expand Down
33 changes: 11 additions & 22 deletions src/controllers/BulkEditController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,18 @@

namespace venveo\bulkedit\controllers;

use craft\elements\Entry;
use craft\models\EntryType;
use craft\records\FieldLayout;
use Craft;
use craft\records\Element;
use craft\records\Field;
use craft\records\FieldLayoutField;
use craft\records\FieldLayoutTab;
use craft\records\Section;
use craft\records\Section_SiteSettings;
use craft\web\Controller;
use craft\web\Response;
use venveo\bulkedit\assetbundles\bulkeditscreen\BulkEditScreenAsset;
use venveo\bulkedit\BulkEdit as Plugin;

use Craft;
use craft\web\Controller;
use venveo\bulkedit\BulkEdit;
use venveo\bulkedit\BulkEdit as Plugin;
use venveo\bulkedit\queue\jobs\SaveBulkEditJob;
use venveo\bulkedit\records\EditContext;
use venveo\bulkedit\records\History;
use venveo\bulkedit\services\BulkEdit as BulkEditService;
use yii\db\Transaction;
use yii\web\BadRequestHttpException;

/**
Expand Down Expand Up @@ -64,7 +55,7 @@ public function actionGetFields(): Response
$service = Plugin::$plugin->bulkEdit;
$layouts = $service->getFieldLayoutsForElementIds($elementIds);
$view = \Craft::$app->getView();
$modalHtml = $view->renderTemplate('bulkedit/elementactions/BulkEdit/_fields', [
$modalHtml = $view->renderTemplate('venveo-bulk-edit/elementactions/BulkEdit/_fields', [
'layouts' => $layouts,
'bulkedit' => $service,
'elementIds' => $elementIds,
Expand All @@ -85,7 +76,8 @@ public function actionGetFields(): Response
return $this->asJson($responseData);
}

public function actionGetEditScreen(): Response {
public function actionGetEditScreen(): Response
{
$this->requireLogin();
$this->requirePostRequest();
$this->requireAcceptsJson();
Expand Down Expand Up @@ -130,9 +122,7 @@ public function actionGetEditScreen(): Response {
$baseEntry = null;
$view = \Craft::$app->getView();

// $baseElements = BulkEdit::$plugin->bulkEdit->getBaseElementForFieldIds($fieldIds);

$modalHtml = $view->renderTemplate('bulkedit/elementactions/BulkEdit/_edit', [
$modalHtml = $view->renderTemplate('venveo-bulk-edit/elementactions/BulkEdit/_edit', [
'fields' => $fieldModels,
'elementIds' => $elementIds,
'baseElement' => $baseEntry,
Expand All @@ -148,7 +138,6 @@ public function actionGetEditScreen(): Response {
$responseData['footHtml'] = $view->getBodyHtml();

return $this->asJson($responseData);

}

public function actionSaveContext(): Response
Expand All @@ -166,8 +155,8 @@ public function actionSaveContext(): Response
$values = Craft::$app->getRequest()->getBodyParam('fields', []);

$keyedFieldValues = [];
foreach($values as $handle => $value) {
foreach($fields as $field) {
foreach ($values as $handle => $value) {
foreach ($fields as $field) {
if ($field->handle === $handle) {
$fieldId = $field->id;
}
Expand All @@ -186,8 +175,8 @@ public function actionSaveContext(): Response
$context->save();

$rows = [];
foreach($elementIds as $elementId) {
foreach($fieldIds as $fieldId) {
foreach ($elementIds as $elementId) {
foreach ($fieldIds as $fieldId) {
$rows[] = [
'pending',
$context->id,
Expand Down
2 changes: 1 addition & 1 deletion src/queue/jobs/SaveBulkEditJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,6 @@ public function execute($queue = null)

protected function defaultDescription(): string
{
return Craft::t('bulkedit', 'Bulk Edit in progress by {name}', ['name' => $this->context->owner->firstName]);
return Craft::t('venveo-bulk-edit', 'Bulk Edit in progress by {name}', ['name' => $this->context->owner->firstName]);
}
}
8 changes: 0 additions & 8 deletions src/translations/en/bulk-edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,9 @@
*/

/**
* Bulk Edit en Translation
*
* Returns an array with the string to be translated (as passed to `Craft::t('bulk-edit', '...')`) as
* the key, and the translation as the value.
*
* http://www.yiiframework.com/doc-2.0/guide-tutorial-i18n.html
*
* @author Venveo
* @package BulkEdit
* @since 1.0.0
*/
return [
'Bulk Edit plugin loaded' => 'Bulk Edit plugin loaded',
];

0 comments on commit 926abe6

Please sign in to comment.