374 Commits

Author SHA1 Message Date
Oliver Günther c950be910e Convert custom filters on user administration to standard query 2026-05-08 13:34:21 +02:00
Oliver Günther 8fafc2593b Fix visibility scope of groups in members filters
https://community.openproject.org/work_packages/74000
2026-04-17 11:34:36 +02:00
Wieland Lindenthal 200072ecc4 [#73511] Fix robots meta tag rendered as text instead of HTML element
`content_tag(:meta, name:, content:)` treated the keyword arguments as
text content rather than HTML attributes, producing visible JSON-like
output on the page. Replace with `tag(:meta, ...)` which correctly
renders a self-closing element with the proper attributes.

Adds a view spec assertion to cover the rendered output.
2026-03-30 07:43:15 +02:00
Alexander Brandon Coles a6ae097715 Merge branch 'dev' into merge-release/17.1-20260223125632 2026-02-23 11:45:18 -03:00
Oliver Günther 8e0b351367 Pass enabled value to external links controller so it can be properly disabled
https://community.openproject.org/projects/openproject/work_packages/71946/activity
2026-02-23 10:24:43 +01:00
Jan Sandbrink 485e09c357 Disable inputs in edit forms more consistently
The decision on which fields are writable has been moved into
the user's contract. Previously the fields in the My Account form were only
disabled in the frontend, but when changing the browser form, the user could
still update values. Now the contract has been updated to check the
authentication method as well, denying changes to the own name and email address.

Similarly when the contract prevents edits, this is also reflected in the admin
UI for users. It's not pretty, because there seems to be no formatting for disabled
text boxes in our old forms, but it still gives faster feedback than the
old forms, where you had to submit to see that a change to your own login
was rejected.

In the My Accounts form, this change leads to the curious case, where
an admin CAN change their own name in the My Account view, because admins
could do it in other forms as well. It's surprising, but consistent.

Additionally the behaviour has been harmonized across LDAP and other auth providers.
Editing the email address is now also forbidden in all cases for the user themselves.
2026-02-18 16:25:47 +01:00
Kabiru Mwenja 8be53a8c6c Automatically detect and apply OS theme on Login screen (#19928)
* Automatically detect and apply OS theme in Login screen

https://community.openproject.org/work_packages/66594

* add a migration to set the default theme of anonymous user to sync_with_os

* add a migration spec

* add a feature spec

* write migrations in raw sql

* update anonymous user pref before testing the theme applied

---------

Co-authored-by: Behrokh Satarnejad <62008897+bsatarnejad@users.noreply.github.com>
Co-authored-by: Behrokh Satarnejad <b.satarnejad@openproject.com>
2025-10-20 13:19:56 +02:00
Ivan Kuchin 99f5d1c0b2 check that within is not an alias for be_within when used with block 2025-09-24 20:03:32 +02:00
Oliver Günther ac159cc5a1 Remove gon service from the core 2025-07-30 14:40:52 +01:00
Oliver Günther 28434f7cc9 Remove current partial 2025-06-13 14:47:45 +02:00
Christophe Bliard d9ef662173 Fix display of error messages in dialog when uploading tokens
And rewrite EnterpriseTokensController specs to test it properly.
2025-06-11 15:09:02 +02:00
Christophe Bliard fb72d73bab [64137] Compute max allowed active users from enterprise tokens
- invalid or expired tokens are ignored, only active tokens are
  considered
- if there are active non-trial tokens, the trial tokens are ignored
- if there is an active token without any user restrictions (no
  `active_user_count` key), there is no limit on the number of active
  users
- the maximum allowed active users is computed by taking the maximum of
  the `active_user_count` values of the active tokens
- if there are no tokens, there is no limit on the number of active
  users
2025-06-11 15:08:45 +02:00
Oliver Günther 4dc60db27c [64157] Handle multiple tokens
https://community.openproject.org/wp/64157

Instead of having one single token, we can now have multiple tokens.
They can have different plans, different trial/non-trial status, and
different activation dates.

This allows:
- to have a paid token for a plan, and a trial token for two weeks to
  try out a higher plan.
- to have an existing token for a plan which will soon expire, and add
  the token for the next period or a higher plan in parallel.

All tokens are listed on the same page in the administration.
2025-06-11 15:05:07 +02:00
Pavel Balashou f37ba8ce5d Merge branch 'dev' into feature/63912-support-multiple-authentication-provider-user-links 2025-06-11 10:18:34 +02:00
Pavel Balashou 4d35299d67 [#63912] Try to fix migrations CI run. 2025-06-06 15:01:17 +02:00
Christophe Bliard a459c252b9 Add spec to detect frozen string errors 2025-06-05 18:23:10 +02:00
Pavel Balashou 2db9ef305c [#63912] Support multiple authentication provider user links
https://community.openproject.org/work_packages/63912
2025-06-03 10:13:00 +02:00
Jan Sandbrink 03c8db36bf Merge pull request #18806 from opf/frozen-specs
Freeze string literals in specs
2025-05-07 07:54:10 +02:00
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
Alexander Brandon Coles 7419fa3f05 Update projects settings view spec expectations 2025-05-02 00:43:46 +01:00
Oliver Günther 197e72e75d Replace view spec with request spec 2025-04-30 08:35:15 +02:00
Alexander Brandon Coles 0a21af988f Clean up stubbing in projects settings view spec 2025-04-28 14:26:14 +01:00
Henriette Darge ee8452282a [63485] Remove show_local_breadcrumb and default_breadcrumb (#18663)
* add a new helper for breadcrumb in wiki page

* set page header in destroy page

* set page header in edit page

* set page header in history and rename and edit parent pages

* change toolbar items into page header items

* add new wiki action to sub header

* remove version edit page which is not in use any more

* add export as a menu item of the header

* fix rubocup errors

* fix failing tests

* replace page header in annotate page

* replace page header in diff page

* add page header in select menu page

* fix rubocup errors

* fix errors on rename test

* fix errors on selecting items from toolbar

* fix errors on tests for child pages

* set correct permission for configure menu item

* replace page header in summary page

* replace page header in summary details page

* edit docs of sub header

* add page header in wiki new page

* remove controller and a route for edit method

* undo changes for docs of sub header

* extract header in show page into a new component

* use helper method in header component

* add wiki module to the breadcrumb

* rename page header component for wiki page

* simplify how lock and lock implemented

* extract sub header

* remove wiki title from header of history page

* fix page header in new page

* use page.find_test_selector in test

* fix failing test for summary page

* fix failing test for wiki child pages

* change the summary test

* use test selector for page header title

* undo changes for activate user in admin

* use test selector in adding editing history test

* use test selector in attachment upload test

* use test selector in child pages tests

* use test selector in wiki menu items tests

* change test selector for breadcrumbs

* extract conditions to show edit button into a method

* extract conditions to show rollback action menu item into a method

* extract conditions to show create button into a method

* fix duplicated code in test

* Remove outdated `show_local_breadcrumb` method which is replaced by the Primer::PageHeader breadcrumb

* Remove `default_breadcrumb` method as it serves no prupose any more

* Remove the old breadcrumb and its hook completely

* remove breadcrumbs path from rename

* fix translations errors in storages

* undo changes on translations

* remove default breadcrumbs in time tracking controller

---------

Co-authored-by: Behrokh Satarnejad <b.satarnejad@openproject.com>
Co-authored-by: Behrokh Satarnejad <62008897+bsatarnejad@users.noreply.github.com>
2025-04-23 10:40:43 +02:00
Jan Sandbrink 3708fa4513 Expose User#authentication_provider as AR class
Previously we only got the slug name of the provider
as a string, which doesn't allow to further use the provider.

Converting it back into its AR representation allows to call
further methods on it, e.g. checking support for certain capabilities.
2025-01-20 14:09:00 +01:00
Henriette Darge a1809640fe Adapt tests to new PageHeader structure 2024-11-26 11:08:17 +01:00
Oliver Günther da4ffd7f2f Replace common error and errorExplanation with banners 2024-09-30 20:36:59 +02:00
Behrokh Satarnejad 72c12f597b write a feature spec and remove unnecessary tests 2024-09-13 17:56:43 +02:00
Behrokh Satarnejad 6edaaddb9f change header Advanced settings to Interface colours 2024-09-10 08:22:24 +02:00
Behrokh Satarnejad 91565cd14d fix failing specs 2024-09-09 08:24:47 +02:00
Oliver Günther 9586b06db3 Merge pull request #16331 from opf/chore/verify_partial_doubles
Set verify_partial_doubles=true
2024-08-06 10:54:18 +02:00
Oliver Günther 74fa859e5f Pass correct nil 2024-08-05 19:31:30 +02:00
Oliver Günther 1df0c00c2a Adapt affected specs to opt-out of double verification 2024-08-05 19:31:30 +02:00
Ivan Kuchin bca7db9398 update copyrights 2024-07-31 15:02:50 +02:00
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +02:00
Oliver Günther 24af829f6f Move spec to component 2024-07-01 09:13:55 +02:00
Oliver Günther a60becaf10 Add groups to user profile 2024-06-11 07:38:14 +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
Henriette Darge c71b37e8aa Remove occurences of primary-color as it was discarded 2024-03-08 14:10:31 +01:00
Pavel Balashou 3572d18352 Modify set_localization to respect session[:authenticated_user_id]. 2024-02-13 22:07:22 +01:00
Ivan Kuchin e66cdc36a1 Mark development environment (#14677)
* visibly different favicon and apple touch icon in development environment

Commands to create modified icons:
* `mogrify -path development -modulate 100,100,0 apple-touch-icon-120x120.png favicon.ico`
* `image_optim development/*.png`

* development in app header

* mention highlighting in documentation about development environment
2024-02-06 15:12:07 +01:00
Oliver Günther e9f624f2d9 Allow anonymous users to access public boards 2024-01-30 10:09:01 +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 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
Klaus Zanders 78c1e4fadb Switch all uses of principal factories to use new interface 2023-10-09 10:39:44 +02:00
Christophe Bliard 86ce8c4114 Fix broken tests
Use `current_user` instead of `User.current` for the reasons explained in `app/controllers/concerns/accounts/current_user.rb`
2023-09-25 17:39:22 +02:00
Christophe Bliard df827db627 Refactor CustomField factories using traits
Reduce duplication and harmonize the factory names:
- bool/boolean => boolean
- int/integer => integer

Co-authored-by: Aaron Contreras <aaronlcaq@gmail.com>
2023-08-29 08:57:39 +02:00
Christophe Bliard 71502d3aba [40427] Better error messages on wiki edition conflict
Additionally, base errors are now separated from field errors to improve
errors readability.
2023-08-11 10:45:41 +02:00
Christophe Bliard bf38384bda refactor: remove always nil classes parameter 2023-08-11 10:19:00 +02:00