Commit 99a190cf authored by Winnie's avatar Winnie Committed by Bob Van Landuyt

Provide Web Terminal paths to Core frontend

parent 24f7775a
...@@ -3,10 +3,10 @@ import terminalModule from '../modules/terminal'; ...@@ -3,10 +3,10 @@ import terminalModule from '../modules/terminal';
function getPathsFromData(el) { function getPathsFromData(el) {
return { return {
webTerminalSvgPath: el.dataset.eeWebTerminalSvgPath, webTerminalSvgPath: el.dataset.webTerminalSvgPath,
webTerminalHelpPath: el.dataset.eeWebTerminalHelpPath, webTerminalHelpPath: el.dataset.webTerminalHelpPath,
webTerminalConfigHelpPath: el.dataset.eeWebTerminalConfigHelpPath, webTerminalConfigHelpPath: el.dataset.webTerminalConfigHelpPath,
webTerminalRunnersHelpPath: el.dataset.eeWebTerminalRunnersHelpPath, webTerminalRunnersHelpPath: el.dataset.webTerminalRunnersHelpPath,
}; };
} }
......
...@@ -20,7 +20,11 @@ module IdeHelper ...@@ -20,7 +20,11 @@ module IdeHelper
'fork-info' => @fork_info&.to_json, 'fork-info' => @fork_info&.to_json,
'project' => convert_to_project_entity_json(@project), 'project' => convert_to_project_entity_json(@project),
'enable-environments-guidance' => enable_environments_guidance?.to_s, 'enable-environments-guidance' => enable_environments_guidance?.to_s,
'preview-markdown-path' => @project && preview_markdown_path(@project) 'preview-markdown-path' => @project && preview_markdown_path(@project),
'web-terminal-svg-path' => image_path('illustrations/web-ide_promotion.svg'),
'web-terminal-help-path' => help_page_path('user/project/web_ide/index.md', anchor: 'interactive-web-terminals-for-the-web-ide'),
'web-terminal-config-help-path' => help_page_path('user/project/web_ide/index.md', anchor: 'web-ide-configuration-file'),
'web-terminal-runners-help-path' => help_page_path('user/project/web_ide/index.md', anchor: 'runner-configuration')
} }
end end
...@@ -44,5 +48,3 @@ module IdeHelper ...@@ -44,5 +48,3 @@ module IdeHelper
current_user.dismissed_callout?(feature_name: 'web_ide_ci_environments_guidance') current_user.dismissed_callout?(feature_name: 'web_ide_ci_environments_guidance')
end end
end end
::IdeHelper.prepend_mod_with('IdeHelper')
# frozen_string_literal: true
module EE
module IdeHelper
extend ::Gitlab::Utils::Override
override :ide_data
def ide_data
super.merge({
"ee-web-terminal-svg-path" => image_path('illustrations/web-ide_promotion.svg'),
"ee-web-terminal-help-path" => help_page_path('user/project/web_ide/index.md', anchor: 'interactive-web-terminals-for-the-web-ide'),
"ee-web-terminal-config-help-path" => help_page_path('user/project/web_ide/index.md', anchor: 'web-ide-configuration-file'),
"ee-web-terminal-runners-help-path" => help_page_path('user/project/web_ide/index.md', anchor: 'runner-configuration')
})
end
end
end
...@@ -6,10 +6,10 @@ import { SET_BRANCH_WORKING_REFERENCE } from '~/ide/stores/mutation_types'; ...@@ -6,10 +6,10 @@ import { SET_BRANCH_WORKING_REFERENCE } from '~/ide/stores/mutation_types';
import createTerminalPlugin from '~/ide/stores/plugins/terminal'; import createTerminalPlugin from '~/ide/stores/plugins/terminal';
const TEST_DATASET = { const TEST_DATASET = {
eeWebTerminalSvgPath: `${TEST_HOST}/web/terminal/svg`, webTerminalSvgPath: `${TEST_HOST}/web/terminal/svg`,
eeWebTerminalHelpPath: `${TEST_HOST}/web/terminal/help`, webTerminalHelpPath: `${TEST_HOST}/web/terminal/help`,
eeWebTerminalConfigHelpPath: `${TEST_HOST}/web/terminal/config/help`, webTerminalConfigHelpPath: `${TEST_HOST}/web/terminal/config/help`,
eeWebTerminalRunnersHelpPath: `${TEST_HOST}/web/terminal/runners/help`, webTerminalRunnersHelpPath: `${TEST_HOST}/web/terminal/runners/help`,
}; };
Vue.use(Vuex); Vue.use(Vuex);
...@@ -40,10 +40,10 @@ describe('ide/stores/extend', () => { ...@@ -40,10 +40,10 @@ describe('ide/stores/extend', () => {
it('dispatches terminal/setPaths', () => { it('dispatches terminal/setPaths', () => {
expect(store.dispatch).toHaveBeenCalledWith('terminal/setPaths', { expect(store.dispatch).toHaveBeenCalledWith('terminal/setPaths', {
webTerminalSvgPath: TEST_DATASET.eeWebTerminalSvgPath, webTerminalSvgPath: TEST_DATASET.webTerminalSvgPath,
webTerminalHelpPath: TEST_DATASET.eeWebTerminalHelpPath, webTerminalHelpPath: TEST_DATASET.webTerminalHelpPath,
webTerminalConfigHelpPath: TEST_DATASET.eeWebTerminalConfigHelpPath, webTerminalConfigHelpPath: TEST_DATASET.webTerminalConfigHelpPath,
webTerminalRunnersHelpPath: TEST_DATASET.eeWebTerminalRunnersHelpPath, webTerminalRunnersHelpPath: TEST_DATASET.webTerminalRunnersHelpPath,
}); });
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment