@collectionspace/cspace-public-browser 1.5.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/cspacePublicBrowser.js +312 -169
- package/dist/cspacePublicBrowser.min.js +1 -1
- package/lib/actions/prefsActions.js +9 -12
- package/lib/actions/searchActions.js +67 -71
- package/lib/components/detail/DetailPanel.js +2 -2
- package/lib/components/detail/DetailPanelContainer.js +1 -2
- package/lib/components/detail/ImageGallery.js +3 -4
- package/lib/components/detail/ImageGalleryContainer.js +1 -2
- package/lib/components/detail/InstitutionHoldingList.js +2 -2
- package/lib/components/detail/InstitutionHoldingListContainer.js +1 -2
- package/lib/components/detail/InstitutionIndexContainer.js +1 -2
- package/lib/components/detail/InstitutionSectionContainer.js +1 -2
- package/lib/components/layout/Panel.js +2 -2
- package/lib/components/layout/PanelContainer.js +1 -2
- package/lib/components/layout/ScrollTopButton.js +2 -2
- package/lib/components/pages/DetailPage.js +2 -2
- package/lib/components/pages/DetailPageContainer.js +1 -2
- package/lib/components/pages/SearchPage.js +3 -4
- package/lib/components/pages/SearchPageContainer.js +1 -2
- package/lib/components/search/entry/SearchEntryForm.js +3 -4
- package/lib/components/search/entry/SearchEntryFormContainer.js +1 -2
- package/lib/components/search/entry/SearchQueryInput.js +4 -6
- package/lib/components/search/entry/SortSelect.js +3 -4
- package/lib/components/search/entry/SortSelectContainer.js +1 -2
- package/lib/components/search/result/Filter.js +3 -4
- package/lib/components/search/result/FilterContainer.js +1 -2
- package/lib/components/search/result/FilterPanel.js +2 -2
- package/lib/components/search/result/FilterPanelContainer.js +1 -2
- package/lib/components/search/result/FilterSearchInput.js +3 -4
- package/lib/components/search/result/SearchResultImage.js +6 -7
- package/lib/components/search/result/SearchResultList.js +2 -2
- package/lib/components/search/result/SearchResultPanel.js +2 -2
- package/lib/components/search/result/SearchResultPanelContainer.js +1 -2
- package/lib/config/anthro.js +5 -3
- package/lib/config/bonsai.js +9 -3
- package/lib/config/botgarden.js +2 -3
- package/lib/config/default.js +24 -8
- package/lib/config/fcart.js +2 -3
- package/lib/config/herbarium.js +2 -3
- package/lib/config/index.js +3 -7
- package/lib/config/lhmc.js +2 -3
- package/lib/config/materials.js +8 -3
- package/lib/config/publicart.js +2 -3
- package/lib/constants/actionCodes.js +20 -40
- package/lib/constants/ids.js +3 -6
- package/lib/helpers/esQueryHelpers.js +18 -29
- package/lib/helpers/formatHelpers.js +9 -14
- package/lib/helpers/searchDimensions.js +3 -6
- package/lib/index.js +5 -6
- package/lib/reducers/detailReducer.js +1 -3
- package/lib/reducers/filterReducer.js +1 -3
- package/lib/reducers/index.js +21 -16
- package/lib/reducers/mediaReducer.js +1 -3
- package/lib/reducers/prefsReducer.js +1 -3
- package/lib/reducers/searchEntryFormReducer.js +1 -3
- package/lib/reducers/searchReducer.js +1 -3
- package/package.json +1 -1
- package/src/config/anthro.js +3 -0
- package/src/config/bonsai.js +7 -0
- package/src/config/default.js +21 -4
- package/src/config/materials.js +6 -0
- package/src/helpers/esQueryHelpers.js +8 -3
|
@@ -13,8 +13,8 @@ var _urlHelpers = require("../../../helpers/urlHelpers");
|
|
|
13
13
|
var _config = _interopRequireDefault(require("../../../config"));
|
|
14
14
|
var _SearchResultImage = _interopRequireDefault(require("../../../../styles/cspace/SearchResultImage.css"));
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
function _getRequireWildcardCache(
|
|
17
|
-
function _interopRequireWildcard(
|
|
16
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
17
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
18
|
/* global fetch, window, AbortController */
|
|
19
19
|
|
|
20
20
|
const propTypes = {
|
|
@@ -173,11 +173,10 @@ class SearchResultImage extends _react.Component {
|
|
|
173
173
|
});
|
|
174
174
|
});
|
|
175
175
|
}), Promise.reject());
|
|
176
|
-
findImage.then(
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
} = _ref;
|
|
176
|
+
findImage.then(({
|
|
177
|
+
instGatewayUrl,
|
|
178
|
+
instMediaCsid
|
|
179
|
+
}) => {
|
|
181
180
|
try {
|
|
182
181
|
window.sessionStorage.setItem(`image-${referenceValue}`, `${instGatewayUrl},${instMediaCsid}`);
|
|
183
182
|
} catch (err) {
|
|
@@ -16,8 +16,8 @@ var _config = _interopRequireDefault(require("../../../config"));
|
|
|
16
16
|
var _searchDimensions = require("../../../helpers/searchDimensions");
|
|
17
17
|
var _SearchResultList = _interopRequireDefault(require("../../../../styles/cspace/SearchResultList.css"));
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
function _getRequireWildcardCache(
|
|
20
|
-
function _interopRequireWildcard(
|
|
19
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
20
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
21
|
const propTypes = {
|
|
22
22
|
error: _propTypes.default.instanceOf(Error),
|
|
23
23
|
hits: _propTypes.default.instanceOf(_immutable.default.List),
|
|
@@ -16,8 +16,8 @@ var _ids = require("../../../constants/ids");
|
|
|
16
16
|
var _searchDimensions = require("../../../helpers/searchDimensions");
|
|
17
17
|
var _SearchResultPanel = _interopRequireDefault(require("../../../../styles/cspace/SearchResultPanel.css"));
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
function _getRequireWildcardCache(
|
|
20
|
-
function _interopRequireWildcard(
|
|
19
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
20
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
21
|
/* global window */
|
|
22
22
|
|
|
23
23
|
const propTypes = {
|
|
@@ -19,5 +19,4 @@ const mapDispatchToProps = {
|
|
|
19
19
|
search: _searchActions.search,
|
|
20
20
|
setSearchPageSize: _searchActions.setSearchPageSize
|
|
21
21
|
};
|
|
22
|
-
var _default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_SearchResultPanel.default);
|
|
23
|
-
exports.default = _default;
|
|
22
|
+
var _default = exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_SearchResultPanel.default);
|
package/lib/config/anthro.js
CHANGED
|
@@ -6,13 +6,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _reactIntl = require("react-intl");
|
|
8
8
|
var _formatHelpers = require("../helpers/formatHelpers");
|
|
9
|
-
var _default = {
|
|
9
|
+
var _default = exports.default = {
|
|
10
10
|
gatewayUrl: 'http://localhost:8180/gateway/anthro',
|
|
11
11
|
filters: {
|
|
12
12
|
fields: {
|
|
13
13
|
objectProductionPeople: {
|
|
14
14
|
field: 'collectionobjects_common:objectProductionPeopleGroupList.objectProductionPeople.displayName'
|
|
15
15
|
},
|
|
16
|
+
objectProductionPlace: {
|
|
17
|
+
field: 'collectionobjects_common:objectProductionPlaceGroupList.objectProductionPlace.displayName'
|
|
18
|
+
},
|
|
16
19
|
taxon: {
|
|
17
20
|
field: 'collectionobjects_naturalhistory_extension:taxonomicIdentGroupList.taxon.displayName',
|
|
18
21
|
messages: (0, _reactIntl.defineMessages)({
|
|
@@ -119,5 +122,4 @@ var _default = {
|
|
|
119
122
|
fields1: ['group_id', 'group_collection', 'group_description', 'group_production']
|
|
120
123
|
}
|
|
121
124
|
}
|
|
122
|
-
};
|
|
123
|
-
exports.default = _default;
|
|
125
|
+
};
|
package/lib/config/bonsai.js
CHANGED
|
@@ -6,13 +6,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _reactIntl = require("react-intl");
|
|
8
8
|
var _formatHelpers = require("../helpers/formatHelpers");
|
|
9
|
-
var _default = {
|
|
9
|
+
var _default = exports.default = {
|
|
10
10
|
gatewayUrl: 'http://localhost:8180/gateway/bonsai',
|
|
11
11
|
messages: {
|
|
12
12
|
'filter.objectProductionPerson.label': 'Original artist',
|
|
13
13
|
'filter.objectProductionPerson.shortLabel': 'Original artist',
|
|
14
14
|
'detailField.objectProductionPerson.label': 'Original artist'
|
|
15
15
|
},
|
|
16
|
+
filters: {
|
|
17
|
+
fields: {
|
|
18
|
+
objectProductionPlace: {
|
|
19
|
+
field: 'collectionobjects_common:objectProductionPlaceGroupList.objectProductionPlace.displayName'
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
16
23
|
detailFields: {
|
|
17
24
|
fields: {
|
|
18
25
|
originDate: {
|
|
@@ -46,5 +53,4 @@ var _default = {
|
|
|
46
53
|
}
|
|
47
54
|
}
|
|
48
55
|
}
|
|
49
|
-
};
|
|
50
|
-
exports.default = _default;
|
|
56
|
+
};
|
package/lib/config/botgarden.js
CHANGED
package/lib/config/default.js
CHANGED
|
@@ -53,7 +53,7 @@ const formatDepartment = data => {
|
|
|
53
53
|
const message = departmentMessages[data];
|
|
54
54
|
return message ? (0, _intl.getIntl)().formatMessage(message) : data;
|
|
55
55
|
};
|
|
56
|
-
var _default = {
|
|
56
|
+
var _default = exports.default = {
|
|
57
57
|
basename: '',
|
|
58
58
|
container: '#cspace-browser',
|
|
59
59
|
gatewayUrl: 'http://localhost:8180/gateway/core',
|
|
@@ -87,10 +87,14 @@ var _default = {
|
|
|
87
87
|
field: 'collectionspace_denorm:title',
|
|
88
88
|
formatValue: _formatHelpers.displayName
|
|
89
89
|
},
|
|
90
|
+
filterOrder: {
|
|
91
|
+
_term: 'asc'
|
|
92
|
+
},
|
|
93
|
+
filterSize: 300,
|
|
90
94
|
filters: {
|
|
91
95
|
fields: {
|
|
92
96
|
objectName: {
|
|
93
|
-
field: '
|
|
97
|
+
field: 'collectionspace_denorm:objectNameList.objectName',
|
|
94
98
|
messages: (0, _reactIntl.defineMessages)({
|
|
95
99
|
label: {
|
|
96
100
|
"id": "filter.objectName.label",
|
|
@@ -171,7 +175,7 @@ var _default = {
|
|
|
171
175
|
})
|
|
172
176
|
},
|
|
173
177
|
material: {
|
|
174
|
-
field: '
|
|
178
|
+
field: 'collectionspace_denorm:materialGroupList.material',
|
|
175
179
|
messages: (0, _reactIntl.defineMessages)({
|
|
176
180
|
label: {
|
|
177
181
|
"id": "filter.material.label",
|
|
@@ -324,7 +328,7 @@ var _default = {
|
|
|
324
328
|
},
|
|
325
329
|
detailSubtitle: data => {
|
|
326
330
|
const {
|
|
327
|
-
'
|
|
331
|
+
'collectionspace_denorm:objectNameList': objectNameGroups
|
|
328
332
|
} = data;
|
|
329
333
|
if (objectNameGroups && objectNameGroups.length > 0) {
|
|
330
334
|
const {
|
|
@@ -354,6 +358,19 @@ var _default = {
|
|
|
354
358
|
}),
|
|
355
359
|
field: 'collectionobjects_common:objectNumber'
|
|
356
360
|
},
|
|
361
|
+
objectName: {
|
|
362
|
+
messages: (0, _reactIntl.defineMessages)({
|
|
363
|
+
label: {
|
|
364
|
+
"id": "detailField.objectName.label",
|
|
365
|
+
"defaultMessage": "Name"
|
|
366
|
+
}
|
|
367
|
+
}),
|
|
368
|
+
field: 'collectionspace_denorm:objectNameList',
|
|
369
|
+
format: (0, _formatHelpers.listOf)((0, _formatHelpers.valueAt)({
|
|
370
|
+
path: 'objectName',
|
|
371
|
+
format: (0, _formatHelpers.filterLink)({})
|
|
372
|
+
}))
|
|
373
|
+
},
|
|
357
374
|
responsibleDepartment: {
|
|
358
375
|
messages: (0, _reactIntl.defineMessages)({
|
|
359
376
|
label: {
|
|
@@ -437,7 +454,7 @@ var _default = {
|
|
|
437
454
|
"defaultMessage": "Material"
|
|
438
455
|
}
|
|
439
456
|
}),
|
|
440
|
-
field: '
|
|
457
|
+
field: 'collectionspace_denorm:materialGroupList',
|
|
441
458
|
format: (0, _formatHelpers.listOf)((0, _formatHelpers.valueAt)({
|
|
442
459
|
path: 'material',
|
|
443
460
|
format: (0, _formatHelpers.filterLink)({})
|
|
@@ -501,7 +518,7 @@ var _default = {
|
|
|
501
518
|
"defaultMessage": "Identification"
|
|
502
519
|
}
|
|
503
520
|
}),
|
|
504
|
-
fields: ['objectNumber', 'responsibleDepartment']
|
|
521
|
+
fields: ['objectNumber', 'objectName', 'responsibleDepartment']
|
|
505
522
|
},
|
|
506
523
|
group_description: {
|
|
507
524
|
messages: (0, _reactIntl.defineMessages)({
|
|
@@ -526,5 +543,4 @@ var _default = {
|
|
|
526
543
|
fields1: ['group_id', 'group_description', 'group_production']
|
|
527
544
|
}
|
|
528
545
|
}
|
|
529
|
-
};
|
|
530
|
-
exports.default = _default;
|
|
546
|
+
};
|
package/lib/config/fcart.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _reactIntl = require("react-intl");
|
|
8
|
-
var _default = {
|
|
8
|
+
var _default = exports.default = {
|
|
9
9
|
gatewayUrl: 'http://localhost:8180/gateway/fcart',
|
|
10
10
|
filters: {
|
|
11
11
|
fields: {
|
|
@@ -32,5 +32,4 @@ var _default = {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
};
|
|
36
|
-
exports.default = _default;
|
|
35
|
+
};
|
package/lib/config/herbarium.js
CHANGED
package/lib/config/index.js
CHANGED
|
@@ -27,14 +27,11 @@ const namedConfig = {
|
|
|
27
27
|
publicart: _publicart.default
|
|
28
28
|
};
|
|
29
29
|
const config = (0, _merge.default)({}, _default2.default);
|
|
30
|
-
var _default = {
|
|
30
|
+
var _default = exports.default = {
|
|
31
31
|
get: (path, defaultValue) => (0, _get.default)(config, path, defaultValue),
|
|
32
32
|
// eslint-disable-next-line no-console
|
|
33
33
|
log: () => console.log(config),
|
|
34
|
-
merge:
|
|
35
|
-
for (var _len = arguments.length, sources = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
36
|
-
sources[_key] = arguments[_key];
|
|
37
|
-
}
|
|
34
|
+
merge: (...sources) => {
|
|
38
35
|
sources.forEach(source => {
|
|
39
36
|
const {
|
|
40
37
|
baseConfig: baseConfigName
|
|
@@ -49,5 +46,4 @@ var _default = {
|
|
|
49
46
|
});
|
|
50
47
|
},
|
|
51
48
|
getFilterFieldConfig: id => (0, _get.default)(config, ['filters', 'fields', id])
|
|
52
|
-
};
|
|
53
|
-
exports.default = _default;
|
|
49
|
+
};
|
package/lib/config/lhmc.js
CHANGED
package/lib/config/materials.js
CHANGED
|
@@ -11,7 +11,7 @@ const composition = data => {
|
|
|
11
11
|
const parts = ['materialCompositionFamilyName', 'materialCompositionClassName', 'materialCompositionGenericName'].map(fieldName => (0, _formatHelpers.renderFilterLink)(fieldName, (0, _formatHelpers.displayName)(data[fieldName])));
|
|
12
12
|
return (0, _formatHelpers.renderJoined)(parts, ' - ');
|
|
13
13
|
};
|
|
14
|
-
var _default = {
|
|
14
|
+
var _default = exports.default = {
|
|
15
15
|
messages: {
|
|
16
16
|
'rootPage.title': 'Material Order',
|
|
17
17
|
'searchQueryInput.label': 'Search materials',
|
|
@@ -72,6 +72,9 @@ var _default = {
|
|
|
72
72
|
},
|
|
73
73
|
filters: {
|
|
74
74
|
fields: {
|
|
75
|
+
material: {
|
|
76
|
+
field: 'collectionobjects_common:materialGroupList.material'
|
|
77
|
+
},
|
|
75
78
|
materialTermAttributionContributingOrganization: {
|
|
76
79
|
field: 'collectionspace_denorm:holdingInstitutions.displayName',
|
|
77
80
|
messages: (0, _reactIntl.defineMessages)({
|
|
@@ -471,6 +474,9 @@ var _default = {
|
|
|
471
474
|
},
|
|
472
475
|
detailFields: {
|
|
473
476
|
fields: {
|
|
477
|
+
material: {
|
|
478
|
+
field: 'collectionobjects_common:materialGroupList'
|
|
479
|
+
},
|
|
474
480
|
featuredCollectionGroupList: {
|
|
475
481
|
field: 'materials_common:featuredCollectionGroupList',
|
|
476
482
|
format: (0, _formatHelpers.listOf)((0, _formatHelpers.valueAt)({
|
|
@@ -978,5 +984,4 @@ var _default = {
|
|
|
978
984
|
}
|
|
979
985
|
}
|
|
980
986
|
}
|
|
981
|
-
};
|
|
982
|
-
exports.default = _default;
|
|
987
|
+
};
|
package/lib/config/publicart.js
CHANGED
|
@@ -4,43 +4,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.TOGGLE_PANEL = exports.SET_SEARCH_PARAMS = exports.SET_SEARCH_PAGE_SIZE = exports.SET_SEARCH_ENTRY_FORM_PARAM = exports.SET_MEDIA = exports.SET_FILTER_SEARCH_VALUE = exports.SET_DETAIL_PARAMS = exports.SEARCH_STARTED = exports.SEARCH_REJECTED = exports.SEARCH_FULFILLED = exports.PREFS_LOADED = exports.OPEN_SEARCH = exports.INST_SEARCH_STARTED = exports.INST_SEARCH_REJECTED = exports.INST_SEARCH_FULFILLED = exports.EXPAND_PANEL = exports.DETAIL_READ_STARTED = exports.DETAIL_READ_REJECTED = exports.DETAIL_READ_FULFILLED = exports.CLEAR_DETAIL = void 0;
|
|
7
|
-
const PREFS_LOADED = 'PREFS_LOADED';
|
|
8
|
-
exports.
|
|
9
|
-
const
|
|
10
|
-
exports.
|
|
11
|
-
const
|
|
12
|
-
exports.
|
|
13
|
-
const
|
|
14
|
-
exports.
|
|
15
|
-
const
|
|
16
|
-
exports.
|
|
17
|
-
const
|
|
18
|
-
exports.
|
|
19
|
-
const
|
|
20
|
-
exports.
|
|
21
|
-
const
|
|
22
|
-
exports.
|
|
23
|
-
const
|
|
24
|
-
exports.
|
|
25
|
-
const
|
|
26
|
-
exports.
|
|
27
|
-
const SET_SEARCH_ENTRY_FORM_PARAM = 'SET_SEARCH_ENTRY_FORM_PARAM';
|
|
28
|
-
exports.SET_SEARCH_ENTRY_FORM_PARAM = SET_SEARCH_ENTRY_FORM_PARAM;
|
|
29
|
-
const SET_FILTER_SEARCH_VALUE = 'SET_FILTER_SEARCH_VALUE';
|
|
30
|
-
exports.SET_FILTER_SEARCH_VALUE = SET_FILTER_SEARCH_VALUE;
|
|
31
|
-
const CLEAR_DETAIL = 'CLEAR_DETAIL';
|
|
32
|
-
exports.CLEAR_DETAIL = CLEAR_DETAIL;
|
|
33
|
-
const SET_DETAIL_PARAMS = 'SET_DETAIL_PARAMS';
|
|
34
|
-
exports.SET_DETAIL_PARAMS = SET_DETAIL_PARAMS;
|
|
35
|
-
const DETAIL_READ_STARTED = 'DETAIL_READ_STARTED';
|
|
36
|
-
exports.DETAIL_READ_STARTED = DETAIL_READ_STARTED;
|
|
37
|
-
const DETAIL_READ_FULFILLED = 'DETAIL_READ_FULFILLED';
|
|
38
|
-
exports.DETAIL_READ_FULFILLED = DETAIL_READ_FULFILLED;
|
|
39
|
-
const DETAIL_READ_REJECTED = 'DETAIL_READ_REJECTED';
|
|
40
|
-
exports.DETAIL_READ_REJECTED = DETAIL_READ_REJECTED;
|
|
41
|
-
const INST_SEARCH_STARTED = 'INST_SEARCH_STARTED';
|
|
42
|
-
exports.INST_SEARCH_STARTED = INST_SEARCH_STARTED;
|
|
43
|
-
const INST_SEARCH_FULFILLED = 'INST_SEARCH_FULFILLED';
|
|
44
|
-
exports.INST_SEARCH_FULFILLED = INST_SEARCH_FULFILLED;
|
|
45
|
-
const INST_SEARCH_REJECTED = 'INST_SEARCH_REJECTED';
|
|
46
|
-
exports.INST_SEARCH_REJECTED = INST_SEARCH_REJECTED;
|
|
7
|
+
const PREFS_LOADED = exports.PREFS_LOADED = 'PREFS_LOADED';
|
|
8
|
+
const EXPAND_PANEL = exports.EXPAND_PANEL = 'EXPAND_PANEL';
|
|
9
|
+
const TOGGLE_PANEL = exports.TOGGLE_PANEL = 'TOGGLE_PANEL';
|
|
10
|
+
const SET_MEDIA = exports.SET_MEDIA = 'SET_MEDIA';
|
|
11
|
+
const OPEN_SEARCH = exports.OPEN_SEARCH = 'OPEN_SEARCH';
|
|
12
|
+
const SET_SEARCH_PAGE_SIZE = exports.SET_SEARCH_PAGE_SIZE = 'SET_SEARCH_PAGE_SIZE';
|
|
13
|
+
const SET_SEARCH_PARAMS = exports.SET_SEARCH_PARAMS = 'SET_SEARCH_PARAMS';
|
|
14
|
+
const SEARCH_STARTED = exports.SEARCH_STARTED = 'SEARCH_STARTED';
|
|
15
|
+
const SEARCH_FULFILLED = exports.SEARCH_FULFILLED = 'SEARCH_FULFILLED';
|
|
16
|
+
const SEARCH_REJECTED = exports.SEARCH_REJECTED = 'SEARCH_REJECTED';
|
|
17
|
+
const SET_SEARCH_ENTRY_FORM_PARAM = exports.SET_SEARCH_ENTRY_FORM_PARAM = 'SET_SEARCH_ENTRY_FORM_PARAM';
|
|
18
|
+
const SET_FILTER_SEARCH_VALUE = exports.SET_FILTER_SEARCH_VALUE = 'SET_FILTER_SEARCH_VALUE';
|
|
19
|
+
const CLEAR_DETAIL = exports.CLEAR_DETAIL = 'CLEAR_DETAIL';
|
|
20
|
+
const SET_DETAIL_PARAMS = exports.SET_DETAIL_PARAMS = 'SET_DETAIL_PARAMS';
|
|
21
|
+
const DETAIL_READ_STARTED = exports.DETAIL_READ_STARTED = 'DETAIL_READ_STARTED';
|
|
22
|
+
const DETAIL_READ_FULFILLED = exports.DETAIL_READ_FULFILLED = 'DETAIL_READ_FULFILLED';
|
|
23
|
+
const DETAIL_READ_REJECTED = exports.DETAIL_READ_REJECTED = 'DETAIL_READ_REJECTED';
|
|
24
|
+
const INST_SEARCH_STARTED = exports.INST_SEARCH_STARTED = 'INST_SEARCH_STARTED';
|
|
25
|
+
const INST_SEARCH_FULFILLED = exports.INST_SEARCH_FULFILLED = 'INST_SEARCH_FULFILLED';
|
|
26
|
+
const INST_SEARCH_REJECTED = exports.INST_SEARCH_REJECTED = 'INST_SEARCH_REJECTED';
|
package/lib/constants/ids.js
CHANGED
|
@@ -4,9 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.SORT_ID = exports.SEARCH_QUERY_ID = exports.FILTER_PANEL_ID = void 0;
|
|
7
|
-
const FILTER_PANEL_ID = 'filter';
|
|
8
|
-
exports.
|
|
9
|
-
const
|
|
10
|
-
exports.SEARCH_QUERY_ID = SEARCH_QUERY_ID;
|
|
11
|
-
const SORT_ID = 'sort';
|
|
12
|
-
exports.SORT_ID = SORT_ID;
|
|
7
|
+
const FILTER_PANEL_ID = exports.FILTER_PANEL_ID = 'filter';
|
|
8
|
+
const SEARCH_QUERY_ID = exports.SEARCH_QUERY_ID = 'search';
|
|
9
|
+
const SORT_ID = exports.SORT_ID = 'sort';
|
|
@@ -76,10 +76,7 @@ const filterParamToQuery = (id, value) => {
|
|
|
76
76
|
exports.filterParamToQuery = filterParamToQuery;
|
|
77
77
|
const getSearchQuery = params => fulltextParamToQuery(params.get(_ids.SEARCH_QUERY_ID));
|
|
78
78
|
exports.getSearchQuery = getSearchQuery;
|
|
79
|
-
const getFilterQueries = params => params.delete(_ids.SEARCH_QUERY_ID).entrySeq().map(
|
|
80
|
-
let [id, value] = _ref;
|
|
81
|
-
return filterParamToQuery(id, value);
|
|
82
|
-
}).toJS();
|
|
79
|
+
const getFilterQueries = params => params.delete(_ids.SEARCH_QUERY_ID).entrySeq().map(([id, value]) => filterParamToQuery(id, value)).toJS();
|
|
83
80
|
exports.getFilterQueries = getFilterQueries;
|
|
84
81
|
const getQuery = params => {
|
|
85
82
|
const clauses = [_config.default.get('defaultQuery'), getSearchQuery(params), ...getFilterQueries(params)].filter(clause => !!clause);
|
|
@@ -98,40 +95,33 @@ const getQuery = params => {
|
|
|
98
95
|
};
|
|
99
96
|
};
|
|
100
97
|
exports.getQuery = getQuery;
|
|
101
|
-
const getHistogramAgg =
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
};
|
|
98
|
+
const getHistogramAgg = (field, interval = 1) => ({
|
|
99
|
+
histogram: {
|
|
100
|
+
field,
|
|
101
|
+
interval,
|
|
102
|
+
min_doc_count: 1
|
|
103
|
+
}
|
|
104
|
+
});
|
|
111
105
|
exports.getHistogramAgg = getHistogramAgg;
|
|
112
|
-
const getTermsAgg =
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
order,
|
|
120
|
-
size: 300
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
};
|
|
106
|
+
const getTermsAgg = (field, order = _config.default.get('filterOrder'), size = _config.default.get('filterSize')) => ({
|
|
107
|
+
terms: {
|
|
108
|
+
field,
|
|
109
|
+
order,
|
|
110
|
+
size
|
|
111
|
+
}
|
|
112
|
+
});
|
|
124
113
|
exports.getTermsAgg = getTermsAgg;
|
|
125
114
|
const getFilterAgg = filterFieldConfig => {
|
|
126
115
|
const {
|
|
127
116
|
field,
|
|
128
117
|
order,
|
|
118
|
+
size,
|
|
129
119
|
type
|
|
130
120
|
} = filterFieldConfig;
|
|
131
121
|
if (type === 'histogram') {
|
|
132
122
|
return getHistogramAgg(field, filterFieldConfig.interval);
|
|
133
123
|
}
|
|
134
|
-
return getTermsAgg(field, order);
|
|
124
|
+
return getTermsAgg(field, order, size);
|
|
135
125
|
};
|
|
136
126
|
exports.getFilterAgg = getFilterAgg;
|
|
137
127
|
let aggs;
|
|
@@ -139,8 +129,7 @@ const getAggs = params => {
|
|
|
139
129
|
if (!aggs) {
|
|
140
130
|
aggs = {};
|
|
141
131
|
const filterFieldsConfig = _config.default.get('filters').fields;
|
|
142
|
-
Object.entries(filterFieldsConfig).forEach(
|
|
143
|
-
let [id, filterFieldConfig] = _ref2;
|
|
132
|
+
Object.entries(filterFieldsConfig).forEach(([id, filterFieldConfig]) => {
|
|
144
133
|
const param = params.get(id);
|
|
145
134
|
const hasValue = param && param.size > 0;
|
|
146
135
|
if (!hasValue) {
|
|
@@ -50,8 +50,7 @@ const renderFilterLink = (filterId, filterValue, linkText) => {
|
|
|
50
50
|
return renderLink(`/search?${query}`, typeof linkText === 'undefined' ? filterValue : linkText);
|
|
51
51
|
};
|
|
52
52
|
exports.renderFilterLink = renderFilterLink;
|
|
53
|
-
const renderJoined =
|
|
54
|
-
let separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
53
|
+
const renderJoined = (parts, separator = '') => {
|
|
55
54
|
const nonEmptyParts = parts.filter(part => typeof part !== 'undefined' && part !== null && part !== '');
|
|
56
55
|
if (nonEmptyParts.length === 0) {
|
|
57
56
|
return null;
|
|
@@ -63,8 +62,7 @@ const renderJoined = function (parts) {
|
|
|
63
62
|
_react.default.createElement("span", null, joinedParts, separatorElement, nextPart));
|
|
64
63
|
};
|
|
65
64
|
exports.renderJoined = renderJoined;
|
|
66
|
-
const renderList =
|
|
67
|
-
let inline = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
65
|
+
const renderList = (values, inline = false) => {
|
|
68
66
|
if (Array.isArray(values)) {
|
|
69
67
|
if (values.length > 1) {
|
|
70
68
|
return /*#__PURE__*/_react.default.createElement(_FieldValueList.default, {
|
|
@@ -127,16 +125,13 @@ const filterLink = config => (data, fieldName) => {
|
|
|
127
125
|
return renderFilterLink(formattedFilterId, formattedFilterValue, formattedLinkText);
|
|
128
126
|
};
|
|
129
127
|
exports.filterLink = filterLink;
|
|
130
|
-
const linkNote =
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
const link = renderLink(url);
|
|
138
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, link, link && note && separator, note);
|
|
139
|
-
};
|
|
128
|
+
const linkNote = (urlField, noteField, separator = ' - ') => object => {
|
|
129
|
+
const {
|
|
130
|
+
[noteField]: note,
|
|
131
|
+
[urlField]: url
|
|
132
|
+
} = object;
|
|
133
|
+
const link = renderLink(url);
|
|
134
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, link, link && note && separator, note);
|
|
140
135
|
};
|
|
141
136
|
exports.linkNote = linkNote;
|
|
142
137
|
const linkedDisplayName = filterId => data => renderFilterLink(filterId, displayName(data));
|
|
@@ -13,12 +13,9 @@ const {
|
|
|
13
13
|
searchResultTileWidth: cssTileWidth,
|
|
14
14
|
searchResultTileBodyHeight: cssTileBodyHeight
|
|
15
15
|
} = _dimensions.default;
|
|
16
|
-
const tileWidth = parseInt(cssTileWidth, 10);
|
|
17
|
-
exports.
|
|
18
|
-
const
|
|
19
|
-
exports.tileBodyHeight = tileBodyHeight;
|
|
20
|
-
const tileHeight = tileWidth + tileBodyHeight;
|
|
21
|
-
exports.tileHeight = tileHeight;
|
|
16
|
+
const tileWidth = exports.tileWidth = parseInt(cssTileWidth, 10);
|
|
17
|
+
const tileBodyHeight = exports.tileBodyHeight = parseInt(cssTileBodyHeight, 10);
|
|
18
|
+
const tileHeight = exports.tileHeight = tileWidth + tileBodyHeight;
|
|
22
19
|
function calculateSearchPageSize() {
|
|
23
20
|
const width = window.innerWidth;
|
|
24
21
|
const height = window.innerHeight;
|
package/lib/index.js
CHANGED
|
@@ -17,13 +17,13 @@ var _App = _interopRequireDefault(require("./components/App"));
|
|
|
17
17
|
var _intl = require("./intl");
|
|
18
18
|
var _reducers = _interopRequireDefault(require("./reducers"));
|
|
19
19
|
var formatters = _interopRequireWildcard(require("./helpers/formatHelpers"));
|
|
20
|
-
function _getRequireWildcardCache(
|
|
21
|
-
function _interopRequireWildcard(
|
|
20
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
21
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
22
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
23
|
/* global document, window */
|
|
24
24
|
|
|
25
|
-
const cspacePublicBrowser =
|
|
26
|
-
_config.default.merge(...
|
|
25
|
+
const cspacePublicBrowser = (...customConfigs) => {
|
|
26
|
+
_config.default.merge(...customConfigs);
|
|
27
27
|
const container = _config.default.get('container');
|
|
28
28
|
const mountNode = document.querySelector(container);
|
|
29
29
|
process.env.NODE_ENV !== "production" ? (0, _warning.default)(mountNode, `No container element was found using the selector '${container}'. The CollectionSpace collection browser will not be rendered.`) : void 0;
|
|
@@ -49,5 +49,4 @@ const cspacePublicBrowser = function () {
|
|
|
49
49
|
}, /*#__PURE__*/_react.default.createElement(_App.default, null))), mountNode);
|
|
50
50
|
};
|
|
51
51
|
cspacePublicBrowser.formatters = formatters;
|
|
52
|
-
var _default = cspacePublicBrowser;
|
|
53
|
-
exports.default = _default;
|
|
52
|
+
var _default = exports.default = cspacePublicBrowser;
|
|
@@ -92,9 +92,7 @@ const handleInstSearchRejected = (state, action) => {
|
|
|
92
92
|
}
|
|
93
93
|
return state.deleteIn(['inst', institutionId, 'pending']).setIn(['inst', institutionId, 'error'], action.payload);
|
|
94
94
|
};
|
|
95
|
-
var _default =
|
|
96
|
-
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _immutable.default.Map();
|
|
97
|
-
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
95
|
+
var _default = (state = _immutable.default.Map(), action) => {
|
|
98
96
|
switch (action.type) {
|
|
99
97
|
case _actionCodes.CLEAR_DETAIL:
|
|
100
98
|
return state.clear();
|
|
@@ -7,9 +7,7 @@ exports.getSearchValue = exports.default = void 0;
|
|
|
7
7
|
var _immutable = _interopRequireDefault(require("immutable"));
|
|
8
8
|
var _actionCodes = require("../constants/actionCodes");
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
var _default =
|
|
11
|
-
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _immutable.default.Map();
|
|
12
|
-
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
10
|
+
var _default = (state = _immutable.default.Map(), action) => {
|
|
13
11
|
switch (action.type) {
|
|
14
12
|
case _actionCodes.SET_FILTER_SEARCH_VALUE:
|
|
15
13
|
return state.setIn([action.meta.id, 'searchValue'], action.payload);
|