diff --git a/src/plugins/dashboard/public/application/utils/get_nav_actions.tsx b/src/plugins/dashboard/public/application/utils/get_nav_actions.tsx index 4c1d466b62ad..87f48e6db364 100644 --- a/src/plugins/dashboard/public/application/utils/get_nav_actions.tsx +++ b/src/plugins/dashboard/public/application/utils/get_nav_actions.tsx @@ -202,6 +202,7 @@ export const getNavActions = ( }); }; + const currentWorkspace = workspaces.currentWorkspace$.value; const dashboardSavedObject = (savedDashboard || {}) as SavedObjectWithMetadata; dashboardSavedObject.meta = { title: savedDashboard.title }; @@ -209,7 +210,7 @@ export const getNavActions = ( {}} diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/components/duplicate_modal.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/components/duplicate_modal.tsx index 506091206a2a..9760d0619074 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/components/duplicate_modal.tsx +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/components/duplicate_modal.tsx @@ -31,7 +31,7 @@ import { EuiCallOut, EuiText, } from '@elastic/eui'; -import { WorkspaceAttribute, WorkspaceStart } from 'opensearch-dashboards/public'; +import { WorkspaceAttribute } from 'opensearch-dashboards/public'; import { i18n } from '@osd/i18n'; import { SavedObjectWithMetadata } from '../../../types'; import { getSavedObjectLabel } from '../../../lib'; @@ -41,7 +41,6 @@ import { SAVED_OBJECT_TYPE_WORKSPACE } from '../../../constants'; type WorkspaceOption = EuiComboBoxOptionOption; interface Props { - workspaces: WorkspaceStart; onDuplicate: ( savedObjects: SavedObjectWithMetadata[], includeReferencesDeep: boolean, @@ -49,8 +48,9 @@ interface Props { ) => Promise; onClose: () => void; duplicateMode: DuplicateMode; - getDuplicateWorkspaces: () => Promise; + currentWorkspace: WorkspaceAttribute | null; selectedSavedObjects: SavedObjectWithMetadata[]; + getDuplicateWorkspaces: () => Promise; } interface State { @@ -101,9 +101,8 @@ export class SavedObjectsDuplicateModal extends React.Component { }; async componentDidMount() { - const { workspaces, getDuplicateWorkspaces } = this.props; + const { currentWorkspace, getDuplicateWorkspaces } = this.props; const workspaceList = await getDuplicateWorkspaces(); - const currentWorkspace = workspaces.currentWorkspace$.value; const currentWorkspaceName = currentWorkspace?.name; // current workspace is the first option diff --git a/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx b/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx index f1815d1a66cf..9c627745c477 100644 --- a/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx +++ b/src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx @@ -774,6 +774,7 @@ export class SavedObjectsTable extends Component {}}