Skip to content

Commit

Permalink
Merge pull request #481 from adessoSE/CUC-538-bug-beim-einfgen-von-bl…
Browse files Browse the repository at this point in the history
…cken-unte

Bug fixed
  • Loading branch information
sMeilbeck authored Nov 2, 2023
2 parents ba74aca + a4c1502 commit 1686a70
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions frontend/src/app/base-editor/base-editor.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ export class BaseEditorComponent {
Object.keys(block[1].stepDefinitions).forEach((key, _) => {
if (key === 'when') {
block[1].stepDefinitions[key].forEach((step: StepType) => {
this.uncheckStep(step);
this.selectedStory.background.stepDefinitions[key].push(JSON.parse(JSON.stringify(step)));
});
}
Expand Down Expand Up @@ -745,6 +746,10 @@ export class BaseEditorComponent {
}
}

uncheckStep (step) {
step.checked = false;
}

/** Updates step definitions list (background & scenario)
* @param stepIndex
* @param newList List afret dragging
Expand Down Expand Up @@ -1349,7 +1354,7 @@ export class BaseEditorComponent {
for (const s in stepsList[prop]) {
if (stepsList[prop][s].checked) {
stepsList[prop][s].deactivated = !stepsList[prop][s].deactivated;
stepsList[prop][s].checked = !stepsList[prop][s].checked;
this.uncheckStep(stepsList[prop][s]);
}
}
}
Expand Down Expand Up @@ -1425,6 +1430,7 @@ export class BaseEditorComponent {
if (this.templateName !== 'example' && prop !== 'example') {
for (let i = stepsList[prop].length - 1; i >= 0; i--) {
if (stepsList[prop][i].checked) {
this.uncheckStep(stepsList[prop][i]);
if(stepsList[prop][i]._blockReferenceId){
this.blockService.checkRefOnRemoveEmitter(stepsList[prop][i]._blockReferenceId);
}
Expand Down Expand Up @@ -1519,6 +1525,7 @@ export class BaseEditorComponent {
Object.keys(stepsListIterate).forEach((key, _) => {
for (const s in stepsList[key]) {
if (stepsList[key][s].checked) {
this.uncheckStep(stepsList[key][s]);
copyBlock[key].push(stepsList[key][s]);
stepsList[key][s].values.forEach((value, index) => {
if (stepsList[key][s].isExample[index]) {
Expand Down Expand Up @@ -1555,7 +1562,7 @@ export class BaseEditorComponent {
if (key === 'when') {
this.clipboardBlock.stepDefinitions[key].forEach((step: StepType) => {
//to prevent blocks to be checked after pasting
step.checked = false;
this.uncheckStep(step);
this.selectedStory.background.stepDefinitions[key].push(JSON.parse(JSON.stringify(step)));
});
}
Expand All @@ -1577,6 +1584,7 @@ export class BaseEditorComponent {
Object.keys(this.clipboardBlock.stepDefinitions).forEach((key, _) => {
if (key != 'example') {
this.clipboardBlock.stepDefinitions[key].forEach((step: StepType, j) => {
this.uncheckStep(step);
this.selectedScenario.stepDefinitions[key].push(JSON.parse(JSON.stringify(step)));
});
}
Expand Down Expand Up @@ -1658,6 +1666,7 @@ export class BaseEditorComponent {
Object.keys(block.stepDefinitions).forEach((key, _) => {
if (key != 'example') {
block.stepDefinitions[key].forEach((step: StepType, j) => {
this.uncheckStep(step);
this.selectedScenario.stepDefinitions[key].push(JSON.parse(JSON.stringify(step)));
});
} else if (key == 'example') {
Expand Down

0 comments on commit 1686a70

Please sign in to comment.