119 Commits

Author SHA1 Message Date
Ivan Kuchin f6e073f0a1 [#74769] Remove portfolio_models feature flag
https://community.openproject.org/wp/74769
2026-05-28 13:53:08 +02:00
Klaus Zanders 2a934faeb9 Fix archiving controller 2026-02-09 15:08:26 +01:00
Klaus Zanders 6dc0bbd4d4 Fix specs in projects controller 2026-02-09 15:08:00 +01:00
Dombi Attila 2e624b1326 [#70982] 'For all projects' project attributes are not displayed during new project creation
https://community.openproject.org/work_packages/70982
2026-01-26 14:16:26 +02:00
ulferts 2a924d1a65 split up project/program/portfolio creation among dedicated controllers 2025-12-04 16:24:00 +01:00
ulferts 58e7c96fb3 permit project creation query params on login back url 2025-12-04 15:10:18 +01:00
Dombi Attila cb873f4460 Render the correct second step when the parent is invalid, display the inline error message on the parent autocompleter. 2025-11-24 19:29:13 +02:00
Dombi Attila 3d3e7d90a9 Merge branch 'dev' into feature/68856-project-create-separate-template-page 2025-11-21 20:31:13 +02:00
Dombi Attila 125dafb545 Update specs 2025-11-21 19:42:07 +02:00
Ivan Kuchin 1bdf3df07f add workspace type specific create routes to use same logic for finding template 2025-11-20 20:30:55 +01:00
Dombi Attila 53b0c14191 Skip validating custom fields when creating a project from a template. 2025-11-19 20:14:10 +02:00
Dombi Attila c4984ade97 [#69034] Change enforcement of project attributes on creation for templates
https://community.openproject.org/work_packages/69034
2025-11-19 20:14:09 +02:00
Tobias Dillmann b10a2b8548 [#68812] Add missing projects controller spec
There was a shared example, but it was never used. Why does our static
code checking miss this?
2025-11-14 16:25:59 +01:00
Alexander Brandon Coles 0936b2a717 [#64885] Impl. Danger Dialog for Project Delete 2025-08-27 16:19:53 +01:00
Dombi Attila 7b1fd5f09a Add program creation form and global permission. 2025-08-22 15:23:16 +03:00
Dombi Attila 97eb8f0692 Code review adjustments 2025-08-22 10:20:07 +03:00
Alexander Brandon Coles b2ae2879ef DRY up user creation in ProjectsController spec
Co-Authored-By: Christophe Bliard <176055+cbliard@users.noreply.github.com>
2025-07-01 12:32:21 +01:00
Alexander Brandon Coles f4035fe345 Fix typo in ProjectsController spec metadata
Co-Authored-By: Christophe Bliard <176055+cbliard@users.noreply.github.com>
2025-07-01 12:32:15 +01:00
Alexander Brandon Coles 974de82cfd Fix submission when no copy options are checked
Ensures no asssocations/dependencies can be checked when the user copies
or creates a project from template.
2025-07-01 12:30:07 +01:00
Alexander Brandon Coles 2a30b50e6e [#63594] Primerize Project copy form
Updates the form visuals based on new mockups: the Project copy form now
only includes required (built-in and custom) fields, along with the
"Subproject of" field.

In detail:

* Introduces `Projects::CopyFormComponent`.
* Adds `Projects::CopyForm` with basic specs.
* Adds `ProjectsController#copy_form` action, permissions and route
  mappings.
* Updates copy project feature specs to reflect form changes.
2025-07-01 12:30:02 +01:00
Alexander Brandon Coles e225422ccd [#63593] Primerize Project create form
Updates the form visuals according to new wireframes: the Project create
form now only includes required (built-in and custom) fields, along with
the "Subproject of" field.

In detail:

* Introduces `Projects::NewComponent` and `TemplateSelectComponent`.
* Adds, extends necessary Primer forms with basic specs.
* Adds `ProjectsController#create` action, routes and permissions.
* Adds `highlight-when-value-selected` Stimulus controller.
* Updates project feature specs for new form, including rewriting some
  expectations that were reliant on `data-qa-name` attribute that Primer
  form components do not render by default.
* Removes now obsolete Project Status administation feature spec.
2025-06-11 16:31:30 +01:00
Jan Sandbrink 0b87e7543f Freeze string literals in specs
Rolling out frozen string literals further by freezing all
string literals in core specs.
2025-05-05 09:29:55 +02:00
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +02:00
Christophe Bliard a885fef2bd Conform to RSpecRails/HaveHttpStatus cop
With a hack to get `have_http_status` to work with `Rack::MockResponse`.
2024-06-24 17:50:57 +02:00
ulferts 3b2121f733 Revert "Merge remote-tracking branch 'origin/release/13.4' into dev"
This reverts commit 40b2bbeb09, reversing
changes made to b4c6cb17cc.
2024-03-21 11:31:17 +01:00
Ivan Kuchin 7787e457a3 Revert "Merge branch 'dev' into release/13.4"
This reverts commit a901541269, reversing
changes made to e573ca00b7.
2024-03-20 20:19:08 +01:00
Ivan Kuchin 9e4934cd0a change quotes using rubocop --only Style/StringLiterals,Style/QuotedSymbols -a 2024-03-20 18:05:22 +01:00
ulferts 241d76c3bf introduce queries/new action - show errors inline 2024-01-25 20:11:13 +01:00
Christophe Bliard c795874f7f Update copyright year for 2024
command used: `rg -l 'Copyright \(C\) 2012-202\d the OpenProject' | xargs -n 100 sed -i -r 's/Copyright \(C\) 2012-202. the OpenProject/Copyright (C) 2012-2024 the OpenProject/'`
2024-01-02 16:23:54 +01:00
Oliver Günther d60120f1fb Adapt specs now that login_required defaults to true 2023-11-08 11:30:58 +01:00
ulferts 5b2bc41f41 Merge remote-tracking branch 'origin/dev' into easier-factory-role-setup 2023-10-12 12:09:27 +02:00
ulferts 2b2abf864a introduce ProjectRole model 2023-10-09 14:34:20 +02:00
Klaus Zanders 78c1e4fadb Switch all uses of principal factories to use new interface 2023-10-09 10:39:44 +02:00
Christophe Bliard 4c2a9d0aa8 Enable RSpec zero monkey patching mode
The plan for RSpec 4.0 is to disable monkey patching.

See https://github.com/rspec/rspec-core/blob/main/features/configuration/zero_monkey_patching_mode.feature for details.
2023-05-31 19:22:29 +02:00
Christophe Bliard aa23106c11 lint: autocorrect RSpec/FactoryBot/ConsistentParenthesesStyle
command is

    rubocop -A --only RSpec/FactoryBot/ConsistentParenthesesStyle modules spec
2023-03-07 15:04:32 +01:00
Christophe Bliard 85b3258a29 Autocorrect with some rubocop cops
RSpec/Rails/InferredSpecType and Style/RedundantConstantBase

rubocop --autocorrect-all --only RSpec/Rails/InferredSpecType,Style/RedundantConstantBase spec modules/*/spec
2023-01-13 14:28:59 +01:00
Christophe Bliard 0084d99851 Faster spec 2023-01-11 08:39:12 +01:00
Christophe Bliard 21a696ef9b Update copyright information for 2023 2022-12-30 15:51:26 +01:00
Christophe Bliard 48a4f1b6ad lint with rubocop --autocorrect (safe cops only) 2022-06-02 10:40:10 +02:00
Christophe Bliard bc8d423ec2 update copyright information for 2022 2022-03-01 17:05:59 +01:00
Oliver Günther f08bea3467 Remove FactoryBot.* prefix where applicable 2022-01-25 08:19:06 +01:00
ulferts dba8567f20 place project archiving into separate controller 2021-10-29 15:48:19 +02:00
ulferts ebcf9138cc introduce separate permission for selecting custom fields 2021-10-28 10:21:44 +02:00
ulferts 9ecd930d52 reenabled select_project_modules permission 2021-10-27 17:02:58 +02:00
ulferts 48006b7bb3 rename generic to general settings 2021-10-27 16:36:25 +02:00
ulferts b11b64895b remove unused method
The form is now rendered in angular
2021-10-26 23:32:20 +02:00
ulferts 40f7989bb2 turn the manage_types permission authoritative
This will for the time being break the other project settings permissions
2021-10-26 18:03:42 +02:00
Oliver Günther ccfa29c728 Move license and copyright docs to root, fix names and references 2021-09-02 21:50:46 +02:00
Oliver Günther 6c75e16dc4 [37140] Use acts_as_url to generate unique slug for identifier (#9250)
* Use acts_as_url to generate unique slug for identifier

* Re-enable project identifier spec now handled in backend

* Add integration spec for set attribute service

* Adapt spec for new empty identifier

* Avoid double error messages for empty identifier

acts_as_url may return an empty string depending on the name,

but the empty presence validation will suffice in this case, we don't need the invalid validation

* Fix stubbed errors object accessed by acts_as_url

* Avoid trying to get the upstream unique attribute in case of errors

* Remove sequential_project_identifiers setting

* Adapt spec to review feedback
2021-05-12 11:11:31 +02:00
Benjamin Bädorf 44294ede04 User custom fields in the invite user modal (#9220)
* Projects form working with formly 50%

* Removed console.log

* Working with formattable

* Working with formattable

* Input with id and label

* Input with id and label

* Useless dependencies removed

* Saving forms + required labels with *

* First backend validation approach

* Removed reload on type change + keep model on route changes

* Handlig backend validations with setError

* Formatting the form model to submit

* Make up refactor

* working with op-form-field

* Form creation moved to the service

* Working with op-form-field wrapper

* Working with validation and op-form-field

* Working with []CustomFields

* Clean up

* Clean up

* Clean up

* Clean up

* Form routing working

* Notification on form error and success

* Refactor + removed useless dynamic form observable

* DynamicFieldsService with tests

* Refactor: inputs catalog + catch form load error

* Filter out non writable fields

* Refactor: naming consistency

* Cleaning comments

* dynamic-fields-service tests + wrapper component

* DynamicForm Tests

* @ngx-formly/core dependency added

* Cleaning up

* Provide DynamicFieldsService in root so it can be used independently

* DynamicForm working as a FormControl

* Getting route params sync

* Global FormsService: submit + formatting + error handling

* Fix: @Optional() FormGroupDirective in OpFormFieldComponent

* Code climate fix

* Removed CdkTextareaAutosize because of CDK issue 22469

* DynamicFormComponent tests

* Dynamic input test helpers + boolean and text tests

* Refactor edit fields to avoid circular dependencies in the dynamic forms

* Naming fix

* IntegerInputComponent tests

* SelectInputComponent tests

* Fix: duplicated identifier on inputs

* Extract toolbar to be reused for now

Still TBD whether we want to move them right now to the frontend?

* Create new project route and redirect to rails view after saving

* fieldsSettingsPipe + hide 'identifier' on projects

* Handling multi-values (also as links) and passwords

* Some TODOs removed

* FormattableTextareaInputComponent tests

* Projects form working with formly 50%

* Removed console.log

* Working with formattable

* Working with formattable

* Input with id and label

* Input with id and label

* Useless dependencies removed

* Saving forms + required labels with *

* First backend validation approach

* Removed reload on type change + keep model on route changes

* Handlig backend validations with setError

* Formatting the form model to submit

* Make up refactor

* working with op-form-field

* Form creation moved to the service

* Working with op-form-field wrapper

* Working with validation and op-form-field

* Working with []CustomFields

* Clean up

* Clean up

* Clean up

* Clean up

* Form routing working

* Notification on form error and success

* Refactor + removed useless dynamic form observable

* DynamicFieldsService with tests

* Refactor: inputs catalog + catch form load error

* Filter out non writable fields

* Refactor: naming consistency

* Cleaning comments

* dynamic-fields-service tests + wrapper component

* DynamicForm Tests

* @ngx-formly/core dependency added

* Cleaning up

* DynamicForm working as a FormControl

* Getting route params sync

* Global FormsService: submit + formatting + error handling

* Fix: @Optional() FormGroupDirective in OpFormFieldComponent

* Code climate fix

* Removed CdkTextareaAutosize because of CDK issue 22469

* DynamicFormComponent tests

* Dynamic input test helpers + boolean and text tests

* Refactor edit fields to avoid circular dependencies in the dynamic forms

* Naming fix

* IntegerInputComponent tests

* SelectInputComponent tests

* Fix: duplicated identifier on inputs

* Extract toolbar to be reused for now

Still TBD whether we want to move them right now to the frontend?

* Create new project route and redirect to rails view after saving

* fieldsSettingsPipe + hide 'identifier' on projects

* Handling multi-values (also as links) and passwords

* Some TODOs removed

* FormattableTextareaInputComponent tests

* _isResourceSchema based on parent?.location

* Scope DynamicFieldsService to DynamicFormComponent

* Added backend validation method to FormsService

* Removed projects routes and ruby template

* Removed projects routes and dynamic forms from Projects

* Revert "Provide DynamicFieldsService in root so it can be used independently"

This reverts commit ab56f3c56f.

* Provide DynamicFieldsService in root so it can be used independently

* TODO: test ProjectsComponent

* Code climate fixes (remove TODOs)

* Default OpFormFieldComponent.inlineLabel to false

* Dynamic components tests xkipped

* Typing improvements

* DynamicFormComponent working as a FormControl

* Global FormsService: submit + formatting + error handling

* Fix: @Optional() FormGroupDirective in OpFormFieldComponent

* Code climate fixes

* noWrapLabel default to false

* Started adding user custom fields to the ium

* Import the dynamic-forms module into the common module

* Refactor edit fields to avoid circular dependencies in the dynamic forms

* Using DynamicFormsModule in OpenprojectInviteUserModalModule

* Add formly form

* Update principal name filter

* Dynamic form field is rendering

* Handling multi-values (also as links) and passwords

* Added backend validation method to FormsService

* Remove form from DynamicForm when not isStandaloneForm

* Allow multiple form keys to validate

* Remove form from non standalone forms

* Remove duplicated button

* Moved to FormGroup input for dynamic form

* Custom field happy path is done

* Add explanatory comment to payload structure transformation

* add op-form class to ium steps

* Add shrinkwrap back in

* Fix test, fix dynamic form resource path

* gimme a shirnkwrap

* Remove failing tests

* Remove another failing test

* Remove more failing specs

* Fix double loading of principals

* Add custom field spec

* Fix spec

* Reset shrinkwrap

* Forbid Factory.build(:user, member_in_project)

If you use the trait member_in_project(s), the user is implicitly saved
to create the member.

This is very confusing if trying to use required custom fields, as this
will fail with the Member#user_id foreign key being nil, as the user
cannot be saved.

Instead, raise an error when trying to use this factory trait

* Change additional spec factory

Co-authored-by: Aleix Suau <info@macrofonoestudio.es>
Co-authored-by: Oliver Günther <mail@oliverguenther.de>
2021-05-05 08:43:29 +02:00