26 Commits

Author SHA1 Message Date
Oliver Günther 3237096fe5 Add tab to project custom fields settings 2025-11-25 22:06:39 +01:00
Christophe Bliard ce96874aff refactor: change parameters shape of update_ancestors methods
- `#update_ancestors` was never called with multiple work packages at
  once. So now it accepts only one work package.
- `#update_ancestors_all_attributes` was called only twice and accepts
  multiple work packages. To differentiate it from `#update_ancestors`,
  prefix it with `multi_`.
- remove the need to have both `#multi_update_ancestors` and
  `#multi_update_ancestors_all_attributes` as it's always called with
  all attributes, so keep only `#multi_update_ancestors` and make
  `#update_ancestors` use all attributes if no changed attributes are
  provided.
- then clean up places where it was used.
2025-10-30 17:41:56 +01:00
Christophe Bliard 02f8e5b4a4 [68560] Reschedule related work packages even if save occurs during UpdateAncestors
https://community.openproject.org/wp/68560

Previous fix of the same issue was incorrect, because
`UpdateAncestorsService` was no longer saving the work package if the
changes were done outside of the service. Sadly, automatically generated
subjects are updated outside of the service and rely on
`UpdateAncestorsService` to be saved. That's a code smell which should
be fixed in a future refactoring.

An integration test was added to ensure the automatically generated
subject is saved correctly, the fix was reverted, and another fix was
found.

Now the fix is to consider the changes from both the update service and
the `UpdateAncestorsService` when calling the `SetScheduleService`.
2025-10-30 10:02:34 +01:00
Alexander Brandon Coles 2b144e8542 Fix wording: Change "Favored" to "Favorited"
Favorite is the correct term in the context of expressing a preference
for a particular project / other OpenProject domain object.

Updates `ActsAsFavorable` to `ActsAsFavoritable`, as well as filenames,
identifiers and strings to:

    favored => favorited
    favorable => favoritable
    favoring => favoriting
