Skip to content

Commit 0763139

Browse files
committed
fix: added a delete button to remove the uploaded text file
1 parent 62bf76a commit 0763139

3 files changed

Lines changed: 23 additions & 1 deletion

File tree

packages/studio-web/src/app/upload/upload.component.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,23 @@ <h1 i18n="Title for text box" class="title">Text</h1>
5858
<!-- </div> -->
5959
</div>
6060
</div>
61+
@if (studioService.textControl$.value !== null) {
62+
<div class="row">
63+
<div class="col-12 offset-xl-8 col-xl-4">
64+
<button
65+
mat-button
66+
i18n="Text delete button"
67+
class="audioControl"
68+
(click)="deleteTextUpload()"
69+
color="warn"
70+
aria-label="Delete button"
71+
>
72+
<mat-icon class="mat-icon-lg">delete</mat-icon>
73+
Delete
74+
</button>
75+
</div>
76+
</div>
77+
}
6178
</div>
6279
<div *ngIf="studioService.inputMethod.text === 'edit'">
6380
<div class="d-flex flex-row justify-content-between p-0">

packages/studio-web/src/app/upload/upload.component.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,11 @@ Please check it to make sure all words are spelled out completely, e.g. write "4
587587
);
588588
}
589589

590+
deleteTextUpload() {
591+
this.textInputElement.nativeElement.value = "";
592+
this.studioService.textControl$.setValue(null);
593+
}
594+
590595
onTextFileSelected(event: Event) {
591596
const el = event.target as HTMLInputElement;
592597
if (!el.files || el.files.length !== 1) {

packages/studio-web/src/i18n/messages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@
140140
"8550195538234658887": " In order to make a ReadAlong, we just need some {$START_BOLD_TEXT}text{$CLOSE_BOLD_TEXT}, and corresponding {$START_BOLD_TEXT}audio{$CLOSE_BOLD_TEXT}. ",
141141
"6162693758764653365": "Text",
142142
"323794992596449638": "Select a plain text file (.txt) or a ReadAlong Studio temporary file (.readalong)",
143+
"5050307465636924350": "{$START_TAG_MAT_ICON}delete{$CLOSE_TAG_MAT_ICON} Delete ",
143144
"6329500169661407619": " Write or paste your text here ",
144145
"887019029800317757": "{$START_TAG_MAT_ICON}help_outline{$CLOSE_TAG_MAT_ICON} Format ",
145146
"4289685560479120097": "{$START_TAG_MAT_ICON}save{$CLOSE_TAG_MAT_ICON} Save a copy ",
@@ -153,7 +154,6 @@
153154
"6543643564103016190": "Recording",
154155
"8066570559817495723": "{$START_TAG_MAT_ICON}stop_circle{$CLOSE_TAG_MAT_ICON} Stop ",
155156
"6710230498600005462": "{$START_TAG_MAT_ICON}play_circle{$CLOSE_TAG_MAT_ICON} Play ",
156-
"5050307465636924350": "{$START_TAG_MAT_ICON}delete{$CLOSE_TAG_MAT_ICON} Delete ",
157157
"7273199130532280751": " Optional: Change language settings ",
158158
"643724100310033610": " Most of the time, you should just use the default selected below. You can also select a specific language if it is supported for improved results. If the default does not work well for you and your language is not supported, have a look at {$START_LINK}{$START_TAG_MAT_ICON}launch{$CLOSE_TAG_MAT_ICON} this blog post series{$CLOSE_LINK} to understand how you might get support for your language, or {$START_LINK_1}{$START_TAG_MAT_ICON}mail{$CLOSE_TAG_MAT_ICON} contact us{$CLOSE_LINK} for more info! ",
159159
"7777031358286609836": "Default (should work with most languages)",

0 commit comments

Comments
 (0)