Skip to content

Commit

Permalink
Merge branch 'master' into feat/annotations-in-data-management
Browse files Browse the repository at this point in the history
# Conflicts:
#	frontend/__snapshots__/scenes-app-notebooks--recordings-playlist.png
  • Loading branch information
benjackwhite committed Nov 7, 2023
2 parents f9b4448 + 0bdbd25 commit f4736d8
Show file tree
Hide file tree
Showing 9 changed files with 94 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
box-shadow: 0px 0px 30px rgba(0, 0, 0, 0.2);

[theme='dark'] & {
box-shadow: 0px 0px 30px rgba(255, 255, 255, 0.1);
box-shadow: none;
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.PropertyFilterButton {
overflow: hidden;
color: var(--bg-charcoal);
border-color: transparent;
background: var(--border);
display: inline-flex;
Expand All @@ -10,7 +9,7 @@
&:focus {
border-color: var(--border);
background: var(--border);
color: var(--bg-charcoal);
color: var(--text-default);
}

text-shadow: none;
Expand All @@ -27,8 +26,4 @@
overflow: hidden;
text-overflow: ellipsis;
}

.anticon-close {
color: var(--bg-charcoal);
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Select } from 'antd'
import { FundOutlined } from '@ant-design/icons'
import { smoothingOptions } from './smoothings'
import { useActions, useValues } from 'kea'
import { insightLogic } from 'scenes/insights/insightLogic'
import { insightVizDataLogic } from 'scenes/insights/insightVizDataLogic'
import { trendsDataLogic } from 'scenes/trends/trendsDataLogic'
import { LemonSelect } from '@posthog/lemon-ui'

export function SmoothingFilter(): JSX.Element | null {
const { insightProps } = useValues(insightLogic)
Expand All @@ -31,9 +31,8 @@ export function SmoothingFilter(): JSX.Element | null {
}))

return options.length ? (
<Select
<LemonSelect
key={interval}
bordered
value={smoothing_intervals || 1}
dropdownMatchSelectWidth={false}
onChange={(key) => {
Expand All @@ -43,6 +42,7 @@ export function SmoothingFilter(): JSX.Element | null {
}}
data-attr="smoothing-filter"
options={options}
size="small"
/>
) : (
<></>
Expand Down
13 changes: 13 additions & 0 deletions frontend/src/styles/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,19 @@ body {
}
.ant-select-dropdown {
z-index: var(--z-ant-select-dropdown);
background-color: var(--bg-3000);

.ant-select-item.ant-select-item-option {
background-color: var(--bg-3000);

&.ant-select-item-option-active {
background-color: var(--border-3000);
}
}
}

.ant-input-number-group-addon {
background: var(--bg-3000);
}

.ant-picker-dropdown {
Expand Down
2 changes: 1 addition & 1 deletion latest_migrations.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ contenttypes: 0002_remove_content_type_name
ee: 0015_add_verified_properties
otp_static: 0002_throttling
otp_totp: 0002_auto_20190420_0723
posthog: 0360_externaldatasource_destination_id
posthog: 0361_add_plugin_config_ui_fields
sessions: 0001_initial
social_django: 0010_uid_db_index
two_factor: 0007_auto_20201201_1019
4 changes: 4 additions & 0 deletions posthog/api/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,10 @@ class Meta:
"plugin_info",
"delivery_rate_24h",
"created_at",
"updated_at",
"name",
"description",
"deleted",
]
read_only_fields = [
"id",
Expand Down
40 changes: 39 additions & 1 deletion posthog/api/test/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,8 @@ def test_create_plugin_config(self, mock_get, mock_reload):
"enabled": True,
"order": 0,
"config": json.dumps({"bar": "moop"}),
"name": "name in ui",
"description": "description in ui",
},
format="multipart",
)
Expand All @@ -955,6 +957,10 @@ def test_create_plugin_config(self, mock_get, mock_reload):
"plugin_info": None,
"delivery_rate_24h": None,
"created_at": mock.ANY,
"updated_at": mock.ANY,
"name": "name in ui",
"description": "description in ui",
"deleted": False,
},
)
plugin_config = PluginConfig.objects.first()
Expand Down Expand Up @@ -993,6 +999,10 @@ def test_create_plugin_config(self, mock_get, mock_reload):
"plugin_info": None,
"delivery_rate_24h": None,
"created_at": mock.ANY,
"updated_at": mock.ANY,
"name": "name in ui",
"description": "description in ui",
"deleted": False,
},
)
self.client.delete(f"/api/plugin_config/{plugin_config_id}")
Expand Down Expand Up @@ -1309,6 +1319,10 @@ def test_create_plugin_config_with_secrets(self, mock_get, mock_reload):
"plugin_info": None,
"delivery_rate_24h": None,
"created_at": mock.ANY,
"updated_at": mock.ANY,
"name": None,
"description": None,
"deleted": False,
},
)

