103 Commits

Author SHA1 Message Date
Henriette Darge 6c04182dff Simplify test case 2026-06-04 09:05:50 +02:00
Behrokh Satarnejad dbef4d9e71 [74931] Show type of field beside the attribute (#23205)
* Show filed type beside its name

* Add feature spec

* Add a comment for field_type_label

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Add custom field type label assertion to feature spec

* Move custom field to active group before asserting type label

* Rename the displayed field format value from field_type to
field_format_label and reuse CustomFieldsHelper for custom field format
labels.

* Make the table configuration modal wait more and embedded work package table loading take longer to avoid flaky failures when the modal or embedded table is still refreshing in CI

* Undo changes for switch_to method

* Undo changes for the tests that are sometimes failing on CI

* Update spec/features/types/form_configuration_spec.rb

Co-authored-by: Henriette Darge <h.darge@openproject.com>

* Update spec/helpers/types_helper_spec.rb

Co-authored-by: Henriette Darge <h.darge@openproject.com>

* Rubocop errors fixed

* Fix flaky field format labels spec by revisiting page after custom field creation

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Henriette Darge <h.darge@openproject.com>
2026-05-27 09:24:38 +02:00
Behrokh Satarnejad d924c255cf [69524] Primerize Types form configuration page (#22854)
* Create the section component

* Create the form configuration component

* Create a controller

* change form template

* Use primer dialog for reset to defaults button

* show WP configuration modal while creating a related WPs table

* Fix the drag and drop functionality without save button

* Fix renaming functionality

* Use generic drag and drop in form configuration and move all client side action handling to server side

* Fix embedded query form configuration regressions

* Add data test selectors to all elements that we used for test

* update the current tests with the new implementations and design

* Add new tests for new controller of sections and rows

* WP quesry row should only have edit quesry action

* Update transformer spec regarding the new changes

* Fix the failing test in reset form configuration and some tests for actions

* Fix rubocop errors

* Fix eslint errors

* Add spec for removing a section

* Use condensed border boxes

* fix failing specs

* fix failing specs

* Switch the buttons in form configuration component

* Create the section at the top of the list

* Instead of using UUID, use the name of the group as the key

* Add missing check for EE for section actions

* Remove angular components

* Use action list instead of a border box for left side panel

* Reduce the margin between the right side panel and sub header, add some space to the query table left side, span to the whole available space

* Show validation errors while updating and creating a section

* Use a danger dialog for reset to default

* Add a confirmation for removing the section

* Align items in the row

* Use test_selector instead of data-test-selector

* Create move_action in rb file

* Create move_action in rb file

* Simplify section component

* Simplify form configuration component

* Remove dialog for rename and delete section on missing EE

* Create a component for inactive attribute list

* Create a separate component for reset dialog

* Remove EE feedback dialog

* Remove form partial which is not needed anymore

* Remove unused js strings

* Update using update_via_turbo

* Remove form configuration rows controller

* Create a blanksalte component

* Fix failing specs

* Fix failing specs

* Fix failing specs

* Remove unused translation strings

* Align form configuration section routes with actual create flow

* Change section to group

* Change section to group in services and controllers

* Change section to group in en.yml

* Fix rubocop errors

* Move the query group persistence assertion from the JS feature spec
to the synchronous form configuration groups controller spec.

* Reuse query service result in embedded query build

* Keep inactive attribute filter after turbo list refresh

* Extract form configuration group edit state into form model

* Fix the failing test

* Potential fix for pull request finding 'CodeQL / Potentially uninitialized local variable'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* Rename inactive attribute component inputs

* Refine reset dialog wording for form configuration

* Use direct Turbo action for adding attribute groups

* Reuse generic filter-list controller for inactive attributes

* Remove focus impelementation in ts

* Group form configuration Stimulus controllers under one namespace

* Use turbo request service in form configuration controller

* Clarify legacy group key normalization in form config contract

* Replace inactive attribute list wrapper via turbo stream

* Extract duplicate untitled group key generation into Type::FormGroup.next_untitled_key

* Auto-generate untitled group name on create instead of returning an error

* Avoid mixed return types in form config group create service

* Extract shared form configuration group service behavior into concern

* Fix spacing for the last group and italic font for the placeholder rows

* Replace Angular no-results component with Primer Banner on form configuration page

* Hide dropped element immediately to prevent flickering before Turbo Stream response

* Reload type before rendering create error to prevent duplicate groups

* Await service initialization before use to prevent potential race condition

* Replace sleep calls with deterministic waits in form configuration spec

* Handle malformed JSON and invalid query errors gracefully in form configuration update

* Make query group label a clickable button and empty group hint italic

---------

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2026-05-13 12:56:18 +02:00
Oliver Günther 40bc3c04e5 Add OpenProject::Cache.fetch_request_cached for hot-path caching
Add fetch_request_cached method that layers RequestStore in front of Rails.cache.fetch

Used in the following places, as they are repeatedly accessed during schema initialization.

all_work_package_form_attributes, form_config_attribute_representation, Query.available_columns

In my tests, this improves cold cache access by reducing initial number of queries to access cache
2026-04-09 15:48:40 +02:00
Jan Sandbrink f9d8bc6614 Introduce SubclassResponsibility error
This error is intended for cases when a method is
intentionally not implemented, because the module/class defining
it expects a subclass (or class including the module) to implement
the method.

This is intended to distinguish it from other cases, such as:
* feature not implemented yet
* edge case of a method call not yet supported

Notably it avoids the misuse of the Ruby-defined NotImplementedError,
which is only intended for much more specific scenarios:

> Raised when a feature is not implemented on the current platform. For example, methods depending on the fsync or fork system calls may raise this exception [...]

Also see https://docs.ruby-lang.org/en/master/NotImplementedError.html
2026-03-27 08:14:56 +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
as-op 8872d50de2 import helper 2025-03-19 14:20:49 +01:00
as-op 0f92f75739 [#62319] PDF Export: Templates selection not translated
https://community.openproject.org/work_packages/62319
2025-03-19 14:04:24 +01:00
as-op c507a73411 naming fix: build_in => built_in
resolves https://github.com/opf/openproject/pull/17840#pullrequestreview-2626598219
2025-02-19 13:33:01 +01:00
as-op 51b9baa57b fix missing refactoring 2025-02-17 14:01:29 +01:00
as-op 69a079e49b obey rubocop & erb_lint 2025-02-17 13:05:21 +01:00
as-op 862f84b6ce refactor spread code into a type sub class 2025-02-17 12:47:46 +01:00
Eric Schubert debb716964 [#58519] enable activating hierarchies
- activation on project settings -> custom fields enabled
- activation in admin -> work package types -> form configuration
  enabled
- amended schema representer to render correct hierarchy schema entries
2024-11-05 14:35:42 +01:00
ulferts 50f612e032 memoize cfs activated in project to avoid n+1 2024-10-24 18:57:42 +02:00
Eric Schubert e0097af30e [#57814] exclude existing hierarchy fields from config lists
- hide hierarchy custom fields when configuring work package types
- hide hierarchy custom fields when enabling custom fields for projects
2024-09-30 13:32:37 +02:00
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +02:00
ulferts b3998d3dde rename key/label to estimates_and_progress 2024-04-24 10:33:47 +02:00
ulferts f9ca863e66 avoid having the estimates and time section for milestone types 2024-04-22 10:28:42 +02:00
ulferts 7c139d0311 move percentage_done to "estimates and time" section 2024-04-19 16:37:28 +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
Aaron Contreras 3242ff7a3c Exclude derived_percentage_done from the WorkPackage type form 2024-02-01 16:10:57 -05:00
Dombi Attila 739223b7e2 Remove serializer deprecation warning. 2024-02-01 14:22:04 +02:00
Christophe Bliard 3565c08330 [52252] Exclude derived_remaining_time from work package form
Include the number of `EXCLUDED` attributes in the cache key for the
work package form attributes. This ensures that the cache is invalidated
when the number of excluded attributes changes.
2024-02-01 09:33:29 +01:00
Christophe Bliard 8fa8584538 Run rubocop --autocorrect on all files
Only the safe cops have run. rubocop version is 1.59.0.
2024-01-05 15:27:09 +01:00
Christophe Bliard 583ef2c8f6 Merge branch 'dev' into implementation/51193-move-remaining-work-field-into-core 2024-01-04 14:36:21 +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
Christophe Bliard c30a2972b2 [51193] Move remaining_time field to core
And improve time of spec/models/work_package_spec.rb (15s -> 3.5s)
2023-12-08 10:01:35 +01:00
Klaus Zanders 0c7fd939c8 Fixes Performance/MapCompact offenses 2023-09-06 11:06:36 +02:00
Christophe Bliard 10085736da refactor: Rename and generalize #accessor_name as #attribute_name
Also extract #attribute_getter and #attribute_setter when
using #attribute_name in the context of calling the getter/setter
methods.
2023-01-17 09:39:27 +01:00
Christophe Bliard 21a696ef9b Update copyright information for 2023 2022-12-30 15:51:26 +01:00
ulferts ae2bebb6e2 mimick id on non existent model
That way change detection can pick up setting an association with such a value
2022-11-01 12:29:59 +01:00
Oliver Günther 7734fbd59c Remove readonly from type groups
This got added as an explicit API field, which is why it turns up here
2022-08-30 15:45:54 +02:00
ulferts a82fa93a70 add ignore flag to work package contracts but hide from form configuration 2022-06-14 17:30:32 +02:00
ulferts f6ff373947 remove duration from form configuration
The property is never to be displayed there since it will receive a fixed place in 12.3
2022-06-14 09:16:09 +02: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
Christophe Bliard bc8d423ec2 update copyright information for 2022 2022-03-01 17:05:59 +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
ulferts 1bdd2ab9ae safe automatic fixes by rubocop (#8994) 2021-02-11 16:02:18 +01:00
ulferts 6140f4c7e9 update copyright to 2021 (#8925)
Updates the copyright to 2021 for all files that have a copyright. Files in our source code without the copyright header still do not receive one automatically. Additionally, backlisted files are also excluded.

Previously the copyright of chiliproject which references redmine stated a copyright of redmine up to and including 2017 which is not true for the code we have in here. Because of that I changed that to 2013
2021-01-13 17:47:45 +01:00
ulferts 2154701a02 hide derived_* from form configuration 2020-08-25 11:35:41 +02:00
Oliver Günther 1496411dc2 Merge remote-tracking branch 'origin/release/10.6' into dev 2020-08-03 15:14:50 +02:00
Oliver Günther 6663a3e404 Don't raise error if to-destroy groups are not found 2020-07-23 10:52:34 +02:00
Oliver Günther 2feaec1101 [33678] Priority needs to be a require field
Priority was marked non-required for it to turn up in the
attribute form configuration.

But priority _is actually required_. This results in the frontend adding
an optional placeholder `-` value, which makes the resource unsavable.

This commit adds priority to the form, but keeps it required as it
should be.

https://community.openproject.com/wp/33678
2020-07-13 15:14:36 +02:00
Oliver Günther 38e913cb00 Skip schedule_manually in attributes
[ci skip]
2020-07-13 13:45:19 +02:00
ulferts 1b16dbcc07 avoid double submit of form configuration
The form configuration used to be submitted at least twice. In most cases, the first submit was canceled fast enough to not reach the backend. But if it was not canceled fast enough, the duplicate post lead to some errors when e.g. the referenced queries where already deleted.
2020-03-11 13:24:32 +01:00
Henriette Dinger bd7f4e4814 Update copyright notice 2020-01-15 11:31:26 +01:00
ulferts bc682f6b01 bail on inexistent related resource
* status
* type
* assignee
* priority
2019-11-20 15:16:38 +01:00