-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/v103.4.0' into 'master'
release/v103.4.0 into master See merge request agence-dnd/marketplace/magento-2/external/magento2-connector-community!78
- Loading branch information
Showing
41 changed files
with
1,485 additions
and
234 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
declare(strict_types = 1); | ||
|
||
namespace Akeneo\Connector\Api\Data; | ||
|
||
/** | ||
* @author Agence Dn'D <[email protected]> | ||
* @copyright 2004-present Agence Dn'D | ||
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
* @link https://www.dnd.fr/ | ||
*/ | ||
interface AttributeTypeInterface | ||
{ | ||
public const PIM_CATALOG_IDENTIFIER = 'pim_catalog_identifier'; | ||
public const PIM_CATALOG_TEXT = 'pim_catalog_text'; | ||
public const PIM_CATALOG_TEXTAREA = 'pim_catalog_textarea'; | ||
public const PIM_CATALOG_SIMPLESELECT = 'pim_catalog_simpleselect'; | ||
public const PIM_CATALOG_MULTISELECT = 'pim_catalog_multiselect'; | ||
public const PIM_CATALOG_BOOLEAN = 'pim_catalog_boolean'; | ||
public const PIM_CATALOG_DATE = 'pim_catalog_date'; | ||
public const PIM_CATALOG_NUMBER = 'pim_catalog_number'; | ||
public const PIM_CATALOG_METRIC = 'pim_catalog_metric'; | ||
public const PIM_CATALOG_PRICE_COLLECTION = 'pim_catalog_price_collection'; | ||
public const PIM_CATALOG_IMAGE = 'pim_catalog_image'; | ||
public const PIM_CATALOG_FILE = 'pim_catalog_file'; | ||
public const PIM_CATALOG_ASSET_COLLECTION = 'pim_catalog_asset_collection'; | ||
public const AKENEO_REFERENCE_ENTITY = 'akeneo_reference_entity'; | ||
public const AKENEO_REFERENCE_ENTITY_COLLECTION = 'akeneo_reference_entity_collection'; | ||
public const PIM_REFERENCE_DATA_SIMPLESELECT = 'pim_reference_data_simpleselect'; | ||
public const PIM_REFERENCE_DATA_MULTISELECT = 'pim_reference_data_multiselect'; | ||
public const PIM_CATALOG_TABLE = 'pim_catalog_table'; | ||
} |
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
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,75 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Akeneo\Connector\Block\Adminhtml\System\Config\Form\Field; | ||
|
||
use Magento\Backend\Block\Template\Context; | ||
use Magento\Config\Block\System\Config\Form\Field\FieldArray\AbstractFieldArray; | ||
use Magento\Framework\Data\Form\Element\AbstractElement; | ||
use Magento\Framework\Data\Form\Element\Factory as ElementFactory; | ||
use Akeneo\Connector\Helper\Import\Attribute as AttributeHelper; | ||
|
||
/** | ||
* @author Agence Dn'D <[email protected]> | ||
* @copyright 2004-present Agence Dn'D | ||
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
* @link https://www.dnd.fr/ | ||
*/ | ||
class SwatchType extends AbstractFieldArray | ||
{ | ||
protected ElementFactory $elementFactory; | ||
protected AttributeHelper $attributeHelper; | ||
|
||
public function __construct( | ||
Context $context, | ||
ElementFactory $elementFactory, | ||
AttributeHelper $attributeHelper, | ||
array $data = [] | ||
) { | ||
parent::__construct($context, $data); | ||
|
||
$this->attributeHelper = $attributeHelper; | ||
$this->elementFactory = $elementFactory; | ||
} | ||
|
||
/** | ||
* Initialise form fields | ||
*/ | ||
protected function _construct(): void | ||
{ | ||
$this->addColumn('pim_type', ['label' => __('Akeneo')]); | ||
$this->addColumn('magento_type', ['label' => __('Magento')]); | ||
$this->_addAfter = false; | ||
$this->_addButtonLabel = __('Add'); | ||
parent::_construct(); | ||
} | ||
|
||
/** | ||
* Render array cell for prototypeJS template | ||
* | ||
* @param string $columnName | ||
*/ | ||
public function renderCellTemplate($columnName): string | ||
{ | ||
if ($columnName != 'magento_type' || !isset($this->_columns[$columnName])) { | ||
return parent::renderCellTemplate($columnName); | ||
} | ||
|
||
/** @var array $options */ | ||
$options = $this->attributeHelper->getAvailableSwatchTypes(); | ||
/** @var AbstractElement $element */ | ||
$element = $this->elementFactory->create('select'); | ||
$element->setForm( | ||
$this->getForm() | ||
)->setName( | ||
$this->_getCellInputElementName($columnName) | ||
)->setHtmlId( | ||
$this->_getCellInputElementId('<%- _id %>', $columnName) | ||
)->setValues( | ||
$options | ||
); | ||
|
||
return str_replace("\n", '', $element->getElementHtml()); | ||
} | ||
} |
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
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
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
Oops, something went wrong.