diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index a6e063ac5..e7d7b5b36 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -4,7 +4,22 @@ Changelog
This project adheres to `Semantic Versioning `_.
-1.0.1 (2020-06-07)
+1.0.2 (2021-06-07)
+------------------
+
+**Added**
+
+**Fixed**
+
+* Update of person entries is no longer blocked by ignored affiliation selection (`#654 `_)
+
+* Disable the affiliation attachment during person update if no affiliation is selected (`#656 `_)
+
+**Dependencies**
+
+**Deprecated**
+
+1.0.1 (2021-06-07)
------------------
**Added**
@@ -19,7 +34,7 @@ This project adheres to `Semantic Versioning `_.
**Deprecated**
-1.0.0 (2020-06-04)
+1.0.0 (2021-06-04)
------------------
**Added**
diff --git a/offer-manager-app/pom.xml b/offer-manager-app/pom.xml
index 59315588b..c38957c0d 100644
--- a/offer-manager-app/pom.xml
+++ b/offer-manager-app/pom.xml
@@ -5,7 +5,7 @@
offer-manager
life.qbic
- 1.0.1-SNAPSHOT
+ 1.0.2-SNAPSHOT
4.0.0
war
@@ -15,7 +15,7 @@
life.qbic
offer-manager-domain
- 1.0.1-SNAPSHOT
+ 1.0.2-SNAPSHOT
compile
diff --git a/offer-manager-app/src/main/groovy/life/qbic/portal/offermanager/components/person/create/CreatePersonView.groovy b/offer-manager-app/src/main/groovy/life/qbic/portal/offermanager/components/person/create/CreatePersonView.groovy
index a98c65e9d..410a5ec4e 100644
--- a/offer-manager-app/src/main/groovy/life/qbic/portal/offermanager/components/person/create/CreatePersonView.groovy
+++ b/offer-manager-app/src/main/groovy/life/qbic/portal/offermanager/components/person/create/CreatePersonView.groovy
@@ -221,6 +221,7 @@ class CreatePersonView extends VerticalLayout implements Resettable {
organisationComboBox.value = findOrganisation(newValue).get()
addressAdditionComboBox.value = newValue
} else {
+ refreshAddressAdditions()
addressAdditionComboBox.value = addressAdditionComboBox.emptyValue
organisationComboBox.value = organisationComboBox.emptyValue
}
@@ -275,6 +276,16 @@ class CreatePersonView extends VerticalLayout implements Resettable {
})
}
+ /**
+ * refreshes assuming no organisation is selected
+ */
+ protected void refreshAddressAdditions() {
+ ListDataProvider dataProvider = new ListDataProvider<>(new ArrayList())
+ this.addressAdditionComboBox.setDataProvider(dataProvider)
+ this.addressAdditionComboBox.value = addressAdditionComboBox.emptyValue
+ addressAdditionComboBox.setEnabled(false)
+ }
+
protected void refreshAddressAdditions(Organisation organisation) {
addressAdditionComboBox.setEnabled(true)
diff --git a/offer-manager-app/src/main/groovy/life/qbic/portal/offermanager/components/person/update/UpdatePersonView.groovy b/offer-manager-app/src/main/groovy/life/qbic/portal/offermanager/components/person/update/UpdatePersonView.groovy
index ad7e124cc..60bbd64c3 100644
--- a/offer-manager-app/src/main/groovy/life/qbic/portal/offermanager/components/person/update/UpdatePersonView.groovy
+++ b/offer-manager-app/src/main/groovy/life/qbic/portal/offermanager/components/person/update/UpdatePersonView.groovy
@@ -44,6 +44,11 @@ class UpdatePersonView extends CreatePersonView {
submitButton.caption = "Update Person"
abortButton.caption = "Abort Person Update"
+ // remove required indicator since affiliationValid is no longer required to update
+ // it is replaced by affiliationsValid
+ organisationComboBox.setRequiredIndicatorVisible(false)
+ addressAdditionComboBox.setRequiredIndicatorVisible(false)
+
//be careful when adding new components to the view
//it is based on the CreatePersonView, you might disrupt the view when adding new components to the wrong position
@@ -155,13 +160,10 @@ class UpdatePersonView extends CreatePersonView {
}
})
- updatePersonViewModel.addPropertyChangeListener("affiliationValid", {
- if (updatePersonViewModel.affiliationValid || updatePersonViewModel.affiliationValid == null) {
- organisationComboBox.componentError = null
- addressAdditionComboBox.componentError = null
- addAffiliationButton.setEnabled(true)
- } else {
- addAffiliationButton.setEnabled(false)
+ updatePersonViewModel.addPropertyChangeListener({
+ if (it.propertyName == "affiliation" || it.propertyName == "affiliationValid") {
+ boolean buttonEnabled = updatePersonViewModel.affiliation && updatePersonViewModel.affiliationValid
+ addAffiliationButton.setEnabled(buttonEnabled)
}
})
@@ -201,6 +203,20 @@ class UpdatePersonView extends CreatePersonView {
}
submitButton.enabled = allValuesValid()
}
+
+ updatePersonViewModel.affiliationList.addPropertyChangeListener({
+ //validation
+ updatePersonViewModel.affiliationsValid = ! updatePersonViewModel.affiliationList.isEmpty()
+ if(updatePersonViewModel.outdatedPerson) {
+ List originalList = updatePersonViewModel.outdatedPerson.affiliations
+ List viewModelList = updatePersonViewModel.affiliationList
+ boolean affiliationsChanged = ! (originalList == viewModelList)
+ // set the changed needs to be triggered after the validity update
+ updatePersonViewModel.personUpdated = updatePersonViewModel.affiliationsValid && affiliationsChanged
+ } else {
+ log.warn("Tried to check for person affiliation changes. There is no person to update.")
+ }
+ })
})
}
@@ -220,7 +236,11 @@ class UpdatePersonView extends CreatePersonView {
*/
@Override
protected boolean allValuesValid() {
- return super.allValuesValid()
- && updatePersonViewModel.personUpdated
+ return createPersonViewModel.academicTitleValid \
+ && createPersonViewModel.firstNameValid \
+ && createPersonViewModel.lastNameValid \
+ && createPersonViewModel.emailValid \
+ && updatePersonViewModel.personUpdated \
+ && updatePersonViewModel.affiliationsValid
}
}
diff --git a/offer-manager-app/src/main/groovy/life/qbic/portal/offermanager/components/person/update/UpdatePersonViewModel.groovy b/offer-manager-app/src/main/groovy/life/qbic/portal/offermanager/components/person/update/UpdatePersonViewModel.groovy
index 69eb77ee1..83062b837 100644
--- a/offer-manager-app/src/main/groovy/life/qbic/portal/offermanager/components/person/update/UpdatePersonViewModel.groovy
+++ b/offer-manager-app/src/main/groovy/life/qbic/portal/offermanager/components/person/update/UpdatePersonViewModel.groovy
@@ -6,7 +6,6 @@ import life.qbic.datamodel.dtos.business.Customer
import life.qbic.datamodel.dtos.business.ProjectManager
import life.qbic.datamodel.dtos.general.Person
import life.qbic.portal.offermanager.components.Resettable
-import life.qbic.portal.offermanager.dataresources.persons.PersonResourceService
import life.qbic.portal.offermanager.communication.EventEmitter
import life.qbic.portal.offermanager.components.person.create.CreatePersonViewModel
import life.qbic.portal.offermanager.dataresources.ResourcesService
@@ -32,6 +31,9 @@ class UpdatePersonViewModel extends CreatePersonViewModel implements Resettable{
@Bindable
Boolean personUpdated
+ @Bindable
+ Boolean affiliationsValid
+
UpdatePersonViewModel(ResourcesService customerService,
ResourcesService managerResourceService,
ResourcesService affiliationService,
@@ -39,7 +41,7 @@ class UpdatePersonViewModel extends CreatePersonViewModel implements Resettable{
ResourcesService personResourceService) {
super(customerService, managerResourceService, affiliationService, personResourceService)
this.customerUpdate = customerUpdate
- affiliationList = new ArrayList()
+ affiliationList = new ObservableList(new ArrayList())
personUpdated = false
this.customerUpdate.register((Person person) -> {
@@ -64,8 +66,8 @@ class UpdatePersonViewModel extends CreatePersonViewModel implements Resettable{
@Override
void reset() {
- super.reset()
- setOutdatedPerson(null)
affiliationList.clear()
+ setOutdatedPerson(null)
+ super.reset()
}
}
diff --git a/offer-manager-domain/pom.xml b/offer-manager-domain/pom.xml
index 9bb0c709a..886504b40 100644
--- a/offer-manager-domain/pom.xml
+++ b/offer-manager-domain/pom.xml
@@ -7,7 +7,7 @@
offer-manager
life.qbic
- 1.0.1-SNAPSHOT
+ 1.0.2-SNAPSHOT
diff --git a/pom.xml b/pom.xml
index 77b05fc18..c9a01ba5c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -8,7 +8,7 @@
offer-manager-app
offer-manager
- 1.0.1-SNAPSHOT
+ 1.0.2-SNAPSHOT
life.qbic
The new offer manager
http://github.com/qbicsoftware/qOffer_2.0