Skip to content

Commit 0c54a60

Browse files
authored
Merge pull request #342 from collectionspace/develop
Develop
2 parents fe7063c + b83b356 commit 0c54a60

44 files changed

Lines changed: 730 additions & 95 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,35 @@
2121
- Rename "MyCollectionSpace" to "Recent Activity".
2222
- Fix performance issue when relating m:n records.
2323
- Enabled Hot Module Replacement for faster development.
24+
- Add 'repatriation preparation' to the movement static term list `moveReasons`
25+
26+
### New Fields
27+
28+
- On the record editor for Objects
29+
- The Controlled Content Place repeating field `controlledContentPlaces/controlledContentPlace` has been added
30+
- On the record editor for Acquisition
31+
- The Acquisition description free text field `acquisitionDescription` has been added
32+
- The Parties Involved repeating group `partiesInvolvedGroupList/partiesInvolvedGroup` has been added
33+
- On the record editor for Consultation
34+
- The repeating field `consultationOutcomes/consultationOutcome` has been added
35+
- On the record editor for Deaccession
36+
- The Parties Involved repeating group `partiesInvolvedGroupList/partiesInvolvedGroup` has been added
2437

2538
### Accessibility
2639

2740
- Display alt text with thumbnail images (Criteria 1.1.1).
2841
- Add link to User Manual in Footer (Criteria 3.2.6).
2942
- ARIA/WCAG updates for search table.
3043
- Fix Contrast for Selected Page in search results paginator (Criteria 1.4.3)
44+
- Add H1 tag to the Login Screen (Criteria 1.3.1)
45+
- Display alt text and title with images of image gallery (Criteria 1.1.1)
3146

3247
### Bug Fixes
3348

3449
- Fix report invocation failure when some number of records over 190 are selected.
3550
- Fix placeholders displayed in error message when user does not have permission to create relationships.
3651

