From 884cd10a34c8017a5ddb10d84a79ffa20dbf673f Mon Sep 17 00:00:00 2001 From: Gregor Vostrak Date: Tue, 16 Apr 2024 00:26:50 +0200 Subject: [PATCH] add billing section links to the organization switcher and organization settings --- e2e/organization.spec.ts | 8 ++-- .../js/Components/OrganizationSwitcher.vue | 11 ++++- resources/js/Pages/Teams/Create.vue | 4 +- .../Pages/Teams/Partials/CreateTeamForm.vue | 6 +-- .../Teams/Partials/UpdateTeamNameForm.vue | 44 ++++++++++++------- resources/js/Pages/Teams/Show.vue | 4 +- resources/js/utils/billing.ts | 3 ++ 7 files changed, 52 insertions(+), 28 deletions(-) create mode 100644 resources/js/utils/billing.ts diff --git a/e2e/organization.spec.ts b/e2e/organization.spec.ts index 4b84f4f9..01754d4c 100644 --- a/e2e/organization.spec.ts +++ b/e2e/organization.spec.ts @@ -4,14 +4,14 @@ import { PLAYWRIGHT_BASE_URL } from '../playwright/config'; async function goToOrganizationSettings(page) { await page.goto(PLAYWRIGHT_BASE_URL + '/dashboard'); await page.locator('[data-testid="organization_switcher"]:visible').click(); - await page.getByText('Team Settings').click(); + await page.getByText('Organization Settings').click(); } test('test that organization name can be updated', async ({ page }) => { await goToOrganizationSettings(page); - await page.getByLabel('Team Name').fill('NEW ORG NAME'); - await page.getByLabel('Team Name').press('Enter'); - await page.getByLabel('Team Name').press('Meta+r'); + await page.getByLabel('Organization Name').fill('NEW ORG NAME'); + await page.getByLabel('Organization Name').press('Enter'); + await page.getByLabel('Organization Name').press('Meta+r'); await expect( page.locator('[data-testid="organization_switcher"]:visible') ).toContainText('NEW ORG NAME'); diff --git a/resources/js/Components/OrganizationSwitcher.vue b/resources/js/Components/OrganizationSwitcher.vue index f501e26e..55717e6a 100644 --- a/resources/js/Components/OrganizationSwitcher.vue +++ b/resources/js/Components/OrganizationSwitcher.vue @@ -4,6 +4,7 @@ import Dropdown from '@/Components/Dropdown.vue'; import DropdownLink from '@/Components/DropdownLink.vue'; import { router, usePage } from '@inertiajs/vue3'; import type { Organization, User } from '@/types/models'; +import { isBillingActivated } from '@/utils/billing'; const page = usePage<{ jetstream: { @@ -80,7 +81,15 @@ const switchToTeam = (team: Organization) => { page.props.auth.user.current_team.id ) "> - Team Settings + Organization Settings + + + + Billing