Skip to content
Snippets Groups Projects
Verified Commit e4c25d36 authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

fix(save-button): ignore not work with arrays #292

parent 80b803d9
No related branches found
No related tags found
No related merge requests found
...@@ -205,7 +205,9 @@ class SaveButton extends CustomElement { ...@@ -205,7 +205,9 @@ class SaveButton extends CustomElement {
const result = diff(self[originValuesSymbol], currentValues); const result = diff(self[originValuesSymbol], currentValues);
if (self.getOption("logLevel") === "debug") { if (self.getOption("logLevel") === "debug") {
console.groupCollapsed("SaveButton"); console.groupCollapsed("SaveButton");
console.log(result); console.log("originValues", JSON.parse(JSON.stringify(currentValues)));
console.log("result of diff", result);
console.log("ignoreChanges", ignoreChanges);
if (isArray(result) && result.length > 0) { if (isArray(result) && result.length > 0) {
const formattedDiff = result.map((change) => ({ const formattedDiff = result.map((change) => ({
...@@ -229,7 +231,13 @@ class SaveButton extends CustomElement { ...@@ -229,7 +231,13 @@ class SaveButton extends CustomElement {
for (const item of result) { for (const item of result) {
for (const ignorePattern of ignoreChanges) { for (const ignorePattern of ignoreChanges) {
const p = new RegExp(ignorePattern); const p = new RegExp(ignorePattern);
if (p.test(item.path)) {
let matchPath = item.path
if(isArray(item.path)){
matchPath = item.path.join(".");
}
if (p.test(matchPath)) {
itemsToRemove.push(item); itemsToRemove.push(item);
break; break;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment