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

Remove client-side routing from Dashboards page

Alexander Brandon Coles338ab041f3f4
diff --git a/frontend/src/app/app.module.ts b/frontend/src/app/app.module.ts
index adc6cce4f4e..ba6c14f39ab 100644
--- a/frontend/src/app/app.module.ts
+++ b/frontend/src/app/app.module.ts
@@ -207,6 +207,7 @@ import { OpInviteUserModalAugmentService } from 'core-app/features/invite-user-m
import { TimeEntryTimerService } from 'core-app/shared/components/time_entries/services/time-entry-timer.service';
import { MyPageComponent } from './features/my-page/my-page.component';
import { OverviewComponent } from './features/overview/overview.component';
+import { DashboardComponent } from './features/dashboards/dashboard/dashboard.component';
export function initializeServices(injector:Injector) {
return () => {
@@ -430,5 +431,6 @@ export class OpenProjectModule implements DoBootstrap {
registerCustomElement('opce-my-page', MyPageComponent, { injector });
registerCustomElement('opce-overview', OverviewComponent, { injector });
+ registerCustomElement('opce-dashboard', DashboardComponent, { injector });
}
}
diff --git a/frontend/src/app/features/dashboards/openproject-dashboards.module.ts b/frontend/src/app/features/dashboards/openproject-dashboards.module.ts
index 390b5295cb3..ffecf5b5c2c 100644
--- a/frontend/src/app/features/dashboards/openproject-dashboards.module.ts
+++ b/frontend/src/app/features/dashboards/openproject-dashboards.module.ts
@@ -28,48 +28,14 @@
import { NgModule } from '@angular/core';
import { OpSharedModule } from 'core-app/shared/shared.module';
-import { Ng2StateDeclaration, UIRouter, UIRouterModule } from '@uirouter/angular';
import { DashboardComponent } from 'core-app/features/dashboards/dashboard/dashboard.component';
import { OpenprojectGridsModule } from 'core-app/shared/components/grids/openproject-grids.module';
-const menuItemClass = 'dashboards-menu-item';
-
-export const DASHBOARDS_ROUTES:Ng2StateDeclaration[] = [
- {
- name: 'dashboards',
- parent: 'optional_project',
- // The trailing slash is important
- // cf., https://community.openproject.com/wp/29754
- url: '/dashboards/',
- data: {
- bodyClasses: ['router--dashboards-view-base', 'widget-grid-layout'],
- menuItem: menuItemClass,
- },
- component: DashboardComponent,
- },
-];
-
-export function uiRouterDashboardsConfiguration(uiRouter:UIRouter) {
- // Ensure boards/ are being redirected correctly
- // cf., https://community.openproject.com/wp/29754
- uiRouter.urlService.rules
- .when(
- new RegExp('^/projects/(.*)/dashboards$'),
- (match) => `/projects/${match[1]}/dashboards/`,
- );
-}
-
@NgModule({
imports: [
OpSharedModule,
OpenprojectGridsModule,
-
- // Routes for /dashboards
- UIRouterModule.forChild({
- states: DASHBOARDS_ROUTES,
- config: uiRouterDashboardsConfiguration,
- }),
],
providers: [
],
@@ -77,5 +43,4 @@ export function uiRouterDashboardsConfiguration(uiRouter:UIRouter) {
DashboardComponent,
],
})
-export class OpenprojectDashboardsModule {
-}
+export class OpenprojectDashboardsModule {} // eslint-disable-line @typescript-eslint/no-extraneous-class
diff --git a/modules/dashboards/app/views/dashboards/dashboards/show.html.erb b/modules/dashboards/app/views/dashboards/dashboards/show.html.erb
index e69de29bb2d..ad4b364f77d 100644
--- a/modules/dashboards/app/views/dashboards/dashboards/show.html.erb
+++ b/modules/dashboards/app/views/dashboards/dashboards/show.html.erb
@@ -0,0 +1,23 @@
+<%=
+ render(Primer::OpenProject::PageHeader.new) do |header|
+ header.with_title(variant: :medium) { t("dashboards.label") }
+ header.with_breadcrumbs(
+ [
+ { href: project_path(@project), text: @project.name, skip_for_mobile: true },
+ t("dashboards.label")
+ ]
+ )
+ header.with_action_icon_button(
+ icon: :"screen-full",
+ mobile_icon: :"screen-full",
+ label: I18n.t("js.button_show_fullscreen"),
+ data: {
+ controller: "projects-zen-mode",
+ target: "projects-zen-mode.button",
+ action: "click->projects-zen-mode#performAction"
+ }
+ )
+ end
+%>
+
+<%= angular_component_tag "opce-dashboard" %>
diff --git a/modules/grids/app/controllers/grids/base_in_project_controller.rb b/modules/grids/app/controllers/grids/base_in_project_controller.rb
index eac86aa79ab..a098d30861f 100644
--- a/modules/grids/app/controllers/grids/base_in_project_controller.rb
+++ b/modules/grids/app/controllers/grids/base_in_project_controller.rb
@@ -4,7 +4,7 @@ module ::Grids
before_action :authorize
def show
- render layout: "angular/angular"
+ render
end
end
end
diff --git a/modules/overviews/app/controllers/overviews/overviews_controller.rb b/modules/overviews/app/controllers/overviews/overviews_controller.rb
index 62b72796221..7cc6031c82a 100644
--- a/modules/overviews/app/controllers/overviews/overviews_controller.rb
+++ b/modules/overviews/app/controllers/overviews/overviews_controller.rb
@@ -35,10 +35,6 @@ module ::Overviews
menu_item :overview
- def show
- render
- end
-
def project_custom_fields_sidebar
render :project_custom_fields_sidebar, layout: false
end