-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Authoring): Add step buttons navigate to add step route (#1709)
- Loading branch information
1 parent
9b43f44
commit 24108d4
Showing
30 changed files
with
366 additions
and
658 deletions.
There are no files selected for viewing
45 changes: 0 additions & 45 deletions
45
...g-tool/import-step/choose-import-step-location/choose-import-step-location.component.html
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
...g-tool/import-step/choose-import-step-location/choose-import-step-location.component.scss
This file was deleted.
Oops, something went wrong.
70 changes: 0 additions & 70 deletions
70
...ing-tool/import-step/choose-import-step-location/choose-import-step-location.component.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...assets/wise5/authoringTool/addNode/abstract-import-step/abstract-import-step.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { Directive, OnInit } from '@angular/core'; | ||
import { ActivatedRoute, Router } from '@angular/router'; | ||
import { ConfigService } from '../../../services/configService'; | ||
import { CopyNodesService } from '../../../services/copyNodesService'; | ||
import { InsertNodesService } from '../../../services/insertNodesService'; | ||
import { TeacherProjectService } from '../../../services/teacherProjectService'; | ||
|
||
@Directive() | ||
export abstract class AbstractImportStepComponent implements OnInit { | ||
protected importProjectId: number; | ||
protected nodeIdToInsertInsideOrAfter: string; | ||
|
||
constructor( | ||
protected configService: ConfigService, | ||
protected copyNodesService: CopyNodesService, | ||
protected insertNodesService: InsertNodesService, | ||
protected projectService: TeacherProjectService, | ||
protected route: ActivatedRoute, | ||
protected router: Router | ||
) {} | ||
|
||
ngOnInit(): void { | ||
this.nodeIdToInsertInsideOrAfter = history.state.nodeIdToInsertInsideOrAfter; | ||
this.importProjectId = history.state.importProjectId; | ||
} | ||
|
||
protected import(nodesToImport: any[]): void { | ||
this.copyNodesService | ||
.copyNodes(nodesToImport, this.importProjectId, this.configService.getProjectId()) | ||
.subscribe((copiedNodes: any[]) => { | ||
const nodesWithNewNodeIds = this.projectService.getNodesWithNewIds(copiedNodes); | ||
this.insertNodesService.insertNodes(nodesWithNewNodeIds, this.nodeIdToInsertInsideOrAfter); | ||
this.projectService.checkPotentialStartNodeIdChangeThenSaveProject().then(() => { | ||
this.projectService.refreshProject(); | ||
this.router.navigate(['../../..'], { relativeTo: this.route }); | ||
}); | ||
}); | ||
} | ||
} |
Oops, something went wrong.