37-
**Full Changelog**: [`v10.1.0...v10.2.0`](https://github.com/collectionspace/cspace-ui.js/compare/v10.1.0-rc.0...v10.2.0-rc1.0)
52+
**Full Changelog**: [`v10.1.0...v10.2.0`](https://github.com/collectionspace/cspace-ui.js/compare/v10.1.0-rc.0...release-10.2.0-rc2.0)
3853

3954
## v10.1.0
4055

docs/configuration/messages.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,8 @@ export default {
677677

678678
"field.acquisitions_common.acquisitionProvisos.name": "Provisos",
679679

680+
"field.acquisitions_common.acquisitionDescription.name": "Acquisition description",
681+
680682
"field.acquisitions_common.acquisitionReason.name": "Acquisition reason",
681683

682684
"field.acquisitions_common.acquisitionReferenceNumber.inUse": "The reference number {value} is in use by another record.",
@@ -1449,6 +1451,10 @@ export default {
14491451

14501452
"field.collectionobjects_common.contentPerson.name": "Person",
14511453

1454+
"field.collectionobjects_common.controlledContentPlace.fullName": "Content place (controlled)",
1455+
1456+
"field.collectionobjects_common.controlledContentPlace.name": "Place (controlled)",
1457+
14521458
"field.collectionobjects_common.contentPlace.fullName": "Content place",
14531459

14541460
"field.collectionobjects_common.contentPlace.name": "Place",

images/collapseWhite.svg

Lines changed: 0 additions & 3 deletions
This file was deleted.

images/expandWhite.svg

Lines changed: 0 additions & 3 deletions
This file was deleted.

package-lock.json

Lines changed: 1 addition & 1 deletion
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-rc1.0",
3+
"version": "10.2.0-rc2.0",
44
"description": "CollectionSpace user interface for browsers",
55
"author": "Ray Lee <ray.lee@lyrasis.org>",
66
"license": "ECL-2.0",

src/actions/searchPage.js

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,40 @@ export const setSearchPageAdvancedSearchTerms = (condition) => (dispatch, getSta
7373
},
7474
});
7575
};
76+
/**
77+
* Builds the advanced search condition, conditionally.
78+
* @param {boolean} useNewSearch whether new search is being used
79+
* @param {Map} advancedLimitBy the condition of the limit by panel
80+
* @param {Map} advancedSearchTerms the condition of the searchTerms panel
81+
* @param {Map} advanced the condition of the classic search form
82+
* @returns {Map} the built advanced search condition;
83+
*/
84+
export const buildAdvancedSearchCondition = (
85+
useNewSearch,
86+
advancedLimitBy,
87+
advancedSearchTerms,
88+
advanced,
89+
) => {
90+
// When using new search
91+
if (useNewSearch || typeof useNewSearch === 'undefined') {
92+
// and only search terms panel is populated,
93+
if (advancedLimitBy == null) {
94+
// then it returns the advancedSearchTerms condition
95+
return advancedSearchTerms;
96+
}
97+
// and both search panels are populated,
98+
// then it combines advancedLimitBy and advancedSearchTerms using AND operator.
99+
return Immutable.Map({
100+
op: OP_AND,
101+
value: Immutable.List.of(
102+
advancedSearchTerms,
103+
advancedLimitBy,
104+
),
105+
});
106+
}
107+
// When not using new search, it returns the advanced condition.
108+
return advanced;
109+
};
76110

77111
export const initiateSearch = (config, push) => (dispatch, getState) => {
78112
const state = getState();
@@ -81,15 +115,6 @@ export const initiateSearch = (config, push) => (dispatch, getState) => {
81115
const vocabulary = getSearchPageVocabulary(state, recordType);
82116
const keyword = getSearchPageKeyword(state);
83117
const useNewSearch = getUseNewSearch(state);
84-
const advancedSearchCondition = useNewSearch || typeof useNewSearch === 'undefined'
85-
? Immutable.Map({
86-
op: OP_AND,
87-
value: Immutable.List.of(
88-
getSearchPageAdvancedSearchTerms(state),
89-
getSearchPageAdvancedLimitBy(state),
90-
),
91-
})
92-
: getSearchPageAdvanced(state);
93118
const query = {};
94119
const vocabularyPath = vocabulary ? `/${vocabulary}` : '';
95120
const pathname = `/list/${recordType}${vocabularyPath}`;
@@ -100,6 +125,16 @@ export const initiateSearch = (config, push) => (dispatch, getState) => {
100125
query.kw = kw;
101126
}
102127

128+
const advancedSearchTerms = getSearchPageAdvancedSearchTerms(state);
129+
const advancedLimitBy = getSearchPageAdvancedLimitBy(state);
130+
const advanced = getSearchPageAdvanced(state);
131+
const advancedSearchCondition = buildAdvancedSearchCondition(
132+
useNewSearch,
133+
advancedLimitBy,
134+
advancedSearchTerms,
135+
advanced,
136+
);
137+
103138
const fields = get(config, ['recordTypes', recordType, 'fields']);
104139
const condition = normalizeCondition(fields, advancedSearchCondition);
105140

src/actions/searchToSelect.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,17 @@ import {
44
SET_SEARCH_TO_SELECT_ADVANCED,
55
SET_SEARCH_TO_SELECT_RECORD_TYPE,
66
SET_SEARCH_TO_SELECT_VOCABULARY,
7+
SET_SEARCH_TO_SELECT_ADVANCED_LIMIT_BY,
8+
SET_SEARCH_TO_SELECT_ADVANCED_SEARCH_TERMS,
79
} from '../constants/actionCodes';
810

911
import {
1012
getSearchToSelectRecordType,
1113
} from '../reducers';
14+
import {
15+
SEARCH_TERMS_GROUP_LIMIT_BY,
16+
SEARCH_TERMS_GROUP_SEARCH_TERMS,
17+
} from '../constants/searchNames';
1218

1319
export const clearSearchToSelect = () => ({
1420
type: CLEAR_SEARCH_TO_SELECT,
@@ -31,6 +37,32 @@ export const setSearchToSelectAdvanced = (condition) => (dispatch, getState) =>
3137
});
3238
};
3339

40+
export const setSearchToSelectAdvancedLimitBy = (condition) => (dispatch, getState) => {
41+
const recordType = getSearchToSelectRecordType(getState());
42+
43+
dispatch({
44+
type: SET_SEARCH_TO_SELECT_ADVANCED_LIMIT_BY,
45+
payload: condition,
46+
meta: {
47+
searchTermsGroup: SEARCH_TERMS_GROUP_LIMIT_BY,
48+
recordType,
49+
},
50+
});
51+
};
52+
53+
export const setSearchToSelectAdvancedSearchTerms = (condition) => (dispatch, getState) => {
54+
const recordType = getSearchToSelectRecordType(getState());
55+
56+
dispatch({
57+
type: SET_SEARCH_TO_SELECT_ADVANCED_SEARCH_TERMS,
58+
payload: condition,
59+
meta: {
60+
searchTermsGroup: SEARCH_TERMS_GROUP_SEARCH_TERMS,
61+
recordType,
62+
},
63+
});
64+
};
65+
3466
export const setSearchToSelectRecordType = (recordType) => ({
3567
type: SET_SEARCH_TO_SELECT_RECORD_TYPE,
3668
payload: recordType,

src/components/media/MediaViewer.jsx

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ const propTypes = {
6666
}).isRequired,
6767
isSearchPending: PropTypes.bool,
6868
listType: PropTypes.string,
69-
ownBlobCsid: PropTypes.string,
69+
ownFields: PropTypes.shape({
70+
ownBlobCsid: PropTypes.string,
71+
ownAltText: PropTypes.string,
72+
ownIdentificationNumber: PropTypes.string,
73+
}),
7074
searchResult: PropTypes.instanceOf(Immutable.Map),
7175
readRecord: PropTypes.func,
7276
};
@@ -113,7 +117,7 @@ export default class MediaViewer extends Component {
113117
.then((blobData) => getContentPath(config, 'blob', undefined, blobCsid, popupSubresource, blobData));
114118
}
115119

116-
createGalleryImage(blobCsid) {
120+
createGalleryImage(blobCsid, altText, identificationNumber) {
117121
const {
118122
config,
119123
} = this.props;
@@ -128,7 +132,11 @@ export default class MediaViewer extends Component {
128132
// move from snapshot to original here to keep similar semantics
129133
original: getContentPath(config, 'blob', undefined, blobCsid, snapshotSubresource),
130134
snapshot: getContentPath(config, 'blob', undefined, blobCsid, snapshotSubresource),
135+
snapshotAlt: altText ?? identificationNumber,
136+
snapshotTitle: identificationNumber,
131137
thumbnail: getContentPath(config, 'blob', undefined, blobCsid, thumbnailSubresource),
138+
thumbnailAlt: altText ?? identificationNumber,
139+
thumbnailTitle: identificationNumber,
132140
};
133141
}
134142

@@ -137,14 +145,15 @@ export default class MediaViewer extends Component {
137145
config,
138146
isSearchPending,
139147
listType,
140-
ownBlobCsid,
148+
ownFields,
141149
searchResult,
142150
} = this.props;
143151

144152
const images = [];
145153

146-
if (ownBlobCsid) {
147-
images.push(this.createGalleryImage(ownBlobCsid));
154+
if (ownFields) {
155+
const { ownBlobCsid, ownAltText, ownIdentificationNumber } = ownFields;
156+
images.push(this.createGalleryImage(ownBlobCsid, ownAltText, ownIdentificationNumber));
148157
}
149158

150159
if (searchResult) {
@@ -168,9 +177,11 @@ export default class MediaViewer extends Component {
168177

169178
items.forEach((item) => {
170179
const blobCsid = item.get('blobCsid');
180+
const altText = item.get('altText');
181+
const identificationNumber = item.get('identificationNumber');
171182

172183
if (blobCsid) {
173-
images.push(this.createGalleryImage(blobCsid));
184+
images.push(this.createGalleryImage(blobCsid, altText, identificationNumber));
174185
}
175186
});
176187
}

src/components/media/MediaViewerPanel.jsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ const propTypes = {
2222
listTypes: PropTypes.object,
2323
}),
2424
name: PropTypes.string,
25-
ownBlobCsid: PropTypes.string,
25+
ownFields: PropTypes.shape({
26+
ownBlobCsid: PropTypes.string,
27+
ownAltText: PropTypes.string,
28+
ownIdentificationNumber: PropTypes.string,
29+
}),
2630
recordType: PropTypes.string,
2731
searchDescriptor: PropTypes.instanceOf(Immutable.Map),
2832
searchResult: PropTypes.instanceOf(Immutable.Map),
@@ -79,11 +83,13 @@ export default class MediaViewerPanel extends Component {
7983
const {
8084
config,
8185
listType,
82-
ownBlobCsid,
86+
ownFields,
8387
searchResult,
8488
title,
8589
} = this.props;
8690

91+
const ownBlobCsid = ownFields?.ownBlobCsid;
92+
8793
const listTypeConfig = config.listTypes[listType];
8894

8995
const totalItems = searchResult
@@ -122,11 +128,13 @@ export default class MediaViewerPanel extends Component {
122128
config,
123129
listType,
124130
name,
125-
ownBlobCsid,
131+
ownFields,
126132
recordType,
127133
searchDescriptor,
128134
} = this.props;
129135

136+
const ownBlobCsid = ownFields?.ownBlobCsid;
137+
130138
return (
131139
<Panel
132140
className={styles.common}
@@ -142,7 +150,7 @@ export default class MediaViewerPanel extends Component {
142150
columnSetName={columnSetName}
143151
config={config}
144152
listType={listType}
145-
ownBlobCsid={isCsid(ownBlobCsid) ? ownBlobCsid : undefined}
153+
ownFields={isCsid(ownBlobCsid) ? ownFields : undefined}
146154
recordType={recordType}
147155
searchName={name}
148156
searchDescriptor={searchDescriptor}

0 commit comments

Comments
 (0)