mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-15 05:53:03 +00:00
60168: Browse-by startsWith text component
This commit is contained in:
@@ -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": {
|
||||
|
@@ -123,7 +123,11 @@ export class BrowseByMetadataPageComponent implements OnInit {
|
||||
}
|
||||
this.updateParent(params.scope);
|
||||
}));
|
||||
this.startsWithOptions = [];
|
||||
this.updateStartsWithTextOptions();
|
||||
}
|
||||
|
||||
updateStartsWithTextOptions() {
|
||||
this.startsWithOptions = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -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 {
|
||||
|
@@ -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;
|
||||
*/
|
||||
|
@@ -1 +1,17 @@
|
||||
<!-- To be implemented -->
|
||||
<form class="w-100" [formGroup]="formData" (ngSubmit)="submitForm(formData.value)">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<ul class="list-inline">
|
||||
<li class="list-inline-item" *ngFor="let option of startsWithOptions">
|
||||
<a [routerLink]="[]" [queryParams]="{startsWith: option}" queryParamsHandling="merge">{{option}}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="form-group input-group col-6">
|
||||
<input class="form-control" placeholder="{{'browse.startsWith.type_text' | translate}}" type="text" name="startsWith" formControlName="startsWith" [value]="getStartsWithAsText()" />
|
||||
<span class="input-group-append">
|
||||
<button class="btn btn-secondary" type="submit">{{'browse.startsWith.submit' | translate}}</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
Reference in New Issue
Block a user