Skip to content

Commit

Permalink
feat(Import Step): Move to Create New Step Menu (#1445)
Browse files Browse the repository at this point in the history
Co-authored-by: Jonathan Lim-Breitbart <breity10@gmail.com>
  • Loading branch information
hirokiterashima and breity authored Oct 12, 2023
1 parent 8addd6b commit 2ff3f69
Show file tree
Hide file tree
Showing 11 changed files with 64 additions and 93 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ <h5 i18n>Choose a location for the imported steps.</h5>
<div class="nav-controls">
<mat-divider></mat-divider>
<div fxLayout="row" fxLayoutAlign="end center">
<button mat-button color="primary" routerLink="../.." aria-label="Cancel" i18n>Cancel</button>
<button mat-button color="primary" routerLink="../../.." i18n>Cancel</button>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ export class ChooseImportStepLocationComponent {
this.projectService.refreshProject();
if (nodesWithNewNodeIds.length === 1) {
const newNode = nodesWithNewNodeIds[0];
this.router.navigate(['../../node', newNode.id], {
this.router.navigate(['../../../node', newNode.id], {
relativeTo: this.route,
state: {
newComponents: newNode.components
}
});
} else {
this.router.navigate(['../..'], { relativeTo: this.route });
this.router.navigate(['../../..'], { relativeTo: this.route });
}
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ <h6 *ngIf="item.order != 0 && item.node.type == 'group'">
Back
</button>
<span fxFlex></span>
<button mat-button color="primary" routerLink="../.." aria-label="cancel" i18n>Cancel</button>
<button mat-button color="primary" routerLink="../../.." i18n>Cancel</button>
<button
mat-raised-button
color="primary"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ <h5 i18n>Choose a unit from which to import step(s).</h5>
<div class="nav-controls">
<mat-divider></mat-divider>
<div fxLayout="row" fxLayoutGap="16px" fxLayoutAlign="end center">
<button mat-button color="primary" routerLink="../.." aria-label="cancel" i18n>Cancel</button>
<button mat-button color="primary" routerLink="../../choose-template" i18n>Back</button>
<span fxFlex></span>
<button mat-button color="primary" routerLink="../../.." i18n>Cancel</button>
</div>
</div>
34 changes: 17 additions & 17 deletions src/app/teacher/authoring-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,23 @@ const routes: Routes = [
path: 'choose-location',
component: ChooseNewNodeLocation
},
{
path: 'import-step',
children: [
{
path: 'choose-location',
component: ChooseImportStepLocationComponent
},
{
path: 'choose-step',
component: ChooseImportStepComponent
},
{
path: 'choose-unit',
component: ChooseImportUnitComponent
}
]
},
{
path: 'simulation',
children: [{ path: 'choose-item', component: ChooseSimulationComponent }]
Expand All @@ -104,23 +121,6 @@ const routes: Routes = [
},
{ path: 'choose-copy-location', component: ChooseCopyNodeLocationComponent },
{ path: 'choose-move-location', component: ChooseMoveNodeLocationComponent },
{
path: 'import-step',
children: [
{
path: 'choose-location',
component: ChooseImportStepLocationComponent
},
{
path: 'choose-step',
component: ChooseImportStepComponent
},
{
path: 'choose-unit',
component: ChooseImportUnitComponent
}
]
},
{ path: 'info', component: ProjectInfoAuthoringComponent },
{ path: 'milestones', component: MilestonesAuthoringComponent },
{
Expand Down
1 change: 0 additions & 1 deletion src/assets/wise5/authoringTool/addNode/NewNodeTemplate.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export interface NewNodeTemplate {
label: string;
description: string;
icon: string;
route: string;
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h5 i18n>Start from scratch or choose a step template:</h5>
<h5 i18n>Start from scratch, import from another unit, or choose a step template:</h5>
<div fxLayout="row wrap" fxLayout.xs="column">
<div
class="template"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,21 @@ export class ChooseNewNodeTemplate {
protected templates: NewNodeTemplate[] = [
{
label: $localize`Create Your Own`,
description: $localize`Create Your Own Description`,
icon: 'mode_edit',
route: 'add-your-own'
},
{
label: $localize`Import From Another Unit`,
icon: 'system_update_alt',
route: 'import-step/choose-unit'
},
{
label: $localize`Automated Assessment`,
description: $localize`Automated Assessment Description`,
icon: 'fact_check',
route: 'automated-assessment/choose-item'
},
{
label: $localize`Interactive Simulation`,
description: $localize`Add an existing interactive simulation`,
icon: 'video_settings',
route: 'simulation/choose-item'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
<button
mat-raised-button
color="primary"
(click)="createNewLesson()"
(click)="addNewLesson()"
[disabled]="stepNodeSelected || groupNodeSelected"
matTooltip="Create New Lesson"
matTooltip="Add New Lesson"
matTooltipPosition="above"
i18n-matTooltip
>
Expand All @@ -24,9 +24,9 @@
<button
mat-raised-button
color="primary"
(click)="createNewStep()"
(click)="addNewStep()"
[disabled]="stepNodeSelected || groupNodeSelected"
matTooltip="Create New Step"
matTooltip="Add New Step"
matTooltipPosition="above"
i18n-matTooltip
>
Expand All @@ -43,17 +43,6 @@
>
<mat-icon>widgets</mat-icon>
</button>
<button
mat-raised-button
color="primary"
(click)="importStep()"
[disabled]="stepNodeSelected || groupNodeSelected"
matTooltip="Import Step"
matTooltipPosition="above"
i18n-matTooltip
>
<mat-icon>system_update_alt</mat-icon>
</button>
<button
mat-raised-button
color="primary"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,22 +141,18 @@ export class ProjectAuthoringComponent {
this.groupNodeSelected = false;
}

protected createNewLesson(): void {
protected addNewLesson(): void {
this.router.navigate([`/teacher/edit/unit/${this.projectId}/add-lesson/configure`]);
}

protected createNewStep(): void {
protected addNewStep(): void {
this.router.navigate([`/teacher/edit/unit/${this.projectId}/add-node/choose-template`]);
}

protected addStructure(): void {
this.router.navigate([`/teacher/edit/unit/${this.projectId}/structure/choose`]);
}

protected importStep(): void {
this.router.navigate([`/teacher/edit/unit/${this.projectId}/import-step/choose-unit`]);
}

protected goToAdvancedAuthoring(): void {
this.router.navigate([`/teacher/edit/unit/${this.projectId}/advanced`]);
}
Expand Down
Loading

0 comments on commit 2ff3f69

Please sign in to comment.