このコミットが含まれているのは:
@@ -6,16 +6,23 @@ class CountsDefaults
|
||||
|
||||
def self.entries(resource)
|
||||
result = [{ definition: 'history', mode: 'summary', params: {
|
||||
'rows' => [{ field: 'created_at', grain: 'month' }].to_json,
|
||||
'cols' => [{ field: 'event_type' }].to_json,
|
||||
'sort' => 'a0:desc', 'conditions' => '[]' } }]
|
||||
'rows' => 'created_at:month',
|
||||
'cols' => 'event_type',
|
||||
'sort' => 'a0:desc', 'conditions' => '' } }]
|
||||
result << { definition: 'latest', mode: 'summary', params: {
|
||||
'rows' => '', 'cols' => '', 'conditions' => '', 'tags' => '' } }
|
||||
if resource == 'posts'
|
||||
result += [{ definition: 'latest', mode: 'summary', params: {
|
||||
'rows' => '[]', 'cols' => '[]', 'conditions' => '[]', 'tags' => '' } },
|
||||
{ definition: 'latest', mode: 'details', params: {
|
||||
'columns' => POST_COLUMNS.join(','), 'order' => POST_COLUMNS.join(','),
|
||||
'children' => 'tags.name,parents.id', 'nested_json' => '0',
|
||||
'conditions' => '[]', 'tags' => '' } }]
|
||||
result += [{ definition: 'latest', mode: 'details', params: {
|
||||
'columns' => POST_COLUMNS.join(' '), 'order' => POST_COLUMNS.join(' '),
|
||||
'children' => 'tags.name parents.id', 'nested_json' => '0',
|
||||
'conditions' => '', 'tags' => '' } }]
|
||||
end
|
||||
if resource == 'tags'
|
||||
columns = ['resource_id', 'version_no', 'is_latest', 'name', 'category',
|
||||
'aliases', 'parents', 'deprecated', 'event_type', 'user', 'created_at']
|
||||
result << { definition: 'latest', mode: 'details', params: {
|
||||
'columns' => columns.join(' '), 'order' => columns.join(' '),
|
||||
'children' => 'aliases.name parents.name', 'nested_json' => '0' } }
|
||||
end
|
||||
result
|
||||
end
|
||||
@@ -26,8 +33,8 @@ class CountsDefaults
|
||||
entry[:mode] == params.fetch('mode', 'summary')
|
||||
end&.fetch(:params) || {}
|
||||
if settings.key?('sort') && params.key?('rows')
|
||||
actual = JSON.parse(params['rows'])
|
||||
expected = JSON.parse(settings.fetch('rows'))
|
||||
actual = QueryState.axes(params['rows'])
|
||||
expected = QueryState.axes(settings.fetch('rows'))
|
||||
compatible = actual.is_a?(Array) && actual.first.is_a?(Hash) &&
|
||||
actual.first['field'] == expected.first['field'] &&
|
||||
actual.first.fetch('grain', 'month') == expected.first['grain']
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする