Peter Makowski has proposed merging ~petermakowski/maas-site-manager:move-sites-components-to-folders into maas-site-manager:main.
Commit message: refactor: move sites components to own folders Requested reviews: MAAS Committers (maas-committers) For more details, see: https://code.launchpad.net/~petermakowski/maas-site-manager/+git/site-manager/+merge/439741 -- Your team MAAS Committers is requested to review the proposed merge of ~petermakowski/maas-site-manager:move-sites-components-to-folders into maas-site-manager:main.
diff --git a/frontend/src/components/SitesList/SitesList.tsx b/frontend/src/components/SitesList/SitesList.tsx index f47b9ed..ef0a567 100644 --- a/frontend/src/components/SitesList/SitesList.tsx +++ b/frontend/src/components/SitesList/SitesList.tsx @@ -2,7 +2,7 @@ import { useEffect, useState } from "react"; import { Pagination } from "@canonical/react-components"; -import SitesTable from "./components/SitesTable"; +import SitesTable from "./SitesTable"; import { useSitesQuery } from "@/hooks/api"; import useDebounce from "@/hooks/useDebouncedValue"; diff --git a/frontend/src/components/SitesList/components/ConnectionInfo.test.tsx b/frontend/src/components/SitesList/SitesTable/ConnectionInfo/ConnectionInfo.test.tsx similarity index 100% rename from frontend/src/components/SitesList/components/ConnectionInfo.test.tsx rename to frontend/src/components/SitesList/SitesTable/ConnectionInfo/ConnectionInfo.test.tsx diff --git a/frontend/src/components/SitesList/components/ConnectionInfo.tsx b/frontend/src/components/SitesList/SitesTable/ConnectionInfo/ConnectionInfo.tsx similarity index 100% rename from frontend/src/components/SitesList/components/ConnectionInfo.tsx rename to frontend/src/components/SitesList/SitesTable/ConnectionInfo/ConnectionInfo.tsx diff --git a/frontend/src/components/SitesList/SitesTable/ConnectionInfo/index.ts b/frontend/src/components/SitesList/SitesTable/ConnectionInfo/index.ts new file mode 100644 index 0000000..07c4508 --- /dev/null +++ b/frontend/src/components/SitesList/SitesTable/ConnectionInfo/index.ts @@ -0,0 +1 @@ +export { default } from "./ConnectionInfo"; diff --git a/frontend/src/components/SitesList/components/SitesTable.scss b/frontend/src/components/SitesList/SitesTable/SitesTable.scss similarity index 100% rename from frontend/src/components/SitesList/components/SitesTable.scss rename to frontend/src/components/SitesList/SitesTable/SitesTable.scss diff --git a/frontend/src/components/SitesList/components/SitesTable.test.tsx b/frontend/src/components/SitesList/SitesTable/SitesTable.test.tsx similarity index 100% rename from frontend/src/components/SitesList/components/SitesTable.test.tsx rename to frontend/src/components/SitesList/SitesTable/SitesTable.test.tsx diff --git a/frontend/src/components/SitesList/components/SitesTable.tsx b/frontend/src/components/SitesList/SitesTable/SitesTable.tsx similarity index 98% rename from frontend/src/components/SitesList/components/SitesTable.tsx rename to frontend/src/components/SitesList/SitesTable/SitesTable.tsx index d325840..2562f35 100644 --- a/frontend/src/components/SitesList/components/SitesTable.tsx +++ b/frontend/src/components/SitesList/SitesTable/SitesTable.tsx @@ -5,8 +5,8 @@ import type { ColumnDef, Column, Getter, Row } from "@tanstack/react-table"; import pick from "lodash/fp/pick"; import useLocalStorageState from "use-local-storage-state"; -import ConnectionInfo from "./ConnectionInfo"; -import SitesTableControls from "./SitesTableControls"; +import ConnectionInfo from "./ConnectionInfo/ConnectionInfo"; +import SitesTableControls from "./SitesTableControls/SitesTableControls"; import type { SitesQueryResult } from "@/api/types"; import { isDev } from "@/constants"; diff --git a/frontend/src/components/SitesList/components/ColumnsVisibilityControl.scss b/frontend/src/components/SitesList/SitesTable/SitesTableControls/ColumnsVisibilityControl/ColumnsVisibilityControl.scss similarity index 100% rename from frontend/src/components/SitesList/components/ColumnsVisibilityControl.scss rename to frontend/src/components/SitesList/SitesTable/SitesTableControls/ColumnsVisibilityControl/ColumnsVisibilityControl.scss diff --git a/frontend/src/components/SitesList/components/ColumnsVisibilityControl.tsx b/frontend/src/components/SitesList/SitesTable/SitesTableControls/ColumnsVisibilityControl/ColumnsVisibilityControl.tsx similarity index 100% rename from frontend/src/components/SitesList/components/ColumnsVisibilityControl.tsx rename to frontend/src/components/SitesList/SitesTable/SitesTableControls/ColumnsVisibilityControl/ColumnsVisibilityControl.tsx diff --git a/frontend/src/components/SitesList/SitesTable/SitesTableControls/ColumnsVisibilityControl/index.ts b/frontend/src/components/SitesList/SitesTable/SitesTableControls/ColumnsVisibilityControl/index.ts new file mode 100644 index 0000000..5f6b976 --- /dev/null +++ b/frontend/src/components/SitesList/SitesTable/SitesTableControls/ColumnsVisibilityControl/index.ts @@ -0,0 +1 @@ +export { default } from "./ColumnsVisibilityControl"; diff --git a/frontend/src/components/SitesList/components/SitesCount.test.tsx b/frontend/src/components/SitesList/SitesTable/SitesTableControls/SitesCount/SitesCount.test.tsx similarity index 100% rename from frontend/src/components/SitesList/components/SitesCount.test.tsx rename to frontend/src/components/SitesList/SitesTable/SitesTableControls/SitesCount/SitesCount.test.tsx diff --git a/frontend/src/components/SitesList/components/SitesCount.tsx b/frontend/src/components/SitesList/SitesTable/SitesTableControls/SitesCount/SitesCount.tsx similarity index 100% rename from frontend/src/components/SitesList/components/SitesCount.tsx rename to frontend/src/components/SitesList/SitesTable/SitesTableControls/SitesCount/SitesCount.tsx diff --git a/frontend/src/components/SitesList/SitesTable/SitesTableControls/SitesCount/index.ts b/frontend/src/components/SitesList/SitesTable/SitesTableControls/SitesCount/index.ts new file mode 100644 index 0000000..388c215 --- /dev/null +++ b/frontend/src/components/SitesList/SitesTable/SitesTableControls/SitesCount/index.ts @@ -0,0 +1 @@ +export { default } from "./SitesCount"; diff --git a/frontend/src/components/SitesList/components/SitesTableControls.scss b/frontend/src/components/SitesList/SitesTable/SitesTableControls/SitesTableControls.scss similarity index 100% rename from frontend/src/components/SitesList/components/SitesTableControls.scss rename to frontend/src/components/SitesList/SitesTable/SitesTableControls/SitesTableControls.scss diff --git a/frontend/src/components/SitesList/components/SitesTableControls.test.tsx b/frontend/src/components/SitesList/SitesTable/SitesTableControls/SitesTableControls.test.tsx similarity index 100% rename from frontend/src/components/SitesList/components/SitesTableControls.test.tsx rename to frontend/src/components/SitesList/SitesTable/SitesTableControls/SitesTableControls.test.tsx diff --git a/frontend/src/components/SitesList/components/SitesTableControls.tsx b/frontend/src/components/SitesList/SitesTable/SitesTableControls/SitesTableControls.tsx similarity index 68% rename from frontend/src/components/SitesList/components/SitesTableControls.tsx rename to frontend/src/components/SitesList/SitesTable/SitesTableControls/SitesTableControls.tsx index 5f97bce..4c2914f 100644 --- a/frontend/src/components/SitesList/components/SitesTableControls.tsx +++ b/frontend/src/components/SitesList/SitesTable/SitesTableControls/SitesTableControls.tsx @@ -1,8 +1,8 @@ -import { SearchBox, Button, Icon } from "@canonical/react-components"; +import { Row, Col, SearchBox, Button, Icon } from "@canonical/react-components"; import ColumnsVisibilityControl from "./ColumnsVisibilityControl"; import SitesCount from "./SitesCount"; -import type { SitesColumn } from "./SitesTable"; +import type { SitesColumn } from "../SitesTable"; import { useAppContext } from "@/context"; import type { UseSitesQueryResult } from "@/hooks/api"; @@ -25,34 +25,29 @@ const SitesTableControls = ({ const isRemoveDisabled = Object.keys(rowSelection).length <= 0; return ( - <div className="u-fixed-width sites-table-controls"> - <div className="u-flex--large"> - <div> - <h2 className="p-heading--4"> - <SitesCount data={data} isLoading={isLoading} /> - </h2> - </div> - <div className="u-flex--grow"> - <SearchBox - className="sites-table-controls__search" - externallyControlled - onChange={handleSearchInput} - placeholder="Search and filter" - /> - </div> - <div className="u-flex u-flex--justify-end"> - <Button - appearance="negative" - disabled={isRemoveDisabled} - onClick={() => setSidebar("removeRegions")} - type="button" - > - <Icon light name="delete" /> Remove - </Button> - <ColumnsVisibilityControl columns={allColumns} /> - </div> - </div> - </div> + <Row> + <Col size={2}> + <h2 className="p-heading--4"> + <SitesCount data={data} isLoading={isLoading} /> + </h2> + </Col> + <Col size={6}> + <SearchBox externallyControlled onChange={handleSearchInput} placeholder="Search and filter" /> + </Col> + <Col className="u-flex u-flex--align-end u-flex--column" size={2}> + <Button + appearance="negative" + disabled={isRemoveDisabled} + onClick={() => setSidebar("removeRegions")} + type="button" + > + <Icon light name="delete" /> Remove + </Button> + </Col> + <Col className="u-flex u-flex--align-end u-flex--column" size={2}> + <ColumnsVisibilityControl columns={allColumns} /> + </Col> + </Row> ); }; diff --git a/frontend/src/components/SitesList/SitesTable/index.ts b/frontend/src/components/SitesList/SitesTable/index.ts new file mode 100644 index 0000000..ab27b0d --- /dev/null +++ b/frontend/src/components/SitesList/SitesTable/index.ts @@ -0,0 +1 @@ +export { default } from "./SitesTable";
-- Mailing list: https://launchpad.net/~sts-sponsors Post to : sts-sponsors@lists.launchpad.net Unsubscribe : https://launchpad.net/~sts-sponsors More help : https://help.launchpad.net/ListHelp