Skip to content

Commit 0c8188e

Browse files
authored
Merge pull request #346 from collectionspace/develop
Develop
2 parents 0c54a60 + 5743016 commit 0c8188e

14 files changed

Lines changed: 44 additions & 20 deletions

File tree

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cspace-ui",
3-
"version": "10.2.0-rc2.0",
3+
"version": "10.2.0-rc3.0",
44
"description": "CollectionSpace user interface for browsers",
55
"author": "Ray Lee <ray.lee@lyrasis.org>",
66
"license": "ECL-2.0",

src/components/pages/search/SearchResults.jsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,13 @@ import {
5050
createSortByHandler,
5151
createSortDirHandler,
5252
normalizeSearchQueryParams,
53-
deriveSearchType,
5453
} from '../../../helpers/searchHelpers';
5554
import {
5655
setSearchPageAdvanced,
5756
setSearchPageAdvancedLimitBy,
5857
setSearchPageAdvancedSearchTerms,
5958
setSearchPageKeyword,
6059
} from '../../../actions/searchPage';
61-
import { readListItems } from '../../search/searchResultHelpers';
6260

6361
const selectBarPropTypes = {
6462
toggleBar: PropTypes.object,
@@ -286,15 +284,10 @@ function SearchResults(props) {
286284
const isSidebarOpen = useSelector((state) => isSearchResultSidebarOpen(state));
287285
const display = currentView(props);
288286

289-
// use the list items size to handle the seeded empty result conflicting with errors
290-
const { listType } = deriveSearchType(config, SEARCH_RESULT_PAGE_SEARCH_NAME, searchDescriptor);
291-
const { items } = readListItems(config, listType, searchResults);
292-
const searchResultsSize = items?.size ?? 0;
293-
294287
useEffect(() => {
295288
setPreferredPageSize(props, dispatch);
296289
dispatch(search(config, SEARCH_RESULT_PAGE_SEARCH_NAME, searchDescriptor));
297-
}, [searchDescriptor.toString(), searchResultsSize]);
290+
}, [searchDescriptor.toString()]);
298291

299292
const handlePageSizeChange = createPageSizeChangeHandler({
300293
history,
@@ -392,11 +385,16 @@ function SearchResults(props) {
392385
searchDisplay = <SearchResultTable searchDescriptor={searchDescriptor} />;
393386
}
394387

388+
const handleBatchInvokeComplete = () => {
389+
dispatch(search(config, SEARCH_RESULT_PAGE_SEARCH_NAME, searchDescriptor));
390+
};
391+
395392
const sidebar = (
396393
<SearchResultSidebar
397394
config={config}
398395
history={history}
399396
isOpen={isSidebarOpen}
397+
onInvokeComplete={handleBatchInvokeComplete}
400398
recordType={searchDescriptor.get('recordType')}
401399
/>
402400
);

src/components/search/SearchResultBatchPanel.jsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const propTypes = {
4242
recordType: PropTypes.string,
4343
selectedItems: PropTypes.instanceOf(Immutable.Map),
4444
invoke: PropTypes.func,
45+
onInvokeComplete: PropTypes.func,
4546
};
4647

4748
export default class SearchResultBatchPanel extends Component {
@@ -146,6 +147,12 @@ export default class SearchResultBatchPanel extends Component {
146147
if (location) {
147148
history.push(location);
148149
}
150+
} else {
151+
const { onInvokeComplete } = this.props;
152+
153+
if (onInvokeComplete) {
154+
onInvokeComplete();
155+
}
149156
}
150157
});
151158
}

src/components/search/SearchResultSidebar.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const propTypes = {
1818
history: PropTypes.shape({
1919
push: PropTypes.func,
2020
}),
21+
onInvokeComplete: PropTypes.func,
2122
recordType: PropTypes.string,
2223
isOpen: PropTypes.bool,
2324
};
@@ -38,6 +39,7 @@ export default function SearchResultSidebar(props) {
3839
const {
3940
config,
4041
history,
42+
onInvokeComplete,
4143
recordType,
4244
isOpen,
4345
} = props;
@@ -69,6 +71,7 @@ export default function SearchResultSidebar(props) {
6971
color={panelColor}
7072
config={config}
7173
history={history}
74+
onInvokeComplete={onInvokeComplete}
7275
recordType={recordType}
7376
selectedItems={selectedItems}
7477
/>

src/components/search/SortBy.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function SortBy({
4444

4545
const {
4646
defaultSortBy = 'updatedAt',
47-
defaultSortDir = 'desc',
47+
defaultSortDirection = 'desc',
4848
} = sortConfig;
4949

5050
const options = Object.keys(sortConfig)
@@ -59,7 +59,7 @@ function SortBy({
5959
};
6060
});
6161

62-
const [sortBy, sortDir] = sort?.split(' ') ?? [defaultSortBy, defaultSortDir];
62+
const [sortBy, sortDir] = sort?.split(' ') ?? [defaultSortBy, defaultSortDirection];
6363
const inputId = 'sortBy';
6464
const input = (
6565
<DropdownMenuInput
@@ -70,7 +70,7 @@ function SortBy({
7070
/>
7171
);
7272

73-
const sortDirLabel = sortDir ? intl.formatMessage(messages.descendingLabel)
73+
const sortDirLabel = sortDir === 'desc' ? intl.formatMessage(messages.descendingLabel)
7474
: intl.formatMessage(messages.ascendingLabel);
7575
const sortDirButton = (
7676
<Button

src/plugins/recordTypes/chronology/columns.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ export default (configContext) => {
6464
sortBy: 'collectionspace_core:updatedAt',
6565
width: 150,
6666
},
67+
defaultSortBy: 'termDisplayName',
68+
defaultSortDirection: 'asc',
6769
},
6870
};
6971
};

src/plugins/recordTypes/citation/columns.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ export default (configContext) => {
6464
sortBy: 'collectionspace_core:updatedAt',
6565
width: 150,
6666
},
67+
defaultSortBy: 'termDisplayName',
68+
defaultSortDirection: 'asc',
6769
},
6870
};
6971
};

src/plugins/recordTypes/concept/columns.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ export default (configContext) => {
6464
sortBy: 'collectionspace_core:updatedAt',
6565
width: 150,
6666
},
67+
defaultSortBy: 'termDisplayName',
68+
defaultSortDirection: 'asc',
6769
},
6870
};
6971
};

src/plugins/recordTypes/location/columns.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ export default (configContext) => {
6666
sortBy: 'collectionspace_core:updatedAt',
6767
width: 150,
6868
},
69+
defaultSortBy: 'termDisplayName',
70+
defaultSortDirection: 'asc',
6971
},
7072
};
7173
};

0 commit comments

Comments
 (0)