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

[49409] Display modal when clicking excluded info icon

Christophe Bliard4b92af5661f0
diff --git a/frontend/src/app/app.module.ts b/frontend/src/app/app.module.ts
index 31994a02083..977203c614b 100644
--- a/frontend/src/app/app.module.ts
+++ b/frontend/src/app/app.module.ts
@@ -151,6 +151,9 @@ import {
import {
AttributeHelpTextComponent,
} from 'core-app/shared/components/attribute-help-texts/attribute-help-text.component';
+import {
+ OpExclusionInfoComponent,
+} from 'core-app/shared/components/fields/display/info/op-exclusion-info.component';
export function initializeServices(injector:Injector) {
return () => {
@@ -334,5 +337,6 @@ export class OpenProjectModule {
registerCustomElement('opce-ckeditor-augmented-textarea', CkeditorAugmentedTextareaComponent, { injector });
registerCustomElement('opce-draggable-autocompleter', DraggableAutocompleteComponent, { injector });
registerCustomElement('opce-attribute-help-text', AttributeHelpTextComponent, { injector });
+ registerCustomElement('opce-exclusion-info', OpExclusionInfoComponent, { injector });
}
}
diff --git a/frontend/src/app/shared/components/fields/display/field-types/excluded-icon-helper.service.ts b/frontend/src/app/shared/components/fields/display/field-types/excluded-icon-helper.service.ts
index a2202934023..84c818c3577 100644
--- a/frontend/src/app/shared/components/fields/display/field-types/excluded-icon-helper.service.ts
+++ b/frontend/src/app/shared/components/fields/display/field-types/excluded-icon-helper.service.ts
@@ -51,14 +51,7 @@ export class ExcludedIconHelperService {
}
public addExcludedInfoIcon(element:HTMLElement):void {
- // This should work, but does not work when adding it through javascript
- // <svg
- // info-icon
- // class="button--icon"
- // size="small"
- // ></svg>
- const icon = document.createElement('i');
- icon.classList.add('icon-info1', 'excluded-from-totals');
- element.appendChild(icon);
+ const infoIcon = document.createElement('opce-exclusion-info');
+ element.appendChild(infoIcon);
}
}
diff --git a/frontend/src/app/shared/components/fields/display/info/op-exclusion-info.component.html b/frontend/src/app/shared/components/fields/display/info/op-exclusion-info.component.html
new file mode 100644
index 00000000000..d2c17c901a8
--- /dev/null
+++ b/frontend/src/app/shared/components/fields/display/info/op-exclusion-info.component.html
@@ -0,0 +1,34 @@
+<spot-drop-modal
+ [opened]="opened"
+ (closed)="opened = false"
+ class="op-exclusion-info"
+ alignment="bottom-end"
+>
+ <svg
+ slot="trigger"
+ info-icon
+ class="button--icon op-exclusion-info--icon"
+ size="small"
+ (click)="toggleOpen($event)"
+ ></svg>
+
+ <ng-container slot="body">
+ <div class="op-exclusion-info--modal">
+ <div class="op-exclusion-info--modal-header">
+ Status excluded from hierarchy totals
+ </div>
+ <div class="op-exclusion-info--modal-content">
+ The status 'Rejected (TODO: replace me)' has been configured to be excluded from hierarchy
+ totals of Work, Remaining work, and %&nbsp;Complete. The totals do not take
+ this value into account.
+ </div>
+ <div class="op-exclusion-info--modal-buttons">
+ <button
+ (click)="toggleOpen($event)"
+ class="button">
+ Close
+ </button>
+ </div>
+ </div>
+ </ng-container>
+</spot-drop-modal>
diff --git a/frontend/src/app/shared/components/fields/display/info/op-exclusion-info.component.sass b/frontend/src/app/shared/components/fields/display/info/op-exclusion-info.component.sass
new file mode 100644
index 00000000000..424f9942258
--- /dev/null
+++ b/frontend/src/app/shared/components/fields/display/info/op-exclusion-info.component.sass
@@ -0,0 +1,39 @@
+@import "../../global_styles/openproject/variables"
+
+.op-exclusion-info
+ display: inline-block
+
+ &--icon
+ margin-left: 0.25rem
+ cursor: pointer
+ color: var(--fgColor-muted)
+ &:hover
+ color: var(--fgColor-default)
+
+ @media screen and (min-width: $breakpoint-lg)
+ &--modal
+ width: 200px
+
+ &--modal
+ color: var(--fgColor-default)
+ display: flex
+ flex-direction: column
+ font-family: var(--body-font-family)
+ gap: 1rem
+ margin: 1.5rem
+
+ &-header
+ font-size: 14px
+ line-height: 20px
+ font-weight: 600
+
+ &-content
+ font-size: 14px
+ line-height: 20px
+
+ &-buttons
+ display: flex
+ flex-direction: row
+
+ & button
+ margin: 0
diff --git a/frontend/src/app/shared/components/fields/display/info/op-exclusion-info.component.ts b/frontend/src/app/shared/components/fields/display/info/op-exclusion-info.component.ts
new file mode 100644
index 00000000000..03a39dcacfc
--- /dev/null
+++ b/frontend/src/app/shared/components/fields/display/info/op-exclusion-info.component.ts
@@ -0,0 +1,54 @@
+/*
+ * -- copyright
+ * OpenProject is an open source project management software.
+ * Copyright (C) 2010-2024 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 { I18nService } from 'core-app/core/i18n/i18n.service';
+
+@Component({
+ selector: 'op-exclusion-info',
+ templateUrl: './op-exclusion-info.component.html',
+ styleUrls: ['./op-exclusion-info.component.sass'],
+ changeDetection: ChangeDetectionStrategy.OnPush,
+})
+export class OpExclusionInfoComponent {
+ public opened = false;
+
+ constructor(
+ readonly I18n:I18nService,
+ ) {}
+
+ public toggleOpen(event:Event):void {
+ event.stopPropagation();
+ this.opened = !this.opened;
+ }
+}
diff --git a/frontend/src/app/shared/components/fields/openproject-fields.module.ts b/frontend/src/app/shared/components/fields/openproject-fields.module.ts
index c03fd9f1c1b..bf36f72d8af 100644
--- a/frontend/src/app/shared/components/fields/openproject-fields.module.ts
+++ b/frontend/src/app/shared/components/fields/openproject-fields.module.ts
@@ -99,6 +99,7 @@ import {
HoursDurationEditFieldComponent,
} from 'core-app/shared/components/fields/edit/field-types/hours-duration-edit-field.component';
import { ProgressPopoverEditFieldComponent } from 'core-app/shared/components/fields/edit/field-types/progress-popover-edit-field.component';
+import { OpExclusionInfoComponent } from 'core-app/shared/components/fields/display/info/op-exclusion-info.component';
import { UserEditFieldComponent } from './edit/field-types/user-edit-field.component';
import {
DaysDurationEditFieldComponent,
@@ -152,6 +153,7 @@ import { FormsModule } from '@angular/forms';
EditFormPortalComponent,
HoursDurationEditFieldComponent,
ProgressPopoverEditFieldComponent,
+ OpExclusionInfoComponent,
DaysDurationEditFieldComponent,
FloatEditFieldComponent,
PlainFormattableEditFieldComponent,
diff --git a/frontend/src/global_styles/content/work_packages/inplace_editing/_display_fields.sass b/frontend/src/global_styles/content/work_packages/inplace_editing/_display_fields.sass
index 03a2802913f..9885543e203 100644
--- a/frontend/src/global_styles/content/work_packages/inplace_editing/_display_fields.sass
+++ b/frontend/src/global_styles/content/work_packages/inplace_editing/_display_fields.sass
@@ -100,12 +100,6 @@ display-field
.-actual-value
@include wp-table--actual-time-values
- .excluded-from-totals
- padding-left: 0.25rem
- color: var(--fgColor-muted)
- &:hover
- color: var(--fgColor-default)
-
.-separator
display: inline-block
width: 1rem