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.
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.
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.
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
* 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>
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.
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.
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.
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.
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
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
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