mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 07:23:03 +00:00
documentation update
This commit is contained in:
@@ -11,13 +11,28 @@ import { hasValue, isNotEmpty } from '../../shared/empty.util';
|
|||||||
templateUrl: './search-labels.component.html',
|
templateUrl: './search-labels.component.html',
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Component that represents the labels containing the currently active filters
|
||||||
|
*/
|
||||||
export class SearchLabelsComponent {
|
export class SearchLabelsComponent {
|
||||||
|
/**
|
||||||
|
* Emits the currently active filters
|
||||||
|
*/
|
||||||
appliedFilters: Observable<Params>;
|
appliedFilters: Observable<Params>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize the instance variable
|
||||||
|
*/
|
||||||
constructor(private searchService: SearchService, private filterService: SearchFilterService) {
|
constructor(private searchService: SearchService, private filterService: SearchFilterService) {
|
||||||
this.appliedFilters = this.filterService.getCurrentFrontendFilters();
|
this.appliedFilters = this.filterService.getCurrentFrontendFilters();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculates the parameters that should change if a given value for the given filter would be removed from the active filters
|
||||||
|
* @param {string} filterField The filter field parameter name from which the value should be removed
|
||||||
|
* @param {string} filterValue The value that is removed for this given filter field
|
||||||
|
* @returns {Observable<Params>} The changed filter parameters
|
||||||
|
*/
|
||||||
getRemoveParams(filterField: string, filterValue: string): Observable<Params> {
|
getRemoveParams(filterField: string, filterValue: string): Observable<Params> {
|
||||||
return this.appliedFilters.pipe(
|
return this.appliedFilters.pipe(
|
||||||
map((filters) => {
|
map((filters) => {
|
||||||
@@ -31,6 +46,9 @@ export class SearchLabelsComponent {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @returns {string} The base path to the search page
|
||||||
|
*/
|
||||||
getSearchLink() {
|
getSearchLink() {
|
||||||
return this.searchService.getSearchLink();
|
return this.searchService.getSearchLink();
|
||||||
}
|
}
|
||||||
|
@@ -7,11 +7,6 @@ import { SortOptions } from '../../core/cache/models/sort-options.model';
|
|||||||
import { SearchResult } from '../search-result.model';
|
import { SearchResult } from '../search-result.model';
|
||||||
import { PaginatedList } from '../../core/data/paginated-list';
|
import { PaginatedList } from '../../core/data/paginated-list';
|
||||||
|
|
||||||
/**
|
|
||||||
* This component renders a simple item page.
|
|
||||||
* The route parameter 'id' is used to request the item it represents.
|
|
||||||
* All fields of the item that should be displayed, are defined in its template.
|
|
||||||
*/
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-search-results',
|
selector: 'ds-search-results',
|
||||||
templateUrl: './search-results.component.html',
|
templateUrl: './search-results.component.html',
|
||||||
@@ -20,9 +15,28 @@ import { PaginatedList } from '../../core/data/paginated-list';
|
|||||||
fadeInOut
|
fadeInOut
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Component that represents all results from a search
|
||||||
|
*/
|
||||||
export class SearchResultsComponent {
|
export class SearchResultsComponent {
|
||||||
|
/**
|
||||||
|
* The actual search result objects
|
||||||
|
*/
|
||||||
@Input() searchResults: RemoteData<PaginatedList<SearchResult<DSpaceObject>>>;
|
@Input() searchResults: RemoteData<PaginatedList<SearchResult<DSpaceObject>>>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The current configuration of the search
|
||||||
|
*/
|
||||||
@Input() searchConfig: SearchOptions;
|
@Input() searchConfig: SearchOptions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The current sort options for the search
|
||||||
|
*/
|
||||||
@Input() sortConfig: SortOptions;
|
@Input() sortConfig: SortOptions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The current view mode for the search results
|
||||||
|
*/
|
||||||
@Input() viewMode: ViewMode;
|
@Input() viewMode: ViewMode;
|
||||||
}
|
}
|
||||||
|
@@ -1,13 +1,25 @@
|
|||||||
|
|
||||||
import { autoserialize, autoserializeAs } from 'cerialize';
|
import { autoserialize, autoserializeAs } from 'cerialize';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class representing possible values for a certain filter
|
||||||
|
*/
|
||||||
export class FacetValue {
|
export class FacetValue {
|
||||||
|
/**
|
||||||
|
* The display value of the facet value
|
||||||
|
*/
|
||||||
@autoserializeAs(String, 'label')
|
@autoserializeAs(String, 'label')
|
||||||
value: string;
|
value: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The number of results this facet value would have if selected
|
||||||
|
*/
|
||||||
@autoserialize
|
@autoserialize
|
||||||
count: number;
|
count: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The REST url to add this filter value
|
||||||
|
*/
|
||||||
@autoserialize
|
@autoserialize
|
||||||
search: string;
|
search: string;
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* Enumeration containing all possible types for filters
|
||||||
|
*/
|
||||||
export enum FilterType {
|
export enum FilterType {
|
||||||
|
/**
|
||||||
|
* Represents simple text facets
|
||||||
|
*/
|
||||||
text = 'text',
|
text = 'text',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents date facets
|
||||||
|
*/
|
||||||
range = 'date',
|
range = 'date',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents hierarchically structured facets
|
||||||
|
*/
|
||||||
hierarchy = 'hierarchical',
|
hierarchy = 'hierarchical',
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents binary facets
|
||||||
|
*/
|
||||||
boolean = 'standard'
|
boolean = 'standard'
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,9 @@
|
|||||||
import { FilterType } from './filter-type.model';
|
import { FilterType } from './filter-type.model';
|
||||||
import { autoserialize, autoserializeAs } from 'cerialize';
|
import { autoserialize, autoserializeAs } from 'cerialize';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
export class SearchFilterConfig {
|
export class SearchFilterConfig {
|
||||||
|
|
||||||
@autoserialize
|
@autoserialize
|
||||||
@@ -12,15 +15,24 @@
|
|||||||
@autoserialize
|
@autoserialize
|
||||||
hasFacets: boolean;
|
hasFacets: boolean;
|
||||||
|
|
||||||
// @autoserializeAs(String, 'facetLimit') - uncomment when fixed in rest
|
@autoserializeAs(String, 'facetLimit')
|
||||||
pageSize = 5;
|
pageSize = 5;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines if the item facet is collapsed by default or not on the search page
|
||||||
|
*/
|
||||||
@autoserialize
|
@autoserialize
|
||||||
isOpenByDefault: boolean;
|
isOpenByDefault: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Minimum value possible for this facet in the repository
|
||||||
|
*/
|
||||||
@autoserialize
|
@autoserialize
|
||||||
maxValue: string;
|
maxValue: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Maximum value possible for this facet in the repository
|
||||||
|
*/
|
||||||
@autoserialize
|
@autoserialize
|
||||||
minValue: string;
|
minValue: string;
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user