Skip to content

Commit

Permalink
feat(Node Authoring): Default step title (#1404)
Browse files Browse the repository at this point in the history
  • Loading branch information
hirokiterashima authored Sep 7, 2023
1 parent a711878 commit b711c7a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
<form role="form" [formGroup]="addNodeFormGroup">
<mat-form-field appearance="fill" class="title-field">
<mat-label i18n>Step Title</mat-label>
<input
#titleField
autofocus
matInput
type="text"
id="title"
name="title"
formControlName="title"
required
/>
<input matInput type="text" id="title" name="title" formControlName="title" required />
<mat-error *ngIf="addNodeFormGroup.controls['title'].hasError('required')" i18n>
Step Title is required
</mat-error>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, ElementRef, ViewChild } from '@angular/core';
import { Component } from '@angular/core';
import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop';
import { FormControl, FormGroup, Validators, FormBuilder } from '@angular/forms';
import { ComponentTypeService } from '../../../services/componentTypeService';
Expand All @@ -11,11 +11,10 @@ import { ActivatedRoute, Router } from '@angular/router';
})
export class AddYourOwnNode {
protected addNodeFormGroup: FormGroup = this.fb.group({
title: new FormControl('', [Validators.required])
title: new FormControl($localize`New Step`, [Validators.required])
});
protected componentTypes: any[];
protected initialComponents: string[] = [];
protected title: string;

constructor(
private componentTypeService: ComponentTypeService,
Expand All @@ -28,11 +27,6 @@ export class AddYourOwnNode {
this.componentTypes = this.componentTypeService.getComponentTypes();
}

@ViewChild('titleField') titleField: ElementRef;
ngAfterViewInit() {
this.titleField.nativeElement.focus();
}

protected addComponent(componentType: any): void {
this.initialComponents.push(componentType);
}
Expand Down
23 changes: 15 additions & 8 deletions src/messages.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -8886,7 +8886,7 @@ Click &quot;Cancel&quot; to keep the invalid JSON open so you can fix it.</sourc
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/authoringTool/addNode/add-your-own-node/add-your-own-node.component.html</context>
<context context-type="linenumber">69,71</context>
<context context-type="linenumber">60,62</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/vle/dismiss-ambient-notification-dialog/dismiss-ambient-notification-dialog.component.html</context>
Expand All @@ -8901,7 +8901,7 @@ Click &quot;Cancel&quot; to keep the invalid JSON open so you can fix it.</sourc
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/authoringTool/addNode/add-your-own-node/add-your-own-node.component.html</context>
<context context-type="linenumber">79,81</context>
<context context-type="linenumber">70,72</context>
</context-group>
</trans-unit>
<trans-unit id="891f639ffcf9d31aea80ea7e8e428a6597b059b3" datatype="html">
Expand All @@ -8915,42 +8915,49 @@ Click &quot;Cancel&quot; to keep the invalid JSON open so you can fix it.</sourc
<source> Step Title is required </source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/authoringTool/addNode/add-your-own-node/add-your-own-node.component.html</context>
<context context-type="linenumber">14,16</context>
<context context-type="linenumber">5,7</context>
</context-group>
</trans-unit>
<trans-unit id="9ff39e032b731c11440ba7faf5eacbbc0ec420e7" datatype="html">
<source>Select components to add to your new step (optional):</source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/authoringTool/addNode/add-your-own-node/add-your-own-node.component.html</context>
<context context-type="linenumber">18</context>
<context context-type="linenumber">9</context>
</context-group>
</trans-unit>
<trans-unit id="a281da0bb5751e01fce4228df3c09a4479fbf124" datatype="html">
<source>No components added</source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/authoringTool/addNode/add-your-own-node/add-your-own-node.component.html</context>
<context context-type="linenumber">21</context>
<context context-type="linenumber">12</context>
</context-group>
</trans-unit>
<trans-unit id="1b3029e37dfc811eb2cc8cd5511570177ecae18a" datatype="html">
<source>Delete component</source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/authoringTool/addNode/add-your-own-node/add-your-own-node.component.html</context>
<context context-type="linenumber">43</context>
<context context-type="linenumber">34</context>
</context-group>
</trans-unit>
<trans-unit id="607d049f4ce5dc907dd7a1cfdac6241e79eb1917" datatype="html">
<source> *Note: You can always add or remove content later by editing the step. </source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/authoringTool/addNode/add-your-own-node/add-your-own-node.component.html</context>
<context context-type="linenumber">58,60</context>
<context context-type="linenumber">49,51</context>
</context-group>
</trans-unit>
<trans-unit id="fd966a55a9d8174e64bf096d0247ba9e1659008e" datatype="html">
<source> Back </source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/authoringTool/addNode/add-your-own-node/add-your-own-node.component.html</context>
<context context-type="linenumber">65,67</context>
<context context-type="linenumber">56,58</context>
</context-group>
</trans-unit>
<trans-unit id="6009535360963985115" datatype="html">
<source>New Step</source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/authoringTool/addNode/add-your-own-node/add-your-own-node.component.ts</context>
<context context-type="linenumber">14</context>
</context-group>
</trans-unit>
<trans-unit id="909afacc2d9d62ea57b1ba4b1e70b6c4314f668d" datatype="html">
Expand Down

0 comments on commit b711c7a

Please sign in to comment.