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 Overviews page

Alexander Brandon Coles07a5779e4c41
diff --git a/frontend/src/app/app.module.ts b/frontend/src/app/app.module.ts
index 942aed85211..adc6cce4f4e 100644
--- a/frontend/src/app/app.module.ts
+++ b/frontend/src/app/app.module.ts
@@ -206,6 +206,7 @@ import {
import { OpInviteUserModalAugmentService } from 'core-app/features/invite-user-modal/invite-user-modal-augment.service';
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';
export function initializeServices(injector:Injector) {
return () => {
@@ -428,5 +429,6 @@ export class OpenProjectModule implements DoBootstrap {
registerCustomElement('opce-colors-autocompleter', ColorsAutocompleterComponent, { injector });
registerCustomElement('opce-my-page', MyPageComponent, { injector });
+ registerCustomElement('opce-overview', OverviewComponent, { injector });
}
}
diff --git a/frontend/src/app/features/overview/openproject-overview.module.ts b/frontend/src/app/features/overview/openproject-overview.module.ts
index 69eb8310325..2af5a8d3705 100644
--- a/frontend/src/app/features/overview/openproject-overview.module.ts
+++ b/frontend/src/app/features/overview/openproject-overview.module.ts
@@ -28,46 +28,14 @@
import { NgModule } from '@angular/core';
import { OpSharedModule } from 'core-app/shared/shared.module';
-import { Ng2StateDeclaration, UIRouter, UIRouterModule } from '@uirouter/angular';
import { OpenprojectGridsModule } from 'core-app/shared/components/grids/openproject-grids.module';
import { OverviewComponent } from 'core-app/features/overview/overview.component';
-const menuItemClass = 'overview-menu-item';
-
-export const OVERVIEW_ROUTES:Ng2StateDeclaration[] = [
- {
- name: 'overview',
- parent: 'optional_project',
- // The trailing slash is important
- // cf., https://community.openproject.com/wp/29754
- url: '/',
- data: {
- menuItem: menuItemClass,
- },
- component: OverviewComponent,
- },
-];
-
-export function uiRouterOverviewConfiguration(uiRouter:UIRouter):void {
- // Ensure projects/:project_id/ are being redirected correctly
- // cf., https://community.openproject.com/wp/29754
- uiRouter.urlService.rules
- .when(
- new RegExp('^/projects(?!/new$)/([^/?]+)$'),
- (match:string[]) => `/projects/${match[1]}/${window.location.search}`,
- );
-}
-
@NgModule({
imports: [
OpSharedModule,
OpenprojectGridsModule,
-
- UIRouterModule.forChild({
- states: OVERVIEW_ROUTES,
- config: uiRouterOverviewConfiguration,
- }),
],
providers: [
],
@@ -75,5 +43,4 @@ export function uiRouterOverviewConfiguration(uiRouter:UIRouter):void {
OverviewComponent,
],
})
-export class OpenprojectOverviewModule {
-}
+export class OpenprojectOverviewModule {} // eslint-disable-line @typescript-eslint/no-extraneous-class
diff --git a/modules/overviews/app/views/overviews/overviews/show.html.erb b/modules/overviews/app/views/overviews/overviews/show.html.erb
index c5c1301ea89..819170f9555 100644
--- a/modules/overviews/app/views/overviews/overviews/show.html.erb
+++ b/modules/overviews/app/views/overviews/overviews/show.html.erb
@@ -74,4 +74,4 @@
end
%>
-<openproject-base></openproject-base>
+<%= angular_component_tag "opce-overview" %>