Skip to content

Commit

Permalink
feat(Import Step): Move to Create New Step #1444
Browse files Browse the repository at this point in the history
  • Loading branch information
hirokiterashima committed Oct 4, 2023
1 parent 9435534 commit 3406b58
Show file tree
Hide file tree
Showing 10 changed files with 96 additions and 95 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ <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="../../.." aria-label="Cancel" 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,9 @@ <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="../../.." aria-label="cancel" 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="../../.." aria-label="cancel" 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 @@ -90,6 +90,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 @@ -103,23 +120,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
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 @@ -15,9 +15,15 @@ export class ChooseNewNodeTemplate {
icon: 'mode_edit',
route: 'add-your-own'
},
{
label: $localize`Import from Another Unit`,
description: $localize`Import a step from another unit`,
icon: 'system_update_alt',
route: 'import-step/choose-unit'
},
{
label: $localize`Automated Assessment`,
description: $localize`Automated Assessment Description`,
description: $localize`Automated Assessment`,
icon: 'fact_check',
route: 'automated-assessment/choose-item'
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 @@ -152,10 +152,6 @@ export class ProjectAuthoringComponent {
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 3406b58

Please sign in to comment.