Skip to content

Commit

Permalink
refactor(web): drop core/About component
Browse files Browse the repository at this point in the history
Because at this moment it does not provide any useful information for
the user. Moreover, most probably a user in front of the Agama UI is
aware of what Agama is, especially now that it has its own documentation
site.
  • Loading branch information
dgdavid committed Oct 22, 2024
1 parent eeaf714 commit 9cf3608
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 207 deletions.
77 changes: 0 additions & 77 deletions web/src/components/core/About.test.tsx

This file was deleted.

94 changes: 0 additions & 94 deletions web/src/components/core/About.tsx

This file was deleted.

10 changes: 0 additions & 10 deletions web/src/components/core/LoginPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,5 @@ describe("LoginPage", () => {
within(form_error).getByText(/Could not authenticate/);
});
});

it("renders a button to know more about the project", async () => {
const { user } = plainRender(<LoginPage />);
const button = screen.getByRole("button", { name: "More about this" });

await user.click(button);

const dialog = await screen.findByRole("dialog");
within(dialog).getByText(/About/);
});
});
});
19 changes: 2 additions & 17 deletions web/src/components/core/LoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,8 @@

import React, { useState } from "react";
import { Navigate } from "react-router-dom";
import {
ActionGroup,
Button,
Card,
Flex,
FlexItem,
Form,
FormGroup,
Grid,
GridItem,
} from "@patternfly/react-core";
import { About, EmptyState, FormValidationError, Page, PasswordInput } from "~/components/core";
import { ActionGroup, Button, Card, Form, FormGroup, Grid, GridItem } from "@patternfly/react-core";
import { EmptyState, FormValidationError, Page, PasswordInput } from "~/components/core";
import { Center } from "~/components/layout";
import { AuthErrors, useAuth } from "~/context/auth";
import { _ } from "~/i18n";
Expand Down Expand Up @@ -109,11 +99,6 @@ user privileges.",
</ActionGroup>
</Form>
</EmptyState>
<Flex>
<FlexItem align={{ default: "alignRight" }}>
<About showIcon={false} iconSize="xs" buttonText={_("More about this")} />
</FlexItem>
</Flex>
</Card>
</GridItem>
</Grid>
Expand Down
1 change: 0 additions & 1 deletion web/src/components/core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
* find current contact information at www.suse.com.
*/

export { default as About } from "./About";
export { default as ChangeProductLink } from "./ChangeProductLink";
export { default as Description } from "./Description";
export { default as Section } from "./Section";
Expand Down
6 changes: 0 additions & 6 deletions web/src/components/layout/Sidebar.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import { screen, within } from "@testing-library/react";
import { installerRender } from "~/test-utils";
import Sidebar from "./Sidebar";

jest.mock("~/components/core/About", () => () => <div>About Mock</div>);
jest.mock("~/components/core/LogsButton", () => () => <div>LogsButton Mock</div>);
jest.mock("~/components/core/ChangeProductLink", () => () => <div>ChangeProductLink Mock</div>);

Expand All @@ -47,11 +46,6 @@ describe("Sidebar", () => {
screen.getByRole("link", { name: "L10n" });
});

it("mounts core/About component", () => {
installerRender(<Sidebar />);
screen.getByText("About Mock");
});

it("mounts core/LogsButton component", () => {
installerRender(<Sidebar />);
screen.getByText("LogsButton Mock");
Expand Down
3 changes: 1 addition & 2 deletions web/src/components/layout/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import React from "react";
import { NavLink } from "react-router-dom";
import { Nav, NavItem, NavList, PageSidebar, PageSidebarBody, Stack } from "@patternfly/react-core";
import { Icon } from "~/components/layout";
import { About, LogsButton, ChangeProductLink } from "~/components/core";
import { LogsButton, ChangeProductLink } from "~/components/core";
import { rootRoutes } from "~/router";
import { _ } from "~/i18n";

Expand Down Expand Up @@ -68,7 +68,6 @@ export default function Sidebar(): React.ReactNode {
<Stack hasGutter>
<ChangeProductLink />
<LogsButton />
<About showIcon={false} buttonProps={{ variant: "link", isInline: true }} />
</Stack>
</PageSidebarBody>
</PageSidebar>
Expand Down

0 comments on commit 9cf3608

Please sign in to comment.