Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 0 additions & 115 deletions src/plugins/saved_objects_management/public/lib/in_app_url.test.ts

This file was deleted.

29 changes: 0 additions & 29 deletions src/plugins/saved_objects_management/public/lib/in_app_url.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/plugins/saved_objects_management/public/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

export { fetchExportByTypeAndSearch } from './fetch_export_by_type_and_search';
export { fetchExportObjects } from './fetch_export_objects';
export { canViewInApp } from './in_app_url';
export { getRelationships } from './get_relationships';
export { getSavedObjectCounts } from './get_saved_object_counts';
export { getSavedObjectLabel } from './get_saved_object_label';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,11 @@ export const mountManagementSection = async ({
<I18nProvider>
<Router history={history}>
<Switch>
<Route path={'/:service/:id'} exact={true}>
<Route path={'/:type/:id'} exact={true}>
<RedirectToHomeIfUnauthorized>
<Suspense fallback={<EuiLoadingSpinner />}>
<SavedObjectsEditionPage
coreStart={coreStart}
serviceRegistry={serviceRegistry}
setBreadcrumbs={setBreadcrumbs}
history={history}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,22 @@
import React from 'react';
import { EuiButton, EuiPageHeader } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@kbn/i18n';

interface HeaderProps {
canEdit: boolean;
canDelete: boolean;
canViewInApp: boolean;
type: string;
viewUrl: string;
onDeleteClick: () => void;
}

const renderConditionalTitle = (canEdit: boolean, type: string) =>
canEdit ? (
<FormattedMessage
id="savedObjectsManagement.view.editItemTitle"
defaultMessage="Edit {title}"
values={{ title: type }}
/>
) : (
<FormattedMessage
id="savedObjectsManagement.view.viewItemTitle"
defaultMessage="View {title}"
values={{ title: type }}
/>
);

export const Header = ({
canEdit,
canDelete,
canViewInApp,
type,
viewUrl,
onDeleteClick,
}: HeaderProps) => {
export const Header = ({ canDelete, canViewInApp, viewUrl, onDeleteClick }: HeaderProps) => {
return (
<EuiPageHeader
bottomBorder
pageTitle={renderConditionalTitle(canEdit, type)}
pageTitle={i18n.translate('savedObjectsManagement.view.inspectTitle', {
defaultMessage: 'Inspect saved object',
})}
rightSideItems={[
canViewInApp && (
<EuiButton
Expand All @@ -56,8 +35,7 @@ export const Header = ({
>
<FormattedMessage
id="savedObjectsManagement.view.viewItemButtonLabel"
defaultMessage="View {title}"
values={{ title: type }}
defaultMessage="View in application"
/>
</EuiButton>
),
Expand All @@ -71,8 +49,7 @@ export const Header = ({
>
<FormattedMessage
id="savedObjectsManagement.view.deleteItemButtonLabel"
defaultMessage="Delete {title}"
values={{ title: type }}
defaultMessage="Delete"
/>
</EuiButton>
),
Expand Down
Loading