|
|
@@ -42,7 +42,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
renderProducts();
|
|
|
getAtributeList();
|
|
|
document.getElementById('btnSubmit').addEventListener('click', submitAttributes);
|
|
|
- document.getElementById('btnReset').addEventListener('click', resetAll);
|
|
|
+ // document.getElementById('btnReset').addEventListener('click', resetAll);
|
|
|
// document.getElementById('btnSelectAll').addEventListener('click', () => {
|
|
|
// if (selectedIds.size === PRODUCT_BASE.length) { selectedIds.clear(); } else { selectedIds = new Set(PRODUCT_BASE.map(p => p.id)); }
|
|
|
// // renderProducts();
|
|
|
@@ -304,17 +304,17 @@ if(p.product_type_details.length > 0){
|
|
|
});
|
|
|
|
|
|
// --- Render Mandatory Attributes ---
|
|
|
- if (mandatoryAttributes.length > 0) {
|
|
|
- const manTitle = el('p', "pSelectRight mandatory-title");
|
|
|
- manTitle.innerHTML = "Mandatory Attributes:";
|
|
|
- attrContainer.appendChild(manTitle);
|
|
|
-
|
|
|
- mandatoryAttributes.forEach(attr => {
|
|
|
- const initialSelected = getSelectedAttributes(p.item_id)[attr.attribute_name] || attr.possible_values;
|
|
|
- const chipGroup = createAttributeChips(p, attr, initialSelected, true, updateProductState);
|
|
|
- attrContainer.appendChild(chipGroup);
|
|
|
- });
|
|
|
- }
|
|
|
+ // if (mandatoryAttributes.length > 0) {
|
|
|
+ // const manTitle = el('p', "pSelectRight mandatory-title");
|
|
|
+ // manTitle.innerHTML = "Mandatory Attributes:";
|
|
|
+ // attrContainer.appendChild(manTitle);
|
|
|
+
|
|
|
+ // mandatoryAttributes.forEach(attr => {
|
|
|
+ // const initialSelected = getSelectedAttributes(p.item_id)[attr.attribute_name] || attr.possible_values;
|
|
|
+ // const chipGroup = createAttributeChips(p, attr, initialSelected, true, updateProductState);
|
|
|
+ // attrContainer.appendChild(chipGroup);
|
|
|
+ // });
|
|
|
+ // }
|
|
|
|
|
|
// --- Render Optional Attributes ---
|
|
|
if (optionalAttributes.length > 0) {
|
|
|
@@ -348,7 +348,7 @@ if(p.product_type_details.length > 0){
|
|
|
row.appendChild(container); row.appendChild(mid);
|
|
|
if(p.product_type_details.length > 0){
|
|
|
console.log("IN ");
|
|
|
- row.appendChild(attrContainer); // Append the new attribute selectors container
|
|
|
+ // row.appendChild(attrContainer); // Append the new attribute selectors container
|
|
|
}
|
|
|
row.appendChild(right);
|
|
|
// if (p.mandatoryAttributes && p.mandatoryAttributes.length > 0) {
|
|
|
@@ -724,7 +724,7 @@ function renderProductsTable(items = getCurrentSlice()) {
|
|
|
const trh = document.createElement('tr');
|
|
|
|
|
|
// Table Headers
|
|
|
- ['Select', 'Image', 'Product', 'SKU', 'Type', 'Short Description', 'Attributes'].forEach(h => {
|
|
|
+ ['Select', 'Image', 'Product', 'SKU', 'Type', 'Short Description'].forEach(h => {
|
|
|
const th = document.createElement('th'); th.textContent = h; trh.appendChild(th);
|
|
|
});
|
|
|
thead.appendChild(trh); table.appendChild(thead);
|
|
|
@@ -770,7 +770,7 @@ function renderProductsTable(items = getCurrentSlice()) {
|
|
|
detailRow.id = `detail-row-${p.id}`;
|
|
|
|
|
|
const detailCell = document.createElement('td');
|
|
|
- detailCell.colSpan = 7; // Must span all columns
|
|
|
+ detailCell.colSpan = 6; // Must span all columns
|
|
|
|
|
|
const attrContainer = document.createElement('div');
|
|
|
attrContainer.id = `attr-container-${p.item_id}`; // Unique ID for targeting by updateProductState
|
|
|
@@ -792,7 +792,7 @@ function renderProductsTable(items = getCurrentSlice()) {
|
|
|
toggleButton.textContent = 'Configure';
|
|
|
toggleButton.classList.add('btn', 'btn-sm', 'btn-info', 'attribute-toggle-btn');
|
|
|
tdAttr.appendChild(toggleButton);
|
|
|
- tr.appendChild(tdAttr);
|
|
|
+ // tr.appendChild(tdAttr);
|
|
|
|
|
|
|
|
|
|
|
|
@@ -850,7 +850,7 @@ function renderProductsTable(items = getCurrentSlice()) {
|
|
|
} else {
|
|
|
const tr = el('tr');
|
|
|
const tdName = el('td');
|
|
|
- tdName.colSpan = 7;
|
|
|
+ tdName.colSpan = 6;
|
|
|
tdName.innerHTML = "No Products Found.";
|
|
|
tr.appendChild(tdName);
|
|
|
tbody.appendChild(tr);
|
|
|
@@ -1750,7 +1750,7 @@ function renderInlineForTable() {
|
|
|
// --- Detail Row Construction ---
|
|
|
const detail = el('tr', 'detail-row');
|
|
|
// td.colSpan must match the number of columns in your main table
|
|
|
- const td = el('td'); td.colSpan = 7;
|
|
|
+ const td = el('td'); td.colSpan = 6;
|
|
|
const content = el('div', 'detail-content-tables');
|
|
|
|
|
|
// 1. MANDATORY Attributes Table
|