Skip to content

Commit ac4699b

Browse files
[8.x] [VisLibrary] AnnotGroup listing page papercuts (elastic#205914) (elastic#206283)
# Backport This will backport the following commits from `main` to `8.x`: - [[VisLibrary] AnnotGroup listing page papercuts (elastic#205914)](elastic#205914) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Paulina Shakirova","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-01-10T13:38:00Z","message":"[VisLibrary] AnnotGroup listing page papercuts (elastic#205914)\n\n## Summary\nThis PR fixes [Annotation groups Listing Page\nPapercuts](elastic#198731) and\n[Dashboard Listing Page\nPapercuts](elastic#198728) issues.\n\n1. Changed the name of the first column\n2. Fixed edit icon being invisible while editing functionality is\navailable.\nIn the past the logic was different - hiding of icon was happening based\non `isEditable(item)` property, and in the [[Managed content] readonly\nin library\nviews](https://github.com/elastic/kibana/pull/176263/files#diff-e442682471f1021a9126ddcad7e00a0d334e57ac8db512c1c3268e14ecac0074L552)\nPR the logic was changed to depend on adding a key `{ edit: { enabled:\nfalse }` if there is a need to hide the Edit button. What happened is\nthat the logic should be -> If you don't want to show the Edit icon, add\n`{ edit: { enabled: false }`, but in the current code, although there is\nno such key, the pencil stays invisible, because the\n`Boolean(tableItemsRowActions[item.id]?.edit?.enabled)` resolved to\n`false` when it is `undefined` (when the Edit functionality isn't\ndisabled.) In this PR I propose an adjustment to this line of code.\n3. Changed the View Details icon.\n4. Show Reload page toast when a user changes preferred\n`savedObjects:perPage` in Advanced Settings.\n5. Fix sorting algorithm that was sorting incorrectly if the preferred\n`savedObjects:perPage` was less than 10.\n\n<img width=\"237\" alt=\"Screenshot 2025-01-09 at 13 44 39\"\nsrc=\"https://github.com/user-attachments/assets/77a6fd45-8845-4b06-818c-0af0dc01ede9\"\n/>\n\n<img width=\"243\" alt=\"Screenshot 2025-01-09 at 13 43 30\"\nsrc=\"https://github.com/user-attachments/assets/3d9e03da-94dd-4e31-b33a-eb81e71b69dd\"\n/>","sha":"86e8a2fceeb24c83f52d421c18600811ac028ef4","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","Team:SharedUX","backport:prev-minor","papercut"],"title":"[VisLibrary] AnnotGroup listing page papercuts","number":205914,"url":"https://github.com/elastic/kibana/pull/205914","mergeCommit":{"message":"[VisLibrary] AnnotGroup listing page papercuts (elastic#205914)\n\n## Summary\nThis PR fixes [Annotation groups Listing Page\nPapercuts](elastic#198731) and\n[Dashboard Listing Page\nPapercuts](elastic#198728) issues.\n\n1. Changed the name of the first column\n2. Fixed edit icon being invisible while editing functionality is\navailable.\nIn the past the logic was different - hiding of icon was happening based\non `isEditable(item)` property, and in the [[Managed content] readonly\nin library\nviews](https://github.com/elastic/kibana/pull/176263/files#diff-e442682471f1021a9126ddcad7e00a0d334e57ac8db512c1c3268e14ecac0074L552)\nPR the logic was changed to depend on adding a key `{ edit: { enabled:\nfalse }` if there is a need to hide the Edit button. What happened is\nthat the logic should be -> If you don't want to show the Edit icon, add\n`{ edit: { enabled: false }`, but in the current code, although there is\nno such key, the pencil stays invisible, because the\n`Boolean(tableItemsRowActions[item.id]?.edit?.enabled)` resolved to\n`false` when it is `undefined` (when the Edit functionality isn't\ndisabled.) In this PR I propose an adjustment to this line of code.\n3. Changed the View Details icon.\n4. Show Reload page toast when a user changes preferred\n`savedObjects:perPage` in Advanced Settings.\n5. Fix sorting algorithm that was sorting incorrectly if the preferred\n`savedObjects:perPage` was less than 10.\n\n<img width=\"237\" alt=\"Screenshot 2025-01-09 at 13 44 39\"\nsrc=\"https://github.com/user-attachments/assets/77a6fd45-8845-4b06-818c-0af0dc01ede9\"\n/>\n\n<img width=\"243\" alt=\"Screenshot 2025-01-09 at 13 43 30\"\nsrc=\"https://github.com/user-attachments/assets/3d9e03da-94dd-4e31-b33a-eb81e71b69dd\"\n/>","sha":"86e8a2fceeb24c83f52d421c18600811ac028ef4"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/205914","number":205914,"mergeCommit":{"message":"[VisLibrary] AnnotGroup listing page papercuts (elastic#205914)\n\n## Summary\nThis PR fixes [Annotation groups Listing Page\nPapercuts](elastic#198731) and\n[Dashboard Listing Page\nPapercuts](elastic#198728) issues.\n\n1. Changed the name of the first column\n2. Fixed edit icon being invisible while editing functionality is\navailable.\nIn the past the logic was different - hiding of icon was happening based\non `isEditable(item)` property, and in the [[Managed content] readonly\nin library\nviews](https://github.com/elastic/kibana/pull/176263/files#diff-e442682471f1021a9126ddcad7e00a0d334e57ac8db512c1c3268e14ecac0074L552)\nPR the logic was changed to depend on adding a key `{ edit: { enabled:\nfalse }` if there is a need to hide the Edit button. What happened is\nthat the logic should be -> If you don't want to show the Edit icon, add\n`{ edit: { enabled: false }`, but in the current code, although there is\nno such key, the pencil stays invisible, because the\n`Boolean(tableItemsRowActions[item.id]?.edit?.enabled)` resolved to\n`false` when it is `undefined` (when the Edit functionality isn't\ndisabled.) In this PR I propose an adjustment to this line of code.\n3. Changed the View Details icon.\n4. Show Reload page toast when a user changes preferred\n`savedObjects:perPage` in Advanced Settings.\n5. Fix sorting algorithm that was sorting incorrectly if the preferred\n`savedObjects:perPage` was less than 10.\n\n<img width=\"237\" alt=\"Screenshot 2025-01-09 at 13 44 39\"\nsrc=\"https://github.com/user-attachments/assets/77a6fd45-8845-4b06-818c-0af0dc01ede9\"\n/>\n\n<img width=\"243\" alt=\"Screenshot 2025-01-09 at 13 43 30\"\nsrc=\"https://github.com/user-attachments/assets/3d9e03da-94dd-4e31-b33a-eb81e71b69dd\"\n/>","sha":"86e8a2fceeb24c83f52d421c18600811ac028ef4"}}]}] BACKPORT--> Co-authored-by: Paulina Shakirova <[email protected]>
1 parent 037207e commit ac4699b

File tree

5 files changed

+6
-8
lines changed

5 files changed

+6
-8
lines changed

src/platform/packages/shared/content-management/table_list_view_table/src/table_list_view_table.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ const urlStateSerializer = (updated: {
299299
const tableColumnMetadata = {
300300
title: {
301301
field: 'attributes.title',
302-
name: 'Name, description, tags',
302+
name: 'Name',
303303
},
304304
updatedAt: {
305305
field: 'updatedAt',
@@ -421,7 +421,7 @@ function TableListViewTableComp<T extends UserContentCommonSchema>({
421421
pageIndex: 0,
422422
totalItemCount: 0,
423423
pageSize: initialPageSize,
424-
pageSizeOptions: uniq([10, 20, 50, initialPageSize]).sort(),
424+
pageSizeOptions: uniq([10, 20, 50, initialPageSize]).sort((a, b) => Number(a) - Number(b)),
425425
},
426426
tableSort: initialSort.tableSort,
427427
sortColumnChanged: !initialSort.isDefault,
@@ -606,7 +606,7 @@ function TableListViewTableComp<T extends UserContentCommonSchema>({
606606
name:
607607
titleColumnName ??
608608
i18n.translate('contentManagement.tableList.mainColumnName', {
609-
defaultMessage: 'Name, description, tags',
609+
defaultMessage: 'Name',
610610
}),
611611
sortable: true,
612612
render: (field: keyof T, record: T) => {
@@ -696,7 +696,7 @@ function TableListViewTableComp<T extends UserContentCommonSchema>({
696696
),
697697
icon: 'pencil',
698698
type: 'icon',
699-
available: (item) => Boolean(tableItemsRowActions[item.id]?.edit?.enabled),
699+
available: (item) => tableItemsRowActions[item.id]?.edit?.enabled !== false,
700700
enabled: (v) => !(v as unknown as { error: string })?.error,
701701
onClick: editItem,
702702
'data-test-subj': `edit-action`,
@@ -722,7 +722,7 @@ function TableListViewTableComp<T extends UserContentCommonSchema>({
722722
defaultMessage: 'View details',
723723
}
724724
),
725-
icon: 'iInCircle',
725+
icon: 'controlsVertical',
726726
type: 'icon',
727727
onClick: inspectItem,
728728
'data-test-subj': `inspect-action`,

src/platform/plugins/shared/saved_objects_finder/server/ui_settings.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export const uiSettings: Record<string, UiSettingsParams> = {
2323
description: i18n.translate('savedObjectsFinder.advancedSettings.perPageText', {
2424
defaultMessage: 'Number of objects to show per page in the load dialog',
2525
}),
26+
requiresPageReload: true,
2627
schema: schema.number(),
2728
},
2829
[LISTING_LIMIT_SETTING]: {

x-pack/platform/plugins/private/translations/translations/fr-FR.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,6 @@
605605
"contentManagement.tableList.listing.userFilter.errorMessage": "Échec de chargement des utilisateurs",
606606
"contentManagement.tableList.listing.userFilter.filterLabel": "Créé par",
607607
"contentManagement.tableList.listing.userFilter.noCreators": "Aucun créateur",
608-
"contentManagement.tableList.mainColumnName": "Nom, description, balises",
609608
"contentManagement.tableList.managedItemNoEdit": "Elastic gère cet objet. Clonez-le pour effectuer des modifications.",
610609
"contentManagement.tableList.tabsFilter.allTabLabel": "Tous",
611610
"contentManagement.tableList.tabsFilter.favoriteTabLabel": "Éléments avec étoiles",

x-pack/platform/plugins/private/translations/translations/ja-JP.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,6 @@
607607
"contentManagement.tableList.listing.userFilter.errorMessage": "ユーザーの読み込みに失敗しました",
608608
"contentManagement.tableList.listing.userFilter.filterLabel": "作成者",
609609
"contentManagement.tableList.listing.userFilter.noCreators": "作成担当なし",
610-
"contentManagement.tableList.mainColumnName": "名前、説明、タグ",
611610
"contentManagement.tableList.managedItemNoEdit": "Elasticはこの項目を管理します。変更するには、複製してください。",
612611
"contentManagement.tableList.tabsFilter.allTabLabel": "すべて",
613612
"contentManagement.tableList.tabsFilter.favoriteTabLabel": "スター付き",

x-pack/platform/plugins/private/translations/translations/zh-CN.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,6 @@
633633
"contentManagement.tableList.listing.userFilter.errorMessage": "无法加载用户",
634634
"contentManagement.tableList.listing.userFilter.filterLabel": "创建者",
635635
"contentManagement.tableList.listing.userFilter.noCreators": "无创建者",
636-
"contentManagement.tableList.mainColumnName": "名称、描述、标签",
637636
"contentManagement.tableList.managedItemNoEdit": "Elastic 将管理此项目。进行克隆以做出更改。",
638637
"contentManagement.tableList.tabsFilter.allTabLabel": "全部",
639638
"contentManagement.tableList.tabsFilter.favoriteTabLabel": "带星标",

0 commit comments

Comments
 (0)