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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Extract upsale pages into CustomComponents and render them on individual rails routes instead of Angular
Henriette Darge092d5cd60040
diff --git a/app/controllers/angular_controller.rb b/app/controllers/angular_controller.rbindex 40e623c9027..3ffbaa8afff 100644--- a/app/controllers/angular_controller.rb+++ b/app/controllers/angular_controller.rb@@ -29,7 +29,7 @@class AngularController < ApplicationControllerbefore_action :require_login- no_authorization_required! :empty_layout, :notifications_layout+ no_authorization_required! :empty_layoutdef empty_layout# Frontend will handle rendering@@ -37,12 +37,6 @@ class AngularController < ApplicationControllerrender html: "", layout: "angular/angular"end- def notifications_layout- # Frontend will handle rendering- # but we will need to render with notification specific layout- render html: "", layout: "angular/notifications"- end-def login_back_url_paramsparams.permit(:state)enddiff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rbindex e2bb53b7e26..742ce9f8e9f 100644--- a/app/controllers/notifications_controller.rb+++ b/app/controllers/notifications_controller.rb@@ -29,18 +29,16 @@class NotificationsController < ApplicationControllerbefore_action :require_loginbefore_action :filtered_query, only: :mark_all_read- no_authorization_required! :index, :split_view, :mark_all_read+ no_authorization_required! :index, :split_view, :mark_all_read, :date_alerts, :share_upsaledef index- # Frontend will handle rendering- # but we will need to render with notification specific layout- render layout: "angular/notifications"+ render_notifications_layoutenddef split_viewrespond_to do |format|format.html do- render :index, layout: "angular/notifications"+ render :index, layout: "notifications"endendend@@ -55,10 +53,22 @@ class NotificationsController < ApplicationControllerredirect_back fallback_location: notifications_pathend+ def date_alerts+ render_notifications_layout+ end++ def share_upsale+ render_notifications_layout+ end+private- def default_breadcrumb- t("js.notifications.title")+ def default_breadcrumb; end++ def render_notifications_layout+ # Frontend will handle rendering+ # but we will need to render with notification specific layout+ render layout: "notifications"enddef filtered_querydiff --git a/app/views/layouts/angular/notifications.html.erb b/app/views/layouts/notifications.html.erbsimilarity index 100%rename from app/views/layouts/angular/notifications.html.erbrename to app/views/layouts/notifications.html.erbdiff --git a/app/views/notifications/date_alerts.html.erb b/app/views/notifications/date_alerts.html.erbnew file mode 100644index 00000000000..7bd17ca6e45--- /dev/null+++ b/app/views/notifications/date_alerts.html.erb@@ -0,0 +1,5 @@+<% html_title t("js.notifications.title") %>++<% content_for :content_body do %>+ <%= angular_component_tag "opce-ian-date-alerts-upsale" %>+<% end %>diff --git a/app/views/notifications/share_upsale.html.erb b/app/views/notifications/share_upsale.html.erbnew file mode 100644index 00000000000..6b72a636ae6--- /dev/null+++ b/app/views/notifications/share_upsale.html.erb@@ -0,0 +1,5 @@+<% html_title t("js.notifications.title") %>++<% content_for :content_body do %>+ <%= angular_component_tag "opce-share-upsale" %>+<% end %>diff --git a/config/routes.rb b/config/routes.rbindex 0d82903b420..e5ad775555e 100644--- a/config/routes.rb+++ b/config/routes.rb@@ -723,9 +723,9 @@ Rails.application.routes.draw doendscope :notifications do- get "/share_upsale" => "angular#notifications_layout", as: "notifications_share_upsale"- get "/date_alerts" => "angular#notifications_layout", as: "notifications_date_alert_upsale"- get "(/*state)", to: "angular#notifications_layout", as: :notifications_center+ get "/share_upsale" => "notifications#share_upsale", as: "notifications_share_upsale"+ get "/date_alerts" => "notifications#date_alerts", as: "notifications_date_alert_upsale"+ get "/", to: "notifications#index", as: :notifications_centerend# OAuthClient needs a "callback" URL that Nextcloud calls with a "code" (see OAuth2 RFC)diff --git a/frontend/src/app/app.module.ts b/frontend/src/app/app.module.tsindex b80abff7fb7..f6b3ac91ba5 100644--- a/frontend/src/app/app.module.ts+++ b/frontend/src/app/app.module.ts@@ -171,6 +171,8 @@ import {import {WorkPackageSplitViewEntryComponent,} from 'core-app/features/work-packages/routing/wp-split-view/wp-split-view-entry.component';+import { InAppNotificationsDateAlertsUpsaleComponent } from 'core-app/features/in-app-notifications/date-alerts-upsale/ian-date-alerts-upsale.component';+import { ShareUpsaleComponent } from 'core-app/features/enterprise/share-upsale/share-upsale.component';export function initializeServices(injector:Injector) {return () => {@@ -369,6 +371,8 @@ export class OpenProjectModule {registerCustomElement('opce-notification-settings', NotificationsSettingsPageComponent, { injector });registerCustomElement('opce-reminder-settings', ReminderSettingsPageComponent, { injector });registerCustomElement('opce-notification-center', InAppNotificationCenterComponent, { injector });+ registerCustomElement('opce-ian-date-alerts-upsale', InAppNotificationsDateAlertsUpsaleComponent, { injector });+ registerCustomElement('opce-share-upsale', ShareUpsaleComponent, { injector });registerCustomElement('opce-wp-split-view', WorkPackageSplitViewEntryComponent, { injector });}}