{
expect(term).toBeVisible();
expect(definition[0]).toHaveTextContent(
- String(testClusterDetails.kafkaFlavor)
+ kafkaFlavorToString[testClusterDetails.kafkaFlavor]
);
});
diff --git a/coral/src/app/features/topics/details/overview/components/ClusterDetails.tsx b/coral/src/app/features/topics/details/overview/components/ClusterDetails.tsx
index 373abc5c50..cd71fafe6b 100644
--- a/coral/src/app/features/topics/details/overview/components/ClusterDetails.tsx
+++ b/coral/src/app/features/topics/details/overview/components/ClusterDetails.tsx
@@ -8,6 +8,7 @@ import {
} from "@aivenio/aquarium";
import React from "react";
import { ClusterDetails as ClusterDetailsType } from "src/domain/cluster";
+import { kafkaFlavorToString } from "src/services/formatter/kafka-flavor-formatter";
function DefinitionBlock({
term,
@@ -92,7 +93,11 @@ function ClusterDetails({ clusterDetails, isUpdating }: ClusterDetailsProps) {
): Promise {
const params: KlawApiRequestQueryParameters<"getClustersPaginated"> = {
- clusterType: "all",
+ clusterType: "ALL",
pageNo,
...(searchClusterParam && { searchClusterParam: searchClusterParam }),
};
diff --git a/coral/src/domain/cluster/cluster-types.ts b/coral/src/domain/cluster/cluster-types.ts
index 57ac45dea8..c0b85606ad 100644
--- a/coral/src/domain/cluster/cluster-types.ts
+++ b/coral/src/domain/cluster/cluster-types.ts
@@ -10,9 +10,16 @@ type ClustersPaginatedApiResponse = ResolveIntersectionTypes<
type AddNewClusterPayload = KlawApiModel<"KwClustersModel">;
+type ClusterKafkaFlavor =
+ KlawApiModel<"KwClustersModelResponse">["kafkaFlavor"];
+
+type ClusterType = KlawApiModel<"KwClustersModelResponse">["clusterType"];
+
export type {
ClusterInfoFromEnvironment,
ClusterDetails,
ClustersPaginatedApiResponse,
AddNewClusterPayload,
+ ClusterKafkaFlavor,
+ ClusterType,
};
diff --git a/coral/src/domain/cluster/index.ts b/coral/src/domain/cluster/index.ts
index d81eb412fe..757f2f5004 100644
--- a/coral/src/domain/cluster/index.ts
+++ b/coral/src/domain/cluster/index.ts
@@ -8,6 +8,8 @@ import {
AddNewClusterPayload,
ClusterInfoFromEnvironment,
ClusterDetails,
+ ClusterKafkaFlavor,
+ ClusterType,
} from "src/domain/cluster/cluster-types";
export {
@@ -20,4 +22,6 @@ export type {
AddNewClusterPayload,
ClusterInfoFromEnvironment,
ClusterDetails,
+ ClusterKafkaFlavor,
+ ClusterType,
};
diff --git a/coral/src/services/formatter/cluster-type-formatter.ts b/coral/src/services/formatter/cluster-type-formatter.ts
new file mode 100644
index 0000000000..5702be22fd
--- /dev/null
+++ b/coral/src/services/formatter/cluster-type-formatter.ts
@@ -0,0 +1,11 @@
+import { ClusterType } from "src/domain/cluster";
+
+type ClusterTypeMap = Record;
+const clusterTypeToString: ClusterTypeMap = {
+ ALL: "All",
+ KAFKA: "Kafka",
+ SCHEMA_REGISTRY: "Schema Registry",
+ KAFKA_CONNECT: "Kafka Connect",
+};
+
+export { clusterTypeToString };
diff --git a/coral/src/services/formatter/kafka-flavor-formatter.ts b/coral/src/services/formatter/kafka-flavor-formatter.ts
new file mode 100644
index 0000000000..863847f2d1
--- /dev/null
+++ b/coral/src/services/formatter/kafka-flavor-formatter.ts
@@ -0,0 +1,12 @@
+import { ClusterKafkaFlavor } from "src/domain/cluster";
+
+type ClusterKafkaFlavorMap = Record;
+const kafkaFlavorToString: ClusterKafkaFlavorMap = {
+ APACHE_KAFKA: "Apache Kafka",
+ AIVEN_FOR_APACHE_KAFKA: "Aiven for Apache Kafka",
+ CONFLUENT: "Confluent",
+ CONFLUENT_CLOUD: "Confluent Cloud",
+ OTHERS: "others",
+};
+
+export { kafkaFlavorToString };
diff --git a/coral/types/api.d.ts b/coral/types/api.d.ts
index f4f6108f72..00fcc1aaca 100644
--- a/coral/types/api.d.ts
+++ b/coral/types/api.d.ts
@@ -4021,7 +4021,7 @@ export type operations = {
getClustersPaginated: {
parameters: {
query: {
- clusterType: string;
+ clusterType: "ALL" | "KAFKA" | "SCHEMA_REGISTRY" | "KAFKA_CONNECT";
pageNo: string;
clusterId?: string;
searchClusterParam?: string;
diff --git a/core/src/main/java/io/aiven/klaw/controller/EnvsClustersTenantsController.java b/core/src/main/java/io/aiven/klaw/controller/EnvsClustersTenantsController.java
index c4ffd835cf..d6792caf84 100644
--- a/core/src/main/java/io/aiven/klaw/controller/EnvsClustersTenantsController.java
+++ b/core/src/main/java/io/aiven/klaw/controller/EnvsClustersTenantsController.java
@@ -48,7 +48,7 @@ public ResponseEntity> getClusters(
method = RequestMethod.GET,
produces = {MediaType.APPLICATION_JSON_VALUE})
public ResponseEntity> getClustersPaginated(
- @RequestParam(value = "clusterType") String clusterType,
+ @RequestParam(value = "clusterType") KafkaClustersType clusterType,
@RequestParam("pageNo") String pageNo,
@RequestParam(value = "clusterId", defaultValue = "") String clusterId,
@RequestParam(value = "searchClusterParam", defaultValue = "") String searchClusterParam) {
diff --git a/core/src/main/java/io/aiven/klaw/service/EnvsClustersTenantsControllerService.java b/core/src/main/java/io/aiven/klaw/service/EnvsClustersTenantsControllerService.java
index 5cc7a9c2b6..d26c118165 100644
--- a/core/src/main/java/io/aiven/klaw/service/EnvsClustersTenantsControllerService.java
+++ b/core/src/main/java/io/aiven/klaw/service/EnvsClustersTenantsControllerService.java
@@ -169,8 +169,10 @@ public List getClusters(String typeOfCluster) {
}
public List getClustersPaginated(
- String typeOfCluster, String clusterId, String pageNo, String searchClusterParam) {
- List kwClustersModelList = getClusters("all");
+ KafkaClustersType typeOfCluster, String clusterId, String pageNo, String searchClusterParam) {
+
+ String clusterTypeValue = typeOfCluster.value;
+ List kwClustersModelList = getClusters(clusterTypeValue);
if (clusterId != null && !clusterId.equals("")) {
kwClustersModelList =
diff --git a/core/src/main/resources/static/js/envs.js b/core/src/main/resources/static/js/envs.js
index c63da19a67..6a1728f0d0 100644
--- a/core/src/main/resources/static/js/envs.js
+++ b/core/src/main/resources/static/js/envs.js
@@ -4,6 +4,7 @@
// edit
// solution for transaction
// message store / key / gui
+
var app = angular.module('envsApp',[]);
app.directive('onReadFile', function ($parse) {
@@ -32,6 +33,14 @@ app.controller("envsCtrl", function($scope, $http, $location, $window) {
$scope.kafkaClusters = [ { label: 'Non-Aiven', value: 'nonaiven' }, { label: 'Aiven', value: 'aiven' } ];
+ $scope.kafkaFlavorToString = {
+ APACHE_KAFKA: "Apache Kafka",
+ AIVEN_FOR_APACHE_KAFKA: "Aiven for Apache Kafka",
+ CONFLUENT: "Confluent",
+ CONFLUENT_CLOUD: "Confluent Cloud",
+ OTHERS: "others",
+ };
+
// Set http service defaults
// We force the "Accept" header to be only "application/json"
// otherwise we risk the Accept header being set by default to:
@@ -238,9 +247,9 @@ app.controller("envsCtrl", function($scope, $http, $location, $window) {
method: "GET",
url: "getClustersPaginated",
headers : { 'Content-Type' : 'application/json' },
- params: {'clusterType' : 'all', 'clusterId' : $scope.clusterIdFromUrl,
+ params: {'clusterType' : 'ALL', 'clusterId' : $scope.clusterIdFromUrl,
'pageNo' : pageNo, 'searchClusterParam' : $scope.searchClusterParam},
- data: {'clusterType' : 'all'}
+ data: {'clusterType' : 'ALL'}
}).success(function(output) {
$scope.allclustersset = output;
if(output && output.length > 0 && output[0] != null){
diff --git a/core/src/main/resources/static/js/modifyEnvs.js b/core/src/main/resources/static/js/modifyEnvs.js
index e1e7111b55..e5009e6b5f 100644
--- a/core/src/main/resources/static/js/modifyEnvs.js
+++ b/core/src/main/resources/static/js/modifyEnvs.js
@@ -7,7 +7,15 @@
var app = angular.module('modifyEnvsApp',[]);
app.controller("modifyEnvsCtrl", function($scope, $http, $location, $window) {
-
+
+ $scope.kafkaFlavorToString = {
+ APACHE_KAFKA: "Apache Kafka",
+ AIVEN_FOR_APACHE_KAFKA: "Aiven for Apache Kafka",
+ CONFLUENT: "Confluent",
+ CONFLUENT_CLOUD: "Confluent Cloud",
+ OTHERS: "others",
+ };
+
// Set http service defaults
// We force the "Accept" header to be only "application/json"
// otherwise we risk the Accept header being set by default to:
diff --git a/core/src/main/resources/templates/clusters.html b/core/src/main/resources/templates/clusters.html
index dfbfb60d10..9682e05a31 100644
--- a/core/src/main/resources/templates/clusters.html
+++ b/core/src/main/resources/templates/clusters.html
@@ -518,16 +518,16 @@ Shortcuts
{{ allenv.protocol}} |
- {{ allenv.clusterType }} |
+ Kafka
- {{ allenv.clusterType }} |
+ Schema Registry
- {{ allenv.clusterType }} |
+ Kafka Connect
- {{ allenv.kafkaFlavor }} |
+ {{ kafkaFlavorToString[allenv.kafkaFlavor] }} |
{{ allenv.associatedServers }} |
diff --git a/core/src/main/resources/templates/modifyCluster.html b/core/src/main/resources/templates/modifyCluster.html
index 35b1a957d9..0477766927 100644
--- a/core/src/main/resources/templates/modifyCluster.html
+++ b/core/src/main/resources/templates/modifyCluster.html
@@ -525,8 +525,8 @@ Shortcuts
-
-
+
+
@@ -636,8 +636,8 @@ Shortcuts
-
-
+
+
@@ -712,8 +712,8 @@ Shortcuts
-
-
+
+
diff --git a/openapi.yaml b/openapi.yaml
index 2011e65c22..557b90a861 100644
--- a/openapi.yaml
+++ b/openapi.yaml
@@ -4827,7 +4827,8 @@
"in" : "query",
"required" : true,
"schema" : {
- "type" : "string"
+ "type" : "string",
+ "enum" : [ "ALL", "KAFKA", "SCHEMA_REGISTRY", "KAFKA_CONNECT" ]
}
}, {
"name" : "pageNo",