26 Commits

Author SHA1 Message Date
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
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
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
ulferts b2f1bcf471 Merge remote-tracking branch 'origin/dev' into new-mocking-service-for-permissions 2023-10-13 09:23:05 +02: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 e3257c7667 Change calls using mocks on the user to our new mocking helper 2023-10-09 10:44:42 +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 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 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 a33524ef6d remove ruby magic comment for utf-8
ruby interprets source encoding as utf-8 since 2.0.0, making magic comment redundant and useless
2022-03-10 19:36:58 +01:00
Oliver Günther f08bea3467 Remove FactoryBot.* prefix where applicable 2022-01-25 08:19:06 +01:00
Oliver Günther ccfa29c728 Move license and copyright docs to root, fix names and references 2021-09-02 21:50:46 +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
ulferts 1bdd2ab9ae safe automatic fixes by rubocop (#8994) 2021-02-11 16:02:18 +01:00
Henriette Dinger bd7f4e4814 Update copyright notice 2020-01-15 11:31:26 +01:00
Oliver Günther 059770f533 FactoryGirl => FactoryBot
Removes the deprecation
2018-05-07 22:38:20 +02:00
ulferts 9a6d5585f4 preload permissions before collection rendering (#4646) 2016-07-13 13:49:32 +02:00
Jan Sandbrink 6e9ed008fb Enforce passing of current_user into representers
Thereby permission checks will no longer silently fail if no user was
passed.
This uncovered a lot of places where we actually expected a user to be passed, when it wasn't.
This was especially true for collections.
The basic idea is, that virtually all representers could change their behaviour based on the current user.
Representers where this is not the case (e.g. Digest), can still explicitly opt-out.
2015-09-03 16:28:05 +02:00
Alexander Bach bd54c9f8ae Diversify tests 2015-06-11 09:06:00 +02:00
Alexander Bach b170ad0f84 Add all the specs 2015-06-11 09:05:58 +02:00