Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix multiple things in EditHandler #308

Merged
merged 3 commits into from
Sep 30, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions src/BulkManager/BulkAction/EditHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class EditHandler extends Handler
/**
* URL segment used to call this handler
* If none given, @BulkManager will fallback to the Unqualified class name
*
*
* @var string
*/
private static $url_segment = 'edit';
Expand Down Expand Up @@ -53,37 +53,37 @@ class EditHandler extends Handler

/**
* Front-end label for this handler's action
*
*
* @var string
*/
protected $label = 'Edit';

/**
* Front-end icon path for this handler's action.
*
*
* @var string
*/
protected $icon = '';

/**
* Extra classes to add to the bulk action button for this handler
* Can also be used to set the button font-icon e.g. font-icon-trash
*
*
* @var string
*/
protected $buttonClasses = 'font-icon-edit';

/**
* Whether this handler should be called via an XHR from the front-end
*
*
* @var boolean
*/
protected $xhr = false;

/**
* Set to true is this handler will destroy any data.
* A warning and confirmation will be shown on the front-end.
*
*
* @var boolean
*/
protected $destructive = false;
Expand All @@ -107,7 +107,7 @@ public function getI18nLabel()
*/
public function Link($action = null)
{
return Controller::join_links(parent::Link(), $this->stat('url_segment'), $action);
return Controller::join_links(parent::Link(), static::config()->url_segment, $action);
lekoala marked this conversation as resolved.
Show resolved Hide resolved
}

/**
Expand All @@ -129,15 +129,15 @@ public function bulkEditForm()
FormAction::create('doSave', _t('GRIDFIELD_BULKMANAGER_EDIT_HANDLER.SAVE_BTN_LABEL', 'Save all'))
->setAttribute('id', 'bulkEditingSaveBtn')
->addExtraClass('btn btn-success')
->setAttribute('data-icon', 'accept')
// ->setAttribute('data-icon', 'accept')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't comment out code. If it shouldn't be there, remove it entirely.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i commented them because maybe it's possible to find the right attribute to set the proper icons but currently it's not working great as you can see in my screenshot :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you have the time to find out if there's an appropriate attribute and set it, please do it in this PR - otherwise please remove the commented-out code.

->setUseButtonTag(true)
);

$actions->push(
FormAction::create('Cancel', _t('GRIDFIELD_BULKMANAGER_EDIT_HANDLER.CANCEL_BTN_LABEL', 'Cancel'))
->setAttribute('id', 'bulkEditingUpdateCancelBtn')
->addExtraClass('btn btn-danger cms-panel-link')
->setAttribute('data-icon', 'decline')
// ->setAttribute('data-icon', 'decline')
->setAttribute('href', $one_level_up->Link)
->setUseButtonTag(true)
->setAttribute('src', '')//changes type to image so isn't hooked by default actions handlers
Expand Down Expand Up @@ -364,7 +364,7 @@ public function index()
'type' => 'Includes',
'SilverStripe\\Admin\\LeftAndMain_EditForm',
]);
$form->addExtraClass('center cms-content');
$form->addExtraClass('center cms-content flexbox-area-grow fill-height');
$form->setAttribute('data-pjax-fragment', 'CurrentForm Content');

Requirements::javascript('colymba/gridfield-bulk-editing-tools:client/dist/js/main.js');
Expand Down
Loading