Commit 42fc5a9f authored by Felipe Artur's avatar Felipe Artur

Hide health status when feature is not available

Hide health status from sidebar when feature is not available
parent d8729627
......@@ -129,7 +129,7 @@
= render_if_exists 'shared/issuable/sidebar_weight', issuable_sidebar: issuable_sidebar
- if Feature.enabled?(:save_issuable_health_status, @project.group) && issuable_sidebar[:type] == "issue"
- if issuable_sidebar.dig(:features_available, :health_status)
.js-sidebar-status-entry-point
- if issuable_sidebar.has_key?(:confidential)
......
......@@ -85,7 +85,7 @@ export default {
</script>
<template>
<div class="block">
<div class="block health-status">
<div ref="status" class="sidebar-collapsed-icon">
<gl-icon name="status-health" :size="14" />
......
......@@ -8,6 +8,8 @@ module EE
expose :supports_epic?, as: :supports_epic
expose :features_available do
expose :supports_health_status?, as: :health_status
expose :issue_weights do |issuable|
issuable.project.feature_available?(:issue_weights)
end
......
......@@ -76,6 +76,43 @@ describe 'Issue Sidebar' do
end
end
context 'health status', :js do
before do
project.add_developer(user)
end
context 'when health status feature is available' do
it 'shows health status on sidebar' do
stub_licensed_features(issuable_health_status: true)
visit_issue(project, issue)
expect(page).to have_selector('.block.health-status')
end
end
context 'when health status feature is not available' do
it 'does not show health status on sidebar' do
stub_licensed_features(issuable_health_status: false)
visit_issue(project, issue)
expect(page).not_to have_selector('.block.health-status')
end
end
context 'when health status feature flag is disabled' do
it 'does not show health status on sidebar' do
stub_licensed_features(issuable_health_status: true)
stub_feature_flags(save_issuable_health_status: false)
visit_issue(project, issue)
expect(page).not_to have_selector('.block.health-status')
end
end
end
def visit_issue(project, issue)
visit project_issue_path(project, issue)
end
......
......@@ -7,6 +7,7 @@
"features_available": {
"type": "object",
"properties": {
"health_status": { "type": "boolean" },
"issue_weights": { "type": "boolean" },
"epics": { "type": ["null", "boolean"] }
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment