diff --git a/src/client/components/pages/help.js b/src/client/components/pages/help.js
index 5251b5c3f5..f8a5ebcef0 100644
--- a/src/client/components/pages/help.js
+++ b/src/client/components/pages/help.js
@@ -79,8 +79,8 @@ function HelpPage() {
- {genEntityIconHTMLElement('EditionGroup')}Edition Group – a logical grouping of similar Editions.
- - Example: paperback, hardcover and e-book editions
+ {genEntityIconHTMLElement('EditionGroup')}Edition Group – a logical grouping of different Editions of the same book.
+ - Example: paperback, hardcover and e-book editions of a novel
{genEntityIconHTMLElement('Publisher')}Publisher – publishing company or imprint
@@ -111,11 +111,15 @@ function HelpPage() {
- Find or add a new {genEntityIconHTMLElement('Author')}Author
- - Find or add a new {genEntityIconHTMLElement('Work')}Work with an 'Author wrote Work' relationship
- - Find or add a new {genEntityIconHTMLElement('Publisher')}Publisher
- - Find or add a new {genEntityIconHTMLElement('EditionGroup')}Edition Group
- - Find or add a new {genEntityIconHTMLElement('Edition')}Edition with a 'contains Work' relationship and fill in the Publisher
- - If another format of the edition from the same publisher exists (see below), go to the Edition Group and click the 'Add Edition' button. Repeat step 5.
+ - On the Author page, click on 'Add Work' to create a {genEntityIconHTMLElement('Work')}Work with a relationship to the Author
+ - On the Work page, click 'Add Edition' to create an {genEntityIconHTMLElement('Edition')}Edition with a relationship to the Work
+ -
+
+ - A new {genEntityIconHTMLElement('EditionGroup')}Edition Group will be created automatically, but you can select an existing one
+ - Create a new {genEntityIconHTMLElement('Publisher')}Publisher if you cannot find an existing one
+
+
+ - To enter another format of the same book (see explanations below), go to the Edition Group and click the 'Add Edition' button. Repeat step 4.
When should I create a new Edition of a Work?
@@ -137,12 +141,15 @@ function HelpPage() {
When should two Editions be part of the same Edition Group?
- Generally, when a publisher releases multiple different formats of the same content, meaning:
+ Edition Groups exist to group together all the variations of an edition (an identifiable set of works) in a given language.
+ Here are examples of Editions that should be part of the same Edition Group:
+
- - No substantial textual changes to the Work (corrections aside)
- - Same editorial content (intro, foreword, etc.)
- - Same publisher
- - Same title and cover
+ - Different formats of the same edition (paperback, hardcover and e-book by the same publisher)
+ - Revised and updated editions
+ - Reprints
+ - Editions with different forewords/intros
+ - Co-editions (same book published in different countries by different publishers)
diff --git a/src/client/entity-editor/common/entity-search-field-option.js b/src/client/entity-editor/common/entity-search-field-option.js
index 4651d84075..e4cdfb5313 100644
--- a/src/client/entity-editor/common/entity-search-field-option.js
+++ b/src/client/entity-editor/common/entity-search-field-option.js
@@ -85,16 +85,21 @@ class EntitySearchFieldOption extends React.Component {
};
}
- fetchOptions(query) {
- return request
+ async fetchOptions(query) {
+ if (!query) {
+ return {
+ options: []
+ };
+ }
+ const response = await request
.get('/search/autocomplete')
.query({
collection: this.props.type,
q: query
- })
- .then((response) => ({
- options: response.body.map(this.entityToOption)
- }));
+ });
+ return {
+ options: response.body.map(this.entityToOption)
+ };
}
render() {
diff --git a/src/client/entity-editor/edition-section/actions.js b/src/client/entity-editor/edition-section/actions.js
index 3bcb0ec0f7..ab08a9e6f4 100644
--- a/src/client/entity-editor/edition-section/actions.js
+++ b/src/client/entity-editor/edition-section/actions.js
@@ -54,6 +54,7 @@ export const UPDATE_HEIGHT = 'UPDATE_HEIGHT';
export const UPDATE_DEPTH = 'UPDATE_DEPTH';
export const SHOW_PHYSICAL = 'SHOW_PHYSICAL';
export const SHOW_EDITION_GROUP = 'SHOW_EDITION_GROUP';
+export const UPDATE_WARN_IF_EDITION_GROUP_EXISTS = 'UPDATE_WARN_IF_EDITION_GROUP_EXISTS';
/**
* Produces an action indicating that the edition status for the edition being
diff --git a/src/client/entity-editor/edition-section/edition-section.js b/src/client/entity-editor/edition-section/edition-section.js
index 9d1d682f77..16f3a50ac0 100644
--- a/src/client/entity-editor/edition-section/edition-section.js
+++ b/src/client/entity-editor/edition-section/edition-section.js
@@ -34,10 +34,12 @@ import {
updatePublisher,
updateStatus
} from './actions';
-import {Button, Col, Row} from 'react-bootstrap';
+
+import {Alert, Button, Col, Row} from 'react-bootstrap';
import type {List, Map} from 'immutable';
import {
validateEditionSectionDepth,
+ validateEditionSectionEditionGroup,
validateEditionSectionHeight,
validateEditionSectionPages,
validateEditionSectionReleaseDate,
@@ -45,13 +47,14 @@ import {
validateEditionSectionWidth
} from '../validators/edition';
-
import CustomInput from '../../input';
import DateField from '../common/new-date-field';
import EntitySearchFieldOption from '../common/entity-search-field-option';
+import Icon from 'react-fontawesome';
import LanguageField from '../common/language-field';
import NumericField from '../common/numeric-field';
import React from 'react';
+import SearchResults from '../../components/pages/parts/search-results';
import Select from 'react-select';
import _ from 'lodash';
import {connect} from 'react-redux';
@@ -100,8 +103,10 @@ type StateProps = {
pagesValue: ?number,
physicalVisible: ?boolean,
publisherValue: Map,
+ editionGroupRequired: ?boolean,
editionGroupVisible: ?boolean,
editionGroupValue: Map,
+ matchingNameEditionGroups: ?array,
releaseDateValue: ?object,
statusValue: ?number,
weightValue: ?number,
@@ -169,8 +174,10 @@ function EditionSection({
onWidthChange,
pagesValue,
physicalVisible,
+ editionGroupRequired,
editionGroupValue,
editionGroupVisible,
+ matchingNameEditionGroups,
publisherValue,
releaseDateValue,
statusValue,
@@ -194,28 +201,85 @@ function EditionSection({
const {isValid: isValidReleaseDate, errorMessage: dateErrorMessage} = validateEditionSectionReleaseDate(releaseDateValue);
- return (
-