SK/FB work

This commit is contained in:
Rich Lott / Artful Robot 2025-02-25 17:42:47 +00:00
parent 16f2b6235d
commit a4c9251f5e
10 changed files with 163 additions and 233 deletions

View file

@ -26,7 +26,21 @@
ctrl.moveIdx = null;
ctrl.categoryToEdit = null;
ctrl.categoryDefinitions = null;
ctrl.categoryDefinitions = await crmApi4("ContactCategoryDefinition", 'get', { orderBy: { label: 'ASC' }, withLabels: true });
ctrl.categoryDefinitions = await crmApi4("ContactCategoryDefinition", 'get', { orderBy: { execution_order: 'ASC' }, withLabels: true });
// Ensure we have the minimum of what we need.
if (!ctrl.categoryDefinitions.find(c => c.search_type === 'default')) {
// There's no default one.
ctrl.categoryDefinitions.push({
id: 0,
execution_order: ctrl.categoryDefinitions.length,
label: '9999 ' + ts('Other'),
search_type: 'default',
search_data: {},
color: '#666666',
icon: 'fa-person-circle-question',
description: ts('Any contact not matching any of the categories is assigned this category.'),
})
}
updateOrders();
console.log("Got", ctrl.categoryDefinitions);
@ -89,7 +103,7 @@
ctrl.categoryDefinitions.splice(idx, 0, item);
ctrl.moveIdx = null;
updateOrders();
$ctrl.dirty = 'dirty';
ctrl.dirty = 'dirty';
};
ctrl.deleteCategory = idx => {