Skip to content

Commit

Permalink
add enterprise plan and features to the view (rails side)
Browse files Browse the repository at this point in the history
  • Loading branch information
klaustopher committed Feb 25, 2025
1 parent ce79dfd commit 0c8a388
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/enterprise_token.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ def set_current_token
:reprieve_days,
:reprieve_days_left,
:restrictions,
:plan,
:features,
to: :token_object

def token_object
Expand Down
2 changes: 2 additions & 0 deletions app/views/enterprises/_current.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
data-email="<%= @current_token.mail %>"
data-company="<%= @current_token.try(:company) %>"
data-domain="<%= @current_token.try(:domain) %>"
data-plan="<%= (@current_token.respond_to?(:plan) ? I18n.t(@current_token.plan, scope: [:enterprise_plans]) : nil) %>"
data-user-count="<%= @current_token.restrictions.nil? ? t("js.admin.enterprise.upsale.unlimited") : @current_token.restrictions[:active_user_count] %>"
data-starts-at="<%= format_date @current_token.starts_at %>"
data-expires-at="<%= @current_token.will_expire? ? (format_date @current_token.expires_at) : t("js.admin.enterprise.upsale.unlimited") %>"
data-is-expired="<%= @current_token.expired?(reprieve: false) %>"
data-additional-features="<%= (@current_token.try(:features) || []).map { |feature| I18n.t(feature, scope: [:enterprise_features], default: feature.to_s.humanize) }.join(", ") %>"
data-reprieve-days-left="<%= @current_token.reprieve_days_left %>">
</opce-enterprise-active-saved-trial>

Expand Down
29 changes: 29 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4493,3 +4493,32 @@ en:
plugin_openproject_auth_saml:
name: "OmniAuth SAML / Single-Sign On"
description: "Adds the OmniAuth SAML provider to OpenProject"

enterprise_plans:
corporate: Corporate Plan
enterprise: Enterprise Plan

enterprise_features:
baseline_comparison: Baseline Comparison
board_view: Board View
conditional_highlighting: Conditional Highlighting
custom_actions: Custom Actions
custom_field_hierarchies: Custom Field Hierarchies
customize_life_cycle: Customize Life Cycle
date_alerts: Date Alerts
define_custom_style: Define Custom Style
edit_attribute_groups: Edit Attribute Groups
gantt_pdf_export: Gantt PDF Export
grid_widget_wp_graph: Grid Widget Work Package Graph
ldap_groups: LDAP Groups
one_drive_sharepoint_file_storage: OneDrive/SharePoint File Storage
placeholder_users: Placeholder Users
project_list_sharing: Project List Sharing
readonly_work_packages: Readonly Work Packages
sso_auth_providers: SSO Auth Providers
team_planner_view: Team Planner View
two_factor_authentication: Two-Factor Authentication
virus_scanning: Attachment Virus Scanning
work_package_query_relation_columns: Work Package Query Relation Columns
work_package_sharing: Work Package Sharing
work_package_subject_generation: Work Package Subject Generation

0 comments on commit 0c8a388

Please sign in to comment.