fix: use correct config flag on UI for incidents

Earlier, the UI code was using `service_graph_enabled`
to show (or hide) the incidents screen, this was wrong.

Now `incidents_enabled` is used and sent by the backend
as part of `/config` API call.
This commit is contained in:
ByteBaker
2026-01-28 22:13:30 +05:30
parent 52c727909e
commit f0ccfbe396
2 changed files with 8 additions and 10 deletions
+7 -9
View File
@@ -158,19 +158,11 @@ struct ConfigResponse<'a> {
log_page_default_field_list: String,
query_values_default_num: i64,
mysql_deprecated_warning: bool,
#[cfg(feature = "enterprise")]
service_graph_enabled: bool,
#[cfg(not(feature = "enterprise"))]
service_graph_enabled: bool,
#[cfg(feature = "enterprise")]
service_streams_enabled: bool,
#[cfg(not(feature = "enterprise"))]
incidents_enabled: bool,
service_streams_enabled: bool,
/// Available FQN priority dimensions from O2_FQN_PRIORITY_DIMENSIONS env var
/// Used by UI to populate the FQN priority dimension selector
#[cfg(feature = "enterprise")]
fqn_priority_dimensions: Vec<String>,
#[cfg(not(feature = "enterprise"))]
fqn_priority_dimensions: Vec<String>,
}
@@ -344,6 +336,11 @@ pub async fn zo_config() -> impl IntoResponse {
#[cfg(not(feature = "enterprise"))]
let service_graph_enabled = false;
#[cfg(feature = "enterprise")]
let incidents_enabled = o2cfg.incidents.enabled;
#[cfg(not(feature = "enterprise"))]
let incidents_enabled = false;
#[cfg(feature = "enterprise")]
let service_streams_enabled = o2cfg.service_streams.enabled;
#[cfg(not(feature = "enterprise"))]
@@ -455,6 +452,7 @@ pub async fn zo_config() -> impl IntoResponse {
query_values_default_num: cfg.limit.query_values_default_num,
mysql_deprecated_warning: cfg.common.meta_store.starts_with("mysql"),
service_graph_enabled,
incidents_enabled,
service_streams_enabled,
#[cfg(feature = "enterprise")]
fqn_priority_dimensions: o2_enterprise::enterprise::common::config::get_config()
+1 -1
View File
@@ -361,7 +361,7 @@ export default defineComponent({
const isIncidentsEnabled = computed(() => {
return (
(config.isEnterprise == "true" || config.isCloud == "true") &&
store.state.zoConfig.service_graph_enabled
store.state.zoConfig.incidents_enabled
);
});