50 Commits

Author SHA1 Message Date
Tomas Hykel 948fa43321 chore: Remove feature flag for project-based work package identifiers 2026-05-25 17:45:06 +02:00
Kabiru Mwenja d39b720e6e Expose semanticId in API v3 work package endpoints
Adds the computed semanticId property to the HAL representer,
SQL collection representer, and schema representer. The property is
gated behind the semantic_work_package_ids feature flag and returns the
value from WorkPackage#identifier. Includes OpenAPI docs
and the translation key for the schema name.
2026-04-13 14:04:38 +03:00
Kabiru Mwenja d3734a7485 Rename work_packages_identifier setting values to "classic" and "semantic"
The setting previously used "numeric" and "alphanumeric" as its allowed
values. Rename them to "classic" and "semantic" to better align with the
product terminology for the work package identifier modes.

Includes a migration to update any stored setting values in the database,
updated constants and helper methods on Setting::WorkPackageIdentifier,
and all corresponding references across models, components, forms,
frontend controllers, locales, and specs.
2026-03-28 10:01:57 +03:00
Kabiru Mwenja f02ef008db Fix WorkPackageIdentifier encapsulation and lazy-load guard
Three issues corrected:

1. Bug fix: ALLOWED_VALUES is an Array; ALLOWED_VALUES[:alphanumeric] raises
   TypeError at runtime (symbols are not valid Array indices). Extract named
   string constants NUMERIC and ALPHANUMERIC so comparisons are explicit.

2. Lazy-load guard: ProjectHandleSuggestionGenerator ran a DB query on every
   component render, even in numeric mode where the result is never used.
   Now the query only runs when alphanumeric? is true; numeric mode gets [].

3. show_autofix_section? simplified: the alphanumeric? guard moved into the
   initializer, so the private method is now just projects_data.any?.

Also: wrap definition.rb's `allowed:` in a lambda to defer constant
resolution past Rails autoload (fixes a load-order error in specs), and
add a spec for Setting::WorkPackageIdentifier covering the bug scenario.
2026-02-25 23:34:01 +03:00
Oliver Günther 3075bbd5a2 Rewrite setting accessors as define_methods 2026-02-10 13:37:22 +01:00
Ivan Kuchin a8b1a7960d don't set perform_deliveries to true before every request/job run
It was probably needed due to calls of with_deliveries, but it was
removed as perform_deliveries is not thread local and there should be no
reason to reset it
2025-10-02 14:10:40 +02: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
Henriette Darge f496da2aad Merge release/16.0 into dev 2025-05-16 14:56:25 +02:00
Oliver Günther 985b07d1fd Primerize setings 2025-04-30 08:35:14 +02:00
Oliver Günther 816b74bff5 Warn about self registration and public projects 2025-04-22 20:17:15 +02:00
Oliver Günther b7476c693b Allow custom link schemes 2025-03-24 08:38:02 +01:00
Oliver Günther 25fc7cd02b Recurring meetings (#15620)
* Prepare basic recurring meeting setup

* Add proof of concept to create schedules

* Add feature flag

* Rework menu

* Pass request to meetings menu

This doesn't help, as the requested url is the turbo frame

* Add filter menu for recurring meetings

* Start primerized create form

* Add recurring meetings to dropdown and dialog

* Add schedule

* Add frequency/iterations form

* Add services

* Recurring meetings menu entry

* Fix setting project

* Template

* add bi-weekly

* Add template sideinfo

* Skip mails when adding participants

* exclude templated meetings

* Add header for templates

* Prevent deletion of meeting template

* Fix breadcrumb

* WIP Add show table and initialization

* Change icon for calendar

* remove unused template

* add template has_one

* meeting form

* Fix creation of recurring

* working edit

* specify end time

* Add header actions

* Add initial recurring meeting frequency label

* Add index page

* Add soft delete and restore for occurrences

* Refine implementation of scheduled meetings using skeletons

* Add template link

* Paginate

* Move init of meeting to recurring

* Add schedule in words

* Add show series action item

* Implement changed show page of occurrence

* Add interval, fewer frequencies

* Add interval to schedule

* Try to add non working days

* Update meetings index to display recurring occurrences correctly

* Update schedule in words

* Fix exception rule

* Fix occurrence for working days

* Hide interval when selecting working_days

* Document show-when-value-selected

* Set interval to 1 when changing to working_days

* Fix dialog

* Adapt to mobile table

* Update type filter

* Rename TypeFilter -> RecurringFilter

* Start date group

* Combined Filter component

* Updated menu

* Update label created by me

* Add validation on end_date > start_date

* Implement sorting through query

* Render all meeting series in the sidebar

* Select my meetings only when href passed

* WIP Add initial specs

* Fix date validation

* Use the correct date formatter in the subtitle

* Add spec for date validation

* Change label to View template

* Add edit series button

* Fix deletion of recurring meetings

* Correctly hide form for end_after options

* Update copy behaviour to never allow recurring copies

* Fix location value in form

* Fix meeting details form

* Add scheduled meetings table

* Replace destroy/restore with actual destroy

* Uniqueness

* Delete with schedule

* Switch to start_time

* Use start_time in schedule

Otherwise, we get time mismatches

* Add helper for time formatting to the current user

* fixup! Delete with schedule

* Move update_start_time to concern

* Delete cancelled meetings when changing schedule

* Allow passing dates directly

* Remove cancelled occurrences when changing schedules

* Limit count_rule until end_date

* Show changed start times for occurrences

* Indent case

* Fix destroy path to include project

* Fix past meetings

* Schedule first occurrence on creation

* Linting

* fixup! Linting

* Autoschedule job

* Add more schedule tests

* Fix project-based destroy

* Redirect to template, not show

* Don't cache user time zone in request store

* Fix forgotten invited where

* fixup! Linting

* Remove default meeting order

* Fix meetings index spec with new ordering

* Fix path

* Convert meeting tab to cuprite

* Fix expectation for meeting tab

* More robust selector on meeting tab

* Change global menu spec

* Add more CRUD specs

* Fix dates and times

* Allow cancellation of scheduled meetings

* Lint

* Reschedule init job when updating schedule

* Fix end date in the form

* Test cancellation

* Extract create spec

* Fix specs

* Add spec when lacking permissions

* Fix cancellation of scheduled meetings

* Render meetings with correct project link

* Remove unused disable

* Remove useless cop disable

* Add contract specs

* Add delete contract spec

* Revert "Add delete contract spec"

This reverts commit 27a517d773.

* Add delete contract spec for meetings itself

* Fix spec

* Hide past cancelled occurrences

* Show different delete labels and messages

* Move to request spec

---------

Co-authored-by: Mir Bhatia <m.bhatia@openproject.com>
2024-12-04 17:12:14 +01:00
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +02:00
Oliver Günther c7286fb91f Set default host at all times
This results in us having to use a bit more helpers around request and feature specs
to ensure that the configured host name also matches the requested one.
2024-07-08 16:11:09 +02:00
Oliver Günther 2b99b45882 Allow timeout to be set to anything != 5 seconds
Rails 7.0 started setting smtp_timeout=5, which should be configurable
https://guides.rubyonrails.org/configuring.html#config-action-mailer-smtp-timeout
2024-06-20 20:07:40 +02:00
Oliver Günther 1f73602839 Add "Link" custom field type
https://community.openproject.org/work_packages/26923
2024-04-29 08:35:35 +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
Oliver Günther 6ba79c96ec Enterprise check for antivirus administration 2024-02-20 09:36:45 +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 3d50596021 Merge remote-tracking branch 'origin/release/12.4' into dev 2023-02-13 09:15:02 +01:00
Oliver Günther 28507de19f Fix sendmail settings arguments 2023-02-08 09:28:39 +01:00
Christophe Bliard f88889489f Remove deprecated Setting::CallbackHelper (#11965) 2023-01-23 11:39:19 +01:00
Christophe Bliard 21a696ef9b Update copyright information for 2023 2022-12-30 15:51:26 +01:00
Christophe Bliard 9c7d115bde Fix flickering tests and deprecation warnings
In some examples of `spec/controllers/account_controller_spec.rb`,
`Setting.self_registration?` was not mocked. If such example is run first,
it would fail.

Same for `spec/features/auth/login_spec.rb` and `Settings.autologin?`.

Fix it by using with `with_settings` helper.

Fix deprecation warnings seen when using `Setting.xxx?` when the setting
xxx is not a boolean.
2022-10-26 15:48:48 +02:00
Oliver Günther 4d097daceb Replace separate https and force_ssl flags with https + hsts
By default, https will be enabled in production in OpenProject 12.2. Right now, a separate flag exists called

rails_force_ssl that needs to be controlled separately, but the two settings are intermingled.

This PR fixes this so that:

HTTPS setting controls the secure cookies and generating links with
https throughout the application

HSTS setting is only active by default when HTTPS is enabled and
controls the HSTS headers as well as the HTTP->HTTPS request upgrade for
transport-security.
2022-08-15 19:48:51 +02:00
Christophe Bliard 48a4f1b6ad lint with rubocop --autocorrect (safe cops only) 2022-06-02 10:40:10 +02:00
Oliver Günther 9e3c51299a Remove Setting.protocol in favor of static config 2022-05-18 16:21:55 +02:00
Oliver Günther 22b7849520 Remove legacy mailer configuration and move into settings
Split from "Remove Setting.protocol in favor of static config"

Restore cache store setup
2022-05-18 16:21:55 +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
Christophe Bliard 4311a0cecb deprecate method Setting.register_callback 2022-02-07 14:29:03 +01:00
Christophe Bliard 823900e4ec fix resolution of Setting::Callbacks
Callbacks was resolved as ActiveRecord::Callbacks, so file setting/callbacks.rb was never required and method fire_callbacks was missing. Renaming the class fixed it.
2022-02-03 13:39:44 +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
Henriette Dinger bd7f4e4814 Update copyright notice 2020-01-15 11:31:26 +01:00
Markus Kahl cddd45c8f5 I'm sick of looking up magic numbers 2019-11-12 14:38:10 +00:00
Oliver Günther 450b0fc13d [27763] Ensure session cookie receives secure flag in https
When users enable https in their instance, the session cookie should be `secure` by default.
It currently is only when the configuration `rails_force_ssl` is set.

https://community.openproject.com/wp/268331
2018-05-17 08:25:41 +02:00
Oliver Günther 6ef4211e77 Bump copyright to 2018 (#6171)
[ci skip]
2018-02-12 08:51:12 +01:00
Oliver Günther 7cf11bb689 Update copyright notice 2017-01-10 15:11:43 +01:00
Oliver Günther 4353953605 Improve stored settings as a whole
Currently, settings are cached on a per-name basis, but that cache is
expired everytime *any* attribute is written.

Even when a week-old attribute is still valid, its cache is expired as
soon another setting is updated due to the max settings cache key.

Instead of caching a single attribute, I suggest to cache the entire
settings (the total number with plugins is less than 120 and 4KiB in
size) and retrieve and deserialize a single value from that hash.

That saves us the time to:

1. Locating a single element from database
2. Instantiate a setting object just for deserializing
3. Requesting settings several times by using RequestStore
2016-07-22 10:33:32 +02:00
Alex Coles d76e97755c Fix Settings callbacks for ActiveSupport API change
Identify callbacks with String not Symbol.

Signed-off-by: Alex Coles <alex@alexbcoles.com>
2015-09-14 09:00:00 +02:00
Alex Coles e0191e759c Update year in copyright header to 2015
[ci skip]
2015-01-01 00:02:57 +00:00
Alex Coles 6fe9535b1f Fix syntax (w/Rubocop) in (Rails) models
Signed-off-by: Alex Coles <alex@alexbcoles.com>
2014-11-03 22:15:11 +01:00
Martin Linkhorst a48792b12b no underscores for private methods 2014-04-16 11:18:35 +02:00
Martin Linkhorst 10d694f6e9 push down callback block check into OpenProject::Notifications 2014-04-16 11:18:17 +02:00
Martin Linkhorst f0b1df9e07 based the settings callbacks on OP::Notifications 2014-04-11 14:46:28 +02:00
Martin Linkhorst c9effc5b6b implements callbacks for settings 2014-04-04 17:34:04 +02:00