-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #300 from e-picsa/feat/dashboard-translation-update
feat(dashboard): translation progress and edit
- Loading branch information
Showing
10 changed files
with
229 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 18 additions & 38 deletions
56
...a-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,21 @@ | ||
<div class="page-content"> | ||
<h2>Edit Translations</h2> | ||
@if(translationRow){ | ||
<form class="form-content"> | ||
<div class="form-data"> | ||
<label>Date of Creation</label> | ||
<div>{{ translationRow.created_at | date: 'mediumDate' }}</div> | ||
</div> | ||
<form [formGroup]="form"> | ||
<!-- Short text input --> | ||
@if(text.length<20){ | ||
<mat-form-field style="width: 320px"> | ||
<mat-label>{{ text }}</mat-label> | ||
<input matInput formControlName="value" cdkFocusInitial /> | ||
</mat-form-field> | ||
|
||
<div class="form-data"> | ||
<label>Text</label> | ||
<input matInput [(ngModel)]="translationRow.text" name="en" /> | ||
</div> | ||
|
||
<div class="form-data"> | ||
<label>mw_ny</label> | ||
<input matInput [(ngModel)]="translationRow.mw_ny" name="mw_ny" /> | ||
</div> | ||
|
||
<div class="form-data"> | ||
<label>ke_sw</label> | ||
<input matInput [(ngModel)]="translationRow.ke_sw" name="ke_sw" /> | ||
</div> | ||
<div class="form-data"> | ||
<label>tj_tg</label> | ||
<input matInput [(ngModel)]="translationRow.tj_tg" name="tj_tg" /> | ||
</div> | ||
<div class="form-data"> | ||
<label>zm_ny</label> | ||
<input matInput [(ngModel)]="translationRow.zm_ny" name="zm_ny" /> | ||
</div> | ||
<button mat-raised-button color="primary" class="submitButton" (click)="submitForm()">Update</button> | ||
</form> | ||
} @else if(dataLoadError) { | ||
<div>{{ dataLoadError }}</div> | ||
} @else { | ||
<div>Loading...</div> | ||
} @if(editActionFeedbackMessage){ | ||
<div>{{ editActionFeedbackMessage }}</div> | ||
<!-- Longer textarea input --> | ||
<mat-form-field style="width: 320px"> | ||
<p>{{ text }}</p> | ||
<textarea matInput formControlName="value" cdkFocusInitial></textarea> | ||
</mat-form-field> | ||
} | ||
</div> | ||
<!-- Action buttons --> | ||
<mat-dialog-actions> | ||
<button mat-button mat-dialog-close>Cancel</button> | ||
<button mat-button mat-dialog-close (click)="save()" [disabled]="form.invalid || form.pristine">Save</button> | ||
</mat-dialog-actions> | ||
</form> |
27 changes: 0 additions & 27 deletions
27
...a-apps/dashboard/src/app/modules/translations/pages/edit/translations-edit.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +0,0 @@ | ||
.form-content { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1.4rem; | ||
} | ||
.submitButton { | ||
width: 7rem; | ||
margin-bottom: 1rem; | ||
} | ||
.deleteButton { | ||
width: 15rem; | ||
} | ||
.form-data { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 0.5rem; | ||
} | ||
input { | ||
padding: 8px; | ||
color: var(--color-primary); | ||
outline-color: var(--color-primary); | ||
max-width: 300px; | ||
display: block; | ||
font-size: 0.9rem; | ||
white-space: pre-wrap; | ||
word-wrap: break-word; | ||
} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 20 additions & 2 deletions
22
apps/picsa-apps/dashboard/src/app/modules/translations/pages/home/translations.page.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.