@collectionspace/cspace-public-browser 2.0.0 → 2.1.1
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 +4 -5
- package/lib/config/bonsai.js +2 -3
- package/lib/config/botgarden.js +2 -3
- package/lib/config/default.js +74 -15
- package/lib/config/fcart.js +3 -4
- package/lib/config/herbarium.js +2 -3
- package/lib/config/index.js +3 -7
- package/lib/config/lhmc.js +10 -4
- package/lib/config/materials.js +2 -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 -2
- package/src/config/default.js +76 -11
- package/src/config/fcart.js +2 -1
- package/src/config/lhmc.js +8 -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,7 +6,7 @@ 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: {
|
|
@@ -57,7 +57,7 @@ var _default = {
|
|
|
57
57
|
fields: ['collectionYears']
|
|
58
58
|
},
|
|
59
59
|
group_description: {
|
|
60
|
-
fields: ['material', 'technique', '
|
|
60
|
+
fields: ['material', 'technique', 'subject', 'color', 'taxon']
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
layout: {
|
|
@@ -115,12 +115,11 @@ var _default = {
|
|
|
115
115
|
fields: ['fieldCollectionDate', 'fieldCollector']
|
|
116
116
|
},
|
|
117
117
|
group_description: {
|
|
118
|
-
fields: ['material', 'technique', '
|
|
118
|
+
fields: ['material', 'technique', 'subject', 'contentDescription', 'measuredPart', 'creditLine', 'taxon']
|
|
119
119
|
}
|
|
120
120
|
},
|
|
121
121
|
layout: {
|
|
122
122
|
fields1: ['group_id', 'group_collection', 'group_description', 'group_production']
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
};
|
|
126
|
-
exports.default = _default;
|
|
125
|
+
};
|
package/lib/config/bonsai.js
CHANGED
|
@@ -6,7 +6,7 @@ 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',
|
|
@@ -53,5 +53,4 @@ var _default = {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
};
|
|
57
|
-
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,6 +87,10 @@ 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: {
|
|
@@ -223,15 +227,15 @@ var _default = {
|
|
|
223
227
|
}
|
|
224
228
|
})
|
|
225
229
|
},
|
|
226
|
-
|
|
227
|
-
field: '
|
|
230
|
+
subject: {
|
|
231
|
+
field: 'collectionspace_denorm:contentSubjectList.subject',
|
|
228
232
|
messages: (0, _reactIntl.defineMessages)({
|
|
229
233
|
label: {
|
|
230
|
-
"id": "filter.
|
|
234
|
+
"id": "filter.subject.label",
|
|
231
235
|
"defaultMessage": "Subject"
|
|
232
236
|
},
|
|
233
237
|
shortLabel: {
|
|
234
|
-
"id": "filter.
|
|
238
|
+
"id": "filter.subject.shortLabel",
|
|
235
239
|
"defaultMessage": "Subject"
|
|
236
240
|
}
|
|
237
241
|
}),
|
|
@@ -294,7 +298,7 @@ var _default = {
|
|
|
294
298
|
"defaultMessage": "Description"
|
|
295
299
|
}
|
|
296
300
|
}),
|
|
297
|
-
fields: ['material', '
|
|
301
|
+
fields: ['material', 'subject', 'color']
|
|
298
302
|
},
|
|
299
303
|
group_production: {
|
|
300
304
|
messages: (0, _reactIntl.defineMessages)({
|
|
@@ -469,18 +473,28 @@ var _default = {
|
|
|
469
473
|
roleFieldName: 'techniqueType'
|
|
470
474
|
}))
|
|
471
475
|
},
|
|
472
|
-
|
|
476
|
+
subject: {
|
|
473
477
|
messages: (0, _reactIntl.defineMessages)({
|
|
474
478
|
label: {
|
|
475
|
-
"id": "detailField.
|
|
479
|
+
"id": "detailField.subject.label",
|
|
476
480
|
"defaultMessage": "Subject"
|
|
477
481
|
}
|
|
478
482
|
}),
|
|
479
|
-
field: '
|
|
480
|
-
format: (0, _formatHelpers.listOf)((0, _formatHelpers.
|
|
481
|
-
|
|
483
|
+
field: 'collectionspace_denorm:contentSubjectList',
|
|
484
|
+
format: (0, _formatHelpers.listOf)((0, _formatHelpers.valueAt)({
|
|
485
|
+
path: 'subject',
|
|
486
|
+
format: (0, _formatHelpers.filterLink)({})
|
|
482
487
|
}))
|
|
483
488
|
},
|
|
489
|
+
contentDescription: {
|
|
490
|
+
messages: (0, _reactIntl.defineMessages)({
|
|
491
|
+
label: {
|
|
492
|
+
"id": "detailField.contentDescription.label",
|
|
493
|
+
"defaultMessage": "Content Description"
|
|
494
|
+
}
|
|
495
|
+
}),
|
|
496
|
+
field: 'collectionobjects_common:contentDescription'
|
|
497
|
+
},
|
|
484
498
|
measuredPart: {
|
|
485
499
|
messages: (0, _reactIntl.defineMessages)({
|
|
486
500
|
label: {
|
|
@@ -504,6 +518,43 @@ var _default = {
|
|
|
504
518
|
}),
|
|
505
519
|
field: 'collectionspace_denorm:creditLine',
|
|
506
520
|
format: _formatHelpers.list
|
|
521
|
+
},
|
|
522
|
+
rightStatement: {
|
|
523
|
+
messages: (0, _reactIntl.defineMessages)({
|
|
524
|
+
label: {
|
|
525
|
+
"id": "detailField.rightStatement.label",
|
|
526
|
+
"defaultMessage": "Right Statement"
|
|
527
|
+
}
|
|
528
|
+
}),
|
|
529
|
+
field: 'collectionobjects_common:rightsGroupList',
|
|
530
|
+
format: (0, _formatHelpers.listOf)((0, _formatHelpers.valueAt)({
|
|
531
|
+
path: 'rightStatement'
|
|
532
|
+
}))
|
|
533
|
+
},
|
|
534
|
+
standardizedRightStatement: {
|
|
535
|
+
messages: (0, _reactIntl.defineMessages)({
|
|
536
|
+
label: {
|
|
537
|
+
"id": "detailField.standardizedRightStatement.label",
|
|
538
|
+
"defaultMessage": "Standardized Right Statement"
|
|
539
|
+
}
|
|
540
|
+
}),
|
|
541
|
+
field: 'collectionobjects_common:rightsGroupList',
|
|
542
|
+
format: (0, _formatHelpers.listOf)((0, _formatHelpers.valueAt)({
|
|
543
|
+
path: 'standardizedRightStatement',
|
|
544
|
+
format: _formatHelpers.displayName
|
|
545
|
+
}))
|
|
546
|
+
},
|
|
547
|
+
rightReproductionStatement: {
|
|
548
|
+
messages: (0, _reactIntl.defineMessages)({
|
|
549
|
+
label: {
|
|
550
|
+
"id": "detailField.rightReproductionStatement.label",
|
|
551
|
+
"defaultMessage": "Right Reproduction Statement"
|
|
552
|
+
}
|
|
553
|
+
}),
|
|
554
|
+
field: 'collectionobjects_common:rightsInGroupList',
|
|
555
|
+
format: (0, _formatHelpers.listOf)((0, _formatHelpers.valueAt)({
|
|
556
|
+
path: 'rightReproductionStatement'
|
|
557
|
+
}))
|
|
507
558
|
}
|
|
508
559
|
},
|
|
509
560
|
groups: {
|
|
@@ -523,7 +574,7 @@ var _default = {
|
|
|
523
574
|
"defaultMessage": "Description"
|
|
524
575
|
}
|
|
525
576
|
}),
|
|
526
|
-
fields: ['material', 'technique', '
|
|
577
|
+
fields: ['material', 'technique', 'subject', 'contentDescription', 'measuredPart', 'creditLine']
|
|
527
578
|
},
|
|
528
579
|
group_production: {
|
|
529
580
|
messages: (0, _reactIntl.defineMessages)({
|
|
@@ -533,11 +584,19 @@ var _default = {
|
|
|
533
584
|
}
|
|
534
585
|
}),
|
|
535
586
|
fields: ['objectProductionPerson', 'objectProductionOrganization', 'objectProductionPeople', 'objectProductionPlace', 'objectProductionDate']
|
|
587
|
+
},
|
|
588
|
+
group_rights: {
|
|
589
|
+
messages: (0, _reactIntl.defineMessages)({
|
|
590
|
+
label: {
|
|
591
|
+
"id": "detailGroup.group_rights.label",
|
|
592
|
+
"defaultMessage": "Rights"
|
|
593
|
+
}
|
|
594
|
+
}),
|
|
595
|
+
fields: ['rightStatement', 'standardizedRightStatement', 'rightReproductionStatement']
|
|
536
596
|
}
|
|
537
597
|
},
|
|
538
598
|
layout: {
|
|
539
|
-
fields1: ['group_id', 'group_description', 'group_production']
|
|
599
|
+
fields1: ['group_id', 'group_description', 'group_production', 'group_rights']
|
|
540
600
|
}
|
|
541
601
|
}
|
|
542
|
-
};
|
|
543
|
-
exports.default = _default;
|
|
602
|
+
};
|
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: {
|
|
@@ -28,9 +28,8 @@ var _default = {
|
|
|
28
28
|
},
|
|
29
29
|
groups: {
|
|
30
30
|
group_description: {
|
|
31
|
-
fields: ['materialTechniqueDescription', 'material', 'technique', '
|
|
31
|
+
fields: ['materialTechniqueDescription', 'material', 'technique', 'subject', 'contentDescription', 'measuredPart', 'creditLine']
|
|
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
|
@@ -4,7 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _default = {
|
|
8
|
-
gatewayUrl: 'http://localhost:8180/gateway/lhmc'
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
var _default = exports.default = {
|
|
8
|
+
gatewayUrl: 'http://localhost:8180/gateway/lhmc',
|
|
9
|
+
filters: {
|
|
10
|
+
fields: {
|
|
11
|
+
objectProductionPlace: {
|
|
12
|
+
field: 'collectionobjects_common:objectProductionPlaceGroupList.objectProductionPlace.displayName'
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
};
|
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',
|
|
@@ -984,5 +984,4 @@ var _default = {
|
|
|
984
984
|
}
|
|
985
985
|
}
|
|
986
986
|
}
|
|
987
|
-
};
|
|
988
|
-
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;
|