mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[APM][ECO] Hide feedback modal/remove search bar (#189526)
closes https://github.com/elastic/kibana/issues/189385 - [x] Don't show the feedback modal after it has been dismissed. https://github.com/user-attachments/assets/894430cf-cc3b-407d-8ff6-50a189d31f4b closes https://github.com/elastic/kibana/issues/189364 - [x] Remove the KQL bar for log-only services. <img width="1555" alt="Screenshot 2024-07-30 at 15 49 49" src="https://github.com/user-attachments/assets/deec8956-1e8a-4517-aa5c-ea3f3225f2e6"> - [x] Remove icon from the breadcrumb, it was breaking the page title. <img width="1402" alt="Screenshot 2024-07-30 at 16 35 58" src="https://github.com/user-attachments/assets/360ec82b-aef5-463c-9673-54a6c70ee2c0">
This commit is contained in:
parent
f78b262faf
commit
305d7f4586
4 changed files with 20 additions and 13 deletions
|
@ -19,6 +19,7 @@ import { ServiceDashboards } from '../../../app/service_dashboards';
|
|||
import { ServiceLogs } from '../../../app/service_logs';
|
||||
import { LogsServiceOverview } from '../../../app/entities/logs/logs_service_overview';
|
||||
import { RedirectToDefaultLogsServiceRouteView } from '../../service_detail/redirect_to_default_service_route_view';
|
||||
import { SearchBar } from '../../../shared/search_bar/search_bar';
|
||||
|
||||
export function page({
|
||||
title,
|
||||
|
@ -29,13 +30,7 @@ export function page({
|
|||
title: string;
|
||||
tabKey: React.ComponentProps<typeof LogsServiceTemplate>['selectedTabKey'];
|
||||
element: React.ReactElement<any, any>;
|
||||
searchBarOptions?: {
|
||||
showUnifiedSearchBar?: boolean;
|
||||
showTransactionTypeSelector?: boolean;
|
||||
showTimeComparison?: boolean;
|
||||
showMobileFilters?: boolean;
|
||||
hidden?: boolean;
|
||||
};
|
||||
searchBarOptions?: React.ComponentProps<typeof SearchBar>;
|
||||
}): {
|
||||
element: React.ReactElement<any, any>;
|
||||
} {
|
||||
|
@ -101,6 +96,7 @@ export const logsServiceDetailsRoute = {
|
|||
}),
|
||||
searchBarOptions: {
|
||||
showUnifiedSearchBar: true,
|
||||
showQueryInput: false,
|
||||
},
|
||||
}),
|
||||
params: t.partial({
|
||||
|
|
|
@ -15,7 +15,6 @@ import { ServiceAnomalyTimeseriesContextProvider } from '../../../../../context/
|
|||
import { useApmParams } from '../../../../../hooks/use_apm_params';
|
||||
import { useApmRouter } from '../../../../../hooks/use_apm_router';
|
||||
import { useTimeRange } from '../../../../../hooks/use_time_range';
|
||||
import { MobileSearchBar } from '../../../../app/mobile/search_bar';
|
||||
import { SearchBar } from '../../../../shared/search_bar/search_bar';
|
||||
import { ServiceIcons } from '../../../../shared/service_icons';
|
||||
import { TechnicalPreviewBadge } from '../../../../shared/technical_preview_badge';
|
||||
|
@ -30,7 +29,7 @@ interface Props {
|
|||
title: string;
|
||||
children: React.ReactChild;
|
||||
selectedTabKey: Tab['key'];
|
||||
searchBarOptions?: React.ComponentProps<typeof MobileSearchBar>;
|
||||
searchBarOptions?: React.ComponentProps<typeof SearchBar>;
|
||||
}
|
||||
|
||||
export function LogsServiceTemplate(props: Props) {
|
||||
|
|
|
@ -101,7 +101,7 @@ export function ServiceGroupTemplate({
|
|||
]
|
||||
: []),
|
||||
{
|
||||
title: selectedTab.label,
|
||||
title: selectedTab.breadcrumbLabel || selectedTab.label,
|
||||
href: selectedTab.href,
|
||||
} as { title: string; href: string },
|
||||
]
|
||||
|
@ -147,6 +147,7 @@ export function ServiceGroupTemplate({
|
|||
|
||||
type ServiceGroupContextTab = NonNullable<EuiPageHeaderProps['tabs']>[0] & {
|
||||
key: 'service-inventory' | 'service-map';
|
||||
breadcrumbLabel?: string;
|
||||
};
|
||||
|
||||
function useTabs(selectedTab: ServiceGroupContextTab['key']) {
|
||||
|
@ -157,6 +158,9 @@ function useTabs(selectedTab: ServiceGroupContextTab['key']) {
|
|||
const tabs: ServiceGroupContextTab[] = [
|
||||
{
|
||||
key: 'service-inventory',
|
||||
breadcrumbLabel: i18n.translate('xpack.apm.serviceGroup.serviceInventory', {
|
||||
defaultMessage: 'Inventory',
|
||||
}),
|
||||
label: (
|
||||
<EuiFlexGroup justifyContent="flexStart" alignItems="baseline" gutterSize="s">
|
||||
<EuiFlexItem grow={false}>
|
||||
|
@ -184,9 +188,10 @@ function useTabs(selectedTab: ServiceGroupContextTab['key']) {
|
|||
|
||||
return tabs
|
||||
.filter((t) => !t.hidden)
|
||||
.map(({ href, key, label }) => ({
|
||||
.map(({ href, key, label, breadcrumbLabel }) => ({
|
||||
href,
|
||||
label,
|
||||
isSelected: key === selectedTab,
|
||||
breadcrumbLabel,
|
||||
}));
|
||||
}
|
||||
|
|
|
@ -28,9 +28,14 @@ import { useEntityManagerEnablementContext } from '../../../context/entity_manag
|
|||
import { FeedbackModal } from './feedback_modal';
|
||||
import { ServiceInventoryView } from '../../../context/entity_manager_context/entity_manager_context';
|
||||
import { Unauthorized } from './unauthorized_modal';
|
||||
import { useLocalStorage } from '../../../hooks/use_local_storage';
|
||||
|
||||
export function EntityEnablement({ label, tooltip }: { label: string; tooltip?: string }) {
|
||||
const [isFeedbackModalVisible, setsIsFeedbackModalVisible] = useState(false);
|
||||
const [isFeedbackModalVisible, setsIsFeedbackModalVisible] = useLocalStorage<boolean | undefined>(
|
||||
'apm.isFeedbackModalVisible',
|
||||
undefined
|
||||
);
|
||||
|
||||
const [isUnauthorizedModalVisible, setsIsUnauthorizedModalVisible] = useState(false);
|
||||
|
||||
const {
|
||||
|
@ -53,7 +58,9 @@ export function EntityEnablement({ label, tooltip }: { label: string; tooltip?:
|
|||
|
||||
const handleRestoreView = async () => {
|
||||
setServiceInventoryViewLocalStorageSetting(ServiceInventoryView.classic);
|
||||
setsIsFeedbackModalVisible(true);
|
||||
if (isFeedbackModalVisible === undefined) {
|
||||
setsIsFeedbackModalVisible(true);
|
||||
}
|
||||
};
|
||||
|
||||
const handleEnablement = async () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue