();
@Input() nodeId: string;
+ private subscriptions = new Subscription();
constructor(
+ private dialog: MatDialog,
private projectService: TeacherProjectService,
private projectTranslationService: TeacherProjectTranslationService
) {
effect(() => {
this.setComponent();
});
+ this.subscriptions.add(
+ this.projectService.projectSaved$.subscribe(() => {
+ this.setComponent();
+ })
+ );
}
ngOnChanges(): void {
this.setComponent();
}
+ ngOnDestroy(): void {
+ this.subscriptions.unsubscribe();
+ }
+
private setComponent(): void {
// when current translations change, apply translations to a copy of the component content
// so the original component content is not modified for subsequent use.
@@ -81,4 +90,14 @@ export class ComponentAuthoringComponent {
this.nodeId
);
}
+
+ protected editComponent(): void {
+ this.dialog.open(EditComponentDialogComponent, {
+ data: {
+ componentContent: this.componentContent,
+ nodeId: this.nodeId
+ },
+ panelClass: 'dialog-xl'
+ });
+ }
}
diff --git a/src/assets/wise5/authoringTool/components/edit-component-dialog/edit-component-dialog.component.ts b/src/assets/wise5/authoringTool/components/edit-component-dialog/edit-component-dialog.component.ts
new file mode 100644
index 00000000000..bd0bb45b0ee
--- /dev/null
+++ b/src/assets/wise5/authoringTool/components/edit-component-dialog/edit-component-dialog.component.ts
@@ -0,0 +1,46 @@
+import { Component, inject, Inject } from '@angular/core';
+import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
+import { EditComponentComponent } from '../edit-component/edit-component.component';
+import { EditComponentAdvancedButtonComponent } from '../edit-component-advanced-button/edit-component-advanced-button.component';
+import { MatButtonModule } from '@angular/material/button';
+import { MatDividerModule } from '@angular/material/divider';
+import { ComponentTypeService } from '../../../services/componentTypeService';
+
+@Component({
+ imports: [
+ EditComponentAdvancedButtonComponent,
+ EditComponentComponent,
+ MatButtonModule,
+ MatDialogModule,
+ MatDividerModule
+ ],
+ template: `
+
+
Edit Activity ({{ componentTypeLabel }})
+
+
+
+
+
+
+
+
+
+
+
+ `
+})
+export class EditComponentDialogComponent {
+ protected componentTypeLabel: string;
+
+ constructor(@Inject(MAT_DIALOG_DATA) public data: any) {
+ this.componentTypeLabel = inject(ComponentTypeService).getComponentTypeLabel(
+ this.data.componentContent.type
+ );
+ }
+}
diff --git a/src/assets/wise5/authoringTool/node/node-authoring/node-authoring.component.html b/src/assets/wise5/authoringTool/node/node-authoring/node-authoring.component.html
index 0be75da4469..a77d8e31043 100644
--- a/src/assets/wise5/authoringTool/node/node-authoring/node-authoring.component.html
+++ b/src/assets/wise5/authoringTool/node/node-authoring/node-authoring.component.html
@@ -21,15 +21,8 @@
@for (component of components; track component.id; let i = $index; let last = $last) {