@@ -24,7 +24,6 @@ import {
2424
2525import {
2626 getResourceIdentifier ,
27- getSiblingIdentifier ,
2827 EResourceType ,
2928 useHandleSubmitSearch ,
3029 usePrevNextPagination ,
@@ -36,6 +35,7 @@ import IdentifierReassignmentForm from '../../IdentifierReassignmentForm';
3635
3736import { urls } from '../../utilities' ;
3837import {
38+ defaultTitlesQIndex as defaultQIndex ,
3939 KB_TAB_FILTER_PANE ,
4040 KB_TAB_PANESET ,
4141 KB_TAB_PANE_ID ,
@@ -89,10 +89,16 @@ const Titles = ({
8989 pageSize : RESULT_COUNT_INCREMENT_MEDIUM
9090 } ) ;
9191
92+ /*
93+ * NOTE: This is not directly defaulting the qIndex,
94+ * rather setting up the "default" for inclusion in qIndexSASQProps,
95+ * which are passed to SASQ below. Then SASQ will be responsible for setting
96+ * initial qIndex values in the url on mount.
97+ */
9298 const {
9399 qIndexChanged,
94100 qIndexSASQProps
95- } = useSASQQIndex ( ) ;
101+ } = useSASQQIndex ( { defaultQIndex } ) ;
96102
97103 const [ storedFilterPaneVisibility ] = useLocalStorage ( filterPaneVisibilityKey , true ) ;
98104 const [ filterPaneIsVisible , setFilterPaneIsVisible ] = useState ( storedFilterPaneVisibility ) ;
@@ -272,35 +278,36 @@ const Titles = ({
272278 columnMapping = { {
273279 name : < FormattedMessage id = "ui-agreements.eresources.name" /> ,
274280 publicationType : < FormattedMessage id = "ui-agreements.eresources.publicationType" /> ,
281+ materialType : < FormattedMessage id = "ui-agreements.eresources.materialType" /> ,
275282 isbn : < FormattedMessage id = "ui-agreements.identifier.isbn" /> ,
276- eissn : < FormattedMessage id = "ui-agreements.identifier.eissn" /> ,
277- pissn : < FormattedMessage id = "ui-agreements.identifier.pissn" /> ,
283+ issn : < FormattedMessage id = "ui-agreements.identifier.issn" /> ,
278284 } }
279285 columnWidths = { {
280286 name : 300 ,
281- publicationType : 100 ,
287+ publicationType : 150 ,
288+ materialType : 150 ,
282289 isbn : 150 ,
283- eissn : 150 ,
284- pissn : 150 ,
290+ issn : 150 ,
285291 } }
286292 contentData = { data . titles }
287293 formatter = { {
288294 name : e => {
295+ const iconKey = e . subType ?. value === 'print' ? 'printTitle' : 'title' ;
289296 return (
290297 < AppIcon
291298 app = "agreements"
292299 iconAlignment = "baseline"
293- iconKey = "title"
300+ iconKey = { iconKey }
294301 size = "small"
295302 >
296303 { e ?. longName ?? e . name }
297304 </ AppIcon >
298305 ) ;
299306 } ,
300307 publicationType : e => < EResourceType resource = { e } /> ,
308+ materialType : e => e ?. subType ?. label ,
301309 isbn : e => getResourceIdentifier ( e , 'isbn' ) ,
302- eissn : e => getResourceIdentifier ( e , 'eissn' ) ?? getResourceIdentifier ( e , 'issn' ) ,
303- pissn : e => getResourceIdentifier ( e , 'pissn' ) ?? getSiblingIdentifier ( e , 'issn' ) ,
310+ issn : e => ( getResourceIdentifier ( e , 'issn' ) ?? getResourceIdentifier ( e , 'eissn' ) ) ?? getResourceIdentifier ( e , 'pissn' ) ,
304311 } }
305312 id = "list-titles"
306313 isEmptyMessage = {
@@ -325,7 +332,7 @@ const Titles = ({
325332 sortDirection = { sortOrder . startsWith ( '-' ) ? 'descending' : 'ascending' }
326333 sortOrder = { sortOrder . replace ( / ^ - / , '' ) . replace ( / , .* / , '' ) }
327334 totalCount = { count }
328- visibleColumns = { [ 'name' , 'publicationType' , 'isbn ' , 'eissn ' , 'pissn ' ] }
335+ visibleColumns = { [ 'name' , 'publicationType' , 'materialType ' , 'isbn ' , 'issn ' ] }
329336 />
330337 </ Pane >
331338 { children }
0 commit comments