Skip to content

Commit

Permalink
add type info for dashboard and visualization
Browse files Browse the repository at this point in the history
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
  • Loading branch information
yuye-aws committed Sep 18, 2023
1 parent fc42473 commit 6667a64
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,9 @@ export const getNavActions = (
includeReferencesDeep: boolean,
targetWorkspace: string
) => {
// object must be dashboard type
const objectsToDuplicate = dashboardSavedObjects.map((obj) => ({
id: obj.id,
type: 'dashboard',
type: obj.type,
}));

try {
Expand All @@ -181,7 +180,10 @@ export const getNavActions = (
};

const currentWorkspace = workspaces.currentWorkspace$.value;
const dashboardSavedObject = (savedDashboard as unknown) as SavedObjectWithMetadata;
const dashboardSavedObject = ({
...currentContainer,
...savedDashboard,
} as unknown) as SavedObjectWithMetadata;
dashboardSavedObject.meta = { title: savedDashboard.title };

const showDuplicateModalProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,9 @@ export const getTopNavConfig = (
includeReferencesDeep: boolean,
targetWorkspace: string
) => {
// object must be visualization type
const objectsToDuplicate = visualizationSavedObjects.map((obj) => ({
id: obj.id,
type: 'visualization',
type: obj.type,
}));

try {
Expand All @@ -311,7 +310,10 @@ export const getTopNavConfig = (
};

const currentWorkspace = workspaces.currentWorkspace$.value;
const visualizationSavedObject = (savedVis as unknown) as SavedObjectWithMetadata;
const visualizationSavedObject = ({
...embeddableHandler,
...savedVis,
} as unknown) as SavedObjectWithMetadata;
visualizationSavedObject.meta = { title: savedVis.title }; // meta is missing in savedVis

const showDuplicateModalProps = {
Expand Down

0 comments on commit 6667a64

Please sign in to comment.