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

[44481]Expandable Enterprise Edition banners (#11503)

Behrokh Satarnejad8d9f2ec5bff3
diff --git a/app/views/admin/settings/projects_settings/show.html.erb b/app/views/admin/settings/projects_settings/show.html.erb
index 225d86e3403..f6e65933788 100644
--- a/app/views/admin/settings/projects_settings/show.html.erb
+++ b/app/views/admin/settings/projects_settings/show.html.erb
@@ -61,6 +61,7 @@ See COPYRIGHT and LICENSE files for more details.
angular_component_tag 'op-enterprise-banner',
inputs: {
textMessage: t('text_project_custom_field_html'),
+ collapsible: true,
moreInfoLink: OpenProject::Static::Links.links[:enterprise_docs][:custom_field_projects][:href],
}
%>
diff --git a/app/views/admin/settings/work_packages_settings/_enterprise_feature_hint.html.erb b/app/views/admin/settings/work_packages_settings/_enterprise_feature_hint.html.erb
index 846a408143b..88daaf17848 100644
--- a/app/views/admin/settings/work_packages_settings/_enterprise_feature_hint.html.erb
+++ b/app/views/admin/settings/work_packages_settings/_enterprise_feature_hint.html.erb
@@ -3,6 +3,7 @@
<%=
angular_component_tag 'op-enterprise-banner',
inputs: {
+ collapsible: true,
textMessage: explanation,
moreInfoLink: OpenProject::Static::Links.links[:enterprise_docs][:attribute_highlighting][:href],
}
diff --git a/app/views/custom_fields/_form.html.erb b/app/views/custom_fields/_form.html.erb
index c52a5fb523b..f29b5c72864 100644
--- a/app/views/custom_fields/_form.html.erb
+++ b/app/views/custom_fields/_form.html.erb
@@ -74,6 +74,7 @@ See COPYRIGHT and LICENSE files for more details.
<div class="form--field-instructions -no-italic -xwide">
<%= angular_component_tag 'op-enterprise-banner',
inputs: {
+ collapsible: true,
textMessage: t('text_wp_custom_field_html'),
moreInfoLink: OpenProject::Static::Links.links[:enterprise_docs][:custom_field_multiselect][:href],
}
diff --git a/app/views/custom_fields/_tab.html.erb b/app/views/custom_fields/_tab.html.erb
index be650df316a..95b8334ae7b 100644
--- a/app/views/custom_fields/_tab.html.erb
+++ b/app/views/custom_fields/_tab.html.erb
@@ -32,6 +32,7 @@ See COPYRIGHT and LICENSE files for more details.
<%=
angular_component_tag 'op-enterprise-banner',
inputs: {
+ collapsible: true,
textMessage: t('text_project_custom_field_html'),
moreInfoLink: OpenProject::Static::Links.links[:enterprise_docs][:custom_field_projects][:href],
}
@@ -44,6 +45,7 @@ See COPYRIGHT and LICENSE files for more details.
<%=
angular_component_tag 'op-enterprise-banner',
inputs: {
+ collapsible: true,
textMessage: t('text_wp_custom_field_html'),
moreInfoLink: OpenProject::Static::Links.links[:enterprise_docs][:custom_field_multiselect][:href],
}
diff --git a/app/views/projects/filters/_form.html.erb b/app/views/projects/filters/_form.html.erb
index e0d5d044a48..0f80c2110a7 100644
--- a/app/views/projects/filters/_form.html.erb
+++ b/app/views/projects/filters/_form.html.erb
@@ -87,6 +87,7 @@
<%=
angular_component_tag 'op-enterprise-banner',
inputs: {
+ collapsible: true,
textMessage: t('ee.upsale.project_filters.description_html'),
moreInfoLink: OpenProject::Static::Links.links[:enterprise_docs][:custom_field_projects][:href],
}
diff --git a/app/views/statuses/_form.html.erb b/app/views/statuses/_form.html.erb
index 2bfad689cea..e1a8d14de87 100644
--- a/app/views/statuses/_form.html.erb
+++ b/app/views/statuses/_form.html.erb
@@ -51,6 +51,7 @@ See COPYRIGHT and LICENSE files for more details.
<%=
angular_component_tag 'op-enterprise-banner',
inputs: {
+ collapsible: true,
textMessage: t('text_wp_status_read_only_html'),
moreInfoLink: OpenProject::Static::Links.links[:enterprise_docs][:status_read_only][:href],
}
diff --git a/app/views/types/form/_form_configuration.html.erb b/app/views/types/form/_form_configuration.html.erb
index 100af85b221..352daa4b99d 100644
--- a/app/views/types/form/_form_configuration.html.erb
+++ b/app/views/types/form/_form_configuration.html.erb
@@ -41,6 +41,7 @@ See COPYRIGHT and LICENSE files for more details.
%>
<%= angular_component_tag 'op-enterprise-banner',
inputs: {
+ collapsible: true,
opReferrer: 'form-configuration',
textMessage: t('types.edit.more_info_text_html'),
moreInfoLink: OpenProject::Static::Links.links[:enterprise_docs][:form_configuration][:href],
diff --git a/frontend/src/app/shared/components/enterprise-banner/enterprise-banner.component.html b/frontend/src/app/shared/components/enterprise-banner/enterprise-banner.component.html
index df8ffea6029..37f1651e608 100644
--- a/frontend/src/app/shared/components/enterprise-banner/enterprise-banner.component.html
+++ b/frontend/src/app/shared/components/enterprise-banner/enterprise-banner.component.html
@@ -7,25 +7,36 @@
<img [src]="image.enterprise_edition" class="hidden-for-mobile op-enterprise-banner--image">
<div class="op-toast--content">
- <div class="op-enterprise-banner--title">
- <op-icon icon-classes="button--icon icon-medal"></op-icon> &nbsp;
- <span [textContent]="text.enterpriseFeature"></span>
+ <div class="op-enterprise-banner--header">
+ <span class="spot-icon spot-icon_medal"></span>
+ <span [textContent]="text.enterpriseFeature" class="op-enterprise-banner--title"></span>
+ <button
+ *ngIf="collapsible"
+ class="op-enterprise-banner--collapsible-button"
+ type="button"
+ (click)="toggleCollapse()"
+ >
+ <span class="spot-icon"
+ [ngClass]="collapsed ? 'spot-icon_arrow-down1' : 'spot-icon_arrow-up1'"
+ aria-hidden="true">
+ </span>
+ </button>
</div>
<br>
<span class="op-enterprise-banner--description" [innerHtml]="textMessage"></span>
- <span class="op-enterprise-banner--description">
+ <span class="op-enterprise-banner--description" *ngIf="!collapsed">
<strong [textContent]="text.become_hero"></strong> {{text.you_contribute}}
</span>
- <div class="op-enterprise-banner--buttons">
+ <div class="op-enterprise-banner--buttons" *ngIf="!collapsed">
<a
*ngIf="moreInfoLink"
[attr.href]="moreInfoLink"
- class="button--link op-enterprise-banner--info-button"
+ class="op-enterprise-banner--info-button"
target=”_blank”>
- <op-icon icon-classes="icon icon-external-link"></op-icon>
+ <span class="spot-icon spot-icon_external-link"></span>
{{ text.more_info_text }}
</a>
@@ -33,7 +44,7 @@
[href]="pricingUrl"
target=”_blank”
class="button -highlight">
- <op-icon icon-classes="button--icon icon-medal"></op-icon>
+ <span class="spot-icon spot-icon_medal"></span>
{{ text.upgrade }}
</a>
diff --git a/frontend/src/app/shared/components/enterprise-banner/enterprise-banner.component.sass b/frontend/src/app/shared/components/enterprise-banner/enterprise-banner.component.sass
index 3c8e5a51bff..26702dd8bd8 100644
--- a/frontend/src/app/shared/components/enterprise-banner/enterprise-banner.component.sass
+++ b/frontend/src/app/shared/components/enterprise-banner/enterprise-banner.component.sass
@@ -2,17 +2,21 @@
.op-enterprise-banner
- &--title
- font-weight: 400
+ &--header
font-size: 20px
line-height: 24px
- display: flex
+ display: grid
+ grid-template-columns: auto auto 1fr
margin-top: 10px
+ align-items: center
+
+ &--title
+ margin-left: $spot-spacing-0_5
&--description
display: block
@include spot-body-small
- margin-bottom: $spot-spacing-0-75
+ margin-bottom: $spot-spacing-0_75
&--image
width: 115px
@@ -25,5 +29,17 @@
justify-content: end
&--info-button
- padding-top: 1rem
- padding-right: 1.5rem
+ padding-top: $spot-spacing-1_25
+ padding-right: $spot-spacing-1_5
+
+ .spot-icon:before
+ padding-right: 0.875rem
+
+ &--collapsible-button
+ background: transparent
+ color: $spot-color-main
+ border: 0
+ padding: $spot-spacing-0_5 $spot-spacing-0_5
+ cursor: pointer
+ display: flex
+ justify-content: end
diff --git a/frontend/src/app/shared/components/enterprise-banner/enterprise-banner.component.ts b/frontend/src/app/shared/components/enterprise-banner/enterprise-banner.component.ts
index b9587d44d26..8566eeb0538 100644
--- a/frontend/src/app/shared/components/enterprise-banner/enterprise-banner.component.ts
+++ b/frontend/src/app/shared/components/enterprise-banner/enterprise-banner.component.ts
@@ -33,6 +33,10 @@ export class EnterpriseBannerComponent implements OnInit {
@Input() public moreInfoLink:string;
+ @Input() public collapsible:boolean;
+
+ public collapsed = false;
+
link:string;
pricingUrl = pricingUrl;
@@ -64,5 +68,10 @@ export class EnterpriseBannerComponent implements OnInit {
ngOnInit():void {
this.link = this.bannersService.getEnterPriseEditionUrl({ referrer: this.opReferrer });
+ this.collapsed = this.collapsible;
+ }
+
+ toggleCollapse():void {
+ this.collapsed = !this.collapsed;
}
}