From 1b971c7ba64fc3382f07b1d3b73bc4be0a66a644 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 2 Nov 2022 23:04:04 +0000 Subject: [PATCH] Last Updated Timestamp for visbuilder saved object is getting Generated (#2628) Signed-off-by: AbhishekReddy1127 Signed-off-by: AbhishekReddy1127 Co-authored-by: Ashwin P Chandran (cherry picked from commit a16fe4064257d72059307717a3e26023142d9b7a) Signed-off-by: github-actions[bot] # Conflicts: # CHANGELOG.md --- src/plugins/saved_objects/public/types.ts | 1 + .../vis_builder/common/vis_builder_saved_object_attributes.ts | 1 + src/plugins/vis_builder/public/plugin.ts | 3 ++- .../visualizations/public/vis_types/vis_type_alias_registry.ts | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/saved_objects/public/types.ts b/src/plugins/saved_objects/public/types.ts index 8143e69426f5..3232c3e16725 100644 --- a/src/plugins/saved_objects/public/types.ts +++ b/src/plugins/saved_objects/public/types.ts @@ -110,6 +110,7 @@ export interface SavedObjectConfig { path?: string; searchSource?: ISearchSource | boolean; type?: string; + updated_at?: string; } export type OpenSearchResponse = Record; diff --git a/src/plugins/vis_builder/common/vis_builder_saved_object_attributes.ts b/src/plugins/vis_builder/common/vis_builder_saved_object_attributes.ts index e0e1e1cb6de7..bcaf0a0490f1 100644 --- a/src/plugins/vis_builder/common/vis_builder_saved_object_attributes.ts +++ b/src/plugins/vis_builder/common/vis_builder_saved_object_attributes.ts @@ -11,6 +11,7 @@ export interface WizardSavedObjectAttributes extends SavedObjectAttributes { title: string; description?: string; visualizationState?: string; + updated_at?: string; styleState?: string; version: number; searchSourceFields?: { diff --git a/src/plugins/vis_builder/public/plugin.ts b/src/plugins/vis_builder/public/plugin.ts index 7b0e983c4a83..f2ec26649d92 100644 --- a/src/plugins/vis_builder/public/plugin.ts +++ b/src/plugins/vis_builder/public/plugin.ts @@ -120,7 +120,7 @@ export class WizardPlugin appExtensions: { visualizations: { docTypes: [PLUGIN_ID], - toListItem: ({ id, attributes }) => ({ + toListItem: ({ id, attributes, updated_at: updatedAt }) => ({ description: attributes?.description, editApp: PLUGIN_ID, editUrl: `${EDIT_PATH}/${encodeURIComponent(id)}`, @@ -130,6 +130,7 @@ export class WizardPlugin stage: 'experimental', title: attributes?.title, typeTitle: PLUGIN_NAME, + updated_at: updatedAt, }), }, }, diff --git a/src/plugins/visualizations/public/vis_types/vis_type_alias_registry.ts b/src/plugins/visualizations/public/vis_types/vis_type_alias_registry.ts index 7f5323cee06a..fb3deea58bd1 100644 --- a/src/plugins/visualizations/public/vis_types/vis_type_alias_registry.ts +++ b/src/plugins/visualizations/public/vis_types/vis_type_alias_registry.ts @@ -53,6 +53,7 @@ export interface VisualizationsAppExtension { id: string; type: string; attributes: SavedObjectAttributes; + updated_at?: string; }) => VisualizationListItem; }