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

Correctly link to the dialog

Klaus Zanders4bae7b4cb660
diff --git a/app/views/my/access_tokens/_icalendar_meeting_tokens_section.html.erb b/app/views/my/access_tokens/_icalendar_meeting_tokens_section.html.erb
index 44808db477d..c4de739c833 100644
--- a/app/views/my/access_tokens/_icalendar_meeting_tokens_section.html.erb
+++ b/app/views/my/access_tokens/_icalendar_meeting_tokens_section.html.erb
@@ -73,9 +73,23 @@ See COPYRIGHT and LICENSE files for more details.
</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 %>
+ <%= render(
+ Primer::Beta::Button.new(
+ tag: :a,
+ mt: 3,
+ scheme: :primary,
+ test_selector: "ical-meeting-token-add",
+ href: dialog_my_access_tokens_path(token_type: "ical-meeting"),
+ data: { turbo_stream: true },
+ aria: { label: I18n.t("my.access_token.new_ical_meeting_token_dialog_show_button_text") },
+ role: "button",
+ title: I18n.t("my.access_token.new_ical_meeting_token_dialog_show_button_text")
+ )
+ ) do |button|
+ button.with_leading_visual_icon(icon: :rss)
+ I18n.t("my.access_token.new_ical_meeting_token_dialog_show_button_text")
+ end %>
<% else %>
<div tabindex="0" class="-info op-toast">
<div role="alert" aria-atomic="true" class="op-toast--content">
diff --git a/config/locales/en.yml b/config/locales/en.yml
index cbcddfdea2d..a791eb785ba 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -638,6 +638,7 @@ en:
notice_api_token_revoked: "The API token has been deleted. To create a new token please use the button in the API section."
notice_rss_token_revoked: "The RSS token has been deleted. To create a new token please use the link in the RSS section."
notice_ical_token_revoked: 'iCalendar token "%{token_name}" for calendar "%{calendar_name}" of project "%{project_name}" has been revoked. The iCalendar URL with this token is now invalid.'
+ new_ical_meeting_token_dialog_show_button_text: "iCalendar subscription"
news:
index:
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 d5f3e964b68..68f4cca9b14 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
@@ -10,7 +10,11 @@
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|
+ menu.with_item(
+ label: t("label_subscribe_icalendar"),
+ href: dialog_my_access_tokens_path(token_type: "ical-meeting"),
+ content_arguments: { data: { turbo_stream: true } }
+ ) do |item|
item.with_leading_visual_icon(icon: :rss)
end
end