From 09f8286da20d2bf859b30b5933d70084ed5ae421 Mon Sep 17 00:00:00 2001 From: Tobias Koch Date: Wed, 9 Jun 2021 13:31:25 +0200 Subject: [PATCH 1/3] Bump version from 1.0.1 to 1.0.2 --- CHANGELOG.rst | 15 +++++++++++++-- offer-manager-app/pom.xml | 4 ++-- offer-manager-domain/pom.xml | 2 +- pom.xml | 2 +- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index a6e063ac5..825a8983e 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,7 +4,18 @@ Changelog This project adheres to `Semantic Versioning `_. -1.0.1 (2020-06-07) +1.0.2 (2021-06-07) +------------------ + +**Added** + +**Fixed** + +**Dependencies** + +**Deprecated** + +1.0.1 (2021-06-07) ------------------ **Added** @@ -19,7 +30,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-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 From 59f388251aef5435eb4ea5d85106234b93cb0247 Mon Sep 17 00:00:00 2001 From: Steffengreiner Date: Wed, 9 Jun 2021 14:47:11 +0200 Subject: [PATCH 2/3] Disable add affilation button until a new affilation is selected (#657) * Disable add affilation button until a new affilation is selected * Remove component error handling on affiliationValid from UpdatePersonView This is handeled by the super class CreatePersonView It also refreshes the affiliation address additions now. * Update Changelog Co-authored-by: Tobias Koch --- CHANGELOG.rst | 2 ++ .../components/person/create/CreatePersonView.groovy | 11 +++++++++++ .../components/person/update/UpdatePersonView.groovy | 11 ++++------- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 825a8983e..b9cbe516a 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -11,6 +11,8 @@ This project adheres to `Semantic Versioning `_. **Fixed** +* Disable the affiliation attachment during person update if no affiliation is selected (`#656 `_) + **Dependencies** **Deprecated** 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..9de067cb6 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 @@ -155,13 +155,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) } }) From 354bbe72915b3e5b0e842a76554f6f8bbbb7c2b8 Mon Sep 17 00:00:00 2001 From: Tobias Koch Date: Wed, 9 Jun 2021 15:13:02 +0200 Subject: [PATCH 3/3] Listen to affiliations of person instead of selected affiliation (#655) * Listen to affiliations of the person instead of selected affiliation * Update Changelog --- CHANGELOG.rst | 2 ++ .../person/update/UpdatePersonView.groovy | 27 +++++++++++++++++-- .../update/UpdatePersonViewModel.groovy | 10 ++++--- 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index b9cbe516a..e7d7b5b36 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -11,6 +11,8 @@ This project adheres to `Semantic Versioning `_. **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** 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 9de067cb6..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 @@ -198,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.") + } + }) }) } @@ -217,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() } }