From fd9f9c3365ff17921532461b85de77c44816bc8f Mon Sep 17 00:00:00 2001 From: Oliver Browne Date: Wed, 3 Jul 2024 15:34:13 +0200 Subject: [PATCH] add to plugin type enum --- latest_migrations.manifest | 2 +- plugin-server/src/types.ts | 2 +- .../0434_alter_plugin_plugin_type.py | 29 +++++++++++++++++++ posthog/models/plugin.py | 4 +++ 4 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 posthog/migrations/0434_alter_plugin_plugin_type.py diff --git a/latest_migrations.manifest b/latest_migrations.manifest index 42267d1703ff7..af90d9a20626d 100644 --- a/latest_migrations.manifest +++ b/latest_migrations.manifest @@ -5,7 +5,7 @@ contenttypes: 0002_remove_content_type_name ee: 0016_rolemembership_organization_member otp_static: 0002_throttling otp_totp: 0002_auto_20190420_0723 -posthog: 0433_dashboard_idx_dashboard_deleted_team_id +posthog: 0434_alter_plugin_plugin_type sessions: 0001_initial social_django: 0010_uid_db_index two_factor: 0007_auto_20201201_1019 diff --git a/plugin-server/src/types.ts b/plugin-server/src/types.ts index d78b2ba924b4a..9dab16d0b86a6 100644 --- a/plugin-server/src/types.ts +++ b/plugin-server/src/types.ts @@ -389,7 +389,7 @@ export interface Plugin { id: number organization_id: string name: string - plugin_type: 'local' | 'respository' | 'custom' | 'source' + plugin_type: 'local' | 'respository' | 'custom' | 'source' | 'inline' description?: string is_global: boolean is_preinstalled?: boolean diff --git a/posthog/migrations/0434_alter_plugin_plugin_type.py b/posthog/migrations/0434_alter_plugin_plugin_type.py new file mode 100644 index 0000000000000..3d3523495f322 --- /dev/null +++ b/posthog/migrations/0434_alter_plugin_plugin_type.py @@ -0,0 +1,29 @@ +# Generated by Django 4.2.11 on 2024-07-03 13:28 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("posthog", "0433_dashboard_idx_dashboard_deleted_team_id"), + ] + + operations = [ + migrations.AlterField( + model_name="plugin", + name="plugin_type", + field=models.CharField( + blank=True, + choices=[ + ("local", "local"), + ("custom", "custom"), + ("repository", "repository"), + ("source", "source"), + ("inline", "inline"), + ], + default=None, + max_length=200, + null=True, + ), + ), + ] diff --git a/posthog/models/plugin.py b/posthog/models/plugin.py index 87ab0497c8118..f79e7abf2328d 100644 --- a/posthog/models/plugin.py +++ b/posthog/models/plugin.py @@ -149,6 +149,10 @@ class PluginType(models.TextChoices): "source", "source", ) # coded inside the browser (versioned via plugin_source_version) + INLINE = ( + "inline", + "inline", + ) # Code checked into plugin_server, url starts with "inline:" organization: models.ForeignKey = models.ForeignKey( "posthog.Organization",