Skip to content

Commit

Permalink
fix duplicate so you can choose which key results you wanna duplicate
Browse files Browse the repository at this point in the history
  • Loading branch information
nevio18324 committed Jan 14, 2025
1 parent 6ed9041 commit d8561be
Show file tree
Hide file tree
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
Expand Up @@ -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();

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

overviewPage.getKeyResultOfObjective(duplicatedTitle, firstKeyResultName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down

0 comments on commit d8561be

Please sign in to comment.