refactor: improve template syntax in file upload components for clarity

- Reorganized conditional rendering in file-uploading-dialog.component.html to enhance readability by using if-else statements.
- Updated upload-button.component.html to streamline the label rendering logic, ensuring consistent display of static titles and translated text.
This commit is contained in:
Denys Vuika
2026-02-26 12:49:48 +00:00
parent beb00b22ec
commit 86524ed15c
2 changed files with 17 additions and 19 deletions

View File

@@ -19,20 +19,20 @@
(click)="toggleMinimized()">
<mat-icon class="adf-upload-dialog__header-button-icon" [adf-icon]="isDialogMinimized ? 'keyboard_arrow_up' : 'keyboard_arrow_down'" />
</button>
@if (!uploadList.isUploadCancelled()) {
<span class="adf-upload-dialog__title">
{{ 'FILE_UPLOAD.MESSAGES.UPLOAD_PROGRESS'
| translate: {
completed: totalCompleted,
total: filesUploadingList.length
}
}}
</span>
}
@if (uploadList.isUploadCancelled()) {
<span class="adf-upload-dialog__title">
{{ 'FILE_UPLOAD.MESSAGES.UPLOAD_CANCELED' | translate }}
</span>
} @else {
<span class="adf-upload-dialog__title">
{{ 'FILE_UPLOAD.MESSAGES.UPLOAD_PROGRESS'
| translate: {
completed: totalCompleted,
total: filesUploadingList.length
}
}}
</span>
}
</header>
@if (totalErrors) {

View File

@@ -17,11 +17,11 @@
(click)="onClickUploadButton()"/>
<label tabindex="0" (keydown.enter)="onClickUploadButton()" for="upload-single-file" class="adf-upload-button-label">
<mat-icon class="adf-upload-button-icon" adf-icon="file_upload" />
@if (!staticTitle) {
<span id="upload-single-file-label">{{ 'FILE_UPLOAD.BUTTON.UPLOAD_FILE' | translate }}</span>
}
@if (staticTitle) {
<span id="upload-single-file-label-static"> {{ staticTitle }}</span>
} @else {
<span id="upload-single-file-label">{{ 'FILE_UPLOAD.BUTTON.UPLOAD_FILE' | translate }}</span>
}
</label>
}
@@ -39,11 +39,10 @@
(change)="onFilesAdded($event)"/>
<label for="upload-multiple-files" class="adf-upload-button-label">
<mat-icon class="adf-upload-button-icon" adf-icon="file_upload" />
@if (!staticTitle) {
<span id="upload-multiple-file-label">{{ 'FILE_UPLOAD.BUTTON.UPLOAD_FILE' | translate }}</span>
}
@if (staticTitle) {
<span id="upload-multiple-file-label-static"> {{ staticTitle }}</span>
} @else {
<span id="upload-multiple-file-label">{{ 'FILE_UPLOAD.BUTTON.UPLOAD_FILE' | translate }}</span>
}
</label>
}
@@ -65,11 +64,10 @@
(change)="onDirectoryAdded($event)"/>
<label for="uploadFolder" data-automation-id="uploadFolder" class="adf-upload-button-label">
<mat-icon class="adf-upload-button-icon" adf-icon="file_upload" />
@if (!staticTitle) {
<span id="uploadFolder-label">{{ 'FILE_UPLOAD.BUTTON.UPLOAD_FOLDER' | translate }}</span>
}
@if (staticTitle) {
<span id="uploadFolder-label-static"> {{ staticTitle }}</span>
} @else {
<span id="uploadFolder-label">{{ 'FILE_UPLOAD.BUTTON.UPLOAD_FOLDER' | translate }}</span>
}
</label>
}