Skip to content

Commit

Permalink
refactor(config-ui): remove content about user info (apache#6245)
Browse files Browse the repository at this point in the history
  • Loading branch information
mintsweet committed Oct 16, 2023
1 parent 62f71ad commit a546e01
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 14 deletions.
3 changes: 0 additions & 3 deletions config-ui/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ import * as task from './task';
const migrate = () => request('/proceed-db-migration');
const ping = () => request('/ping');
const version = (signal?: AbortSignal): Promise<{ version: string }> => request('/version', { signal });
const userInfo = (signal?: AbortSignal): Promise<{ user: string; email: string; logoutURI: string }> =>
request('/userinfo', { signal });

export const API = {
apiKey,
Expand All @@ -47,7 +45,6 @@ export const API = {
migrate,
ping,
version,
userInfo,
};

export default API;
10 changes: 1 addition & 9 deletions config-ui/src/routes/layout/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import * as S from './styled';
import './tips-transition.css';

export const Layout = () => {
const { version, userInfo } = useLoaderData() as Awaited<ReturnType<typeof loader>>;
const { version } = useLoaderData() as Awaited<ReturnType<typeof loader>>;

const navigate = useNavigate();
const { pathname } = useLocation();
Expand Down Expand Up @@ -144,14 +144,6 @@ export const Layout = () => {
<img src={SlackIcon} alt="slack" />
<span>Slack</span>
</a>
{userInfo && userInfo.logoutURI && (
<>
<Navbar.Divider />
<span>{userInfo.email}</span>
<Navbar.Divider />
<a href={userInfo.logoutURI}>Sign Out</a>
</>
)}
</Navbar.Group>
</S.Header>
<S.Inner>
Expand Down
2 changes: 0 additions & 2 deletions config-ui/src/routes/layout/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@ type Props = {
export const loader = async ({ request }: Props) => {
try {
const version = await API.version(request.signal);
const userInfo = await API.userInfo(request.signal);
return {
version: version.version,
userInfo,
};
} catch (err) {
const status = (err as AxiosError).response?.status;
Expand Down

0 comments on commit a546e01

Please sign in to comment.