Skip to content

refactor(site): verify external auth before display ws form #11777

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Apply PR review suggestions
  • Loading branch information
BrunoQuaresma committed Jan 24, 2024
commit c59abfd30c8ca077cd9da35bd570797b5ca0a2da
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const MockExternalAuth: TemplateVersionExternalAuth = {
};

const meta: Meta<typeof ExternalAuthBanner> = {
title: "pages/CreateWorkspacePage/ExternalAuthBanner/ExternalAuthBanner",
title: "pages/CreateWorkspacePage/ExternalAuthBanner",
component: ExternalAuthBanner,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@ import { Interpolation, Theme } from "@emotion/react";
import { TemplateVersionExternalAuth } from "api/typesGenerated";
import { ExternalAuthPollingState } from "../CreateWorkspacePage";
import { ExternalAuthItem } from "./ExternalAuthItem";
import { FC } from "react";

type ExternalAuthBannerProps = {
providers: TemplateVersionExternalAuth[];
pollingState: ExternalAuthPollingState;
onStartPolling: () => void;
};

export const ExternalAuthBanner = ({
export const ExternalAuthBanner: FC<ExternalAuthBannerProps> = ({
providers,
pollingState,
onStartPolling,
}: ExternalAuthBannerProps) => {
}) => {
return (
<section css={styles.root}>
<div css={styles.content}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import DoneAllOutlined from "@mui/icons-material/DoneAllOutlined";
import LoadingButton from "@mui/lab/LoadingButton";
import { TemplateVersionExternalAuth } from "api/typesGenerated";
import { ExternalImage } from "components/ExternalImage/ExternalImage";
import { ComponentProps, useEffect, useState } from "react";
import { FC, useEffect, useState } from "react";
// eslint-disable-next-line no-restricted-imports -- used to allow extension with "component"
import Box from "@mui/material/Box";
import Box, { BoxProps } from "@mui/material/Box";

type Status = "idle" | "connecting";

Expand All @@ -14,15 +14,15 @@ type ExternalAuthItemProps = {
isPolling: boolean;
defaultStatus?: Status;
onStartPolling: () => void;
} & ComponentProps<typeof Box>;
} & BoxProps;

export const ExternalAuthItem = ({
export const ExternalAuthItem: FC<ExternalAuthItemProps> = ({
provider,
isPolling,
defaultStatus = "idle",
onStartPolling,
...boxProps
}: ExternalAuthItemProps) => {
}) => {
const [status, setStatus] = useState(defaultStatus);

useEffect(() => {
Expand Down