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

Hide enterprise banner frame if has enterprise edition

Christophe Bliard8d4adcfcb22a
diff --git a/frontend/src/app/features/boards/board/board-partitioned-page/board-list-container.component.html b/frontend/src/app/features/boards/board/board-partitioned-page/board-list-container.component.html
index dd47639caf2..7e2806ea85f 100644
--- a/frontend/src/app/features/boards/board/board-partitioned-page/board-list-container.component.html
+++ b/frontend/src/app/features/boards/board/board-partitioned-page/board-list-container.component.html
@@ -1,6 +1,6 @@
<ng-container *ngIf="(board$ | async) as board">
<div
- *ngIf="!needEnterpriseEdition"
+ *ngIf="!needEnterpriseEdition; else enterpriseBanner"
class="boards-list--container"
[ngClass]="{ '-free' : board.isFree }"
#container
@@ -38,9 +38,12 @@
</div>
</div>
</div>
- <op-enterprise-banner-frame
- class="boards-list--enterprise-banner"
- feature="board_view"
- [dismissable]="true"
- ></op-enterprise-banner-frame>
+
+ <ng-template #enterpriseBanner>
+ <op-enterprise-banner-frame
+ class="boards-list--enterprise-banner"
+ feature="board_view"
+ [dismissable]="true"
+ ></op-enterprise-banner-frame>
+ </ng-template>
</ng-container>
diff --git a/spec/support/matchers/has_enterprise_banner.rb b/spec/support/matchers/has_enterprise_banner.rb
index fc0ef4fc8f2..12355020318 100644
--- a/spec/support/matchers/has_enterprise_banner.rb
+++ b/spec/support/matchers/has_enterprise_banner.rb
@@ -46,15 +46,17 @@ RSpec::Matchers.define :have_enterprise_banner do |**args|
failure_message do
<<~MESSAGE
- Expected page to have Enterprise edition banner, but it does not:
- #{@error}
+ Expected page to have Enterprise banner, but it is absent or invisible.
MESSAGE
end
failure_message_when_negated do
+ puts Capybara::Screenshot.screenshot_and_save_page
+ banner_text = page.find(test_selector("op-enterprise-banner")).text
<<~MESSAGE
- Expected page not to have Enterprise edition banner, but it does:
- #{@error}
+ Expected page not to have Enterprise banner, but it is present and visible.
+ Enterprise banner text:
+ #{banner_text.gsub("\n", "\n ")}
MESSAGE
end
end