2025-09-10 19:08:15 +01:00
Alexander Brandon Coles 6764afda87 Make #valid_attribute? run attr. validations only
`#valid?` will run all validations for a given record (unless a specific
context is specified). This patch attempts to optimize
`#valid_attribute?` to run only the validations applicable to the given
attribute.
2025-08-18 16:49:26 +01:00
ulferts 67750db3a7 use AR`s upsert to avoid deactivating optimistic_locking
disabling optimistic_locking on ActiveRecord::Base is not thread-safe.
2025-07-29 17:44:26 +02:00
Alexander Brandon Coles dd8ead6456 Fix missing copyright notices in app/models 2025-07-22 18:26:13 +01:00
Alexander Brandon Coles d17da65477 Freeze string literals in app/models
rubocop -A --only Style/FrozenStringLiteralComment,Layout/EmptyLineAfterMagicComment,Style/RedundantFreeze app/models
2025-07-22 18:26:13 +01:00
Ivan Kuchin 1cb482e5c8 simplify ApplicationRecord.most_recently_changed 2025-01-08 11:53:20 +01:00
Ivan Kuchin fa5d03eae0 rubocop safe autocorrect all except Rails/WhereRange 2024-05-30 19:54:08 +02:00
Oliver Günther e96d2e6506 Add favorites 2024-04-23 14:46:30 +02:00
Oliver Günther dbc4fcc0b6 Move watchable under lib/open_project 2024-04-23 14:46:30 +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
ulferts 40b2bbeb09 Merge remote-tracking branch 'origin/release/13.4' into dev 2024-03-21 10:41:19 +01:00
Dombi Attila 5ebe4754d4 Use the lock_optimistically method instead of using the locking_column because the activerecord-import gem respects it.
The https://github.com/zdennis/activerecord-import/pull/822 got merged and released
in the activerecord-import 1.6.0 which now respects the ActiveRecord::Base.lock_optimistically
setting.
2024-03-21 09:00:46 +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
Dombi Attila 9bc195ffc8 Create ApplicationRecord.skip_optimistic_locking 2023-11-23 13:12:21 +02:00
ulferts 976fccb296 allow our models to have non existing attributes read for validation 2023-10-24 11:52:49 +02:00
Christophe Bliard 9e865b4f7b lint: Run rubocop safe autocorrect
Command is `rubocop --safe --autocorrect app lib lib_static modules spec`
2023-03-09 10:25:57 +01:00
Oliver Günther 934a8b500c Don't try to use mail attribute if invalid 2021-08-03 13:49:26 +02:00
Oliver Günther 2cde433326 Remove usages of AnyFixture (#8987)
AnyFixture will create once instance of a factory for reuse in a number of specs.
This will work fine until we require a clean slate for a specific example.

As we have numerous tests that test like the database is empty,
we get a number of disadvantages:

  - After an example with `with_clean_fixture` metadata, the fixture will only be regenerated
    after the next example that uses it. This means the order of execution will change
    the number of objects in the DB.

  - The more `with_clean_fixture` we have, the smaller the performance advantage of AnyFixture will
    result in.

  - You cannot use an AnyFixture in a spec that needs a clean slate. This should be obvious but was overlooked
    by myself.
2021-02-10 08:59:15 +01:00
Oliver Günther 6d6d6aeb09 Ensure we set just_registered only for users that were just created 2020-09-10 15:19:54 +02:00
Oliver Günther 53f2d694ff Use AnyFixtures to generate fixtures from factories (#7230)
Uses FactoryBot to keep and maintain specific records in a special transaction that does not get removed after each spec.
They automatically are created whenever first hitting them.
This makes an excellent time saver for items that are commonly used, such as an admin user account
2020-04-09 11:54:26 +02:00
Oliver Günther 4685ccdb45 Add version tag to highlighting css 2019-06-28 07:49:19 +02:00
Oliver Günther 8ab4f2a663 Boards module (#7008)
* Hack spike to show D&D use case

[ci skip]

* Add ordered work packages

* Save order on existing work packages

* Boards WIP

* CDK drag

* Add dragula handler

[ci skip]

* Add filter to return all manual sorted work packages

* Print icon on hover

* Boards routing and list components

* Better loading indicator on list with streaming result

[ci skip]

* Add new board and list buttons

[ci skip]

* Post new query

[ci skip]

* Added creation of new board lists with persisted queries

[ci skip]

* Render placeholder row in empty queries

 [ci skip]

* Push boards on grid

* Use base class in scope

[ci skip]

* Extend api for options

* Hack spike to show D&D use case

[ci skip]

* Add ordered work packages

* Save order on existing work packages

* Boards WIP

* CDK drag

* Add dragula handler

[ci skip]

* Add filter to return all manual sorted work packages

* Print icon on hover

* Boards routing and list components

* Better loading indicator on list with streaming result

[ci skip]

* Add new board and list buttons

[ci skip]

* Post new query

[ci skip]

* Added creation of new board lists with persisted queries

[ci skip]

* Render placeholder row in empty queries

 [ci skip]

* Save queries in grids

[ci skip]

* Renaming queries

[ci skip]

* Add existing work packages to board

[ci skip]

* Introduce card view component for work packages

* Extend grids to allow project scope for boards (#7025)

Extends the grid backend to also be able to handle boards. In particular, it adds the ability of boards to be attached to projects and changes the page property of grids to a scope property that better describes that more than one board can belong to the same scope (e.g. /projects/:project_id/boards).

For a fully featured board, though, widgets need to be able to store options, so that they can store queries. Those widgets might also need to have custom processing and validation. That part has not been implemented.

* introduce project association for boards

* have dedicated grid registration classes

* update and create form for board grids

* extract defaults into grid registration


[ci skip]

* Add drag and drop to card view

[ci skip]

* Add options to grid

* Fix option migration name

* Renaming boards

[ci skip]

* Frontend deletion of boards

* Avoid map on NodeList which doesnt exist

[ci skip]

* Add inline create to boards

[ci skip]

* Smaller create button

[ci skip]

* Add navigation for boards

* Make inner grid same height

* Replace index page with table

* Workaround for widget registration

[ci skip]

* Fixed height for cards and tables

[ci skip]

* Implement escape as cancel d&d action

[ci skip]

* Fix and extend grid specs for name and options

* Extend board specs for required name

* Fix migration for MySQL references

https://stackoverflow.com/a/45825566/420614

* Make board list extend from widget

Since we cannot configure widgets yet, it's not yet possible to use a
board-list widget anywhere.

* Fix specs

* Fix escape listener removal

[ci skip]

* Fix renamed to_path in relation spec

[ci skip]

* Allow deletion of grids for boards

* Avoid reloading resource multiple times with replays

* Frontend synchronization on deletion

[ci skip]

* Delete through table

* Use work packages board path

* Use work packages board path

* Fix augmented columns breaking re-rendering

* Fix duplicated permission with forums

* Strengthen tab switch in specs

* Add hidden flag for project-context queries

Allows the API to create a hidden query that will not be rendered to the
user even if it is within a project context.

* private queries

* Add hidden flag for project-context queries

Allows the API to create a hidden query that will not be rendered to the
user even if it is within a project context.

* Move boards below work packages

* Add Board configuration modal

* Fix reloading with onPush

* Saving / Switching of display mode

[ci skip]

* Extract wp-query-selectable-title into common component

* Fix renaming of board-list

* Fix auto-hide notifications in boards

* Add permissions to seeders

* Reorder lists in board

* Linting

* Remove default gravatar from settings

* Show assignees avatar in the card view of WPs

* Fix specs

* Add missing method

* Fix timeline icon

* Use URL as input to be able to show avatars for groups, too

* Fix test

* Add further specs

* Use correct data attribute to avoid unnecessary data base calls

* Add further specs

* Deletion of board lists

* Pass permission via gon to decide whether we can create boards

* Fix rename spec

* Cherry-pick of 7873d59 and 30abc7f
2019-02-18 15:59:54 +01:00