-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug fixes and bring the project up to standard
- Loading branch information
Showing
27 changed files
with
1,869 additions
and
1,212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace Bloomreach\Feed\Block\Adminhtml\System\Config; | ||
|
||
/** | ||
* Adminhtml "Attribute Name Mappings" field | ||
*/ | ||
class AttrNameMappings extends \Magento\Config\Block\System\Config\Form\Field\FieldArray\AbstractFieldArray | ||
{ | ||
/** | ||
* Prepare to render | ||
* | ||
* @return void | ||
*/ | ||
protected function _prepareToRender() | ||
{ | ||
$this->addColumn( | ||
'source_attribute', | ||
[ | ||
'label' => __('Source Attribute'), | ||
'class' => 'required-entry admin__control-text' | ||
] | ||
); | ||
$this->addColumn( | ||
'target_attributes', | ||
[ | ||
'label' => __('Target Attributes'), | ||
'class' => 'required-entry admin__control-text' | ||
] | ||
); | ||
$this->_addAfter = false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<?php | ||
|
||
namespace Bloomreach\Feed\Block\Adminhtml\System\Config; | ||
|
||
use Magento\Backend\Block\Template\Context; | ||
use Magento\Config\Block\System\Config\Form\Field; | ||
use Magento\Framework\Data\Form\Element\AbstractElement; | ||
use Magento\Integration\Model\Oauth\TokenFactory; | ||
use Magento\Backend\Model\Auth\Session as AdminSession; | ||
|
||
class SubmitProductsHistory extends Field | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected $_template = 'Bloomreach_Feed::system/config/history.phtml'; | ||
|
||
/** @var TokenFactory */ | ||
private $tokenFactory; | ||
|
||
/** @var AdminSession */ | ||
private $adminSession; | ||
|
||
|
||
/** | ||
* Button constructor. | ||
* @param Context $context | ||
* @param array $data | ||
*/ | ||
public function __construct( | ||
Context $context, | ||
TokenFactory $tokenFactory, | ||
AdminSession $adminSession, | ||
array $data = [] | ||
) { | ||
parent::__construct($context, $data); | ||
|
||
$this->tokenFactory = $tokenFactory; | ||
$this->adminSession = $adminSession; | ||
} | ||
|
||
/** | ||
* Remove scope label | ||
* | ||
* @param AbstractElement $element | ||
* @return string | ||
*/ | ||
public function render(AbstractElement $element) | ||
{ | ||
$element->setData('scope', null); | ||
return parent::render($element); | ||
} | ||
|
||
/** | ||
* Render button HTML | ||
* | ||
* @param AbstractElement $element | ||
* @return string | ||
*/ | ||
public function _getElementHtml(AbstractElement $element) | ||
{ | ||
return $this->_toHtml(); | ||
} | ||
|
||
public function getToken() | ||
{ | ||
$token = $this->tokenFactory->create() | ||
->createAdminToken($this->adminSession->getUser()->getId()); | ||
|
||
return $token->getToken(); | ||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.