Notification history: Enable by default (#49502)
* remove persistNotifications feature flag * remove unused imports
This commit is contained in:
@@ -51,7 +51,6 @@ export interface FeatureToggles {
|
||||
azureMonitorResourcePickerForMetrics?: boolean;
|
||||
explore2Dashboard?: boolean;
|
||||
tracing?: boolean;
|
||||
persistNotifications?: boolean;
|
||||
commandPalette?: boolean;
|
||||
savedItems?: boolean;
|
||||
cloudWatchDynamicLabels?: boolean;
|
||||
|
||||
+3
-5
@@ -40,11 +40,9 @@ func (hs *HTTPServer) getProfileNode(c *models.ReqContext) *dtos.NavLink {
|
||||
},
|
||||
}
|
||||
|
||||
if hs.Features.IsEnabled(featuremgmt.FlagPersistNotifications) {
|
||||
children = append(children, &dtos.NavLink{
|
||||
Text: "Notification history", Id: "notifications", Url: hs.Cfg.AppSubURL + "/notifications", Icon: "bell",
|
||||
})
|
||||
}
|
||||
children = append(children, &dtos.NavLink{
|
||||
Text: "Notification history", Id: "notifications", Url: hs.Cfg.AppSubURL + "/notifications", Icon: "bell",
|
||||
})
|
||||
|
||||
if setting.AddChangePasswordLink() {
|
||||
children = append(children, &dtos.NavLink{
|
||||
|
||||
@@ -199,12 +199,6 @@ var (
|
||||
State: FeatureStateAlpha,
|
||||
FrontendOnly: true,
|
||||
},
|
||||
{
|
||||
Name: "persistNotifications",
|
||||
Description: "PoC Notifications page",
|
||||
State: FeatureStateAlpha,
|
||||
FrontendOnly: true,
|
||||
},
|
||||
{
|
||||
Name: "commandPalette",
|
||||
Description: "Enable command palette",
|
||||
|
||||
@@ -147,10 +147,6 @@ const (
|
||||
// Adds trace ID to error notifications
|
||||
FlagTracing = "tracing"
|
||||
|
||||
// FlagPersistNotifications
|
||||
// PoC Notifications page
|
||||
FlagPersistNotifications = "persistNotifications"
|
||||
|
||||
// FlagCommandPalette
|
||||
// Enable command palette
|
||||
FlagCommandPalette = "commandPalette"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
|
||||
|
||||
import { config } from '@grafana/runtime';
|
||||
import { AppNotification, AppNotificationSeverity, AppNotificationsState } from 'app/types/';
|
||||
|
||||
const MAX_STORED_NOTIFICATIONS = 25;
|
||||
@@ -88,10 +87,6 @@ function isStoredNotification(obj: any): obj is StoredNotification {
|
||||
// (De)serialization
|
||||
|
||||
export function deserializeNotifications(): Record<string, StoredNotification> {
|
||||
if (!config.featureToggles?.persistNotifications) {
|
||||
return {};
|
||||
}
|
||||
|
||||
const storedNotifsRaw = window.localStorage.getItem(STORAGE_KEY);
|
||||
if (!storedNotifsRaw) {
|
||||
return {};
|
||||
@@ -106,10 +101,6 @@ export function deserializeNotifications(): Record<string, StoredNotification> {
|
||||
}
|
||||
|
||||
function serializeNotifications(notifs: Record<string, StoredNotification>) {
|
||||
if (!config.featureToggles?.persistNotifications) {
|
||||
return;
|
||||
}
|
||||
|
||||
const reducedNotifs = Object.values(notifs)
|
||||
.filter(isAtLeastWarning)
|
||||
.sort((a, b) => b.timestamp - a.timestamp)
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import React from 'react';
|
||||
import { connect, ConnectedProps } from 'react-redux';
|
||||
|
||||
import { config } from '@grafana/runtime';
|
||||
|
||||
import Page from '../../core/components/Page/Page';
|
||||
import { GrafanaRouteComponentProps } from '../../core/navigation/types';
|
||||
import { getNavModel } from '../../core/selectors/navModel';
|
||||
@@ -21,10 +19,6 @@ interface OwnProps extends GrafanaRouteComponentProps {}
|
||||
type Props = OwnProps & ConnectedProps<typeof connector>;
|
||||
|
||||
export const NotificationsPage = ({ navModel }: Props) => {
|
||||
if (!config.featureToggles.persistNotifications) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Page navModel={navModel}>
|
||||
<Page.Contents>
|
||||
|
||||
Reference in New Issue
Block a user