Repository: PostHog/posthog
Pull request: Do not open people modal on retention panel in dashboard
## Changes

*Please describe.*  
*If this affects the frontend, include screenshots.*  

Closes #3132

When I opened the issue I was in the middle of a demo so couldn't do the immediate fix.

Here it is now.

## Checklist

- [ ] All querysets/queries filter by Organization, by Team, and by User
- [ ] Django backend tests
- [ ] Jest frontend tests
- [ ] Cypress end-to-end tests


Problem statement:
Hide PII in Shared Dashboards
## Is your feature request related to a problem?

*Please describe.*

When I share a dashboard clicking on a data point gives me the list of users just like in-app. Problem is, if I'm sharing this outside of PostHog, I most likely want to display aggregate data without PII.

## Describe the solution you'd like

Disallow data point user loading on shared dashboard links.

## Describe alternatives you've considered

Leave as is

## Additional context



#### *Thank you* for your feature request – we love each and every one!

Hints from issue discussion:
Seems like retention is the only one missing, other views already restrict this

Commit message: Do not open people modal on retention panel in dashboard

Patch to review:
diff --git a/frontend/src/scenes/retention/RetentionTable.tsx b/frontend/src/scenes/retention/RetentionTable.tsx
index 7a6f29710d857..1710a79bb2237 100644
--- a/frontend/src/scenes/retention/RetentionTable.tsx
+++ b/frontend/src/scenes/retention/RetentionTable.tsx
@@ -88,14 +88,14 @@ export function RetentionTable({
                 size="small"
                 className="retention-table"
                 pagination={{ pageSize: 99999, hideOnSinglePage: true }}
-                rowClassName={'cursor-pointer'}
+                rowClassName={!dashboardItemId ? 'cursor-pointer' : ''}
                 dataSource={results}
                 columns={columns}
                 rowKey="date"
                 loading={resultsLoading}
                 onRow={(_, rowIndex: number | undefined) => ({
                     onClick: () => {
-                        if (rowIndex !== undefined) {
+                        if (!dashboardItemId && rowIndex !== undefined) {
                             loadPeople(rowIndex)
                             setModalVisible(true)
                             selectRow(rowIndex)


Code review comments:
diff_hunk: @@ -88,14 +88,14 @@ export function RetentionTable({
                 size="small"
                 className="retention-table"
                 pagination={{ pageSize: 99999, hideOnSinglePage: true }}
-                rowClassName={'cursor-pointer'}
+                rowClassName={!dashboardItemId ? 'cursor-pointer' : ''}
path: frontend/src/scenes/retention/RetentionTable.tsx
text: @user1:
super nit but just for readability, this logic can be flipped so you don't need negation

@author:
Yeah it's best practice to not have a negation on a boolean but it felt weird to me to have the `' '` as the "default" condition