2018-08-20 08:32:33 +00:00
|
|
|
function ItemPublishDialog(primary_action, secondary_action) {
|
2018-08-24 11:08:34 +00:00
|
|
|
let dialog = new frappe.ui.Dialog({
|
|
|
|
title: __('Edit Publishing Details'),
|
|
|
|
fields: [
|
|
|
|
{
|
|
|
|
"label": "Item Code",
|
|
|
|
"fieldname": "item_code",
|
|
|
|
"fieldtype": "Data",
|
|
|
|
"read_only": 1
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"label": "Hub Category",
|
|
|
|
"fieldname": "hub_category",
|
|
|
|
"fieldtype": "Autocomplete",
|
|
|
|
"options": [],
|
|
|
|
"reqd": 1
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"label": "Images",
|
|
|
|
"fieldname": "image_list",
|
|
|
|
"fieldtype": "MultiSelect",
|
|
|
|
"options": [],
|
|
|
|
"reqd": 1
|
|
|
|
}
|
|
|
|
],
|
|
|
|
primary_action_label: primary_action.label || __('Set Details'),
|
|
|
|
primary_action: primary_action.fn,
|
|
|
|
secondary_action: secondary_action.fn
|
|
|
|
});
|
2018-08-20 08:48:07 +00:00
|
|
|
|
2018-08-24 11:08:34 +00:00
|
|
|
hub.call('get_categories')
|
|
|
|
.then(categories => {
|
|
|
|
categories = categories.map(d => d.name);
|
|
|
|
dialog.fields_dict.hub_category.set_data(categories);
|
|
|
|
});
|
2018-08-20 08:48:07 +00:00
|
|
|
|
2018-08-24 11:08:34 +00:00
|
|
|
return dialog;
|
2018-08-20 08:32:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export {
|
2018-08-24 11:08:34 +00:00
|
|
|
ItemPublishDialog
|
2018-08-20 08:32:33 +00:00
|
|
|
}
|