[ACS-4295] Label is not persistent as placeholder is being used as the only visual label for a text field (#8211)

* Label is not persistent as placeholder is being used as the only visual label for a text field, so now added title too

* review comments addressed

* changes for placeholder and mat-label after discussion with shane

* failing unit tests correction
This commit is contained in:
Jatin Chugh 2023-03-29 19:21:16 +05:30 committed by GitHub
parent bf5352cbe9
commit 2f80607520
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 5 deletions

View File

@ -26,7 +26,7 @@
*ngIf="showDropdownSiteList" *ngIf="showDropdownSiteList"
class="full-width" class="full-width"
(change)="siteChanged($event)" (change)="siteChanged($event)"
[placeholder]="'NODE_SELECTOR.SELECT_LOCATION'" [placeholder]="'NODE_SELECTOR.SELECT_LIBRARY'"
[hideMyFiles]="dropdownHideMyFiles" [hideMyFiles]="dropdownHideMyFiles"
[siteList]="dropdownSiteList" [siteList]="dropdownSiteList"
[value]="startSiteGuid" [value]="startSiteGuid"

View File

@ -94,12 +94,13 @@
"CHOOSE_ITEM": "Select content to attach from '{{ name }}'", "CHOOSE_ITEM": "Select content to attach from '{{ name }}'",
"COPY": "Copy", "COPY": "Copy",
"COPY_ITEM": "Copy '{{ name }}' to...", "COPY_ITEM": "Copy '{{ name }}' to...",
"LOCATION": "Location",
"MOVE": "Move", "MOVE": "Move",
"MOVE_ITEM": "Move '{{ name }}' to...", "MOVE_ITEM": "Move '{{ name }}' to...",
"NO_RESULTS": "No results found", "NO_RESULTS": "No results found",
"SEARCH": "Search", "SEARCH": "Search",
"SEARCH_RESULTS": "Search results", "SEARCH_RESULTS": "Search results",
"SELECT_LOCATION": "Select Location", "SELECT_LIBRARY": "Select a Library",
"UPLOAD_BUTTON_SEARCH_WARNING_MESSAGE": "You can't upload a file whilst a search is still running", "UPLOAD_BUTTON_SEARCH_WARNING_MESSAGE": "You can't upload a file whilst a search is still running",
"UPLOAD_BUTTON_PERMISSION_WARNING_MESSAGE": "User doesn't have permission to upload content to the folder", "UPLOAD_BUTTON_PERMISSION_WARNING_MESSAGE": "User doesn't have permission to upload content to the folder",
"REPOSITORY": "Repository", "REPOSITORY": "Repository",

View File

@ -1,5 +1,6 @@
<div id="site-dropdown-container" class="adf-site-dropdown-container"> <div id="site-dropdown-container" class="adf-site-dropdown-container">
<mat-form-field> <mat-form-field>
<mat-label>{{ 'NODE_SELECTOR.LOCATION' | translate }}</mat-label>
<mat-select <mat-select
adf-infinite-select-scroll adf-infinite-select-scroll
(scrollEnd)="loadAllOnScroll()" (scrollEnd)="loadAllOnScroll()"

View File

@ -161,11 +161,11 @@ describe('DropdownSitesComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
await fixture.whenStable(); await fixture.whenStable();
expect(fixture.nativeElement.innerText.trim()).toContain('DROPDOWN.PLACEHOLDER_LABEL'); expect(fixture.nativeElement.innerText.trim()).toContain('NODE_SELECTOR.LOCATION');
}); });
it('should show custom placeholder label when the "placeholder" input property is given a value', async () => { it('should show custom placeholder label when the "placeholder" input property is given a value', async () => {
component.placeholder = 'NODE_SELECTOR.SELECT_LOCATION'; component.placeholder = 'NODE_SELECTOR.SELECT_LIBRARY';
fixture.detectChanges(); fixture.detectChanges();
await fixture.whenStable(); await fixture.whenStable();
@ -175,7 +175,7 @@ describe('DropdownSitesComponent', () => {
fixture.detectChanges(); fixture.detectChanges();
await fixture.whenStable(); await fixture.whenStable();
expect(fixture.nativeElement.innerText.trim()).toContain('NODE_SELECTOR.SELECT_LOCATION'); expect(fixture.nativeElement.innerText.trim()).toContain('NODE_SELECTOR.LOCATION');
}); });
it('should load custom sites when the "siteList" input property is given a value', async () => { it('should load custom sites when the "siteList" input property is given a value', async () => {