54 Commits

Author SHA1 Message Date
Jens Ulferts 2a7b249b59 Merge pull request #20377 from opf/use-set-for-available-features
use Set for available_features
2025-09-22 13:19:07 +02:00
Ivan Kuchin 15cec3382c use Set for available_features 2025-09-19 18:01:24 +02:00
Ivan Kuchin 7f90670baf use OpenProject::Token.lowest_plan_for directly 2025-09-19 17:46:45 +02:00
Pavel Balashou b5e5b00c63 [#66706] Responds with 403 and proper message when enterprise plan is not enough.
https://community.openproject.org/work_packages/66706
2025-08-27 16:32:00 +02:00
Oliver Günther 06d78fe8f0 Add validation for a single trial token, rename to active_trial_token 2025-06-24 16:46:55 +02:00
Mir Bhatia 0b15d19f4f Update days_left to use expires_at 2025-06-24 16:15:57 +02:00
Mir Bhatia 9ec008ec8f Add teaser specs 2025-06-24 16:15:56 +02:00
Mir Bhatia 1b6c571e01 Move trial teasers from SaaS 2025-06-24 14:31:05 +02:00
Christophe Bliard 56bfd61994 Merge pull request #19228 from opf/implementation/64636-forbid-importing-same-token-twice
[64636] Prevent importing the same enterprise token twice
2025-06-18 16:21:11 +02:00
Christophe Bliard 520992f5e9 [64636] Prevent importing same token twice
https://community.openproject.org/wp/64636

It's not very strict right now: you can still import the same token
twice if you add some garbage before and/or after, but it strips
whitespaces and for most customer scenarios, it should be enough.

Also even if the same token is added twice, it's not a big deal. It will
still work as expected.
2025-06-18 11:38:23 +02:00
Christophe Bliard 3d2b33ccea Remove some dead i18n keys, code, and files related to enterprise tokens
This is a follow-up to the following commits:
- 299d611d27: Remove enterprise angular code
- 9357553e3f: Replace common/upsale with component
- 28434f7cc9: Remove enterprise_tokens/_current partial

That also removes the fixture tokens used in _current partial specs as
they're not used elsewhere.
2025-06-18 10:44:59 +02:00
Christophe Bliard efbdb62656 [64635] Format enterprise tokens table according to their statuses
https://community.openproject.org/wp/64635

This follows the design on Figma:
- 4 columns: subscription, active users, domain, dates
- subscription shows plan name, subscriber, and some labels depending on
  the token validity and attributes
- the dates are highlighted if they have an influence on the token status
2025-06-17 15:37:19 +02:00
Christophe Bliard 6426f17d81 Do not consider an invalid enterprise token as expired 2025-06-17 14:44:06 +02:00
Klaus Zanders 4fd3546558 Use new active method to determine token 2025-06-12 11:22:12 +02:00
Klaus Zanders 401f43669b Ensure mock tokens have a starts_at date 2025-06-12 11:22:11 +02:00
Klaus Zanders 16f4338eb0 add a hint why we still do the reject and use before_save to ensure extraction 2025-06-11 15:28:06 +02:00
Klaus Zanders 0bc9074a8b extract validity period and use as a scope 2025-06-11 15:27:56 +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
Oliver Günther 3f4bd12c93 Rework frontend so that it knows features to be trialled 2025-06-04 11:19:21 +02:00
Mir Bhatia 81d34331a0 Add trial banner 2025-06-04 11:19:20 +02:00
Oliver Günther e7e2c0bab2 Extract show/hide of EE banners from ee_manager_visible
Allow hiding the admin page separately from banners
2025-04-08 14:49:34 +02:00
Oliver Günther edc0a2a47e Replace show_banners with hide_banners
Encode features in the configuration API, instead of relying on a boolean yes/no flag
2025-04-07 10:55:21 +02:00
Klaus Zanders af4728db8b Add banner type for EnterpriseToken 2025-03-25 11:42:16 +01:00
Klaus Zanders 7955acb681 show version of entrprise token with plan 2025-02-28 10:24:51 +01:00
Klaus Zanders ab49151052 rework show_banners? check to also allow feature specific banners 2025-02-28 10:24:49 +01:00
Klaus Zanders 9c52ee4858 add enterprise plan and features to the view (rails side) 2025-02-28 10:24:44 +01:00
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +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
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
Aaron Contreras 78710667b6 Re-use .active? in show_banners?
As the `active?` logic was extracted out, it makes sense to re-use this newly created method. Thanks Oliver!

Co-authored-by: Oliver Günther <o.guenther@openproject.com>
2023-05-22 13:15:06 -05:00
Aaron Contreras 43d5d73456 Account for Enterprise token in help menu's cache key
The cached help menu needs to be invalidated once an EnterpriseToken is set or
removed in order to properly render upsales/set appropriate support links.
Otherwise, an outdated up-sale link and Enterprise Support link would still be
displayed even when the OpenProject version toggles between Community and Enterprise.
2023-05-22 13:15:05 -05:00
Oliver Günther 579d841dba Use validate_domain of token gem 2023-04-17 16:18:12 +02:00
Christophe Bliard 21a696ef9b Update copyright information for 2023 2022-12-30 15:51:26 +01:00
Christophe Bliard 48a4f1b6ad lint with rubocop --autocorrect (safe cops only) 2022-06-02 10:40:10 +02:00
Christophe Bliard bc8d423ec2 update copyright information for 2022 2022-03-01 17:05:59 +01:00
ulferts 2d6eec0874 Merge remote-tracking branch 'origin/release/11.4' into dev 2021-09-27 12:34:59 +02: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
Markus Kahl 3f13bc5fef enforce token domain 2020-05-25 12:37:20 +01: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
Henriette Dinger bd7f4e4814 Update copyright notice 2020-01-15 11:31:26 +01:00
ulferts fdbcdc45bf restrict wp_graph widget to be ee only 2019-09-16 08:32:20 +02:00
Oliver Günther f86abae9eb Enforce Arel.sql for string order, pluck 2018-12-03 10:31:57 +01:00
Oliver Günther 38256858aa Skip initializer if being run too early
[ci skip]
2018-11-22 13:56:35 +01:00
Oliver Günther 6ef4211e77 Bump copyright to 2018 (#6171)
[ci skip]
2018-02-12 08:51:12 +01:00
Wieland Lindenthal c4a8320ed5 Fix: logic for ee_manager_visible is falsey
`allows_to?` and `show_banners?` should behave differently if the
configuration is set to false.
2017-01-23 17:57:56 +01:00