diff --git a/resources/i18n/en.json b/resources/i18n/en.json index a9a456df33..b1e76631f0 100644 --- a/resources/i18n/en.json +++ b/resources/i18n/en.json @@ -285,6 +285,7 @@ "jump": "Jump to a point in the index:", "choose_year": "(Choose year)", "type_year": "Or type in a year:", + "type_text": "Or enter first few letters:", "submit": "Go" }, "metadata": { diff --git a/src/app/+browse-by/+browse-by-metadata-page/browse-by-metadata-page.component.ts b/src/app/+browse-by/+browse-by-metadata-page/browse-by-metadata-page.component.ts index cfd8c74107..79a8ff0421 100644 --- a/src/app/+browse-by/+browse-by-metadata-page/browse-by-metadata-page.component.ts +++ b/src/app/+browse-by/+browse-by-metadata-page/browse-by-metadata-page.component.ts @@ -123,7 +123,11 @@ export class BrowseByMetadataPageComponent implements OnInit { } this.updateParent(params.scope); })); - this.startsWithOptions = []; + this.updateStartsWithTextOptions(); + } + + updateStartsWithTextOptions() { + this.startsWithOptions = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split(''); } /** diff --git a/src/app/+browse-by/+browse-by-title-page/browse-by-title-page.component.ts b/src/app/+browse-by/+browse-by-title-page/browse-by-title-page.component.ts index 8703193dc5..717275bf8b 100644 --- a/src/app/+browse-by/+browse-by-title-page/browse-by-title-page.component.ts +++ b/src/app/+browse-by/+browse-by-title-page/browse-by-title-page.component.ts @@ -45,7 +45,7 @@ export class BrowseByTitlePageComponent extends BrowseByMetadataPageComponent { this.updatePageWithItems(browseParamsToOptions(params, this.paginationConfig, this.sortConfig, this.metadata), undefined); this.updateParent(params.scope) })); - this.startsWithOptions = []; + this.updateStartsWithTextOptions(); } ngOnDestroy(): void { diff --git a/src/app/shared/browse-by/browse-by-starts-with/browse-by-starts-with-abstract.component.ts b/src/app/shared/browse-by/browse-by-starts-with/browse-by-starts-with-abstract.component.ts index a51ad5e2ea..97030f7cdf 100644 --- a/src/app/shared/browse-by/browse-by-starts-with/browse-by-starts-with-abstract.component.ts +++ b/src/app/shared/browse-by/browse-by-starts-with/browse-by-starts-with-abstract.component.ts @@ -39,6 +39,14 @@ export class BrowseByStartsWithAbstractComponent implements OnInit, OnDestroy { }); } + getStartsWithAsText() { + if (hasValue(this.startsWith)) { + return this.startsWith; + } else { + return ''; + } + } + /** * Get startsWith as a number; */ diff --git a/src/app/shared/browse-by/browse-by-starts-with/text/browse-by-starts-with-text.component.html b/src/app/shared/browse-by/browse-by-starts-with/text/browse-by-starts-with-text.component.html index 7a1b58e832..5255423d81 100644 --- a/src/app/shared/browse-by/browse-by-starts-with/text/browse-by-starts-with-text.component.html +++ b/src/app/shared/browse-by/browse-by-starts-with/text/browse-by-starts-with-text.component.html @@ -1 +1,17 @@ - +