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

Fixed: #21278, Add sort order on downloadable links #21279

Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -208,22 +208,23 @@ protected function getRecord()
'children',
$record,
[
'container_link_title' => $this->getTitleColumn(),
'container_link_price' => $this->getPriceColumn(),
'container_file' => $this->getFileColumn(),
'container_sample' => $this->getSampleColumn(),
'is_shareable' => $this->getShareableColumn(),
'max_downloads' => $this->getMaxDownloadsColumn(),
'container_link_title' => $this->getTitleColumn(10),
'container_link_price' => $this->getPriceColumn(20),
'container_file' => $this->getFileColumn(30),
'container_sample' => $this->getSampleColumn(40),
'is_shareable' => $this->getShareableColumn(50),
'max_downloads' => $this->getMaxDownloadsColumn(60),
'position' => $recordPosition,
'action_delete' => $recordActionDelete,
]
);
}

/**
* @param int $sortOrder
* @return array
*/
protected function getTitleColumn()
protected function getTitleColumn($sortOrder)
{
$titleContainer['arguments']['data']['config'] = [
'componentType' => Container::NAME,
Expand All @@ -232,6 +233,7 @@ protected function getTitleColumn()
'label' => __('Title'),
'showLabel' => false,
'dataScope' => '',
'sortOrder' => $sortOrder,
];
$titleField['arguments']['data']['config'] = [
'formElement' => Form\Element\Input::NAME,
Expand All @@ -247,9 +249,10 @@ protected function getTitleColumn()
}

/**
* @param int $sortOrder
* @return array
*/
protected function getPriceColumn()
protected function getPriceColumn($sortOrder)
{
$priceContainer['arguments']['data']['config'] = [
'componentType' => Container::NAME,
Expand All @@ -258,6 +261,7 @@ protected function getPriceColumn()
'label' => __('Price'),
'showLabel' => false,
'dataScope' => '',
'sortOrder' => $sortOrder,
];
$priceField['arguments']['data']['config'] = [
'formElement' => Form\Element\Input::NAME,
Expand All @@ -281,9 +285,10 @@ protected function getPriceColumn()
}

/**
* @param int $sortOrder
* @return array
*/
protected function getFileColumn()
protected function getFileColumn($sortOrder)
{
$fileContainer['arguments']['data']['config'] = [
'componentType' => Container::NAME,
Expand All @@ -292,6 +297,7 @@ protected function getFileColumn()
'label' => __('File'),
'showLabel' => false,
'dataScope' => '',
'sortOrder' => $sortOrder,
];
$fileTypeField['arguments']['data']['config'] = [
'formElement' => Form\Element\Select::NAME,
Expand Down Expand Up @@ -344,9 +350,10 @@ protected function getFileColumn()
}

/**
* @param int $sortOrder
* @return array
*/
protected function getSampleColumn()
protected function getSampleColumn($sortOrder)
{
$sampleContainer['arguments']['data']['config'] = [
'componentType' => Container::NAME,
Expand All @@ -355,6 +362,7 @@ protected function getSampleColumn()
'label' => __('Sample'),
'showLabel' => false,
'dataScope' => '',
'sortOrder' => $sortOrder,
];
$sampleTypeField['arguments']['data']['config'] = [
'formElement' => Form\Element\Select::NAME,
Expand Down Expand Up @@ -403,26 +411,29 @@ protected function getSampleColumn()
}

/**
* @param int $sortOrder
* @return array
*/
protected function getShareableColumn()
protected function getShareableColumn($sortOrder)
{
$shareableField['arguments']['data']['config'] = [
'label' => __('Shareable'),
'formElement' => Form\Element\Select::NAME,
'componentType' => Form\Field::NAME,
'dataType' => Form\Element\DataType\Number::NAME,
'dataScope' => 'is_shareable',
'sortOrder' => $sortOrder,
'options' => $this->shareable->toOptionArray(),
];

return $shareableField;
}

/**
* @param int $sortOrder
* @return array
*/
protected function getMaxDownloadsColumn()
protected function getMaxDownloadsColumn($sortOrder)
{
$maxDownloadsContainer['arguments']['data']['config'] = [
'componentType' => Container::NAME,
Expand All @@ -431,6 +442,7 @@ protected function getMaxDownloadsColumn()
'label' => __('Max. Downloads'),
'showLabel' => false,
'dataScope' => '',
'sortOrder' => $sortOrder,
];
$numberOfDownloadsField['arguments']['data']['config'] = [
'formElement' => Form\Element\Input::NAME,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,18 +183,19 @@ protected function getRecord()
'children',
$record,
[
'container_sample_title' => $this->getTitleColumn(),
'container_sample' => $this->getSampleColumn(),
'container_sample_title' => $this->getTitleColumn(10),
'container_sample' => $this->getSampleColumn(20),
'position' => $recordPosition,
'action_delete' => $recordActionDelete,
]
);
}

/**
* @param int $sortOrder
* @return array
*/
protected function getTitleColumn()
protected function getTitleColumn($sortOrder)
{
$titleContainer['arguments']['data']['config'] = [
'componentType' => Container::NAME,
Expand All @@ -203,6 +204,7 @@ protected function getTitleColumn()
'showLabel' => false,
'label' => __('Title'),
'dataScope' => '',
'sortOrder' => $sortOrder,
];
$titleField['arguments']['data']['config'] = [
'formElement' => Form\Element\Input::NAME,
Expand All @@ -218,9 +220,10 @@ protected function getTitleColumn()
}

/**
* @param int $sortOrder
* @return array
*/
protected function getSampleColumn()
protected function getSampleColumn($sortOrder)
{
$sampleContainer['arguments']['data']['config'] = [
'componentType' => Container::NAME,
Expand All @@ -229,6 +232,7 @@ protected function getSampleColumn()
'label' => __('File'),
'showLabel' => false,
'dataScope' => '',
'sortOrder' => $sortOrder,
];
$sampleType['arguments']['data']['config'] = [
'formElement' => Form\Element\Select::NAME,
Expand Down