Skip to content

Commit c9a9d64

Browse files
sort order added to downloable product links column
1 parent 63a874f commit c9a9d64

File tree

2 files changed

+32
-16
lines changed

2 files changed

+32
-16
lines changed

app/code/Magento/Downloadable/Ui/DataProvider/Product/Form/Modifier/Links.php

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -208,22 +208,23 @@ protected function getRecord()
208208
'children',
209209
$record,
210210
[
211-
'container_link_title' => $this->getTitleColumn(),
212-
'container_link_price' => $this->getPriceColumn(),
213-
'container_file' => $this->getFileColumn(),
214-
'container_sample' => $this->getSampleColumn(),
215-
'is_shareable' => $this->getShareableColumn(),
216-
'max_downloads' => $this->getMaxDownloadsColumn(),
211+
'container_link_title' => $this->getTitleColumn(10),
212+
'container_link_price' => $this->getPriceColumn(20),
213+
'container_file' => $this->getFileColumn(30),
214+
'container_sample' => $this->getSampleColumn(40),
215+
'is_shareable' => $this->getShareableColumn(50),
216+
'max_downloads' => $this->getMaxDownloadsColumn(60),
217217
'position' => $recordPosition,
218218
'action_delete' => $recordActionDelete,
219219
]
220220
);
221221
}
222222

223223
/**
224+
* @param int $sortOrder
224225
* @return array
225226
*/
226-
protected function getTitleColumn()
227+
protected function getTitleColumn($sortOrder)
227228
{
228229
$titleContainer['arguments']['data']['config'] = [
229230
'componentType' => Container::NAME,
@@ -232,6 +233,7 @@ protected function getTitleColumn()
232233
'label' => __('Title'),
233234
'showLabel' => false,
234235
'dataScope' => '',
236+
'sortOrder' => $sortOrder,
235237
];
236238
$titleField['arguments']['data']['config'] = [
237239
'formElement' => Form\Element\Input::NAME,
@@ -247,9 +249,10 @@ protected function getTitleColumn()
247249
}
248250

249251
/**
252+
* @param int $sortOrder
250253
* @return array
251254
*/
252-
protected function getPriceColumn()
255+
protected function getPriceColumn($sortOrder)
253256
{
254257
$priceContainer['arguments']['data']['config'] = [
255258
'componentType' => Container::NAME,
@@ -258,6 +261,7 @@ protected function getPriceColumn()
258261
'label' => __('Price'),
259262
'showLabel' => false,
260263
'dataScope' => '',
264+
'sortOrder' => $sortOrder,
261265
];
262266
$priceField['arguments']['data']['config'] = [
263267
'formElement' => Form\Element\Input::NAME,
@@ -281,9 +285,10 @@ protected function getPriceColumn()
281285
}
282286

283287
/**
288+
* @param int $sortOrder
284289
* @return array
285290
*/
286-
protected function getFileColumn()
291+
protected function getFileColumn($sortOrder)
287292
{
288293
$fileContainer['arguments']['data']['config'] = [
289294
'componentType' => Container::NAME,
@@ -292,6 +297,7 @@ protected function getFileColumn()
292297
'label' => __('File'),
293298
'showLabel' => false,
294299
'dataScope' => '',
300+
'sortOrder' => $sortOrder,
295301
];
296302
$fileTypeField['arguments']['data']['config'] = [
297303
'formElement' => Form\Element\Select::NAME,
@@ -344,9 +350,10 @@ protected function getFileColumn()
344350
}
345351

346352
/**
353+
* @param int $sortOrder
347354
* @return array
348355
*/
349-
protected function getSampleColumn()
356+
protected function getSampleColumn($sortOrder)
350357
{
351358
$sampleContainer['arguments']['data']['config'] = [
352359
'componentType' => Container::NAME,
@@ -355,6 +362,7 @@ protected function getSampleColumn()
355362
'label' => __('Sample'),
356363
'showLabel' => false,
357364
'dataScope' => '',
365+
'sortOrder' => $sortOrder,
358366
];
359367
$sampleTypeField['arguments']['data']['config'] = [
360368
'formElement' => Form\Element\Select::NAME,
@@ -403,26 +411,29 @@ protected function getSampleColumn()
403411
}
404412

405413
/**
414+
* @param int $sortOrder
406415
* @return array
407416
*/
408-
protected function getShareableColumn()
417+
protected function getShareableColumn($sortOrder)
409418
{
410419
$shareableField['arguments']['data']['config'] = [
411420
'label' => __('Shareable'),
412421
'formElement' => Form\Element\Select::NAME,
413422
'componentType' => Form\Field::NAME,
414423
'dataType' => Form\Element\DataType\Number::NAME,
415424
'dataScope' => 'is_shareable',
425+
'sortOrder' => $sortOrder,
416426
'options' => $this->shareable->toOptionArray(),
417427
];
418428

419429
return $shareableField;
420430
}
421431

422432
/**
433+
* @param int $sortOrder
423434
* @return array
424435
*/
425-
protected function getMaxDownloadsColumn()
436+
protected function getMaxDownloadsColumn($sortOrder)
426437
{
427438
$maxDownloadsContainer['arguments']['data']['config'] = [
428439
'componentType' => Container::NAME,
@@ -431,6 +442,7 @@ protected function getMaxDownloadsColumn()
431442
'label' => __('Max. Downloads'),
432443
'showLabel' => false,
433444
'dataScope' => '',
445+
'sortOrder' => $sortOrder,
434446
];
435447
$numberOfDownloadsField['arguments']['data']['config'] = [
436448
'formElement' => Form\Element\Input::NAME,

app/code/Magento/Downloadable/Ui/DataProvider/Product/Form/Modifier/Samples.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,18 +183,19 @@ protected function getRecord()
183183
'children',
184184
$record,
185185
[
186-
'container_sample_title' => $this->getTitleColumn(),
187-
'container_sample' => $this->getSampleColumn(),
186+
'container_sample_title' => $this->getTitleColumn(10),
187+
'container_sample' => $this->getSampleColumn(20),
188188
'position' => $recordPosition,
189189
'action_delete' => $recordActionDelete,
190190
]
191191
);
192192
}
193193

194194
/**
195+
* @param int $sortOrder
195196
* @return array
196197
*/
197-
protected function getTitleColumn()
198+
protected function getTitleColumn($sortOrder)
198199
{
199200
$titleContainer['arguments']['data']['config'] = [
200201
'componentType' => Container::NAME,
@@ -203,6 +204,7 @@ protected function getTitleColumn()
203204
'showLabel' => false,
204205
'label' => __('Title'),
205206
'dataScope' => '',
207+
'sortOrder' => $sortOrder,
206208
];
207209
$titleField['arguments']['data']['config'] = [
208210
'formElement' => Form\Element\Input::NAME,
@@ -218,9 +220,10 @@ protected function getTitleColumn()
218220
}
219221

220222
/**
223+
* @param int $sortOrder
221224
* @return array
222225
*/
223-
protected function getSampleColumn()
226+
protected function getSampleColumn($sortOrder)
224227
{
225228
$sampleContainer['arguments']['data']['config'] = [
226229
'componentType' => Container::NAME,
@@ -229,6 +232,7 @@ protected function getSampleColumn()
229232
'label' => __('File'),
230233
'showLabel' => false,
231234
'dataScope' => '',
235+
'sortOrder' => $sortOrder,
232236
];
233237
$sampleType['arguments']['data']['config'] = [
234238
'formElement' => Form\Element\Select::NAME,

0 commit comments

Comments
 (0)