From 6393831b0b056257c8a40676ede7f043035c3603 Mon Sep 17 00:00:00 2001 From: tshenry Date: Sun, 8 Dec 2019 19:20:34 -0800 Subject: [PATCH] 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. --- plugin.rb | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/plugin.rb b/plugin.rb index c1e7ebd..cad6d24 100644 --- a/plugin.rb +++ b/plugin.rb @@ -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