-
Notifications
You must be signed in to change notification settings - Fork 1
/
subcategory.rb
59 lines (54 loc) · 2.61 KB
/
subcategory.rb
1
2
3
4
5
6
7
8
9
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
class Subcategory < ActiveHash::Base
self.data = [
# Demo
{ key: 'demo', name: 'Demo', category_key: 'demo' },
# Getting Started
{ key: 'installation', name: 'Installation', category_key: 'getting_started' },
{ key: 'quick_start', name: 'Quick Start', category_key: 'getting_started' },
{ key: 'how_it_works', name: 'How It Works', category_key: 'getting_started' },
# Data
{ key: 'data_overview', name: 'Overview', category_key: 'data' },
{ key: 'measures', name: 'Measures', category_key: 'data' },
{ key: 'dimensions', name: 'Dimensions', category_key: 'data' },
{ key: 'filters', name: 'Filters', category_key: 'data' },
{ key: 'contextual_filters', name: 'Contextual Filters', category_key: 'data' },
{ key: 'series', name: 'Series', category_key: 'data' },
{ key: 'limit', name: 'Limit', category_key: 'data' },
{ key: 'order', name: 'Order', category_key: 'data' },
{ key: 'data_methods', name: 'Data Methods', category_key: 'data' },
# Visualization
{ key: 'visualization_overview', name: 'Overview', category_key: 'visualization' },
{ key: 'bar_charts', name: 'Bar Charts', category_key: 'visualization' },
{ key: 'line_charts', name: 'Line Charts', category_key: 'visualization' },
{ key: 'other_charts', name: 'Other Charts', category_key: 'visualization' },
{ key: 'tables', name: 'Tables', category_key: 'visualization' },
{ key: 'legends', name: 'Legends', category_key: 'visualization' },
# Interaction
{ key: 'interaction_filters', name: 'Form Filters', category_key: 'interaction' },
{ key: 'actions', name: 'Actions', category_key: 'interaction' },
# Configuration
{ key: 'autocomplete', name: 'Autocomplete Results', category_key: 'configuration' },
{ key: 'caching', name: 'Caching', category_key: 'configuration' },
{ key: 'context_params_modification', name: 'Context Params Modification', category_key: 'configuration' },
{ key: 'context_record', name: 'Context Record', category_key: 'configuration' },
{ key: 'concurrent_queries', name: 'Concurrent Queries', category_key: 'configuration' },
{ key: 'first_day_of_the_week', name: 'First Day of the Week', category_key: 'configuration' },
{ key: 'properties', name: 'Properties', category_key: 'configuration' },
{ key: 'report_filename', name: 'Report Filename', category_key: 'configuration' },
]
def category
Category.find_by(key: category_key)
end
def examples
@examples ||= Example.where(subcategory_key: key)
end
def show_examples_in_nav?
examples.length > 1
end
def to_param
key
end
def to_s
name
end
end