Content
View differences
Updated by Jens Ulferts over 1 year ago
### Steps to reproduce
1. As an administrator, add a new project attribute
1. Mark it as required
2. Navigate to a project with an external file storage added and configured
3. Go to _Project settings_ → _Files_ and navigate to the _Attachments_ tab
4. Click on "Add new member"
5. Try to disable the _Show attachments in the work packages files tab_ option
### What is the buggy behavior?
* When the new required field is added, the project goes into an "invalid" state and an error message is displayed to the user saying that the change in attachment settings cannot be saved because of this.
* The error message will be implemented in: ###55789
### What is the expected behavior?
The error message is useful but it doesn't help the user since project admins may not necessary be able to change admin settings.
* The addition of that new required field should _not_ block other actions concerning project settings.
* A "new" required project attribute should only throw an error when the user tries to edit and save the project attribute section containing this new attribute (left empty) in the _Project overview page._
* This front-end validation is already implemented.
### Technical details:
Currently custom field validations happen inside the `acts_as_customizable` plugin. This is not ideal, because it does not provide enough flexiblity for each implementing model apart.
A good example is the work package [#55789](https://community.openproject.org/work_packages/55789), where saving Project settings unrelated to custom fields will fail validation if the project has an unset required attribute.
The solution is to move the custom field validations away from the `acts_as_customizable` plugin to the _contract layer_ of each implementing model (`Project, Group, User, Version, WorkPackage`).
### Environment information
**OpenProject 14.3.0**
**Edge**
Core build: [2b354c9d11d94ae1efa3dd75d31de6269ae855a7](https://github.com/opf/openproject/commits/2b354c9d11d94ae1efa3dd75d31de6269ae855a7)
Product version: [62bf97503d455f6ab4e5c09ee9e1b868ecc8d988](https://github.com/opf/saas-openproject/commits/62bf97503d455f6ab4e5c09ee9e1b868ecc8d988)
**Browser**
* [ ] Chrome
* [x] Firefox
* [ ] Safari
* [ ] Mobile Safari
* [ ] Other (please specify)
**Language**
EN/FR
1. As an administrator, add a new project attribute
1. Mark it as required
2. Navigate to a project with an external file storage added and configured
3. Go to _Project settings_ → _Files_ and navigate to the _Attachments_ tab
4.
5.
### What is the buggy behavior?
* When the new required field is added, the project goes into an "invalid" state and an error message is displayed to the user saying that the change in attachment settings cannot be saved because of this.
* The error message will be implemented in: ###55789
### What is the expected behavior?
The error message is useful but it doesn't help the user since project admins may not necessary be able to change admin settings.
* The addition of that new required field should _not_ block other actions concerning project settings.
* A "new" required project attribute should only throw an error when the user tries to edit and save the project attribute section containing this new attribute (left empty) in the _Project overview page._
* This front-end validation is already implemented.
### Technical details:
Currently custom field validations happen inside the `acts_as_customizable` plugin. This is not ideal, because it does not provide enough flexiblity for each implementing model apart.
A good example is the work package [#55789](https://community.openproject.org/work_packages/55789), where saving Project settings unrelated to custom fields will fail validation if the project has an unset required attribute.
The solution is to move the custom field validations away from the `acts_as_customizable` plugin to the _contract layer_ of each implementing model (`Project, Group, User, Version, WorkPackage`).
### Environment information
**OpenProject 14.3.0**
**Edge**
Core build: [2b354c9d11d94ae1efa3dd75d31de6269ae855a7](https://github.com/opf/openproject/commits/2b354c9d11d94ae1efa3dd75d31de6269ae855a7)
Product version: [62bf97503d455f6ab4e5c09ee9e1b868ecc8d988](https://github.com/opf/saas-openproject/commits/62bf97503d455f6ab4e5c09ee9e1b868ecc8d988)
**Browser**
* [ ] Chrome
* [x] Firefox
* [ ] Safari
* [ ] Mobile Safari
* [ ] Other (please specify)
**Language**
EN/FR