Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Multiple Languages): Convert EditComponentPrompt input to TranslatableInput #1585

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<mat-form-field class="prompt" appearance="fill">
<mat-label i18n>Prompt</mat-label>
<textarea
matInput
[(ngModel)]="prompt"
(ngModelChange)="promptChangedEvent.next($event)"
placeholder="Enter Prompt Here"
i18n-placeholder
cdkTextareaAutosize
>
</textarea>
</mat-form-field>
<translatable-input [content]="componentContent" key="prompt" class="prompt" appearance="fill">
<mat-form-field>
<mat-label i18n>Prompt</mat-label>
<textarea
matInput
[(ngModel)]="componentContent.prompt"
(ngModelChange)="promptChangedEvent.next($event)"
placeholder="Enter Prompt Here"
i18n-placeholder
cdkTextareaAutosize
>
</textarea>
</mat-form-field>
</translatable-input>
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { ComponentContent } from '../../../assets/wise5/common/ComponentContent';

@Component({
selector: 'edit-component-prompt',
styles: ['.prompt {width: 100%; }'],
styles: ['.prompt {width: 100%; mat-form-field { width:100%} }'],
templateUrl: 'edit-component-prompt.component.html'
})
export class EditComponentPrompt {
@Input()
prompt: string;

@Output()
promptChangedEvent = new EventEmitter<string>();
@Input() componentContent: ComponentContent;
@Output() promptChangedEvent = new EventEmitter<string>();
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<edit-component-prompt
[prompt]="componentContent.prompt"
[componentContent]="componentContent"
(promptChangedEvent)="promptChanged($event)"
></edit-component-prompt>
<div fxLayout="row">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<edit-component-prompt
[prompt]="componentContent.prompt"
[componentContent]="componentContent"
(promptChangedEvent)="promptChanged($event)"
></edit-component-prompt>
<span i18n>Oscillator Types</span>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div fxLayout="column" fxLayoutGap="16px">
<edit-component-prompt
[prompt]="componentContent.prompt"
[componentContent]="componentContent"
(promptChangedEvent)="promptChanged($event)"
></edit-component-prompt>
<div fxLayoutGap="16px">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div fxLayout="column" fxLayoutGap="16px">
<edit-component-prompt
[prompt]="componentContent.prompt"
[componentContent]="componentContent"
(promptChangedEvent)="promptChanged($event)"
></edit-component-prompt>
<mat-form-field>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<edit-component-prompt
[prompt]="componentContent.prompt"
[componentContent]="componentContent"
(promptChangedEvent)="promptChanged($event)"
></edit-component-prompt>
<div class="checkbox-container">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<edit-component-prompt
[prompt]="componentContent.prompt"
[componentContent]="componentContent"
(promptChangedEvent)="promptChanged($event)"
></edit-component-prompt>
<div fxLayout="row" fxLayoutAlign="start center">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<edit-component-prompt
[prompt]="componentContent.prompt"
[componentContent]="componentContent"
(promptChangedEvent)="promptChanged($event)"
></edit-component-prompt>
<div fxLayout="row wrap">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<edit-component-prompt
[prompt]="componentContent.prompt"
[componentContent]="componentContent"
(promptChangedEvent)="promptChanged($event)"
></edit-component-prompt>
<div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<edit-component-prompt
[prompt]="componentContent.prompt"
[componentContent]="componentContent"
(promptChangedEvent)="promptChanged($event)"
></edit-component-prompt>
<p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<edit-component-prompt
[prompt]="componentContent.prompt"
[componentContent]="componentContent"
(promptChangedEvent)="promptChanged($event)"
></edit-component-prompt>
<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
>announcement</mat-icon
>
<edit-component-prompt
[prompt]="componentContent.prompt"
[componentContent]="componentContent"
(promptChangedEvent)="promptChanged($event)"
></edit-component-prompt>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<edit-component-prompt
*ngIf="!componentContent.dynamicPrompt?.enabled"
[prompt]="componentContent.prompt"
[componentContent]="componentContent"
(promptChangedEvent)="promptChanged($event)"
></edit-component-prompt>
<edit-dynamic-prompt
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<edit-component-prompt
[prompt]="componentContent.prompt"
[componentContent]="componentContent"
(promptChangedEvent)="promptChanged($event)"
></edit-component-prompt>
<div fxLayoutGap="20px">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<edit-component-prompt
[prompt]="componentContent.prompt"
[componentContent]="componentContent"
(promptChangedEvent)="promptChanged($event)"
></edit-component-prompt>
<div fxLayoutGap="20px">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<edit-component-prompt
[prompt]="componentContent.prompt"
[componentContent]="componentContent"
(promptChangedEvent)="promptChanged($event)"
></edit-component-prompt>
<p i18n>Choose the step and component to show the summary data for:</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<edit-component-prompt
[prompt]="componentContent.prompt"
[componentContent]="componentContent"
(promptChangedEvent)="promptChanged($event)"
></edit-component-prompt>
<div fxLayout="row wrap">
Expand Down
4 changes: 2 additions & 2 deletions src/messages.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ Click &quot;Cancel&quot; to keep the invalid JSON open so you can fix it.</sourc
<source>Prompt</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/authoring-tool/edit-component-prompt/edit-component-prompt.component.html</context>
<context context-type="linenumber">2</context>
<context context-type="linenumber">3</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/app/authoring-tool/edit-dynamic-prompt-rules/edit-dynamic-prompt-rules.component.html</context>
Expand All @@ -986,7 +986,7 @@ Click &quot;Cancel&quot; to keep the invalid JSON open so you can fix it.</sourc
<source>Enter Prompt Here</source>
<context-group purpose="location">
<context context-type="sourcefile">src/app/authoring-tool/edit-component-prompt/edit-component-prompt.component.html</context>
<context context-type="linenumber">7</context>
<context context-type="linenumber">8</context>
</context-group>
</trans-unit>
<trans-unit id="7affaae0e14529c0192d5a4bfabd6fcb1ea27529" datatype="html">
Expand Down