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

Aggregate similar files in the same directories #1318

Merged
merged 1 commit into from
Nov 13, 2024
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
26 changes: 3 additions & 23 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,11 @@
import { ThemeProvider } from "@mui/material/styles";
import React, { FC } from "react";
import React from "react";
import { createRoot } from "react-dom/client";

import { AironeSnackbarProvider } from "AironeSnackbarProvider";
import { AppRouter } from "AppRouter";
import { CheckTermsService } from "CheckTermsService";
import { ErrorHandler } from "ErrorHandler";
import { theme } from "Theme";
import "i18n/config";

const App: FC = () => {
return (
<ThemeProvider theme={theme}>
<AironeSnackbarProvider>
<ErrorHandler>
<CheckTermsService>
<AppRouter />
</CheckTermsService>
</ErrorHandler>
</AironeSnackbarProvider>
</ThemeProvider>
);
};
import { AppBase } from "AppBase";

const container = document.getElementById("app");
if (container == null) {
throw new Error("failed to initializer React app.");
}
const root = createRoot(container);
root.render(<App />);
root.render(<AppBase />);
30 changes: 30 additions & 0 deletions frontend/src/AppBase.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { ThemeProvider } from "@mui/material/styles";
import React, { FC } from "react";

import { AironeSnackbarProvider } from "AironeSnackbarProvider";
import { ErrorHandler } from "ErrorHandler";
import { theme } from "Theme";
import { CheckTerms } from "components/common/CheckTerms";
import { AppRouter } from "routes/AppRouter";
import "i18n/config";

interface Props {
customRoutes?: {
path: string;
element: React.ReactNode;
}[];
}

export const AppBase: FC<Props> = ({ customRoutes }) => {
return (
<ThemeProvider theme={theme}>
<AironeSnackbarProvider>
<ErrorHandler>
<CheckTerms>
<AppRouter customRoutes={customRoutes} />
</CheckTerms>
</ErrorHandler>
</AironeSnackbarProvider>
</ThemeProvider>
);
};
40 changes: 20 additions & 20 deletions frontend/src/AppRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,25 @@ import { NotFoundErrorPage } from "./pages/NotFoundErrorPage";
import { RoleEditPage } from "./pages/RoleEditPage";
import { RoleListPage } from "./pages/RoleListPage";

import { Header } from "components/common/Header";
import { ACLEditPage } from "pages/ACLEditPage";
import { AdvancedSearchPage } from "pages/AdvancedSearchPage";
import { AdvancedSearchResultsPage } from "pages/AdvancedSearchResultsPage";
import { DashboardPage } from "pages/DashboardPage";
import { EntityEditPage } from "pages/EntityEditPage";
import { EntityHistoryPage } from "pages/EntityHistoryPage";
import { EntityListPage } from "pages/EntityListPage";
import { EntryEditPage } from "pages/EntryEditPage";
import { EntryHistoryListPage } from "pages/EntryHistoryListPage";
import { EntryListPage } from "pages/EntryListPage";
import { GroupEditPage } from "pages/GroupEditPage";
import { GroupListPage } from "pages/GroupListPage";
import { JobListPage } from "pages/JobListPage";
import { LoginPage } from "pages/LoginPage";
import { TriggerEditPage } from "pages/TriggerEditPage";
import { TriggerListPage } from "pages/TriggerListPage";
import { UserEditPage } from "pages/UserEditPage";
import { UserListPage } from "pages/UserListPage";
import {
aclHistoryPath,
aclPath,
Expand Down Expand Up @@ -47,26 +66,7 @@ import {
triggersPath,
userPath,
usersPath,
} from "Routes";
import { Header } from "components/Header";
import { ACLEditPage } from "pages/ACLEditPage";
import { AdvancedSearchPage } from "pages/AdvancedSearchPage";
import { AdvancedSearchResultsPage } from "pages/AdvancedSearchResultsPage";
import { DashboardPage } from "pages/DashboardPage";
import { EntityEditPage } from "pages/EntityEditPage";
import { EntityHistoryPage } from "pages/EntityHistoryPage";
import { EntityListPage } from "pages/EntityListPage";
import { EntryEditPage } from "pages/EntryEditPage";
import { EntryHistoryListPage } from "pages/EntryHistoryListPage";
import { EntryListPage } from "pages/EntryListPage";
import { GroupEditPage } from "pages/GroupEditPage";
import { GroupListPage } from "pages/GroupListPage";
import { JobListPage } from "pages/JobListPage";
import { LoginPage } from "pages/LoginPage";
import { TriggerEditPage } from "pages/TriggerEditPage";
import { TriggerListPage } from "pages/TriggerListPage";
import { UserEditPage } from "pages/UserEditPage";
import { UserListPage } from "pages/UserListPage";
} from "routes/Routes";

