Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix duplicate so you can choose which key results you wanna duplicate
Browse files Browse the repository at this point in the history
nevio18324 committed Jan 14, 2025
1 parent 6ed9041 commit d8561be
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions frontend/cypress/e2e/duplicate-objective.cy.ts
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ import * as users from '../fixtures/users.json';
import CyOverviewPage from '../support/helper/dom-helper/pages/overviewPage';
import KeyResultDetailPage from '../support/helper/dom-helper/pages/keyResultDetailPage';
import ObjectiveDialog from '../support/helper/dom-helper/dialogs/objectiveDialog';
import { wait } from 'cypress-real-events/utils';

let overviewPage = new CyOverviewPage();

@@ -42,6 +43,7 @@ describe('functionality of duplicating objectives and their belonging key-result
.excludeKeyResults([secondKeyResultName,
thirdKeyResultName])
.submit();
wait(1000);

overviewPage.getKeyResultOfObjective(duplicatedTitle, firstKeyResultName);

Original file line number Diff line number Diff line change
@@ -187,7 +187,9 @@ export class ObjectiveFormComponent implements OnInit, OnDestroy {
objectiveDTO.state = 'DRAFT' as State;
return this.objectiveService.duplicateObjective(id, {
objective: objectiveDTO,
keyResultIds: this.keyResults.map((keyResult) => keyResult.id)
keyResultIds: this.keyResults
.filter((keyResult, index) => this.objectiveForm.value.keyResults?.[index] ?? false)
.map((keyResult) => keyResult.id)
});
} else {
if (this.data.action == 'releaseBacklog') {

0 comments on commit d8561be

Please sign in to comment.