From 9921ab67298677df0fa57669a716499a80e83972 Mon Sep 17 00:00:00 2001 From: Monkey Do Date: Wed, 12 Jun 2019 15:37:48 +0200 Subject: [PATCH] feat(auto-eg): Refactor Edition page to keep Edition Group section in the same place --- .../edition-section/edition-section.js | 62 +++++++++---------- 1 file changed, 29 insertions(+), 33 deletions(-) diff --git a/src/client/entity-editor/edition-section/edition-section.js b/src/client/entity-editor/edition-section/edition-section.js index 86011611d2..16f3a50ac0 100644 --- a/src/client/entity-editor/edition-section/edition-section.js +++ b/src/client/entity-editor/edition-section/edition-section.js @@ -50,6 +50,7 @@ import { 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'; @@ -229,22 +230,27 @@ function EditionSection({ } + + ); - const alertAutoCreateEditionGroup = !editionGroupVisible && - !editionGroupRequired && + const alertAutoCreateEditionGroup = !editionGroupValue && + !editionGroupVisible && + !editionGroupRequired && !hasmatchingNameEditionGroups; return ( @@ -252,14 +258,27 @@ function EditionSection({

What else do you know about the Edition?

+

+ Edition Group is required — this cannot be blank +

{ - (editionGroupRequired || hasmatchingNameEditionGroups) && - -

- Edition Group is required — this cannot be blank -

- {getEditionGroupSearchSelect()} -
+ alertAutoCreateEditionGroup ? + + + + A new Edition Group with the same name will be created automatically. +
+ +
+ +
: + getEditionGroupSearchSelect() }

Below fields are optional — leave something blank if you @@ -325,29 +344,6 @@ function EditionSection({ - - { - alertAutoCreateEditionGroup && - - - - A new Edition Group with the same name will be created automatically. -
- -
- -
- } - { - (editionGroupVisible || editionGroupValue) && !editionGroupRequired && - getEditionGroupSearchSelect() - } { physicalVisible &&