Skip to content
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

refactor(config-ui): remove content about user info #6245

Merged
merged 1 commit into from
Oct 16, 2023
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
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
Loading