Skip to content

Commit

Permalink
fix padding
Browse files Browse the repository at this point in the history
  • Loading branch information
daibhin committed Nov 2, 2023
2 parents e2387f8 + 3819d76 commit e32139b
Show file tree
Hide file tree
Showing 191 changed files with 3,181 additions and 798 deletions.
8 changes: 4 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,6 @@ module.exports = {
element: 'Select',
message: 'use <LemonSelect> instead',
},
{
element: 'a',
message: 'use <Link> instead',
},
],
},
],
Expand Down Expand Up @@ -189,6 +185,10 @@ module.exports = {
element: 'ReactMarkdown',
message: 'use <LemonMarkdown> instead',
},
{
element: 'a',
message: 'use <Link> instead',
},
],
},
],
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ jobs:
- name: Check for syntax errors, import sort, and code style violations
run: |
ruff .
ruff check .
- name: Check formatting
run: |
black --exclude posthog/hogql/grammar --check --diff .
ruff format --exclude posthog/hogql/grammar --check --diff .
- name: Check static typing
run: |
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ services:
restart: on-failure

kafka:
image: bitnami/kafka:3.5.1
image: ghcr.io/posthog/kafka-container:v2.8.2
restart: on-failure
depends_on:
- zookeeper
Expand Down
2 changes: 1 addition & 1 deletion ee/api/explicit_team_member.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def create(self, validated_data):
user_uuid = validated_data.pop("user_uuid")
validated_data["team"] = team
try:
requesting_parent_membership: (OrganizationMembership) = OrganizationMembership.objects.get(
requesting_parent_membership: OrganizationMembership = OrganizationMembership.objects.get(
organization_id=team.organization_id,
user__uuid=user_uuid,
user__is_active=True,
Expand Down
2 changes: 1 addition & 1 deletion ee/api/role.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class RolePermissions(BasePermission):
def has_permission(self, request, view):
organization = request.user.organization

requesting_membership: (OrganizationMembership) = OrganizationMembership.objects.get(
requesting_membership: OrganizationMembership = OrganizationMembership.objects.get(
user_id=cast(User, request.user).id,
organization=organization,
)
Expand Down
30 changes: 18 additions & 12 deletions ee/clickhouse/models/test/test_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -1219,13 +1219,16 @@ def test_person_cohort_properties(self):
)
query = """
SELECT distinct_id FROM person_distinct_id2 WHERE team_id = %(team_id)s {prop_clause}
""".format(
prop_clause=prop_clause
)
""".format(prop_clause=prop_clause)
# get distinct_id column of result
result = sync_execute(query, {"team_id": self.team.pk, **prop_clause_params, **filter.hogql_context.values,},)[
0
][0]
result = sync_execute(
query,
{
"team_id": self.team.pk,
**prop_clause_params,
**filter.hogql_context.values,
},
)[0][0]
self.assertEqual(result, person1_distinct_id)

# test cohort2 with negation
Expand All @@ -1241,13 +1244,16 @@ def test_person_cohort_properties(self):
)
query = """
SELECT distinct_id FROM person_distinct_id2 WHERE team_id = %(team_id)s {prop_clause}
""".format(
prop_clause=prop_clause
)
""".format(prop_clause=prop_clause)
# get distinct_id column of result
result = sync_execute(query, {"team_id": self.team.pk, **prop_clause_params, **filter.hogql_context.values,},)[
0
][0]
result = sync_execute(
query,
{
"team_id": self.team.pk,
**prop_clause_params,
**filter.hogql_context.values,
},
)[0][0]

self.assertEqual(result, person2_distinct_id)

Expand Down
6 changes: 5 additions & 1 deletion ee/clickhouse/queries/funnels/funnel_correlation_persons.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ def actor_query(self, limit_actors: Optional[bool] = True):

def get_actors(
self,
) -> Tuple[Union[QuerySet[Person], QuerySet[Group]], Union[List[SerializedGroup], List[SerializedPerson]], int,]:
) -> Tuple[
Union[QuerySet[Person], QuerySet[Group]],
Union[List[SerializedGroup], List[SerializedPerson]],
int,
]:
if self._filter.correlation_type == FunnelCorrelationType.PROPERTIES:
return _FunnelPropertyCorrelationActors(self._filter, self._team, self._base_uri).get_actors()
else:
Expand Down
2 changes: 1 addition & 1 deletion ee/models/role.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Role(UUIDModel):
related_name="roles",
related_query_name="role",
)
feature_flags_access_level: (models.PositiveSmallIntegerField) = models.PositiveSmallIntegerField(
feature_flags_access_level: models.PositiveSmallIntegerField = models.PositiveSmallIntegerField(
default=OrganizationResourceAccess.AccessLevel.CAN_ALWAYS_EDIT,
choices=OrganizationResourceAccess.AccessLevel.choices,
)
Expand Down
4 changes: 1 addition & 3 deletions ee/session_recordings/session_recording_playlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,7 @@ def modify_recordings(
return response.Response({"success": True})

if request.method == "DELETE":
playlist_item = SessionRecordingPlaylistItem.objects.get(
playlist=playlist, recording=session_recording_id
) # type: ignore
playlist_item = SessionRecordingPlaylistItem.objects.get(playlist=playlist, recording=session_recording_id) # type: ignore

if playlist_item:
playlist_item.delete()
Expand Down
4 changes: 1 addition & 3 deletions ee/tasks/test/test_calculate_cohort.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
from posthog.test.base import ClickhouseTestMixin, _create_event, _create_person


class TestClickhouseCalculateCohort(
ClickhouseTestMixin, calculate_cohort_test_factory(_create_event, _create_person)
): # type: ignore
class TestClickhouseCalculateCohort(ClickhouseTestMixin, calculate_cohort_test_factory(_create_event, _create_person)): # type: ignore
@patch("posthog.tasks.calculate_cohort.insert_cohort_from_insight_filter.delay")
def test_create_stickiness_cohort(self, _insert_cohort_from_insight_filter):
_create_person(team_id=self.team.pk, distinct_ids=["blabla"])
Expand Down
Binary file modified frontend/__snapshots__/components-hogqleditor--hog-ql-editor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/__snapshots__/components-hogqleditor--no-value.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/__snapshots__/scenes-app-surveys--new-survey.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/__snapshots__/scenes-app-surveys--survey-templates.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/__snapshots__/scenes-other-preflight--preflight.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ function Header({
{!hideEdit &&
isViewable &&
(hasTaxonomyFeatures ? (
<a onClick={onEdit}>Edit</a>
<Link onClick={onEdit}>Edit</Link>
) : (
<Tooltip title="Creating and editing definitions require a premium license">
<a onClick={onEdit} className="definition-popover-disabled-button">
<Link onClick={onEdit} className="definition-popover-disabled-button">
Edit
</a>
</Link>
</Tooltip>
))}
{!hideView && isViewable && (
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/lib/components/HogQLEditor/HogQLEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { LemonButton } from 'lib/lemon-ui/LemonButton'
import { IconErrorOutline, IconInfo } from 'lib/lemon-ui/icons'
import { useActions, useValues } from 'kea'
import { hogQLEditorLogic } from './hogQLEditorLogic'
import { Link } from '@posthog/lemon-ui'

export interface HogQLEditorProps {
onChange: (value: string) => void
Expand Down Expand Up @@ -93,9 +94,9 @@ export function HogQLEditor({
disablePersonProperties ? '' : 'w-full '
}text-right select-none ${CLICK_OUTSIDE_BLOCK_CLASS}`}
>
<a href="https://posthog.com/manual/hogql" target={'_blank'}>
<Link to="https://posthog.com/manual/hogql" target="_blank">
Learn more about HogQL
</a>
</Link>
</div>
</div>
</>
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lib/components/JSBookmarklet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export function JSBookmarklet({ team }: { team: TeamBasicType }): JSX.Element {

return (
<>
{/* eslint-disable-next-line react/forbid-elements */}
<a
href={href}
className="w-full text-primary-alt bg-primary-alt-highlight rounded-lg justify-center p-4 flex font-bold gap-2 items-center"
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/lib/components/PayGateMini/PayGateMini.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { LemonButton } from 'lib/lemon-ui/LemonButton'
import './PayGateMini.scss'
import { FEATURE_MINIMUM_PLAN, POSTHOG_CLOUD_STANDARD_PLAN } from 'lib/constants'
import clsx from 'clsx'
import { Link } from '@posthog/lemon-ui'

type PayGateSupportedFeatures =
| AvailableFeature.DASHBOARD_PERMISSIONING
Expand Down Expand Up @@ -124,9 +125,9 @@ export function PayGateMini({
{featureSummary.docsHref && (
<>
{' '}
<a href={featureSummary.docsHref} target="_blank" rel="noopener noreferrer">
<Link to={featureSummary.docsHref} target="_blank">
Learn more in PostHog Docs.
</a>
</Link>
</>
)}
</div>
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/lib/components/PersonalAPIKeys/PersonalAPIKeys.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { humanFriendlyDetailedTime } from 'lib/utils'
import { CopyToClipboardInline } from '../CopyToClipboard'
import { ColumnsType } from 'antd/lib/table'
import { LemonButton } from 'lib/lemon-ui/LemonButton'
import { LemonInput, LemonModal } from '@posthog/lemon-ui'
import { LemonInput, LemonModal, Link } from '@posthog/lemon-ui'
import { LemonBanner } from 'lib/lemon-ui/LemonBanner'
import { IconPlus } from 'lib/lemon-ui/icons'

Expand Down Expand Up @@ -94,7 +94,7 @@ function RowActionsCreator(
deleteKey(personalAPIKey)
}}
>
<a className="text-danger">Delete</a>
<span className="text-danger">Danger</span>
</Popconfirm>
)
}
Expand Down Expand Up @@ -156,14 +156,14 @@ export function PersonalAPIKeys(): JSX.Element {
<p>
These keys allow full access to your personal account through the API, as if you were logged in. You can
also use them in integrations, such as{' '}
<a href="https://zapier.com/apps/posthog/">our premium Zapier one</a>.
<Link to="https://zapier.com/apps/posthog/">our premium Zapier one</Link>.
<br />
Try not to keep disused keys around. If you have any suspicion that one of these may be compromised,
delete it and use a new one.
<br />
<a href="https://posthog.com/docs/api/overview#authentication">
<Link to="https://posthog.com/docs/api/overview#authentication">
More about API authentication in PostHog Docs.
</a>
</Link>
</p>
<LemonButton
type="primary"
Expand Down
11 changes: 5 additions & 6 deletions frontend/src/lib/components/PropertiesTable/PropertiesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import { KEY_MAPPING, keyMappingKeys } from 'lib/taxonomy'
import { PropertyKeyInfo } from '../PropertyKeyInfo'
import { Dropdown, Input, Menu, Popconfirm } from 'antd'
import { isURL } from 'lib/utils'
import { IconDeleteForever, IconOpenInNew } from 'lib/lemon-ui/icons'
import { IconDeleteForever } from 'lib/lemon-ui/icons'
import './PropertiesTable.scss'
import { LemonTable, LemonTableColumns, LemonTableProps } from 'lib/lemon-ui/LemonTable'
import { CopyToClipboardInline } from '../CopyToClipboard'
import { useValues } from 'kea'
import { propertyDefinitionsModel } from '~/models/propertyDefinitionsModel'
import { LemonButton } from 'lib/lemon-ui/LemonButton'
import { NewPropertyComponent } from 'scenes/persons/NewPropertyComponent'
import { LemonCheckbox, LemonInput } from '@posthog/lemon-ui'
import { LemonCheckbox, LemonInput, Link } from '@posthog/lemon-ui'
import clsx from 'clsx'
import { PropertyDefinitionType } from '~/types'

Expand Down Expand Up @@ -93,10 +93,9 @@ function ValueDisplay({
{!isURL(value) ? (
valueString
) : (
<a href={value} target="_blank" rel="noopener noreferrer" className="value-link">
<span>{valueString}</span>
<IconOpenInNew />
</a>
<Link to={value} target="_blank" className="value-link" targetBlankIcon>
{valueString}
</Link>
)}
</span>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'
import { LemonButton } from 'lib/lemon-ui/LemonButton'
import { LemonDivider } from 'lib/lemon-ui/LemonDivider'
import { router, combineUrl } from 'kea-router'
import { Link } from '@posthog/lemon-ui'

interface SocialLoginLinkProps {
provider: SSOProvider
Expand All @@ -28,9 +29,9 @@ function SocialLoginLink({ provider, extraQueryParams, children }: SocialLoginLi
const loginUrl = combineUrl(`/login/${provider}/`, loginParams).url

return (
<a className="block" href={loginUrl}>
<Link className="block" to={loginUrl}>
{children}
</a>
</Link>
)
}

Expand Down
Loading

0 comments on commit e32139b

Please sign in to comment.