diff --git a/frontend/src/components/entity/EntityHistoryList.tsx b/frontend/src/components/entity/EntityHistoryList.tsx index ffadfb525..943ff23fb 100644 --- a/frontend/src/components/entity/EntityHistoryList.tsx +++ b/frontend/src/components/entity/EntityHistoryList.tsx @@ -11,7 +11,7 @@ import { import React, { FC } from "react"; import { PaginationFooter } from "components/common/PaginationFooter"; -import { EntityHistoryList as ConstEntityHistoryList } from "services/Constants"; +import { EntityHistoryListParam } from "services/Constants"; import { formatDateTime } from "services/DateUtil"; const Operations = { @@ -130,7 +130,7 @@ export const EntityHistoryList: FC = ({ diff --git a/frontend/src/components/entity/EntityList.tsx b/frontend/src/components/entity/EntityList.tsx index 4b4188287..f7752b14b 100644 --- a/frontend/src/components/entity/EntityList.tsx +++ b/frontend/src/components/entity/EntityList.tsx @@ -9,7 +9,7 @@ import { EntityListCard } from "./EntityListCard"; 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 { EntityListParam } from "services/Constants"; import { normalizeToMatch } from "services/StringUtil"; interface Props { @@ -69,7 +69,7 @@ export const EntityList: FC = ({ diff --git a/frontend/src/components/entry/EntryHistoryList.tsx b/frontend/src/components/entry/EntryHistoryList.tsx index 3085f1f45..04545a8b3 100644 --- a/frontend/src/components/entry/EntryHistoryList.tsx +++ b/frontend/src/components/entry/EntryHistoryList.tsx @@ -20,7 +20,7 @@ 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 { EntryHistoryListParam } from "services/Constants"; import { formatDateTime } from "services/DateUtil"; const HeaderTableRow = styled(TableRow)(({}) => ({ @@ -133,7 +133,7 @@ export const EntryHistoryList: FC = ({ diff --git a/frontend/src/components/entry/EntryList.tsx b/frontend/src/components/entry/EntryList.tsx index e4fc8a3cd..960402160 100644 --- a/frontend/src/components/entry/EntryList.tsx +++ b/frontend/src/components/entry/EntryList.tsx @@ -1,7 +1,7 @@ import AddIcon from "@mui/icons-material/Add"; import { Box, Button, Grid } from "@mui/material"; import React, { FC, useState } from "react"; -import { Link, useNavigate, useLocation } from "react-router-dom"; +import { Link, useLocation, useNavigate } from "react-router-dom"; import { EntryListCard } from "./EntryListCard"; @@ -12,7 +12,7 @@ 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 { EntryListParam } from "services/Constants"; import { normalizeToMatch } from "services/StringUtil"; interface Props { @@ -96,7 +96,7 @@ export const EntryList: FC = ({ entityId, canCreateEntry = true }) => { )} diff --git a/frontend/src/components/entry/RestorableEntryList.tsx b/frontend/src/components/entry/RestorableEntryList.tsx index 08cb07d36..83b656b51 100644 --- a/frontend/src/components/entry/RestorableEntryList.tsx +++ b/frontend/src/components/entry/RestorableEntryList.tsx @@ -20,7 +20,7 @@ import { import { styled } from "@mui/material/styles"; import { useSnackbar } from "notistack"; import React, { FC, useState } from "react"; -import { useNavigate, useLocation } from "react-router-dom"; +import { useLocation, useNavigate } from "react-router-dom"; import { EntryAttributes } from "./EntryAttributes"; @@ -32,7 +32,7 @@ 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 { EntryListParam } from "services/Constants"; import { formatDateTime } from "services/DateUtil"; import { normalizeToMatch } from "services/StringUtil"; @@ -215,7 +215,7 @@ export const RestorableEntryList: FC = ({ entityId }) => { )} diff --git a/frontend/src/components/entry/SearchResults.tsx b/frontend/src/components/entry/SearchResults.tsx index 41d60a36e..dc6052f68 100644 --- a/frontend/src/components/entry/SearchResults.tsx +++ b/frontend/src/components/entry/SearchResults.tsx @@ -24,7 +24,7 @@ import { SearchResultsTableHead } from "./SearchResultsTableHead"; import { PaginationFooter } from "components/common/PaginationFooter"; import { AttributeValue } from "components/entry/AttributeValue"; import { entryDetailsPath } from "routes/Routes"; -import { AdvancedSerarchResultList } from "services/Constants"; +import { AdvancedSerarchResultListParam } from "services/Constants"; import { AttrsFilter } from "services/entry/AdvancedSearch"; const StyledBox = styled(Box)({ @@ -186,7 +186,7 @@ export const SearchResults: FC = ({ {!disablePaginationFooter && ( diff --git a/frontend/src/components/entry/index.ts b/frontend/src/components/entry/index.ts index 6038db1fb..860e2e55f 100644 --- a/frontend/src/components/entry/index.ts +++ b/frontend/src/components/entry/index.ts @@ -6,8 +6,10 @@ export * from "./EntryAttributes"; export * from "./EntryBreadcrumbs"; export * from "./EntryControlMenu"; export * from "./EntryImportModal"; +export * from "./EntryList"; export * from "./EntryListCard"; export * from "./EntryReferral"; +export * from "./SearchResults"; -export * from "./entryForm/EntryFormSchema"; export * from "./entryForm/AttributeValueField"; +export * from "./entryForm/EntryFormSchema"; diff --git a/frontend/src/components/index.ts b/frontend/src/components/index.ts index 7f7111ce1..4262dbd10 100644 --- a/frontend/src/components/index.ts +++ b/frontend/src/components/index.ts @@ -2,3 +2,4 @@ export * from "./acl"; export * from "./common"; export * from "./entity"; export * from "./entry"; +export * from "./job"; diff --git a/frontend/src/components/job/index.ts b/frontend/src/components/job/index.ts new file mode 100644 index 000000000..4fb6a6998 --- /dev/null +++ b/frontend/src/components/job/index.ts @@ -0,0 +1 @@ +export * from "./JobList"; diff --git a/frontend/src/components/user/UserList.tsx b/frontend/src/components/user/UserList.tsx index bf5f93235..9d07cffed 100644 --- a/frontend/src/components/user/UserList.tsx +++ b/frontend/src/components/user/UserList.tsx @@ -13,7 +13,7 @@ import { } from "@mui/material"; import { styled } from "@mui/material/styles"; import React, { FC, useMemo, useState } from "react"; -import { Link, useNavigate, useLocation } from "react-router-dom"; +import { Link, useLocation, useNavigate } from "react-router-dom"; import { UserControlMenu } from "./UserControlMenu"; @@ -25,7 +25,7 @@ import { useAsyncWithThrow } from "hooks/useAsyncWithThrow"; import { usePage } from "hooks/usePage"; import { aironeApiClient } from "repository/AironeApiClient"; import { newUserPath, userPath } from "routes/Routes"; -import { UserList as ConstUserList } from "services/Constants"; +import { UserListParam } from "services/Constants"; import { ServerContext } from "services/ServerContext"; import { normalizeToMatch } from "services/StringUtil"; @@ -160,7 +160,7 @@ export const UserList: FC = ({}) => { diff --git a/frontend/src/pages/AdvancedSearchResultsPage.tsx b/frontend/src/pages/AdvancedSearchResultsPage.tsx index b3d8c6bfe..b4df09629 100644 --- a/frontend/src/pages/AdvancedSearchResultsPage.tsx +++ b/frontend/src/pages/AdvancedSearchResultsPage.tsx @@ -24,7 +24,7 @@ import { SearchResults } from "components/entry/SearchResults"; import { usePage } from "hooks/usePage"; import { aironeApiClient } from "repository/AironeApiClient"; import { advancedSearchPath, topPath } from "routes/Routes"; -import { AdvancedSerarchResultList } from "services/Constants"; +import { AdvancedSerarchResultListParam } from "services/Constants"; import { extractAdvancedSearchParams } from "services/entry/AdvancedSearch"; export const getIsFiltered = (filterKey?: number, keyword?: string) => { @@ -106,7 +106,7 @@ export const AdvancedSearchResultsPage: FC = () => { referralName, searchAllEntities, page, - AdvancedSerarchResultList.MAX_ROW_COUNT + AdvancedSerarchResultListParam.MAX_ROW_COUNT ); }; @@ -338,7 +338,7 @@ export const AdvancedSearchResultsPage: FC = () => { - {page * AdvancedSerarchResultList.MAX_ROW_COUNT} /{" "} + {page * AdvancedSerarchResultListParam.MAX_ROW_COUNT} /{" "} {searchResults.totalCount} 件 diff --git a/frontend/src/pages/JobListPage.tsx b/frontend/src/pages/JobListPage.tsx index a470f3a88..7135f1808 100644 --- a/frontend/src/pages/JobListPage.tsx +++ b/frontend/src/pages/JobListPage.tsx @@ -14,7 +14,7 @@ import { JobList } from "components/job/JobList"; import { usePage } from "hooks/usePage"; import { aironeApiClient } from "repository/AironeApiClient"; import { topPath } from "routes/Routes"; -import { JobList as ConstJobList } from "services/Constants"; +import { JobListParam } from "services/Constants"; export const JobListPage: FC = () => { const location = useLocation(); @@ -60,7 +60,7 @@ export const JobListPage: FC = () => { diff --git a/frontend/src/repository/AironeApiClient.ts b/frontend/src/repository/AironeApiClient.ts index b88cfefcc..3f11d90a2 100644 --- a/frontend/src/repository/AironeApiClient.ts +++ b/frontend/src/repository/AironeApiClient.ts @@ -51,12 +51,12 @@ import Cookies from "js-cookie"; import fileDownload from "js-file-download"; import { - AdvancedSerarchResultList, - EntityList as ConstEntityList, - EntityHistoryList, - EntryHistoryList, + AdvancedSerarchResultListParam, + EntityHistoryListParam, + EntityListParam, + EntryHistoryListParam, EntryReferralList, - JobList, + JobListParam, } from "services/Constants"; export type GroupTree = Pick<_GroupTree, "id" | "name"> & { @@ -209,8 +209,8 @@ class AironeApiClient { ): Promise { const params: EntityApiV2ListRequest = page ? { - offset: (page - 1) * ConstEntityList.MAX_ROW_COUNT, - limit: ConstEntityList.MAX_ROW_COUNT, + offset: (page - 1) * EntityListParam.MAX_ROW_COUNT, + limit: EntityListParam.MAX_ROW_COUNT, search: search, isToplevel: isToplevel, } @@ -300,8 +300,8 @@ class AironeApiClient { ): Promise { return await this.entity.entityApiV2HistoriesList({ entityId: id, - offset: (page - 1) * EntityHistoryList.MAX_ROW_COUNT, - limit: EntityHistoryList.MAX_ROW_COUNT, + offset: (page - 1) * EntityHistoryListParam.MAX_ROW_COUNT, + limit: EntityHistoryListParam.MAX_ROW_COUNT, }); } @@ -445,8 +445,8 @@ class AironeApiClient { ): Promise { return await this.entry.entryApiV2HistoriesList({ id: id, - offset: (page - 1) * EntryHistoryList.MAX_ROW_COUNT, - limit: EntryHistoryList.MAX_ROW_COUNT, + offset: (page - 1) * EntryHistoryListParam.MAX_ROW_COUNT, + limit: EntryHistoryListParam.MAX_ROW_COUNT, }); } @@ -677,7 +677,7 @@ class AironeApiClient { referralName = "", searchAllEntities = false, page: number, - limit: number = AdvancedSerarchResultList.MAX_ROW_COUNT, + limit: number = AdvancedSerarchResultListParam.MAX_ROW_COUNT, offset: number = 0 ): Promise { return await this.entry.entryApiV2AdvancedSearchCreate( @@ -917,8 +917,8 @@ class AironeApiClient { limit?: number ): Promise { return await this.job.jobApiV2JobsList({ - offset: (page - 1) * JobList.MAX_ROW_COUNT, - limit: limit ?? JobList.MAX_ROW_COUNT, + offset: (page - 1) * JobListParam.MAX_ROW_COUNT, + limit: limit ?? JobListParam.MAX_ROW_COUNT, targetId, }); } @@ -930,7 +930,7 @@ class AironeApiClient { const resp = await this.job.jobApiV2JobsList({ offset: 0, - limit: JobList.MAX_ROW_COUNT, + limit: JobListParam.MAX_ROW_COUNT, createdAfter: createdAfter, }); return resp.results ?? []; diff --git a/frontend/src/services/Constants.ts b/frontend/src/services/Constants.ts index 813f71c61..1d9afec88 100644 --- a/frontend/src/services/Constants.ts +++ b/frontend/src/services/Constants.ts @@ -4,31 +4,31 @@ export const EntityStatus = { EDITING: 1 << 2, }; -export const EntityList = { +export const EntityListParam = { MAX_ROW_COUNT: 30, }; -export const EntryList = { +export const EntryListParam = { MAX_ROW_COUNT: 30, }; -export const UserList = { +export const UserListParam = { MAX_ROW_COUNT: 30, }; -export const JobList = { +export const JobListParam = { MAX_ROW_COUNT: 30, }; -export const EntryHistoryList = { +export const EntryHistoryListParam = { MAX_ROW_COUNT: 30, }; -export const EntityHistoryList = { +export const EntityHistoryListParam = { MAX_ROW_COUNT: 30, }; -export const AdvancedSerarchResultList = { +export const AdvancedSerarchResultListParam = { MAX_ROW_COUNT: 100, }; diff --git a/frontend/src/services/index.ts b/frontend/src/services/index.ts index 1639a321b..e59d99f09 100644 --- a/frontend/src/services/index.ts +++ b/frontend/src/services/index.ts @@ -5,3 +5,6 @@ export * from "./JobUtil"; export * from "./ServerContext"; export * from "./StringUtil"; export * from "./ZodSchemaUtil"; + +export * from "./entry/AdvancedSearch"; +export * from "./entry/Edit"; diff --git a/package.json b/package.json index 74fc61304..b525f07f8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@dmm-com/pagoda-core", - "version": "1.0.1", + "version": "1.0.2", "description": "[![CircleCI](https://circleci.com/gh/dmm-com/airone.svg?style=svg&circle-token=2e12c068b0ed1bab9d0c2d72529d5ee1da9b53b4)](https://circleci.com/gh/dmm-com/airone)", "main": "frontend/dist/pagoda-core.js", "types": "frontend/dist/index.d.ts",