Release v2.17.4: add API region sorting and indexed placeholders
This commit is contained in:
1 parent
bc8075379a
commit
46636939de
18 files changed
+709
-232
No files matched your search
@@ -466,6 +466,9 @@ async function buildTemplateContent(pool, template, body, filesByField, existing
|
||||
const sourceId = body[`region_api_source_id_${region.id}`];
|
||||
const itemNumber = body[`region_api_item_number_${region.id}`];
|
||||
const itemsPath = body[`region_api_items_path_${region.id}`];
|
||||
const sortMode = body[`region_api_sort_mode_${region.id}`];
|
||||
const sortBy = body[`region_api_sort_by_${region.id}`];
|
||||
const sortDirection = body[`region_api_sort_direction_${region.id}`];
|
||||
const parsedItemNumber = Math.max(1, Number(itemNumber || current.item_number || 1));
|
||||
content[region.region_key] = {
|
||||
type: 'api',
|
||||
@@ -473,6 +476,8 @@ async function buildTemplateContent(pool, template, body, filesByField, existing
|
||||
source_id: sourceId === undefined || sourceId === null ? (current.source_id || null) : (sourceId === '' ? null : Number(sourceId)),
|
||||
item_number: Number.isFinite(parsedItemNumber) && parsedItemNumber > 0 ? parsedItemNumber : 1,
|
||||
items_path: itemsPath === undefined || itemsPath === null ? (current.items_path === undefined || current.items_path === null ? '' : String(current.items_path)) : String(itemsPath || '').trim(),
|
||||
sort_by: sortMode === undefined ? String(current.sort_by || '') : (sortMode === 'field' ? String(sortBy || '').trim() : ''),
|
||||
sort_direction: sortDirection === undefined ? (String(current.sort_direction || '').toLowerCase() === 'desc' ? 'desc' : 'asc') : (sortDirection === 'desc' ? 'desc' : 'asc'),
|
||||
variable_name: 'item',
|
||||
font_family: style.font_family,
|
||||
font_size: style.font_size,
|
||||
|
||||
Reference in new issue
Block a user