Module: IdeHelper

Defined in:
app/helpers/ide_helper.rb

Instance Method Summary collapse

Instance Method Details

#ide_data(project:, fork_info:, params:) ⇒ Object

Overridden in EE



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/helpers/ide_helper.rb', line 5

def ide_data(project:, fork_info:, params:)
  base_data = {
    'new-web-ide-help-page-path' => help_page_path('user/project/web_ide/_index.md'),
    'sign-in-path' => new_session_path(current_user),
    'sign-out-path' => destroy_user_session_path,
    'user-preferences-path' => profile_preferences_path
  }.merge(extend_ide_data(project: project))

  return base_data unless project

  base_data.merge(
    'fork-info' => fork_info&.to_json,
    'branch-name' => params[:branch],
    'file-path' => params[:path],
    'merge-request' => params[:merge_request_id]
  )
end

#show_web_ide_oauth_callback_mismatch_callout?Boolean

Returns:

  • (Boolean)


23
24
25
26
27
# File 'app/helpers/ide_helper.rb', line 23

def show_web_ide_oauth_callback_mismatch_callout?
  callback_urls = ::WebIde::DefaultOauthApplication.oauth_application_callback_urls
  callback_url_domains = callback_urls.map { |url| URI.parse(url).origin }
  callback_url_domains.any? && callback_url_domains.exclude?(request.base_url)
end

#web_ide_oauth_application_idObject



29
30
31
# File 'app/helpers/ide_helper.rb', line 29

def web_ide_oauth_application_id
  ::WebIde::DefaultOauthApplication.oauth_application_id
end