mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[VisLibrary] AnnotGroup listing page papercuts (#205914)
## Summary This PR fixes [Annotation groups Listing Page Papercuts](https://github.com/elastic/kibana/issues/198731) and [Dashboard Listing Page Papercuts](https://github.com/elastic/kibana/issues/198728) issues. 1. Changed the name of the first column 2. Fixed edit icon being invisible while editing functionality is available. In the past the logic was different - hiding of icon was happening based on `isEditable(item)` property, and in the [[Managed content] readonly in library views](https://github.com/elastic/kibana/pull/176263/files#diff-e442682471f1021a9126ddcad7e00a0d334e57ac8db512c1c3268e14ecac0074L552) PR the logic was changed to depend on adding a key `{ edit: { enabled: false }` if there is a need to hide the Edit button. What happened is that the logic should be -> If you don't want to show the Edit icon, add `{ edit: { enabled: false }`, but in the current code, although there is no such key, the pencil stays invisible, because the `Boolean(tableItemsRowActions[item.id]?.edit?.enabled)` resolved to `false` when it is `undefined` (when the Edit functionality isn't disabled.) In this PR I propose an adjustment to this line of code. 3. Changed the View Details icon. 4. Show Reload page toast when a user changes preferred `savedObjects:perPage` in Advanced Settings. 5. Fix sorting algorithm that was sorting incorrectly if the preferred `savedObjects:perPage` was less than 10. <img width="237" alt="Screenshot 2025-01-09 at 13 44 39" src="https://github.com/user-attachments/assets/77a6fd45-8845-4b06-818c-0af0dc01ede9" /> <img width="243" alt="Screenshot 2025-01-09 at 13 43 30" src="https://github.com/user-attachments/assets/3d9e03da-94dd-4e31-b33a-eb81e71b69dd" />
This commit is contained in:
parent
3d82bb58af
commit
86e8a2fcee
5 changed files with 6 additions and 8 deletions
|
@ -299,7 +299,7 @@ const urlStateSerializer = (updated: {
|
|||
const tableColumnMetadata = {
|
||||
title: {
|
||||
field: 'attributes.title',
|
||||
name: 'Name, description, tags',
|
||||
name: 'Name',
|
||||
},
|
||||
updatedAt: {
|
||||
field: 'updatedAt',
|
||||
|
@ -421,7 +421,7 @@ function TableListViewTableComp<T extends UserContentCommonSchema>({
|
|||
pageIndex: 0,
|
||||
totalItemCount: 0,
|
||||
pageSize: initialPageSize,
|
||||
pageSizeOptions: uniq([10, 20, 50, initialPageSize]).sort(),
|
||||
pageSizeOptions: uniq([10, 20, 50, initialPageSize]).sort((a, b) => Number(a) - Number(b)),
|
||||
},
|
||||
tableSort: initialSort.tableSort,
|
||||
sortColumnChanged: !initialSort.isDefault,
|
||||
|
@ -606,7 +606,7 @@ function TableListViewTableComp<T extends UserContentCommonSchema>({
|
|||
name:
|
||||
titleColumnName ??
|
||||
i18n.translate('contentManagement.tableList.mainColumnName', {
|
||||
defaultMessage: 'Name, description, tags',
|
||||
defaultMessage: 'Name',
|
||||
}),
|
||||
sortable: true,
|
||||
render: (field: keyof T, record: T) => {
|
||||
|
@ -696,7 +696,7 @@ function TableListViewTableComp<T extends UserContentCommonSchema>({
|
|||
),
|
||||
icon: 'pencil',
|
||||
type: 'icon',
|
||||
available: (item) => Boolean(tableItemsRowActions[item.id]?.edit?.enabled),
|
||||
available: (item) => tableItemsRowActions[item.id]?.edit?.enabled !== false,
|
||||
enabled: (v) => !(v as unknown as { error: string })?.error,
|
||||
onClick: editItem,
|
||||
'data-test-subj': `edit-action`,
|
||||
|
@ -722,7 +722,7 @@ function TableListViewTableComp<T extends UserContentCommonSchema>({
|
|||
defaultMessage: 'View details',
|
||||
}
|
||||
),
|
||||
icon: 'iInCircle',
|
||||
icon: 'controlsVertical',
|
||||
type: 'icon',
|
||||
onClick: inspectItem,
|
||||
'data-test-subj': `inspect-action`,
|
||||
|
|
|
@ -23,6 +23,7 @@ export const uiSettings: Record<string, UiSettingsParams> = {
|
|||
description: i18n.translate('savedObjectsFinder.advancedSettings.perPageText', {
|
||||
defaultMessage: 'Number of objects to show per page in the load dialog',
|
||||
}),
|
||||
requiresPageReload: true,
|
||||
schema: schema.number(),
|
||||
},
|
||||
[LISTING_LIMIT_SETTING]: {
|
||||
|
|
|
@ -593,7 +593,6 @@
|
|||
"contentManagement.tableList.listing.userFilter.errorMessage": "Échec de chargement des utilisateurs",
|
||||
"contentManagement.tableList.listing.userFilter.filterLabel": "Créé par",
|
||||
"contentManagement.tableList.listing.userFilter.noCreators": "Aucun créateur",
|
||||
"contentManagement.tableList.mainColumnName": "Nom, description, balises",
|
||||
"contentManagement.tableList.managedItemNoEdit": "Elastic gère cet objet. Clonez-le pour effectuer des modifications.",
|
||||
"contentManagement.tableList.tabsFilter.allTabLabel": "Tous",
|
||||
"contentManagement.tableList.tabsFilter.favoriteTabLabel": "Éléments avec étoiles",
|
||||
|
|
|
@ -595,7 +595,6 @@
|
|||
"contentManagement.tableList.listing.userFilter.errorMessage": "ユーザーの読み込みに失敗しました",
|
||||
"contentManagement.tableList.listing.userFilter.filterLabel": "作成者",
|
||||
"contentManagement.tableList.listing.userFilter.noCreators": "作成担当なし",
|
||||
"contentManagement.tableList.mainColumnName": "名前、説明、タグ",
|
||||
"contentManagement.tableList.managedItemNoEdit": "Elasticはこの項目を管理します。変更するには、複製してください。",
|
||||
"contentManagement.tableList.tabsFilter.allTabLabel": "すべて",
|
||||
"contentManagement.tableList.tabsFilter.favoriteTabLabel": "スター付き",
|
||||
|
|
|
@ -617,7 +617,6 @@
|
|||
"contentManagement.tableList.listing.userFilter.errorMessage": "无法加载用户",
|
||||
"contentManagement.tableList.listing.userFilter.filterLabel": "创建者",
|
||||
"contentManagement.tableList.listing.userFilter.noCreators": "无创建者",
|
||||
"contentManagement.tableList.mainColumnName": "名称、描述、标签",
|
||||
"contentManagement.tableList.managedItemNoEdit": "Elastic 将管理此项目。进行克隆以做出更改。",
|
||||
"contentManagement.tableList.tabsFilter.allTabLabel": "全部",
|
||||
"contentManagement.tableList.tabsFilter.favoriteTabLabel": "带星标",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue