-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feat/dropdown-min-width
# Conflicts: # frontend/src/lib/lemon-ui/LemonInputSelect/LemonInputSelect.tsx
- Loading branch information
Showing
204 changed files
with
5,414 additions
and
2,431 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,10 +4,8 @@ | |
from rest_framework import status | ||
|
||
from ee.api.test.base import APILicensedTest | ||
from ee.api.test.fixtures.available_product_features import AVAILABLE_PRODUCT_FEATURES | ||
from ee.models.explicit_team_membership import ExplicitTeamMembership | ||
from ee.models.license import License | ||
from posthog.constants import AvailableFeature | ||
from posthog.models import OrganizationMembership | ||
from posthog.models.dashboard import Dashboard | ||
from posthog.models.sharing_configuration import SharingConfiguration | ||
|
@@ -269,7 +267,12 @@ def test_sharing_edits_limited_to_collaborators(self): | |
self.permission_denied_response("You don't have edit permissions for this dashboard."), | ||
) | ||
|
||
def test_cannot_edit_dashboard_description_when_collaboration_not_available(self): | ||
def test_can_edit_dashboard_description_when_collaboration_not_available(self): | ||
""" | ||
Team collaboration feature is only available on some plans, but if the feature is | ||
not available, the user should still be able to read/write for migration purposes. | ||
The access to the feature is blocked in the UI, so this is unlikely to be truly abused. | ||
""" | ||
self.client.logout() | ||
|
||
self.organization.available_features = [] | ||
|
@@ -288,49 +291,16 @@ def test_cannot_edit_dashboard_description_when_collaboration_not_available(self | |
name="example dashboard", | ||
) | ||
|
||
response = self.client.patch( | ||
f"/api/projects/{self.team.id}/dashboards/{dashboard.id}", | ||
{ | ||
"description": "i should not be allowed to edit this", | ||
"name": "even though I am allowed to edit this", | ||
}, | ||
) | ||
|
||
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) | ||
|
||
dashboard.refresh_from_db() | ||
self.assertEqual(dashboard.description, "") | ||
self.assertEqual(dashboard.name, "example dashboard") | ||
|
||
def test_can_edit_dashboard_description_when_collaboration_is_available(self): | ||
self.client.logout() | ||
|
||
self.organization.available_features = [AvailableFeature.TEAM_COLLABORATION] | ||
self.organization.available_product_features = AVAILABLE_PRODUCT_FEATURES | ||
self.organization.save() | ||
self.team.access_control = True | ||
self.team.save() | ||
|
||
user_with_collaboration = User.objects.create_and_join( | ||
self.organization, "[email protected]", None | ||
) | ||
self.client.force_login(user_with_collaboration) | ||
|
||
dashboard: Dashboard = Dashboard.objects.create( | ||
team=self.team, | ||
name="example dashboard", | ||
) | ||
|
||
response = self.client.patch( | ||
f"/api/projects/{self.team.id}/dashboards/{dashboard.id}", | ||
{ | ||
"description": "i should be allowed to edit this", | ||
"name": "and so also to edit this", | ||
"name": "as well as this", | ||
}, | ||
) | ||
|
||
self.assertEqual(response.status_code, status.HTTP_200_OK) | ||
|
||
dashboard.refresh_from_db() | ||
self.assertEqual(dashboard.description, "i should be allowed to edit this") | ||
self.assertEqual(dashboard.name, "and so also to edit this") | ||
self.assertEqual(dashboard.name, "as well as this") |
2 changes: 1 addition & 1 deletion
2
ee/clickhouse/views/test/__snapshots__/test_clickhouse_experiment_secondary_results.ambr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.