mirror of
https://github.com/baz-scm/awesome-reviewers.git
synced 2025-08-20 18:58:52 +03:00
24 lines
2.2 KiB
JSON
24 lines
2.2 KiB
JSON
[
|
|
{
|
|
"discussion_id": "2241445914",
|
|
"pr_number": 35239,
|
|
"pr_file": "frontend/src/scenes/surveys/SurveyResponseLimitWidget.tsx",
|
|
"created_at": "2025-07-30T03:25:00+00:00",
|
|
"commented_code": "+import { IconInfo } from '@posthog/icons'\n+import { LemonBanner, Link, Tooltip } from '@posthog/lemon-ui'\n+import { useValues } from 'kea'\n+import { billingLogic } from 'scenes/billing/billingLogic'\n+import { userLogic } from 'scenes/userLogic'\n+\n+const DEFAULT_SURVEY_RESPONSE_LIMIT = 250\n+\n+export function SurveyResponseLimitWidget(): JSX.Element | null {\n+ const { billing } = useValues(billingLogic)\n+ const { user } = useValues(userLogic)\n+\n+ // Only show for non-admin users\n+ if (user?.is_staff || user?.is_impersonated) {",
|
|
"repo_full_name": "PostHog/posthog",
|
|
"discussion_comments": [
|
|
{
|
|
"comment_id": "2241445914",
|
|
"repo_full_name": "PostHog/posthog",
|
|
"pr_number": 35239,
|
|
"pr_file": "frontend/src/scenes/surveys/SurveyResponseLimitWidget.tsx",
|
|
"discussion_id": "2241445914",
|
|
"commented_code": "@@ -0,0 +1,64 @@\n+import { IconInfo } from '@posthog/icons'\n+import { LemonBanner, Link, Tooltip } from '@posthog/lemon-ui'\n+import { useValues } from 'kea'\n+import { billingLogic } from 'scenes/billing/billingLogic'\n+import { userLogic } from 'scenes/userLogic'\n+\n+const DEFAULT_SURVEY_RESPONSE_LIMIT = 250\n+\n+export function SurveyResponseLimitWidget(): JSX.Element | null {\n+ const { billing } = useValues(billingLogic)\n+ const { user } = useValues(userLogic)\n+\n+ // Only show for non-admin users\n+ if (user?.is_staff || user?.is_impersonated) {",
|
|
"comment_created_at": "2025-07-30T03:25:00+00:00",
|
|
"comment_author": "lucasheriques",
|
|
"comment_body": "`is_staff` and `is_impersonated` are not for user roles, but instead, Django attributes to determine wether the current user has access to the admin panel or if they are impersonating someone\r\n\r\nfor checking if they are an admin, you can instead import the organization logic like this:\r\n\r\n`const { isAdminOrOwner } = useValues(organizationLogic)`\r\n\r\nthere are some examples in the codebase",
|
|
"pr_file_module": null
|
|
}
|
|
]
|
|
}
|
|
] |