Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions web-server/pages/integrations.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
import { Add } from '@mui/icons-material';
import { Button, Divider } from '@mui/material';
import { useEffect } from 'react';
import { Authenticated } from 'src/components/Authenticated';

import { FlexBox } from '@/components/FlexBox';
import { Line } from '@/components/Text';
import { Integration } from '@/constants/integrations';
import { ROUTES } from '@/constants/routes';
import { GithubIntegrationCard } from '@/content/Dashboards/IntegrationCards';
import { PageWrapper } from '@/content/PullRequests/PageWrapper';
import { useAuth } from '@/hooks/useAuth';
import { useBoolState } from '@/hooks/useEasyState';
import ExtendedSidebarLayout from '@/layouts/ExtendedSidebarLayout';
import { useSelector } from '@/store';
import { fetchTeams } from '@/slices/team';
import { useDispatch, useSelector } from '@/store';
import { PageLayout } from '@/types/resources';
import { depFn } from '@/utils/fn';

function Integrations() {
return (
Expand Down Expand Up @@ -39,8 +45,24 @@ Integrations.getLayout = (page: PageLayout) => (
export default Integrations;

const Content = () => {
const { orgId } = useAuth();
const isLinked = useSelector((s) => s.auth.org.integrations.github === true);
const teamCount = useSelector((s) => s.app.allTeams.length);
const teams = useSelector((s) => s.team.teams);
const dispatch = useDispatch();
const loading = useBoolState(false);

useEffect(() => {
if (!orgId) return;
depFn(loading.true);
dispatch(
fetchTeams({
org_id: orgId,
provider: Integration.GITHUB
})
).finally(loading.false);
}, [dispatch, loading.false, loading.true, orgId]);

const teamCount = teams.length;
return (
<FlexBox col gap2>
<Line white fontSize={'24px'}>
Expand All @@ -50,7 +72,7 @@ const Content = () => {
<FlexBox>
<GithubIntegrationCard />
</FlexBox>
{isLinked && !teamCount && (
{isLinked && !teamCount && !loading && (
<FlexBox mt={'56px'} col fit alignStart>
<Line fontSize={'24px'} semibold white>
Create team structure to see DORA
Expand Down
5 changes: 4 additions & 1 deletion web-server/pages/welcome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import LoginCenter from '@/assets/login-presentation.svg';
import { FlexBox } from '@/components/FlexBox';
import { Logo } from '@/components/Logo/Logo';
import { Line } from '@/components/Text';
import { ROUTES } from '@/constants/routes';

function Page() {
return (
Expand Down Expand Up @@ -110,7 +111,9 @@ const OnboardingContent = () => {
</FlexBox>
))}
</FlexBox>
<Button variant="contained">Continue</Button>
<Button href={ROUTES.INTEGRATIONS.PATH} variant="contained">
Continue
</Button>
</FlexBox>
</FlexBox>
</Container>
Expand Down