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
Replace angular CE with new Primer CollapsibleSection
Henriette Darge73a382323af8
diff --git a/app/views/augmented/_collapsible_section.html.erb b/app/views/augmented/_collapsible_section.html.erbindex 4b9986a9ffd..f0b3716c2fb 100644--- a/app/views/augmented/_collapsible_section.html.erb+++ b/app/views/augmented/_collapsible_section.html.erb@@ -1,6 +1,8 @@-<opce-collapsible-section-augment initially-expanded="<%= initiallyExpanded %>"- section-title="<%= title %>">-</opce-collapsible-section-augment>-<div class="opce-collapsible-section-augment--body" hidden>- <%= capture(&block) %>-</div>+<%=+ render(Primer::OpenProject::CollapsibleSection.new(collapsed: !initiallyExpanded, display: :block, mb: 3)) do |section|+ section.with_title { title }+ section.with_collapsible_content do+ capture(&block)+ end+ end+%>diff --git a/app/views/enterprises/_form.html.erb b/app/views/enterprises/_form.html.erbindex 2da2486690f..6998e736711 100644--- a/app/views/enterprises/_form.html.erb+++ b/app/views/enterprises/_form.html.erb@@ -4,9 +4,7 @@<%= labelled_tabular_form_for @token,url: { action: :create },html: { class: 'token-form form -vertical' },- method: :post do |f|%>-- <div class="form--space"></div>+ method: :post do |f| %><%= f.text_area :encoded_token,value: nil,diff --git a/frontend/src/app/app.module.ts b/frontend/src/app/app.module.tsindex 78386494d49..87c56c76285 100644--- a/frontend/src/app/app.module.ts+++ b/frontend/src/app/app.module.ts@@ -192,9 +192,6 @@ import { NoResultsComponent } from 'core-app/shared/components/no-results/no-resimport {OpNonWorkingDaysListComponent,} from 'core-app/shared/components/op-non-working-days-list/op-non-working-days-list.component';-import {- CollapsibleSectionComponent,-} from 'core-app/shared/components/collapsible-section/collapsible-section.component';import { CopyToClipboardComponent } from 'core-app/shared/components/copy-to-clipboard/copy-to-clipboard.component';import { GlobalSearchTitleComponent } from 'core-app/core/global_search/title/global-search-title.component';import { ContentTabsComponent } from 'core-app/shared/components/tabs/content-tabs/content-tabs.component';@@ -457,7 +454,6 @@ export class OpenProjectModule implements DoBootstrap {registerCustomElement('opce-enterprise-base', EnterpriseBaseComponent, { injector });registerCustomElement('opce-no-results', NoResultsComponent, { injector });registerCustomElement('opce-non-working-days-list', OpNonWorkingDaysListComponent, { injector });- registerCustomElement('opce-collapsible-section-augment', CollapsibleSectionComponent, { injector });registerCustomElement('opce-main-menu-toggle', MainMenuToggleComponent, { injector });registerCustomElement('opce-main-menu-resizer', MainMenuResizerComponent, { injector });registerCustomElement('opce-copy-to-clipboard', CopyToClipboardComponent, { injector });diff --git a/frontend/src/app/shared/components/collapsible-section/collapsible-section.component.ts b/frontend/src/app/shared/components/collapsible-section/collapsible-section.component.tsdeleted file mode 100644index 7491a52a4ab..00000000000--- a/frontend/src/app/shared/components/collapsible-section/collapsible-section.component.ts+++ /dev/null@@ -1,62 +0,0 @@-//-- 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 { Component, ElementRef, OnInit, ViewChild } from '@angular/core';--@Component({- selector: 'opce-opce-collapsible-section-augment',- templateUrl: './collapsible-section.html',-})-export class CollapsibleSectionComponent implements OnInit {- public expanded = false;-- public sectionTitle:string;-- @ViewChild('sectionBody', { static: true }) public sectionBody:ElementRef;-- constructor(public elementRef:ElementRef) {- }-- ngOnInit():void {- const element:HTMLElement = this.elementRef.nativeElement;-- this.sectionTitle = element.getAttribute('section-title')!;- if (element.getAttribute('initially-expanded') === 'true') {- this.expanded = true;- }-- const target:HTMLElement = element.nextElementSibling as HTMLElement;- this.sectionBody.nativeElement.appendChild(target);- target.removeAttribute('hidden');- }-- public toggle(event:Event) {- this.expanded = !this.expanded;- event.preventDefault();- }-}diff --git a/frontend/src/app/shared/components/collapsible-section/collapsible-section.html b/frontend/src/app/shared/components/collapsible-section/collapsible-section.htmldeleted file mode 100644index a9c0b45b3e0..00000000000--- a/frontend/src/app/shared/components/collapsible-section/collapsible-section.html+++ /dev/null@@ -1,17 +0,0 @@-<section class="collapsible-section"- [ngClass]="{ '-expanded': expanded }">-- <button- class="collapsible-section--toggle-link"- (click)="toggle($event)"- >- <span class="collapsible-section--legend"- [textContent]="sectionTitle">- </span>- </button>- <div class="collapsible-section--body toggle-slide-animation"- #sectionBody- [hidden]="!expanded">- <!-- Wrapped by component -->- </div>-</section>diff --git a/frontend/src/app/shared/shared.module.ts b/frontend/src/app/shared/shared.module.tsindex b4664769fa7..a3bc9b9eda5 100644--- a/frontend/src/app/shared/shared.module.ts+++ b/frontend/src/app/shared/shared.module.ts@@ -68,7 +68,6 @@ import { ToastComponent } from './components/toaster/toast.component';import { ToastsContainerComponent } from './components/toaster/toasts-container.component';import { UploadProgressComponent } from './components/toaster/upload-progress.component';import { ResizerComponent } from './components/resizer/resizer.component';-import { CollapsibleSectionComponent } from './components/collapsible-section/collapsible-section.component';import { NoResultsComponent } from './components/no-results/no-results.component';import { EditableToolbarTitleComponent } from './components/editable-toolbar-title/editable-toolbar-title.component';import { PersistentToggleComponent } from './components/persistent-toggle/persistent-toggle.component';@@ -200,7 +199,6 @@ export function bootstrapModule(injector:Injector):void {// Add functionality to rails rendered templatesCopyToClipboardComponent,- CollapsibleSectionComponent,ResizerComponent,diff --git a/frontend/src/global_styles/content/_collapsible_section.sass b/frontend/src/global_styles/content/_collapsible_section.sassdeleted file mode 100644index 3f58bfcee78..00000000000--- a/frontend/src/global_styles/content/_collapsible_section.sass+++ /dev/null@@ -1,31 +0,0 @@-.collapsible-section- margin: 2rem 0--.collapsible-section--legend- &:before- @include icon-mixin-arrow-down1- @include icon-common- font-size: 0.75rem- padding: 0.625rem 0.25rem 0 0.25rem-- .collapsible-section.-expanded &- @include icon-mixin-arrow-up1--.collapsible-section--toggle-link- @include without-link-styling- background: none- border: none- width: 100%- text-align: left- display: block- cursor: pointer- color: var(--body-font-color)- font-size: var(--body-font-size)- font-weight: var(--base-text-weight-bold)- line-height: 1.8- text-transform: uppercase- border-bottom: 1px solid var(--gray)-- &:hover, &:focus- color: var(--body-font-color)- text-decoration: nonediff --git a/frontend/src/global_styles/content/_index.sass b/frontend/src/global_styles/content/_index.sassindex 78e2d636c3a..9dc1ced64e8 100644--- a/frontend/src/global_styles/content/_index.sass+++ b/frontend/src/global_styles/content/_index.sass@@ -9,7 +9,6 @@@import forms@import forms_mobile@import comments-@import collapsible_section@import copy_to_clipboard@import custom_logo@import toastdiff --git a/frontend/src/global_styles/content/modules/_documents.sass b/frontend/src/global_styles/content/modules/_documents.sassindex 472104d5f5c..c926e85db8d 100644--- a/frontend/src/global_styles/content/modules/_documents.sass+++ b/frontend/src/global_styles/content/modules/_documents.sass@@ -23,9 +23,6 @@ dt.document:before.sidebar--document-sort label:last-of-typemargin-bottom: 2rem-.document-category--inner-section- padding-top: 20px-.document-category-elementsdisplay: inline@@ -37,4 +34,3 @@ dt.document:before.document-category-elements .wikimargin-bottom: 2rem-diff --git a/lookbook/previews/open_project/deprecated/collapsible_section_preview/default.html.erb b/lookbook/previews/open_project/deprecated/collapsible_section_preview/default.html.erbdeleted file mode 100644index 79186a66d13..00000000000--- a/lookbook/previews/open_project/deprecated/collapsible_section_preview/default.html.erb+++ /dev/null@@ -1,13 +0,0 @@-<opce-collapsible-section-augment initially-expanded="true"- section-title="My section title">--</opce-collapsible-section-augment>-<div class="opce-collapsible-section-augment--body" hidden>- <p><strong>Initially expanded</strong></p>-</div>--<opce-collapsible-section-augment section-title="My closed section title">-</opce-collapsible-section-augment>-<div class="opce-collapsible-section-augment--body" hidden>- <p><strong>Initially closed</strong></p>-</div>diff --git a/modules/documents/app/views/documents/index.html.erb b/modules/documents/app/views/documents/index.html.erbindex e8b1f530a1f..06ddb7df9f2 100644--- a/modules/documents/app/views/documents/index.html.erb+++ b/modules/documents/app/views/documents/index.html.erb@@ -59,7 +59,7 @@ See COPYRIGHT and LICENSE files for more details.<% end %><% @grouped.keys.sort.each do |group| %>- <%= augmented_collapsible_section title: group do %>+ <%= augmented_collapsible_section(title: group.name) do %><div class="document-category--inner-section"><div class="form--field document-category-elements"><%= render partial: "documents/document", collection: @grouped[group] %>