// re-throw error to be caught by the root error boundary
const ErrorBridge: FC = () => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/ErrorHandler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
NonTermsServiceAgreement,
} from "./services/Exceptions";

import { topPath } from "Routes";
import { topPath } from "routes/Routes";

const ErrorDescription = styled(Box)(({ theme }) => ({
marginTop: theme.spacing(2),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import React, { FC } from "react";

import { NonTermsServiceAgreement } from "./services/Exceptions";

import { NonTermsServiceAgreement } from "services/Exceptions";
import { ServerContext } from "services/ServerContext";

function getCookieValue(key: string) {
return ((document.cookie + ";").match(key + "=([^¥S;]*)") || [])[1];
}

export const CheckTermsService: FC<{ children: React.ReactNode }> = ({
children,
}) => {
export const CheckTerms: FC<{ children: React.ReactNode }> = ({ children }) => {
const serverContext = ServerContext.getInstance();

if (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ import React, { FC, MouseEvent, useMemo, useState } from "react";
import { Link } from "react-router-dom";
import { useInterval } from "react-use";

import { useTranslation } from "../hooks/useTranslation";
import { useTranslation } from "../../hooks/useTranslation";

import { SearchBox } from "components/common/SearchBox";
import { useSimpleSearch } from "hooks/useSimpleSearch";
import { aironeApiClient } from "repository/AironeApiClient";
import {
advancedSearchPath,
entitiesPath,
Expand All @@ -36,10 +39,7 @@ import {
triggersPath,
userPath,
usersPath,
} from "Routes";
import { SearchBox } from "components/common/SearchBox";
import { useSimpleSearch } from "hooks/useSimpleSearch";
import { aironeApiClient } from "repository/AironeApiClient";
} from "routes/Routes";
import {
JobOperations,
JobRefreshIntervalMilliSec,
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/common/PageHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { styled } from "@mui/material/styles";
import React, { FC } from "react";
import { Link } from "react-router-dom";

import { jobsPath } from "Routes";
import { jobsPath } from "routes/Routes";

const Frame = styled(Box)({
width: "100%",
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/entity/EntityBreadcrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { Typography } from "@mui/material";
import React, { FC } from "react";
import { Link } from "react-router-dom";

import { topPath, entitiesPath, entityEntriesPath } from "Routes";
import { AironeBreadcrumbs } from "components/common/AironeBreadcrumbs";
import { FlexBox } from "components/common/FlexBox";
import { topPath, entitiesPath, entityEntriesPath } from "routes/Routes";

interface Props {
entity?: EntityDetail;
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/entity/EntityControlMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import { Link, useNavigate } from "react-router-dom";

import { RateLimitedClickable } from "../common/RateLimitedClickable";

import { Confirmable } from "components/common/Confirmable";
import { aironeApiClient } from "repository/AironeApiClient";
import {
aclPath,
entityHistoryPath,
Expand All @@ -21,9 +23,7 @@ import {
topPath,
entityEntriesPath,
aclHistoryPath,
} from "Routes";
import { Confirmable } from "components/common/Confirmable";
import { aironeApiClient } from "repository/AironeApiClient";
} from "routes/Routes";

type ExportFormatType = "YAML" | "CSV";

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/entity/EntityList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { Link } from "react-router-dom";

import { EntityListCard } from "./EntityListCard";

import { newEntityPath } from "Routes";
import { PaginationFooter } from "components/common/PaginationFooter";
import { SearchBox } from "components/common/SearchBox";
import { newEntityPath } from "routes/Routes";
import { EntityList as ConstEntityList } from "services/Constants";
import { normalizeToMatch } from "services/StringUtil";

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/entity/EntityListCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import { Link } from "react-router-dom";

import { EntityControlMenu } from "./EntityControlMenu";

import { entityEntriesPath } from "Routes";
import { ClipboardCopyButton } from "components/common/ClipboardCopyButton";
import { EntryImportModal } from "components/entry/EntryImportModal";
import { entityEntriesPath } from "routes/Routes";

const EntityNote = styled(Typography)(({ theme }) => ({
color: theme.palette.text.secondary,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { Link } from "react-router-dom";
import { AttributeNoteModal } from "./AttributeNoteModal";
import { Schema } from "./EntityFormSchema";

import { aclPath } from "Routes";
import { aclPath } from "routes/Routes";
import { AttributeTypes } from "services/Constants";

const StyledBox = styled(Box)(({ theme }) => ({
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/entry/AttributeValue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import * as React from "react";
import { FC } from "react";
import { Link } from "react-router-dom";

import { groupsPath, rolePath, entryDetailsPath } from "Routes";
import { groupsPath, rolePath, entryDetailsPath } from "routes/Routes";

const StyledBox = styled(Box)(() => ({
display: "flex",
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/entry/EntryBreadcrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import { Typography } from "@mui/material";
import React, { FC } from "react";
import { Link } from "react-router-dom";

import { AironeBreadcrumbs } from "components/common/AironeBreadcrumbs";
import { FlexBox } from "components/common/FlexBox";
import {
topPath,
entitiesPath,
entityEntriesPath,
entryDetailsPath,
} from "Routes";
import { AironeBreadcrumbs } from "components/common/AironeBreadcrumbs";
import { FlexBox } from "components/common/FlexBox";
} from "routes/Routes";

interface Props {
entry?: EntryRetrieve;
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/entry/EntryControlMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { useSnackbar } from "notistack";
import React, { FC } from "react";
import { Link, useNavigate } from "react-router-dom";

import { Confirmable } from "components/common/Confirmable";
import { aironeApiClient } from "repository/AironeApiClient";
import {
entryEditPath,
aclPath,
Expand All @@ -20,9 +22,7 @@ import {
topPath,
entryDetailsPath,
aclHistoryPath,
} from "Routes";
import { Confirmable } from "components/common/Confirmable";
import { aironeApiClient } from "repository/AironeApiClient";
} from "routes/Routes";

interface EntryControlProps {
entityId: number;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/entry/EntryHistoryList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import { useNavigate } from "react-router-dom";

import { AttributeValue } from "./AttributeValue";

import { showEntryHistoryPath, topPath } from "Routes";
import { Confirmable } from "components/common/Confirmable";
import { PaginationFooter } from "components/common/PaginationFooter";
import { aironeApiClient } from "repository/AironeApiClient";
import { showEntryHistoryPath, topPath } from "routes/Routes";
import { EntryHistoryList as ConstEntryHistoryList } from "services/Constants";
import { formatDateTime } from "services/DateUtil";

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/entry/EntryList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import { Link, useNavigate, useLocation } from "react-router-dom";

import { EntryListCard } from "./EntryListCard";

import { newEntryPath } from "Routes";
import { Loading } from "components/common/Loading";
import { PaginationFooter } from "components/common/PaginationFooter";
import { SearchBox } from "components/common/SearchBox";
import { useAsyncWithThrow } from "hooks/useAsyncWithThrow";
import { usePage } from "hooks/usePage";
import { aironeApiClient } from "repository/AironeApiClient";
import { newEntryPath } from "routes/Routes";
import { EntryList as ConstEntryList } from "services/Constants";
import { normalizeToMatch } from "services/StringUtil";

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/entry/EntryListCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import { styled } from "@mui/material/styles";
import React, { FC, useState } from "react";
import { Link } from "react-router-dom";

import { entryDetailsPath } from "Routes";
import { ClipboardCopyButton } from "components/common/ClipboardCopyButton";
import { EntryControlMenu } from "components/entry/EntryControlMenu";
import { entryDetailsPath } from "routes/Routes";

const StyledCard = styled(Card)(({}) => ({
height: "100%",
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/entry/EntryReferral.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import { aironeApiClient } from "../../repository/AironeApiClient";
import { EntryReferralList } from "../../services/Constants";
import { normalizeToMatch } from "../../services/StringUtil";

import { entryDetailsPath } from "Routes";
import { SearchBox } from "components/common/SearchBox";
import { entryDetailsPath } from "routes/Routes";

const ReferralCount = styled(Typography)(({}) => ({
fontSize: "16px",
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/entry/RestorableEntryList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ import { useNavigate, useLocation } from "react-router-dom";

import { EntryAttributes } from "./EntryAttributes";

import { restoreEntryPath, topPath } from "Routes";
import { Confirmable } from "components/common/Confirmable";
import { Loading } from "components/common/Loading";
import { PaginationFooter } from "components/common/PaginationFooter";
import { SearchBox } from "components/common/SearchBox";
import { useAsyncWithThrow } from "hooks/useAsyncWithThrow";
import { usePage } from "hooks/usePage";
import { aironeApiClient } from "repository/AironeApiClient";
import { restoreEntryPath, topPath } from "routes/Routes";
import { EntryList as ConstEntryList } from "services/Constants";
import { formatDateTime } from "services/DateUtil";
import { normalizeToMatch } from "services/StringUtil";
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/entry/SearchResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import { Link } from "react-router-dom";

import { SearchResultsTableHead } from "./SearchResultsTableHead";

import { entryDetailsPath } from "Routes";
import { PaginationFooter } from "components/common/PaginationFooter";
import { AttributeValue } from "components/entry/AttributeValue";
import { entryDetailsPath } from "routes/Routes";
import { AdvancedSerarchResultList } from "services/Constants";
import { AttrsFilter } from "services/entry/AdvancedSearch";

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/group/GroupControlMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import { useSnackbar } from "notistack";
import React, { FC, useCallback } from "react";
import { Link, useNavigate } from "react-router-dom";

import { groupPath, groupsPath, topPath } from "Routes";
import { Confirmable } from "components/common/Confirmable";
import { aironeApiClient } from "repository/AironeApiClient";
import { groupPath, groupsPath, topPath } from "routes/Routes";

interface Props {
groupId: number;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/group/GroupTreeItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { Checkbox, IconButton, ListItem, Typography } from "@mui/material";
import React, { FC } from "react";
import { Link } from "react-router-dom";

import { groupPath } from "../../Routes";
import { GroupTree } from "../../repository/AironeApiClient";
import { groupPath } from "../../routes/Routes";
import { ServerContext } from "../../services/ServerContext";

const CHILDREN_INDENT_WIDTH = 16;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/group/GroupTreeRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import { styled } from "@mui/material/styles";
import React, { FC } from "react";
import { Link } from "react-router-dom";

import { groupPath } from "../../Routes";
import { GroupTree } from "../../repository/AironeApiClient";
import { groupPath } from "../../routes/Routes";
import { ServerContext } from "../../services/ServerContext";

import { GroupTreeItem } from "./GroupTreeItem";
Expand Down
Loading
Loading