diff --git a/app/assets/stylesheets/components/browse-list.scss b/app/assets/stylesheets/components/browse-list.scss index 14f7b59f8..95128534f 100644 --- a/app/assets/stylesheets/components/browse-list.scss +++ b/app/assets/stylesheets/components/browse-list.scss @@ -11,6 +11,7 @@ &-item, &-sub-item { + @include bold-24; list-style: none; margin-bottom: $gutter-half; } diff --git a/app/main/views/organisations.py b/app/main/views/organisations.py index be2395b8c..4a0ba7065 100644 --- a/app/main/views/organisations.py +++ b/app/main/views/organisations.py @@ -56,6 +56,9 @@ def add_organisation(): @user_has_permissions() def organisation_dashboard(org_id): organisation_services = organisations_client.get_organisation_services(org_id) + for service in organisation_services: + has_permission = current_user.has_permission_for_service(service['id'], 'view_activity') + service.update({'has_permission_to_view': has_permission}) return render_template( 'views/organisations/organisation/index.html', diff --git a/app/templates/views/organisations/organisation/index.html b/app/templates/views/organisations/organisation/index.html index 55ca47512..6e7fb3b25 100644 --- a/app/templates/views/organisations/organisation/index.html +++ b/app/templates/views/organisations/organisation/index.html @@ -16,7 +16,11 @@ diff --git a/tests/app/main/views/organisations/test_organisation_invites.py b/tests/app/main/views/organisations/test_organisation_invites.py index e261d7dc6..3e6e75482 100644 --- a/tests/app/main/views/organisations/test_organisation_invites.py +++ b/tests/app/main/views/organisations/test_organisation_invites.py @@ -99,14 +99,17 @@ def test_organisation_services_show( assert len(page.select('.browse-list-item')) == 3 - for i in range(0, 3): + for i in range(0, 2): service_name = mock_get_organisation_services(mock_get_organisation['id'])[i]['name'] service_id = mock_get_organisation_services(mock_get_organisation['id'])[i]['id'] assert normalize_spaces(page.select('.browse-list-item')[i].text) == service_name - assert normalize_spaces( - page.select('.browse-list-item a')[i]['href'] - ) == '/services/{}'.format(service_id) + if i > 1: + assert normalize_spaces( + page.select('.browse-list-item a')[i]['href'] + ) == '/services/{}'.format(service_id) + else: + assert page.select('.browse-list-item')[i].find('a') is None def test_view_team_members( diff --git a/tests/conftest.py b/tests/conftest.py index a70a7ce19..b8cfc1488 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -2756,12 +2756,12 @@ def mock_update_service_organisation(mocker): @pytest.fixture(scope='function') -def mock_get_organisation_services(mocker): +def mock_get_organisation_services(mocker, api_user_active): def _get_organisation_services(organisation_id): return [ service_json('12345', 'service one'), service_json('67890', 'service two'), - service_json('09876', 'service three') + service_json(SERVICE_ONE_ID, 'service one', [api_user_active.id]) ] return mocker.patch(