mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
[TableListView] Remove listing limit warning (#217945)
## Summary Temporary solution for https://github.com/elastic/kibana/issues/207135#issuecomment-2789752279  > [!NOTE] > All items are still findable by query or tags Per Graham, > I would love to not need to display a warning but even with today's implementation I would remove it as its benefits don't outweigh its drawbacks IMO We also plan to work on server-side pagination soon
This commit is contained in:
parent
edf8d6d975
commit
23fe329228
19 changed files with 0 additions and 142 deletions
|
@ -13,8 +13,6 @@ import type { UserContentCommonSchema } from '@kbn/content-management-table-list
|
|||
import { SavedObjectsFindOptionsReference } from '@kbn/core-saved-objects-api-browser';
|
||||
import React from 'react';
|
||||
|
||||
const LISTING_LIMIT = 1000;
|
||||
|
||||
export const MSearchTable = () => {
|
||||
const contentClient = useContentClient();
|
||||
|
||||
|
@ -54,7 +52,6 @@ export const MSearchTable = () => {
|
|||
id="cm-msearch-table"
|
||||
headingId="cm-msearch-table-heading"
|
||||
findItems={findItems}
|
||||
listingLimit={LISTING_LIMIT}
|
||||
initialPageSize={50}
|
||||
entityName={`ContentItem`}
|
||||
entityNamePlural={`ContentItems`}
|
||||
|
|
|
@ -23,7 +23,6 @@ export type TableListViewProps<T extends UserContentCommonSchema = UserContentCo
|
|||
| 'initialFilter'
|
||||
| 'headingId'
|
||||
| 'initialPageSize'
|
||||
| 'listingLimit'
|
||||
| 'urlStateEnabled'
|
||||
| 'customTableColumn'
|
||||
| 'emptyPrompt'
|
||||
|
@ -59,7 +58,6 @@ export const TableListView = <T extends UserContentCommonSchema>({
|
|||
initialFilter,
|
||||
headingId,
|
||||
initialPageSize,
|
||||
listingLimit,
|
||||
urlStateEnabled = true,
|
||||
customTableColumn,
|
||||
emptyPrompt,
|
||||
|
@ -109,7 +107,6 @@ export const TableListView = <T extends UserContentCommonSchema>({
|
|||
initialFilter={initialFilter}
|
||||
headingId={headingId}
|
||||
initialPageSize={initialPageSize}
|
||||
listingLimit={listingLimit}
|
||||
urlStateEnabled={urlStateEnabled}
|
||||
customTableColumn={customTableColumn}
|
||||
emptyPrompt={emptyPrompt}
|
||||
|
|
|
@ -61,7 +61,6 @@ describe('created_by column', () => {
|
|||
const requiredProps: TableListViewTableProps = {
|
||||
entityName: 'test',
|
||||
entityNamePlural: 'tests',
|
||||
listingLimit: 500,
|
||||
initialFilter: '',
|
||||
initialPageSize: 20,
|
||||
findItems: jest.fn().mockResolvedValue({ total: 0, hits }),
|
||||
|
|
|
@ -62,7 +62,6 @@ describe('created_by filter', () => {
|
|||
const requiredProps: TableListViewTableProps = {
|
||||
entityName: 'test',
|
||||
entityNamePlural: 'tests',
|
||||
listingLimit: 500,
|
||||
initialFilter: '',
|
||||
initialPageSize: 20,
|
||||
findItems: jest.fn().mockResolvedValue({ total: 0, hits }),
|
||||
|
|
|
@ -19,8 +19,6 @@ import { TableListViewProvider, Services } from '../services';
|
|||
|
||||
export const getMockServices = (overrides?: Partial<Services & UserProfilesServices>) => {
|
||||
const services: Services & UserProfilesServices = {
|
||||
canEditAdvancedSettings: true,
|
||||
getListingLimitSettingsUrl: () => 'http://elastic.co',
|
||||
notifyError: () => undefined,
|
||||
currentAppId$: from('mockedApp'),
|
||||
navigateToUrl: () => undefined,
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
export { Table, FORBIDDEN_SEARCH_CHARS } from './table';
|
||||
export { UpdatedAtField } from './updated_at_field';
|
||||
export { ConfirmDeleteModal } from './confirm_delete_modal';
|
||||
export { ListingLimitWarning } from './listing_limit_warning';
|
||||
export { ItemDetails } from './item_details';
|
||||
export { TableSortSelect } from './table_sort_select';
|
||||
export { TagFilterPanel } from './tag_filter_panel';
|
||||
|
|
|
@ -1,79 +0,0 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the "Elastic License
|
||||
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
|
||||
* Public License v 1"; you may not use this file except in compliance with, at
|
||||
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
||||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { EuiCallOut, EuiLink, EuiSpacer } from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
|
||||
interface Props<T> {
|
||||
entityNamePlural: string;
|
||||
canEditAdvancedSettings: boolean;
|
||||
advancedSettingsLink: string;
|
||||
totalItems: number;
|
||||
listingLimit: number;
|
||||
}
|
||||
|
||||
export function ListingLimitWarning<T>({
|
||||
entityNamePlural,
|
||||
totalItems,
|
||||
listingLimit,
|
||||
canEditAdvancedSettings,
|
||||
advancedSettingsLink,
|
||||
}: Props<T>) {
|
||||
return (
|
||||
<>
|
||||
<EuiCallOut
|
||||
title={
|
||||
<FormattedMessage
|
||||
id="contentManagement.tableList.listing.listingLimitExceededTitle"
|
||||
defaultMessage="Listing limit exceeded"
|
||||
/>
|
||||
}
|
||||
color="warning"
|
||||
iconType="help"
|
||||
>
|
||||
<p>
|
||||
<FormattedMessage
|
||||
id="contentManagement.tableList.listing.listingLimitExceededDescription"
|
||||
defaultMessage="You have {totalItems} {entityNamePlural}, but your {listingLimitText} setting prevents
|
||||
the table below from displaying more than {listingLimitValue}."
|
||||
values={{
|
||||
entityNamePlural,
|
||||
totalItems,
|
||||
listingLimitValue: listingLimit,
|
||||
listingLimitText: <strong>listingLimit</strong>,
|
||||
}}
|
||||
/>{' '}
|
||||
{canEditAdvancedSettings ? (
|
||||
<FormattedMessage
|
||||
id="contentManagement.tableList.listing.listingLimitExceededDescriptionPermissions"
|
||||
defaultMessage="You can change this setting under {advancedSettingsLink}."
|
||||
values={{
|
||||
advancedSettingsLink: (
|
||||
<EuiLink href={advancedSettingsLink}>
|
||||
<FormattedMessage
|
||||
id="contentManagement.tableList.listing.listingLimitExceeded.advancedSettingsLinkText"
|
||||
defaultMessage="Advanced Settings"
|
||||
/>
|
||||
</EuiLink>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
<FormattedMessage
|
||||
id="contentManagement.tableList.listing.listingLimitExceededDescriptionNoPermissions"
|
||||
defaultMessage="Contact your system administrator to change this setting."
|
||||
/>
|
||||
)}
|
||||
</p>
|
||||
</EuiCallOut>
|
||||
<EuiSpacer size="m" />
|
||||
</>
|
||||
);
|
||||
}
|
|
@ -62,8 +62,6 @@ export const getTagList =
|
|||
*/
|
||||
export const getStoryServices = (params: Params, action: ActionFn = () => {}) => {
|
||||
const services: Services = {
|
||||
canEditAdvancedSettings: true,
|
||||
getListingLimitSettingsUrl: () => 'http://elastic.co',
|
||||
notifyError: (title, text) => {
|
||||
action('notifyError')({ title, text });
|
||||
},
|
||||
|
|
|
@ -57,8 +57,6 @@ export interface TagListProps {
|
|||
* Abstract external services for this component.
|
||||
*/
|
||||
export interface Services {
|
||||
canEditAdvancedSettings: boolean;
|
||||
getListingLimitSettingsUrl: () => string;
|
||||
notifyError: NotifyFn;
|
||||
currentAppId$: Observable<string | undefined>;
|
||||
navigateToUrl: (url: string) => Promise<void> | void;
|
||||
|
@ -276,12 +274,6 @@ export const TableListViewKibanaProvider: FC<
|
|||
}}
|
||||
>
|
||||
<TableListViewProvider
|
||||
canEditAdvancedSettings={Boolean(application.capabilities.advancedSettings?.save)}
|
||||
getListingLimitSettingsUrl={() =>
|
||||
application.getUrlForApp('management', {
|
||||
path: `/kibana/settings?query=savedObjects:listingLimit`,
|
||||
})
|
||||
}
|
||||
notifyError={(title, text) => {
|
||||
notifications.toasts.addDanger({
|
||||
title: toMountPoint(title, startServices),
|
||||
|
|
|
@ -59,7 +59,6 @@ describe('TableListView', () => {
|
|||
const requiredProps: TableListViewTableProps = {
|
||||
entityName: 'test',
|
||||
entityNamePlural: 'tests',
|
||||
listingLimit: 500,
|
||||
initialFilter: '',
|
||||
initialPageSize: 20,
|
||||
findItems: jest.fn().mockResolvedValue({ total: 0, hits: [] }),
|
||||
|
@ -1896,7 +1895,6 @@ describe('TableList', () => {
|
|||
entityName: 'test',
|
||||
entityNamePlural: 'tests',
|
||||
initialPageSize: 20,
|
||||
listingLimit: 500,
|
||||
findItems: jest.fn().mockResolvedValue({ total: 0, hits: [] }),
|
||||
onFetchSuccess: jest.fn(),
|
||||
tableCaption: 'test title',
|
||||
|
|
|
@ -49,7 +49,6 @@ import { useEuiTablePersist } from '@kbn/shared-ux-table-persist';
|
|||
import {
|
||||
Table,
|
||||
ConfirmDeleteModal,
|
||||
ListingLimitWarning,
|
||||
ItemDetails,
|
||||
UpdatedAtField,
|
||||
FORBIDDEN_SEARCH_CHARS,
|
||||
|
@ -81,7 +80,6 @@ export interface TableListViewTableProps<
|
|||
> {
|
||||
entityName: string;
|
||||
entityNamePlural: string;
|
||||
listingLimit: number;
|
||||
initialFilter?: string;
|
||||
initialPageSize: number;
|
||||
emptyPrompt?: JSX.Element;
|
||||
|
@ -326,7 +324,6 @@ function TableListViewTableComp<T extends UserContentCommonSchema>({
|
|||
initialFilter: initialQuery,
|
||||
headingId,
|
||||
initialPageSize,
|
||||
listingLimit,
|
||||
urlStateEnabled = true,
|
||||
customSortingOptions,
|
||||
customTableColumn,
|
||||
|
@ -378,8 +375,6 @@ function TableListViewTableComp<T extends UserContentCommonSchema>({
|
|||
const initialQueryInitialized = useRef(false);
|
||||
|
||||
const {
|
||||
canEditAdvancedSettings,
|
||||
getListingLimitSettingsUrl,
|
||||
getTagIdsFromReferences,
|
||||
searchQueryParser,
|
||||
notifyError,
|
||||
|
@ -453,7 +448,6 @@ function TableListViewTableComp<T extends UserContentCommonSchema>({
|
|||
showDeleteModal,
|
||||
isDeletingItems,
|
||||
selectedIds,
|
||||
totalItems,
|
||||
hasUpdatedAtMetadata,
|
||||
hasCreatedByMetadata,
|
||||
hasRecentlyAccessedMetadata,
|
||||
|
@ -463,7 +457,6 @@ function TableListViewTableComp<T extends UserContentCommonSchema>({
|
|||
} = state;
|
||||
|
||||
const showFetchError = Boolean(fetchError);
|
||||
const showLimitError = !showFetchError && totalItems > listingLimit;
|
||||
|
||||
const fetchItems = useCallback(async () => {
|
||||
dispatch({ type: 'onFetchItems' });
|
||||
|
@ -1180,17 +1173,6 @@ function TableListViewTableComp<T extends UserContentCommonSchema>({
|
|||
|
||||
return (
|
||||
<>
|
||||
{/* Too many items error */}
|
||||
{showLimitError && (
|
||||
<ListingLimitWarning
|
||||
canEditAdvancedSettings={canEditAdvancedSettings}
|
||||
advancedSettingsLink={getListingLimitSettingsUrl()}
|
||||
entityNamePlural={entityNamePlural}
|
||||
totalItems={totalItems}
|
||||
listingLimit={listingLimit}
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* Error while fetching items */}
|
||||
{showFetchError && renderFetchError()}
|
||||
|
||||
|
|
|
@ -198,7 +198,6 @@ export const EventAnnotationGroupTableList = ({
|
|||
: undefined
|
||||
}
|
||||
editItem={editItem}
|
||||
listingLimit={listingLimit}
|
||||
initialPageSize={initialPageSize}
|
||||
initialFilter={''}
|
||||
customTableColumn={getCustomColumn(dataViews)}
|
||||
|
|
|
@ -78,7 +78,6 @@ export const App: FunctionComponent = () => {
|
|||
}}
|
||||
initialFilter=""
|
||||
initialPageSize={50}
|
||||
listingLimit={1000}
|
||||
getOnClickTitle={({ attributes }) =>
|
||||
() =>
|
||||
setSelectedFile(attributes as unknown as FileJSON)}
|
||||
|
|
|
@ -396,7 +396,6 @@ export const VisualizeListing = () => {
|
|||
// for data exploration purposes
|
||||
customTableColumn={getCustomColumn()}
|
||||
customSortingOptions={getCustomSortingOptions()}
|
||||
listingLimit={listingLimit}
|
||||
initialPageSize={initialPageSize}
|
||||
initialFilter={''}
|
||||
entityName={i18n.translate('visualizations.listing.table.entityName', {
|
||||
|
@ -431,7 +430,6 @@ export const VisualizeListing = () => {
|
|||
dashboardCapabilities.createNew,
|
||||
initialPageSize,
|
||||
kbnUrlStateStorage,
|
||||
listingLimit,
|
||||
tableViewProps,
|
||||
visualizeLibraryTitle,
|
||||
]);
|
||||
|
|
|
@ -96,7 +96,6 @@ export function ListingRoute({
|
|||
findItems={findItems}
|
||||
deleteItems={capabilities.graph.delete ? deleteItems : undefined}
|
||||
editItem={capabilities.graph.save ? editItem : undefined}
|
||||
listingLimit={listingLimit}
|
||||
initialFilter={initialFilter}
|
||||
initialPageSize={initialPageSize}
|
||||
emptyPrompt={getNoItemsMessage(
|
||||
|
|
|
@ -640,11 +640,6 @@
|
|||
"contentManagement.tableList.listing.deleteSelectedItemsConfirmModal.confirmButtonLabelDeleting": "Suppression",
|
||||
"contentManagement.tableList.listing.fetchErrorDescription": "Le listing {entityName} n'a pas pu être récupéré : {message}.",
|
||||
"contentManagement.tableList.listing.fetchErrorTitle": "Échec de la récupération du listing",
|
||||
"contentManagement.tableList.listing.listingLimitExceeded.advancedSettingsLinkText": "Paramètres avancés",
|
||||
"contentManagement.tableList.listing.listingLimitExceededDescription": "Vous avez {totalItems} {entityNamePlural}, mais votre paramètre {listingLimitText} empêche le tableau ci-dessous d'en afficher plus de {listingLimitValue}.",
|
||||
"contentManagement.tableList.listing.listingLimitExceededDescriptionNoPermissions": "Contactez l'administrateur système pour modifier ce paramètre.",
|
||||
"contentManagement.tableList.listing.listingLimitExceededDescriptionPermissions": "Vous pouvez modifier ce paramètre sous {advancedSettingsLink}.",
|
||||
"contentManagement.tableList.listing.listingLimitExceededTitle": "Limite de listing dépassée",
|
||||
"contentManagement.tableList.listing.table.actionTitle": "Actions",
|
||||
"contentManagement.tableList.listing.table.editActionDescription": "Modifier",
|
||||
"contentManagement.tableList.listing.table.editActionName": "Modifier {itemDescription}",
|
||||
|
|
|
@ -640,11 +640,6 @@
|
|||
"contentManagement.tableList.listing.deleteSelectedItemsConfirmModal.confirmButtonLabelDeleting": "削除中",
|
||||
"contentManagement.tableList.listing.fetchErrorDescription": "{entityName}リストを取得できませんでした。{message}",
|
||||
"contentManagement.tableList.listing.fetchErrorTitle": "リストを取得できませんでした",
|
||||
"contentManagement.tableList.listing.listingLimitExceeded.advancedSettingsLinkText": "高度な設定",
|
||||
"contentManagement.tableList.listing.listingLimitExceededDescription": "{totalItems} 件の {entityNamePlural} がありますが、{listingLimitText} の設定により {listingLimitValue} 件までしか下の表に表示できません。",
|
||||
"contentManagement.tableList.listing.listingLimitExceededDescriptionNoPermissions": "この設定を変更するには、システム管理者に問い合わせてください。",
|
||||
"contentManagement.tableList.listing.listingLimitExceededDescriptionPermissions": "{advancedSettingsLink} の下でこの設定を変更できます。",
|
||||
"contentManagement.tableList.listing.listingLimitExceededTitle": "リスティング制限超過",
|
||||
"contentManagement.tableList.listing.noAvailableItemsMessage": "利用可能な {entityNamePlural} がありません。",
|
||||
"contentManagement.tableList.listing.noMatchedItemsMessage": "検索条件に一致する {entityNamePlural} がありません。",
|
||||
"contentManagement.tableList.listing.table.actionTitle": "アクション",
|
||||
|
|
|
@ -638,11 +638,6 @@
|
|||
"contentManagement.tableList.listing.deleteSelectedItemsConfirmModal.confirmButtonLabelDeleting": "正在删除",
|
||||
"contentManagement.tableList.listing.fetchErrorDescription": "无法提取 {entityName} 列表:{message}。",
|
||||
"contentManagement.tableList.listing.fetchErrorTitle": "提取列表失败",
|
||||
"contentManagement.tableList.listing.listingLimitExceeded.advancedSettingsLinkText": "高级设置",
|
||||
"contentManagement.tableList.listing.listingLimitExceededDescription": "您有 {totalItems} 个{entityNamePlural},但您的“{listingLimitText}”设置阻止下表显示 {listingLimitValue} 个以上。",
|
||||
"contentManagement.tableList.listing.listingLimitExceededDescriptionNoPermissions": "请联系系统管理员更改此设置。",
|
||||
"contentManagement.tableList.listing.listingLimitExceededDescriptionPermissions": "您可以在“{advancedSettingsLink}”下更改此设置。",
|
||||
"contentManagement.tableList.listing.listingLimitExceededTitle": "已超过列表限制",
|
||||
"contentManagement.tableList.listing.noAvailableItemsMessage": "没有可用的{entityNamePlural}。",
|
||||
"contentManagement.tableList.listing.noMatchedItemsMessage": "没有任何{entityNamePlural}匹配您的搜索。",
|
||||
"contentManagement.tableList.listing.table.actionTitle": "操作",
|
||||
|
|
|
@ -70,7 +70,6 @@ function MapsListViewComp({ history }: Props) {
|
|||
});
|
||||
|
||||
const isReadOnly = !getMapsCapabilities().save;
|
||||
const listingLimit = getUiSettings().get(SAVED_OBJECTS_LIMIT_SETTING);
|
||||
const initialPageSize = getUiSettings().get(SAVED_OBJECTS_PER_PAGE_SETTING);
|
||||
|
||||
// TLDR; render should be side effect free
|
||||
|
@ -129,7 +128,6 @@ function MapsListViewComp({ history }: Props) {
|
|||
createItem={isReadOnly ? undefined : navigateToNewMap}
|
||||
findItems={findMaps}
|
||||
deleteItems={isReadOnly ? undefined : deleteMaps}
|
||||
listingLimit={listingLimit}
|
||||
initialFilter={''}
|
||||
initialPageSize={initialPageSize}
|
||||
entityName={i18n.translate('xpack.maps.mapListing.entityName', {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue