Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Add the ical meeting token generation

Klaus Zanders7d561fd9e664
diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb
index d059581c5e1..c3daf8bd48b 100644
--- a/app/controllers/my_controller.rb
+++ b/app/controllers/my_controller.rb
@@ -98,6 +98,8 @@ class MyController < ApplicationController
# Administer access tokens
def access_token
+ @ical_meeting_tokens = current_user.ical_meeting_tokens
+
@storage_tokens = OAuthClientToken
.preload(:oauth_client)
.joins(:oauth_client)
diff --git a/app/views/my/access_token.html.erb b/app/views/my/access_token.html.erb
index 651fc13e6dd..b0850c7aa96 100644
--- a/app/views/my/access_token.html.erb
+++ b/app/views/my/access_token.html.erb
@@ -42,6 +42,8 @@ See COPYRIGHT and LICENSE files for more details.
<%= render ::My::AccessToken::APITokensSectionComponent.new(api_tokens: @user.api_tokens) %>
<%= render partial: "my/access_token_partials/icalendar_tokens_section",
locals: { ical_tokens_grouped_by_query: @ical_tokens_grouped_by_query } %>
+<%= render partial: "my/access_token_partials/icalendar_meeting_tokens_section",
+ locals: { ical_tokens: @ical_meeting_tokens } %>
<%= render partial: "my/access_token_partials/oauth_tokens_section",
locals: { granted_applications: granted_applications } %>
<%= render partial: "my/access_token_partials/rss_tokens_section",
diff --git a/app/views/my/access_token_partials/_icalendar_meeting_tokens_section.html.erb b/app/views/my/access_token_partials/_icalendar_meeting_tokens_section.html.erb
new file mode 100644
index 00000000000..bad7f22bb40
--- /dev/null
+++ b/app/views/my/access_token_partials/_icalendar_meeting_tokens_section.html.erb
@@ -0,0 +1,89 @@
+<%#-- copyright
+OpenProject is an open source project management software.
+Copyright (C) the OpenProject GmbH
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License version 3.
+
+OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+Copyright (C) 2006-2013 Jean-Philippe Lang
+Copyright (C) 2010-2013 the ChiliProject Team
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+See COPYRIGHT and LICENSE files for more details.
+
+++#%>
+<div class="attributes-group" id="icalendar-token-section">
+ <div class="attributes-group--header">
+ <div class="attributes-group--header-container">
+ <h3 class="attributes-group--header-text"><%= t("my_account.access_tokens.ical_meeting.title") %></h3>
+ </div>
+ </div>
+ <div>
+ <p>
+ <%= t("my_account.access_tokens.ical_meeting.text_hint") %>
+ </p>
+ <% if Setting.ical_enabled? %>
+ <% if ical_tokens.any? %>
+ <div class="generic-table--container">
+ <div class="generic-table--results-container">
+ <table class="generic-table" data-controller="table-highlighting">
+ <%= render partial: "my/access_token_partials/token_table_header",
+ locals: {
+ column_headers: [
+ t("attributes.name"),
+ User.human_attribute_name(:created_at),
+ t("my_account.access_tokens.headers.expiration")
+ ]
+ } %>
+ <tbody>
+ <% ical_tokens.each do |token| %>
+ <tr>
+ <td class="-w-rel-20 -mw-abs-200" data-test-selector="ical-meeting-token-row-<%= token.id %>-name"><%= token.token_name %></td>
+ <td>
+ <span title="<%= format_time(token.created_at) %>">
+ <%= format_time(token.created_at.to_s) %>
+ </span>
+ </td>
+ <td><%= t("my_account.access_tokens.indefinite_expiration") %></td>
+ <td class="buttons">
+ <%= link_to "",
+ { action: "revoke_ical_meeting_token", id: token.id },
+ data: { confirm: t("my_account.access_tokens.simple_revoke_confirmation"), test_selector: "ical-meeting-token-row-#{token.id}-revoke" },
+ method: :delete,
+ class: "icon icon-delete" %>
+ </td>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ <% else %>
+ <span class="spot-icon spot-icon_inline spot-icon_info1"></span>
+ <i><%= t("my_account.access_tokens.ical_meeting.empty_text_hint", path: meetings_path).html_safe %></i>
+ <% end %>
+ <% else %>
+ <div tabindex="0" class="-info op-toast">
+ <div role="alert" aria-atomic="true" class="op-toast--content">
+ <p>
+ <span><%= t("my_account.access_tokens.ical_meeting.disabled_text") %></span>
+ </p>
+ </div>
+ </div>
+ <% end %>
+ </div>
+</div>
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 10e81ca5d50..cbcddfdea2d 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -502,7 +502,7 @@ en:
life_cycle:
header:
title: "Project life cycle"
- description_html: "The active project phases define this project's life cycle and are defined in the <a href=%{admin_settings_url} target=\"_blank\">administration settings</a>. Enabled phases will be displayed in your <a href=%{overview_url} target=\"_blank\">project overview</a>."
+ description_html: 'The active project phases define this project''s life cycle and are defined in the <a href=%{admin_settings_url} target="_blank">administration settings</a>. Enabled phases will be displayed in your <a href=%{overview_url} target="_blank">project overview</a>.'
non_defined: "No phases are currently defined."
section_header: "Phases"
step:
@@ -777,7 +777,7 @@ en:
pattern:
label: "Subject pattern"
caption: Create patterns by adding text, or type "/" to search for [supported attributes](attributes_url).
- insert_as_text: "No attributes found. Add as text: \"%{word}\""
+ insert_as_text: 'No attributes found. Add as text: "%{word}"'
export_configuration:
tab: "Generate PDF"
intro: "Select which templates from those that are available you would like to enable for this type. The template determines the design and attributes visible in the exported PDF of a work package using this type. The first template on the list is selected by default."
@@ -1636,7 +1636,8 @@ en:
cant_exceed_work: "cannot be higher than Work."
must_be_set_when_work_is_set: "required when Work is set."
must_be_set_when_work_and_percent_complete_are_set: "required when Work and % Complete are set."
- must_be_set_to_zero_hours_when_work_is_set_and_percent_complete_is_100p: >-
+ must_be_set_to_zero_hours_when_work_is_set_and_percent_complete_is_100p:
+ >-
must be 0h when Work is set and % Complete is 100%.
must_be_empty_when_work_is_empty_and_percent_complete_is_100p: >-
must be empty when Work is empty and % Complete is 100%.
@@ -2060,21 +2061,45 @@ en:
succeeded: 'Copied project "%{source_project_name}" to "%{target_project_name}".'
source_project_label: "Project copied"
copy_options:
- dependencies_label: 'Copy from project'
+ dependencies_label: "Copy from project"
create_project:
template_label: "Use template"
copy_options:
- dependencies_label: 'Copy from template'
+ dependencies_label: "Copy from template"
create_wiki_page: "Create new wiki page"
create_wiki_page_button: "Wiki page"
date:
abbr_day_names: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
- abbr_month_names: [~, "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
+ abbr_month_names:
+ [
+ ~,
+ "Jan",
+ "Feb",
+ "Mar",
+ "Apr",
+ "May",
+ "Jun",
+ "Jul",
+ "Aug",
+ "Sep",
+ "Oct",
+ "Nov",
+ "Dec",
+ ]
abbr_week: "Wk"
- day_names: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
+ day_names:
+ [
+ "Sunday",
+ "Monday",
+ "Tuesday",
+ "Wednesday",
+ "Thursday",
+ "Friday",
+ "Saturday",
+ ]
formats:
# Use the strftime parameters for formats.
# When no format has been given, it uses default.
@@ -2333,8 +2358,7 @@ en:
Please check your inbox and click the confirmation link provided to start your 14-day free trial.
confirmation_subline: >
Please, check your inbox and follow the steps to start your 14-day free trial.
- domain_caption:
- The token will be valid for your currently configured host name.
+ domain_caption: The token will be valid for your currently configured host name.
receive_newsletter_html: >
I want to receive the OpenProject <a target="_blank" href="https://www.openproject.org/newsletter/">newsletter</a>.
consent_html: >
@@ -2696,6 +2720,11 @@ en:
text_hint: 'iCalendar tokens allow users to <a href="%{path}" target="_blank">subscribe to OpenProject calendars</a> and view up-to-date work package information from external clients.'
disabled_text: "iCalendar subscriptions are not enabled by the administrator. Please contact your administrator to use this feature."
empty_text_hint: "To add an iCalendar token, subscribe to a new or existing calendar from within the Calendar module of a project. You must have the necessary permissions."
+ ical_meeting:
+ title: "iCalendar for meetings"
+ text_hint: "iCalendar meeting tokens allow users to subscribe to all their meetings and view up-to-date meeting information in external clients."
+ disabled_text: "iCalendar meeting subscriptions are not enabled by the administrator. Please contact your administrator to use this feature."
+ empty_text_hint: 'To add an iCalendar meeting token, go to the <a href="%{path}">meetings section</a> and subscribe from there.'
oauth:
title: "OAuth"
text_hint: "OAuth tokens allow third-party applications to connect with this OpenProject instance."
diff --git a/modules/meeting/app/components/meetings/index_page_header_component.html.erb b/modules/meeting/app/components/meetings/index_page_header_component.html.erb
index 12cc2daea1b..d5f3e964b68 100644
--- a/modules/meeting/app/components/meetings/index_page_header_component.html.erb
+++ b/modules/meeting/app/components/meetings/index_page_header_component.html.erb
@@ -2,6 +2,17 @@
keep_scroll_position_url_value: polymorphic_path([@project, :meetings]) %>
<%= render(Primer::OpenProject::PageHeader.new) do |header|
- header.with_title { page_title }
- header.with_breadcrumbs(breadcrumb_items, selected_item_font_weight: section_present? ? :normal : :bold)
-end %>
+ header.with_title { page_title }
+ header.with_breadcrumbs(breadcrumb_items, selected_item_font_weight: section_present? ? :normal : :bold)
+
+ if Setting.ical_enabled?
+ header.with_action_menu(
+ menu_arguments: { anchor_align: :end },
+ button_arguments: { icon: "kebab-horizontal", "aria-label": t(:label_more), data: { "test-selector": "meeting-more" } }
+ ) do |menu|
+ menu.with_item(label: t("label_subscribe_icalendar"), href: "#") do |item|
+ item.with_leading_visual_icon(icon: :rss)
+ end
+ end
+ end
+ end %>
diff --git a/modules/meeting/config/locales/en.yml b/modules/meeting/config/locales/en.yml
index c72042bc503..c319580b226 100644
--- a/modules/meeting/config/locales/en.yml
+++ b/modules/meeting/config/locales/en.yml
@@ -187,7 +187,7 @@ en:
label_version: "Version"
label_time_zone: "Time zone"
label_start_date: "Start date"
-
+ label_subscribe_icalendar: "Subscribe to calendar"
meeting:
participants:
@@ -342,8 +342,7 @@ en:
All participants will receive updated calendar invites informing them of your changes to this template or to individual occurrences.
disabled: >
Email calendar updates are disabled for the meeting series.
- Participants will not receive an email informing them of your changes to this template or to individual occurrences.
-
+ Participants will not receive an email informing them of your changes to this template or to individual occurrences.
meeting_section:
untitled_title: "Untitled section"
@@ -351,7 +350,6 @@ en:
placeholder_title: "New section"
empty_text: "Drag items here or create a new one"
-
recurring_meeting:
time_zone_difference_banner:
title: "Time zone difference"
@@ -359,14 +357,14 @@ en:
The dates below are referencing the time zone of the meeting series (%{actual_zone}),
not your local time zone (%{user_zone}).
ended_blankslate:
- title: "Meeting series ended"
- message: "This meeting series has come to an end. There are no upcoming meetings. "
- action: "You can still view past occurrences or edit the meeting series to extend it."
+ title: "Meeting series ended"
+ message: "This meeting series has come to an end. There are no upcoming meetings. "
+ action: "You can still view past occurrences or edit the meeting series to extend it."
occurrence:
infoline: "This meeting is part of a recurring meeting series."
error_no_next: "There is no next occurrence for this meeting."
first_already_exists: "The first occurrence of this meeting series is already instantiated."
- first_created: >
+ first_created: >
The first meeting has been successfuly created from template.
All future meetings will be created automatically at the time of the previous occurrence.
template:
@@ -376,7 +374,7 @@ en:
This template will be used whenever new meetings in the series get created.
You can add agenda items, participants, and attachments to this template.
blankslate_finalize: >
- When you're done preparing this template,
+ When you're done preparing this template,
click the '%{button_title}' button above to finish the setup and schedule the first meeting of the series.
label_view_template: "View template"
label_edit_template: "Edit template"
@@ -418,8 +416,8 @@ en:
planned:
title: "Planned"
subtitle: >
- The following meetings are planned in the recurring meeting schedule but are not open yet.
- Every time a planned meeting starts, the next one will automatically be opened for you.
+ The following meetings are planned in the recurring meeting schedule but are not open yet.
+ Every time a planned meeting starts, the next one will automatically be opened for you.
You can also open planned meetings manually to import the template and start editing the agenda.
blankslate:
title: "No more planned meetings"
@@ -537,7 +535,7 @@ en:
text_agenda_backlog_clear_description: >
Are you sure you want to remove all items currently in the agenda backlog? This action is not reversible.
label_series_backlog: "Series backlog"
- text_series_backlog: >
+ text_series_backlog: >
The backlog is shared with all occurrences of this series.
You can drag items in and out to add or remove them from a particular meeting.
label_series_backlog_clear_title: "Clear series backlog?"
@@ -546,8 +544,8 @@ en:
Are you sure you want to continue? This action is not reversible.
text_agenda_item_title: 'Agenda item "%{title}"'
- text_agenda_work_package_deleted: 'Agenda item for deleted work package'
- text_deleted_agenda_item: 'Deleted agenda item'
+ text_agenda_work_package_deleted: "Agenda item for deleted work package"
+ text_deleted_agenda_item: "Deleted agenda item"
label_initial_meeting_details: "Meeting"
label_meeting_details: "Meeting details"
@@ -597,4 +595,3 @@ en:
text_email_updates_muted: "Email calendar updates are muted. Participants will not receive updated invites via email when you make changes."
text_email_updates_enabled: "Email calendar updates are enabled. All participants will receive updated invites via email when you make changes."
-