From a42aafb4c51465adb57afa9224a6615add337c52 Mon Sep 17 00:00:00 2001 From: MiguelRamBalt Date: Fri, 9 Apr 2021 07:16:16 -0500 Subject: [PATCH 1/4] add debounce time for apis-docs Signed-off-by: MiguelRamBalt --- packages/core/src/hooks/useQueryParamState.ts | 3 ++- .../src/components/ApiExplorerTable/ApiExplorerTable.tsx | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/core/src/hooks/useQueryParamState.ts b/packages/core/src/hooks/useQueryParamState.ts index dc2279cb53..da303234f5 100644 --- a/packages/core/src/hooks/useQueryParamState.ts +++ b/packages/core/src/hooks/useQueryParamState.ts @@ -58,6 +58,7 @@ type SetQueryParams = (params: T) => void; export function useQueryParamState( stateName: string, + debounceTime: number = 100, ): [T | undefined, SetQueryParams] { const navigate = useNavigate(); const location = useLocation(); @@ -85,7 +86,7 @@ export function useQueryParamState( navigate({ ...location, search: `?${queryString}` }, { replace: true }); } }, - 100, + debounceTime, [queryParamState], ); diff --git a/plugins/api-docs/src/components/ApiExplorerTable/ApiExplorerTable.tsx b/plugins/api-docs/src/components/ApiExplorerTable/ApiExplorerTable.tsx index 5b9808e26d..39c2caaf1b 100644 --- a/plugins/api-docs/src/components/ApiExplorerTable/ApiExplorerTable.tsx +++ b/plugins/api-docs/src/components/ApiExplorerTable/ApiExplorerTable.tsx @@ -156,6 +156,7 @@ export const ApiExplorerTable = ({ }: ExplorerTableProps) => { const [queryParamState, setQueryParamState] = useQueryParamState( 'apiTable', + 500, ); if (error) { From 5cafcf452750a16fcb5543451f227a2dc71d3f1e Mon Sep 17 00:00:00 2001 From: MiguelRamBalt Date: Fri, 9 Apr 2021 08:23:23 -0500 Subject: [PATCH 2/4] add changeset specifications Signed-off-by: MiguelRamBalt --- .changeset/tender-turtles-smash.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/tender-turtles-smash.md diff --git a/.changeset/tender-turtles-smash.md b/.changeset/tender-turtles-smash.md new file mode 100644 index 0000000000..645ed688db --- /dev/null +++ b/.changeset/tender-turtles-smash.md @@ -0,0 +1,6 @@ +--- +'@backstage/core': patch +'@backstage/plugin-api-docs': patch +--- + +add debounce time attribute for apis-docs for search, giving more time to the users when they are typing. From 5fe923715b8d78609a3d1d9fddf7b26abda2128a Mon Sep 17 00:00:00 2001 From: MiguelRamBalt Date: Fri, 9 Apr 2021 09:09:23 -0500 Subject: [PATCH 3/4] add debounce word to vocab Signed-off-by: MiguelRamBalt --- .github/styles/vocab.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/styles/vocab.txt b/.github/styles/vocab.txt index b0bcf9c9f7..e76c90ef68 100644 --- a/.github/styles/vocab.txt +++ b/.github/styles/vocab.txt @@ -13,6 +13,7 @@ Cloudformation Codecov Codehilite Config +Debounce Discoverability Dockerfile Dockerize From 27b2237fbeb805cdf10524e3cedbbed2fd9a103f Mon Sep 17 00:00:00 2001 From: MiguelRamBalt Date: Fri, 9 Apr 2021 09:12:53 -0500 Subject: [PATCH 4/4] add debounce word to vocab Signed-off-by: MiguelRamBalt --- .github/styles/vocab.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/styles/vocab.txt b/.github/styles/vocab.txt index e76c90ef68..8c385e1bbb 100644 --- a/.github/styles/vocab.txt +++ b/.github/styles/vocab.txt @@ -112,6 +112,7 @@ cookiecutter css dataflow deadnaming +debounce declaratively destructured dev