From 5885b03b8ae1d270f84bbcfc3216985471672e3c Mon Sep 17 00:00:00 2001 From: Dombi Attila <83396+dombesz@users.noreply.github.com> Date: Mon, 18 Nov 2024 16:46:17 +0200 Subject: [PATCH 01/36] wip --- .../features/overview/overview.component.ts | 55 +++++++++++++-- .../grids/grid/page/grid-page.component.html | 22 +++++- .../sections/show_component.html.erb | 35 ++++++++++ .../sections/show_component.rb | 68 +++++++++++++++++++ .../side_panel_component.html.erb | 20 ++++++ .../side_panel_component.rb | 48 +++++++++++++ .../overviews/overviews_controller.rb | 35 +++++++++- .../project_life_cycles_sidebar.html.erb | 31 +++++++++ .../views/overviews/overviews/show.html.erb | 3 +- modules/overviews/config/routes.rb | 3 + modules/overviews/lib/overviews/engine.rb | 3 +- .../life_cycle/overview_page/sidebar_spec.rb | 58 ++++++++++++++++ 12 files changed, 373 insertions(+), 8 deletions(-) create mode 100644 modules/overviews/app/components/project_life_cycles/sections/show_component.html.erb create mode 100644 modules/overviews/app/components/project_life_cycles/sections/show_component.rb create mode 100644 modules/overviews/app/components/project_life_cycles/side_panel_component.html.erb create mode 100644 modules/overviews/app/components/project_life_cycles/side_panel_component.rb create mode 100644 modules/overviews/app/views/overviews/overviews/project_life_cycles_sidebar.html.erb create mode 100644 spec/features/projects/life_cycle/overview_page/sidebar_spec.rb diff --git a/frontend/src/app/features/overview/overview.component.ts b/frontend/src/app/features/overview/overview.component.ts index 742139d19362..86e75ede5e39 100644 --- a/frontend/src/app/features/overview/overview.component.ts +++ b/frontend/src/app/features/overview/overview.component.ts @@ -1,3 +1,31 @@ +//-- 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. +//++ + import { ChangeDetectionStrategy, Component } from '@angular/core'; import { GridPageComponent } from 'core-app/shared/components/grids/grid/page/grid-page.component'; import { GRID_PROVIDERS } from 'core-app/shared/components/grids/grid/grid.component'; @@ -17,15 +45,34 @@ export class OverviewComponent extends GridPageComponent { } protected isTurboFrameSidebarEnabled():boolean { - const sidebarEnabledTag:HTMLMetaElement|null = document.querySelector('meta[name="sidebar_enabled"]'); - return sidebarEnabledTag?.dataset.enabled === 'true'; + return this.isCustomFieldsSidebarEnabled() || this.isLifeCyclesSidebarEnabled(); + } + + protected isCustomFieldsSidebarEnabled():boolean { + const customFieldsSidebarEnabledTag:HTMLMetaElement|null = document.querySelector('meta[name="custom_fields_sidebar_enabled"]'); + + return customFieldsSidebarEnabledTag?.dataset.enabled === 'true'; + } + + protected isLifeCyclesSidebarEnabled():boolean { + const lifeCyclesSidebarEnabledTag:HTMLMetaElement|null = document.querySelector('meta[name="life_cycles_sidebar_enabled"]'); + + return lifeCyclesSidebarEnabledTag?.dataset.enabled === 'true'; + } + + protected lifeCyclesSidebarSrc():string { + return `${this.pathHelper.staticBase}/projects/${this.currentProject.identifier ?? ''}/project_life_cycles_sidebar`; + } + + protected lifeCyclesSidebarId():string { + return 'project-life-cycles-sidebar'; } - protected turboFrameSidebarSrc():string { + protected projectCustomFieldsSidebarSrc():string { return `${this.pathHelper.staticBase}/projects/${this.currentProject.identifier ?? ''}/project_custom_fields_sidebar`; } - protected turboFrameSidebarId():string { + protected projectCustomFieldsSidebarId():string { return 'project-custom-fields-sidebar'; } diff --git a/frontend/src/app/shared/components/grids/grid/page/grid-page.component.html b/frontend/src/app/shared/components/grids/grid/page/grid-page.component.html index 01a5002f85d8..f3c82b9e54c7 100644 --- a/frontend/src/app/shared/components/grids/grid/page/grid-page.component.html +++ b/frontend/src/app/shared/components/grids/grid/page/grid-page.component.html @@ -17,7 +17,27 @@