FEATURE: Additional enums (#45)

Data explorer displays special information about various enums, this flags more fields that we know are enums leading to a clearer UX.
This commit is contained in:
tshenry 2019-12-08 19:20:34 -08:00 committed by Sam
parent 6f1b246b65
commit 6393831b0b
1 changed files with 28 additions and 3 deletions

View File

@ -374,22 +374,47 @@ SQL
return @enums if @enums
@enums = {
'application_requests.req_type': ApplicationRequest.req_types,
'badges.badge_type_id': Enum.new(:gold, :silver, :bronze, start: 1),
'category_groups.permission_type': CategoryGroup.permission_types,
'category_users.notification_level': CategoryUser.notification_levels,
'directory_items.period_type': DirectoryItem.period_types,
'groups.alias_level': Group::ALIAS_LEVELS,
'groups.id': Group::AUTO_GROUPS,
'groups.mentionable_level': Group::ALIAS_LEVELS,
'groups.messageable_level': Group::ALIAS_LEVELS,
'groups.members_visibility_level': Group.visibility_levels,
'groups.visibility_level': Group.visibility_levels,
'groups.default_notification_level': GroupUser.notification_levels,
'group_users.notification_level': GroupUser.notification_levels,
'notifications.notification_type': Notification.types,
'polls.results': Poll.results,
'polls.status': Poll.statuses,
'polls.type': Poll.types,
'polls.visibility': Poll.visibilities,
'post_action_types.id': PostActionType.types,
'post_actions.post_action_type_id': PostActionType.types,
'posts.cook_method': Post.cook_methods,
'posts.hidden_reason_id': Post.hidden_reasons,
'posts.post_type': Post.types,
'post_actions.post_action_type_id': PostActionType.types,
'post_action_types.id': PostActionType.types,
'reviewable_histories.reviewable_history_type': ReviewableHistory.types,
'reviewable_scores.status': ReviewableScore.statuses,
'screened_emails.action_type': ScreenedEmail.actions,
'screened_ip_addresses.action_type': ScreenedIpAddress.actions,
'screened_urls.action_type': ScreenedUrl.actions,
'search_logs.search_result_type': SearchLog.search_result_types,
'search_logs.search_type': SearchLog.search_types,
'site_settings.data_type': SiteSetting.types,
'skipped_email_logs.reason_type': SkippedEmailLog.reason_types,
'tag_group_permissions.permission_type': TagGroupPermission.permission_types,
'theme_settings.data_type': ThemeSetting.types,
'topic_timers.status_type': TopicTimer.types,
'topic_users.notification_level': TopicUser.notification_levels,
'topic_users.notifications_reason_id': TopicUser.notification_reasons,
'user_histories.action': UserHistory.actions,
'user_security_keys.factor_type': UserSecurityKey.factor_types,
'users.trust_level': TrustLevel.levels,
'web_hooks.content_type': WebHook.content_types,
'web_hooks.last_delivery_status': WebHook.last_delivery_statuses,
}.with_indifferent_access
# QueuedPost is removed in recent Discourse releases