Skip to content

Commit

Permalink
feat(Authoring): Collapse components (#1201)
Browse files Browse the repository at this point in the history
Co-authored-by: Jonathan Lim-Breitbart <[email protected]>
  • Loading branch information
geoffreykwan and breity authored Apr 28, 2023
1 parent 47b3c84 commit 1ce0124
Show file tree
Hide file tree
Showing 7 changed files with 221 additions and 138 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ export class ChooseImportStepLocationComponent {
this.ProjectService.checkPotentialStartNodeIdChangeThenSaveProject().then(() => {
this.ProjectService.refreshProject();
if (nodesWithNewNodeIds.length === 1) {
const newNode = nodesWithNewNodeIds[0];
this.upgrade.$injector
.get('$state')
.go('root.at.project.node', { nodeId: nodesWithNewNodeIds[0].id });
.go('root.at.project.node', { nodeId: newNode.id, newComponents: newNode.components });
} else {
this.upgrade.$injector.get('$state').go('root.at.project');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class ChooseNewNodeLocation {
this.upgrade.$injector.get('$stateParams').initialComponents
);
this.save(newNode.id).then(() => {
this.goToNode(newNode.id);
this.goToNode(newNode);
});
}

Expand All @@ -54,8 +54,10 @@ export class ChooseNewNodeLocation {
});
}

goToNode(nodeId: string) {
this.upgrade.$injector.get('$state').go('root.at.project.node', { nodeId: nodeId });
private goToNode(node: any): void {
this.upgrade.$injector
.get('$state')
.go('root.at.project.node', { nodeId: node.id, newComponents: node.components });
}

isGroupNode(nodeId: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
matTooltip="Preview Component"
matTooltipPosition="above"
i18n-matTooltip
(click)="popUpComponentPreview()"
(click)="popUpComponentPreview($event)"
>
<mat-icon>visibility</mat-icon>
</button>
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export class PreviewComponentButtonComponent implements OnInit {

ngOnInit(): void {}

popUpComponentPreview(): void {
popUpComponentPreview(event: any): void {
event.stopPropagation();
const dialogRef = this.dialog.open(PreviewComponentDialogComponent, {
panelClass: 'dialog-lg'
});
Expand Down
2 changes: 2 additions & 0 deletions src/assets/wise5/authoringTool/i18n/i18n_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@
"scriptFilename": "Script Filename",
"selectAStepToImport": "Please select a step a import.",
"selectAuthorableProject": "Select Authorable Unit",
"selectComponent": "Select component",
"selectLibraryProject": "Select Library Unit",
"selectMyProject": "Select My Unit",
"selfDirectedInvestigation.label": "Self-Directed Investigation",
Expand Down Expand Up @@ -376,6 +377,7 @@
"thisComponent": "This Component",
"thisProjectDoesNotHaveAProjectIcon": "This unit does not have a unit icon.",
"title": "Title",
"toggleComponentAuthoring": "Toggle component authoring",
"toStep": "To Step",
"transitionCriteria": "Which criteria should match to use this path",
"transitionCriteriaComponent": "Which Component in this step to check for criteria",
Expand Down
Loading

0 comments on commit 1ce0124

Please sign in to comment.