From e3efee3b2651819475f2160816f10cbcf04128f2 Mon Sep 17 00:00:00 2001 From: muralibasani Date: Wed, 4 Oct 2023 15:47:33 +0200 Subject: [PATCH 1/4] Adding all to req operation type enum Signed-off-by: muralibasani --- .../klaw/helpers/db/rdbms/SelectDataJdbc.java | 2 +- .../model/enums/RequestOperationType.java | 3 +- openapi.yaml | 42 +++++++++---------- 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/core/src/main/java/io/aiven/klaw/helpers/db/rdbms/SelectDataJdbc.java b/core/src/main/java/io/aiven/klaw/helpers/db/rdbms/SelectDataJdbc.java index f466414b72..fe30248eb8 100644 --- a/core/src/main/java/io/aiven/klaw/helpers/db/rdbms/SelectDataJdbc.java +++ b/core/src/main/java/io/aiven/klaw/helpers/db/rdbms/SelectDataJdbc.java @@ -227,7 +227,7 @@ public Iterable findAclRequestsByExample( if (requestor != null && !requestor.isEmpty()) { request.setRequestor(requestor); } - if (requestOperationType != null) { + if (requestOperationType != null && !requestOperationType.value.equalsIgnoreCase("all")) { request.setRequestOperationType(requestOperationType.value); } // check if debug is enabled so the logger doesnt waste resources converting object request to a diff --git a/core/src/main/java/io/aiven/klaw/model/enums/RequestOperationType.java b/core/src/main/java/io/aiven/klaw/model/enums/RequestOperationType.java index f8be375ec8..060bb03a86 100644 --- a/core/src/main/java/io/aiven/klaw/model/enums/RequestOperationType.java +++ b/core/src/main/java/io/aiven/klaw/model/enums/RequestOperationType.java @@ -9,7 +9,8 @@ public enum RequestOperationType { UPDATE("Update"), PROMOTE("Promote"), CLAIM("Claim"), - DELETE("Delete"); + DELETE("Delete"), + ALL("All"); // All is applicable only to query requests public final String value; diff --git a/openapi.yaml b/openapi.yaml index 20be95229a..a9f6486d7a 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -3020,7 +3020,7 @@ "required" : false, "schema" : { "type" : "string", - "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE" ] + "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE", "ALL" ] } }, { "name" : "search", @@ -3113,7 +3113,7 @@ "required" : false, "schema" : { "type" : "string", - "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE" ] + "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE", "ALL" ] } }, { "name" : "search", @@ -3727,7 +3727,7 @@ "required" : false, "schema" : { "type" : "string", - "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE" ] + "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE", "ALL" ] } }, { "name" : "order", @@ -3819,7 +3819,7 @@ "required" : false, "schema" : { "type" : "string", - "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE" ] + "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE", "ALL" ] } }, { "name" : "order", @@ -4609,7 +4609,7 @@ "required" : false, "schema" : { "type" : "string", - "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE" ] + "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE", "ALL" ] } }, { "name" : "search", @@ -4694,7 +4694,7 @@ "required" : false, "schema" : { "type" : "string", - "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE" ] + "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE", "ALL" ] } }, { "name" : "search", @@ -5376,7 +5376,7 @@ "required" : false, "schema" : { "type" : "string", - "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE" ] + "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE", "ALL" ] } }, { "name" : "topic", @@ -5505,7 +5505,7 @@ "required" : false, "schema" : { "type" : "string", - "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE" ] + "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE", "ALL" ] } }, { "name" : "order", @@ -5871,7 +5871,7 @@ "properties" : { "requestOperationType" : { "type" : "string", - "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE" ] + "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE", "ALL" ] }, "environment" : { "type" : "string" @@ -6000,7 +6000,7 @@ "properties" : { "requestOperationType" : { "type" : "string", - "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE" ] + "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE", "ALL" ] }, "environment" : { "type" : "string" @@ -6637,7 +6637,7 @@ "properties" : { "requestOperationType" : { "type" : "string", - "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE" ] + "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE", "ALL" ] }, "environment" : { "type" : "string" @@ -6718,7 +6718,7 @@ "properties" : { "requestOperationType" : { "type" : "string", - "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE" ] + "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE", "ALL" ] }, "environment" : { "type" : "string" @@ -6794,7 +6794,7 @@ "properties" : { "requestOperationType" : { "type" : "string", - "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE" ] + "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE", "ALL" ] }, "environment" : { "type" : "string" @@ -7187,7 +7187,7 @@ }, "requestOperationType" : { "type" : "string", - "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE" ] + "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE", "ALL" ] }, "requestStatus" : { "type" : "string", @@ -7472,7 +7472,7 @@ "properties" : { "requestOperationType" : { "type" : "string", - "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE" ] + "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE", "ALL" ] }, "count" : { "type" : "integer", @@ -7929,10 +7929,10 @@ "type" : "integer", "format" : "int32" }, - "highestEnv" : { + "topicOwner" : { "type" : "boolean" }, - "topicOwner" : { + "highestEnv" : { "type" : "boolean" } }, @@ -8173,7 +8173,7 @@ }, "requestOperationType" : { "type" : "string", - "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE" ] + "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE", "ALL" ] }, "requestStatus" : { "type" : "string", @@ -8557,7 +8557,7 @@ }, "requestOperationType" : { "type" : "string", - "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE" ] + "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE", "ALL" ] }, "requestStatus" : { "type" : "string", @@ -8782,7 +8782,7 @@ }, "requestOperationType" : { "type" : "string", - "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE" ] + "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE", "ALL" ] }, "requestStatus" : { "type" : "string", @@ -9297,7 +9297,7 @@ }, "requestOperationType" : { "type" : "string", - "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE" ] + "enum" : [ "CREATE", "UPDATE", "PROMOTE", "CLAIM", "DELETE", "ALL" ] }, "requestStatus" : { "type" : "string", From a4c295584411bcdf4531df43daafaaaa968ccb2a Mon Sep 17 00:00:00 2001 From: Mathieu Anderson Date: Thu, 5 Oct 2023 16:21:47 +0200 Subject: [PATCH 2/4] feat(coral): Add "ALL" value to all references to operationType Signed-off-by: Mathieu Anderson --- .../approvals/acls/AclApprovals.test.tsx | 1 + .../features/approvals/acls/AclApprovals.tsx | 4 +- .../connectors/ConnectorApprovals.test.tsx | 1 + .../connectors/ConnectorApprovals.tsx | 4 +- .../schemas/SchemaApprovals.test.tsx | 1 + .../approvals/schemas/SchemaApprovals.tsx | 4 +- .../approvals/topics/TopicApprovals.test.tsx | 2 + .../approvals/topics/TopicApprovals.tsx | 6 +-- .../utils/request-operation-type-helper.ts | 3 ++ .../filters/RequestTypeFilter.test.tsx | 5 ++- .../components/filters/RequestTypeFilter.tsx | 7 ++-- .../components/filters/useFiltersContext.tsx | 7 ++-- .../requests/acls/AclRequests.test.tsx | 26 ++++++------ .../features/requests/acls/AclRequests.tsx | 2 +- .../connectors/ConnectorRequests.test.tsx | 16 ++++++++ .../requests/connectors/ConnectorRequests.tsx | 2 +- .../requests/schemas/SchemaRequests.test.tsx | 2 +- .../requests/schemas/SchemaRequests.tsx | 2 +- .../requests/topics/TopicRequests.test.tsx | 16 ++++++++ .../requests/topics/TopicRequests.tsx | 2 +- coral/src/domain/requests/requests-types.ts | 3 +- coral/src/domain/topic/topic-api.ts | 3 +- coral/types/api.d.ts | 40 +++++++++---------- 23 files changed, 96 insertions(+), 63 deletions(-) diff --git a/coral/src/app/features/approvals/acls/AclApprovals.test.tsx b/coral/src/app/features/approvals/acls/AclApprovals.test.tsx index c9db874599..7c052abb1e 100644 --- a/coral/src/app/features/approvals/acls/AclApprovals.test.tsx +++ b/coral/src/app/features/approvals/acls/AclApprovals.test.tsx @@ -126,6 +126,7 @@ describe("AclApprovals", () => { env: "ALL", pageNo: "1", requestStatus: "CREATED", + operationType: "ALL", search: "", }; diff --git a/coral/src/app/features/approvals/acls/AclApprovals.tsx b/coral/src/app/features/approvals/acls/AclApprovals.tsx index 1db622c4a8..81c3f4d13f 100644 --- a/coral/src/app/features/approvals/acls/AclApprovals.tsx +++ b/coral/src/app/features/approvals/acls/AclApprovals.tsx @@ -25,8 +25,6 @@ import { import { AclRequestsForApprover } from "src/domain/acl/acl-types"; import { parseErrorMsg } from "src/services/mutation-utils"; -const defaultType = "ALL"; - function AclApprovals() { const queryClient = useQueryClient(); const [searchParams, setSearchParams] = useSearchParams(); @@ -80,7 +78,7 @@ function AclApprovals() { requestStatus: status, aclType, search: search, - operationType: requestType !== defaultType ? requestType : undefined, + operationType: requestType, }), keepPreviousData: true, }); diff --git a/coral/src/app/features/approvals/connectors/ConnectorApprovals.test.tsx b/coral/src/app/features/approvals/connectors/ConnectorApprovals.test.tsx index 342f539d52..41fc07edd7 100644 --- a/coral/src/app/features/approvals/connectors/ConnectorApprovals.test.tsx +++ b/coral/src/app/features/approvals/connectors/ConnectorApprovals.test.tsx @@ -115,6 +115,7 @@ describe("ConnectorApprovals", () => { requestStatus: "CREATED", env: "ALL", search: "", + operationType: "ALL", }; beforeAll(() => { diff --git a/coral/src/app/features/approvals/connectors/ConnectorApprovals.tsx b/coral/src/app/features/approvals/connectors/ConnectorApprovals.tsx index cc589fc6e1..76df66da94 100644 --- a/coral/src/app/features/approvals/connectors/ConnectorApprovals.tsx +++ b/coral/src/app/features/approvals/connectors/ConnectorApprovals.tsx @@ -23,8 +23,6 @@ import { import { parseErrorMsg } from "src/services/mutation-utils"; import { SearchConnectorFilter } from "src/app/features/components/filters/SearchConnectorFilter"; -const defaultType = "ALL"; - function ConnectorApprovals() { const queryClient = useQueryClient(); @@ -72,7 +70,7 @@ function ConnectorApprovals() { pageNo: currentPage.toString(), env: environment, search: search, - operationType: requestType !== defaultType ? requestType : undefined, + operationType: requestType, }), keepPreviousData: true, }); diff --git a/coral/src/app/features/approvals/schemas/SchemaApprovals.test.tsx b/coral/src/app/features/approvals/schemas/SchemaApprovals.test.tsx index 7bda0a99d9..23a3ae58e3 100644 --- a/coral/src/app/features/approvals/schemas/SchemaApprovals.test.tsx +++ b/coral/src/app/features/approvals/schemas/SchemaApprovals.test.tsx @@ -110,6 +110,7 @@ describe("SchemaApprovals", () => { requestStatus: "CREATED", env: "ALL", search: "", + operationType: "ALL", }; beforeAll(() => { mockIntersectionObserver(); diff --git a/coral/src/app/features/approvals/schemas/SchemaApprovals.tsx b/coral/src/app/features/approvals/schemas/SchemaApprovals.tsx index e5a96e808e..3e0f37cb79 100644 --- a/coral/src/app/features/approvals/schemas/SchemaApprovals.tsx +++ b/coral/src/app/features/approvals/schemas/SchemaApprovals.tsx @@ -23,8 +23,6 @@ import { import { parseErrorMsg } from "src/services/mutation-utils"; import { RequestTypeFilter } from "src/app/features/components/filters/RequestTypeFilter"; -const defaultType = "ALL"; - function SchemaApprovals() { const queryClient = useQueryClient(); @@ -72,7 +70,7 @@ function SchemaApprovals() { pageNo: currentPage.toString(), env: environment, search: search, - operationType: requestType !== defaultType ? requestType : undefined, + operationType: requestType, }), keepPreviousData: true, }); diff --git a/coral/src/app/features/approvals/topics/TopicApprovals.test.tsx b/coral/src/app/features/approvals/topics/TopicApprovals.test.tsx index 7e94919199..8096dac33f 100644 --- a/coral/src/app/features/approvals/topics/TopicApprovals.test.tsx +++ b/coral/src/app/features/approvals/topics/TopicApprovals.test.tsx @@ -145,6 +145,7 @@ describe("TopicApprovals", () => { pageNo: "1", requestStatus: "CREATED", search: "", + operationType: "ALL", }; beforeAll(() => { mockIntersectionObserver(); @@ -422,6 +423,7 @@ describe("TopicApprovals", () => { requestStatus: "CREATED", search: "", teamId: undefined, + operationType: "ALL", }); }); }); diff --git a/coral/src/app/features/approvals/topics/TopicApprovals.tsx b/coral/src/app/features/approvals/topics/TopicApprovals.tsx index 661154e064..9be2dd0bf3 100644 --- a/coral/src/app/features/approvals/topics/TopicApprovals.tsx +++ b/coral/src/app/features/approvals/topics/TopicApprovals.tsx @@ -25,8 +25,6 @@ import { import { HTTPError } from "src/services/api"; import { parseErrorMsg } from "src/services/mutation-utils"; -const defaultType = "ALL"; - function TopicApprovals() { const queryClient = useQueryClient(); @@ -81,9 +79,9 @@ function TopicApprovals() { pageNo: String(currentPage), env: environment, requestStatus: status, - teamId: teamId !== defaultType ? Number(teamId) : undefined, + teamId: teamId !== "ALL" ? Number(teamId) : undefined, search: search, - operationType: requestType !== defaultType ? requestType : undefined, + operationType: requestType, }), keepPreviousData: true, }); diff --git a/coral/src/app/features/approvals/utils/request-operation-type-helper.ts b/coral/src/app/features/approvals/utils/request-operation-type-helper.ts index ce043408c6..e537c7f512 100644 --- a/coral/src/app/features/approvals/utils/request-operation-type-helper.ts +++ b/coral/src/app/features/approvals/utils/request-operation-type-helper.ts @@ -6,6 +6,7 @@ import { ChipStatus } from "@aivenio/aquarium"; // here TS won't complain if a possible // value is missing from the array. const requestOperationTypeList: RequestOperationType[] = [ + "ALL", "CLAIM", "CREATE", "DELETE", @@ -16,6 +17,7 @@ const requestOperationTypeList: RequestOperationType[] = [ const requestOperationTypeChipStatusMap: { [key in RequestOperationType]: ChipStatus; } = { + ALL: "neutral", CLAIM: "neutral", CREATE: "neutral", DELETE: "neutral", @@ -26,6 +28,7 @@ const requestOperationTypeChipStatusMap: { const requestOperationTypeNameMap: { [key in RequestOperationType]: string; } = { + ALL: "All", CLAIM: "Claim", CREATE: "Create", DELETE: "Delete", diff --git a/coral/src/app/features/components/filters/RequestTypeFilter.test.tsx b/coral/src/app/features/components/filters/RequestTypeFilter.test.tsx index b3073c8c76..dcf359bc5d 100644 --- a/coral/src/app/features/components/filters/RequestTypeFilter.test.tsx +++ b/coral/src/app/features/components/filters/RequestTypeFilter.test.tsx @@ -40,7 +40,10 @@ describe("RequestTypeFilter.tsx", () => { requestOperationTypeList.forEach((type) => { const option = screen.getByRole("option", { - name: requestOperationTypeNameMap[type], + name: + requestOperationTypeNameMap[type] === "All" + ? "All request types" + : requestOperationTypeNameMap[type], }); expect(option).toBeEnabled(); diff --git a/coral/src/app/features/components/filters/RequestTypeFilter.tsx b/coral/src/app/features/components/filters/RequestTypeFilter.tsx index 72db8a2518..f013524f56 100644 --- a/coral/src/app/features/components/filters/RequestTypeFilter.tsx +++ b/coral/src/app/features/components/filters/RequestTypeFilter.tsx @@ -28,13 +28,12 @@ function RequestTypeFilter() { defaultValue={requestType} onChange={handleChangeRequestType} > - {requestOperationTypeList.map((operationType) => { return ( ); })} diff --git a/coral/src/app/features/components/filters/useFiltersContext.tsx b/coral/src/app/features/components/filters/useFiltersContext.tsx index 20475ac7c7..da0a29a86f 100644 --- a/coral/src/app/features/components/filters/useFiltersContext.tsx +++ b/coral/src/app/features/components/filters/useFiltersContext.tsx @@ -12,7 +12,7 @@ type SetFiltersParams = | { name: "status"; value: RequestStatus } | { name: "teamId"; value: string } | { name: "showOnlyMyRequests"; value: boolean } - | { name: "requestType"; value: RequestOperationType | "ALL" } + | { name: "requestType"; value: RequestOperationType } | { name: "search"; value: string }; interface UseFiltersDefaultValues { @@ -21,7 +21,7 @@ interface UseFiltersDefaultValues { status: RequestStatus; teamId: string; showOnlyMyRequests: boolean; - requestType: RequestOperationType | "ALL"; + requestType: RequestOperationType; search: string; paginated: boolean; } @@ -58,7 +58,6 @@ const FiltersProvider = ({ }) => { const [searchParams, setSearchParams] = useSearchParams(); - // const initialValues = { ...emptyValues, ...defaultValues }; const environment = @@ -70,7 +69,7 @@ const FiltersProvider = ({ const teamId = searchParams.get("teamId") ?? initialValues.teamId; const showOnlyMyRequests = searchParams.get("showOnlyMyRequests") === "true"; const requestType = - (searchParams.get("requestType") as RequestOperationType | "ALL") ?? + (searchParams.get("requestType") as RequestOperationType) ?? initialValues.requestType; const search = searchParams.get("search") ?? initialValues.search; const paginated = initialValues.paginated; diff --git a/coral/src/app/features/requests/acls/AclRequests.test.tsx b/coral/src/app/features/requests/acls/AclRequests.test.tsx index 6267b37ebe..3ff51a3858 100644 --- a/coral/src/app/features/requests/acls/AclRequests.test.tsx +++ b/coral/src/app/features/requests/acls/AclRequests.test.tsx @@ -157,7 +157,7 @@ describe("AclRequests", () => { env: "ALL", aclType: "ALL", requestStatus: "ALL", - operationType: undefined, + operationType: "ALL", isMyRequest: false, }); }); @@ -176,7 +176,7 @@ describe("AclRequests", () => { env: "ALL", aclType: "ALL", requestStatus: "ALL", - operationType: undefined, + operationType: "ALL", isMyRequest: false, }); }); @@ -285,7 +285,7 @@ describe("AclRequests", () => { env: "ALL", aclType: "ALL", requestStatus: "ALL", - operationType: undefined, + operationType: "ALL", isMyRequest: false, }); }); @@ -309,7 +309,7 @@ describe("AclRequests", () => { env: "ALL", aclType: "ALL", requestStatus: "ALL", - operationType: undefined, + operationType: "ALL", isMyRequest: false, }); }); @@ -330,7 +330,7 @@ describe("AclRequests", () => { env: "ALL", aclType: "ALL", requestStatus: "ALL", - operationType: undefined, + operationType: "ALL", isMyRequest: false, }); }); @@ -365,7 +365,7 @@ describe("AclRequests", () => { env: "1", aclType: "ALL", requestStatus: "ALL", - operationType: undefined, + operationType: "ALL", isMyRequest: false, }); }); @@ -393,7 +393,7 @@ describe("AclRequests", () => { env: "1", aclType: "ALL", requestStatus: "ALL", - operationType: undefined, + operationType: "ALL", isMyRequest: false, }); }); @@ -424,7 +424,7 @@ describe("AclRequests", () => { env: "ALL", aclType: "CONSUMER", requestStatus: "ALL", - operationType: undefined, + operationType: "ALL", isMyRequest: false, }); }); @@ -448,7 +448,7 @@ describe("AclRequests", () => { env: "ALL", aclType: "CONSUMER", requestStatus: "ALL", - operationType: undefined, + operationType: "ALL", isMyRequest: false, }); }); @@ -479,7 +479,7 @@ describe("AclRequests", () => { env: "ALL", aclType: "ALL", requestStatus: "APPROVED", - operationType: undefined, + operationType: "ALL", isMyRequest: false, }); }); @@ -504,7 +504,7 @@ describe("AclRequests", () => { env: "ALL", aclType: "ALL", requestStatus: "APPROVED", - operationType: undefined, + operationType: "ALL", isMyRequest: false, }); }); @@ -536,7 +536,7 @@ describe("AclRequests", () => { aclType: "ALL", requestStatus: "ALL", isMyRequest: true, - operationType: undefined, + operationType: "ALL", }); }); @@ -564,7 +564,7 @@ describe("AclRequests", () => { aclType: "ALL", requestStatus: "ALL", isMyRequest: true, - operationType: undefined, + operationType: "ALL", }); }); }); diff --git a/coral/src/app/features/requests/acls/AclRequests.tsx b/coral/src/app/features/requests/acls/AclRequests.tsx index 6bc7c92d51..17d179875f 100644 --- a/coral/src/app/features/requests/acls/AclRequests.tsx +++ b/coral/src/app/features/requests/acls/AclRequests.tsx @@ -79,7 +79,7 @@ function AclRequests() { env: environment, aclType, requestStatus: status, - operationType: requestType === "ALL" ? undefined : requestType, + operationType: requestType, isMyRequest: showOnlyMyRequests, }), keepPreviousData: true, diff --git a/coral/src/app/features/requests/connectors/ConnectorRequests.test.tsx b/coral/src/app/features/requests/connectors/ConnectorRequests.test.tsx index 318ed5e4f0..1ddc52ade6 100644 --- a/coral/src/app/features/requests/connectors/ConnectorRequests.test.tsx +++ b/coral/src/app/features/requests/connectors/ConnectorRequests.test.tsx @@ -193,6 +193,7 @@ describe("ConnectorRequests", () => { env: "ALL", isMyRequest: false, requestStatus: "ALL", + operationType: "ALL", }); }); @@ -210,6 +211,7 @@ describe("ConnectorRequests", () => { env: "ALL", isMyRequest: false, requestStatus: "ALL", + operationType: "ALL", }); }); @@ -320,6 +322,7 @@ describe("ConnectorRequests", () => { env: "ALL", isMyRequest: false, requestStatus: "ALL", + operationType: "ALL", }); }); }); @@ -342,6 +345,7 @@ describe("ConnectorRequests", () => { env: "ALL", isMyRequest: false, requestStatus: "ALL", + operationType: "ALL", }); }); @@ -364,6 +368,7 @@ describe("ConnectorRequests", () => { env: "ALL", isMyRequest: false, requestStatus: "ALL", + operationType: "ALL", }); }); }); @@ -399,6 +404,7 @@ describe("ConnectorRequests", () => { env: "TEST_ENV_THAT_CANNOT_BE_PART_OF_ANY_API_MOCK", isMyRequest: false, requestStatus: "ALL", + operationType: "ALL", }); }); @@ -418,6 +424,7 @@ describe("ConnectorRequests", () => { env: mockedEnvironmentResponse[0].id, isMyRequest: false, requestStatus: "ALL", + operationType: "ALL", }); }); }); @@ -440,6 +447,7 @@ describe("ConnectorRequests", () => { search: "", env: "ALL", requestStatus: "ALL", + operationType: "ALL", }); }); @@ -459,6 +467,7 @@ describe("ConnectorRequests", () => { search: "", env: "ALL", requestStatus: "ALL", + operationType: "ALL", }); }); }); @@ -480,6 +489,7 @@ describe("ConnectorRequests", () => { search: "", env: "ALL", requestStatus: "ALL", + operationType: "ALL", }); }); }); @@ -516,6 +526,7 @@ describe("ConnectorRequests", () => { isMyRequest: false, requestStatus: "TEST_STATUS_THAT_CANNOT_BE_PART_OF_ANY_API_MOCK", env: "ALL", + operationType: "ALL", }); }); @@ -536,6 +547,7 @@ describe("ConnectorRequests", () => { isMyRequest: false, requestStatus: newStatus, env: "ALL", + operationType: "ALL", }); }); }); @@ -657,6 +669,7 @@ describe("ConnectorRequests", () => { isMyRequest: false, requestStatus: "ALL", env: "ALL", + operationType: "ALL", }); const deleteButton = screen.getByRole("button", { @@ -683,6 +696,7 @@ describe("ConnectorRequests", () => { isMyRequest: false, requestStatus: "ALL", env: "ALL", + operationType: "ALL", }); expect(console.error).not.toHaveBeenCalled(); }); @@ -695,6 +709,7 @@ describe("ConnectorRequests", () => { isMyRequest: false, requestStatus: "ALL", env: "ALL", + operationType: "ALL", }); const deleteButton = screen.getByRole("button", { @@ -730,6 +745,7 @@ describe("ConnectorRequests", () => { isMyRequest: false, requestStatus: "ALL", env: "ALL", + operationType: "ALL", }); const deleteButton = screen.getByRole("button", { diff --git a/coral/src/app/features/requests/connectors/ConnectorRequests.tsx b/coral/src/app/features/requests/connectors/ConnectorRequests.tsx index 902a0011b2..26a5b1da4d 100644 --- a/coral/src/app/features/requests/connectors/ConnectorRequests.tsx +++ b/coral/src/app/features/requests/connectors/ConnectorRequests.tsx @@ -81,7 +81,7 @@ function ConnectorRequests() { env: environment, search, requestStatus: status, - operationType: requestType !== "ALL" ? requestType : undefined, + operationType: requestType, }), keepPreviousData: true, }); diff --git a/coral/src/app/features/requests/schemas/SchemaRequests.test.tsx b/coral/src/app/features/requests/schemas/SchemaRequests.test.tsx index f8eac1f4f3..5c524cfe51 100644 --- a/coral/src/app/features/requests/schemas/SchemaRequests.test.tsx +++ b/coral/src/app/features/requests/schemas/SchemaRequests.test.tsx @@ -41,7 +41,7 @@ describe("SchemaRequest", () => { const defaultApiParams = { env: "ALL", pageNo: "1", - operationType: undefined, + operationType: "ALL", requestStatus: undefined, search: "", isMyRequest: false, diff --git a/coral/src/app/features/requests/schemas/SchemaRequests.tsx b/coral/src/app/features/requests/schemas/SchemaRequests.tsx index 480362e143..a7623bdf5b 100644 --- a/coral/src/app/features/requests/schemas/SchemaRequests.tsx +++ b/coral/src/app/features/requests/schemas/SchemaRequests.tsx @@ -64,7 +64,7 @@ function SchemaRequests() { requestStatus: status !== "ALL" ? status : undefined, search: search, isMyRequest: showOnlyMyRequests, - operationType: requestType !== "ALL" ? requestType : undefined, + operationType: requestType, }), keepPreviousData: true, }); diff --git a/coral/src/app/features/requests/topics/TopicRequests.test.tsx b/coral/src/app/features/requests/topics/TopicRequests.test.tsx index 0f997082a3..02674b9689 100644 --- a/coral/src/app/features/requests/topics/TopicRequests.test.tsx +++ b/coral/src/app/features/requests/topics/TopicRequests.test.tsx @@ -109,6 +109,7 @@ describe("TopicRequests", () => { isMyRequest: false, requestStatus: "ALL", env: "ALL", + operationType: "ALL", }); }); @@ -128,6 +129,7 @@ describe("TopicRequests", () => { isMyRequest: false, requestStatus: "ALL", env: "ALL", + operationType: "ALL", }); }); }); @@ -151,6 +153,7 @@ describe("TopicRequests", () => { search: "", requestStatus: "ALL", env: "ALL", + operationType: "ALL", }); }); @@ -170,6 +173,7 @@ describe("TopicRequests", () => { search: "", requestStatus: "ALL", env: "ALL", + operationType: "ALL", }); }); }); @@ -191,6 +195,7 @@ describe("TopicRequests", () => { search: "", requestStatus: "ALL", env: "ALL", + operationType: "ALL", }); }); }); @@ -228,6 +233,7 @@ describe("TopicRequests", () => { isMyRequest: false, requestStatus: "ALL", env: "ALL", + operationType: "ALL", }); }); @@ -245,6 +251,7 @@ describe("TopicRequests", () => { isMyRequest: false, requestStatus: "ALL", env: "ALL", + operationType: "ALL", }); }); @@ -355,6 +362,7 @@ describe("TopicRequests", () => { isMyRequest: false, requestStatus: "ALL", env: "ALL", + operationType: "ALL", }); }); }); @@ -386,6 +394,7 @@ describe("TopicRequests", () => { isMyRequest: false, requestStatus: "ALL", env: "TEST_ENV_THAT_CANNOT_BE_PART_OF_ANY_API_MOCK", + operationType: "ALL", }); }); @@ -405,6 +414,7 @@ describe("TopicRequests", () => { isMyRequest: false, requestStatus: "ALL", env: mockedEnvironmentResponse[0].id, + operationType: "ALL", }); }); }); @@ -438,6 +448,7 @@ describe("TopicRequests", () => { isMyRequest: false, requestStatus: "TEST_STATUS_THAT_CANNOT_BE_PART_OF_ANY_API_MOCK", env: "ALL", + operationType: "ALL", }); }); @@ -458,6 +469,7 @@ describe("TopicRequests", () => { isMyRequest: false, requestStatus: newStatus, env: "ALL", + operationType: "ALL", }); }); }); @@ -606,6 +618,7 @@ describe("TopicRequests", () => { isMyRequest: false, requestStatus: "ALL", env: "ALL", + operationType: "ALL", }); const deleteButton = screen.getByRole("button", { @@ -632,6 +645,7 @@ describe("TopicRequests", () => { isMyRequest: false, requestStatus: "ALL", env: "ALL", + operationType: "ALL", }); expect(console.error).not.toHaveBeenCalled(); }); @@ -644,6 +658,7 @@ describe("TopicRequests", () => { isMyRequest: false, requestStatus: "ALL", env: "ALL", + operationType: "ALL", }); const deleteButton = screen.getByRole("button", { @@ -679,6 +694,7 @@ describe("TopicRequests", () => { isMyRequest: false, requestStatus: "ALL", env: "ALL", + operationType: "ALL", }); const deleteButton = screen.getByRole("button", { diff --git a/coral/src/app/features/requests/topics/TopicRequests.tsx b/coral/src/app/features/requests/topics/TopicRequests.tsx index 79b408eb3e..0a95f67073 100644 --- a/coral/src/app/features/requests/topics/TopicRequests.tsx +++ b/coral/src/app/features/requests/topics/TopicRequests.tsx @@ -56,7 +56,7 @@ function TopicRequests() { env: environment, requestStatus: status, isMyRequest: showOnlyMyRequests, - operationType: requestType !== "ALL" ? requestType : undefined, + operationType: requestType, }), keepPreviousData: true, }); diff --git a/coral/src/domain/requests/requests-types.ts b/coral/src/domain/requests/requests-types.ts index 945b1a51e8..4d7adab1d5 100644 --- a/coral/src/domain/requests/requests-types.ts +++ b/coral/src/domain/requests/requests-types.ts @@ -6,7 +6,8 @@ type RequestOperationType = | "UPDATE" | "PROMOTE" | "CLAIM" - | "DELETE"; + | "DELETE" + | "ALL"; type RequestStatus = "CREATED" | "DELETED" | "DECLINED" | "APPROVED" | "ALL"; type RequestVerdict = components["schemas"]["RequestVerdict"]; type RequestEntityType = diff --git a/coral/src/domain/topic/topic-api.ts b/coral/src/domain/topic/topic-api.ts index 8f8b74a3d3..5b3243c87a 100644 --- a/coral/src/domain/topic/topic-api.ts +++ b/coral/src/domain/topic/topic-api.ts @@ -211,8 +211,7 @@ const getTopicRequests = ( const omitEnv = property === "env" && (value === "ALL" || value === undefined); const omitRequestOperationType = - property === "operationType" && - (value === "ALL" || value === undefined); + property === "operationType" && value === undefined; return ( omitIsMyRequest || omitSearch || omitEnv || omitRequestOperationType diff --git a/coral/types/api.d.ts b/coral/types/api.d.ts index b233913400..2d0935aecd 100644 --- a/coral/types/api.d.ts +++ b/coral/types/api.d.ts @@ -540,7 +540,7 @@ export type components = { schemas: { SchemaRequestModel: { /** @enum {string} */ - requestOperationType: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE"; + requestOperationType: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE" | "ALL"; environment: string; appname?: string; remarks?: string; @@ -583,7 +583,7 @@ export type components = { }; TopicUpdateRequestModel: { /** @enum {string} */ - requestOperationType: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE"; + requestOperationType: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE" | "ALL"; environment: string; appname?: string; remarks?: string; @@ -804,7 +804,7 @@ export type components = { }; TopicCreateRequestModel: { /** @enum {string} */ - requestOperationType: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE"; + requestOperationType: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE" | "ALL"; environment: string; appname?: string; remarks?: string; @@ -833,7 +833,7 @@ export type components = { }; KafkaConnectorRequestModel: { /** @enum {string} */ - requestOperationType: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE"; + requestOperationType: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE" | "ALL"; environment: string; appname?: string; remarks?: string; @@ -861,7 +861,7 @@ export type components = { }; AclRequestsModel: { /** @enum {string} */ - requestOperationType: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE"; + requestOperationType: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE" | "ALL"; environment: string; appname?: string; remarks?: string; @@ -994,7 +994,7 @@ export type components = { teamId: number; teamname: string; /** @enum {string} */ - requestOperationType: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE"; + requestOperationType: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE" | "ALL"; /** @enum {string} */ requestStatus: "CREATED" | "DELETED" | "DECLINED" | "APPROVED" | "ALL"; /** Format: date-time */ @@ -1087,7 +1087,7 @@ export type components = { }; RequestsOperationTypeCount: { /** @enum {string} */ - requestOperationType?: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE"; + requestOperationType?: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE" | "ALL"; /** Format: int64 */ count?: number; }; @@ -1248,8 +1248,8 @@ export type components = { hasSchema: boolean; /** Format: int32 */ clusterId: number; - highestEnv?: boolean; topicOwner?: boolean; + highestEnv?: boolean; }; TopicBaseConfig: { topicName: string; @@ -1335,7 +1335,7 @@ export type components = { teamId: number; teamname: string; /** @enum {string} */ - requestOperationType: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE"; + requestOperationType: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE" | "ALL"; /** @enum {string} */ requestStatus: "CREATED" | "DELETED" | "DECLINED" | "APPROVED" | "ALL"; /** Format: date-time */ @@ -1466,7 +1466,7 @@ export type components = { teamId: number; teamname: string; /** @enum {string} */ - requestOperationType: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE"; + requestOperationType: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE" | "ALL"; /** @enum {string} */ requestStatus: "CREATED" | "DELETED" | "DECLINED" | "APPROVED" | "ALL"; /** Format: date-time */ @@ -1552,7 +1552,7 @@ export type components = { teamId: number; teamname: string; /** @enum {string} */ - requestOperationType: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE"; + requestOperationType: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE" | "ALL"; /** @enum {string} */ requestStatus: "CREATED" | "DELETED" | "DECLINED" | "APPROVED" | "ALL"; /** Format: date-time */ @@ -1734,7 +1734,7 @@ export type components = { teamId: number; teamname: string; /** @enum {string} */ - requestOperationType: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE"; + requestOperationType: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE" | "ALL"; /** @enum {string} */ requestStatus: "CREATED" | "DELETED" | "DECLINED" | "APPROVED" | "ALL"; /** Format: date-time */ @@ -3276,7 +3276,7 @@ export type operations = { currentPage?: string; requestStatus?: "CREATED" | "DELETED" | "DECLINED" | "APPROVED" | "ALL"; env?: string; - operationType?: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE"; + operationType?: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE" | "ALL"; search?: string; order?: "ASC_REQUESTED_TIME" | "DESC_REQUESTED_TIME"; isMyRequest?: boolean; @@ -3299,7 +3299,7 @@ export type operations = { requestStatus?: "CREATED" | "DELETED" | "DECLINED" | "APPROVED" | "ALL"; teamId?: number; env?: string; - operationType?: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE"; + operationType?: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE" | "ALL"; search?: string; order?: "ASC_REQUESTED_TIME" | "DESC_REQUESTED_TIME"; }; @@ -3528,7 +3528,7 @@ export type operations = { topic?: string; env?: string; search?: string; - operationType?: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE"; + operationType?: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE" | "ALL"; order?: "ASC_REQUESTED_TIME" | "DESC_REQUESTED_TIME"; isMyRequest?: boolean; }; @@ -3551,7 +3551,7 @@ export type operations = { topic?: string; env?: string; search?: string; - operationType?: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE"; + operationType?: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE" | "ALL"; order?: "ASC_REQUESTED_TIME" | "DESC_REQUESTED_TIME"; }; }; @@ -3897,7 +3897,7 @@ export type operations = { requestStatus?: "CREATED" | "DELETED" | "DECLINED" | "APPROVED" | "ALL"; env?: string; order?: "ASC_REQUESTED_TIME" | "DESC_REQUESTED_TIME"; - operationType?: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE"; + operationType?: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE" | "ALL"; search?: string; isMyRequest?: boolean; }; @@ -3919,7 +3919,7 @@ export type operations = { requestStatus?: "CREATED" | "DELETED" | "DECLINED" | "APPROVED" | "ALL"; env?: string; order?: "ASC_REQUESTED_TIME" | "DESC_REQUESTED_TIME"; - operationType?: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE"; + operationType?: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE" | "ALL"; search?: string; }; }; @@ -4239,7 +4239,7 @@ export type operations = { pageNo: string; currentPage?: string; requestStatus?: "CREATED" | "DELETED" | "DECLINED" | "APPROVED" | "ALL"; - operationType?: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE"; + operationType?: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE" | "ALL"; topic?: string; env?: string; search?: string; @@ -4267,7 +4267,7 @@ export type operations = { env?: string; search?: string; aclType?: "PRODUCER" | "CONSUMER"; - operationType?: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE"; + operationType?: "CREATE" | "UPDATE" | "PROMOTE" | "CLAIM" | "DELETE" | "ALL"; order?: "ASC_REQUESTED_TIME" | "DESC_REQUESTED_TIME"; }; }; From ea3e3d6ce18adb9486e20e84354ef43b44019236 Mon Sep 17 00:00:00 2001 From: muralibasani Date: Thu, 5 Oct 2023 16:47:36 +0200 Subject: [PATCH 3/4] Fix queries for topics, connectors, schemas Signed-off-by: muralibasani --- .../klaw/helpers/db/rdbms/SelectDataJdbc.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/core/src/main/java/io/aiven/klaw/helpers/db/rdbms/SelectDataJdbc.java b/core/src/main/java/io/aiven/klaw/helpers/db/rdbms/SelectDataJdbc.java index fe30248eb8..57e381343e 100644 --- a/core/src/main/java/io/aiven/klaw/helpers/db/rdbms/SelectDataJdbc.java +++ b/core/src/main/java/io/aiven/klaw/helpers/db/rdbms/SelectDataJdbc.java @@ -344,7 +344,7 @@ public Iterable findSchemaRequestsByExample( if (userName != null && !userName.isEmpty()) { request.setRequestor(userName); } - if (requestOperationType != null) { + if (requestOperationType != null && !requestOperationType.value.equalsIgnoreCase("all")) { request.setRequestOperationType(requestOperationType.value); } @@ -663,7 +663,7 @@ private void filterAndAddOperationalRequest( * Query the TopicRequestsRepo by supplying optional search parameters any given search parameters * will be utilised in the search. * - * @param requestType The type of topic request Create/claim etc + * @param requestOperationType The type of topic request Create/claim etc * @param teamId The identifier of the team * @param environment the environment * @param status created/declined/approved @@ -673,7 +673,7 @@ private void filterAndAddOperationalRequest( * @return An Iterable of all TopicRequests that match the parameters that have been supplied */ private Iterable findTopicRequestsByExample( - String requestType, + String requestOperationType, Integer teamId, String environment, String status, @@ -684,8 +684,8 @@ private Iterable findTopicRequestsByExample( TopicRequest request = new TopicRequest(); request.setTenantId(tenantId); - if (requestType != null) { - request.setRequestOperationType(requestType); + if (requestOperationType != null && !requestOperationType.equalsIgnoreCase("all")) { + request.setRequestOperationType(requestOperationType); } if (environment != null) { request.setEnvironment(environment); @@ -812,7 +812,7 @@ public List getTopicsByTopicNameAndTeamId(String topicName, int teamId, i * Query the KafkaConnectorRequestsRepo by supplying optional search parameters any given search * parameters will be utilised in the search. * - * @param requestType The type of topic request Create/claim etc + * @param requestOperationType The type of topic request Create/claim etc * @param teamId The identifier of the team * @param environment the environment * @param status created/declined/approved @@ -821,7 +821,7 @@ public List getTopicsByTopicNameAndTeamId(String topicName, int teamId, i * @return An Iterable of all TopicRequests that match the parameters that have been supplied */ private Iterable findKafkaConnectorRequestsByExample( - String requestType, + String requestOperationType, Integer teamId, String environment, String status, @@ -832,8 +832,8 @@ private Iterable findKafkaConnectorRequestsByExample( KafkaConnectorRequest request = new KafkaConnectorRequest(); request.setTenantId(tenantId); - if (requestType != null) { - request.setRequestOperationType(requestType); + if (requestOperationType != null && !requestOperationType.equalsIgnoreCase("all")) { + request.setRequestOperationType(requestOperationType); } if (environment != null) { request.setEnvironment(environment); From d58df088b7abd398fe7b48d319db07c719764976 Mon Sep 17 00:00:00 2001 From: muralibasani Date: Fri, 6 Oct 2023 11:28:55 +0200 Subject: [PATCH 4/4] Changes from review Signed-off-by: muralibasani --- .../io/aiven/klaw/helpers/db/rdbms/SelectDataJdbc.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/io/aiven/klaw/helpers/db/rdbms/SelectDataJdbc.java b/core/src/main/java/io/aiven/klaw/helpers/db/rdbms/SelectDataJdbc.java index 57e381343e..5022a9f8d5 100644 --- a/core/src/main/java/io/aiven/klaw/helpers/db/rdbms/SelectDataJdbc.java +++ b/core/src/main/java/io/aiven/klaw/helpers/db/rdbms/SelectDataJdbc.java @@ -227,7 +227,7 @@ public Iterable findAclRequestsByExample( if (requestor != null && !requestor.isEmpty()) { request.setRequestor(requestor); } - if (requestOperationType != null && !requestOperationType.value.equalsIgnoreCase("all")) { + if (requestOperationType != null && requestOperationType != RequestOperationType.ALL) { request.setRequestOperationType(requestOperationType.value); } // check if debug is enabled so the logger doesnt waste resources converting object request to a @@ -344,7 +344,7 @@ public Iterable findSchemaRequestsByExample( if (userName != null && !userName.isEmpty()) { request.setRequestor(userName); } - if (requestOperationType != null && !requestOperationType.value.equalsIgnoreCase("all")) { + if (requestOperationType != null && requestOperationType != RequestOperationType.ALL) { request.setRequestOperationType(requestOperationType.value); } @@ -684,7 +684,8 @@ private Iterable findTopicRequestsByExample( TopicRequest request = new TopicRequest(); request.setTenantId(tenantId); - if (requestOperationType != null && !requestOperationType.equalsIgnoreCase("all")) { + if (requestOperationType != null + && !requestOperationType.equals(RequestOperationType.ALL.value)) { request.setRequestOperationType(requestOperationType); } if (environment != null) { @@ -832,7 +833,8 @@ private Iterable findKafkaConnectorRequestsByExample( KafkaConnectorRequest request = new KafkaConnectorRequest(); request.setTenantId(tenantId); - if (requestOperationType != null && !requestOperationType.equalsIgnoreCase("all")) { + if (requestOperationType != null + && !requestOperationType.equals(RequestOperationType.ALL.value)) { request.setRequestOperationType(requestOperationType); } if (environment != null) {