Skip to content

Commit 7b1c5cd

Browse files
authored
Issue ED-1099 merge: Merge pull request #3307 from shikshalokam/release-5.1.0-mlcert
Issue ED-1099 fix: back button issue in project details page
2 parents 927d94d + ebf9d26 commit 7b1c5cd

File tree

2 files changed

+31
-16
lines changed

2 files changed

+31
-16
lines changed

src/app/components/popups/sb-profile-name-confirmation-popup/sb-profile-name-confirmation-popup.component.spec.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ describe('ProfileNameConfirmationPopoverComponent', () => {
8686
});
8787

8888
describe('onProfilePageClick test-suites', () => {
89-
it('should generate telemetry and navigate to district mapping if network is available', () => {
89+
it('should generate telemetry and navigate to district mapping if network is available, if no project content', () => {
9090
// arrange
9191
// act
9292
profileNameConfirmationPopoverComponent.projectContent = "Project content";
@@ -99,5 +99,18 @@ describe('ProfileNameConfirmationPopoverComponent', () => {
9999
);
100100
expect(mockPopoverCtrl.dismiss).toHaveBeenCalledWith({ editProfileClicked: true });
101101
});
102+
it('should generate telemetry and navigate to district mapping if network is available, if no project content', () => {
103+
// arrange
104+
// act
105+
profileNameConfirmationPopoverComponent.projectContent = "";
106+
profileNameConfirmationPopoverComponent.onProfilePageClick();
107+
// assert
108+
expect(mockNavService.navigateToEditPersonalDetails).toHaveBeenCalledWith(
109+
mockProfileData,
110+
PageId.PROFILE_NAME_CONFIRMATION_POPUP,
111+
''
112+
);
113+
expect(mockPopoverCtrl.dismiss).toHaveBeenCalledWith({ editProfileClicked: true });
114+
});
102115
});
103-
});
116+
});

src/app/manage-learn/project/project-templateview/project-templateview.page.ts

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ export class ProjectTemplateviewPage implements OnInit {
260260
}
261261

262262
async start() {
263+
await this.router.navigate([`/${RouterLinks.HOME}`]);
263264
if (this.stateData?.referenceFrom === 'link') {
264265
this.startProjectsFromLink();
265266
} else if (this.project.projectId) {
@@ -356,6 +357,21 @@ export class ProjectTemplateviewPage implements OnInit {
356357
})
357358
}
358359
private async showProfileNameConfirmationPopup() {
360+
let params ={
361+
isTargeted :this.isTargeted,
362+
programId: this.programId,
363+
solutionId :this.solutionId,
364+
isATargetedSolution :this.isATargetedSolution ,
365+
type :this.isAssignedProject ? 'assignedToMe' : 'createdByMe'
366+
}
367+
this.router.navigate([`${RouterLinks.PROJECT}/${RouterLinks.PROJECT_TEMPLATE}`, this.solutionId], {
368+
queryParams: params,
369+
skipLocationChange: false,
370+
replaceUrl: true,
371+
state: {
372+
"referenceFrom": "link",
373+
}})
374+
359375
this.clickedOnProfile = true;
360376
const popUp = await this.popoverController.create({
361377
component: ProfileNameConfirmationPopoverComponent,
@@ -368,20 +384,6 @@ export class ProjectTemplateviewPage implements OnInit {
368384
const { data } = await popUp.onDidDismiss();
369385
if (data !== undefined) {
370386
if (data.buttonClicked) {
371-
let params ={
372-
isTargeted :this.isTargeted,
373-
programId: this.programId,
374-
solutionId :this.solutionId,
375-
isATargetedSolution :this.isATargetedSolution ,
376-
type :this.isAssignedProject ? 'assignedToMe' : 'createdByMe'
377-
}
378-
this.router.navigate([`${RouterLinks.PROJECT}/${RouterLinks.PROJECT_TEMPLATE}`, this.solutionId], {
379-
queryParams: params,
380-
skipLocationChange: false,
381-
replaceUrl: true,
382-
state: {
383-
"referenceFrom": "link",
384-
}})
385387
this.isStarted = true;
386388
this.clickedOnProfile = false;
387389
this.doAction();

0 commit comments

Comments
 (0)