Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-03-16 21:18:33 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-03-16 21:18:33 +0300
commitf64a639bcfa1fc2bc89ca7db268f594306edfd7c (patch)
treea2c3c2ebcc3b45e596949db485d6ed18ffaacfa1 /app/helpers/ide_helper.rb
parentbfbc3e0d6583ea1a91f627528bedc3d65ba4b10f (diff)
Add latest changes from gitlab-org/gitlab@13-10-stable-eev13.10.0-rc40
Diffstat (limited to 'app/helpers/ide_helper.rb')
-rw-r--r--app/helpers/ide_helper.rb33
1 files changed, 23 insertions, 10 deletions
diff --git a/app/helpers/ide_helper.rb b/app/helpers/ide_helper.rb
index 93f5ca7258d..5f0d513ba35 100644
--- a/app/helpers/ide_helper.rb
+++ b/app/helpers/ide_helper.rb
@@ -3,18 +3,31 @@
module IdeHelper
def ide_data
{
- "empty-state-svg-path" => image_path('illustrations/multi_file_editor_empty.svg'),
- "no-changes-state-svg-path" => image_path('illustrations/multi-editor_no_changes_empty.svg'),
- "committed-state-svg-path" => image_path('illustrations/multi-editor_all_changes_committed_empty.svg'),
- "pipelines-empty-state-svg-path": image_path('illustrations/pipelines_empty.svg'),
- "promotion-svg-path": image_path('illustrations/web-ide_promotion.svg'),
- "ci-help-page-path" => help_page_path('ci/quick_start/README'),
- "web-ide-help-page-path" => help_page_path('user/project/web_ide/index.md'),
- "clientside-preview-enabled": Gitlab::CurrentSettings.web_ide_clientside_preview_enabled?.to_s,
- "render-whitespace-in-code": current_user.render_whitespace_in_code.to_s,
- "codesandbox-bundler-url": Gitlab::CurrentSettings.web_ide_clientside_preview_bundler_url
+ 'empty-state-svg-path' => image_path('illustrations/multi_file_editor_empty.svg'),
+ 'no-changes-state-svg-path' => image_path('illustrations/multi-editor_no_changes_empty.svg'),
+ 'committed-state-svg-path' => image_path('illustrations/multi-editor_all_changes_committed_empty.svg'),
+ 'pipelines-empty-state-svg-path': image_path('illustrations/pipelines_empty.svg'),
+ 'promotion-svg-path': image_path('illustrations/web-ide_promotion.svg'),
+ 'ci-help-page-path' => help_page_path('ci/quick_start/README'),
+ 'web-ide-help-page-path' => help_page_path('user/project/web_ide/index.md'),
+ 'clientside-preview-enabled': Gitlab::CurrentSettings.web_ide_clientside_preview_enabled?.to_s,
+ 'render-whitespace-in-code': current_user.render_whitespace_in_code.to_s,
+ 'codesandbox-bundler-url': Gitlab::CurrentSettings.web_ide_clientside_preview_bundler_url,
+ 'branch-name' => @branch,
+ 'file-path' => @path,
+ 'merge-request' => @merge_request,
+ 'forked-project' => convert_to_project_entity_json(@forked_project),
+ 'project' => convert_to_project_entity_json(@project)
}
end
+
+ private
+
+ def convert_to_project_entity_json(project)
+ return unless project
+
+ API::Entities::Project.represent(project).to_json
+ end
end
::IdeHelper.prepend_if_ee('::EE::IdeHelper')