From 4d050a2da2e7ddeed7d8adc7b51ee40ca8bef885 Mon Sep 17 00:00:00 2001 From: Oleksii Orel Date: Tue, 16 Jan 2024 18:36:07 +0200 Subject: [PATCH] Set the editor content as an editor ID for custom editors (#1038) * fix: set the editor content as an editor ID for the custom editors Signed-off-by: Oleksii Orel --- .../src/store/Workspaces/devWorkspaces/index.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/index.ts b/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/index.ts index 8fbaaf81a..875956838 100644 --- a/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/index.ts +++ b/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/index.ts @@ -184,7 +184,8 @@ export type ActionCreators = { createWorkspaceFromResources: ( devWorkspace: devfileApi.DevWorkspace, devWorkspaceTemplate: devfileApi.DevWorkspaceTemplate, - editorId?: string, + // it could be editorId or editorContent + editor?: string, ) => AppThunk>; handleWebSocketMessage: ( @@ -532,7 +533,7 @@ export const actionCreators: ActionCreators = { ( devWorkspaceResource: devfileApi.DevWorkspace, devWorkspaceTemplateResource: devfileApi.DevWorkspaceTemplate, - editorId?: string, + editor?: string, ): AppThunk> => async (dispatch, getState): Promise => { const state = getState(); @@ -540,7 +541,7 @@ export const actionCreators: ActionCreators = { const openVSXUrl = selectOpenVSXUrl(state); const pluginRegistryUrl = selectPluginRegistryUrl(state); const pluginRegistryInternalUrl = selectPluginRegistryInternalUrl(state); - const cheEditor = editorId ? editorId : selectDefaultEditor(state); + const cheEditor = editor ? editor : selectDefaultEditor(state); const defaultNamespace = defaultKubernetesNamespace.name; try { @@ -912,7 +913,7 @@ export const actionCreators: ActionCreators = { actionCreators.createWorkspaceFromResources( devWorkspaceResource, devWorkspaceTemplateResource, - editor, + editor ? editor : editorContent, ), ); },