Expand All @@ -1334,6 +1348,10 @@ def test_create_plugin_config_with_secrets(self, mock_get, mock_reload):
"plugin_info": None,
"delivery_rate_24h": None,
"created_at": mock.ANY,
"updated_at": mock.ANY,
"name": None,
"description": None,
"deleted": False,
},
)

Expand Down Expand Up @@ -1361,6 +1379,10 @@ def test_create_plugin_config_with_secrets(self, mock_get, mock_reload):
"plugin_info": None,
"delivery_rate_24h": None,
"created_at": mock.ANY,
"updated_at": mock.ANY,
"name": None,
"description": None,
"deleted": False,
},
)
plugin_config = PluginConfig.objects.get(plugin=plugin_id)
Expand All @@ -1370,7 +1392,15 @@ def test_create_plugin_config_with_secrets(self, mock_get, mock_reload):
def test_plugin_config_list(self, mock_get, mock_reload):
plugin = Plugin.objects.create(organization=self.organization)
plugin_config1 = PluginConfig.objects.create(plugin=plugin, team=self.team, enabled=True, order=1)
plugin_config2 = PluginConfig.objects.create(plugin=plugin, team=self.team, enabled=True, order=2)
plugin_config2 = PluginConfig.objects.create(
plugin=plugin,
team=self.team,
enabled=True,
order=2,
name="ui name",
description="ui description",
deleted=True,
)

create_app_metric(
team_id=self.team.pk,
Expand All @@ -1397,6 +1427,10 @@ def test_plugin_config_list(self, mock_get, mock_reload):
"plugin_info": None,
"delivery_rate_24h": 0.5,
"created_at": mock.ANY,
"updated_at": mock.ANY,
"name": None,
"description": None,
"deleted": False,
},
{
"id": plugin_config2.pk,
Expand All @@ -1409,6 +1443,10 @@ def test_plugin_config_list(self, mock_get, mock_reload):
"plugin_info": None,
"delivery_rate_24h": None,
"created_at": mock.ANY,
"updated_at": mock.ANY,
"name": "ui name",
"description": "ui description",
"deleted": True,
},
],
)
Expand Down
27 changes: 27 additions & 0 deletions posthog/migrations/0361_add_plugin_config_ui_fields.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Generated by Django 3.2.19 on 2023-11-07 11:02

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("posthog", "0360_externaldatasource_destination_id"),
]

operations = [
migrations.AddField(
model_name="pluginconfig",
name="deleted",
field=models.BooleanField(default=False, null=True),
),
migrations.AddField(
model_name="pluginconfig",
name="description",
field=models.CharField(blank=True, max_length=1000, null=True),
),
migrations.AddField(
model_name="pluginconfig",
name="name",
field=models.CharField(blank=True, max_length=400, null=True),
),
]
5 changes: 5 additions & 0 deletions posthog/models/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,11 @@ class Meta:

created_at: models.DateTimeField = models.DateTimeField(auto_now_add=True)
updated_at: models.DateTimeField = models.DateTimeField(auto_now=True)
# Used in the frontend
name: models.CharField = models.CharField(max_length=400, null=True, blank=True)
description: models.CharField = models.CharField(max_length=1000, null=True, blank=True)
# Used in the frontend to hide pluginConfgis that user deleted
deleted: models.BooleanField = models.BooleanField(default=False, null=True)


class PluginAttachment(models.Model):
Expand Down

0 comments on commit f4736d8

Please sign in to comment.