Module: DashboardHelper

Includes:
IconsHelper
Defined in:
app/helpers/dashboard_helper.rb

Constant Summary

Constants included from IconsHelper

IconsHelper::DEFAULT_ICON_SIZE, IconsHelper::VARIANT_CLASSES

Instance Method Summary collapse

Methods included from IconsHelper

#audit_icon, #boolean_to_icon, #custom_icon, #external_snippet_icon, #file_type_icon_class, #gl_loading_icon, #illustrations_path, #sprite_file_icons_path, #sprite_icon, #sprite_icon_path, #visibility_level_icon

Instance Method Details

#feature_entry(title, href: nil, enabled: true, doc_href: nil, last: false, css_class: nil) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'app/helpers/dashboard_helper.rb', line 10

def feature_entry(title, href: nil, enabled: true, doc_href: nil, last: false, css_class: nil)
  enabled_text = enabled ? 'enabled' : 'not enabled'
  label = "#{title}: #{enabled_text}"
  link_or_title = title

  tag.p(aria: { label: label }, class: ['gl-py-4', 'gl-m-0', ('gl-border-b' unless last), css_class].compact) do
    concat(link_or_title)

    concat(tag.span(class: %w[gl-float-right]) do
      concat(boolean_to_icon(enabled))

      if href.present? && current_user.can_admin_all_resources?
        concat(render(Pajamas::ButtonComponent.new(icon: 'settings', category: :tertiary, size: :small, href: href,
          button_options: {
            title: _('Configure'),
            class: 'gl-ml-2 has-tooltip',
            aria: { label: format(_('Configure feature "%{name}"'), name: title) }
          })))
      end

      if doc_href.present?
        link_to_doc = link_to(
          sprite_icon('question-o'),
          doc_href,
          class: 'gl-ml-4 gl-mr-2 has-tooltip',
          title: _('Documentation'),
          aria: { label: format(_('Documentation about the "%{name}" feature'), name: title) },
          target: '_blank',
          rel: 'noopener noreferrer'
        )

        concat(link_to_doc)
      end
    end)
  end
end

#has_start_trial?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'app/helpers/dashboard_helper.rb', line 6

def has_start_trial?
  false
end

#user_groups_requiring_reauthObject



47
48
49
# File 'app/helpers/dashboard_helper.rb', line 47

def user_groups_requiring_reauth
  []
end

#user_roles_mappingObject



51
52
53
54
55
56
57
58
59
60
# File 'app/helpers/dashboard_helper.rb', line 51

def user_roles_mapping
  {
    planner: 'Planner',
    reporter: 'Reporter',
    developer: 'Developer',
    maintainer: 'Maintainer',
    owner: 'Owner',
    guest: 'Guest'
  }
end