mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-04-23 22:30:37 +00:00
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:
@@ -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) {
|
||||
|
||||
@@ -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>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user