Fix: Product Permutations save on production.
This commit is contained in:
@@ -4569,7 +4569,7 @@ BEGIN
|
|||||||
|
|
||||||
IF (NOT (
|
IF (NOT (
|
||||||
NEW.id_unit_measurement_interval_recurrence IS NULL
|
NEW.id_unit_measurement_interval_recurrence IS NULL
|
||||||
OR NEW.id_unit_measurement_interval_recurrence NOT IN (SELECT id_unit_measurement FROM Shop_Unit_Measurement WHERE is_unit_of_time = 1)
|
OR NEW.id_unit_measurement_interval_recurrence IN (SELECT id_unit_measurement FROM Shop_Unit_Measurement WHERE is_unit_of_time = 1)
|
||||||
)) THEN
|
)) THEN
|
||||||
SIGNAL SQLSTATE '45000'
|
SIGNAL SQLSTATE '45000'
|
||||||
SET MESSAGE_TEXT = 'Recurrence interval ID must be a unit of time.';
|
SET MESSAGE_TEXT = 'Recurrence interval ID must be a unit of time.';
|
||||||
@@ -4577,7 +4577,7 @@ BEGIN
|
|||||||
|
|
||||||
IF (NOT (
|
IF (NOT (
|
||||||
NEW.id_unit_measurement_interval_expiration_unsealed IS NULL
|
NEW.id_unit_measurement_interval_expiration_unsealed IS NULL
|
||||||
OR NEW.id_unit_measurement_interval_expiration_unsealed NOT IN (SELECT id_unit_measurement FROM Shop_Unit_Measurement WHERE is_unit_of_time = 1)
|
OR NEW.id_unit_measurement_interval_expiration_unsealed IN (SELECT id_unit_measurement FROM Shop_Unit_Measurement WHERE is_unit_of_time = 1)
|
||||||
)) THEN
|
)) THEN
|
||||||
SET v_msg := CONCAT('Unsealed expiration interval ID must be a unit of time. Invalid value: ', CAST(NEW.id_unit_measurement_interval_expiration_unsealed AS CHAR));
|
SET v_msg := CONCAT('Unsealed expiration interval ID must be a unit of time. Invalid value: ', CAST(NEW.id_unit_measurement_interval_expiration_unsealed AS CHAR));
|
||||||
SIGNAL SQLSTATE '45000'
|
SIGNAL SQLSTATE '45000'
|
||||||
@@ -24028,7 +24028,8 @@ INSERT INTO partsltd_prod.Shop_Product_Change_Set (
|
|||||||
)
|
)
|
||||||
VALUES ( 'Update Variation Display Orders' )
|
VALUES ( 'Update Variation Display Orders' )
|
||||||
;
|
;
|
||||||
WITH RECURSIVE RANKED AS (
|
UPDATE partsltd_prod.Shop_Variation V
|
||||||
|
INNER JOIN (
|
||||||
SELECT
|
SELECT
|
||||||
V.id_variation,
|
V.id_variation,
|
||||||
RANK() OVER (ORDER BY
|
RANK() OVER (ORDER BY
|
||||||
@@ -24058,9 +24059,7 @@ WITH RECURSIVE RANKED AS (
|
|||||||
AND UM.active = 1
|
AND UM.active = 1
|
||||||
WHERE
|
WHERE
|
||||||
V.id_type = 2
|
V.id_type = 2
|
||||||
)
|
) AS RANKED ON V.id_variation = RANKED.id_variation
|
||||||
UPDATE partsltd_prod.Shop_Variation V
|
|
||||||
INNER JOIN RANKED ON V.id_variation = RANKED.id_variation
|
|
||||||
JOIN (
|
JOIN (
|
||||||
SELECT CS.id_change_set
|
SELECT CS.id_change_set
|
||||||
FROM partsltd_prod.Shop_Product_Change_Set CS
|
FROM partsltd_prod.Shop_Product_Change_Set CS
|
||||||
|
|||||||
12
static/dist/js/main.bundle.js
vendored
12
static/dist/js/main.bundle.js
vendored
@@ -324,6 +324,8 @@ var DOM = /*#__PURE__*/function () {
|
|||||||
returnVal = element.value;
|
returnVal = element.value;
|
||||||
} else if (element.tagName === 'BUTTON' && element.classList.contains(flagActive)) {
|
} else if (element.tagName === 'BUTTON' && element.classList.contains(flagActive)) {
|
||||||
returnVal = element.classList.contains(flagDelete);
|
returnVal = element.classList.contains(flagDelete);
|
||||||
|
} else if (element.tagName === 'TD') {
|
||||||
|
returnVal = DOM.getElementAttributeValueCurrent(element);
|
||||||
} else {
|
} else {
|
||||||
returnVal = element.textContent;
|
returnVal = element.textContent;
|
||||||
}
|
}
|
||||||
@@ -2470,9 +2472,9 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
|||||||
wasDirtyParentRows: wasDirtyParentRows
|
wasDirtyParentRows: wasDirtyParentRows
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (isDirtyElement != wasDirtyElement) {
|
|
||||||
var td = DOM.getCellFromElement(element);
|
var td = DOM.getCellFromElement(element);
|
||||||
DOM.setElementAttributeValueCurrent(td, DOM.getElementAttributeValueCurrent(element));
|
DOM.setElementAttributeValueCurrent(td, DOM.getElementAttributeValueCurrent(element));
|
||||||
|
if (isDirtyElement != wasDirtyElement) {
|
||||||
DOM.handleDirtyElement(td, isDirtyElement);
|
DOM.handleDirtyElement(td, isDirtyElement);
|
||||||
this.updateAndToggleShowButtonsSaveCancel();
|
this.updateAndToggleShowButtonsSaveCancel();
|
||||||
this.cascadeChangedIsDirtyNestedElementCellTable(element, isDirtyElement, wasDirtyParentRows);
|
this.cascadeChangedIsDirtyNestedElementCellTable(element, isDirtyElement, wasDirtyParentRows);
|
||||||
@@ -3025,14 +3027,14 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
|||||||
}, {
|
}, {
|
||||||
key: "handleChangeDdlProductVariationOrVariationType",
|
key: "handleChangeDdlProductVariationOrVariationType",
|
||||||
value: function handleChangeDdlProductVariationOrVariationType(event, element) {
|
value: function handleChangeDdlProductVariationOrVariationType(event, element) {
|
||||||
this.updateProductPermutationVariations(element);
|
|
||||||
this.handleChangeNestedElementCellTable(event, element);
|
this.handleChangeNestedElementCellTable(event, element);
|
||||||
|
this.updateProductPermutationVariations(element);
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: "hookupDdlsProductPermutationVariation",
|
key: "hookupDdlsProductPermutationVariation",
|
||||||
value: function hookupDdlsProductPermutationVariation() {
|
value: function hookupDdlsProductPermutationVariation() {
|
||||||
var _this22 = this;
|
var _this22 = this;
|
||||||
this.hookupTableCellDdls(idTableMain + ' td.' + flagProductVariations + ' td.' + flagProductVariation, function (event, ddlVariation) {
|
this.hookupTableCellDdls(idTableMain + ' td.' + flagProductVariations + ' td.' + flagProductVariation + ' select', function (event, ddlVariation) {
|
||||||
_this22.handleChangeDdlProductVariationOrVariationType(event, ddlVariation);
|
_this22.handleChangeDdlProductVariationOrVariationType(event, ddlVariation);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -3073,7 +3075,7 @@ var TableBasePage = /*#__PURE__*/function (_BasePage) {
|
|||||||
var variationsCell = element.closest('td.' + flagProductVariations);
|
var variationsCell = element.closest('td.' + flagProductVariations);
|
||||||
var variationPairsString = this.getProductPermutationVariationsText(variationsCell);
|
var variationPairsString = this.getProductPermutationVariationsText(variationsCell);
|
||||||
DOM.setElementAttributeValueCurrent(variationsCell, variationPairsString);
|
DOM.setElementAttributeValueCurrent(variationsCell, variationPairsString);
|
||||||
DOM.isElementDirty(variationsCell);
|
this.handleChangeNestedElementCellTable(null, variationsCell);
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: "getProductPermutationVariationsText",
|
key: "getProductPermutationVariationsText",
|
||||||
@@ -4739,6 +4741,7 @@ var PageStoreProductPermutations = /*#__PURE__*/function (_TableBasePage) {
|
|||||||
this.hookupFieldsProductPermutationVariation();
|
this.hookupFieldsProductPermutationVariation();
|
||||||
this.hookupDescriptionTextareas();
|
this.hookupDescriptionTextareas();
|
||||||
this.hookupCostFields();
|
this.hookupCostFields();
|
||||||
|
this.hookupProfitFields();
|
||||||
this.hookupLatencyManufactureInputs();
|
this.hookupLatencyManufactureInputs();
|
||||||
this.hookupQuantityFields();
|
this.hookupQuantityFields();
|
||||||
this.hookupSubscriptionFields();
|
this.hookupSubscriptionFields();
|
||||||
@@ -4797,6 +4800,7 @@ var PageStoreProductPermutations = /*#__PURE__*/function (_TableBasePage) {
|
|||||||
}, {
|
}, {
|
||||||
key: "hookupProfitInputs",
|
key: "hookupProfitInputs",
|
||||||
value: function hookupProfitInputs() {
|
value: function hookupProfitInputs() {
|
||||||
|
debugger;
|
||||||
this.hookupChangeHandlerTableCells(idTableMain + ' td.' + flagProfitLocalMin + ' input');
|
this.hookupChangeHandlerTableCells(idTableMain + ' td.' + flagProfitLocalMin + ' input');
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
|
|||||||
@@ -123,6 +123,9 @@ export default class DOM {
|
|||||||
else if (element.tagName === 'BUTTON' && element.classList.contains(flagActive)) {
|
else if (element.tagName === 'BUTTON' && element.classList.contains(flagActive)) {
|
||||||
returnVal = element.classList.contains(flagDelete);
|
returnVal = element.classList.contains(flagDelete);
|
||||||
}
|
}
|
||||||
|
else if (element.tagName === 'TD') {
|
||||||
|
returnVal = DOM.getElementAttributeValueCurrent(element);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
returnVal = element.textContent;
|
returnVal = element.textContent;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -362,9 +362,9 @@ export default class TableBasePage extends BasePage {
|
|||||||
let wasDirtyElement = element.classList.contains(flagDirty);
|
let wasDirtyElement = element.classList.contains(flagDirty);
|
||||||
let isDirtyElement = DOM.updateAndCheckIsElementDirty(element);
|
let isDirtyElement = DOM.updateAndCheckIsElementDirty(element);
|
||||||
if (_verbose) { console.log({isDirtyElement, wasDirtyElement, wasDirtyParentRows}); }
|
if (_verbose) { console.log({isDirtyElement, wasDirtyElement, wasDirtyParentRows}); }
|
||||||
if (isDirtyElement != wasDirtyElement) {
|
|
||||||
let td = DOM.getCellFromElement(element);
|
let td = DOM.getCellFromElement(element);
|
||||||
DOM.setElementAttributeValueCurrent(td, DOM.getElementAttributeValueCurrent(element));
|
DOM.setElementAttributeValueCurrent(td, DOM.getElementAttributeValueCurrent(element));
|
||||||
|
if (isDirtyElement != wasDirtyElement) {
|
||||||
DOM.handleDirtyElement(td, isDirtyElement);
|
DOM.handleDirtyElement(td, isDirtyElement);
|
||||||
this.updateAndToggleShowButtonsSaveCancel();
|
this.updateAndToggleShowButtonsSaveCancel();
|
||||||
this.cascadeChangedIsDirtyNestedElementCellTable(element, isDirtyElement, wasDirtyParentRows);
|
this.cascadeChangedIsDirtyNestedElementCellTable(element, isDirtyElement, wasDirtyParentRows);
|
||||||
@@ -849,11 +849,11 @@ export default class TableBasePage extends BasePage {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
handleChangeDdlProductVariationOrVariationType(event, element) {
|
handleChangeDdlProductVariationOrVariationType(event, element) {
|
||||||
this.updateProductPermutationVariations(element);
|
|
||||||
this.handleChangeNestedElementCellTable(event, element);
|
this.handleChangeNestedElementCellTable(event, element);
|
||||||
|
this.updateProductPermutationVariations(element);
|
||||||
}
|
}
|
||||||
hookupDdlsProductPermutationVariation() {
|
hookupDdlsProductPermutationVariation() {
|
||||||
this.hookupTableCellDdls(idTableMain + ' td.' + flagProductVariations + ' td.' + flagProductVariation, (event, ddlVariation) => { this.handleChangeDdlProductVariationOrVariationType(event, ddlVariation); });
|
this.hookupTableCellDdls(idTableMain + ' td.' + flagProductVariations + ' td.' + flagProductVariation + ' select', (event, ddlVariation) => { this.handleChangeDdlProductVariationOrVariationType(event, ddlVariation); });
|
||||||
}
|
}
|
||||||
hookupButtonsProductPermutationVariationAddDelete() {
|
hookupButtonsProductPermutationVariationAddDelete() {
|
||||||
let selectorButton = idTableMain + ' td.' + flagProductVariations + ' tr.' + flagProductVariation + ' button';
|
let selectorButton = idTableMain + ' td.' + flagProductVariations + ' tr.' + flagProductVariation + ' button';
|
||||||
@@ -884,7 +884,7 @@ export default class TableBasePage extends BasePage {
|
|||||||
let variationsCell = element.closest('td.' + flagProductVariations);
|
let variationsCell = element.closest('td.' + flagProductVariations);
|
||||||
let variationPairsString = this.getProductPermutationVariationsText(variationsCell);
|
let variationPairsString = this.getProductPermutationVariationsText(variationsCell);
|
||||||
DOM.setElementAttributeValueCurrent(variationsCell, variationPairsString);
|
DOM.setElementAttributeValueCurrent(variationsCell, variationPairsString);
|
||||||
DOM.isElementDirty(variationsCell);
|
this.handleChangeNestedElementCellTable(null, variationsCell);
|
||||||
}
|
}
|
||||||
getProductPermutationVariationsText(variationsTd) {
|
getProductPermutationVariationsText(variationsTd) {
|
||||||
let rows = variationsTd.querySelectorAll(':scope tbody tr');
|
let rows = variationsTd.querySelectorAll(':scope tbody tr');
|
||||||
|
|||||||
@@ -213,6 +213,7 @@ export default class PageStoreProductPermutations extends TableBasePage {
|
|||||||
this.hookupFieldsProductPermutationVariation();
|
this.hookupFieldsProductPermutationVariation();
|
||||||
this.hookupDescriptionTextareas();
|
this.hookupDescriptionTextareas();
|
||||||
this.hookupCostFields();
|
this.hookupCostFields();
|
||||||
|
this.hookupProfitFields();
|
||||||
this.hookupLatencyManufactureInputs();
|
this.hookupLatencyManufactureInputs();
|
||||||
this.hookupQuantityFields();
|
this.hookupQuantityFields();
|
||||||
this.hookupSubscriptionFields();
|
this.hookupSubscriptionFields();
|
||||||
@@ -256,7 +257,8 @@ export default class PageStoreProductPermutations extends TableBasePage {
|
|||||||
this.hookupTableCellDdlPreviews(idTableMain + ' td.' + flagCurrency, Utils.getListFromDict(currencies));
|
this.hookupTableCellDdlPreviews(idTableMain + ' td.' + flagCurrency, Utils.getListFromDict(currencies));
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
hookupProfitInputs(){
|
hookupProfitInputs() {
|
||||||
|
debugger;
|
||||||
this.hookupChangeHandlerTableCells(idTableMain + ' td.' + flagProfitLocalMin + ' input');
|
this.hookupChangeHandlerTableCells(idTableMain + ' td.' + flagProfitLocalMin + ' input');
|
||||||
}
|
}
|
||||||
hookupLatencyManufactureInputs(){
|
hookupLatencyManufactureInputs(){
|
||||||
|
|||||||
Reference in New Issue
Block a user