This is an automated email from the ASF dual-hosted git repository.
dengliming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shenyu-dashboard.git
The following commit(s) were added to refs/heads/master by this push:
new cc92a91a fix: apply namespace ID search filter (#679)
cc92a91a is described below
commit cc92a91a7361784002029d14671504687d1ae9a3
Author: Carlos Acosta <[email protected]>
AuthorDate: Sun Sep 27 00:29:52 2026 -0500
fix: apply namespace ID search filter (#679)
Co-authored-by: Aeontra <aeontra@localhost>
---
src/routes/System/Namespace/index.js | 3 +-
src/routes/System/Namespace/index.test.js | 59 +++++++++++++++++++++++++++++++
2 files changed, 60 insertions(+), 2 deletions(-)
diff --git a/src/routes/System/Namespace/index.js
b/src/routes/System/Namespace/index.js
index 3ffc8af8..c153daba 100644
--- a/src/routes/System/Namespace/index.js
+++ b/src/routes/System/Namespace/index.js
@@ -84,8 +84,7 @@ export default class Namespace extends Component {
};
currentQueryPayload = (override) => {
- const { name, currentPage, pageSize } = this.state;
- const { namespaceId } = this.props;
+ const { name, namespaceId, currentPage, pageSize } = this.state;
return {
name,
namespaceId,
diff --git a/src/routes/System/Namespace/index.test.js
b/src/routes/System/Namespace/index.test.js
new file mode 100644
index 00000000..6cd749c2
--- /dev/null
+++ b/src/routes/System/Namespace/index.test.js
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import ConnectedNamespace from "./index";
+
+jest.mock("./AddModal", () => () => null);
+jest.mock(
+ "../../../utils/AuthButton",
+ () =>
+ ({ children }) =>
+ children,
+);
+jest.mock("../../../utils/IntlUtils", () => ({
+ getCurrentLocale: jest.fn(),
+ getIntlContent: (key) => key,
+}));
+jest.mock("../../../utils/AuthRoute", () => ({
+ refreshAuthMenus: jest.fn(),
+}));
+jest.mock("../../../components/_utils/utils", () => ({
+ defaultNamespaceId: "default",
+}));
+
+const Namespace = ConnectedNamespace.WrappedComponent;
+
+it("uses the namespaceId filter stored in component state", () => {
+ const component = new Namespace({
+ currentNamespaceId: "active-namespace",
+ });
+
+ component.state = {
+ ...component.state,
+ name: "demo",
+ namespaceId: "searched-namespace",
+ currentPage: 2,
+ pageSize: 20,
+ };
+
+ expect(component.currentQueryPayload()).toEqual({
+ name: "demo",
+ namespaceId: "searched-namespace",
+ currentPage: 2,
+ pageSize: 20,
+ });
+});