diff --git a/geoinsight/core/rest/analytics.py b/geoinsight/core/rest/analytics.py index cac2f8e3..229717a5 100644 --- a/geoinsight/core/rest/analytics.py +++ b/geoinsight/core/rest/analytics.py @@ -25,6 +25,10 @@ class AnalyticsViewSet(ReadOnlyModelViewSet): url_path=r'project/(?P[\d*]+)/types', ) def list_types(self, request, project_id: int, **kwargs): + # TODO: remove this when analytics are ready to be shown to all users + if not request.user.is_superuser: + return Response([], status=200) + serialized = [] for analysis_type in analysis_types: if not analysis_type.is_enabled(): diff --git a/geoinsight/core/tests/test_analytics.py b/geoinsight/core/tests/test_analytics.py index 3d540704..521b6a06 100644 --- a/geoinsight/core/tests/test_analytics.py +++ b/geoinsight/core/tests/test_analytics.py @@ -5,9 +5,13 @@ @pytest.mark.django_db -def test_rest_list_analysis_types(authenticated_api_client, project): +def test_rest_list_analysis_types(user, authenticated_api_client, project): from geoinsight.core.tasks.analytics import analysis_types + # TODO: remove this when analytics are no longer hidden from non-superusers + user.is_superuser = True + user.save() + analysis_type_instances = [at() for at in analysis_types] resp = authenticated_api_client.get(f'/api/v1/analytics/project/{project.id}/types/') data = resp.json() diff --git a/web/src/store/app.ts b/web/src/store/app.ts index ff8342fc..873ae1c2 100644 --- a/web/src/store/app.ts +++ b/web/src/store/app.ts @@ -4,7 +4,7 @@ import { ref } from 'vue'; export const useAppStore = defineStore('app', () => { const theme = ref<"dark" | "light">("light"); - const openSidebars = ref<("left" | "right")[]>(["left", "right"]); + const openSidebars = ref<("left" | "right")[]>(["left"]); const currentUser = ref(); const currentError = ref(); diff --git a/web/src/store/panel.ts b/web/src/store/panel.ts index b9ec1107..1c93c198 100644 --- a/web/src/store/panel.ts +++ b/web/src/store/panel.ts @@ -40,6 +40,7 @@ function defaultPanelArrangement(): FloatingPanelConfig[] { label: "Charts", visible: true, closeable: true, + collapsed: true, dock: 'right', order: 1, }, @@ -48,14 +49,16 @@ function defaultPanelArrangement(): FloatingPanelConfig[] { label: 'Networks', visible: true, closeable: true, + collapsed: true, dock: 'right', order: 2, }, { id: "analytics", label: "Analytics", - visible: true, + visible: false, closeable: true, + collapsed: true, dock: 'right', order: 3, },