If the integration connection is local, don’t show the irrelevant tabs

This commit is contained in:
James Ritchie
2023-06-27 16:45:52 +01:00
parent ae243c783a
commit 3227da122e
2 changed files with 18 additions and 20 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB

@@ -57,6 +57,23 @@ export default function Integrations() {
const { client } = useTypedLoaderData<typeof loader>();
const organization = useOrganization();
const project = useProject();
let tabs = [
{
label: "Jobs",
to: integrationClientPath(organization, project, client),
},
];
if (client.authMethod.type !== "local") {
tabs.push({
label: "Connections",
to: integrationClientConnectionsPath(organization, project, client),
});
tabs.push({
label: "Scopes",
to: integrationClientScopesPath(organization, project, client),
});
}
return (
<PageContainer>
@@ -101,26 +118,7 @@ export default function Integrations() {
/>
</PageInfoGroup>
</PageInfoRow>
<PageTabs
tabs={[
{
label: "Jobs",
to: integrationClientPath(organization, project, client),
},
{
label: "Connections",
to: integrationClientConnectionsPath(
organization,
project,
client
),
},
{
label: "Scopes",
to: integrationClientScopesPath(organization, project, client),
},
]}
/>
<PageTabs tabs={tabs} />
</PageHeader>
<PageBody scrollable={true}>