-
Notifications
You must be signed in to change notification settings - Fork 439
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce browse definition requests on simple item page (#3701)
* 121561 Reduce the number of browse definition requests on Item pages by reusing the navbar request for all browse indexes * Fix test issues. --------- Co-authored-by: Koen Pauwels <[email protected]>
- Loading branch information
Showing
12 changed files
with
152 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
import { | ||
EMPTY, | ||
Observable, | ||
} from 'rxjs'; | ||
|
||
import { | ||
buildPaginatedList, | ||
PaginatedList, | ||
} from '../../core/data/paginated-list.model'; | ||
import { RemoteData } from '../../core/data/remote-data'; | ||
import { BrowseDefinition } from '../../core/shared/browse-definition.model'; | ||
import { FlatBrowseDefinition } from '../../core/shared/flat-browse-definition.model'; | ||
import { HierarchicalBrowseDefinition } from '../../core/shared/hierarchical-browse-definition.model'; | ||
import { PageInfo } from '../../core/shared/page-info.model'; | ||
import { ValueListBrowseDefinition } from '../../core/shared/value-list-browse-definition.model'; | ||
import { createSuccessfulRemoteDataObject$ } from '../remote-data.utils'; | ||
|
||
const mockData = [ | ||
Object.assign(new FlatBrowseDefinition(), { | ||
'id': 'dateissued', | ||
'browseType': 'flatBrowse', | ||
'dataType': 'date', | ||
'sortOptions': EMPTY, | ||
'order': 'ASC', | ||
'type': 'browse', | ||
'metadataKeys': [ | ||
'dc.date.issued', | ||
], | ||
'_links': EMPTY, | ||
}), | ||
|
||
Object.assign(new ValueListBrowseDefinition(), { | ||
'id': 'author', | ||
'browseType': 'valueList', | ||
'dataType': 'text', | ||
'sortOptions': EMPTY, | ||
'order': 'ASC', | ||
'type': 'browse', | ||
'metadataKeys': [ | ||
'dc.contributor.*', | ||
'dc.creator', | ||
], | ||
'_links': EMPTY, | ||
}), | ||
|
||
Object.assign(new FlatBrowseDefinition(), { | ||
'id': 'title', | ||
'browseType': 'flatBrowse', | ||
'dataType': 'title', | ||
'sortOptions': EMPTY, | ||
'order': 'ASC', | ||
'type': 'browse', | ||
'metadataKeys': [ | ||
'dc.title', | ||
], | ||
'_links': EMPTY, | ||
}), | ||
|
||
Object.assign(new ValueListBrowseDefinition(), { | ||
'id': 'subject', | ||
'browseType': 'valueList', | ||
'dataType': 'text', | ||
'sortOptions': EMPTY, | ||
'order': 'ASC', | ||
'type': 'browse', | ||
'metadataKeys': [ | ||
'dc.subject.*', | ||
], | ||
'_links': EMPTY, | ||
}), | ||
|
||
Object.assign(new HierarchicalBrowseDefinition(), { | ||
'id': 'srsc', | ||
'browseType': 'hierarchicalBrowse', | ||
'facetType': 'subject', | ||
'vocabulary': 'srsc', | ||
'type': 'browse', | ||
'metadataKeys': [ | ||
'dc.subject', | ||
], | ||
'_links': EMPTY, | ||
}), | ||
]; | ||
export const BrowseServiceStub: any = { | ||
/** | ||
* Get all browse definitions. | ||
*/ | ||
getBrowseDefinitions(): Observable<RemoteData<PaginatedList<BrowseDefinition>>> { | ||
return createSuccessfulRemoteDataObject$(buildPaginatedList(new PageInfo(), mockData)); | ||
}, | ||
}; |